mayura 0.1.0-dev.0
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/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +55 -0
- package/lib/adapter-code-docker/dist/index.d.ts +65 -0
- package/lib/adapter-code-docker/dist/index.d.ts.map +1 -0
- package/lib/adapter-code-docker/dist/index.js +228 -0
- package/lib/adapter-code-docker/dist/index.js.map +1 -0
- package/lib/adapter-code-docker/image/Dockerfile +12 -0
- package/lib/adapter-code-docker/package.json +5 -0
- package/lib/adapter-code-docker/src/index.ts +244 -0
- package/lib/adapter-code-quickjs/dist/index.d.ts +40 -0
- package/lib/adapter-code-quickjs/dist/index.d.ts.map +1 -0
- package/lib/adapter-code-quickjs/dist/index.js +169 -0
- package/lib/adapter-code-quickjs/dist/index.js.map +1 -0
- package/lib/adapter-code-quickjs/dist/worker.d.ts +2 -0
- package/lib/adapter-code-quickjs/dist/worker.d.ts.map +1 -0
- package/lib/adapter-code-quickjs/dist/worker.js +164 -0
- package/lib/adapter-code-quickjs/dist/worker.js.map +1 -0
- package/lib/adapter-code-quickjs/package.json +5 -0
- package/lib/adapter-code-quickjs/src/index.ts +174 -0
- package/lib/adapter-code-quickjs/src/worker.ts +142 -0
- package/lib/adapter-mcp/dist/index.d.ts +29 -0
- package/lib/adapter-mcp/dist/index.d.ts.map +1 -0
- package/lib/adapter-mcp/dist/index.js +54 -0
- package/lib/adapter-mcp/dist/index.js.map +1 -0
- package/lib/adapter-mcp/package.json +5 -0
- package/lib/adapter-mcp/src/index.ts +82 -0
- package/lib/artifacts/dist/contracts.d.ts +139 -0
- package/lib/artifacts/dist/contracts.d.ts.map +1 -0
- package/lib/artifacts/dist/contracts.js +2 -0
- package/lib/artifacts/dist/contracts.js.map +1 -0
- package/lib/artifacts/dist/index.d.ts +3 -0
- package/lib/artifacts/dist/index.d.ts.map +1 -0
- package/lib/artifacts/dist/index.js +2 -0
- package/lib/artifacts/dist/index.js.map +1 -0
- package/lib/artifacts/dist/local-store.d.ts +3 -0
- package/lib/artifacts/dist/local-store.d.ts.map +1 -0
- package/lib/artifacts/dist/local-store.js +922 -0
- package/lib/artifacts/dist/local-store.js.map +1 -0
- package/lib/artifacts/package.json +5 -0
- package/lib/artifacts/src/contracts.ts +159 -0
- package/lib/artifacts/src/index.ts +26 -0
- package/lib/artifacts/src/local-store.ts +816 -0
- package/lib/cli/dist/application.d.ts +85 -0
- package/lib/cli/dist/application.d.ts.map +1 -0
- package/lib/cli/dist/application.js +116 -0
- package/lib/cli/dist/application.js.map +1 -0
- package/lib/cli/dist/bin.d.ts +3 -0
- package/lib/cli/dist/bin.d.ts.map +1 -0
- package/lib/cli/dist/bin.js +394 -0
- package/lib/cli/dist/bin.js.map +1 -0
- package/lib/cli/dist/dev.d.ts +21 -0
- package/lib/cli/dist/dev.d.ts.map +1 -0
- package/lib/cli/dist/dev.js +205 -0
- package/lib/cli/dist/dev.js.map +1 -0
- package/lib/cli/dist/index.d.ts +72 -0
- package/lib/cli/dist/index.d.ts.map +1 -0
- package/lib/cli/dist/index.js +423 -0
- package/lib/cli/dist/index.js.map +1 -0
- package/lib/cli/dist/interactive.d.ts +19 -0
- package/lib/cli/dist/interactive.d.ts.map +1 -0
- package/lib/cli/dist/interactive.js +163 -0
- package/lib/cli/dist/interactive.js.map +1 -0
- package/lib/cli/dist/operations.d.ts +215 -0
- package/lib/cli/dist/operations.d.ts.map +1 -0
- package/lib/cli/dist/operations.js +580 -0
- package/lib/cli/dist/operations.js.map +1 -0
- package/lib/cli/dist/output.d.ts +29 -0
- package/lib/cli/dist/output.d.ts.map +1 -0
- package/lib/cli/dist/output.js +244 -0
- package/lib/cli/dist/output.js.map +1 -0
- package/lib/cli/dist/providers.d.ts +54 -0
- package/lib/cli/dist/providers.d.ts.map +1 -0
- package/lib/cli/dist/providers.js +96 -0
- package/lib/cli/dist/providers.js.map +1 -0
- package/lib/cli/package.json +5 -0
- package/lib/cli/src/application.ts +109 -0
- package/lib/cli/src/bin.ts +261 -0
- package/lib/cli/src/dev.ts +139 -0
- package/lib/cli/src/index.ts +386 -0
- package/lib/cli/src/interactive.ts +132 -0
- package/lib/cli/src/operations.ts +458 -0
- package/lib/cli/src/output.ts +205 -0
- package/lib/cli/src/providers.ts +102 -0
- package/lib/cli/starters/approval-workflow/Dockerfile +20 -0
- package/lib/cli/starters/approval-workflow/README.md +102 -0
- package/lib/cli/starters/approval-workflow/compose.yaml +33 -0
- package/lib/cli/starters/approval-workflow/dot-dockerignore +7 -0
- package/lib/cli/starters/approval-workflow/dot-env.example +41 -0
- package/lib/cli/starters/approval-workflow/dot-github/workflows/ci.yml +13 -0
- package/lib/cli/starters/approval-workflow/dot-gitignore +10 -0
- package/lib/cli/starters/approval-workflow/mayura.project.json +16 -0
- package/lib/cli/starters/approval-workflow/package.json +30 -0
- package/lib/cli/starters/approval-workflow/src/app.ts +19 -0
- package/lib/cli/starters/approval-workflow/src/auth.ts +68 -0
- package/lib/cli/starters/approval-workflow/src/config.ts +107 -0
- package/lib/cli/starters/approval-workflow/src/dev.ts +59 -0
- package/lib/cli/starters/approval-workflow/src/intake.ts +104 -0
- package/lib/cli/starters/approval-workflow/src/model.ts +33 -0
- package/lib/cli/starters/approval-workflow/src/server.ts +56 -0
- package/lib/cli/starters/approval-workflow/src/services.ts +26 -0
- package/lib/cli/starters/approval-workflow/src/token.ts +6 -0
- package/lib/cli/starters/approval-workflow/src/worker.ts +18 -0
- package/lib/cli/starters/approval-workflow/src/workflow.ts +100 -0
- package/lib/cli/starters/approval-workflow/test/refunds.test.ts +140 -0
- package/lib/cli/starters/approval-workflow/tsconfig.json +20 -0
- package/lib/cli/starters/event-automation/Dockerfile +21 -0
- package/lib/cli/starters/event-automation/README.md +150 -0
- package/lib/cli/starters/event-automation/compose.yaml +41 -0
- package/lib/cli/starters/event-automation/dot-dockerignore +7 -0
- package/lib/cli/starters/event-automation/dot-env.example +51 -0
- package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +13 -0
- package/lib/cli/starters/event-automation/dot-gitignore +10 -0
- package/lib/cli/starters/event-automation/mayura.project.json +17 -0
- package/lib/cli/starters/event-automation/package.json +32 -0
- package/lib/cli/starters/event-automation/src/app.ts +19 -0
- package/lib/cli/starters/event-automation/src/auth.ts +61 -0
- package/lib/cli/starters/event-automation/src/config.ts +138 -0
- package/lib/cli/starters/event-automation/src/dev.ts +54 -0
- package/lib/cli/starters/event-automation/src/ingress.ts +129 -0
- package/lib/cli/starters/event-automation/src/mcp.ts +139 -0
- package/lib/cli/starters/event-automation/src/model.ts +33 -0
- package/lib/cli/starters/event-automation/src/send-sample.ts +29 -0
- package/lib/cli/starters/event-automation/src/server.ts +58 -0
- package/lib/cli/starters/event-automation/src/services.ts +54 -0
- package/lib/cli/starters/event-automation/src/signing.ts +30 -0
- package/lib/cli/starters/event-automation/src/token.ts +7 -0
- package/lib/cli/starters/event-automation/src/tracker/main.ts +18 -0
- package/lib/cli/starters/event-automation/src/tracker/mcp-server.ts +145 -0
- package/lib/cli/starters/event-automation/src/tracker/samples.ts +19 -0
- package/lib/cli/starters/event-automation/src/tracker/tickets.ts +54 -0
- package/lib/cli/starters/event-automation/src/tracker-tools.ts +38 -0
- package/lib/cli/starters/event-automation/src/triage.ts +151 -0
- package/lib/cli/starters/event-automation/src/worker.ts +19 -0
- package/lib/cli/starters/event-automation/src/workflows.ts +57 -0
- package/lib/cli/starters/event-automation/test/automation.test.ts +200 -0
- package/lib/cli/starters/event-automation/tsconfig.json +20 -0
- package/lib/cli/starters/research-team/Dockerfile +22 -0
- package/lib/cli/starters/research-team/README.md +189 -0
- package/lib/cli/starters/research-team/compose.yaml +38 -0
- package/lib/cli/starters/research-team/dot-dockerignore +7 -0
- package/lib/cli/starters/research-team/dot-env.example +49 -0
- package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +13 -0
- package/lib/cli/starters/research-team/dot-gitignore +10 -0
- package/lib/cli/starters/research-team/mayura.project.json +22 -0
- package/lib/cli/starters/research-team/package.json +30 -0
- package/lib/cli/starters/research-team/src/app.ts +19 -0
- package/lib/cli/starters/research-team/src/auth.ts +56 -0
- package/lib/cli/starters/research-team/src/config.ts +170 -0
- package/lib/cli/starters/research-team/src/desk.ts +124 -0
- package/lib/cli/starters/research-team/src/dev.ts +58 -0
- package/lib/cli/starters/research-team/src/library/corpus.ts +76 -0
- package/lib/cli/starters/research-team/src/library/index.ts +109 -0
- package/lib/cli/starters/research-team/src/model.ts +33 -0
- package/lib/cli/starters/research-team/src/server.ts +69 -0
- package/lib/cli/starters/research-team/src/services.ts +48 -0
- package/lib/cli/starters/research-team/src/team.ts +173 -0
- package/lib/cli/starters/research-team/src/telemetry.ts +95 -0
- package/lib/cli/starters/research-team/src/token.ts +6 -0
- package/lib/cli/starters/research-team/src/worker.ts +21 -0
- package/lib/cli/starters/research-team/src/workflow.ts +197 -0
- package/lib/cli/starters/research-team/test/research.test.ts +271 -0
- package/lib/cli/starters/research-team/tsconfig.json +20 -0
- package/lib/cli/starters/support-agent/Dockerfile +21 -0
- package/lib/cli/starters/support-agent/README.md +128 -0
- package/lib/cli/starters/support-agent/compose.yaml +33 -0
- package/lib/cli/starters/support-agent/dot-dockerignore +7 -0
- package/lib/cli/starters/support-agent/dot-env.example +44 -0
- package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +13 -0
- package/lib/cli/starters/support-agent/dot-gitignore +10 -0
- package/lib/cli/starters/support-agent/mayura.project.json +18 -0
- package/lib/cli/starters/support-agent/package.json +43 -0
- package/lib/cli/starters/support-agent/src/app.ts +19 -0
- package/lib/cli/starters/support-agent/src/assistant.ts +313 -0
- package/lib/cli/starters/support-agent/src/auth.ts +69 -0
- package/lib/cli/starters/support-agent/src/config.ts +120 -0
- package/lib/cli/starters/support-agent/src/dev.ts +115 -0
- package/lib/cli/starters/support-agent/src/guardrails.ts +71 -0
- package/lib/cli/starters/support-agent/src/model.ts +33 -0
- package/lib/cli/starters/support-agent/src/orders.ts +62 -0
- package/lib/cli/starters/support-agent/src/returns.ts +86 -0
- package/lib/cli/starters/support-agent/src/server.ts +72 -0
- package/lib/cli/starters/support-agent/src/services.ts +32 -0
- package/lib/cli/starters/support-agent/src/session.ts +55 -0
- package/lib/cli/starters/support-agent/src/token.ts +9 -0
- package/lib/cli/starters/support-agent/src/worker.ts +19 -0
- package/lib/cli/starters/support-agent/test/support.test.ts +263 -0
- package/lib/cli/starters/support-agent/tsconfig.json +20 -0
- package/lib/cli/starters/support-agent/web/index.html +12 -0
- package/lib/cli/starters/support-agent/web/src/App.tsx +43 -0
- package/lib/cli/starters/support-agent/web/src/components/chat.tsx +161 -0
- package/lib/cli/starters/support-agent/web/src/components/ui/button.tsx +33 -0
- package/lib/cli/starters/support-agent/web/src/components/ui/primitives.tsx +48 -0
- package/lib/cli/starters/support-agent/web/src/env.d.ts +1 -0
- package/lib/cli/starters/support-agent/web/src/lib/api.ts +56 -0
- package/lib/cli/starters/support-agent/web/src/lib/utils.ts +4 -0
- package/lib/cli/starters/support-agent/web/src/main.tsx +6 -0
- package/lib/cli/starters/support-agent/web/src/styles.css +86 -0
- package/lib/cli/starters/support-agent/web/tsconfig.json +9 -0
- package/lib/cli/starters/support-agent/web/vite.config.ts +13 -0
- package/lib/cli/templates/basic-agent.ts +10 -0
- package/lib/cli/templates/capability-policy.ts +18 -0
- package/lib/cli/templates/code-mode-workflow.ts +34 -0
- package/lib/cli/templates/durable-approval.ts +25 -0
- package/lib/cli/templates/guarded-streaming-app.ts +23 -0
- package/lib/cli/templates/native-memory.ts +15 -0
- package/lib/cli/templates/parallel-research.ts +21 -0
- package/lib/cli/templates/typed-tool-runner.ts +15 -0
- package/lib/client/dist/forms.d.ts +77 -0
- package/lib/client/dist/forms.d.ts.map +1 -0
- package/lib/client/dist/forms.js +282 -0
- package/lib/client/dist/forms.js.map +1 -0
- package/lib/client/dist/headless.d.ts +84 -0
- package/lib/client/dist/headless.d.ts.map +1 -0
- package/lib/client/dist/headless.js +376 -0
- package/lib/client/dist/headless.js.map +1 -0
- package/lib/client/dist/index.d.ts +266 -0
- package/lib/client/dist/index.d.ts.map +1 -0
- package/lib/client/dist/index.js +814 -0
- package/lib/client/dist/index.js.map +1 -0
- package/lib/client/dist/workflows.d.ts +128 -0
- package/lib/client/dist/workflows.d.ts.map +1 -0
- package/lib/client/dist/workflows.js +379 -0
- package/lib/client/dist/workflows.js.map +1 -0
- package/lib/client/package.json +5 -0
- package/lib/client/src/forms.ts +215 -0
- package/lib/client/src/headless.ts +265 -0
- package/lib/client/src/index.ts +646 -0
- package/lib/client/src/workflows.ts +307 -0
- package/lib/client-react/dist/components.d.ts +70 -0
- package/lib/client-react/dist/components.d.ts.map +1 -0
- package/lib/client-react/dist/components.js +173 -0
- package/lib/client-react/dist/components.js.map +1 -0
- package/lib/client-react/dist/index.d.ts +29 -0
- package/lib/client-react/dist/index.d.ts.map +1 -0
- package/lib/client-react/dist/index.js +57 -0
- package/lib/client-react/dist/index.js.map +1 -0
- package/lib/client-react/package.json +5 -0
- package/lib/client-react/src/components.ts +183 -0
- package/lib/client-react/src/index.ts +70 -0
- package/lib/code-mode/dist/index.d.ts +142 -0
- package/lib/code-mode/dist/index.d.ts.map +1 -0
- package/lib/code-mode/dist/index.js +498 -0
- package/lib/code-mode/dist/index.js.map +1 -0
- package/lib/code-mode/package.json +5 -0
- package/lib/code-mode/src/index.ts +605 -0
- package/lib/code-mode-workflows/dist/index.d.ts +51 -0
- package/lib/code-mode-workflows/dist/index.d.ts.map +1 -0
- package/lib/code-mode-workflows/dist/index.js +231 -0
- package/lib/code-mode-workflows/dist/index.js.map +1 -0
- package/lib/code-mode-workflows/package.json +5 -0
- package/lib/code-mode-workflows/src/index.ts +259 -0
- package/lib/context/dist/assemble.d.ts +11 -0
- package/lib/context/dist/assemble.d.ts.map +1 -0
- package/lib/context/dist/assemble.js +265 -0
- package/lib/context/dist/assemble.js.map +1 -0
- package/lib/context/dist/cache.d.ts +53 -0
- package/lib/context/dist/cache.d.ts.map +1 -0
- package/lib/context/dist/cache.js +147 -0
- package/lib/context/dist/cache.js.map +1 -0
- package/lib/context/dist/contracts.d.ts +145 -0
- package/lib/context/dist/contracts.d.ts.map +1 -0
- package/lib/context/dist/contracts.js +2 -0
- package/lib/context/dist/contracts.js.map +1 -0
- package/lib/context/dist/index.d.ts +4 -0
- package/lib/context/dist/index.d.ts.map +1 -0
- package/lib/context/dist/index.js +3 -0
- package/lib/context/dist/index.js.map +1 -0
- package/lib/context/package.json +5 -0
- package/lib/context/src/assemble.ts +205 -0
- package/lib/context/src/cache.ts +143 -0
- package/lib/context/src/contracts.ts +124 -0
- package/lib/context/src/index.ts +3 -0
- package/lib/core/dist/budget.d.ts +85 -0
- package/lib/core/dist/budget.d.ts.map +1 -0
- package/lib/core/dist/budget.js +328 -0
- package/lib/core/dist/budget.js.map +1 -0
- package/lib/core/dist/contracts.d.ts +156 -0
- package/lib/core/dist/contracts.d.ts.map +1 -0
- package/lib/core/dist/contracts.js +13 -0
- package/lib/core/dist/contracts.js.map +1 -0
- package/lib/core/dist/errors.d.ts +17 -0
- package/lib/core/dist/errors.d.ts.map +1 -0
- package/lib/core/dist/errors.js +22 -0
- package/lib/core/dist/errors.js.map +1 -0
- package/lib/core/dist/event-stream.d.ts +26 -0
- package/lib/core/dist/event-stream.d.ts.map +1 -0
- package/lib/core/dist/event-stream.js +116 -0
- package/lib/core/dist/event-stream.js.map +1 -0
- package/lib/core/dist/host.d.ts +7 -0
- package/lib/core/dist/host.d.ts.map +1 -0
- package/lib/core/dist/host.js +7 -0
- package/lib/core/dist/host.js.map +1 -0
- package/lib/core/dist/index.d.ts +8 -0
- package/lib/core/dist/index.d.ts.map +1 -0
- package/lib/core/dist/index.js +7 -0
- package/lib/core/dist/index.js.map +1 -0
- package/lib/core/dist/json.d.ts +18 -0
- package/lib/core/dist/json.d.ts.map +1 -0
- package/lib/core/dist/json.js +100 -0
- package/lib/core/dist/json.js.map +1 -0
- package/lib/core/dist/lifecycle.d.ts +45 -0
- package/lib/core/dist/lifecycle.d.ts.map +1 -0
- package/lib/core/dist/lifecycle.js +114 -0
- package/lib/core/dist/lifecycle.js.map +1 -0
- package/lib/core/dist/local-guards.d.ts +4 -0
- package/lib/core/dist/local-guards.d.ts.map +1 -0
- package/lib/core/dist/local-guards.js +47 -0
- package/lib/core/dist/local-guards.js.map +1 -0
- package/lib/core/dist/managed-guards.d.ts +44 -0
- package/lib/core/dist/managed-guards.d.ts.map +1 -0
- package/lib/core/dist/managed-guards.js +146 -0
- package/lib/core/dist/managed-guards.js.map +1 -0
- package/lib/core/dist/schema.d.ts +36 -0
- package/lib/core/dist/schema.d.ts.map +1 -0
- package/lib/core/dist/schema.js +24 -0
- package/lib/core/dist/schema.js.map +1 -0
- package/lib/core/package.json +5 -0
- package/lib/core/src/budget.ts +366 -0
- package/lib/core/src/contracts.ts +107 -0
- package/lib/core/src/errors.ts +33 -0
- package/lib/core/src/event-stream.ts +87 -0
- package/lib/core/src/host.ts +6 -0
- package/lib/core/src/index.ts +7 -0
- package/lib/core/src/json.ts +81 -0
- package/lib/core/src/lifecycle.ts +133 -0
- package/lib/core/src/local-guards.ts +37 -0
- package/lib/core/src/managed-guards.ts +154 -0
- package/lib/core/src/schema.ts +43 -0
- package/lib/exporter-otlp/dist/contracts.d.ts +112 -0
- package/lib/exporter-otlp/dist/contracts.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/contracts.js +2 -0
- package/lib/exporter-otlp/dist/contracts.js.map +1 -0
- package/lib/exporter-otlp/dist/index.d.ts +5 -0
- package/lib/exporter-otlp/dist/index.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/index.js +4 -0
- package/lib/exporter-otlp/dist/index.js.map +1 -0
- package/lib/exporter-otlp/dist/otlp-http-json.d.ts +4 -0
- package/lib/exporter-otlp/dist/otlp-http-json.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/otlp-http-json.js +286 -0
- package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -0
- package/lib/exporter-otlp/dist/run-traces.d.ts +15 -0
- package/lib/exporter-otlp/dist/run-traces.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/run-traces.js +114 -0
- package/lib/exporter-otlp/dist/run-traces.js.map +1 -0
- package/lib/exporter-otlp/dist/signals.d.ts +4 -0
- package/lib/exporter-otlp/dist/signals.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/signals.js +330 -0
- package/lib/exporter-otlp/dist/signals.js.map +1 -0
- package/lib/exporter-otlp/package.json +5 -0
- package/lib/exporter-otlp/src/contracts.ts +119 -0
- package/lib/exporter-otlp/src/index.ts +23 -0
- package/lib/exporter-otlp/src/otlp-http-json.ts +189 -0
- package/lib/exporter-otlp/src/run-traces.ts +86 -0
- package/lib/exporter-otlp/src/signals.ts +185 -0
- package/lib/guardrails/dist/agent-guard.d.ts +9 -0
- package/lib/guardrails/dist/agent-guard.d.ts.map +1 -0
- package/lib/guardrails/dist/agent-guard.js +23 -0
- package/lib/guardrails/dist/agent-guard.js.map +1 -0
- package/lib/guardrails/dist/auxiliary-helpers.d.ts +63 -0
- package/lib/guardrails/dist/auxiliary-helpers.d.ts.map +1 -0
- package/lib/guardrails/dist/auxiliary-helpers.js +147 -0
- package/lib/guardrails/dist/auxiliary-helpers.js.map +1 -0
- package/lib/guardrails/dist/auxiliary.d.ts +51 -0
- package/lib/guardrails/dist/auxiliary.d.ts.map +1 -0
- package/lib/guardrails/dist/auxiliary.js +230 -0
- package/lib/guardrails/dist/auxiliary.js.map +1 -0
- package/lib/guardrails/dist/batches.d.ts +18 -0
- package/lib/guardrails/dist/batches.d.ts.map +1 -0
- package/lib/guardrails/dist/batches.js +160 -0
- package/lib/guardrails/dist/batches.js.map +1 -0
- package/lib/guardrails/dist/disclosure.d.ts +30 -0
- package/lib/guardrails/dist/disclosure.d.ts.map +1 -0
- package/lib/guardrails/dist/disclosure.js +109 -0
- package/lib/guardrails/dist/disclosure.js.map +1 -0
- package/lib/guardrails/dist/helpers.d.ts +20 -0
- package/lib/guardrails/dist/helpers.d.ts.map +1 -0
- package/lib/guardrails/dist/helpers.js +72 -0
- package/lib/guardrails/dist/helpers.js.map +1 -0
- package/lib/guardrails/dist/index.d.ts +9 -0
- package/lib/guardrails/dist/index.d.ts.map +1 -0
- package/lib/guardrails/dist/index.js +9 -0
- package/lib/guardrails/dist/index.js.map +1 -0
- package/lib/guardrails/dist/managed.d.ts +18 -0
- package/lib/guardrails/dist/managed.d.ts.map +1 -0
- package/lib/guardrails/dist/managed.js +67 -0
- package/lib/guardrails/dist/managed.js.map +1 -0
- package/lib/guardrails/dist/pipeline.d.ts +55 -0
- package/lib/guardrails/dist/pipeline.d.ts.map +1 -0
- package/lib/guardrails/dist/pipeline.js +201 -0
- package/lib/guardrails/dist/pipeline.js.map +1 -0
- package/lib/guardrails/package.json +5 -0
- package/lib/guardrails/src/agent-guard.ts +22 -0
- package/lib/guardrails/src/auxiliary-helpers.ts +146 -0
- package/lib/guardrails/src/auxiliary.ts +202 -0
- package/lib/guardrails/src/batches.ts +130 -0
- package/lib/guardrails/src/disclosure.ts +92 -0
- package/lib/guardrails/src/helpers.ts +67 -0
- package/lib/guardrails/src/index.ts +8 -0
- package/lib/guardrails/src/managed.ts +64 -0
- package/lib/guardrails/src/pipeline.ts +185 -0
- package/lib/helpers/dist/concurrency.d.ts +25 -0
- package/lib/helpers/dist/concurrency.d.ts.map +1 -0
- package/lib/helpers/dist/concurrency.js +106 -0
- package/lib/helpers/dist/concurrency.js.map +1 -0
- package/lib/helpers/dist/configuration.d.ts +42 -0
- package/lib/helpers/dist/configuration.d.ts.map +1 -0
- package/lib/helpers/dist/configuration.js +119 -0
- package/lib/helpers/dist/configuration.js.map +1 -0
- package/lib/helpers/dist/control.d.ts +61 -0
- package/lib/helpers/dist/control.d.ts.map +1 -0
- package/lib/helpers/dist/control.js +220 -0
- package/lib/helpers/dist/control.js.map +1 -0
- package/lib/helpers/dist/credentials.d.ts +42 -0
- package/lib/helpers/dist/credentials.d.ts.map +1 -0
- package/lib/helpers/dist/credentials.js +126 -0
- package/lib/helpers/dist/credentials.js.map +1 -0
- package/lib/helpers/dist/data.d.ts +30 -0
- package/lib/helpers/dist/data.d.ts.map +1 -0
- package/lib/helpers/dist/data.js +90 -0
- package/lib/helpers/dist/data.js.map +1 -0
- package/lib/helpers/dist/index.d.ts +6 -0
- package/lib/helpers/dist/index.d.ts.map +1 -0
- package/lib/helpers/dist/index.js +6 -0
- package/lib/helpers/dist/index.js.map +1 -0
- package/lib/helpers/package.json +5 -0
- package/lib/helpers/src/concurrency.ts +92 -0
- package/lib/helpers/src/configuration.ts +131 -0
- package/lib/helpers/src/control.ts +231 -0
- package/lib/helpers/src/credentials.ts +113 -0
- package/lib/helpers/src/data.ts +105 -0
- package/lib/helpers/src/index.ts +5 -0
- package/lib/memory/dist/contracts.d.ts +146 -0
- package/lib/memory/dist/contracts.d.ts.map +1 -0
- package/lib/memory/dist/contracts.js +2 -0
- package/lib/memory/dist/contracts.js.map +1 -0
- package/lib/memory/dist/index.d.ts +10 -0
- package/lib/memory/dist/index.d.ts.map +1 -0
- package/lib/memory/dist/index.js +316 -0
- package/lib/memory/dist/index.js.map +1 -0
- package/lib/memory/dist/native.d.ts +157 -0
- package/lib/memory/dist/native.d.ts.map +1 -0
- package/lib/memory/dist/native.js +664 -0
- package/lib/memory/dist/native.js.map +1 -0
- package/lib/memory/dist/validation.d.ts +21 -0
- package/lib/memory/dist/validation.d.ts.map +1 -0
- package/lib/memory/dist/validation.js +123 -0
- package/lib/memory/dist/validation.js.map +1 -0
- package/lib/memory/dist/vectors.d.ts +40 -0
- package/lib/memory/dist/vectors.d.ts.map +1 -0
- package/lib/memory/dist/vectors.js +134 -0
- package/lib/memory/dist/vectors.js.map +1 -0
- package/lib/memory/package.json +5 -0
- package/lib/memory/src/contracts.ts +113 -0
- package/lib/memory/src/index.ts +241 -0
- package/lib/memory/src/native.ts +568 -0
- package/lib/memory/src/validation.ts +103 -0
- package/lib/memory/src/vectors.ts +121 -0
- package/lib/memory-remote/dist/index.d.ts +91 -0
- package/lib/memory-remote/dist/index.d.ts.map +1 -0
- package/lib/memory-remote/dist/index.js +434 -0
- package/lib/memory-remote/dist/index.js.map +1 -0
- package/lib/memory-remote/package.json +5 -0
- package/lib/memory-remote/src/index.ts +367 -0
- package/lib/observability/dist/contracts.d.ts +102 -0
- package/lib/observability/dist/contracts.d.ts.map +1 -0
- package/lib/observability/dist/contracts.js +2 -0
- package/lib/observability/dist/contracts.js.map +1 -0
- package/lib/observability/dist/index.d.ts +5 -0
- package/lib/observability/dist/index.d.ts.map +1 -0
- package/lib/observability/dist/index.js +4 -0
- package/lib/observability/dist/index.js.map +1 -0
- package/lib/observability/dist/observer.d.ts +4 -0
- package/lib/observability/dist/observer.d.ts.map +1 -0
- package/lib/observability/dist/observer.js +354 -0
- package/lib/observability/dist/observer.js.map +1 -0
- package/lib/observability/dist/validation.d.ts +6 -0
- package/lib/observability/dist/validation.d.ts.map +1 -0
- package/lib/observability/dist/validation.js +203 -0
- package/lib/observability/dist/validation.js.map +1 -0
- package/lib/observability/package.json +5 -0
- package/lib/observability/src/contracts.ts +85 -0
- package/lib/observability/src/index.ts +4 -0
- package/lib/observability/src/observer.ts +246 -0
- package/lib/observability/src/validation.ts +132 -0
- package/lib/provider-anthropic/dist/index.d.ts +19 -0
- package/lib/provider-anthropic/dist/index.d.ts.map +1 -0
- package/lib/provider-anthropic/dist/index.js +342 -0
- package/lib/provider-anthropic/dist/index.js.map +1 -0
- package/lib/provider-anthropic/package.json +5 -0
- package/lib/provider-anthropic/src/index.ts +317 -0
- package/lib/provider-openai/dist/index.d.ts +77 -0
- package/lib/provider-openai/dist/index.d.ts.map +1 -0
- package/lib/provider-openai/dist/index.js +577 -0
- package/lib/provider-openai/dist/index.js.map +1 -0
- package/lib/provider-openai/package.json +5 -0
- package/lib/provider-openai/src/index.ts +459 -0
- package/lib/runtime/dist/agent.d.ts +63 -0
- package/lib/runtime/dist/agent.d.ts.map +1 -0
- package/lib/runtime/dist/agent.js +134 -0
- package/lib/runtime/dist/agent.js.map +1 -0
- package/lib/runtime/dist/composition.d.ts +21 -0
- package/lib/runtime/dist/composition.d.ts.map +1 -0
- package/lib/runtime/dist/composition.js +54 -0
- package/lib/runtime/dist/composition.js.map +1 -0
- package/lib/runtime/dist/event-buffer.d.ts +18 -0
- package/lib/runtime/dist/event-buffer.d.ts.map +1 -0
- package/lib/runtime/dist/event-buffer.js +66 -0
- package/lib/runtime/dist/event-buffer.js.map +1 -0
- package/lib/runtime/dist/hook-execution.d.ts +40 -0
- package/lib/runtime/dist/hook-execution.d.ts.map +1 -0
- package/lib/runtime/dist/hook-execution.js +186 -0
- package/lib/runtime/dist/hook-execution.js.map +1 -0
- package/lib/runtime/dist/hooks.d.ts +178 -0
- package/lib/runtime/dist/hooks.d.ts.map +1 -0
- package/lib/runtime/dist/hooks.js +120 -0
- package/lib/runtime/dist/hooks.js.map +1 -0
- package/lib/runtime/dist/index.d.ts +6 -0
- package/lib/runtime/dist/index.d.ts.map +1 -0
- package/lib/runtime/dist/index.js +6 -0
- package/lib/runtime/dist/index.js.map +1 -0
- package/lib/runtime/dist/managed-guards.d.ts +27 -0
- package/lib/runtime/dist/managed-guards.d.ts.map +1 -0
- package/lib/runtime/dist/managed-guards.js +183 -0
- package/lib/runtime/dist/managed-guards.js.map +1 -0
- package/lib/runtime/dist/permits.d.ts +9 -0
- package/lib/runtime/dist/permits.d.ts.map +1 -0
- package/lib/runtime/dist/permits.js +77 -0
- package/lib/runtime/dist/permits.js.map +1 -0
- package/lib/runtime/dist/response.d.ts +8 -0
- package/lib/runtime/dist/response.d.ts.map +1 -0
- package/lib/runtime/dist/response.js +83 -0
- package/lib/runtime/dist/response.js.map +1 -0
- package/lib/runtime/dist/router.d.ts +51 -0
- package/lib/runtime/dist/router.d.ts.map +1 -0
- package/lib/runtime/dist/router.js +181 -0
- package/lib/runtime/dist/router.js.map +1 -0
- package/lib/runtime/dist/runtime.d.ts +98 -0
- package/lib/runtime/dist/runtime.d.ts.map +1 -0
- package/lib/runtime/dist/runtime.js +945 -0
- package/lib/runtime/dist/runtime.js.map +1 -0
- package/lib/runtime/dist/stream.d.ts +25 -0
- package/lib/runtime/dist/stream.d.ts.map +1 -0
- package/lib/runtime/dist/stream.js +226 -0
- package/lib/runtime/dist/stream.js.map +1 -0
- package/lib/runtime/package.json +5 -0
- package/lib/runtime/src/agent.ts +167 -0
- package/lib/runtime/src/composition.ts +63 -0
- package/lib/runtime/src/event-buffer.ts +55 -0
- package/lib/runtime/src/hook-execution.ts +188 -0
- package/lib/runtime/src/hooks.ts +227 -0
- package/lib/runtime/src/index.ts +5 -0
- package/lib/runtime/src/managed-guards.ts +176 -0
- package/lib/runtime/src/permits.ts +65 -0
- package/lib/runtime/src/response.ts +68 -0
- package/lib/runtime/src/router.ts +178 -0
- package/lib/runtime/src/runtime.ts +909 -0
- package/lib/runtime/src/stream.ts +130 -0
- package/lib/sdk/dist/index.d.ts +5 -0
- package/lib/sdk/dist/index.d.ts.map +1 -0
- package/lib/sdk/dist/index.js +5 -0
- package/lib/sdk/dist/index.js.map +1 -0
- package/lib/sdk/package.json +5 -0
- package/lib/sdk/src/index.ts +4 -0
- package/lib/server/dist/index.d.ts +343 -0
- package/lib/server/dist/index.d.ts.map +1 -0
- package/lib/server/dist/index.js +1356 -0
- package/lib/server/dist/index.js.map +1 -0
- package/lib/server/dist/inspector-bundle.d.ts +6 -0
- package/lib/server/dist/inspector-bundle.d.ts.map +1 -0
- package/lib/server/dist/inspector-bundle.js +6 -0
- package/lib/server/dist/inspector-bundle.js.map +1 -0
- package/lib/server/dist/inspector.d.ts +3 -0
- package/lib/server/dist/inspector.d.ts.map +1 -0
- package/lib/server/dist/inspector.js +27 -0
- package/lib/server/dist/inspector.js.map +1 -0
- package/lib/server/package.json +5 -0
- package/lib/server/src/index.ts +1033 -0
- package/lib/server/src/inspector-bundle.ts +5 -0
- package/lib/server/src/inspector.ts +27 -0
- package/lib/server-node/dist/hardening.d.ts +19 -0
- package/lib/server-node/dist/hardening.d.ts.map +1 -0
- package/lib/server-node/dist/hardening.js +79 -0
- package/lib/server-node/dist/hardening.js.map +1 -0
- package/lib/server-node/dist/index.d.ts +18 -0
- package/lib/server-node/dist/index.d.ts.map +1 -0
- package/lib/server-node/dist/index.js +53 -0
- package/lib/server-node/dist/index.js.map +1 -0
- package/lib/server-node/dist/probe.d.ts +13 -0
- package/lib/server-node/dist/probe.d.ts.map +1 -0
- package/lib/server-node/dist/probe.js +44 -0
- package/lib/server-node/dist/probe.js.map +1 -0
- package/lib/server-node/dist/production.d.ts +32 -0
- package/lib/server-node/dist/production.d.ts.map +1 -0
- package/lib/server-node/dist/production.js +125 -0
- package/lib/server-node/dist/production.js.map +1 -0
- package/lib/server-node/package.json +5 -0
- package/lib/server-node/src/hardening.ts +79 -0
- package/lib/server-node/src/index.ts +58 -0
- package/lib/server-node/src/probe.ts +36 -0
- package/lib/server-node/src/production.ts +116 -0
- package/lib/storage/dist/index.d.ts +4 -0
- package/lib/storage/dist/index.d.ts.map +1 -0
- package/lib/storage/dist/index.js +5 -0
- package/lib/storage/dist/index.js.map +1 -0
- package/lib/storage/package.json +5 -0
- package/lib/storage/src/index.ts +5 -0
- package/lib/storage-contracts/dist/contracts.d.ts +69 -0
- package/lib/storage-contracts/dist/contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/contracts.js +15 -0
- package/lib/storage-contracts/dist/contracts.js.map +1 -0
- package/lib/storage-contracts/dist/durable-budget-contracts.d.ts +110 -0
- package/lib/storage-contracts/dist/durable-budget-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/durable-budget-contracts.js +430 -0
- package/lib/storage-contracts/dist/durable-budget-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/execution-wait-contracts.d.ts +74 -0
- package/lib/storage-contracts/dist/execution-wait-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/execution-wait-contracts.js +159 -0
- package/lib/storage-contracts/dist/execution-wait-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/index.d.ts +18 -0
- package/lib/storage-contracts/dist/index.d.ts.map +1 -0
- package/lib/storage-contracts/dist/index.js +18 -0
- package/lib/storage-contracts/dist/index.js.map +1 -0
- package/lib/storage-contracts/dist/memory-contracts.d.ts +208 -0
- package/lib/storage-contracts/dist/memory-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/memory-contracts.js +350 -0
- package/lib/storage-contracts/dist/memory-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +171 -0
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.js +2 -0
- package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/scheduler-contracts.d.ts +133 -0
- package/lib/storage-contracts/dist/scheduler-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/scheduler-contracts.js +2 -0
- package/lib/storage-contracts/dist/scheduler-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/submission-journal.d.ts +21 -0
- package/lib/storage-contracts/dist/submission-journal.d.ts.map +1 -0
- package/lib/storage-contracts/dist/submission-journal.js +51 -0
- package/lib/storage-contracts/dist/submission-journal.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-format2.d.ts +54 -0
- package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-format2.js +398 -0
- package/lib/storage-contracts/dist/workflow-format2.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-format3.d.ts +20 -0
- package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-format3.js +309 -0
- package/lib/storage-contracts/dist/workflow-format3.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-format4.d.ts +48 -0
- package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-format4.js +132 -0
- package/lib/storage-contracts/dist/workflow-format4.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-format5.d.ts +94 -0
- package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-format5.js +365 -0
- package/lib/storage-contracts/dist/workflow-format5.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +69 -0
- package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-graph-contracts.js +2 -0
- package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-graph-discovery.d.ts +45 -0
- package/lib/storage-contracts/dist/workflow-graph-discovery.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-graph-discovery.js +101 -0
- package/lib/storage-contracts/dist/workflow-graph-discovery.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-loop-format1.d.ts +52 -0
- package/lib/storage-contracts/dist/workflow-loop-format1.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-loop-format1.js +134 -0
- package/lib/storage-contracts/dist/workflow-loop-format1.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-saga-format1.d.ts +52 -0
- package/lib/storage-contracts/dist/workflow-saga-format1.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-saga-format1.js +235 -0
- package/lib/storage-contracts/dist/workflow-saga-format1.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +428 -0
- package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-tree-contracts.js +151 -0
- package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/workflow-tree-discovery.d.ts +38 -0
- package/lib/storage-contracts/dist/workflow-tree-discovery.d.ts.map +1 -0
- package/lib/storage-contracts/dist/workflow-tree-discovery.js +57 -0
- package/lib/storage-contracts/dist/workflow-tree-discovery.js.map +1 -0
- package/lib/storage-contracts/package.json +5 -0
- package/lib/storage-contracts/src/contracts.ts +73 -0
- package/lib/storage-contracts/src/durable-budget-contracts.ts +266 -0
- package/lib/storage-contracts/src/execution-wait-contracts.ts +169 -0
- package/lib/storage-contracts/src/index.ts +17 -0
- package/lib/storage-contracts/src/memory-contracts.ts +322 -0
- package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +88 -0
- package/lib/storage-contracts/src/scheduler-contracts.ts +68 -0
- package/lib/storage-contracts/src/submission-journal.ts +50 -0
- package/lib/storage-contracts/src/workflow-format2.ts +288 -0
- package/lib/storage-contracts/src/workflow-format3.ts +201 -0
- package/lib/storage-contracts/src/workflow-format4.ts +96 -0
- package/lib/storage-contracts/src/workflow-format5.ts +375 -0
- package/lib/storage-contracts/src/workflow-graph-contracts.ts +44 -0
- package/lib/storage-contracts/src/workflow-graph-discovery.ts +107 -0
- package/lib/storage-contracts/src/workflow-loop-format1.ts +102 -0
- package/lib/storage-contracts/src/workflow-saga-format1.ts +165 -0
- package/lib/storage-contracts/src/workflow-tree-contracts.ts +191 -0
- package/lib/storage-contracts/src/workflow-tree-discovery.ts +39 -0
- package/lib/storage-postgres/dist/index.d.ts +2 -0
- package/lib/storage-postgres/dist/index.d.ts.map +1 -0
- package/lib/storage-postgres/dist/index.js +2 -0
- package/lib/storage-postgres/dist/index.js.map +1 -0
- package/lib/storage-postgres/dist/postgres.d.ts +8 -0
- package/lib/storage-postgres/dist/postgres.d.ts.map +1 -0
- package/lib/storage-postgres/dist/postgres.js +233 -0
- package/lib/storage-postgres/dist/postgres.js.map +1 -0
- package/lib/storage-postgres/package.json +5 -0
- package/lib/storage-postgres/src/index.ts +1 -0
- package/lib/storage-postgres/src/postgres.ts +222 -0
- package/lib/storage-sql/dist/aggregate-session.d.ts +31 -0
- package/lib/storage-sql/dist/aggregate-session.d.ts.map +1 -0
- package/lib/storage-sql/dist/aggregate-session.js +78 -0
- package/lib/storage-sql/dist/aggregate-session.js.map +1 -0
- package/lib/storage-sql/dist/contracts.d.ts +2 -0
- package/lib/storage-sql/dist/contracts.d.ts.map +1 -0
- package/lib/storage-sql/dist/contracts.js +3 -0
- package/lib/storage-sql/dist/contracts.js.map +1 -0
- package/lib/storage-sql/dist/durable-budget-database.d.ts +33 -0
- package/lib/storage-sql/dist/durable-budget-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/durable-budget-database.js +191 -0
- package/lib/storage-sql/dist/durable-budget-database.js.map +1 -0
- package/lib/storage-sql/dist/durable-budget-state.d.ts +24 -0
- package/lib/storage-sql/dist/durable-budget-state.d.ts.map +1 -0
- package/lib/storage-sql/dist/durable-budget-state.js +211 -0
- package/lib/storage-sql/dist/durable-budget-state.js.map +1 -0
- package/lib/storage-sql/dist/durable-budget-validation.d.ts +5 -0
- package/lib/storage-sql/dist/durable-budget-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/durable-budget-validation.js +22 -0
- package/lib/storage-sql/dist/durable-budget-validation.js.map +1 -0
- package/lib/storage-sql/dist/execution-completions.d.ts +12 -0
- package/lib/storage-sql/dist/execution-completions.d.ts.map +1 -0
- package/lib/storage-sql/dist/execution-completions.js +60 -0
- package/lib/storage-sql/dist/execution-completions.js.map +1 -0
- package/lib/storage-sql/dist/execution-wait-database.d.ts +22 -0
- package/lib/storage-sql/dist/execution-wait-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/execution-wait-database.js +288 -0
- package/lib/storage-sql/dist/execution-wait-database.js.map +1 -0
- package/lib/storage-sql/dist/execution-wait-validation.d.ts +8 -0
- package/lib/storage-sql/dist/execution-wait-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/execution-wait-validation.js +125 -0
- package/lib/storage-sql/dist/execution-wait-validation.js.map +1 -0
- package/lib/storage-sql/dist/host.d.ts +22 -0
- package/lib/storage-sql/dist/host.d.ts.map +1 -0
- package/lib/storage-sql/dist/host.js +21 -0
- package/lib/storage-sql/dist/host.js.map +1 -0
- package/lib/storage-sql/dist/memory-database.d.ts +24 -0
- package/lib/storage-sql/dist/memory-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/memory-database.js +359 -0
- package/lib/storage-sql/dist/memory-database.js.map +1 -0
- package/lib/storage-sql/dist/scheduled-database.d.ts +74 -0
- package/lib/storage-sql/dist/scheduled-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/scheduled-database.js +1152 -0
- package/lib/storage-sql/dist/scheduled-database.js.map +1 -0
- package/lib/storage-sql/dist/scheduled-validation.d.ts +9 -0
- package/lib/storage-sql/dist/scheduled-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/scheduled-validation.js +200 -0
- package/lib/storage-sql/dist/scheduled-validation.js.map +1 -0
- package/lib/storage-sql/dist/scheduler-contracts.d.ts +2 -0
- package/lib/storage-sql/dist/scheduler-contracts.d.ts.map +1 -0
- package/lib/storage-sql/dist/scheduler-contracts.js +3 -0
- package/lib/storage-sql/dist/scheduler-contracts.js.map +1 -0
- package/lib/storage-sql/dist/scheduler-database.d.ts +55 -0
- package/lib/storage-sql/dist/scheduler-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/scheduler-database.js +655 -0
- package/lib/storage-sql/dist/scheduler-database.js.map +1 -0
- package/lib/storage-sql/dist/scheduler-validation.d.ts +22 -0
- package/lib/storage-sql/dist/scheduler-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/scheduler-validation.js +201 -0
- package/lib/storage-sql/dist/scheduler-validation.js.map +1 -0
- package/lib/storage-sql/dist/validation.d.ts +14 -0
- package/lib/storage-sql/dist/validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/validation.js +106 -0
- package/lib/storage-sql/dist/validation.js.map +1 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-index.d.ts +7 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-index.d.ts.map +1 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-index.js +55 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-index.js.map +1 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-validation.d.ts +5 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-validation.js +22 -0
- package/lib/storage-sql/dist/workflow-graph-discovery-validation.js.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-database.d.ts +270 -0
- package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-database.js +1692 -0
- package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-discovery-validation.d.ts +5 -0
- package/lib/storage-sql/dist/workflow-tree-discovery-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-discovery-validation.js +15 -0
- package/lib/storage-sql/dist/workflow-tree-discovery-validation.js.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-validation.d.ts +9 -0
- package/lib/storage-sql/dist/workflow-tree-validation.d.ts.map +1 -0
- package/lib/storage-sql/dist/workflow-tree-validation.js +576 -0
- package/lib/storage-sql/dist/workflow-tree-validation.js.map +1 -0
- package/lib/storage-sql/package.json +5 -0
- package/lib/storage-sql/src/aggregate-session.ts +72 -0
- package/lib/storage-sql/src/contracts.ts +2 -0
- package/lib/storage-sql/src/durable-budget-database.ts +180 -0
- package/lib/storage-sql/src/durable-budget-state.ts +155 -0
- package/lib/storage-sql/src/durable-budget-validation.ts +23 -0
- package/lib/storage-sql/src/execution-completions.ts +58 -0
- package/lib/storage-sql/src/execution-wait-database.ts +219 -0
- package/lib/storage-sql/src/execution-wait-validation.ts +108 -0
- package/lib/storage-sql/src/host.ts +21 -0
- package/lib/storage-sql/src/memory-database.ts +320 -0
- package/lib/storage-sql/src/scheduled-database.ts +811 -0
- package/lib/storage-sql/src/scheduled-validation.ts +89 -0
- package/lib/storage-sql/src/scheduler-contracts.ts +2 -0
- package/lib/storage-sql/src/scheduler-database.ts +475 -0
- package/lib/storage-sql/src/scheduler-validation.ts +112 -0
- package/lib/storage-sql/src/validation.ts +104 -0
- package/lib/storage-sql/src/workflow-graph-discovery-index.ts +60 -0
- package/lib/storage-sql/src/workflow-graph-discovery-validation.ts +21 -0
- package/lib/storage-sql/src/workflow-tree-database.ts +450 -0
- package/lib/storage-sql/src/workflow-tree-discovery-validation.ts +13 -0
- package/lib/storage-sql/src/workflow-tree-validation.ts +166 -0
- package/lib/storage-sqlite/dist/backup.d.ts +24 -0
- package/lib/storage-sqlite/dist/backup.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/backup.js +84 -0
- package/lib/storage-sqlite/dist/backup.js.map +1 -0
- package/lib/storage-sqlite/dist/index.d.ts +4 -0
- package/lib/storage-sqlite/dist/index.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/index.js +4 -0
- package/lib/storage-sqlite/dist/index.js.map +1 -0
- package/lib/storage-sqlite/dist/migrations.d.ts +6 -0
- package/lib/storage-sqlite/dist/migrations.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/migrations.js +50 -0
- package/lib/storage-sqlite/dist/migrations.js.map +1 -0
- package/lib/storage-sqlite/dist/sqlite-database.d.ts +36 -0
- package/lib/storage-sqlite/dist/sqlite-database.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/sqlite-database.js +179 -0
- package/lib/storage-sqlite/dist/sqlite-database.js.map +1 -0
- package/lib/storage-sqlite/dist/sqlite-worker.d.ts +2 -0
- package/lib/storage-sqlite/dist/sqlite-worker.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/sqlite-worker.js +95 -0
- package/lib/storage-sqlite/dist/sqlite-worker.js.map +1 -0
- package/lib/storage-sqlite/dist/sqlite.d.ts +7 -0
- package/lib/storage-sqlite/dist/sqlite.d.ts.map +1 -0
- package/lib/storage-sqlite/dist/sqlite.js +78 -0
- package/lib/storage-sqlite/dist/sqlite.js.map +1 -0
- package/lib/storage-sqlite/package.json +5 -0
- package/lib/storage-sqlite/src/backup.ts +58 -0
- package/lib/storage-sqlite/src/index.ts +3 -0
- package/lib/storage-sqlite/src/migrations.ts +46 -0
- package/lib/storage-sqlite/src/sqlite-database.ts +172 -0
- package/lib/storage-sqlite/src/sqlite-worker.ts +52 -0
- package/lib/storage-sqlite/src/sqlite.ts +72 -0
- package/lib/testing/dist/index.d.ts +10 -0
- package/lib/testing/dist/index.d.ts.map +1 -0
- package/lib/testing/dist/index.js +24 -0
- package/lib/testing/dist/index.js.map +1 -0
- package/lib/testing/package.json +5 -0
- package/lib/testing/src/index.ts +26 -0
- package/lib/tools/dist/batch.d.ts +71 -0
- package/lib/tools/dist/batch.d.ts.map +1 -0
- package/lib/tools/dist/batch.js +542 -0
- package/lib/tools/dist/batch.js.map +1 -0
- package/lib/tools/dist/budget-binding.d.ts +18 -0
- package/lib/tools/dist/budget-binding.d.ts.map +1 -0
- package/lib/tools/dist/budget-binding.js +65 -0
- package/lib/tools/dist/budget-binding.js.map +1 -0
- package/lib/tools/dist/context.d.ts +17 -0
- package/lib/tools/dist/context.d.ts.map +1 -0
- package/lib/tools/dist/context.js +52 -0
- package/lib/tools/dist/context.js.map +1 -0
- package/lib/tools/dist/host.d.ts +3 -0
- package/lib/tools/dist/host.d.ts.map +1 -0
- package/lib/tools/dist/host.js +3 -0
- package/lib/tools/dist/host.js.map +1 -0
- package/lib/tools/dist/index.d.ts +79 -0
- package/lib/tools/dist/index.d.ts.map +1 -0
- package/lib/tools/dist/index.js +462 -0
- package/lib/tools/dist/index.js.map +1 -0
- package/lib/tools/package.json +5 -0
- package/lib/tools/src/batch.ts +496 -0
- package/lib/tools/src/budget-binding.ts +63 -0
- package/lib/tools/src/context.ts +56 -0
- package/lib/tools/src/host.ts +2 -0
- package/lib/tools/src/index.ts +479 -0
- package/lib/workflows/dist/agents.d.ts +24 -0
- package/lib/workflows/dist/agents.d.ts.map +1 -0
- package/lib/workflows/dist/agents.js +55 -0
- package/lib/workflows/dist/agents.js.map +1 -0
- package/lib/workflows/dist/children-coordinator.d.ts +58 -0
- package/lib/workflows/dist/children-coordinator.d.ts.map +1 -0
- package/lib/workflows/dist/children-coordinator.js +148 -0
- package/lib/workflows/dist/children-coordinator.js.map +1 -0
- package/lib/workflows/dist/children-definition.d.ts +43 -0
- package/lib/workflows/dist/children-definition.d.ts.map +1 -0
- package/lib/workflows/dist/children-definition.js +74 -0
- package/lib/workflows/dist/children-definition.js.map +1 -0
- package/lib/workflows/dist/children-discovery.d.ts +20 -0
- package/lib/workflows/dist/children-discovery.d.ts.map +1 -0
- package/lib/workflows/dist/children-discovery.js +103 -0
- package/lib/workflows/dist/children-discovery.js.map +1 -0
- package/lib/workflows/dist/children-runtime.d.ts +72 -0
- package/lib/workflows/dist/children-runtime.d.ts.map +1 -0
- package/lib/workflows/dist/children-runtime.js +600 -0
- package/lib/workflows/dist/children-runtime.js.map +1 -0
- package/lib/workflows/dist/children.d.ts +9 -0
- package/lib/workflows/dist/children.d.ts.map +1 -0
- package/lib/workflows/dist/children.js +6 -0
- package/lib/workflows/dist/children.js.map +1 -0
- package/lib/workflows/dist/composite-fleet.d.ts +87 -0
- package/lib/workflows/dist/composite-fleet.d.ts.map +1 -0
- package/lib/workflows/dist/composite-fleet.js +259 -0
- package/lib/workflows/dist/composite-fleet.js.map +1 -0
- package/lib/workflows/dist/composite-host.d.ts +45 -0
- package/lib/workflows/dist/composite-host.d.ts.map +1 -0
- package/lib/workflows/dist/composite-host.js +132 -0
- package/lib/workflows/dist/composite-host.js.map +1 -0
- package/lib/workflows/dist/composites.d.ts +4 -0
- package/lib/workflows/dist/composites.d.ts.map +1 -0
- package/lib/workflows/dist/composites.js +3 -0
- package/lib/workflows/dist/composites.js.map +1 -0
- package/lib/workflows/dist/definition.d.ts +61 -0
- package/lib/workflows/dist/definition.d.ts.map +1 -0
- package/lib/workflows/dist/definition.js +112 -0
- package/lib/workflows/dist/definition.js.map +1 -0
- package/lib/workflows/dist/drain.d.ts +21 -0
- package/lib/workflows/dist/drain.d.ts.map +1 -0
- package/lib/workflows/dist/drain.js +53 -0
- package/lib/workflows/dist/drain.js.map +1 -0
- package/lib/workflows/dist/ephemeral.d.ts +24 -0
- package/lib/workflows/dist/ephemeral.d.ts.map +1 -0
- package/lib/workflows/dist/ephemeral.js +122 -0
- package/lib/workflows/dist/ephemeral.js.map +1 -0
- package/lib/workflows/dist/fleet-control.d.ts +129 -0
- package/lib/workflows/dist/fleet-control.d.ts.map +1 -0
- package/lib/workflows/dist/fleet-control.js +356 -0
- package/lib/workflows/dist/fleet-control.js.map +1 -0
- package/lib/workflows/dist/graph-coordinator.d.ts +60 -0
- package/lib/workflows/dist/graph-coordinator.d.ts.map +1 -0
- package/lib/workflows/dist/graph-coordinator.js +266 -0
- package/lib/workflows/dist/graph-coordinator.js.map +1 -0
- package/lib/workflows/dist/graph-definition.d.ts +40 -0
- package/lib/workflows/dist/graph-definition.d.ts.map +1 -0
- package/lib/workflows/dist/graph-definition.js +58 -0
- package/lib/workflows/dist/graph-definition.js.map +1 -0
- package/lib/workflows/dist/graph-discovery.d.ts +27 -0
- package/lib/workflows/dist/graph-discovery.d.ts.map +1 -0
- package/lib/workflows/dist/graph-discovery.js +165 -0
- package/lib/workflows/dist/graph-discovery.js.map +1 -0
- package/lib/workflows/dist/graphs.d.ts +55 -0
- package/lib/workflows/dist/graphs.d.ts.map +1 -0
- package/lib/workflows/dist/graphs.js +10 -0
- package/lib/workflows/dist/graphs.js.map +1 -0
- package/lib/workflows/dist/hook-relay.d.ts +67 -0
- package/lib/workflows/dist/hook-relay.d.ts.map +1 -0
- package/lib/workflows/dist/hook-relay.js +157 -0
- package/lib/workflows/dist/hook-relay.js.map +1 -0
- package/lib/workflows/dist/index.d.ts +16 -0
- package/lib/workflows/dist/index.d.ts.map +1 -0
- package/lib/workflows/dist/index.js +15 -0
- package/lib/workflows/dist/index.js.map +1 -0
- package/lib/workflows/dist/leadership.d.ts +33 -0
- package/lib/workflows/dist/leadership.d.ts.map +1 -0
- package/lib/workflows/dist/leadership.js +109 -0
- package/lib/workflows/dist/leadership.js.map +1 -0
- package/lib/workflows/dist/lifecycle-definition.d.ts +89 -0
- package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle-definition.js +137 -0
- package/lib/workflows/dist/lifecycle-definition.js.map +1 -0
- package/lib/workflows/dist/lifecycle-fleet.d.ts +90 -0
- package/lib/workflows/dist/lifecycle-fleet.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle-fleet.js +406 -0
- package/lib/workflows/dist/lifecycle-fleet.js.map +1 -0
- package/lib/workflows/dist/lifecycle-host.d.ts +44 -0
- package/lib/workflows/dist/lifecycle-host.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle-host.js +133 -0
- package/lib/workflows/dist/lifecycle-host.js.map +1 -0
- package/lib/workflows/dist/lifecycle-human-transport.d.ts +67 -0
- package/lib/workflows/dist/lifecycle-human-transport.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle-human-transport.js +149 -0
- package/lib/workflows/dist/lifecycle-human-transport.js.map +1 -0
- package/lib/workflows/dist/lifecycle-runtime.d.ts +115 -0
- package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle-runtime.js +831 -0
- package/lib/workflows/dist/lifecycle-runtime.js.map +1 -0
- package/lib/workflows/dist/lifecycle.d.ts +10 -0
- package/lib/workflows/dist/lifecycle.d.ts.map +1 -0
- package/lib/workflows/dist/lifecycle.js +7 -0
- package/lib/workflows/dist/lifecycle.js.map +1 -0
- package/lib/workflows/dist/loop-definition.d.ts +46 -0
- package/lib/workflows/dist/loop-definition.d.ts.map +1 -0
- package/lib/workflows/dist/loop-definition.js +55 -0
- package/lib/workflows/dist/loop-definition.js.map +1 -0
- package/lib/workflows/dist/loop-runtime.d.ts +47 -0
- package/lib/workflows/dist/loop-runtime.d.ts.map +1 -0
- package/lib/workflows/dist/loop-runtime.js +358 -0
- package/lib/workflows/dist/loop-runtime.js.map +1 -0
- package/lib/workflows/dist/loops.d.ts +6 -0
- package/lib/workflows/dist/loops.d.ts.map +1 -0
- package/lib/workflows/dist/loops.js +4 -0
- package/lib/workflows/dist/loops.js.map +1 -0
- package/lib/workflows/dist/migration-service.d.ts +55 -0
- package/lib/workflows/dist/migration-service.d.ts.map +1 -0
- package/lib/workflows/dist/migration-service.js +73 -0
- package/lib/workflows/dist/migration-service.js.map +1 -0
- package/lib/workflows/dist/migration.d.ts +123 -0
- package/lib/workflows/dist/migration.d.ts.map +1 -0
- package/lib/workflows/dist/migration.js +217 -0
- package/lib/workflows/dist/migration.js.map +1 -0
- package/lib/workflows/dist/operator-transports.d.ts +265 -0
- package/lib/workflows/dist/operator-transports.d.ts.map +1 -0
- package/lib/workflows/dist/operator-transports.js +404 -0
- package/lib/workflows/dist/operator-transports.js.map +1 -0
- package/lib/workflows/dist/reconciliation.d.ts +25 -0
- package/lib/workflows/dist/reconciliation.d.ts.map +1 -0
- package/lib/workflows/dist/reconciliation.js +109 -0
- package/lib/workflows/dist/reconciliation.js.map +1 -0
- package/lib/workflows/dist/runtime.d.ts +65 -0
- package/lib/workflows/dist/runtime.d.ts.map +1 -0
- package/lib/workflows/dist/runtime.js +492 -0
- package/lib/workflows/dist/runtime.js.map +1 -0
- package/lib/workflows/dist/saga-definition.d.ts +46 -0
- package/lib/workflows/dist/saga-definition.d.ts.map +1 -0
- package/lib/workflows/dist/saga-definition.js +71 -0
- package/lib/workflows/dist/saga-definition.js.map +1 -0
- package/lib/workflows/dist/saga-runtime.d.ts +51 -0
- package/lib/workflows/dist/saga-runtime.d.ts.map +1 -0
- package/lib/workflows/dist/saga-runtime.js +499 -0
- package/lib/workflows/dist/saga-runtime.js.map +1 -0
- package/lib/workflows/dist/sagas.d.ts +6 -0
- package/lib/workflows/dist/sagas.d.ts.map +1 -0
- package/lib/workflows/dist/sagas.js +4 -0
- package/lib/workflows/dist/sagas.js.map +1 -0
- package/lib/workflows/dist/scheduled-helpers.d.ts +53 -0
- package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -0
- package/lib/workflows/dist/scheduled-helpers.js +230 -0
- package/lib/workflows/dist/scheduled-helpers.js.map +1 -0
- package/lib/workflows/dist/scheduled.d.ts +116 -0
- package/lib/workflows/dist/scheduled.d.ts.map +1 -0
- package/lib/workflows/dist/scheduled.js +781 -0
- package/lib/workflows/dist/scheduled.js.map +1 -0
- package/lib/workflows/dist/traces.d.ts +158 -0
- package/lib/workflows/dist/traces.d.ts.map +1 -0
- package/lib/workflows/dist/traces.js +366 -0
- package/lib/workflows/dist/traces.js.map +1 -0
- package/lib/workflows/dist/versions.d.ts +57 -0
- package/lib/workflows/dist/versions.d.ts.map +1 -0
- package/lib/workflows/dist/versions.js +87 -0
- package/lib/workflows/dist/versions.js.map +1 -0
- package/lib/workflows/dist/worker.d.ts +51 -0
- package/lib/workflows/dist/worker.d.ts.map +1 -0
- package/lib/workflows/dist/worker.js +143 -0
- package/lib/workflows/dist/worker.js.map +1 -0
- package/lib/workflows/package.json +5 -0
- package/lib/workflows/src/agents.ts +65 -0
- package/lib/workflows/src/children-coordinator.ts +50 -0
- package/lib/workflows/src/children-definition.ts +88 -0
- package/lib/workflows/src/children-discovery.ts +32 -0
- package/lib/workflows/src/children-runtime.ts +169 -0
- package/lib/workflows/src/children.ts +12 -0
- package/lib/workflows/src/composite-fleet.ts +155 -0
- package/lib/workflows/src/composite-host.ts +67 -0
- package/lib/workflows/src/composites.ts +6 -0
- package/lib/workflows/src/definition.ts +113 -0
- package/lib/workflows/src/drain.ts +56 -0
- package/lib/workflows/src/ephemeral.ts +124 -0
- package/lib/workflows/src/fleet-control.ts +326 -0
- package/lib/workflows/src/graph-coordinator.ts +223 -0
- package/lib/workflows/src/graph-definition.ts +70 -0
- package/lib/workflows/src/graph-discovery.ts +145 -0
- package/lib/workflows/src/graphs.ts +56 -0
- package/lib/workflows/src/hook-relay.ts +177 -0
- package/lib/workflows/src/index.ts +27 -0
- package/lib/workflows/src/leadership.ts +102 -0
- package/lib/workflows/src/lifecycle-definition.ts +194 -0
- package/lib/workflows/src/lifecycle-fleet.ts +346 -0
- package/lib/workflows/src/lifecycle-host.ts +109 -0
- package/lib/workflows/src/lifecycle-human-transport.ts +170 -0
- package/lib/workflows/src/lifecycle-runtime.ts +673 -0
- package/lib/workflows/src/lifecycle.ts +59 -0
- package/lib/workflows/src/loop-definition.ts +62 -0
- package/lib/workflows/src/loop-runtime.ts +260 -0
- package/lib/workflows/src/loops.ts +7 -0
- package/lib/workflows/src/migration-service.ts +83 -0
- package/lib/workflows/src/migration.ts +242 -0
- package/lib/workflows/src/operator-transports.ts +439 -0
- package/lib/workflows/src/reconciliation.ts +121 -0
- package/lib/workflows/src/runtime.ts +348 -0
- package/lib/workflows/src/saga-definition.ts +104 -0
- package/lib/workflows/src/saga-runtime.ts +406 -0
- package/lib/workflows/src/sagas.ts +24 -0
- package/lib/workflows/src/scheduled-helpers.ts +214 -0
- package/lib/workflows/src/scheduled.ts +707 -0
- package/lib/workflows/src/traces.ts +381 -0
- package/lib/workflows/src/versions.ts +114 -0
- package/lib/workflows/src/worker.ts +115 -0
- package/lib/workstream/dist/executions.d.ts +34 -0
- package/lib/workstream/dist/executions.d.ts.map +1 -0
- package/lib/workstream/dist/executions.js +344 -0
- package/lib/workstream/dist/executions.js.map +1 -0
- package/lib/workstream/dist/humans.d.ts +76 -0
- package/lib/workstream/dist/humans.d.ts.map +1 -0
- package/lib/workstream/dist/humans.js +273 -0
- package/lib/workstream/dist/humans.js.map +1 -0
- package/lib/workstream/dist/index.d.ts +61 -0
- package/lib/workstream/dist/index.d.ts.map +1 -0
- package/lib/workstream/dist/index.js +310 -0
- package/lib/workstream/dist/index.js.map +1 -0
- package/lib/workstream/dist/timers.d.ts +41 -0
- package/lib/workstream/dist/timers.d.ts.map +1 -0
- package/lib/workstream/dist/timers.js +240 -0
- package/lib/workstream/dist/timers.js.map +1 -0
- package/lib/workstream/dist/webhooks.d.ts +69 -0
- package/lib/workstream/dist/webhooks.d.ts.map +1 -0
- package/lib/workstream/dist/webhooks.js +313 -0
- package/lib/workstream/dist/webhooks.js.map +1 -0
- package/lib/workstream/package.json +5 -0
- package/lib/workstream/src/executions.ts +253 -0
- package/lib/workstream/src/humans.ts +323 -0
- package/lib/workstream/src/index.ts +279 -0
- package/lib/workstream/src/timers.ts +212 -0
- package/lib/workstream/src/webhooks.ts +180 -0
- package/package.json +281 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { freezeJson, jsonValue, type JsonObject, type JsonValue } from '@mayura/core';
|
|
2
|
+
import { StorageError, type StoredEvent } from './contracts.js';
|
|
3
|
+
import type { ScheduledWorkflowAggregateStore } from './scheduled-workflow-contracts.js';
|
|
4
|
+
import { workflowHashMaterial } from './workflow-format2.js';
|
|
5
|
+
|
|
6
|
+
/** Immutable scheduled-run identity, not an authorization capability or backend identity proof. */
|
|
7
|
+
export interface ExecutionRef {
|
|
8
|
+
readonly kind: 'scheduled-workflow';
|
|
9
|
+
readonly runId: string;
|
|
10
|
+
readonly definitionHash: string;
|
|
11
|
+
readonly policyHash: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** A terminal observation contains no workflow payload, error, receipt or provider data. */
|
|
15
|
+
export interface ExecutionCompletion {
|
|
16
|
+
readonly reference: ExecutionRef;
|
|
17
|
+
readonly outcome: 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';
|
|
18
|
+
readonly sourceVersion: number;
|
|
19
|
+
readonly sourceEventSequence: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** A finite all-target join. Initial states have version 1; later resolution/cancellation has 2. */
|
|
23
|
+
export interface ExecutionWaitSnapshot {
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly version: number;
|
|
26
|
+
readonly definitionHash: string;
|
|
27
|
+
readonly status: 'waiting' | 'resolved' | 'cancelled';
|
|
28
|
+
readonly targets: readonly ExecutionRef[];
|
|
29
|
+
readonly observations: readonly ExecutionCompletion[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Scope is the existing mayura:scope:v1 digest, not a caller-supplied principal record. */
|
|
33
|
+
export interface ExecutionWaitStreamKey {
|
|
34
|
+
readonly scope: string;
|
|
35
|
+
readonly streamId: string;
|
|
36
|
+
readonly policyHash: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ExecutionWaitKey extends ExecutionWaitStreamKey { readonly id: string }
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Finite trusted-host commands. There are no replacement-state updates, callbacks, clocks,
|
|
42
|
+
* dispatches or per-wait pending promises. Cancellation affects only the wait, never its targets.
|
|
43
|
+
*/
|
|
44
|
+
export interface ExecutionWaitStore {
|
|
45
|
+
initialize(): Promise<void>;
|
|
46
|
+
open(command: ExecutionWaitStreamKey): Promise<void>;
|
|
47
|
+
materialize(command: { readonly scope: string; readonly reference: ExecutionRef }): Promise<ExecutionCompletion | undefined>;
|
|
48
|
+
register(command: ExecutionWaitKey & { readonly targets: readonly ExecutionRef[] }): Promise<ExecutionWaitSnapshot>;
|
|
49
|
+
inspect(command: ExecutionWaitKey): Promise<ExecutionWaitSnapshot | undefined>;
|
|
50
|
+
cancel(command: ExecutionWaitKey): Promise<ExecutionWaitSnapshot>;
|
|
51
|
+
drainReady(command: ExecutionWaitStreamKey & { readonly limit: number }): Promise<readonly ExecutionWaitSnapshot[]>;
|
|
52
|
+
events(command: ExecutionWaitStreamKey & { readonly after: number }): Promise<readonly StoredEvent[]>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Explicit opt-in: existing scheduled/aggregate-only custom adapters are not widened. */
|
|
56
|
+
export interface ExecutionWaitAggregateStore extends ScheduledWorkflowAggregateStore {
|
|
57
|
+
readonly executionWaits: ExecutionWaitStore;
|
|
58
|
+
}
|
|
59
|
+
export type ExecutionWaitMethod = keyof ExecutionWaitStore;
|
|
60
|
+
|
|
61
|
+
const MAX_BYTES = 65_536;
|
|
62
|
+
const HASH = /^[a-f0-9]{64}$/;
|
|
63
|
+
const ID = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,127}$/;
|
|
64
|
+
function invalid(): never { throw new StorageError('INVALID_INPUT', 'Invalid bounded execution-wait metadata.'); }
|
|
65
|
+
function record(value: JsonValue | undefined): JsonObject {
|
|
66
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) invalid();
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
function fields(value: JsonObject, names: readonly string[]): void {
|
|
70
|
+
const actual = Object.keys(value);
|
|
71
|
+
if (actual.length !== names.length || actual.some(name => !names.includes(name))) invalid();
|
|
72
|
+
}
|
|
73
|
+
function hash(value: unknown): void { if (typeof value !== 'string' || !HASH.test(value)) invalid(); }
|
|
74
|
+
function identifier(value: unknown): void { if (typeof value !== 'string' || !ID.test(value)) invalid(); }
|
|
75
|
+
function integer(value: unknown, min: number, max = Number.MAX_SAFE_INTEGER): void {
|
|
76
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < min || value > max) invalid();
|
|
77
|
+
}
|
|
78
|
+
/** Snapshot all caller data before inspecting it; never call caller-owned methods or iterators. */
|
|
79
|
+
function validated<T>(value: unknown, check: (copy: JsonObject) => void): T {
|
|
80
|
+
try {
|
|
81
|
+
const copy = record(jsonValue(value, { maxBytes: MAX_BYTES, maxDepth: 12, maxNodes: 8_192 }));
|
|
82
|
+
check(copy);
|
|
83
|
+
return freezeJson(copy) as unknown as T;
|
|
84
|
+
} catch { return invalid(); }
|
|
85
|
+
}
|
|
86
|
+
function referenceFields(value: JsonObject): void {
|
|
87
|
+
fields(value, ['kind', 'runId', 'definitionHash', 'policyHash']);
|
|
88
|
+
if (value['kind'] !== 'scheduled-workflow') invalid();
|
|
89
|
+
hash(value['runId']); hash(value['definitionHash']); hash(value['policyHash']);
|
|
90
|
+
}
|
|
91
|
+
function completionFields(value: JsonObject): void {
|
|
92
|
+
fields(value, ['reference', 'outcome', 'sourceVersion', 'sourceEventSequence']);
|
|
93
|
+
referenceFields(record(value['reference']));
|
|
94
|
+
if (!['succeeded', 'failed', 'blocked', 'cancelled', 'outcome_unknown'].includes(value['outcome'] as string)) invalid();
|
|
95
|
+
integer(value['sourceVersion'], 1); integer(value['sourceEventSequence'], 1);
|
|
96
|
+
}
|
|
97
|
+
function targetFields(value: JsonValue | undefined, policyHash?: JsonValue, enforcePolicy = true): JsonObject[] {
|
|
98
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > 32) invalid();
|
|
99
|
+
const ids = new Set<string>();
|
|
100
|
+
let pinnedPolicy = policyHash;
|
|
101
|
+
return value.map(item => {
|
|
102
|
+
const target = record(item); referenceFields(target);
|
|
103
|
+
if (pinnedPolicy === undefined) pinnedPolicy = target['policyHash'];
|
|
104
|
+
if ((enforcePolicy && target['policyHash'] !== pinnedPolicy) || ids.has(target['runId'] as string)) invalid();
|
|
105
|
+
ids.add(target['runId'] as string); return target;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function sameReference(left: JsonObject, right: JsonObject): boolean {
|
|
109
|
+
return ['kind', 'runId', 'definitionHash', 'policyHash'].every(field => left[field] === right[field]);
|
|
110
|
+
}
|
|
111
|
+
function snapshotFields(value: JsonObject): void {
|
|
112
|
+
fields(value, ['id', 'version', 'definitionHash', 'status', 'targets', 'observations']);
|
|
113
|
+
identifier(value['id']); hash(value['definitionHash']); integer(value['version'], 1, 2);
|
|
114
|
+
const targets = targetFields(value['targets']);
|
|
115
|
+
const observations = value['observations'];
|
|
116
|
+
if (!Array.isArray(observations)) invalid();
|
|
117
|
+
if (value['status'] === 'resolved') {
|
|
118
|
+
if (observations.length !== targets.length) invalid();
|
|
119
|
+
observations.forEach((item, index) => {
|
|
120
|
+
const observation = record(item); completionFields(observation);
|
|
121
|
+
if (!sameReference(record(observation['reference']), targets[index]!)) invalid();
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
if (observations.length !== 0 || (value['status'] !== 'waiting' && value['status'] !== 'cancelled')) invalid();
|
|
125
|
+
if (value['version'] !== (value['status'] === 'waiting' ? 1 : 2)) invalid();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function streamFields(value: JsonObject): void {
|
|
129
|
+
hash(value['scope']); identifier(value['streamId']); hash(value['policyHash']);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Validate and own an exact bounded, deeply frozen reference. */
|
|
133
|
+
export function executionRef(value: unknown): ExecutionRef { return validated(value, referenceFields); }
|
|
134
|
+
/** Validate an immutable terminal observation without inventing source history or success. */
|
|
135
|
+
export function executionCompletion(value: unknown): ExecutionCompletion { return validated(value, completionFields); }
|
|
136
|
+
/** Validate structural continuity; the configured host must separately verify the definition digest. */
|
|
137
|
+
export function executionWaitSnapshot(value: unknown): ExecutionWaitSnapshot { return validated(value, snapshotFields); }
|
|
138
|
+
|
|
139
|
+
/** Snapshot/validate a whole command before a driver queue or asynchronous operation sees it. */
|
|
140
|
+
export function executionWaitCommand(method: ExecutionWaitMethod, value: unknown): JsonObject {
|
|
141
|
+
return validated<JsonObject>(value, copy => {
|
|
142
|
+
if (method === 'initialize') { fields(copy, []); return; }
|
|
143
|
+
if (method === 'materialize') {
|
|
144
|
+
fields(copy, ['scope', 'reference']); hash(copy['scope']); referenceFields(record(copy['reference'])); return;
|
|
145
|
+
}
|
|
146
|
+
const common = ['scope', 'streamId', 'policyHash'];
|
|
147
|
+
streamFields(copy);
|
|
148
|
+
switch (method) {
|
|
149
|
+
case 'open': fields(copy, common); return;
|
|
150
|
+
case 'register':
|
|
151
|
+
fields(copy, [...common, 'id', 'targets']); identifier(copy['id']);
|
|
152
|
+
// Well-formed authorization/identity mismatches are authoritative storage CONFLICTs,
|
|
153
|
+
// not malformed transport data; preserve them for that check before materialization.
|
|
154
|
+
targetFields(copy['targets'], undefined, false); return;
|
|
155
|
+
case 'inspect': case 'cancel': fields(copy, [...common, 'id']); identifier(copy['id']); return;
|
|
156
|
+
case 'drainReady': fields(copy, [...common, 'limit']); integer(copy['limit'], 1, 32); return;
|
|
157
|
+
case 'events': fields(copy, [...common, 'after']); integer(copy['after'], 0); return;
|
|
158
|
+
default: invalid();
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Canonical domain-separated hash input; drivers/hosts select their own SHA-256 implementation. */
|
|
164
|
+
export function executionWaitHashMaterial(key: ExecutionWaitStreamKey, id: string, targets: readonly ExecutionRef[]): string {
|
|
165
|
+
const capturedKey = executionWaitCommand('open', key);
|
|
166
|
+
const command = executionWaitCommand('register', { ...capturedKey, id, targets });
|
|
167
|
+
targetFields(command['targets'], capturedKey['policyHash']);
|
|
168
|
+
return workflowHashMaterial('mayura:execution-wait:v1', { format: 1, key: capturedKey, id: command['id']!, targets: command['targets']! });
|
|
169
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './contracts.js';
|
|
2
|
+
export * from './scheduler-contracts.js';
|
|
3
|
+
export * from './scheduled-workflow-contracts.js';
|
|
4
|
+
export * from './workflow-format2.js';
|
|
5
|
+
export * from './execution-wait-contracts.js';
|
|
6
|
+
export * from './workflow-graph-contracts.js';
|
|
7
|
+
export * from './workflow-format3.js';
|
|
8
|
+
export * from './workflow-graph-discovery.js';
|
|
9
|
+
export * from './durable-budget-contracts.js';
|
|
10
|
+
export * from './workflow-tree-contracts.js';
|
|
11
|
+
export * from './workflow-format4.js';
|
|
12
|
+
export * from './workflow-tree-discovery.js';
|
|
13
|
+
export * from './workflow-format5.js';
|
|
14
|
+
export * from './workflow-saga-format1.js';
|
|
15
|
+
export * from './workflow-loop-format1.js';
|
|
16
|
+
export * from './submission-journal.js';
|
|
17
|
+
export * from './memory-contracts.js';
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import { freezeJson, jsonValue, type JsonObject } from '@mayura/core';
|
|
2
|
+
import { StorageError, type AggregateStore } from './contracts.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Table-backed native memory persistence. The store owns atomicity, compare-and-set, index maintenance and
|
|
6
|
+
* authorization filtering inside queries; `@mayura/memory` owns record semantics, permissions and hooks.
|
|
7
|
+
*/
|
|
8
|
+
export type MemoryRowStatus = 'active' | 'superseded' | 'deleted';
|
|
9
|
+
export type MemoryRowSensitivity = 'public' | 'internal' | 'confidential' | 'restricted';
|
|
10
|
+
export interface MemoryRow {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly version: number;
|
|
13
|
+
readonly status: MemoryRowStatus;
|
|
14
|
+
readonly sensitivity: MemoryRowSensitivity;
|
|
15
|
+
/** Record content and provenance; `null` for a tombstone, which retains no content. */
|
|
16
|
+
readonly body: JsonObject | null;
|
|
17
|
+
readonly validFrom: string | null;
|
|
18
|
+
readonly validUntil: string | null;
|
|
19
|
+
readonly createdAt: string;
|
|
20
|
+
readonly updatedAt: string;
|
|
21
|
+
readonly deletedAt: string | null;
|
|
22
|
+
readonly supersededBy: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface MemoryEdgeRow {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly version: number;
|
|
27
|
+
readonly status: 'active' | 'deleted';
|
|
28
|
+
readonly from: string;
|
|
29
|
+
readonly to: string;
|
|
30
|
+
readonly relation: string;
|
|
31
|
+
readonly body: JsonObject | null;
|
|
32
|
+
readonly validFrom: string | null;
|
|
33
|
+
readonly validUntil: string | null;
|
|
34
|
+
readonly createdAt: string;
|
|
35
|
+
readonly updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
export interface MemoryVectorRow { readonly recordId: string; readonly recordVersion: number; readonly vector: string; readonly list: number | null }
|
|
38
|
+
export interface MemoryChange { readonly sequence: number; readonly kind: 'record' | 'edge'; readonly id: string; readonly version: number; readonly status: string }
|
|
39
|
+
/** Authorization filter applied inside every read query. */
|
|
40
|
+
export interface MemoryFilter { readonly sensitivities: readonly MemoryRowSensitivity[]; readonly asOf: string }
|
|
41
|
+
|
|
42
|
+
export interface MemoryIndexStore {
|
|
43
|
+
initialize(): Promise<void>;
|
|
44
|
+
/** CAS on `expectedVersion` (0 = must not exist). A tombstone is never replaced. Maintains terms, vectors and edges atomically. */
|
|
45
|
+
putRecord(command: { readonly scope: string; readonly record: MemoryRow; readonly expectedVersion: number; readonly terms: readonly (readonly [string, number])[] }):
|
|
46
|
+
Promise<{ readonly record: MemoryRow; readonly sequence: number }>;
|
|
47
|
+
getRecords(command: { readonly scope: string; readonly ids: readonly string[] }): Promise<readonly MemoryRow[]>;
|
|
48
|
+
listRecords(command: { readonly scope: string; readonly after?: string; readonly limit: number; readonly statuses: readonly MemoryRowStatus[]; readonly sensitivities: readonly MemoryRowSensitivity[] }):
|
|
49
|
+
Promise<readonly MemoryRow[]>;
|
|
50
|
+
/** Postings for authorized, current, active records, plus corpus statistics for ranking. */
|
|
51
|
+
postings(command: { readonly scope: string; readonly terms: readonly string[]; readonly limit: number } & MemoryFilter):
|
|
52
|
+
Promise<{ readonly documents: number; readonly averageLength: number; readonly postings: readonly { readonly id: string; readonly term: string; readonly frequency: number; readonly length: number }[] }>;
|
|
53
|
+
/** BM25 ranking computed inside the database; returns only the top `limit` authorized, current, active records. */
|
|
54
|
+
rank(command: { readonly scope: string; readonly terms: readonly string[]; readonly limit: number } & MemoryFilter):
|
|
55
|
+
Promise<{ readonly documents: number; readonly hits: readonly { readonly id: string; readonly score: number }[] }>;
|
|
56
|
+
/** CAS edge write. An active edge requires both endpoints to be active records in scope. */
|
|
57
|
+
putEdge(command: { readonly scope: string; readonly edge: MemoryEdgeRow; readonly expectedVersion: number }): Promise<{ readonly edge: MemoryEdgeRow; readonly sequence: number }>;
|
|
58
|
+
getEdge(command: { readonly scope: string; readonly id: string }): Promise<MemoryEdgeRow | undefined>;
|
|
59
|
+
/** Every edge, including tombstones, in id order (for export). */
|
|
60
|
+
listEdges(command: { readonly scope: string; readonly after?: string; readonly limit: number }): Promise<readonly MemoryEdgeRow[]>;
|
|
61
|
+
/** Active, current edges touching the given records whose other endpoint is also authorized. */
|
|
62
|
+
edges(command: { readonly scope: string; readonly recordIds: readonly string[]; readonly direction: 'out' | 'in' | 'both'; readonly relations?: readonly string[]; readonly limit: number } & MemoryFilter):
|
|
63
|
+
Promise<readonly MemoryEdgeRow[]>;
|
|
64
|
+
/** Stores vectors for exact record versions; entries for changed or inactive records are reported stale and not written. */
|
|
65
|
+
putVectors(command: { readonly scope: string; readonly embedderId: string; readonly dimensions: number; readonly entries: readonly MemoryVectorRow[] }):
|
|
66
|
+
Promise<{ readonly written: number; readonly stale: readonly string[] }>;
|
|
67
|
+
/** Active records in the profile lacking a current vector for the embedder. */
|
|
68
|
+
missingVectors(command: { readonly scope: string; readonly embedderId: string; readonly sensitivities: readonly MemoryRowSensitivity[]; readonly limit: number }):
|
|
69
|
+
Promise<readonly { readonly id: string; readonly version: number }[]>;
|
|
70
|
+
/** Vectors of authorized current records; `lists` restricts to IVF lists plus not-yet-assigned vectors. */
|
|
71
|
+
vectors(command: { readonly scope: string; readonly embedderId: string; readonly lists?: readonly number[]; readonly after?: string; readonly limit: number } & MemoryFilter):
|
|
72
|
+
Promise<readonly MemoryVectorRow[]>;
|
|
73
|
+
indexState(command: { readonly scope: string; readonly embedderId: string }):
|
|
74
|
+
Promise<{ readonly vectors: number; readonly trainedAt: number; readonly dimensions: number; readonly centroids: readonly string[] }>;
|
|
75
|
+
/** Replace the IVF centroids; every vector becomes unassigned until `assignLists`. */
|
|
76
|
+
setCentroids(command: { readonly scope: string; readonly embedderId: string; readonly dimensions: number; readonly centroids: readonly string[]; readonly trainedAt: number }): Promise<void>;
|
|
77
|
+
assignLists(command: { readonly scope: string; readonly embedderId: string; readonly entries: readonly (readonly [string, number])[] }): Promise<number>;
|
|
78
|
+
changes(command: { readonly scope: string; readonly after: number; readonly limit: number }): Promise<readonly MemoryChange[]>;
|
|
79
|
+
stats(command: { readonly scope: string }): Promise<{ readonly records: number; readonly edges: number; readonly sequence: number }>;
|
|
80
|
+
}
|
|
81
|
+
export interface MemoryIndexAggregateStore extends AggregateStore { readonly memory: MemoryIndexStore }
|
|
82
|
+
export type MemoryIndexMethod = keyof MemoryIndexStore;
|
|
83
|
+
|
|
84
|
+
const methods = new Set<MemoryIndexMethod>(['initialize', 'putRecord', 'getRecords', 'listRecords', 'postings', 'rank', 'putEdge', 'getEdge', 'listEdges', 'edges',
|
|
85
|
+
'putVectors', 'missingVectors', 'vectors', 'indexState', 'setCentroids', 'assignLists', 'changes', 'stats']);
|
|
86
|
+
const identifier = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;
|
|
87
|
+
const scopeKey = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;
|
|
88
|
+
const sensitivities: readonly MemoryRowSensitivity[] = ['public', 'internal', 'confidential', 'restricted'];
|
|
89
|
+
const statuses: readonly MemoryRowStatus[] = ['active', 'superseded', 'deleted'];
|
|
90
|
+
const base64 = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
91
|
+
/** Decoded byte length of canonical base64 without Node buffers (this package is runtime-neutral). */
|
|
92
|
+
function decodedBytes(value: string): number { return value.length % 4 !== 0 ? -1 : value.length / 4 * 3 - (value.endsWith('==') ? 2 : value.endsWith('=') ? 1 : 0); }
|
|
93
|
+
export const MEMORY_MAX_BODY_BYTES = 65_536;
|
|
94
|
+
export const MEMORY_MAX_BATCH = 1_000;
|
|
95
|
+
|
|
96
|
+
function invalid(): never { throw new StorageError('INVALID_INPUT', 'Invalid bounded native memory command.'); }
|
|
97
|
+
function corrupt(): never { throw new StorageError('STORAGE_UNAVAILABLE', 'Native memory storage failed integrity validation.'); }
|
|
98
|
+
function record(value: unknown): Record<string, unknown> {
|
|
99
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) invalid();
|
|
100
|
+
return value as Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
function keys(value: Record<string, unknown>, required: readonly string[], optional: readonly string[] = []): void {
|
|
103
|
+
if (required.some(key => !Object.hasOwn(value, key)) || Object.keys(value).some(key => !required.includes(key) && !optional.includes(key))) invalid();
|
|
104
|
+
}
|
|
105
|
+
function id(value: unknown): string { if (typeof value !== 'string' || !identifier.test(value)) invalid(); return value as string; }
|
|
106
|
+
function integer(value: unknown, minimum = 0, maximum = Number.MAX_SAFE_INTEGER): number {
|
|
107
|
+
if (!Number.isSafeInteger(value) || (value as number) < minimum || (value as number) > maximum) invalid(); return value as number;
|
|
108
|
+
}
|
|
109
|
+
function time(value: unknown, nullable = false): string | null {
|
|
110
|
+
if (nullable && value === null) return null;
|
|
111
|
+
if (typeof value !== 'string' || value.length > 32 || !Number.isFinite(Date.parse(value)) || new Date(value).toISOString() !== value) invalid();
|
|
112
|
+
return value as string;
|
|
113
|
+
}
|
|
114
|
+
function list<T>(value: unknown, maximum: number, item: (entry: unknown) => T): T[] {
|
|
115
|
+
if (!Array.isArray(value) || value.length > maximum) invalid(); return (value as unknown[]).map(item);
|
|
116
|
+
}
|
|
117
|
+
function member<T extends string>(value: unknown, allowed: readonly T[]): T { if (typeof value !== 'string' || !allowed.includes(value as T)) invalid(); return value as T; }
|
|
118
|
+
function body(value: unknown): JsonObject | null {
|
|
119
|
+
if (value === null) return null;
|
|
120
|
+
try { const parsed = jsonValue(value, { maxBytes: MEMORY_MAX_BODY_BYTES, maxDepth: 12 }); if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) invalid(); return parsed as JsonObject; }
|
|
121
|
+
catch { return invalid(); }
|
|
122
|
+
}
|
|
123
|
+
function vector(value: unknown): string { if (typeof value !== 'string' || value.length === 0 || value.length > 65_536 || !base64.test(value)) invalid(); return value as string; }
|
|
124
|
+
function filter(value: Record<string, unknown>): MemoryFilter {
|
|
125
|
+
return { sensitivities: list(value['sensitivities'], 4, entry => member(entry, sensitivities)), asOf: time(value['asOf'])! };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function memoryRow(value: unknown): MemoryRow {
|
|
129
|
+
const row = record(value);
|
|
130
|
+
keys(row, ['id', 'version', 'status', 'sensitivity', 'body', 'validFrom', 'validUntil', 'createdAt', 'updatedAt', 'deletedAt', 'supersededBy']);
|
|
131
|
+
const status = member(row['status'], statuses); const content = body(row['body']);
|
|
132
|
+
const result: MemoryRow = { id: id(row['id']), version: integer(row['version'], 1), status, sensitivity: member(row['sensitivity'], sensitivities), body: content,
|
|
133
|
+
validFrom: time(row['validFrom'], true), validUntil: time(row['validUntil'], true), createdAt: time(row['createdAt'])!, updatedAt: time(row['updatedAt'])!,
|
|
134
|
+
deletedAt: time(row['deletedAt'], true), supersededBy: row['supersededBy'] === null ? null : id(row['supersededBy']) };
|
|
135
|
+
// A tombstone carries no content and no validity; live records carry both.
|
|
136
|
+
if ((status === 'deleted') !== (content === null) || (status === 'deleted') !== (result.deletedAt !== null)
|
|
137
|
+
|| (status === 'deleted') !== (result.validFrom === null) || (status === 'superseded') !== (result.supersededBy !== null)) invalid();
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
export function memoryEdgeRow(value: unknown): MemoryEdgeRow {
|
|
141
|
+
const row = record(value);
|
|
142
|
+
keys(row, ['id', 'version', 'status', 'from', 'to', 'relation', 'body', 'validFrom', 'validUntil', 'createdAt', 'updatedAt']);
|
|
143
|
+
const status = member(row['status'], ['active', 'deleted'] as const); const content = body(row['body']);
|
|
144
|
+
const result: MemoryEdgeRow = { id: id(row['id']), version: integer(row['version'], 1), status, from: id(row['from']), to: id(row['to']), relation: id(row['relation']),
|
|
145
|
+
body: content, validFrom: time(row['validFrom'], true), validUntil: time(row['validUntil'], true), createdAt: time(row['createdAt'])!, updatedAt: time(row['updatedAt'])! };
|
|
146
|
+
if ((status === 'deleted') !== (content === null) || (status === 'deleted') !== (result.validFrom === null) || result.from === result.to) invalid();
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
function vectorRow(value: unknown): MemoryVectorRow {
|
|
150
|
+
const row = record(value); keys(row, ['recordId', 'recordVersion', 'vector', 'list']);
|
|
151
|
+
return { recordId: id(row['recordId']), recordVersion: integer(row['recordVersion'], 1), vector: vector(row['vector']), list: row['list'] === null ? null : integer(row['list'], 0, 1_023) };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Validate and snapshot a command before it crosses a process or database boundary. */
|
|
155
|
+
export function memoryIndexCommand(method: MemoryIndexMethod, value: unknown): JsonObject {
|
|
156
|
+
if (!methods.has(method)) invalid();
|
|
157
|
+
const input = record(value); const scope = method === 'initialize' ? undefined : input['scope'];
|
|
158
|
+
if (scope !== undefined && (typeof scope !== 'string' || !scopeKey.test(scope))) invalid();
|
|
159
|
+
let output: Record<string, unknown>;
|
|
160
|
+
switch (method) {
|
|
161
|
+
case 'initialize': keys(input, []); output = {}; break;
|
|
162
|
+
case 'putRecord': {
|
|
163
|
+
keys(input, ['scope', 'record', 'expectedVersion', 'terms']);
|
|
164
|
+
const row = memoryRow(input['record']); const expectedVersion = integer(input['expectedVersion']);
|
|
165
|
+
if (row.version <= expectedVersion) invalid();
|
|
166
|
+
const terms = list(input['terms'], 4_096, entry => {
|
|
167
|
+
if (!Array.isArray(entry) || entry.length !== 2 || typeof entry[0] !== 'string' || entry[0].length === 0 || entry[0].length > 64) invalid();
|
|
168
|
+
return [entry[0] as string, integer(entry[1], 1, 1_000_000)] as const;
|
|
169
|
+
});
|
|
170
|
+
if (new Set(terms.map(([term]) => term)).size !== terms.length || (row.status !== 'active' && terms.length > 0)) invalid();
|
|
171
|
+
output = { scope, record: row, expectedVersion, terms }; break;
|
|
172
|
+
}
|
|
173
|
+
case 'getRecords': keys(input, ['scope', 'ids']); output = { scope, ids: list(input['ids'], MEMORY_MAX_BATCH, id) }; break;
|
|
174
|
+
case 'listRecords':
|
|
175
|
+
keys(input, ['scope', 'limit', 'statuses', 'sensitivities'], ['after']);
|
|
176
|
+
output = { scope, limit: integer(input['limit'], 1, MEMORY_MAX_BATCH), statuses: list(input['statuses'], 3, entry => member(entry, statuses)),
|
|
177
|
+
sensitivities: list(input['sensitivities'], 4, entry => member(entry, sensitivities)), ...(input['after'] === undefined ? {} : { after: id(input['after']) }) }; break;
|
|
178
|
+
case 'postings':
|
|
179
|
+
keys(input, ['scope', 'terms', 'limit', 'sensitivities', 'asOf']);
|
|
180
|
+
output = { scope, terms: list(input['terms'], 32, entry => { if (typeof entry !== 'string' || entry.length === 0 || entry.length > 64) invalid(); return entry; }),
|
|
181
|
+
limit: integer(input['limit'], 1, 100_000), ...filter(input) }; break;
|
|
182
|
+
case 'rank':
|
|
183
|
+
keys(input, ['scope', 'terms', 'limit', 'sensitivities', 'asOf']);
|
|
184
|
+
output = { scope, terms: list(input['terms'], 32, entry => { if (typeof entry !== 'string' || entry.length === 0 || entry.length > 64) invalid(); return entry; }),
|
|
185
|
+
limit: integer(input['limit'], 1, 1_000), ...filter(input) }; break;
|
|
186
|
+
case 'putEdge': {
|
|
187
|
+
keys(input, ['scope', 'edge', 'expectedVersion']); const edge = memoryEdgeRow(input['edge']); const expectedVersion = integer(input['expectedVersion']);
|
|
188
|
+
if (edge.version <= expectedVersion) invalid(); output = { scope, edge, expectedVersion }; break;
|
|
189
|
+
}
|
|
190
|
+
case 'getEdge': keys(input, ['scope', 'id']); output = { scope, id: id(input['id']) }; break;
|
|
191
|
+
case 'listEdges': keys(input, ['scope', 'limit'], ['after']); output = { scope, limit: integer(input['limit'], 1, MEMORY_MAX_BATCH), ...(input['after'] === undefined ? {} : { after: id(input['after']) }) }; break;
|
|
192
|
+
case 'edges':
|
|
193
|
+
keys(input, ['scope', 'recordIds', 'direction', 'limit', 'sensitivities', 'asOf'], ['relations']);
|
|
194
|
+
output = { scope, recordIds: list(input['recordIds'], MEMORY_MAX_BATCH, id), direction: member(input['direction'], ['out', 'in', 'both'] as const),
|
|
195
|
+
limit: integer(input['limit'], 1, 10_000), ...filter(input), ...(input['relations'] === undefined ? {} : { relations: list(input['relations'], 32, id) }) }; break;
|
|
196
|
+
case 'putVectors': {
|
|
197
|
+
keys(input, ['scope', 'embedderId', 'dimensions', 'entries']);
|
|
198
|
+
const dimensions = integer(input['dimensions'], 1, 4_096);
|
|
199
|
+
const entries = list(input['entries'], MEMORY_MAX_BATCH, vectorRow);
|
|
200
|
+
if (entries.some(entry => decodedBytes(entry.vector) !== dimensions * 4) || new Set(entries.map(entry => entry.recordId)).size !== entries.length) invalid();
|
|
201
|
+
output = { scope, embedderId: id(input['embedderId']), dimensions, entries }; break;
|
|
202
|
+
}
|
|
203
|
+
case 'missingVectors':
|
|
204
|
+
keys(input, ['scope', 'embedderId', 'sensitivities', 'limit']);
|
|
205
|
+
output = { scope, embedderId: id(input['embedderId']), sensitivities: list(input['sensitivities'], 4, entry => member(entry, sensitivities)), limit: integer(input['limit'], 1, MEMORY_MAX_BATCH) }; break;
|
|
206
|
+
case 'vectors':
|
|
207
|
+
keys(input, ['scope', 'embedderId', 'limit', 'sensitivities', 'asOf'], ['lists', 'after']);
|
|
208
|
+
output = { scope, embedderId: id(input['embedderId']), limit: integer(input['limit'], 1, 5_000), ...filter(input),
|
|
209
|
+
...(input['lists'] === undefined ? {} : { lists: list(input['lists'], 1_024, entry => integer(entry, 0, 1_023)) }),
|
|
210
|
+
...(input['after'] === undefined ? {} : { after: id(input['after']) }) }; break;
|
|
211
|
+
case 'indexState': keys(input, ['scope', 'embedderId']); output = { scope, embedderId: id(input['embedderId']) }; break;
|
|
212
|
+
case 'setCentroids': {
|
|
213
|
+
keys(input, ['scope', 'embedderId', 'dimensions', 'centroids', 'trainedAt']);
|
|
214
|
+
const dimensions = integer(input['dimensions'], 1, 4_096); const centroids = list(input['centroids'], 1_024, vector);
|
|
215
|
+
if (centroids.some(entry => decodedBytes(entry) !== dimensions * 4)) invalid();
|
|
216
|
+
output = { scope, embedderId: id(input['embedderId']), dimensions, centroids, trainedAt: integer(input['trainedAt']) }; break;
|
|
217
|
+
}
|
|
218
|
+
case 'assignLists':
|
|
219
|
+
keys(input, ['scope', 'embedderId', 'entries']);
|
|
220
|
+
output = { scope, embedderId: id(input['embedderId']), entries: list(input['entries'], 10_000, entry => {
|
|
221
|
+
if (!Array.isArray(entry) || entry.length !== 2) invalid(); return [id(entry[0]), integer(entry[1], 0, 1_023)] as const; }) }; break;
|
|
222
|
+
case 'changes': keys(input, ['scope', 'after', 'limit']); output = { scope, after: integer(input['after']), limit: integer(input['limit'], 1, MEMORY_MAX_BATCH) }; break;
|
|
223
|
+
case 'stats': keys(input, ['scope']); output = { scope }; break;
|
|
224
|
+
}
|
|
225
|
+
return freezeJson(jsonValue(output!, { maxBytes: 64 * 1_048_576, maxNodes: 2_000_000 })) as JsonObject;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** Results can be large (vector pages); bound them like commands rather than by the 1 MiB JSON default. */
|
|
229
|
+
function snapshot(value: unknown): unknown { return freezeJson(jsonValue(value, { maxBytes: 64 * 1_048_576, maxNodes: 2_000_000 })); }
|
|
230
|
+
|
|
231
|
+
/** Revalidate adapter results against the command that produced them. */
|
|
232
|
+
export function memoryIndexResult(method: MemoryIndexMethod, value: unknown, command: JsonObject): unknown {
|
|
233
|
+
try {
|
|
234
|
+
switch (method) {
|
|
235
|
+
case 'initialize': case 'setCentroids': if (value !== undefined && value !== null) corrupt(); return undefined;
|
|
236
|
+
case 'putRecord': {
|
|
237
|
+
const result = record(value); keys(result, ['record', 'sequence']); const row = memoryRow(result['record']);
|
|
238
|
+
if (JSON.stringify(row) !== JSON.stringify(command['record'])) corrupt();
|
|
239
|
+
return snapshot(({ record: row, sequence: integer(result['sequence'], 1) }));
|
|
240
|
+
}
|
|
241
|
+
case 'getRecords': case 'listRecords': {
|
|
242
|
+
const rows = list(value, MEMORY_MAX_BATCH, memoryRow);
|
|
243
|
+
if (method === 'getRecords' && rows.some(row => !(command['ids'] as string[]).includes(row.id))) corrupt();
|
|
244
|
+
if (method === 'listRecords' && (rows.length > (command['limit'] as number) || rows.some(row => !(command['statuses'] as string[]).includes(row.status)
|
|
245
|
+
|| !(command['sensitivities'] as string[]).includes(row.sensitivity)))) corrupt();
|
|
246
|
+
return snapshot((rows));
|
|
247
|
+
}
|
|
248
|
+
case 'postings': {
|
|
249
|
+
const result = record(value); keys(result, ['documents', 'averageLength', 'postings']);
|
|
250
|
+
const averageLength = result['averageLength'];
|
|
251
|
+
if (typeof averageLength !== 'number' || !Number.isFinite(averageLength) || averageLength < 0) corrupt();
|
|
252
|
+
const postings = list(result['postings'], command['limit'] as number, entry => {
|
|
253
|
+
const posting = record(entry); keys(posting, ['id', 'term', 'frequency', 'length']);
|
|
254
|
+
if (!(command['terms'] as string[]).includes(posting['term'] as string)) corrupt();
|
|
255
|
+
return { id: id(posting['id']), term: posting['term'] as string, frequency: integer(posting['frequency'], 1), length: integer(posting['length'], 1) };
|
|
256
|
+
});
|
|
257
|
+
return snapshot(({ documents: integer(result['documents']), averageLength, postings }));
|
|
258
|
+
}
|
|
259
|
+
case 'rank': {
|
|
260
|
+
const result = record(value); keys(result, ['documents', 'hits']);
|
|
261
|
+
return snapshot({ documents: integer(result['documents']), hits: list(result['hits'], command['limit'] as number, entry => {
|
|
262
|
+
const hit = record(entry); keys(hit, ['id', 'score']);
|
|
263
|
+
if (typeof hit['score'] !== 'number' || !Number.isFinite(hit['score'])) corrupt();
|
|
264
|
+
return { id: id(hit['id']), score: hit['score'] as number };
|
|
265
|
+
}) });
|
|
266
|
+
}
|
|
267
|
+
case 'putEdge': {
|
|
268
|
+
const result = record(value); keys(result, ['edge', 'sequence']); const edge = memoryEdgeRow(result['edge']);
|
|
269
|
+
if (JSON.stringify(edge) !== JSON.stringify(command['edge'])) corrupt();
|
|
270
|
+
return snapshot(({ edge, sequence: integer(result['sequence'], 1) }));
|
|
271
|
+
}
|
|
272
|
+
case 'getEdge': return value === undefined || value === null ? undefined : snapshot((memoryEdgeRow(value)));
|
|
273
|
+
case 'listEdges': return snapshot((list(value, command['limit'] as number, memoryEdgeRow)));
|
|
274
|
+
case 'edges': return snapshot((list(value, command['limit'] as number, entry => {
|
|
275
|
+
const edge = memoryEdgeRow(entry); if (edge.status !== 'active') corrupt(); return edge; })));
|
|
276
|
+
case 'putVectors': {
|
|
277
|
+
const result = record(value); keys(result, ['written', 'stale']);
|
|
278
|
+
return snapshot(({ written: integer(result['written'], 0, MEMORY_MAX_BATCH), stale: list(result['stale'], MEMORY_MAX_BATCH, id) }));
|
|
279
|
+
}
|
|
280
|
+
case 'missingVectors': return snapshot((list(value, command['limit'] as number, entry => {
|
|
281
|
+
const row = record(entry); keys(row, ['id', 'version']); return { id: id(row['id']), version: integer(row['version'], 1) }; })));
|
|
282
|
+
// Vector pages are large; each row is rebuilt from validated primitives, so a shallow freeze is a complete snapshot.
|
|
283
|
+
case 'vectors': return Object.freeze(list(value, command['limit'] as number, entry => Object.freeze(vectorRow(entry))));
|
|
284
|
+
case 'indexState': {
|
|
285
|
+
const result = record(value); keys(result, ['vectors', 'trainedAt', 'dimensions', 'centroids']);
|
|
286
|
+
return snapshot(({ vectors: integer(result['vectors']), trainedAt: integer(result['trainedAt']), dimensions: integer(result['dimensions']),
|
|
287
|
+
centroids: list(result['centroids'], 1_024, vector) }));
|
|
288
|
+
}
|
|
289
|
+
case 'assignLists': return integer(value, 0, 10_000);
|
|
290
|
+
case 'changes': {
|
|
291
|
+
let previous = command['after'] as number;
|
|
292
|
+
return snapshot((list(value, command['limit'] as number, entry => {
|
|
293
|
+
const change = record(entry); keys(change, ['sequence', 'kind', 'id', 'version', 'status']);
|
|
294
|
+
const sequence = integer(change['sequence'], 1); if (sequence <= previous) corrupt(); previous = sequence;
|
|
295
|
+
return { sequence, kind: member(change['kind'], ['record', 'edge'] as const), id: id(change['id']), version: integer(change['version'], 1),
|
|
296
|
+
status: member(change['status'], ['active', 'superseded', 'deleted'] as const) };
|
|
297
|
+
})));
|
|
298
|
+
}
|
|
299
|
+
case 'stats': {
|
|
300
|
+
const result = record(value); keys(result, ['records', 'edges', 'sequence']);
|
|
301
|
+
return snapshot(({ records: integer(result['records']), edges: integer(result['edges']), sequence: integer(result['sequence']) }));
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} catch (error) { if (error instanceof StorageError && error.code !== 'INVALID_INPUT') throw error; return corrupt(); }
|
|
305
|
+
return corrupt();
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** Client-side facade: validate commands before sending and results after receiving. */
|
|
309
|
+
export function memoryIndexFacade(request: (method: MemoryIndexMethod, input: JsonObject) => Promise<unknown>): MemoryIndexStore {
|
|
310
|
+
const call = async <T>(method: MemoryIndexMethod, value: unknown): Promise<T> => {
|
|
311
|
+
const command = memoryIndexCommand(method, value);
|
|
312
|
+
return memoryIndexResult(method, await request(method, command), command) as T;
|
|
313
|
+
};
|
|
314
|
+
return Object.freeze<MemoryIndexStore>({
|
|
315
|
+
initialize: () => call('initialize', {}), putRecord: value => call('putRecord', value), getRecords: value => call('getRecords', value),
|
|
316
|
+
listRecords: value => call('listRecords', value), postings: value => call('postings', value), rank: value => call('rank', value), putEdge: value => call('putEdge', value),
|
|
317
|
+
getEdge: value => call('getEdge', value), listEdges: value => call('listEdges', value), edges: value => call('edges', value), putVectors: value => call('putVectors', value),
|
|
318
|
+
missingVectors: value => call('missingVectors', value), vectors: value => call('vectors', value), indexState: value => call('indexState', value),
|
|
319
|
+
setCentroids: value => call('setCentroids', value), assignLists: value => call('assignLists', value), changes: value => call('changes', value),
|
|
320
|
+
stats: value => call('stats', value),
|
|
321
|
+
});
|
|
322
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Effect, ExecutionReceipt, ExecutionSettlement, JsonObject, JsonValue, Scope } from '@mayura/core';
|
|
2
|
+
import type { AggregateStore, StoredRecord } from './contracts.js';
|
|
3
|
+
import type { Claim, JobRecord, SchedulerEvidenceSource, SchedulerStore } from './scheduler-contracts.js';
|
|
4
|
+
|
|
5
|
+
export type WorkflowBinding =
|
|
6
|
+
| { readonly kind: 'literal'; readonly value: JsonValue }
|
|
7
|
+
| { readonly kind: 'input'; readonly path: readonly string[] }
|
|
8
|
+
| { readonly kind: 'step'; readonly stepId: string; readonly path: readonly string[] };
|
|
9
|
+
export type WorkflowManifestNode =
|
|
10
|
+
| { readonly kind: 'join'; readonly id: string; readonly dependsOn: readonly string[] }
|
|
11
|
+
| { readonly kind: 'tool'; readonly id: string; readonly dependsOn: readonly string[];
|
|
12
|
+
readonly tool: string; readonly toolVersion: string; readonly effects: Effect;
|
|
13
|
+
readonly capabilities: readonly string[]; readonly costMicros: number;
|
|
14
|
+
readonly approval: boolean; readonly input: WorkflowBinding };
|
|
15
|
+
/** Data-only material reproducing the existing mayura:workflow:v1 definition digest. */
|
|
16
|
+
export interface WorkflowManifest {
|
|
17
|
+
readonly id: string; readonly version: string; readonly graph: readonly WorkflowManifestNode[];
|
|
18
|
+
readonly result: WorkflowBinding;
|
|
19
|
+
}
|
|
20
|
+
/** Exact legacy policy material; permissions preserve duplicates for hash compatibility. */
|
|
21
|
+
export interface WorkflowPolicyManifest {
|
|
22
|
+
readonly scope: Scope; readonly permissions: readonly string[]; readonly policyVersion: string;
|
|
23
|
+
readonly maxCostMicros: number; readonly maxOutputBytes: number; readonly approvalTtlMs: number;
|
|
24
|
+
}
|
|
25
|
+
export type WorkflowResourcePlan = Readonly<Record<string, readonly string[]>>;
|
|
26
|
+
export interface ScheduledRunKey { readonly scope: string; readonly id: string }
|
|
27
|
+
export interface ScheduledRunAccess extends ScheduledRunKey { readonly policyHash: string }
|
|
28
|
+
export interface ScheduledWrite extends ScheduledRunAccess {
|
|
29
|
+
readonly expectedVersion: number;
|
|
30
|
+
/** Stable logical command ID. Retried expectedVersion is not semantic command content. */
|
|
31
|
+
readonly commandId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ScheduledWorkflowSnapshot {
|
|
34
|
+
readonly record: StoredRecord;
|
|
35
|
+
readonly profile: 'scheduled-v1';
|
|
36
|
+
readonly manifestHash: string;
|
|
37
|
+
readonly policyHash: string;
|
|
38
|
+
readonly resourceHash: string;
|
|
39
|
+
readonly jobs: readonly JobRecord[];
|
|
40
|
+
}
|
|
41
|
+
export interface ScheduledEnrollment {
|
|
42
|
+
readonly manifest: WorkflowManifest; readonly policy: WorkflowPolicyManifest;
|
|
43
|
+
readonly resources: WorkflowResourcePlan;
|
|
44
|
+
}
|
|
45
|
+
/** Finite trusted persistence commands. No callback, arbitrary replacement state, or user clock. */
|
|
46
|
+
/** A reviewed migration command. `state` is the complete migrated state; the store decides whether it is safe. */
|
|
47
|
+
export interface ScheduledMigrate extends ScheduledWrite {
|
|
48
|
+
readonly manifest: WorkflowManifest | import('./workflow-graph-contracts.js').WorkflowGraphManifest;
|
|
49
|
+
readonly resources: WorkflowResourcePlan;
|
|
50
|
+
readonly state: JsonObject;
|
|
51
|
+
readonly migrationId: string;
|
|
52
|
+
readonly actorId: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ScheduledWorkflowStore {
|
|
55
|
+
initialize(): Promise<void>;
|
|
56
|
+
submit(command: ScheduledEnrollment & { readonly input: JsonValue; readonly idempotencyKey: string }): Promise<{ readonly snapshot: ScheduledWorkflowSnapshot; readonly created: boolean }>;
|
|
57
|
+
attach(command: ScheduledWrite & ScheduledEnrollment): Promise<ScheduledWorkflowSnapshot>;
|
|
58
|
+
inspect(command: ScheduledRunAccess): Promise<ScheduledWorkflowSnapshot>;
|
|
59
|
+
requestApproval(command: ScheduledWrite & { readonly nodeId: string; readonly input: JsonValue }): Promise<ScheduledWorkflowSnapshot>;
|
|
60
|
+
approve(command: ScheduledWrite & { readonly nodeId: string; readonly digest: string; readonly humanId: string }): Promise<ScheduledWorkflowSnapshot>;
|
|
61
|
+
prepare(command: ScheduledWrite & { readonly nodeId: string; readonly input: JsonValue }): Promise<ScheduledWorkflowSnapshot>;
|
|
62
|
+
claim(command: ScheduledRunAccess & { readonly workerId: string; readonly limit: number; readonly leaseMs: number }): Promise<readonly { readonly job: JobRecord; readonly claim: Claim }[]>;
|
|
63
|
+
renew(command: ScheduledRunAccess & { readonly claim: Claim; readonly leaseMs: number }): Promise<Claim>;
|
|
64
|
+
start(command: ScheduledWrite & { readonly claim: Claim; readonly input: JsonValue }): Promise<{ readonly status: 'started' | 'already_started'; readonly snapshot: ScheduledWorkflowSnapshot }>;
|
|
65
|
+
recordReceipt(command: ScheduledRunAccess & { readonly jobId: string; readonly fence: number; readonly evidenceId: string;
|
|
66
|
+
readonly receipt: ExecutionReceipt; readonly settlement?: ExecutionSettlement; readonly source?: SchedulerEvidenceSource }): Promise<ScheduledWorkflowSnapshot>;
|
|
67
|
+
complete(command: ScheduledWrite & { readonly claim: Claim; readonly evidenceId: string; readonly outcome: 'succeeded' | 'failed' | 'blocked'; readonly output: JsonValue | null }): Promise<ScheduledWorkflowSnapshot>;
|
|
68
|
+
abandon(command: ScheduledWrite & { readonly claim: Claim; readonly outcome: 'failed' | 'blocked' }): Promise<ScheduledWorkflowSnapshot>;
|
|
69
|
+
failNode(command: ScheduledWrite & { readonly nodeId: string; readonly outcome: 'failed' | 'blocked' }): Promise<ScheduledWorkflowSnapshot>;
|
|
70
|
+
advance(command: ScheduledWrite): Promise<ScheduledWorkflowSnapshot>;
|
|
71
|
+
finalize(command: ScheduledWrite & ({ readonly validation: 'passed'; readonly output: JsonValue } | { readonly validation: 'failed' })): Promise<ScheduledWorkflowSnapshot>;
|
|
72
|
+
cancel(command: ScheduledWrite): Promise<ScheduledWorkflowSnapshot>;
|
|
73
|
+
/** Optional quiescent operator pause; refused while any job is leased or started. */
|
|
74
|
+
pause?(command: ScheduledWrite): Promise<ScheduledWorkflowSnapshot>;
|
|
75
|
+
resume?(command: ScheduledWrite): Promise<ScheduledWorkflowSnapshot>;
|
|
76
|
+
/**
|
|
77
|
+
* Optional reviewed in-place migration of a paused run to a new manifest. The store re-verifies everything: steps with
|
|
78
|
+
* scheduler history and started waits must be unchanged, no other run may wait on this one, and the new state must
|
|
79
|
+
* satisfy the new manifest. The previous definition digest joins the owner lineage so existing job history stays valid.
|
|
80
|
+
*/
|
|
81
|
+
migrate?(command: ScheduledMigrate): Promise<ScheduledWorkflowSnapshot>;
|
|
82
|
+
recover(command: ScheduledWrite): Promise<ScheduledWorkflowSnapshot>;
|
|
83
|
+
}
|
|
84
|
+
/** Explicit opt-in capability; conservative/custom aggregate-only adapters remain supported. */
|
|
85
|
+
export interface ScheduledWorkflowAggregateStore extends AggregateStore {
|
|
86
|
+
readonly scheduler: SchedulerStore;
|
|
87
|
+
readonly workflows: ScheduledWorkflowStore;
|
|
88
|
+
}
|