@ai-digital-factory/state-flow-observe
v0.1.2
Published
Dev-only Observe bridge and durable companion (observe and recover service-owned flow instances).
Readme
@ai-digital-factory/state-flow-observe
Durable companion
For the durable runtime (@ai-digital-factory/state-flow-runtime), start the companion against your runtime. It lists instances and shows each one's diagram, execution status, unresolved work and history. It is read-only unless you pass recovery.authorize, which is called for every manual recovery action:
import { startDurableCompanion } from "@ai-digital-factory/state-flow-observe";
const companion = await startDurableCompanion({
runtime,
modules: [visitorAccess],
recovery: {
// Called per action (resolve inputs or { action: "restart-recovery" }) after validation,
// with the credential typed on the page and the connection's headers (e.g. your session cookie).
authorize: ({ credential, headers, input }) =>
isOperator(credential, headers, input),
},
});
console.log(companion.url);See ADRs 0062, 0063 and 0076.
Companion wire messages are validated by shared Zod schemas before authorization or execution. Their TypeScript input types are inferred from the schemas. Invalid query fields, unexpected action fields, and malformed recovery targets are rejected before reaching the application authorization callback. Transition payload shape validation is owned by the durable runtime's compiled payload schemas.
Read-only tools receive runtime.inspector; recovery uses the separately exposed runtime.controls capability behind the companion's per-action authorization policy. The companion never writes SQLite directly.
License
Proprietary software. All third-party use requires prior written permission from [email protected]. See LICENSE.
