mayura 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/docs/README.md +17 -4
- package/docs/cli/init.md +15 -3
- package/docs/concepts/workflows.md +60 -1
- package/docs/guides/choosing-a-starter.md +80 -0
- package/docs/guides/durable-workflows.md +1 -1
- package/docs/guides/framework-starters.md +5 -1
- package/docs/guides/hono.md +94 -0
- package/docs/guides/nextjs.md +94 -0
- package/docs/guides/nuxt.md +94 -0
- package/docs/guides/rag-deployment.md +48 -0
- package/docs/guides/rag-modal-pinecone-starter.md +63 -0
- package/docs/guides/rag-production.md +48 -0
- package/docs/guides/rag-quickstart.md +119 -0
- package/docs/guides/rag.md +23 -3
- package/docs/guides/react-router.md +94 -0
- package/docs/guides/release-readiness.md +78 -55
- package/docs/guides/sveltekit.md +94 -0
- package/docs/guides/tanstack-start.md +94 -0
- package/docs/guides/workflow-composition.md +1 -1
- package/docs/integrations/reranker-cohere.md +1 -0
- package/docs/integrations/reranker-jina.md +1 -0
- package/docs/integrations/reranker-voyage.md +1 -0
- package/docs/integrations/vector-chroma.md +1 -0
- package/docs/integrations/vector-libsql.md +1 -0
- package/docs/integrations/vector-pgvector.md +1 -0
- package/docs/integrations/vector-pinecone.md +4 -1
- package/docs/integrations/vector-qdrant.md +1 -0
- package/docs/integrations/vector-weaviate.md +1 -0
- package/docs/introduction.md +5 -0
- package/docs/project/whats-new.md +70 -2
- package/docs/quickstart.md +5 -3
- package/lib/adapter-code-docker/image/Dockerfile +1 -1
- package/lib/adapter-code-docker/package.json +1 -1
- package/lib/adapter-code-quickjs/package.json +1 -1
- package/lib/adapter-mcp/package.json +1 -1
- package/lib/ag-ui/package.json +1 -1
- package/lib/artifacts/package.json +1 -1
- package/lib/auth/package.json +1 -1
- package/lib/authz/package.json +1 -1
- package/lib/browser/package.json +1 -1
- package/lib/cli/dist/index.d.ts +1 -1
- package/lib/cli/dist/index.d.ts.map +1 -1
- package/lib/cli/dist/index.js +63 -20
- package/lib/cli/dist/index.js.map +1 -1
- package/lib/cli/dist/interactive.js +2 -2
- package/lib/cli/dist/interactive.js.map +1 -1
- package/lib/cli/dist/operations.d.ts +1 -0
- package/lib/cli/dist/operations.d.ts.map +1 -1
- package/lib/cli/dist/operations.js +13 -5
- package/lib/cli/dist/operations.js.map +1 -1
- package/lib/cli/package.json +1 -1
- package/lib/cli/src/index.ts +51 -12
- package/lib/cli/src/interactive.ts +2 -2
- package/lib/cli/src/operations.ts +9 -5
- package/lib/cli/starter-assets/manifest.json +1 -0
- package/lib/cli/starters/hono/package.json +2 -2
- package/lib/cli/starters/rag-modal-pinecone/README.md +60 -0
- package/lib/cli/starters/rag-modal-pinecone/dot-env.example +23 -0
- package/lib/cli/starters/{event-automation → rag-modal-pinecone}/dot-gitignore +2 -4
- package/lib/cli/starters/rag-modal-pinecone/fixtures/on-call.md +4 -0
- package/lib/cli/starters/rag-modal-pinecone/mayura.project.json +13 -0
- package/lib/cli/starters/rag-modal-pinecone/modal-app.py +110 -0
- package/lib/cli/starters/rag-modal-pinecone/package.json +28 -0
- package/lib/cli/starters/rag-modal-pinecone/src/application.ts +148 -0
- package/lib/cli/starters/rag-modal-pinecone/src/cli.ts +78 -0
- package/lib/cli/starters/rag-modal-pinecone/src/hosted.ts +137 -0
- package/lib/cli/starters/rag-modal-pinecone/test/modal_worker_test.py +53 -0
- package/lib/cli/starters/rag-modal-pinecone/test/pipeline.test.ts +137 -0
- package/lib/cli/starters/{cli-agent → rag-modal-pinecone}/tsconfig.json +0 -1
- package/lib/client/dist/index.d.ts.map +1 -1
- package/lib/client/dist/index.js +12 -4
- package/lib/client/dist/index.js.map +1 -1
- package/lib/client/dist/workflow-limits.d.ts +6 -0
- package/lib/client/dist/workflow-limits.d.ts.map +1 -0
- package/lib/client/dist/workflow-limits.js +15 -0
- package/lib/client/dist/workflow-limits.js.map +1 -0
- package/lib/client/dist/workflows.d.ts +3 -0
- package/lib/client/dist/workflows.d.ts.map +1 -1
- package/lib/client/dist/workflows.js +15 -7
- package/lib/client/dist/workflows.js.map +1 -1
- package/lib/client/package.json +1 -1
- package/lib/client/src/index.ts +7 -4
- package/lib/client/src/workflow-limits.ts +12 -0
- package/lib/client/src/workflows.ts +12 -6
- package/lib/client-react/package.json +1 -1
- package/lib/code-mode/package.json +1 -1
- package/lib/code-mode-workflows/package.json +1 -1
- package/lib/context/package.json +1 -1
- package/lib/core/dist/host.d.ts +1 -0
- package/lib/core/dist/host.d.ts.map +1 -1
- package/lib/core/dist/host.js +1 -0
- package/lib/core/dist/host.js.map +1 -1
- package/lib/core/dist/index.d.ts +1 -0
- package/lib/core/dist/index.d.ts.map +1 -1
- package/lib/core/dist/index.js +1 -0
- package/lib/core/dist/index.js.map +1 -1
- package/lib/core/dist/workflow-environment.d.ts +9 -0
- package/lib/core/dist/workflow-environment.d.ts.map +1 -0
- package/lib/core/dist/workflow-environment.js +15 -0
- package/lib/core/dist/workflow-environment.js.map +1 -0
- package/lib/core/dist/workflow-limits.d.ts +7 -0
- package/lib/core/dist/workflow-limits.d.ts.map +1 -0
- package/lib/core/dist/workflow-limits.js +17 -0
- package/lib/core/dist/workflow-limits.js.map +1 -0
- package/lib/core/package.json +1 -1
- package/lib/core/src/host.ts +1 -0
- package/lib/core/src/index.ts +1 -0
- package/lib/core/src/workflow-environment.ts +15 -0
- package/lib/core/src/workflow-limits.ts +16 -0
- package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
- package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
- package/lib/exporter-otlp/dist/signals.js +2 -2
- package/lib/exporter-otlp/dist/signals.js.map +1 -1
- package/lib/exporter-otlp/package.json +1 -1
- package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
- package/lib/exporter-otlp/src/signals.ts +2 -2
- package/lib/files/package.json +1 -1
- package/lib/guardrails/package.json +1 -1
- package/lib/helpers/package.json +1 -1
- package/lib/keys/package.json +1 -1
- package/lib/memory/package.json +1 -1
- package/lib/memory-remote/package.json +1 -1
- package/lib/observability/package.json +1 -1
- package/lib/provider-anthropic/package.json +1 -1
- package/lib/provider-openai/package.json +1 -1
- package/lib/rag/dist/bm25.d.ts +13 -0
- package/lib/rag/dist/bm25.d.ts.map +1 -0
- package/lib/rag/dist/bm25.js +76 -0
- package/lib/rag/dist/bm25.js.map +1 -0
- package/lib/rag/dist/document-lexical.d.ts +7 -0
- package/lib/rag/dist/document-lexical.d.ts.map +1 -0
- package/lib/rag/dist/document-lexical.js +33 -0
- package/lib/rag/dist/document-lexical.js.map +1 -0
- package/lib/rag/dist/evidence-window.d.ts +15 -0
- package/lib/rag/dist/evidence-window.d.ts.map +1 -0
- package/lib/rag/dist/evidence-window.js +52 -0
- package/lib/rag/dist/evidence-window.js.map +1 -0
- package/lib/rag/dist/retrieval.d.ts +6 -0
- package/lib/rag/dist/retrieval.d.ts.map +1 -1
- package/lib/rag/dist/retrieval.js +60 -6
- package/lib/rag/dist/retrieval.js.map +1 -1
- package/lib/rag/dist/vectors.d.ts +8 -0
- package/lib/rag/dist/vectors.d.ts.map +1 -1
- package/lib/rag/dist/vectors.js +121 -4
- package/lib/rag/dist/vectors.js.map +1 -1
- package/lib/rag/package.json +1 -1
- package/lib/rag/src/bm25.ts +35 -0
- package/lib/rag/src/document-lexical.ts +17 -0
- package/lib/rag/src/evidence-window.ts +41 -0
- package/lib/rag/src/retrieval.ts +56 -7
- package/lib/rag/src/vectors.ts +62 -4
- package/lib/runtime/package.json +1 -1
- package/lib/sandbox/package.json +1 -1
- package/lib/sdk/package.json +1 -1
- package/lib/server/dist/index.d.ts +2 -0
- package/lib/server/dist/index.d.ts.map +1 -1
- package/lib/server/dist/index.js +12 -4
- package/lib/server/dist/index.js.map +1 -1
- package/lib/server/dist/inspector-bundle.d.ts +1 -1
- package/lib/server/dist/inspector-bundle.d.ts.map +1 -1
- package/lib/server/dist/inspector-bundle.js +4 -4
- package/lib/server/dist/inspector-bundle.js.map +1 -1
- package/lib/server/package.json +1 -1
- package/lib/server/src/index.ts +9 -4
- package/lib/server/src/inspector-bundle.ts +4 -4
- package/lib/server-node/package.json +1 -1
- package/lib/skills/package.json +1 -1
- package/lib/storage/package.json +1 -1
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +2 -0
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -1
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-format2.d.ts +2 -0
- package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-format2.js +8 -7
- package/lib/storage-contracts/dist/workflow-format2.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-format3.js +9 -7
- package/lib/storage-contracts/dist/workflow-format3.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-format4.d.ts +2 -0
- package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-format4.js +9 -8
- package/lib/storage-contracts/dist/workflow-format4.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-format5.d.ts +4 -0
- package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-format5.js +9 -8
- package/lib/storage-contracts/dist/workflow-format5.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +2 -0
- package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -1
- package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +2 -0
- package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -1
- package/lib/storage-contracts/dist/workflow-tree-contracts.js +5 -3
- package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -1
- package/lib/storage-contracts/package.json +1 -1
- package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +2 -0
- package/lib/storage-contracts/src/workflow-format2.ts +10 -7
- package/lib/storage-contracts/src/workflow-format3.ts +9 -7
- package/lib/storage-contracts/src/workflow-format4.ts +11 -8
- package/lib/storage-contracts/src/workflow-format5.ts +13 -8
- package/lib/storage-contracts/src/workflow-graph-contracts.ts +2 -0
- package/lib/storage-contracts/src/workflow-tree-contracts.ts +7 -3
- package/lib/storage-postgres/package.json +1 -1
- package/lib/storage-sql/dist/scheduled-database.js +1 -1
- package/lib/storage-sql/dist/scheduled-database.js.map +1 -1
- package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -1
- package/lib/storage-sql/dist/workflow-tree-database.js +37 -1
- package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -1
- package/lib/storage-sql/package.json +1 -1
- package/lib/storage-sql/src/scheduled-database.ts +1 -1
- package/lib/storage-sql/src/workflow-tree-database.ts +15 -1
- package/lib/storage-sqlite/package.json +1 -1
- package/lib/terminal/package.json +1 -1
- package/lib/testing/package.json +1 -1
- package/lib/threads/package.json +1 -1
- package/lib/tools/package.json +1 -1
- package/lib/voice/package.json +1 -1
- package/lib/workflows/dist/children-definition.d.ts +5 -1
- package/lib/workflows/dist/children-definition.d.ts.map +1 -1
- package/lib/workflows/dist/children-definition.js +6 -2
- package/lib/workflows/dist/children-definition.js.map +1 -1
- package/lib/workflows/dist/children-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/children-runtime.js +4 -3
- package/lib/workflows/dist/children-runtime.js.map +1 -1
- package/lib/workflows/dist/definition.d.ts +4 -0
- package/lib/workflows/dist/definition.d.ts.map +1 -1
- package/lib/workflows/dist/definition.js +6 -3
- package/lib/workflows/dist/definition.js.map +1 -1
- package/lib/workflows/dist/graph-definition.d.ts +5 -1
- package/lib/workflows/dist/graph-definition.d.ts.map +1 -1
- package/lib/workflows/dist/graph-definition.js +8 -4
- package/lib/workflows/dist/graph-definition.js.map +1 -1
- package/lib/workflows/dist/lifecycle-definition.d.ts +5 -1
- package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -1
- package/lib/workflows/dist/lifecycle-definition.js +5 -2
- package/lib/workflows/dist/lifecycle-definition.js.map +1 -1
- package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/lifecycle-runtime.js +4 -5
- package/lib/workflows/dist/lifecycle-runtime.js.map +1 -1
- package/lib/workflows/dist/node-batches.d.ts +9 -0
- package/lib/workflows/dist/node-batches.d.ts.map +1 -0
- package/lib/workflows/dist/node-batches.js +19 -0
- package/lib/workflows/dist/node-batches.js.map +1 -0
- package/lib/workflows/dist/operator-transports.d.ts +1 -0
- package/lib/workflows/dist/operator-transports.d.ts.map +1 -1
- package/lib/workflows/dist/operator-transports.js +1 -0
- package/lib/workflows/dist/operator-transports.js.map +1 -1
- package/lib/workflows/dist/runtime.d.ts.map +1 -1
- package/lib/workflows/dist/runtime.js +6 -7
- package/lib/workflows/dist/runtime.js.map +1 -1
- package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -1
- package/lib/workflows/dist/scheduled-helpers.js +3 -2
- package/lib/workflows/dist/scheduled-helpers.js.map +1 -1
- package/lib/workflows/dist/scheduled.d.ts.map +1 -1
- package/lib/workflows/dist/scheduled.js +2 -1
- package/lib/workflows/dist/scheduled.js.map +1 -1
- package/lib/workflows/package.json +1 -1
- package/lib/workflows/src/children-definition.ts +10 -3
- package/lib/workflows/src/children-runtime.ts +3 -2
- package/lib/workflows/src/definition.ts +9 -2
- package/lib/workflows/src/graph-definition.ts +10 -3
- package/lib/workflows/src/lifecycle-definition.ts +10 -3
- package/lib/workflows/src/lifecycle-runtime.ts +4 -4
- package/lib/workflows/src/node-batches.ts +21 -0
- package/lib/workflows/src/operator-transports.ts +3 -1
- package/lib/workflows/src/runtime.ts +6 -6
- package/lib/workflows/src/scheduled-helpers.ts +3 -2
- package/lib/workflows/src/scheduled.ts +2 -1
- package/lib/workstream/package.json +1 -1
- package/llms-full.txt +1442 -281
- package/llms.txt +17 -3
- package/package.json +4 -4
- package/lib/cli/starters/cli-agent/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/cli-agent/dot-gitignore +0 -10
- package/lib/cli/starters/event-automation/dot-dockerignore +0 -7
- package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/event-automation/src/model.ts +0 -40
- package/lib/cli/starters/event-automation/tsconfig.json +0 -20
- package/lib/cli/starters/nextjs/Dockerfile +0 -12
- package/lib/cli/starters/nextjs/compose.yaml +0 -19
- package/lib/cli/starters/nextjs/dot-dockerignore +0 -11
- package/lib/cli/starters/nextjs/dot-env.example +0 -7
- package/lib/cli/starters/nextjs/scripts/setup.mjs +0 -9
- package/lib/cli/starters/nextjs/server/application.mjs +0 -74
- package/lib/cli/starters/nextjs/server/auth.mjs +0 -24
- package/lib/cli/starters/nextjs/server/worker.mjs +0 -11
- package/lib/cli/starters/nextjs/server/workflows.mjs +0 -23
- package/lib/cli/starters/nextjs/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/nextjs/src/Notebook.jsx +0 -25
- package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/nextjs/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/nextjs/src/connect.js +0 -21
- package/lib/cli/starters/nextjs/src/session.js +0 -138
- package/lib/cli/starters/nextjs/src/style.css +0 -11
- package/lib/cli/starters/nextjs/test/server.test.mjs +0 -95
- package/lib/cli/starters/nextjs/test/session.test.mjs +0 -16
- package/lib/cli/starters/nuxt/compose.yaml +0 -19
- package/lib/cli/starters/nuxt/dot-dockerignore +0 -11
- package/lib/cli/starters/nuxt/dot-env.example +0 -7
- package/lib/cli/starters/nuxt/dot-gitignore +0 -14
- package/lib/cli/starters/nuxt/scripts/setup.mjs +0 -9
- package/lib/cli/starters/nuxt/server/application.mjs +0 -74
- package/lib/cli/starters/nuxt/server/auth.mjs +0 -24
- package/lib/cli/starters/nuxt/server/worker.mjs +0 -11
- package/lib/cli/starters/nuxt/server/workflows.mjs +0 -23
- package/lib/cli/starters/nuxt/src/connect.js +0 -21
- package/lib/cli/starters/nuxt/src/session.js +0 -138
- package/lib/cli/starters/nuxt/src/style.css +0 -11
- package/lib/cli/starters/nuxt/test/server.test.mjs +0 -95
- package/lib/cli/starters/nuxt/test/session.test.mjs +0 -16
- package/lib/cli/starters/react-router/Dockerfile +0 -12
- package/lib/cli/starters/react-router/compose.yaml +0 -19
- package/lib/cli/starters/react-router/dot-dockerignore +0 -11
- package/lib/cli/starters/react-router/dot-env.example +0 -7
- package/lib/cli/starters/react-router/dot-gitignore +0 -14
- package/lib/cli/starters/react-router/scripts/setup.mjs +0 -9
- package/lib/cli/starters/react-router/server/application.mjs +0 -74
- package/lib/cli/starters/react-router/server/auth.mjs +0 -24
- package/lib/cli/starters/react-router/server/worker.mjs +0 -11
- package/lib/cli/starters/react-router/server/workflows.mjs +0 -23
- package/lib/cli/starters/react-router/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/react-router/src/Notebook.jsx +0 -25
- package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/react-router/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/react-router/src/connect.js +0 -21
- package/lib/cli/starters/react-router/src/session.js +0 -138
- package/lib/cli/starters/react-router/src/style.css +0 -11
- package/lib/cli/starters/react-router/src/vite-env.d.ts +0 -1
- package/lib/cli/starters/react-router/test/server.test.mjs +0 -95
- package/lib/cli/starters/react-router/test/session.test.mjs +0 -16
- package/lib/cli/starters/research-team/dot-dockerignore +0 -7
- package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/research-team/dot-gitignore +0 -10
- package/lib/cli/starters/research-team/src/model.ts +0 -40
- package/lib/cli/starters/research-team/tsconfig.json +0 -20
- package/lib/cli/starters/support-agent/dot-dockerignore +0 -7
- package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/support-agent/dot-gitignore +0 -10
- package/lib/cli/starters/support-agent/src/model.ts +0 -40
- package/lib/cli/starters/support-agent/tsconfig.json +0 -20
- package/lib/cli/starters/sveltekit/Dockerfile +0 -12
- package/lib/cli/starters/sveltekit/compose.yaml +0 -19
- package/lib/cli/starters/sveltekit/dot-dockerignore +0 -11
- package/lib/cli/starters/sveltekit/dot-env.example +0 -7
- package/lib/cli/starters/sveltekit/dot-gitignore +0 -14
- package/lib/cli/starters/sveltekit/scripts/setup.mjs +0 -9
- package/lib/cli/starters/sveltekit/server/application.mjs +0 -74
- package/lib/cli/starters/sveltekit/server/auth.mjs +0 -24
- package/lib/cli/starters/sveltekit/server/worker.mjs +0 -11
- package/lib/cli/starters/sveltekit/server/workflows.mjs +0 -23
- package/lib/cli/starters/sveltekit/src/connect.js +0 -21
- package/lib/cli/starters/sveltekit/src/session.js +0 -138
- package/lib/cli/starters/sveltekit/src/style.css +0 -11
- package/lib/cli/starters/sveltekit/src/view.js +0 -49
- package/lib/cli/starters/sveltekit/test/server.test.mjs +0 -95
- package/lib/cli/starters/sveltekit/test/session.test.mjs +0 -16
- package/lib/cli/starters/tanstack-start/Dockerfile +0 -12
- package/lib/cli/starters/tanstack-start/compose.yaml +0 -19
- package/lib/cli/starters/tanstack-start/dot-dockerignore +0 -11
- package/lib/cli/starters/tanstack-start/dot-env.example +0 -7
- package/lib/cli/starters/tanstack-start/dot-gitignore +0 -14
- package/lib/cli/starters/tanstack-start/scripts/setup.mjs +0 -9
- package/lib/cli/starters/tanstack-start/server/application.mjs +0 -74
- package/lib/cli/starters/tanstack-start/server/auth.mjs +0 -24
- package/lib/cli/starters/tanstack-start/server/worker.mjs +0 -11
- package/lib/cli/starters/tanstack-start/server/workflows.mjs +0 -23
- package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/tanstack-start/src/Notebook.jsx +0 -25
- package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/tanstack-start/src/connect.js +0 -21
- package/lib/cli/starters/tanstack-start/src/session.js +0 -138
- package/lib/cli/starters/tanstack-start/src/style.css +0 -11
- package/lib/cli/starters/tanstack-start/test/server.test.mjs +0 -95
- package/lib/cli/starters/tanstack-start/test/session.test.mjs +0 -16
- /package/lib/cli/{starters/hono/src/components/mayura/ui.css → starter-assets/011cacc77ada0de5b447674e9fc4374a247b9a46eb169722b12649753f24188f} +0 -0
- /package/lib/cli/{starters/hono/test/server.test.mjs → starter-assets/0c825d6a776673ec6274cfc29cd45b1a8c56dcb880c291a91075c77e1ef1e4f3} +0 -0
- /package/lib/cli/{starters/hono/server/auth.mjs → starter-assets/0dd570bfacc357d23be3340250090b9a4c6193a49cdd02e9b6789e7bee8433dd} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/approval.tsx → starter-assets/11292bd14cdaf27a8f8317ba4ab768d706a726b2e26474b599f3db116674b4b3} +0 -0
- /package/lib/cli/{starters/nextjs/dot-gitignore → starter-assets/1873b02e070347f9a449e07084242982fa6af412c45aa764985d553975b64589} +0 -0
- /package/lib/cli/{starters/hono/src/style.css → starter-assets/2f3869e6d69134e43be713c4590bfe48896a5c54ece6ffc1a4f204cfcfe54218} +0 -0
- /package/lib/cli/{starters/hono/server/worker.mjs → starter-assets/350d77757f548369beff29d658cf1620752d4e23b4b732d99a1b403ca043137f} +0 -0
- /package/lib/cli/{starters/approval-workflow/src/model.ts → starter-assets/37294d24c04b71eaf6d6f0bd52fd4c1cc7a5d3cb63da9c7920ed1d44276da9cb} +0 -0
- /package/lib/cli/{starters/approval-workflow/tsconfig.json → starter-assets/4387d6537dd5924ae62326aa3d7d8cbad1e5abd930aecc9daa6fab1ac2f6ef24} +0 -0
- /package/lib/cli/{starters/hono/dot-dockerignore → starter-assets/4434be031b58cc6ee680b2860b2ad1fe4089af7ee866c13223dfb621dd042ff1} +0 -0
- /package/lib/cli/{starters/hono/src/ChatApp.jsx → starter-assets/46e199317648a076243d6c8e7ffedc48785a6ffc0f203b88c7c4a9479b34c5b9} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/thread-history.tsx → starter-assets/4741fccbca2e0d2fc6f61d11af3cf7bcc5f0238b67bb46282287207abdc6c536} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-dockerignore → starter-assets/4be664708b0120da5d2b73c5a27968093da06b8728f88f2bda2a1ccbf40f6891} +0 -0
- /package/lib/cli/{starters/hono/server/workflows.mjs → starter-assets/4d11f729672df54969a851494877a3c5aee24bb8f8c68eacaaa22e715bf5ed69} +0 -0
- /package/lib/cli/{starters/hono/dot-env.example → starter-assets/4f141323062660c4dc5b563300d57bb4cdbdc7fe9bfba96e43d9c64bb274474e} +0 -0
- /package/lib/cli/{starters/hono/Dockerfile → starter-assets/5471b74c46258d1edb00eb8f60f4219c389a252f7e224f2692f8f3e71ae43e3e} +0 -0
- /package/lib/cli/{starters/hono/scripts/setup.mjs → starter-assets/56e2d6db9fe4b0449c979acd06947a5b776bcc645184b54b8d3654a48bd12c38} +0 -0
- /package/lib/cli/{starters/hono/src/Notebook.jsx → starter-assets/6138d1e2ca4469daf4f5545d140943f6e23b0c37f865051b266ec99695cf181a} +0 -0
- /package/lib/cli/{starters/hono/src/vite-env.d.ts → starter-assets/65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5} +0 -0
- /package/lib/cli/{starters/hono/server/application.mjs → starter-assets/757f43c27415654049ecf01b67d560c83d788108d1aebcf1f16a86d956bd7fb6} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/thread-list.tsx → starter-assets/97601d0bf331df7bbde88f7ee269610bc8a1239f8eeb58fded6416e588a5b7dd} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-github/workflows/ci.yml → starter-assets/aa4182c76778ba2194ecbfde9a960c20181534fd1ab484df126278dbc6eb0186} +0 -0
- /package/lib/cli/{starters/hono/src/session.js → starter-assets/abcc6ebd29ba47a079befb6568054dec8f43d4c729187e4a3610af39789e77be} +0 -0
- /package/lib/cli/{starters/hono/compose.yaml → starter-assets/cc1df6f5ce0eebffc567ecea1d599eba97cd1b94ab01551085c0eb87a28e3a6c} +0 -0
- /package/lib/cli/{starters/hono/src/connect.js → starter-assets/cd3ddb959b277e7d495cc020a6f8146acfbcc9d05ececa3809e8aafcf84504d9} +0 -0
- /package/lib/cli/{starters/hono/test/session.test.mjs → starter-assets/dfe75fd07538427d80ba76767e037e929664c80ff5a41b7544496a789181bb73} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-gitignore → starter-assets/f3ef7285253ec9668732f535306beee602e91cb6e20f83d4799b3323399ce569} +0 -0
- /package/lib/cli/{starters/nuxt/src/view.js → starter-assets/ff840fe960683d377e78f731b5d4318adf6050384791fa20e4948d34192aa35d} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"children-runtime.js","sourceRoot":"","sources":["../src/children-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAqG,MAAM,cAAc,CAAC;AAC9M,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAuD,MAAM,YAAY,CAAC;AAC1G,OAAO,EACL,YAAY,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,iBAAiB,GAElF,MA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D,CAAC;QACrI,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,EAAE,IAAE,MAAM,aAAa,CAAC,EAAE,CAAC,CAAC,CAAA,OAAO,cAAc,CAAC,CAAC,MAAM,IAAI,CAAC,GAAE,EAAE,CAAA,GAAG,CAAC,cAAc,CAAC,EAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAC,KAAK,EAAC,GAAG,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA,CAAC;QAC9I,KAAK,CAAC,MAAM,CAAC,EAAE,EAAC,KAAK,GAAC,CAAC,IAAE,IAAI,EAAE,CAAC,CAAA,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA,IAAG,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAE,KAAK,GAAC,CAAC;YAAC,MAAM,IAAI,WAAW,CAAC,eAAe,EAAC,0CAA0C,CAAC,CAAC,CAAA,MAAM,aAAa,CAAC,EAAE,CAAC,CAAC,CAAA,OAAO,IAAI,CAAC,GAAE,EAAE,CAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAC,EAAE,EAAC,KAAK,CAAC,CAAC,CAAC,CAAA,CAAC;QACxP,KAAK,EAAC,YAAY;QAClB,KAAK,CAAC,OAAO,IAAE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAC,YAAY,CAAC,CAAC,CAAA,CAAC;KACzD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { workflowAuthorization } from './authorization.js';\nimport type { Authorizer } from '@mayura/core';\nimport { Budget, MayuraError, assertPositiveInteger, freezeJson, jsonValue, validate, type ExecutionReceipt, type InferInput, type JsonValue, type Permissions, type Schema, type Scope } from '@mayura/core';\nimport { invokeTool } from '@mayura/tools';\nimport { createWorkflowDrainGate, type WorkflowDrainOptions, type WorkflowDrainReport } from './drain.js';\nimport {\n StorageError, initialWorkflowTreeRootState, workflowTreePolicy, workflowTreeState,\n type Claim, type StoredRecord, type WorkflowTreeAggregateStore, type WorkflowTreeRootSnapshot as StoredTreeSnapshot, type WorkflowTreeStore,\n} from '@mayura/storage-contracts';\nimport { assertWorkflow, digest, resolveBinding, type WorkflowNode } from './definition.js';\nimport { assertMigrationAllowed, assertWorkflowMigration, migrationCommand, nodeEvidence, nodeFingerprint, planWorkflowMigration,\n type MigrationBlocker, type MigrationCommand, type WorkflowMigration, type WorkflowMigrationResult } from './migration.js';\nimport { assertWorkflowTree, treeManifest, type AnyWorkflowTree, type WorkflowTreeDefinition } from './children-definition.js';\nimport type { VerifiedHuman } from './runtime.js';\n\nexport interface WorkflowTreeRuntimeOptions {\n readonly store:WorkflowTreeAggregateStore;readonly scope:Scope;readonly permissions:Permissions;readonly policyVersion:string;\n /** Host-owned core authorizer; decisions and audit delivery use its existing limits and lifecycle. */\n readonly authorization?: Authorizer;\n readonly maxCostMicros:number;readonly maxCalls:number;readonly workerId:string;readonly leaseMs?:number;\n readonly maxConcurrentJobs?:number;readonly maxConcurrentRuns?:number;\n readonly maxOutputBytes?:number;readonly approvalTtlMs?:number;readonly storageTimeoutMs?:number;\n readonly verifyHuman?:(credential:unknown)=>Promise<VerifiedHuman>;\n}\nexport interface WorkflowTreeSnapshot {\n readonly id:string;readonly version:number;readonly status:ReturnType<typeof workflowTreeState>['status'];\n readonly steps:ReturnType<typeof workflowTreeState>['steps'];readonly output:JsonValue;\n readonly budget:StoredTreeSnapshot['budget'];\n}\nexport interface WorkflowTreeChildSnapshot {readonly id:string;readonly version:number;readonly status:ReturnType<typeof workflowTreeState>['status'];readonly steps:ReturnType<typeof workflowTreeState>['steps'];readonly output:JsonValue;}\nexport interface WorkflowTreeRuntime {\n readonly profile:'scheduled-v3';\n submit<I extends Schema,O extends Schema>(definition:WorkflowTreeDefinition<I,O>,command:{readonly input:InferInput<I>;readonly idempotencyKey:string}):Promise<WorkflowTreeSnapshot>;\n inspect(id:string):Promise<WorkflowTreeSnapshot>;\n inspectChild(id:string,childId:string):Promise<WorkflowTreeChildSnapshot>;\n runUntilSettled(definition:AnyWorkflowTree,id:string):Promise<WorkflowTreeSnapshot>;\n approve(command:{readonly id:string;readonly childId?:string;readonly nodeId:string;readonly digest:string;readonly credential:unknown}):Promise<WorkflowTreeSnapshot>;\n cancel(id:string):Promise<WorkflowTreeSnapshot>;\n /** Persist a tree-wide quiescent pause; claimed or in-flight root or child effects must settle or be recovered first. */\n pause(id:string):Promise<WorkflowTreeSnapshot>;\n /** Resume scheduling only; unresolved approvals and child waits remain unresolved. */\n resume(id:string):Promise<WorkflowTreeSnapshot>;\n /**\n * Plan (dryRun) or apply a reviewed migration of a paused tree. Root steps with a prepared job and child steps with an\n * admitted child keep their exact definition; everything else follows the plan. The tree stays paused.\n */\n migrate(migration:WorkflowMigration<AnyWorkflowTree,AnyWorkflowTree>,command:MigrationCommand):Promise<WorkflowMigrationResult<WorkflowTreeSnapshot>>;\n recoverExpired(id:string):Promise<WorkflowTreeSnapshot>;\n events(id:string,after?:number):ReturnType<WorkflowTreeAggregateStore['events']>;\n close():Promise<void>;\n /** Admit no new wave, let admitted root/child effects and receipts settle within the deadline, then close. */\n drain(options?:WorkflowDrainOptions):Promise<WorkflowDrainReport>;\n}\n\nconst terminal=new Set(['succeeded','failed','blocked','cancelled','outcome_unknown']);\nconst methods=(['initialize','submit','inspect','requestRootApproval','approveRootTool','prepareRootTool','claimPreparedRootTool','renewClaimedRootTool','startClaimedRootTool','recordRootToolReceipt','completeRootTool','inspectChild','admitChild','requestChildApproval','approveChildTool','prepareChildTool','claimPreparedChildTool','renewClaimedChildTool','startClaimedChildTool','recordChildToolReceipt','completeChildTool','finalizeChild','joinChild','finalizeRoot','cancelChild','cancelRoot','recoverExpired'] as const) satisfies readonly (keyof WorkflowTreeStore)[];\n\nasync function bounded<T>(operation:()=>Promise<T>,timeoutMs:number):Promise<T>{let timer:ReturnType<typeof setTimeout>|undefined;try{return await Promise.race([Promise.resolve().then(operation),new Promise<never>((_resolve,reject)=>{timer=setTimeout(()=>reject(new MayuraError('TIMEOUT','Workflow-tree validation or storage operation timed out.')),timeoutMs);})]);}finally{if(timer)clearTimeout(timer);}}\nfunction safe(value:unknown,maxBytes:number,label:string):JsonValue{try{return jsonValue(value,{maxBytes});}catch{throw new MayuraError('INVALID_INPUT',`Workflow-tree ${label} exceeds its bounded JSON contract.`);}}\nfunction outputs(record:StoredRecord):Record<string,JsonValue>{const state=workflowTreeState(record);return Object.fromEntries(Object.entries(state.steps).filter(([,step])=>step.status==='succeeded').map(([id,step])=>[id,step.output]));}\nfunction publicSnapshot(value:StoredTreeSnapshot):WorkflowTreeSnapshot{const state=workflowTreeState(value.record);return freezeJson(jsonValue({id:value.rootId,version:value.record.version,status:state.status,steps:state.steps,output:state.output,budget:value.budget})) as unknown as WorkflowTreeSnapshot;}\nfunction publicChild(record:StoredRecord):WorkflowTreeChildSnapshot{const state=workflowTreeState(record);return freezeJson(jsonValue({id:record.id,version:record.version,status:state.status,steps:state.steps,output:state.output})) as unknown as WorkflowTreeChildSnapshot;}\nfunction storageFailure(error:unknown):never{if(error instanceof StorageError&&['CONFLICT','NOT_FOUND','STALE_CLAIM','LIMIT_EXCEEDED'].includes(error.storageCode))throw error;throw new MayuraError('STORAGE_UNAVAILABLE','Workflow-tree storage is unavailable; reconcile uncertain actions before retrying.');}\n\n/** Finite format-4 driver for root-local tools and one-level required children. */\nexport function createWorkflowTreeRuntime(options:WorkflowTreeRuntimeOptions):WorkflowTreeRuntime{\n let api:WorkflowTreeStore;try{if(!options.store?.workflowTrees||methods.some(method=>typeof options.store.workflowTrees[method]!=='function'))throw new Error();api=Object.freeze(Object.fromEntries(methods.map(method=>[method,options.store.workflowTrees[method].bind(options.store.workflowTrees)]))) as unknown as WorkflowTreeStore;}catch{throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide the optional workflow-tree capability.');}\n // Optional pause controls: custom adapters without them keep working until pause is requested.\n const trees=options.store.workflowTrees;const controls={pauseRoot:typeof trees.pauseRoot==='function'?trees.pauseRoot.bind(trees):undefined,resumeRoot:typeof trees.resumeRoot==='function'?trees.resumeRoot.bind(trees):undefined,migrateRoot:typeof trees.migrateRoot==='function'?trees.migrateRoot.bind(trees):undefined};\n const authority=workflowTreePolicy({scope:options.scope,permissions:options.permissions?.allow,policyVersion:options.policyVersion,maxCostMicros:options.maxCostMicros,maxCalls:options.maxCalls,maxOutputBytes:options.maxOutputBytes??65_536,approvalTtlMs:options.approvalTtlMs??3_600_000});\n if(typeof options.workerId!=='string'||!/^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/.test(options.workerId))throw new MayuraError('INVALID_CONFIG','A bounded workflow-tree worker identity is required.');const leaseMs=options.leaseMs??3_000;const timeoutMs=options.storageTimeoutMs??10_000;const maxConcurrentJobs=options.maxConcurrentJobs??4;const maxConcurrentRuns=options.maxConcurrentRuns??16;for(const [name,value] of Object.entries({leaseMs,timeoutMs,maxConcurrentJobs,maxConcurrentRuns}))assertPositiveInteger(value,name);if(leaseMs<1_000||leaseMs>300_000||timeoutMs>30_000||maxConcurrentJobs>32||maxConcurrentRuns>128)throw new MayuraError('INVALID_CONFIG','Workflow-tree worker limits exceed supported bounds.');\n const auth = workflowAuthorization(options.authorization, authority.scope);\n const scopeKey=digest('mayura:scope:v1',authority.scope);const policyHash=digest('mayura:workflow-tree-policy:v1',authority);let initialized:Promise<void>|undefined;let closed=false;let closing:Promise<void>|undefined;let slots=0;const active=new Map<string,AbortController>();const runs=new Map<string,{definition:AnyWorkflowTree;operation:Promise<WorkflowTreeSnapshot>}>();const pendingExecutions=new Set<Promise<void>>();const gate=createWorkflowDrainGate();\n const open=():void=>{if(closed)throw new MayuraError('CANCELLED','Workflow-tree runtime is closed.');};const initialize=()=>initialized??=(async()=>{try{await bounded(()=>api.initialize(),timeoutMs);}catch(error){storageFailure(error);}})();const access=(id:string)=>{if(typeof id!=='string'||!/^[a-f0-9]{64}$/.test(id))throw new MayuraError('INVALID_INPUT','Workflow-tree run ID must be an exact hash.');return{scope:scopeKey,rootId:id,rootPolicyHash:policyHash};};\n const call=async<T>(operation:()=>Promise<T>):Promise<T>=>{try{return await bounded(operation,timeoutMs);}catch(error){return storageFailure(error);}};\n const inspectStored=async(id:string):Promise<StoredTreeSnapshot>=>{open();await initialize();const value=await call(()=>api.inspect(access(id)));if(!value)throw new MayuraError('NOT_FOUND','Workflow tree was not found in this scope.');if(value.rootId!==id||value.record.scope!==scopeKey||value.policyHash!==policyHash)throw new MayuraError('CONFLICT','Stored workflow-tree identity does not match this runtime.');workflowTreeState(value.record);return value;};\n const supported=(definition:AnyWorkflowTree):void=>{assertWorkflowTree(definition);for(const child of definition.nodes.filter(node=>node.kind==='child'))assertWorkflow(child.workflow);};\n const matchRoot=(definition:AnyWorkflowTree,root:StoredTreeSnapshot):void=>{if(root.manifestHash!==definition.digest||workflowTreeState(root.record).definition!==definition.digest)throw new MayuraError('CONFLICT','Stored workflow tree uses a different genuine definition.');};\n const receiptId=(jobId:string,fence:number,receipt:ExecutionReceipt)=>digest('mayura:workflow-tree-receipt:v1',{jobId,fence,receipt});\n const reserveJobSlot=()=>{if(slots>=maxConcurrentJobs)return undefined;slots++;let resolveDrain!:()=>void;const drain=new Promise<void>(resolve=>{resolveDrain=resolve;});pendingExecutions.add(drain);let acquired=false;let handlerSettled=false;let logicalSettled=false;let released=false;const release=()=>{if(!released&&logicalSettled&&(!acquired||handlerSettled)){released=true;slots--;pendingExecutions.delete(drain);resolveDrain();}};return{acquire:async(signal:AbortSignal)=>{signal.throwIfAborted();acquired=true;return()=>{handlerSettled=true;release();};},logical:()=>{logicalSettled=true;release();}};};\n\n async function executeRootTool(rootId:string,node:Extract<WorkflowNode,{kind:'tool'}>,record:StoredRecord,raw:JsonValue):Promise<{operation:()=>Promise<void>}|undefined>{\n await auth.execute(record.definitionHash, rootId);\n await auth.require('tool', node.tool.id, 'execute');\n const capacity=reserveJobSlot();if(!capacity)return undefined;const base={...access(rootId),nodeId:node.id};try{try{await call(()=>api.prepareRootTool({...base,expectedVersion:record.version,input:raw}));}catch(error){if(error instanceof StorageError&&error.storageCode==='CONFLICT'){capacity.logical();return undefined;}throw error;}const claimed=await call(()=>api.claimPreparedRootTool({...base,workerId:options.workerId,leaseMs}));if(!claimed){capacity.logical();return undefined;}const operation=async()=>{if(closed){capacity.logical();return;}let token:Claim=claimed.claim;let renewal:ReturnType<typeof setTimeout>|undefined;let renewing:Promise<void>|undefined;let finished=false;const controller=new AbortController();active.set(claimed.job.jobId,controller);\n const schedule=()=>{if(finished||controller.signal.aborted)return;renewal=setTimeout(()=>{renewing=call(()=>api.renewClaimedRootTool({...base,claim:token,leaseMs})).then(result=>{token=result.claim;schedule();}).catch(()=>controller.abort());},Math.max(100,Math.floor(leaseMs/3)));};const stop=async()=>{finished=true;if(renewal)clearTimeout(renewal);await renewing;};let evidenceId:string|undefined;\n try{const result=await invokeTool(node.tool,raw,{runId:rootId,callId:`${rootId}/step:${node.id}`,scope:authority.scope,...auth.toolContext(record.definitionHash,rootId),permissions:Object.freeze({allow:authority.permissions}),signal:controller.signal,budget:new Budget(node.tool.costMicros,1),maxOutputBytes:authority.maxOutputBytes,acquireExecution:capacity.acquire,beforeDispatch:async input=>{await auth.execute(record.definitionHash,rootId,controller.signal);for(let attempt=0;attempt<32;attempt++){const current=await inspectStored(rootId);try{const started=await call(()=>api.startClaimedRootTool({...base,expectedVersion:current.record.version,claim:token,input}));if(started.status!=='started')throw new MayuraError('CONFLICT','The root claim does not grant a fresh dispatch.');schedule();return;}catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}throw new MayuraError('CONFLICT','Root start contention exceeded its bounded retry limit.');},onExecutionReceipt:async receipt=>{const withheld=Object.freeze({...receipt,disclosure:'withheld' as const});const currentEvidence=receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordRootToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));}});if(!result.receipt)return;const withheld=Object.freeze({...result.receipt,disclosure:'withheld' as const});const currentEvidence=evidenceId??receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordRootToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));if(withheld.execution==='unknown')return;await stop();const outcome=result.status==='succeeded'?'succeeded':withheld.execution==='failed'?'failed':'blocked';await call(()=>api.completeRootTool({...base,claim:token,commandId:crypto.randomUUID(),evidenceId:currentEvidence,outcome,output:result.status==='succeeded'?safe(result.output,authority.maxOutputBytes,'tool output'):null}));}catch(error){if(!(error instanceof StorageError&&['STALE_CLAIM','CONFLICT'].includes(error.code)))throw error;}finally{await stop();active.delete(claimed.job.jobId);capacity.logical();}\n };return{operation};}catch(error){capacity.logical();throw error;}\n }\n\n async function executeTool(rootId:string,childId:string,childPolicyHash:string,childPermissions:readonly string[],maxOutputBytes:number,node:Extract<WorkflowNode,{kind:'tool'}>,record:StoredRecord,raw:JsonValue):Promise<{operation:()=>Promise<void>}|undefined>{\n await auth.execute(record.definitionHash, childId);\n await auth.require('workflow', record.definitionHash, 'delegate');\n await auth.require('tool', node.tool.id, 'execute');\n const capacity=reserveJobSlot();if(!capacity)return undefined;const base={...access(rootId),childId,childPolicyHash,nodeId:node.id};try{try{await call(()=>api.prepareChildTool({...base,expectedVersion:record.version,input:raw}));}catch(error){if(error instanceof StorageError&&error.storageCode==='CONFLICT'){capacity.logical();return undefined;}throw error;}const claimed=await call(()=>api.claimPreparedChildTool({...base,workerId:options.workerId,leaseMs}));if(!claimed){capacity.logical();return undefined;}const operation=async()=>{if(closed){capacity.logical();return;}let token:Claim=claimed.claim;let renewal:ReturnType<typeof setTimeout>|undefined;let renewing:Promise<void>|undefined;let finished=false;const controller=new AbortController();active.set(claimed.job.jobId,controller);\n const schedule=()=>{if(finished||controller.signal.aborted)return;renewal=setTimeout(()=>{renewing=call(()=>api.renewClaimedChildTool({...base,claim:token,leaseMs})).then(result=>{token=result.claim;schedule();}).catch(()=>controller.abort());},Math.max(100,Math.floor(leaseMs/3)));};const stop=async()=>{finished=true;if(renewal)clearTimeout(renewal);await renewing;};let evidenceId:string|undefined;\n try{const result=await invokeTool(node.tool,raw,{runId:childId,callId:`${childId}/step:${node.id}`,scope:authority.scope,...auth.toolContext(record.definitionHash,childId,async signal=>{const root=await inspectStored(rootId);await auth.execute(root.record.definitionHash,rootId,signal);await auth.require('workflow',record.definitionHash,'delegate',signal);}),permissions:Object.freeze({allow:childPermissions}),signal:controller.signal,budget:new Budget(node.tool.costMicros,1),maxOutputBytes,acquireExecution:capacity.acquire,beforeDispatch:async input=>{await auth.execute(record.definitionHash,childId,controller.signal);await auth.require('workflow',record.definitionHash,'delegate',controller.signal);const root=await inspectStored(rootId);await auth.execute(root.record.definitionHash,rootId,controller.signal);for(let attempt=0;attempt<32;attempt++){const current=await call(()=>api.inspectChild({...access(rootId),childId,childPolicyHash}));try{const started=await call(()=>api.startClaimedChildTool({...base,expectedVersion:current.member.version,claim:token,input}));if(started.status!=='started')throw new MayuraError('CONFLICT','The child claim does not grant a fresh dispatch.');schedule();return;}catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}throw new MayuraError('CONFLICT','Child start contention exceeded its bounded retry limit.');},onExecutionReceipt:async receipt=>{const withheld=Object.freeze({...receipt,disclosure:'withheld' as const});const currentEvidence=receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordChildToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));}});if(!result.receipt)return;const withheld=Object.freeze({...result.receipt,disclosure:'withheld' as const});const currentEvidence=evidenceId??receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordChildToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));if(withheld.execution==='unknown')return;await stop();const outcome=result.status==='succeeded'?'succeeded':withheld.execution==='failed'?'failed':'blocked';await call(()=>api.completeChildTool({...base,claim:token,commandId:crypto.randomUUID(),evidenceId:currentEvidence,outcome,output:result.status==='succeeded'?safe(result.output,maxOutputBytes,'tool output'):null}));}catch(error){if(!(error instanceof StorageError&&['STALE_CLAIM','CONFLICT'].includes(error.code)))throw error;}finally{await stop();active.delete(claimed.job.jobId);capacity.logical();}\n };return{operation};}catch(error){capacity.logical();throw error;}\n }\n\n async function drive(definition:AnyWorkflowTree,id:string):Promise<WorkflowTreeSnapshot>{\n const checkedSnapshot = async (record: StoredTreeSnapshot) => { await auth.execute(definition.digest, id); return publicSnapshot(record); };\n\n const rootNodes=definition.nodes.filter((node):node is Extract<WorkflowNode,{kind:'tool'}>=>node.kind==='tool');const childNodes=definition.nodes.filter(node=>node.kind==='child');for(let wave=0;wave<256;wave++){open();await auth.execute(definition.digest,id);let root=await inspectStored(id);matchRoot(definition,root);let rootState=workflowTreeState(root.record);if(rootState.status==='paused')return checkedSnapshot(root);if(terminal.has(rootState.status)){if(rootState.status!=='succeeded'&&!root.budget.accounts.find(account=>account.id==='root')?.closed)root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}const release=gate.enter();if(!release)return checkedSnapshot(root);try{let progress=false;const operations:(()=>Promise<void>)[]=[];let dispatched=false;try{const recovery=await call(()=>api.recoverExpired({...access(id),limit:128}));if(recovery.jobs.length){root=recovery.root;rootState=workflowTreeState(root.record);progress=true;}if(rootState.status==='paused')return checkedSnapshot(root);\n for(const node of rootNodes){root=await inspectStored(id);rootState=workflowTreeState(root.record);const step=rootState.steps[node.id];if(!step||terminal.has(rootState.status)||!['pending','waiting','approved'].includes(step.status)||node.dependsOn?.some(dependency=>rootState.steps[dependency]?.status!=='succeeded'))continue;const required=[`tool:${node.tool.id}`,...node.tool.capabilities,...(node.tool.effects==='none'?[]:[`effect:${node.tool.effects}`])];if(required.some(grant=>!authority.permissions.includes(grant))){root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);await auth.require('tool',node.tool.id,'execute');let input:JsonValue;try{const raw=resolveBinding(node.input,rootState.input,outputs(root.record));input=safe(await validate(node.tool.input,raw,'input',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'tool input');}catch{root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);await auth.require('tool',node.tool.id,'execute');if(node.approval){const previousVersion=root.record.version;root=await call(()=>api.requestRootApproval({...access(id),nodeId:node.id,expectedVersion:previousVersion,input}));rootState=workflowTreeState(root.record);progress=root.record.version!==previousVersion||progress;if(rootState.steps[node.id]?.status!=='approved')continue;}const scheduled=await executeRootTool(id,node,root.record,input);if(scheduled){operations.push(scheduled.operation);progress=true;}}\n for(const childNode of childNodes){root=await inspectStored(id);rootState=workflowTreeState(root.record);const rootStep=rootState.steps[childNode.id];if(!rootStep||terminal.has(rootState.status))break;if(!rootStep.child&&childNode.dependsOn?.some(dependency=>rootState.steps[dependency]?.status!=='succeeded'))continue;await auth.execute(definition.digest,id);await auth.require('workflow',childNode.workflow.digest,'delegate');const expectedChildId=rootStep.child?.runId??digest('mayura:workflow-tree-child-run:v1',{scope:scopeKey,rootId:id,parentId:id,nodeId:childNode.id});await auth.execute(childNode.workflow.digest,expectedChildId);let childRecord:StoredRecord;let childId:string;let childPolicyHash:string;if(!rootStep.child){const raw=resolveBinding(childNode.input,rootState.input,outputs(root.record));const input=safe(await validate(childNode.workflow.input,raw,'input',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'child input');await auth.execute(definition.digest,id);await auth.require('workflow',childNode.workflow.digest,'delegate');await auth.execute(childNode.workflow.digest,expectedChildId);const admitted=await call(()=>api.admitChild({...access(id),parentId:id,nodeId:childNode.id,expectedVersion:root.record.version,input}));if(admitted.childId!==expectedChildId)throw new MayuraError('CONFLICT','Child admission changed the authorized identity.');root=admitted.root;childRecord=admitted.child;childId=admitted.childId;childPolicyHash=admitted.policyHash;progress||=admitted.created;}else{childId=rootStep.child.runId;childPolicyHash=rootStep.child.policyHash;childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;}\n let childState=workflowTreeState(childRecord);if(!terminal.has(childState.status)){for(const node of childNode.workflow.nodes){if(node.kind!=='tool')continue;childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;childState=workflowTreeState(childRecord);const step=childState.steps[node.id];if(!step||!['pending','waiting','approved'].includes(step.status)||node.dependsOn?.some(dependency=>childState.steps[dependency]?.status!=='succeeded'))continue;const required=[`tool:${node.tool.id}`,...node.tool.capabilities,...(node.tool.effects==='none'?[]:[`effect:${node.tool.effects}`])];if(required.some(grant=>!childNode.policy.permissions.includes(grant))){const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));childRecord=cancelled.member;progress=true;break;}await auth.execute(childNode.workflow.digest,childId);await auth.require('tool',node.tool.id,'execute');let input:JsonValue;try{const raw=resolveBinding(node.input,childState.input,outputs(childRecord));input=safe(await validate(node.tool.input,raw,'input',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'tool input');}catch{const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));childRecord=cancelled.member;progress=true;break;}await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('tool',node.tool.id,'execute');if(node.approval){const previousVersion=childRecord.version;const requested=await call(()=>api.requestChildApproval({...access(id),childId,childPolicyHash,nodeId:node.id,expectedVersion:previousVersion,input}));childRecord=requested.member;childState=workflowTreeState(childRecord);progress=childRecord.version!==previousVersion||progress;if(childState.steps[node.id]?.status!=='approved')continue;}const scheduled=await executeTool(id,childId,childPolicyHash,childNode.policy.permissions,childNode.policy.maxOutputBytes,node,childRecord,input);if(scheduled){operations.push(scheduled.operation);progress=true;}}\n childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;childState=workflowTreeState(childRecord);if(!terminal.has(childState.status)&&Object.values(childState.steps).every(step=>step.status==='succeeded')){let output:JsonValue|undefined;try{const raw=resolveBinding(childNode.workflow.result,childState.input,outputs(childRecord));output=safe(await validate(childNode.workflow.output,raw,'output',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'child output');}catch{const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));root=cancelled.root;childRecord=cancelled.member;progress=true;}if(output!==undefined){await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('workflow',childNode.workflow.digest,'delegate');const finalized=await call(()=>api.finalizeChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,output}));root=finalized.root;childRecord=finalized.member;progress=true;}}\n }\n childState=workflowTreeState(childRecord);root=await inspectStored(id);rootState=workflowTreeState(root.record);if(terminal.has(childState.status)&&rootState.steps[childNode.id]?.child?.joinedVersion===null){await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('workflow',childNode.workflow.digest,'delegate');root=await call(()=>api.joinChild({...access(id),nodeId:childNode.id,expectedVersion:root.record.version}));progress=true;if(workflowTreeState(root.record).status!=='succeeded'&&terminal.has(workflowTreeState(root.record).status)){root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}}\n }\n if(operations.length){dispatched=true;const results=await Promise.allSettled(operations.map(operation=>operation()));const failure=results.find(result=>result.status==='rejected');if(failure?.status==='rejected')throw failure.reason;continue;}\n root=await inspectStored(id);rootState=workflowTreeState(root.record);if(rootState.status==='paused')return checkedSnapshot(root);if(Object.values(rootState.steps).every(step=>step.status==='succeeded')){let output:JsonValue;try{const raw=resolveBinding(definition.result,rootState.input,outputs(root.record));output=safe(await validate(definition.output,raw,'output',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'root output');}catch{root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);root=await call(()=>api.finalizeRoot({...access(id),expectedVersion:root.record.version,output}));return checkedSnapshot(root);}\n if(!progress)return checkedSnapshot(root);\n }finally{if(!dispatched)await Promise.allSettled(operations.map(operation=>operation()));}\n }finally{release();}}throw new MayuraError('LIMIT_EXCEEDED','Workflow-tree continuation exceeded its finite progress bound.');\n }\n\n const closeRuntime=():Promise<void>=>{if(!closing){closed=true;auth.close();for(const controller of active.values())controller.abort();closing=(async()=>{await Promise.allSettled([...runs.values()].map(run=>run.operation));await Promise.allSettled([...pendingExecutions]);})();}return closing;};\n return Object.freeze<WorkflowTreeRuntime>({\n profile:'scheduled-v3',\n async submit(definition,command){open();supported(definition);if(typeof command.idempotencyKey!=='string'||!command.idempotencyKey.length||command.idempotencyKey.length>128)throw new MayuraError('INVALID_INPUT','A bounded stable submission key is required.');const admittedId=digest('mayura:workflow-tree-run:v1',{scope:scopeKey,submissionKey:command.idempotencyKey});await auth.execute(definition.digest,admittedId);const raw=safe(command.input,authority.maxOutputBytes,'input');const input=safe(await validate(definition.input,raw,'input',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'input');await auth.execute(definition.digest,admittedId);await initialize();const result=await call(()=>api.submit({manifest:treeManifest(definition),policy:authority,resources:{},input,idempotencyKey:command.idempotencyKey}));if(result.snapshot.rootId!==admittedId)throw new MayuraError('CONFLICT','Workflow admission changed the authorized identity.');matchRoot(definition,result.snapshot);return publicSnapshot(result.snapshot);},\n async inspect(id){return publicSnapshot(await inspectStored(id));},\n async inspectChild(id,childId){const root=await inspectStored(id);if(!/^[a-f0-9]{64}$/.test(childId))throw new MayuraError('INVALID_INPUT','Child run ID must be an exact hash.');const link=Object.values(workflowTreeState(root.record).steps).find(step=>step.child?.runId===childId)?.child;if(!link)throw new MayuraError('CONFLICT','Child is not owned by this workflow tree.');return publicChild((await call(()=>api.inspectChild({...access(id),childId,childPolicyHash:link.policyHash}))).member);},\n runUntilSettled(definition,id){open();if(gate.draining)return Promise.reject(new MayuraError('CANCELLED','Workflow-tree runtime is draining.'));supported(definition);access(id);const existing=runs.get(id);if(existing)return existing.definition===definition?existing.operation:Promise.reject(new MayuraError('CONFLICT','The active driver uses a different workflow-tree definition.'));if(runs.size>=maxConcurrentRuns)return Promise.reject(new MayuraError('LIMIT_EXCEEDED','This workflow-tree worker has reached its active-run limit.'));const operation=drive(definition,id).catch(async(error:unknown)=>{if(error instanceof StorageError&&error.storageCode==='CONFLICT'){const current=await inspectStored(id);if(workflowTreeState(current.record).status==='paused')return publicSnapshot(current);}throw error;}).finally(()=>runs.delete(id));runs.set(id,{definition,operation});return operation;},\n async approve(command){\n open();await auth.require('run',command.id,'approve');if(command.childId!==undefined)await auth.require('run',command.childId,'approve');const root=await inspectStored(command.id);if((command.childId!==undefined&&!/^[a-f0-9]{64}$/.test(command.childId))||!/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(command.nodeId)||!/^[a-f0-9]{64}$/.test(command.digest))throw new MayuraError('INVALID_INPUT','Approval requires exact member, node and review identities.');if(!options.verifyHuman)throw new MayuraError('PERMISSION_DENIED','A trusted human verifier is required.');let human:VerifiedHuman;try{human=await bounded(()=>options.verifyHuman!(command.credential),30_000);if(typeof human.id!=='string'||!human.id.length||/[\\uD800-\\uDFFF]/u.test(human.id)||new TextEncoder().encode(human.id).length>256||human.id.includes('\\u0000')||human.projectId!==authority.scope.projectId||human.canApprove!==true)throw new Error();}catch{throw new MayuraError('PERMISSION_DENIED','Human verification did not authorize this approval.');}\n if(command.childId===undefined){await auth.require('run',command.id,'approve');await call(()=>api.approveRootTool({...access(command.id),nodeId:command.nodeId,expectedVersion:root.record.version,digest:command.digest,humanId:human.id}));return publicSnapshot(await inspectStored(command.id));}\n const childId=command.childId;const state=workflowTreeState(root.record);const link=Object.values(state.steps).find(step=>step.child?.runId===childId)?.child;if(!link)throw new MayuraError('CONFLICT','Child is not owned by this workflow tree.');const child=await call(()=>api.inspectChild({...access(command.id),childId,childPolicyHash:link.policyHash}));await auth.require('run',command.id,'approve');await auth.require('run',childId,'approve');await call(()=>api.approveChildTool({...access(command.id),childId,childPolicyHash:link.policyHash,nodeId:command.nodeId,expectedVersion:child.member.version,digest:command.digest,humanId:human.id}));return publicSnapshot(await inspectStored(command.id));\n },\n async cancel(id){const root=await inspectStored(id);if(workflowTreeState(root.record).status==='succeeded')return publicSnapshot(root);return publicSnapshot((await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root);},\n async pause(id){\n if(!controls.pauseRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide durable workflow-tree pause.');\n for(let attempt=0;attempt<32;attempt++){const root=await inspectStored(id);const status=workflowTreeState(root.record).status;if(status==='paused')return publicSnapshot(root);if(terminal.has(status))throw new MayuraError('CONFLICT','A terminal workflow tree cannot be paused.');\n try{return publicSnapshot(await call(()=>controls.pauseRoot!({...access(id),expectedVersion:root.record.version})));}\n catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;if((await inspectStored(id)).record.version===root.record.version)throw new MayuraError('CONFLICT','A workflow tree with a claimed or in-flight effect cannot enter the quiescent paused state.');}}\n throw new MayuraError('CONFLICT','Workflow-tree pause contention exceeded its bounded retry limit.');\n },\n async resume(id){\n await auth.require('run',id,'resume');\n if(!controls.resumeRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide durable workflow-tree pause.');\n for(let attempt=0;attempt<32;attempt++){const root=await inspectStored(id);if(workflowTreeState(root.record).status!=='paused')throw new MayuraError('CONFLICT','Only a paused workflow tree can be resumed.');\n try{return publicSnapshot(await call(()=>controls.resumeRoot!({...access(id),expectedVersion:root.record.version})));}\n catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}\n throw new MayuraError('CONFLICT','Workflow-tree resume contention exceeded its bounded retry limit.');\n },\n async migrate(migration,command){\n open();assertWorkflowMigration(migration);supported(migration.from);supported(migration.to);\n const {id,actorId,commandId,dryRun=false}=migrationCommand(command);\n const root=await inspectStored(id);matchRoot(migration.from,root);const state=workflowTreeState(root.record);\n const nodes=(definition:AnyWorkflowTree)=>treeManifest(definition).graph.map(node=>({id:node.id,kind:node.kind,dependsOn:node.dependsOn,fingerprint:nodeFingerprint(node as unknown as Record<string,unknown>),...(nodeEvidence(node)?{evidence:nodeEvidence(node)!}:{})}));\n const fromNodes=nodes(migration.from);const toNodes=nodes(migration.to);\n const preconditions:MigrationBlocker[]=[];\n if(state.status!=='paused')preconditions.push({node:'*',reason:`The tree is ${state.status}; pause it before migrating.`});\n if(runs.has(id))preconditions.push({node:'*',reason:'This worker is still driving the tree; wait for its driver to stop.'});\n // A prepared job or an admitted child is durable history keyed by node: it must survive unchanged under its own id.\n for(const [nodeId,step] of Object.entries(state.steps))if(step.candidateHash!==null||step.child!==null){\n const before=fromNodes.find(node=>node.id===nodeId);const after=toNodes.find(node=>node.id===nodeId);\n if(!after||before?.fingerprint!==after.fingerprint||Object.values(migration.renames).includes(nodeId))preconditions.push({node:nodeId,reason:`Step \"${nodeId}\" has execution history; it must be kept unchanged.`});\n }\n // An admitted child that has not joined is still in flight from the root's point of view.\n const status=(step:typeof state.steps[string]):string=>step.child!==null&&step.child.joinedVersion===null?'running':step.status;\n const plan=planWorkflowMigration({migration,format:'tree-v4',runId:id,fromDigest:migration.from.digest,toDigest:migration.to.digest,from:fromNodes,to:toNodes,\n steps:Object.entries(state.steps).map(([step,value])=>({id:step,status:status(value)})),preconditions});\n if(dryRun)return freezeJson(jsonValue({plan})) as unknown as WorkflowMigrationResult<WorkflowTreeSnapshot>;\n assertMigrationAllowed(plan);\n if(!controls.migrateRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter cannot migrate in-flight workflow trees.');\n const manifest=treeManifest(migration.to);\n const fresh=initialWorkflowTreeRootState(manifest,state.input,id,migration.to.digest,state.policy,authority);\n const carried:Record<string,unknown>={};\n for(const entry of plan.entries)if(entry.target)carried[entry.target]=entry.action==='keep'||entry.action==='accept'?state.steps[entry.source!]:fresh.steps[entry.target];\n const steps=Object.fromEntries(manifest.graph.map(node=>[node.id,carried[node.id]]));\n const next={...state,definition:migration.to.digest,steps,reservedMicros:Object.values(steps).reduce<number>((sum,step)=>sum+(step as {costReserved:number}).costReserved,0)};\n const migrated=await call(()=>controls.migrateRoot!({...access(id),expectedVersion:root.record.version,commandId,manifest,resources:{},state:jsonValue(next) as never,migrationId:migration.id,actorId}));\n matchRoot(migration.to,migrated);\n return freezeJson(jsonValue({plan,snapshot:publicSnapshot(migrated)})) as unknown as WorkflowMigrationResult<WorkflowTreeSnapshot>;\n },\n async recoverExpired(id){await inspectStored(id);return publicSnapshot((await call(()=>api.recoverExpired({...access(id),limit:128}))).root);},\n async events(id,after=0){open();access(id);if(!Number.isSafeInteger(after)||after<0)throw new MayuraError('INVALID_INPUT','A non-negative event cursor is required.');await inspectStored(id);return call(()=>options.store.events(scopeKey,id,after));},\n close:closeRuntime,\n drain(options){return gate.drain(options,closeRuntime);},\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"children-runtime.js","sourceRoot":"","sources":["../src/children-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAqG,MAAM,cAAc,CAAC;AAC9M,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAuD,MAAM,YAAY,CAAC;AAC1G,OAAO,EACL,YAAY,EAAE,4BAA4B,EAAE,kB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ent":["import { workflowAuthorization } from './authorization.js';\nimport { workflowNodeLimit } from '@mayura/core';\nimport type { Authorizer } from '@mayura/core';\nimport { Budget, MayuraError, assertPositiveInteger, freezeJson, jsonValue, validate, type ExecutionReceipt, type InferInput, type JsonValue, type Permissions, type Schema, type Scope } from '@mayura/core';\nimport { invokeTool } from '@mayura/tools';\nimport { createWorkflowDrainGate, type WorkflowDrainOptions, type WorkflowDrainReport } from './drain.js';\nimport {\n StorageError, initialWorkflowTreeRootState, workflowTreePolicy, workflowTreeState,\n type Claim, type StoredRecord, type WorkflowTreeAggregateStore, type WorkflowTreeRootSnapshot as StoredTreeSnapshot, type WorkflowTreeStore,\n} from '@mayura/storage-contracts';\nimport { assertWorkflow, digest, resolveBinding, type WorkflowNode } from './definition.js';\nimport { assertMigrationAllowed, assertWorkflowMigration, migrationCommand, nodeEvidence, nodeFingerprint, planWorkflowMigration,\n type MigrationBlocker, type MigrationCommand, type WorkflowMigration, type WorkflowMigrationResult } from './migration.js';\nimport { assertWorkflowTree, treeManifest, type AnyWorkflowTree, type WorkflowTreeDefinition } from './children-definition.js';\nimport type { VerifiedHuman } from './runtime.js';\n\nexport interface WorkflowTreeRuntimeOptions {\n readonly store:WorkflowTreeAggregateStore;readonly scope:Scope;readonly permissions:Permissions;readonly policyVersion:string;\n /** Host-owned core authorizer; decisions and audit delivery use its existing limits and lifecycle. */\n readonly authorization?: Authorizer;\n readonly maxCostMicros:number;readonly maxCalls:number;readonly workerId:string;readonly leaseMs?:number;\n readonly maxConcurrentJobs?:number;readonly maxConcurrentRuns?:number;\n readonly maxOutputBytes?:number;readonly approvalTtlMs?:number;readonly storageTimeoutMs?:number;\n readonly verifyHuman?:(credential:unknown)=>Promise<VerifiedHuman>;\n}\nexport interface WorkflowTreeSnapshot {\n readonly id:string;readonly version:number;readonly status:ReturnType<typeof workflowTreeState>['status'];\n readonly steps:ReturnType<typeof workflowTreeState>['steps'];readonly output:JsonValue;\n readonly budget:StoredTreeSnapshot['budget'];\n}\nexport interface WorkflowTreeChildSnapshot {readonly id:string;readonly version:number;readonly status:ReturnType<typeof workflowTreeState>['status'];readonly steps:ReturnType<typeof workflowTreeState>['steps'];readonly output:JsonValue;}\nexport interface WorkflowTreeRuntime {\n readonly profile:'scheduled-v3';\n submit<I extends Schema,O extends Schema>(definition:WorkflowTreeDefinition<I,O>,command:{readonly input:InferInput<I>;readonly idempotencyKey:string}):Promise<WorkflowTreeSnapshot>;\n inspect(id:string):Promise<WorkflowTreeSnapshot>;\n inspectChild(id:string,childId:string):Promise<WorkflowTreeChildSnapshot>;\n runUntilSettled(definition:AnyWorkflowTree,id:string):Promise<WorkflowTreeSnapshot>;\n approve(command:{readonly id:string;readonly childId?:string;readonly nodeId:string;readonly digest:string;readonly credential:unknown}):Promise<WorkflowTreeSnapshot>;\n cancel(id:string):Promise<WorkflowTreeSnapshot>;\n /** Persist a tree-wide quiescent pause; claimed or in-flight root or child effects must settle or be recovered first. */\n pause(id:string):Promise<WorkflowTreeSnapshot>;\n /** Resume scheduling only; unresolved approvals and child waits remain unresolved. */\n resume(id:string):Promise<WorkflowTreeSnapshot>;\n /**\n * Plan (dryRun) or apply a reviewed migration of a paused tree. Root steps with a prepared job and child steps with an\n * admitted child keep their exact definition; everything else follows the plan. The tree stays paused.\n */\n migrate(migration:WorkflowMigration<AnyWorkflowTree,AnyWorkflowTree>,command:MigrationCommand):Promise<WorkflowMigrationResult<WorkflowTreeSnapshot>>;\n recoverExpired(id:string):Promise<WorkflowTreeSnapshot>;\n events(id:string,after?:number):ReturnType<WorkflowTreeAggregateStore['events']>;\n close():Promise<void>;\n /** Admit no new wave, let admitted root/child effects and receipts settle within the deadline, then close. */\n drain(options?:WorkflowDrainOptions):Promise<WorkflowDrainReport>;\n}\n\nconst terminal=new Set(['succeeded','failed','blocked','cancelled','outcome_unknown']);\nconst methods=(['initialize','submit','inspect','requestRootApproval','approveRootTool','prepareRootTool','claimPreparedRootTool','renewClaimedRootTool','startClaimedRootTool','recordRootToolReceipt','completeRootTool','inspectChild','admitChild','requestChildApproval','approveChildTool','prepareChildTool','claimPreparedChildTool','renewClaimedChildTool','startClaimedChildTool','recordChildToolReceipt','completeChildTool','finalizeChild','joinChild','finalizeRoot','cancelChild','cancelRoot','recoverExpired'] as const) satisfies readonly (keyof WorkflowTreeStore)[];\n\nasync function bounded<T>(operation:()=>Promise<T>,timeoutMs:number):Promise<T>{let timer:ReturnType<typeof setTimeout>|undefined;try{return await Promise.race([Promise.resolve().then(operation),new Promise<never>((_resolve,reject)=>{timer=setTimeout(()=>reject(new MayuraError('TIMEOUT','Workflow-tree validation or storage operation timed out.')),timeoutMs);})]);}finally{if(timer)clearTimeout(timer);}}\nfunction safe(value:unknown,maxBytes:number,label:string):JsonValue{try{return jsonValue(value,{maxBytes});}catch{throw new MayuraError('INVALID_INPUT',`Workflow-tree ${label} exceeds its bounded JSON contract.`);}}\nfunction outputs(record:StoredRecord):Record<string,JsonValue>{const state=workflowTreeState(record);return Object.fromEntries(Object.entries(state.steps).filter(([,step])=>step.status==='succeeded').map(([id,step])=>[id,step.output]));}\nfunction publicSnapshot(value:StoredTreeSnapshot):WorkflowTreeSnapshot{const state=workflowTreeState(value.record);return freezeJson(jsonValue({id:value.rootId,version:value.record.version,status:state.status,steps:state.steps,output:state.output,budget:value.budget})) as unknown as WorkflowTreeSnapshot;}\nfunction publicChild(record:StoredRecord):WorkflowTreeChildSnapshot{const state=workflowTreeState(record);return freezeJson(jsonValue({id:record.id,version:record.version,status:state.status,steps:state.steps,output:state.output})) as unknown as WorkflowTreeChildSnapshot;}\nfunction storageFailure(error:unknown):never{if(error instanceof StorageError&&['CONFLICT','NOT_FOUND','STALE_CLAIM','LIMIT_EXCEEDED'].includes(error.storageCode))throw error;throw new MayuraError('STORAGE_UNAVAILABLE','Workflow-tree storage is unavailable; reconcile uncertain actions before retrying.');}\n\n/** Finite format-4 driver for root-local tools and one-level required children. */\nexport function createWorkflowTreeRuntime(options:WorkflowTreeRuntimeOptions):WorkflowTreeRuntime{\n let api:WorkflowTreeStore;try{if(!options.store?.workflowTrees||methods.some(method=>typeof options.store.workflowTrees[method]!=='function'))throw new Error();api=Object.freeze(Object.fromEntries(methods.map(method=>[method,options.store.workflowTrees[method].bind(options.store.workflowTrees)]))) as unknown as WorkflowTreeStore;}catch{throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide the optional workflow-tree capability.');}\n // Optional pause controls: custom adapters without them keep working until pause is requested.\n const trees=options.store.workflowTrees;const controls={pauseRoot:typeof trees.pauseRoot==='function'?trees.pauseRoot.bind(trees):undefined,resumeRoot:typeof trees.resumeRoot==='function'?trees.resumeRoot.bind(trees):undefined,migrateRoot:typeof trees.migrateRoot==='function'?trees.migrateRoot.bind(trees):undefined};\n const authority=workflowTreePolicy({scope:options.scope,permissions:options.permissions?.allow,policyVersion:options.policyVersion,maxCostMicros:options.maxCostMicros,maxCalls:options.maxCalls,maxOutputBytes:options.maxOutputBytes??65_536,approvalTtlMs:options.approvalTtlMs??3_600_000});\n if(typeof options.workerId!=='string'||!/^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/.test(options.workerId))throw new MayuraError('INVALID_CONFIG','A bounded workflow-tree worker identity is required.');const leaseMs=options.leaseMs??3_000;const timeoutMs=options.storageTimeoutMs??10_000;const maxConcurrentJobs=options.maxConcurrentJobs??4;const maxConcurrentRuns=options.maxConcurrentRuns??16;for(const [name,value] of Object.entries({leaseMs,timeoutMs,maxConcurrentJobs,maxConcurrentRuns}))assertPositiveInteger(value,name);if(leaseMs<1_000||leaseMs>300_000||timeoutMs>30_000||maxConcurrentJobs>32||maxConcurrentRuns>128)throw new MayuraError('INVALID_CONFIG','Workflow-tree worker limits exceed supported bounds.');\n const auth = workflowAuthorization(options.authorization, authority.scope);\n const scopeKey=digest('mayura:scope:v1',authority.scope);const policyHash=digest('mayura:workflow-tree-policy:v1',authority);let initialized:Promise<void>|undefined;let closed=false;let closing:Promise<void>|undefined;let slots=0;const active=new Map<string,AbortController>();const runs=new Map<string,{definition:AnyWorkflowTree;operation:Promise<WorkflowTreeSnapshot>}>();const pendingExecutions=new Set<Promise<void>>();const gate=createWorkflowDrainGate();\n const open=():void=>{if(closed)throw new MayuraError('CANCELLED','Workflow-tree runtime is closed.');};const initialize=()=>initialized??=(async()=>{try{await bounded(()=>api.initialize(),timeoutMs);}catch(error){storageFailure(error);}})();const access=(id:string)=>{if(typeof id!=='string'||!/^[a-f0-9]{64}$/.test(id))throw new MayuraError('INVALID_INPUT','Workflow-tree run ID must be an exact hash.');return{scope:scopeKey,rootId:id,rootPolicyHash:policyHash};};\n const call=async<T>(operation:()=>Promise<T>):Promise<T>=>{try{return await bounded(operation,timeoutMs);}catch(error){return storageFailure(error);}};\n const inspectStored=async(id:string):Promise<StoredTreeSnapshot>=>{open();await initialize();const value=await call(()=>api.inspect(access(id)));if(!value)throw new MayuraError('NOT_FOUND','Workflow tree was not found in this scope.');if(value.rootId!==id||value.record.scope!==scopeKey||value.policyHash!==policyHash)throw new MayuraError('CONFLICT','Stored workflow-tree identity does not match this runtime.');workflowTreeState(value.record);return value;};\n const supported=(definition:AnyWorkflowTree):void=>{assertWorkflowTree(definition);for(const child of definition.nodes.filter(node=>node.kind==='child'))assertWorkflow(child.workflow);};\n const matchRoot=(definition:AnyWorkflowTree,root:StoredTreeSnapshot):void=>{if(root.manifestHash!==definition.digest||workflowTreeState(root.record).definition!==definition.digest)throw new MayuraError('CONFLICT','Stored workflow tree uses a different genuine definition.');};\n const receiptId=(jobId:string,fence:number,receipt:ExecutionReceipt)=>digest('mayura:workflow-tree-receipt:v1',{jobId,fence,receipt});\n const reserveJobSlot=()=>{if(slots>=maxConcurrentJobs)return undefined;slots++;let resolveDrain!:()=>void;const drain=new Promise<void>(resolve=>{resolveDrain=resolve;});pendingExecutions.add(drain);let acquired=false;let handlerSettled=false;let logicalSettled=false;let released=false;const release=()=>{if(!released&&logicalSettled&&(!acquired||handlerSettled)){released=true;slots--;pendingExecutions.delete(drain);resolveDrain();}};return{acquire:async(signal:AbortSignal)=>{signal.throwIfAborted();acquired=true;return()=>{handlerSettled=true;release();};},logical:()=>{logicalSettled=true;release();}};};\n\n async function executeRootTool(rootId:string,node:Extract<WorkflowNode,{kind:'tool'}>,record:StoredRecord,raw:JsonValue):Promise<{operation:()=>Promise<void>}|undefined>{\n await auth.execute(record.definitionHash, rootId);\n await auth.require('tool', node.tool.id, 'execute');\n const capacity=reserveJobSlot();if(!capacity)return undefined;const base={...access(rootId),nodeId:node.id};try{try{await call(()=>api.prepareRootTool({...base,expectedVersion:record.version,input:raw}));}catch(error){if(error instanceof StorageError&&error.storageCode==='CONFLICT'){capacity.logical();return undefined;}throw error;}const claimed=await call(()=>api.claimPreparedRootTool({...base,workerId:options.workerId,leaseMs}));if(!claimed){capacity.logical();return undefined;}const operation=async()=>{if(closed){capacity.logical();return;}let token:Claim=claimed.claim;let renewal:ReturnType<typeof setTimeout>|undefined;let renewing:Promise<void>|undefined;let finished=false;const controller=new AbortController();active.set(claimed.job.jobId,controller);\n const schedule=()=>{if(finished||controller.signal.aborted)return;renewal=setTimeout(()=>{renewing=call(()=>api.renewClaimedRootTool({...base,claim:token,leaseMs})).then(result=>{token=result.claim;schedule();}).catch(()=>controller.abort());},Math.max(100,Math.floor(leaseMs/3)));};const stop=async()=>{finished=true;if(renewal)clearTimeout(renewal);await renewing;};let evidenceId:string|undefined;\n try{const result=await invokeTool(node.tool,raw,{runId:rootId,callId:`${rootId}/step:${node.id}`,scope:authority.scope,...auth.toolContext(record.definitionHash,rootId),permissions:Object.freeze({allow:authority.permissions}),signal:controller.signal,budget:new Budget(node.tool.costMicros,1),maxOutputBytes:authority.maxOutputBytes,acquireExecution:capacity.acquire,beforeDispatch:async input=>{await auth.execute(record.definitionHash,rootId,controller.signal);for(let attempt=0;attempt<32;attempt++){const current=await inspectStored(rootId);try{const started=await call(()=>api.startClaimedRootTool({...base,expectedVersion:current.record.version,claim:token,input}));if(started.status!=='started')throw new MayuraError('CONFLICT','The root claim does not grant a fresh dispatch.');schedule();return;}catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}throw new MayuraError('CONFLICT','Root start contention exceeded its bounded retry limit.');},onExecutionReceipt:async receipt=>{const withheld=Object.freeze({...receipt,disclosure:'withheld' as const});const currentEvidence=receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordRootToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));}});if(!result.receipt)return;const withheld=Object.freeze({...result.receipt,disclosure:'withheld' as const});const currentEvidence=evidenceId??receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordRootToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));if(withheld.execution==='unknown')return;await stop();const outcome=result.status==='succeeded'?'succeeded':withheld.execution==='failed'?'failed':'blocked';await call(()=>api.completeRootTool({...base,claim:token,commandId:crypto.randomUUID(),evidenceId:currentEvidence,outcome,output:result.status==='succeeded'?safe(result.output,authority.maxOutputBytes,'tool output'):null}));}catch(error){if(!(error instanceof StorageError&&['STALE_CLAIM','CONFLICT'].includes(error.code)))throw error;}finally{await stop();active.delete(claimed.job.jobId);capacity.logical();}\n };return{operation};}catch(error){capacity.logical();throw error;}\n }\n\n async function executeTool(rootId:string,childId:string,childPolicyHash:string,childPermissions:readonly string[],maxOutputBytes:number,node:Extract<WorkflowNode,{kind:'tool'}>,record:StoredRecord,raw:JsonValue):Promise<{operation:()=>Promise<void>}|undefined>{\n await auth.execute(record.definitionHash, childId);\n await auth.require('workflow', record.definitionHash, 'delegate');\n await auth.require('tool', node.tool.id, 'execute');\n const capacity=reserveJobSlot();if(!capacity)return undefined;const base={...access(rootId),childId,childPolicyHash,nodeId:node.id};try{try{await call(()=>api.prepareChildTool({...base,expectedVersion:record.version,input:raw}));}catch(error){if(error instanceof StorageError&&error.storageCode==='CONFLICT'){capacity.logical();return undefined;}throw error;}const claimed=await call(()=>api.claimPreparedChildTool({...base,workerId:options.workerId,leaseMs}));if(!claimed){capacity.logical();return undefined;}const operation=async()=>{if(closed){capacity.logical();return;}let token:Claim=claimed.claim;let renewal:ReturnType<typeof setTimeout>|undefined;let renewing:Promise<void>|undefined;let finished=false;const controller=new AbortController();active.set(claimed.job.jobId,controller);\n const schedule=()=>{if(finished||controller.signal.aborted)return;renewal=setTimeout(()=>{renewing=call(()=>api.renewClaimedChildTool({...base,claim:token,leaseMs})).then(result=>{token=result.claim;schedule();}).catch(()=>controller.abort());},Math.max(100,Math.floor(leaseMs/3)));};const stop=async()=>{finished=true;if(renewal)clearTimeout(renewal);await renewing;};let evidenceId:string|undefined;\n try{const result=await invokeTool(node.tool,raw,{runId:childId,callId:`${childId}/step:${node.id}`,scope:authority.scope,...auth.toolContext(record.definitionHash,childId,async signal=>{const root=await inspectStored(rootId);await auth.execute(root.record.definitionHash,rootId,signal);await auth.require('workflow',record.definitionHash,'delegate',signal);}),permissions:Object.freeze({allow:childPermissions}),signal:controller.signal,budget:new Budget(node.tool.costMicros,1),maxOutputBytes,acquireExecution:capacity.acquire,beforeDispatch:async input=>{await auth.execute(record.definitionHash,childId,controller.signal);await auth.require('workflow',record.definitionHash,'delegate',controller.signal);const root=await inspectStored(rootId);await auth.execute(root.record.definitionHash,rootId,controller.signal);for(let attempt=0;attempt<32;attempt++){const current=await call(()=>api.inspectChild({...access(rootId),childId,childPolicyHash}));try{const started=await call(()=>api.startClaimedChildTool({...base,expectedVersion:current.member.version,claim:token,input}));if(started.status!=='started')throw new MayuraError('CONFLICT','The child claim does not grant a fresh dispatch.');schedule();return;}catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}throw new MayuraError('CONFLICT','Child start contention exceeded its bounded retry limit.');},onExecutionReceipt:async receipt=>{const withheld=Object.freeze({...receipt,disclosure:'withheld' as const});const currentEvidence=receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordChildToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));}});if(!result.receipt)return;const withheld=Object.freeze({...result.receipt,disclosure:'withheld' as const});const currentEvidence=evidenceId??receiptId(claimed.job.jobId,claimed.claim.fence,withheld);evidenceId=currentEvidence;await call(()=>api.recordChildToolReceipt({...base,fence:claimed.claim.fence,evidenceId:currentEvidence,receipt:withheld}));if(withheld.execution==='unknown')return;await stop();const outcome=result.status==='succeeded'?'succeeded':withheld.execution==='failed'?'failed':'blocked';await call(()=>api.completeChildTool({...base,claim:token,commandId:crypto.randomUUID(),evidenceId:currentEvidence,outcome,output:result.status==='succeeded'?safe(result.output,maxOutputBytes,'tool output'):null}));}catch(error){if(!(error instanceof StorageError&&['STALE_CLAIM','CONFLICT'].includes(error.code)))throw error;}finally{await stop();active.delete(claimed.job.jobId);capacity.logical();}\n };return{operation};}catch(error){capacity.logical();throw error;}\n }\n\n async function drive(definition:AnyWorkflowTree,id:string):Promise<WorkflowTreeSnapshot>{\n const checkedSnapshot = async (record: StoredTreeSnapshot) => { await auth.execute(definition.digest, id); return publicSnapshot(record); };\n\n const rootNodes=definition.nodes.filter((node):node is Extract<WorkflowNode,{kind:'tool'}>=>node.kind==='tool');const childNodes=definition.nodes.filter(node=>node.kind==='child');for(let wave=0;wave<definition.nodes.length*2+8;wave++){open();await auth.execute(definition.digest,id);let root=await inspectStored(id);matchRoot(definition,root);let rootState=workflowTreeState(root.record);if(rootState.status==='paused')return checkedSnapshot(root);if(terminal.has(rootState.status)){if(rootState.status!=='succeeded'&&!root.budget.accounts.find(account=>account.id==='root')?.closed)root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}const release=gate.enter();if(!release)return checkedSnapshot(root);try{let progress=false;const operations:(()=>Promise<void>)[]=[];let dispatched=false;try{const recovery=await call(()=>api.recoverExpired({...access(id),limit:128}));if(recovery.jobs.length||recovery.root.record.version!==root.record.version){root=recovery.root;rootState=workflowTreeState(root.record);progress=true;}if(rootState.status==='paused')return checkedSnapshot(root);\n for(const node of rootNodes){root=await inspectStored(id);rootState=workflowTreeState(root.record);const step=rootState.steps[node.id];if(!step||terminal.has(rootState.status)||!['pending','waiting','approved'].includes(step.status)||node.dependsOn?.some(dependency=>rootState.steps[dependency]?.status!=='succeeded'))continue;const required=[`tool:${node.tool.id}`,...node.tool.capabilities,...(node.tool.effects==='none'?[]:[`effect:${node.tool.effects}`])];if(required.some(grant=>!authority.permissions.includes(grant))){root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);await auth.require('tool',node.tool.id,'execute');let input:JsonValue;try{const raw=resolveBinding(node.input,rootState.input,outputs(root.record));input=safe(await validate(node.tool.input,raw,'input',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'tool input');}catch{root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);await auth.require('tool',node.tool.id,'execute');if(node.approval){const previousVersion=root.record.version;root=await call(()=>api.requestRootApproval({...access(id),nodeId:node.id,expectedVersion:previousVersion,input}));rootState=workflowTreeState(root.record);progress=root.record.version!==previousVersion||progress;if(rootState.steps[node.id]?.status!=='approved')continue;}const scheduled=await executeRootTool(id,node,root.record,input);if(scheduled){operations.push(scheduled.operation);progress=true;}}\n for(const childNode of childNodes){root=await inspectStored(id);rootState=workflowTreeState(root.record);const rootStep=rootState.steps[childNode.id];if(!rootStep||terminal.has(rootState.status))break;if(!rootStep.child&&childNode.dependsOn?.some(dependency=>rootState.steps[dependency]?.status!=='succeeded'))continue;await auth.execute(definition.digest,id);await auth.require('workflow',childNode.workflow.digest,'delegate');const expectedChildId=rootStep.child?.runId??digest('mayura:workflow-tree-child-run:v1',{scope:scopeKey,rootId:id,parentId:id,nodeId:childNode.id});await auth.execute(childNode.workflow.digest,expectedChildId);let childRecord:StoredRecord;let childId:string;let childPolicyHash:string;if(!rootStep.child){const raw=resolveBinding(childNode.input,rootState.input,outputs(root.record));const input=safe(await validate(childNode.workflow.input,raw,'input',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'child input');await auth.execute(definition.digest,id);await auth.require('workflow',childNode.workflow.digest,'delegate');await auth.execute(childNode.workflow.digest,expectedChildId);const admitted=await call(()=>api.admitChild({...access(id),parentId:id,nodeId:childNode.id,expectedVersion:root.record.version,input}));if(admitted.childId!==expectedChildId)throw new MayuraError('CONFLICT','Child admission changed the authorized identity.');root=admitted.root;childRecord=admitted.child;childId=admitted.childId;childPolicyHash=admitted.policyHash;progress||=admitted.created;}else{childId=rootStep.child.runId;childPolicyHash=rootStep.child.policyHash;childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;}\n let childState=workflowTreeState(childRecord);if(!terminal.has(childState.status)){for(const node of childNode.workflow.nodes){if(node.kind!=='tool')continue;childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;childState=workflowTreeState(childRecord);const step=childState.steps[node.id];if(!step||!['pending','waiting','approved'].includes(step.status)||node.dependsOn?.some(dependency=>childState.steps[dependency]?.status!=='succeeded'))continue;const required=[`tool:${node.tool.id}`,...node.tool.capabilities,...(node.tool.effects==='none'?[]:[`effect:${node.tool.effects}`])];if(required.some(grant=>!childNode.policy.permissions.includes(grant))){const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));childRecord=cancelled.member;progress=true;break;}await auth.execute(childNode.workflow.digest,childId);await auth.require('tool',node.tool.id,'execute');let input:JsonValue;try{const raw=resolveBinding(node.input,childState.input,outputs(childRecord));input=safe(await validate(node.tool.input,raw,'input',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'tool input');}catch{const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));childRecord=cancelled.member;progress=true;break;}await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('tool',node.tool.id,'execute');if(node.approval){const previousVersion=childRecord.version;const requested=await call(()=>api.requestChildApproval({...access(id),childId,childPolicyHash,nodeId:node.id,expectedVersion:previousVersion,input}));childRecord=requested.member;childState=workflowTreeState(childRecord);progress=childRecord.version!==previousVersion||progress;if(childState.steps[node.id]?.status!=='approved')continue;}const scheduled=await executeTool(id,childId,childPolicyHash,childNode.policy.permissions,childNode.policy.maxOutputBytes,node,childRecord,input);if(scheduled){operations.push(scheduled.operation);progress=true;}}\n childRecord=(await call(()=>api.inspectChild({...access(id),childId,childPolicyHash}))).member;childState=workflowTreeState(childRecord);if(!terminal.has(childState.status)&&Object.values(childState.steps).every(step=>step.status==='succeeded')){let output:JsonValue|undefined;try{const raw=resolveBinding(childNode.workflow.result,childState.input,outputs(childRecord));output=safe(await validate(childNode.workflow.output,raw,'output',{maxBytes:childNode.policy.maxOutputBytes}),childNode.policy.maxOutputBytes,'child output');}catch{const cancelled=await call(()=>api.cancelChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,commandId:crypto.randomUUID()}));root=cancelled.root;childRecord=cancelled.member;progress=true;}if(output!==undefined){await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('workflow',childNode.workflow.digest,'delegate');const finalized=await call(()=>api.finalizeChild({...access(id),childId,childPolicyHash,expectedVersion:childRecord.version,output}));root=finalized.root;childRecord=finalized.member;progress=true;}}\n }\n childState=workflowTreeState(childRecord);root=await inspectStored(id);rootState=workflowTreeState(root.record);if(terminal.has(childState.status)&&rootState.steps[childNode.id]?.child?.joinedVersion===null){await auth.execute(definition.digest,id);await auth.execute(childNode.workflow.digest,childId);await auth.require('workflow',childNode.workflow.digest,'delegate');root=await call(()=>api.joinChild({...access(id),nodeId:childNode.id,expectedVersion:root.record.version}));progress=true;if(workflowTreeState(root.record).status!=='succeeded'&&terminal.has(workflowTreeState(root.record).status)){root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}}\n }\n if(operations.length){dispatched=true;const results=await Promise.allSettled(operations.map(operation=>operation()));const failure=results.find(result=>result.status==='rejected');if(failure?.status==='rejected')throw failure.reason;continue;}\n root=await inspectStored(id);rootState=workflowTreeState(root.record);if(rootState.status==='paused')return checkedSnapshot(root);if(Object.values(rootState.steps).every(step=>step.status==='succeeded')){let output:JsonValue;try{const raw=resolveBinding(definition.result,rootState.input,outputs(root.record));output=safe(await validate(definition.output,raw,'output',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'root output');}catch{root=(await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root;return checkedSnapshot(root);}await auth.execute(definition.digest,id);root=await call(()=>api.finalizeRoot({...access(id),expectedVersion:root.record.version,output}));return checkedSnapshot(root);}\n if(!progress)return checkedSnapshot(root);\n }finally{if(!dispatched)await Promise.allSettled(operations.map(operation=>operation()));}\n }finally{release();}}throw new MayuraError('LIMIT_EXCEEDED','Workflow-tree continuation exceeded its finite progress bound.');\n }\n\n const closeRuntime=():Promise<void>=>{if(!closing){closed=true;auth.close();for(const controller of active.values())controller.abort();closing=(async()=>{await Promise.allSettled([...runs.values()].map(run=>run.operation));await Promise.allSettled([...pendingExecutions]);})();}return closing;};\n return Object.freeze<WorkflowTreeRuntime>({\n profile:'scheduled-v3',\n async submit(definition,command){open();supported(definition);if(typeof command.idempotencyKey!=='string'||!command.idempotencyKey.length||command.idempotencyKey.length>128)throw new MayuraError('INVALID_INPUT','A bounded stable submission key is required.');const admittedId=digest('mayura:workflow-tree-run:v1',{scope:scopeKey,submissionKey:command.idempotencyKey});await auth.execute(definition.digest,admittedId);const raw=safe(command.input,authority.maxOutputBytes,'input');const input=safe(await validate(definition.input,raw,'input',{maxBytes:authority.maxOutputBytes}),authority.maxOutputBytes,'input');await auth.execute(definition.digest,admittedId);await initialize();const result=await call(()=>api.submit({manifest:treeManifest(definition),policy:authority,resources:{},input,idempotencyKey:command.idempotencyKey}));if(result.snapshot.rootId!==admittedId)throw new MayuraError('CONFLICT','Workflow admission changed the authorized identity.');matchRoot(definition,result.snapshot);return publicSnapshot(result.snapshot);},\n async inspect(id){return publicSnapshot(await inspectStored(id));},\n async inspectChild(id,childId){const root=await inspectStored(id);if(!/^[a-f0-9]{64}$/.test(childId))throw new MayuraError('INVALID_INPUT','Child run ID must be an exact hash.');const link=Object.values(workflowTreeState(root.record).steps).find(step=>step.child?.runId===childId)?.child;if(!link)throw new MayuraError('CONFLICT','Child is not owned by this workflow tree.');return publicChild((await call(()=>api.inspectChild({...access(id),childId,childPolicyHash:link.policyHash}))).member);},\n runUntilSettled(definition,id){open();if(gate.draining)return Promise.reject(new MayuraError('CANCELLED','Workflow-tree runtime is draining.'));supported(definition);access(id);const existing=runs.get(id);if(existing)return existing.definition===definition?existing.operation:Promise.reject(new MayuraError('CONFLICT','The active driver uses a different workflow-tree definition.'));if(runs.size>=maxConcurrentRuns)return Promise.reject(new MayuraError('LIMIT_EXCEEDED','This workflow-tree worker has reached its active-run limit.'));const operation=drive(definition,id).catch(async(error:unknown)=>{if(error instanceof StorageError&&error.storageCode==='CONFLICT'){const current=await inspectStored(id);if(workflowTreeState(current.record).status==='paused')return publicSnapshot(current);}throw error;}).finally(()=>runs.delete(id));runs.set(id,{definition,operation});return operation;},\n async approve(command){\n open();await auth.require('run',command.id,'approve');if(command.childId!==undefined)await auth.require('run',command.childId,'approve');const root=await inspectStored(command.id);if((command.childId!==undefined&&!/^[a-f0-9]{64}$/.test(command.childId))||!/^[A-Za-z][A-Za-z0-9._-]{0,127}$/.test(command.nodeId)||!/^[a-f0-9]{64}$/.test(command.digest))throw new MayuraError('INVALID_INPUT','Approval requires exact member, node and review identities.');if(!options.verifyHuman)throw new MayuraError('PERMISSION_DENIED','A trusted human verifier is required.');let human:VerifiedHuman;try{human=await bounded(()=>options.verifyHuman!(command.credential),30_000);if(typeof human.id!=='string'||!human.id.length||/[\\uD800-\\uDFFF]/u.test(human.id)||new TextEncoder().encode(human.id).length>256||human.id.includes('\\u0000')||human.projectId!==authority.scope.projectId||human.canApprove!==true)throw new Error();}catch{throw new MayuraError('PERMISSION_DENIED','Human verification did not authorize this approval.');}\n if(command.childId===undefined){await auth.require('run',command.id,'approve');await call(()=>api.approveRootTool({...access(command.id),nodeId:command.nodeId,expectedVersion:root.record.version,digest:command.digest,humanId:human.id}));return publicSnapshot(await inspectStored(command.id));}\n const childId=command.childId;const state=workflowTreeState(root.record);const link=Object.values(state.steps).find(step=>step.child?.runId===childId)?.child;if(!link)throw new MayuraError('CONFLICT','Child is not owned by this workflow tree.');const child=await call(()=>api.inspectChild({...access(command.id),childId,childPolicyHash:link.policyHash}));await auth.require('run',command.id,'approve');await auth.require('run',childId,'approve');await call(()=>api.approveChildTool({...access(command.id),childId,childPolicyHash:link.policyHash,nodeId:command.nodeId,expectedVersion:child.member.version,digest:command.digest,humanId:human.id}));return publicSnapshot(await inspectStored(command.id));\n },\n async cancel(id){const root=await inspectStored(id);if(workflowTreeState(root.record).status==='succeeded')return publicSnapshot(root);return publicSnapshot((await call(()=>api.cancelRoot({...access(id),expectedVersion:root.record.version,commandId:crypto.randomUUID()}))).root);},\n async pause(id){\n if(!controls.pauseRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide durable workflow-tree pause.');\n for(let attempt=0;attempt<32;attempt++){const root=await inspectStored(id);const status=workflowTreeState(root.record).status;if(status==='paused')return publicSnapshot(root);if(terminal.has(status))throw new MayuraError('CONFLICT','A terminal workflow tree cannot be paused.');\n try{return publicSnapshot(await call(()=>controls.pauseRoot!({...access(id),expectedVersion:root.record.version})));}\n catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;if((await inspectStored(id)).record.version===root.record.version)throw new MayuraError('CONFLICT','A workflow tree with a claimed or in-flight effect cannot enter the quiescent paused state.');}}\n throw new MayuraError('CONFLICT','Workflow-tree pause contention exceeded its bounded retry limit.');\n },\n async resume(id){\n await auth.require('run',id,'resume');\n if(!controls.resumeRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter does not provide durable workflow-tree pause.');\n for(let attempt=0;attempt<32;attempt++){const root=await inspectStored(id);if(workflowTreeState(root.record).status!=='paused')throw new MayuraError('CONFLICT','Only a paused workflow tree can be resumed.');\n try{return publicSnapshot(await call(()=>controls.resumeRoot!({...access(id),expectedVersion:root.record.version})));}\n catch(error){if(!(error instanceof StorageError&&error.storageCode==='CONFLICT'))throw error;}}\n throw new MayuraError('CONFLICT','Workflow-tree resume contention exceeded its bounded retry limit.');\n },\n async migrate(migration,command){\n open();assertWorkflowMigration(migration);supported(migration.from);supported(migration.to);\n const {id,actorId,commandId,dryRun=false}=migrationCommand(command);\n const root=await inspectStored(id);matchRoot(migration.from,root);const state=workflowTreeState(root.record);\n const nodes=(definition:AnyWorkflowTree)=>treeManifest(definition).graph.map(node=>({id:node.id,kind:node.kind,dependsOn:node.dependsOn,fingerprint:nodeFingerprint(node as unknown as Record<string,unknown>),...(nodeEvidence(node)?{evidence:nodeEvidence(node)!}:{})}));\n const fromNodes=nodes(migration.from);const toNodes=nodes(migration.to);\n const preconditions:MigrationBlocker[]=[];\n if(state.status!=='paused')preconditions.push({node:'*',reason:`The tree is ${state.status}; pause it before migrating.`});\n if(runs.has(id))preconditions.push({node:'*',reason:'This worker is still driving the tree; wait for its driver to stop.'});\n // A prepared job or an admitted child is durable history keyed by node: it must survive unchanged under its own id.\n for(const [nodeId,step] of Object.entries(state.steps))if(step.candidateHash!==null||step.child!==null){\n const before=fromNodes.find(node=>node.id===nodeId);const after=toNodes.find(node=>node.id===nodeId);\n if(!after||before?.fingerprint!==after.fingerprint||Object.values(migration.renames).includes(nodeId))preconditions.push({node:nodeId,reason:`Step \"${nodeId}\" has execution history; it must be kept unchanged.`});\n }\n // An admitted child that has not joined is still in flight from the root's point of view.\n const status=(step:typeof state.steps[string]):string=>step.child!==null&&step.child.joinedVersion===null?'running':step.status;\n const plan=planWorkflowMigration({migration,format:'tree-v4',runId:id,fromDigest:migration.from.digest,toDigest:migration.to.digest,from:fromNodes,to:toNodes,\n steps:Object.entries(state.steps).map(([step,value])=>({id:step,status:status(value)})),preconditions});\n if(dryRun)return freezeJson(jsonValue({plan})) as unknown as WorkflowMigrationResult<WorkflowTreeSnapshot>;\n assertMigrationAllowed(plan);\n if(!controls.migrateRoot)throw new MayuraError('UNSUPPORTED_PROFILE','This adapter cannot migrate in-flight workflow trees.');\n const manifest=treeManifest(migration.to);\n const fresh=initialWorkflowTreeRootState(manifest,state.input,id,migration.to.digest,state.policy,authority);\n const carried:Record<string,unknown>={};\n for(const entry of plan.entries)if(entry.target)carried[entry.target]=entry.action==='keep'||entry.action==='accept'?state.steps[entry.source!]:fresh.steps[entry.target];\n const steps=Object.fromEntries(manifest.graph.map(node=>[node.id,carried[node.id]]));\n const next={...state,maxNodes:migration.to.maxNodes===false?false:workflowNodeLimit(migration.to.maxNodes),definition:migration.to.digest,steps,reservedMicros:Object.values(steps).reduce<number>((sum,step)=>sum+(step as {costReserved:number}).costReserved,0)};\n const migrated=await call(()=>controls.migrateRoot!({...access(id),expectedVersion:root.record.version,commandId,manifest,resources:{},state:jsonValue(next) as never,migrationId:migration.id,actorId}));\n matchRoot(migration.to,migrated);\n return freezeJson(jsonValue({plan,snapshot:publicSnapshot(migrated)})) as unknown as WorkflowMigrationResult<WorkflowTreeSnapshot>;\n },\n async recoverExpired(id){await inspectStored(id);return publicSnapshot((await call(()=>api.recoverExpired({...access(id),limit:128}))).root);},\n async events(id,after=0){open();access(id);if(!Number.isSafeInteger(after)||after<0)throw new MayuraError('INVALID_INPUT','A non-negative event cursor is required.');await inspectStored(id);return call(()=>options.store.events(scopeKey,id,after));},\n close:closeRuntime,\n drain(options){return gate.drain(options,closeRuntime);},\n });\n}\n"]}
|
|
@@ -24,6 +24,8 @@ export type WorkflowNode = {
|
|
|
24
24
|
readonly dependsOn: readonly string[];
|
|
25
25
|
};
|
|
26
26
|
export interface WorkflowOptions<I extends Schema, O extends Schema> {
|
|
27
|
+
/** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */
|
|
28
|
+
readonly maxNodes?: number | false;
|
|
27
29
|
readonly id: string;
|
|
28
30
|
readonly version: string;
|
|
29
31
|
readonly input: I;
|
|
@@ -32,6 +34,8 @@ export interface WorkflowOptions<I extends Schema, O extends Schema> {
|
|
|
32
34
|
readonly result: Binding;
|
|
33
35
|
}
|
|
34
36
|
export interface WorkflowDefinition<I extends Schema = Schema, O extends Schema = Schema> {
|
|
37
|
+
/** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */
|
|
38
|
+
readonly maxNodes?: number | false;
|
|
35
39
|
readonly id: string;
|
|
36
40
|
readonly version: string;
|
|
37
41
|
readonly digest: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AACA,OAAO,EAAoD,KAAK,UAAU,EAAE,KAAK,WAAW,EAAmB,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AACjK,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAIzD,MAAM,MAAM,OAAO,GACf;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,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,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIlJ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { workflowNodeLimit } from '../../core/dist/index.js';
|
|
1
2
|
import { assertSchema, freezeJson, jsonValue, MayuraError } from '../../core/dist/index.js';
|
|
2
3
|
import { assertTool } from '../../tools/dist/index.js';
|
|
3
4
|
import { workflowHashMaterial } from '../../storage-contracts/dist/index.js';
|
|
@@ -36,8 +37,10 @@ export function defineWorkflow(options) {
|
|
|
36
37
|
throw new MayuraError('INVALID_CONFIG', 'Workflow id/version must be bounded identifiers.');
|
|
37
38
|
assertSchema(options.input);
|
|
38
39
|
assertSchema(options.output);
|
|
39
|
-
if (!Array.isArray(options.nodes) || options.nodes.length === 0 || options.nodes.length >
|
|
40
|
-
throw new MayuraError('INVALID_CONFIG', 'A workflow requires
|
|
40
|
+
if (!Array.isArray(options.nodes) || options.nodes.length === 0 || options.nodes.length > workflowNodeLimit(options.maxNodes))
|
|
41
|
+
throw new MayuraError('INVALID_CONFIG', 'A workflow requires nodes within its configured maxNodes bound.');
|
|
42
|
+
workflowNodeLimit(options.maxNodes);
|
|
43
|
+
const nodeLimit = options.maxNodes === undefined ? {} : { maxNodes: options.maxNodes };
|
|
41
44
|
const ids = new Set(options.nodes.map(node => node.id));
|
|
42
45
|
if (ids.size !== options.nodes.length || [...ids].some(id => !identifier.test(id) || ['constructor', 'prototype', '__proto__'].includes(id)))
|
|
43
46
|
throw new MayuraError('INVALID_CONFIG', 'Step identifiers must be unique and bounded.');
|
|
@@ -83,7 +86,7 @@ export function defineWorkflow(options) {
|
|
|
83
86
|
const standard = schema['~standard'];
|
|
84
87
|
return Object.freeze({ '~standard': Object.freeze({ version: 1, vendor: standard.vendor, validate: standard.validate.bind(standard) }) });
|
|
85
88
|
};
|
|
86
|
-
const definition = Object.freeze({ id: options.id, version: options.version, digest: digest('mayura:workflow:v1', { id: options.id, version: options.version, graph, result }), input: snapshot(options.input), output: snapshot(options.output), nodes: Object.freeze(nodes), result });
|
|
89
|
+
const definition = Object.freeze({ ...nodeLimit, id: options.id, version: options.version, digest: digest('mayura:workflow:v1', { id: options.id, version: options.version, ...nodeLimit, graph, result }), input: snapshot(options.input), output: snapshot(options.output), nodes: Object.freeze(nodes), result });
|
|
87
90
|
definitions.add(definition);
|
|
88
91
|
return definition;
|
|
89
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../src/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAmF,MAAM,cAAc,CAAC;AACjK,OAAO,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAqB9C,MAAM,UAAU,GAAG,iCAAiC,CAAC;AACrD,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAC;AAE1C,sEAAsE;AACtE,MAAM,UAAU,cAAc,CAAC,UAAuB;IACpD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,WAAW,CAAC,gBAAgB,EAAE,gDAAgD,CAAC,CAAC;AAC9H,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,MAAM,CAAC,MAAc,EAAE,KAAc;IACnD,OAAO,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,cAAc,CAAC,OAAgB,EAAE,GAAgB;IACxD,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,WAAW,CAAC,gBAAgB,EAAE,2BAA2B,C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CAAC,KAAK,CAAC,CAAC;IAChE,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;YAAE,MAAM,IAAI,WAAW,CAAC,eAAe,EAAE,2CAA2C,CAAC,CAAC;QACvK,KAAK,GAAI,KAAoB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,UAAgG,EAAE,QAAgB;IACxI,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAC;IACjC,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAC3E,OAAO,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnG,CAAC","sourcesContent":["import { assertSchema, freezeJson, jsonValue, MayuraError, type InferInput, type InferOutput, type JsonObject, type JsonValue, type Schema } from '@mayura/core';\nimport { assertTool, type AnyTool } from '@mayura/tools';\nimport { workflowHashMaterial } from '@mayura/storage-contracts';\nimport { sha256Hex } from '@mayura/core/host';\n\nexport type Binding =\n | { readonly kind: 'literal'; readonly value: JsonValue }\n | { readonly kind: 'input'; readonly path: readonly string[] }\n | { readonly kind: 'step'; readonly stepId: string; readonly path: readonly string[] };\nexport type WorkflowNode =\n | { readonly kind: 'tool'; readonly id: string; readonly tool: AnyTool; readonly input: Binding; readonly dependsOn?: readonly string[]; readonly approval?: boolean }\n | { readonly kind: 'join'; readonly id: string; readonly dependsOn: readonly string[] };\nexport interface WorkflowOptions<I extends Schema, O extends Schema> {\n readonly id: string; readonly version: string; readonly input: I; readonly output: O;\n readonly nodes: readonly WorkflowNode[]; readonly result: Binding;\n}\nexport interface WorkflowDefinition<I extends Schema = Schema, O extends Schema = Schema> {\n readonly id: string; readonly version: string; readonly digest: string;\n readonly input: Schema<InferInput<I>, InferOutput<I>>;\n readonly output: Schema<InferInput<O>, InferOutput<O>>;\n readonly nodes: readonly WorkflowNode[]; readonly result: Binding;\n}\nexport type AnyWorkflow = WorkflowDefinition;\nexport type WorkflowOutput<D extends AnyWorkflow> = InferOutput<D['output']>;\nconst identifier = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;\nconst definitions = new WeakSet<object>();\n\n/** Mutable/forged definitions cannot enter the durable dispatcher. */\nexport function assertWorkflow(definition: AnyWorkflow): void {\n if (!definitions.has(definition)) throw new MayuraError('INVALID_CONFIG', 'Use defineWorkflow from this package instance.');\n}\n\n/** Canonical, sorted-key JSON encoding, domain-separated before SHA-256. */\nexport function digest(domain: string, value: unknown): string {\n return sha256Hex(workflowHashMaterial(domain, value));\n}\n\nfunction checkedBinding(binding: Binding, ids: Set<string>): Binding {\n const value = jsonValue(binding);\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new MayuraError('INVALID_CONFIG', 'Invalid workflow binding.');\n if (binding.kind === 'literal') jsonValue(binding.value);\n else if (binding.kind === 'input' || binding.kind === 'step') {\n if (!Array.isArray(binding.path) || binding.path.length > 32 || binding.path.some(key => typeof key !== 'string' || ['__proto__', 'constructor', 'prototype'].includes(key))) {\n throw new MayuraError('INVALID_CONFIG', 'Binding path must contain safe property names.');\n }\n if (binding.kind === 'step' && !ids.has(binding.stepId)) throw new MayuraError('INVALID_CONFIG', 'Binding references an unknown step.');\n } else throw new MayuraError('INVALID_CONFIG', 'Unknown binding kind.');\n return freezeJson(value) as unknown as Binding;\n}\n\n/** Define a finite acyclic graph. No user expression strings or callback stacks are persisted. */\nexport function defineWorkflow<I extends Schema, O extends Schema>(options: WorkflowOptions<I, O>): WorkflowDefinition<I, O> {\n if (!options || !identifier.test(options.id) || typeof options.version !== 'string' || !options.version.length || options.version.length > 128) throw new MayuraError('INVALID_CONFIG', 'Workflow id/version must be bounded identifiers.');\n assertSchema(options.input); assertSchema(options.output);\n if (!Array.isArray(options.nodes) || options.nodes.length === 0 || options.nodes.length > 128) throw new MayuraError('INVALID_CONFIG', 'A workflow requires 1–128 nodes.');\n const ids = new Set(options.nodes.map(node => node.id));\n if (ids.size !== options.nodes.length || [...ids].some(id => !identifier.test(id) || ['constructor', 'prototype', '__proto__'].includes(id))) throw new MayuraError('INVALID_CONFIG', 'Step identifiers must be unique and bounded.');\n const nodes = options.nodes.map(node => {\n if (node.kind !== 'join' && node.kind !== 'tool') throw new MayuraError('INVALID_CONFIG', 'Unknown workflow node kind.');\n const dependencies = [...(node.dependsOn ?? [])];\n if (new Set(dependencies).size !== dependencies.length || dependencies.some(id => !ids.has(id))) throw new MayuraError('INVALID_CONFIG', 'Invalid workflow dependencies.');\n if (node.kind === 'tool') {\n if (!node.tool || typeof node.tool.id !== 'string') throw new MayuraError('INVALID_CONFIG', 'A registered tool definition is required.');\n assertTool(node.tool);\n if (node.approval !== undefined && typeof node.approval !== 'boolean') throw new MayuraError('INVALID_CONFIG', 'Approval configuration must be a boolean.');\n const binding = checkedBinding(node.input, ids);\n if (binding.kind === 'step' && !dependencies.includes(binding.stepId)) throw new MayuraError('INVALID_CONFIG', 'Step input must declare its output dependency.');\n return Object.freeze({ ...node, input: binding, dependsOn: Object.freeze(dependencies), approval: node.approval ?? false });\n }\n return Object.freeze({ ...node, dependsOn: Object.freeze(dependencies) });\n });\n const visiting = new Set<string>(); const visited = new Set<string>();\n const visit = (id: string): void => {\n if (visiting.has(id)) throw new MayuraError('INVALID_CONFIG', 'Workflow dependency cycle detected.');\n if (visited.has(id)) return;\n visiting.add(id);\n for (const dependency of nodes.find(node => node.id === id)!.dependsOn) visit(dependency);\n visiting.delete(id); visited.add(id);\n };\n for (const id of ids) visit(id);\n const result = checkedBinding(options.result, ids);\n const graph = nodes.map(node => node.kind === 'join'\n ? { id: node.id, kind: node.kind, dependsOn: node.dependsOn }\n : { id: node.id, kind: node.kind, dependsOn: node.dependsOn, tool: node.tool.id, toolVersion: node.tool.version, effects: node.tool.effects, capabilities: node.tool.capabilities, costMicros: node.tool.costMicros, approval: node.approval, input: node.input });\n const snapshot = <S extends Schema>(schema: S): Schema<InferInput<S>, InferOutput<S>> => {\n const standard = schema['~standard'];\n return Object.freeze({ '~standard': Object.freeze({ version: 1 as const, vendor: standard.vendor, validate: standard.validate.bind(standard) }) }) as Schema<InferInput<S>, InferOutput<S>>;\n };\n const definition = Object.freeze({ id: options.id, version: options.version, digest: digest('mayura:workflow:v1', { id: options.id, version: options.version, graph, result }), input: snapshot(options.input), output: snapshot(options.output), nodes: Object.freeze(nodes), result });\n definitions.add(definition);\n return definition;\n}\n\n/** Read a binding from already admitted state without prototype traversal. */\nexport function resolveBinding(binding: Binding, input: JsonValue, outputs: Readonly<Record<string, JsonValue>>): JsonValue {\n if (binding.kind === 'literal') return jsonValue(binding.value);\n let value = binding.kind === 'input' ? input : outputs[binding.stepId];\n for (const segment of binding.path) {\n if (value === null || typeof value !== 'object' || !Object.hasOwn(value, segment)) throw new MayuraError('INVALID_INPUT', 'Workflow binding cannot resolve its path.');\n value = (value as JsonObject)[segment];\n }\n return jsonValue(value);\n}\n\n/**\n * What a settled tool call costs a durable run: the usage the tool reported (known plus unknown, the unknown part\n * charged conservatively as spent), never more than what was reserved for it.\n */\nexport function charged(settlement: { readonly knownCostMicros: number; readonly unknownCostMicros: number } | undefined, reserved: number): number {\n if (!settlement) return reserved;\n const reported = settlement.knownCostMicros + settlement.unknownCostMicros;\n return Number.isSafeInteger(reported) && reported >= 0 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gB,EAAE,KAAgB,EAAE,OAA4C;IAC7G,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAChE,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvE,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC;YAAE,MAAM,IAAI,WAAW,CAAC,eAAe,EAAE,2CAA2C,CAAC,CAAC;QACvK,KAAK,GAAI,KAAoB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,UAAgG,EAAE,QAAgB;IACxI,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAC;IACjC,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAC3E,OAAO,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACnG,CAAC","sourcesContent":["import { workflowNodeLimit } from '@mayura/core';\nimport { assertSchema, freezeJson, jsonValue, MayuraError, type InferInput, type InferOutput, type JsonObject, type JsonValue, type Schema } from '@mayura/core';\nimport { assertTool, type AnyTool } from '@mayura/tools';\nimport { workflowHashMaterial } from '@mayura/storage-contracts';\nimport { sha256Hex } from '@mayura/core/host';\n\nexport type Binding =\n | { readonly kind: 'literal'; readonly value: JsonValue }\n | { readonly kind: 'input'; readonly path: readonly string[] }\n | { readonly kind: 'step'; readonly stepId: string; readonly path: readonly string[] };\nexport type WorkflowNode =\n | { readonly kind: 'tool'; readonly id: string; readonly tool: AnyTool; readonly input: Binding; readonly dependsOn?: readonly string[]; readonly approval?: boolean }\n | { readonly kind: 'join'; readonly id: string; readonly dependsOn: readonly string[] };\nexport interface WorkflowOptions<I extends Schema, O extends Schema> {\n /** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */\n readonly maxNodes?: number | false;\n readonly id: string; readonly version: string; readonly input: I; readonly output: O;\n readonly nodes: readonly WorkflowNode[]; readonly result: Binding;\n}\nexport interface WorkflowDefinition<I extends Schema = Schema, O extends Schema = Schema> {\n /** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */\n readonly maxNodes?: number | false;\n readonly id: string; readonly version: string; readonly digest: string;\n readonly input: Schema<InferInput<I>, InferOutput<I>>;\n readonly output: Schema<InferInput<O>, InferOutput<O>>;\n readonly nodes: readonly WorkflowNode[]; readonly result: Binding;\n}\nexport type AnyWorkflow = WorkflowDefinition;\nexport type WorkflowOutput<D extends AnyWorkflow> = InferOutput<D['output']>;\nconst identifier = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/;\nconst definitions = new WeakSet<object>();\n\n/** Mutable/forged definitions cannot enter the durable dispatcher. */\nexport function assertWorkflow(definition: AnyWorkflow): void {\n if (!definitions.has(definition)) throw new MayuraError('INVALID_CONFIG', 'Use defineWorkflow from this package instance.');\n}\n\n/** Canonical, sorted-key JSON encoding, domain-separated before SHA-256. */\nexport function digest(domain: string, value: unknown): string {\n return sha256Hex(workflowHashMaterial(domain, value));\n}\n\nfunction checkedBinding(binding: Binding, ids: Set<string>): Binding {\n const value = jsonValue(binding);\n if (!value || typeof value !== 'object' || Array.isArray(value)) throw new MayuraError('INVALID_CONFIG', 'Invalid workflow binding.');\n if (binding.kind === 'literal') jsonValue(binding.value);\n else if (binding.kind === 'input' || binding.kind === 'step') {\n if (!Array.isArray(binding.path) || binding.path.length > 32 || binding.path.some(key => typeof key !== 'string' || ['__proto__', 'constructor', 'prototype'].includes(key))) {\n throw new MayuraError('INVALID_CONFIG', 'Binding path must contain safe property names.');\n }\n if (binding.kind === 'step' && !ids.has(binding.stepId)) throw new MayuraError('INVALID_CONFIG', 'Binding references an unknown step.');\n } else throw new MayuraError('INVALID_CONFIG', 'Unknown binding kind.');\n return freezeJson(value) as unknown as Binding;\n}\n\n/** Define a finite acyclic graph. No user expression strings or callback stacks are persisted. */\nexport function defineWorkflow<I extends Schema, O extends Schema>(options: WorkflowOptions<I, O>): WorkflowDefinition<I, O> {\n if (!options || !identifier.test(options.id) || typeof options.version !== 'string' || !options.version.length || options.version.length > 128) throw new MayuraError('INVALID_CONFIG', 'Workflow id/version must be bounded identifiers.');\n assertSchema(options.input); assertSchema(options.output);\n if (!Array.isArray(options.nodes) || options.nodes.length === 0 || options.nodes.length > workflowNodeLimit(options.maxNodes)) throw new MayuraError('INVALID_CONFIG', 'A workflow requires nodes within its configured maxNodes bound.');\n workflowNodeLimit(options.maxNodes);\n const nodeLimit = options.maxNodes === undefined ? {} : { maxNodes: options.maxNodes };\n const ids = new Set(options.nodes.map(node => node.id));\n if (ids.size !== options.nodes.length || [...ids].some(id => !identifier.test(id) || ['constructor', 'prototype', '__proto__'].includes(id))) throw new MayuraError('INVALID_CONFIG', 'Step identifiers must be unique and bounded.');\n const nodes = options.nodes.map(node => {\n if (node.kind !== 'join' && node.kind !== 'tool') throw new MayuraError('INVALID_CONFIG', 'Unknown workflow node kind.');\n const dependencies = [...(node.dependsOn ?? [])];\n if (new Set(dependencies).size !== dependencies.length || dependencies.some(id => !ids.has(id))) throw new MayuraError('INVALID_CONFIG', 'Invalid workflow dependencies.');\n if (node.kind === 'tool') {\n if (!node.tool || typeof node.tool.id !== 'string') throw new MayuraError('INVALID_CONFIG', 'A registered tool definition is required.');\n assertTool(node.tool);\n if (node.approval !== undefined && typeof node.approval !== 'boolean') throw new MayuraError('INVALID_CONFIG', 'Approval configuration must be a boolean.');\n const binding = checkedBinding(node.input, ids);\n if (binding.kind === 'step' && !dependencies.includes(binding.stepId)) throw new MayuraError('INVALID_CONFIG', 'Step input must declare its output dependency.');\n return Object.freeze({ ...node, input: binding, dependsOn: Object.freeze(dependencies), approval: node.approval ?? false });\n }\n return Object.freeze({ ...node, dependsOn: Object.freeze(dependencies) });\n });\n const visiting = new Set<string>(); const visited = new Set<string>();\n const visit = (id: string): void => {\n if (visiting.has(id)) throw new MayuraError('INVALID_CONFIG', 'Workflow dependency cycle detected.');\n if (visited.has(id)) return;\n visiting.add(id);\n for (const dependency of nodes.find(node => node.id === id)!.dependsOn) visit(dependency);\n visiting.delete(id); visited.add(id);\n };\n for (const id of ids) visit(id);\n const result = checkedBinding(options.result, ids);\n const graph = nodes.map(node => node.kind === 'join'\n ? { id: node.id, kind: node.kind, dependsOn: node.dependsOn }\n : { id: node.id, kind: node.kind, dependsOn: node.dependsOn, tool: node.tool.id, toolVersion: node.tool.version, effects: node.tool.effects, capabilities: node.tool.capabilities, costMicros: node.tool.costMicros, approval: node.approval, input: node.input });\n const snapshot = <S extends Schema>(schema: S): Schema<InferInput<S>, InferOutput<S>> => {\n const standard = schema['~standard'];\n return Object.freeze({ '~standard': Object.freeze({ version: 1 as const, vendor: standard.vendor, validate: standard.validate.bind(standard) }) }) as Schema<InferInput<S>, InferOutput<S>>;\n };\n const definition = Object.freeze({ ...nodeLimit, id: options.id, version: options.version, digest: digest('mayura:workflow:v1', { id: options.id, version: options.version, ...nodeLimit, graph, result }), input: snapshot(options.input), output: snapshot(options.output), nodes: Object.freeze(nodes), result });\n definitions.add(definition);\n return definition;\n}\n\n/** Read a binding from already admitted state without prototype traversal. */\nexport function resolveBinding(binding: Binding, input: JsonValue, outputs: Readonly<Record<string, JsonValue>>): JsonValue {\n if (binding.kind === 'literal') return jsonValue(binding.value);\n let value = binding.kind === 'input' ? input : outputs[binding.stepId];\n for (const segment of binding.path) {\n if (value === null || typeof value !== 'object' || !Object.hasOwn(value, segment)) throw new MayuraError('INVALID_INPUT', 'Workflow binding cannot resolve its path.');\n value = (value as JsonObject)[segment];\n }\n return jsonValue(value);\n}\n\n/**\n * What a settled tool call costs a durable run: the usage the tool reported (known plus unknown, the unknown part\n * charged conservatively as spent), never more than what was reserved for it.\n */\nexport function charged(settlement: { readonly knownCostMicros: number; readonly unknownCostMicros: number } | undefined, reserved: number): number {\n if (!settlement) return reserved;\n const reported = settlement.knownCostMicros + settlement.unknownCostMicros;\n return Number.isSafeInteger(reported) && reported >= 0 ? Math.min(reported, reserved) : reserved;\n}\n"]}
|
|
@@ -10,6 +10,8 @@ export type WorkflowGraphNode = WorkflowNode | {
|
|
|
10
10
|
readonly targets: WorkflowGraphTargetBinding;
|
|
11
11
|
};
|
|
12
12
|
export interface WorkflowGraphOptions<I extends Schema, O extends Schema> {
|
|
13
|
+
/** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */
|
|
14
|
+
readonly maxNodes?: number | false;
|
|
13
15
|
readonly id: string;
|
|
14
16
|
readonly version: string;
|
|
15
17
|
readonly input: I;
|
|
@@ -19,6 +21,8 @@ export interface WorkflowGraphOptions<I extends Schema, O extends Schema> {
|
|
|
19
21
|
}
|
|
20
22
|
declare const graphDefinitionBrand: unique symbol;
|
|
21
23
|
export interface WorkflowGraphDefinition<I extends Schema = Schema, O extends Schema = Schema> {
|
|
24
|
+
/** Per-graph bound: defaults to 128; finite maximum 512; false disables node-count admission. */
|
|
25
|
+
readonly maxNodes?: number | false;
|
|
22
26
|
readonly [graphDefinitionBrand]: true;
|
|
23
27
|
readonly format: 3;
|
|
24
28
|
readonly id: string;
|
|
@@ -34,7 +38,7 @@ export type WorkflowGraphOutput<D extends AnyWorkflowGraph> = InferOutput<D['out
|
|
|
34
38
|
/** A graph definition is local executable code, never a deserialized authority grant. */
|
|
35
39
|
export declare function assertWorkflowGraph(definition: AnyWorkflowGraph): void;
|
|
36
40
|
/** Build the exact versioned, data-only material admitted by the storage contract. */
|
|
37
|
-
export declare function graphManifest(definition: Pick<AnyWorkflowGraph, 'id' | 'version' | 'nodes' | 'result'>): WorkflowGraphManifest;
|
|
41
|
+
export declare function graphManifest(definition: Pick<AnyWorkflowGraph, 'id' | 'version' | 'nodes' | 'result' | 'maxNodes'>): WorkflowGraphManifest;
|
|
38
42
|
/** Define a finite format-3 graph; existing format-2 factories retain their exact contract. */
|
|
39
43
|
export declare function defineWorkflowGraph<I extends Schema, O extends Schema>(options: WorkflowGraphOptions<I, O>): WorkflowGraphDefinition<I, O>;
|
|
40
44
|
//# sourceMappingURL=graph-definition.d.ts.map
|