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,430 @@
|
|
|
1
|
+
import { freezeJson, jsonValue } from '../../core/dist/index.js';
|
|
2
|
+
import { StorageError } from './contracts.js';
|
|
3
|
+
const safe = BigInt(Number.MAX_SAFE_INTEGER);
|
|
4
|
+
const maximumSpent = safe * 512n;
|
|
5
|
+
const identifierPattern = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;
|
|
6
|
+
const encoder = new TextEncoder();
|
|
7
|
+
const methods = new Set(['initialize', 'create', 'fork', 'reserveBundle', 'start', 'markUnknown', 'settle', 'cancelReservation', 'closeSubtree', 'inspect', 'events']);
|
|
8
|
+
function invalid() { throw new StorageError('INVALID_INPUT', 'Invalid bounded durable budget metadata.'); }
|
|
9
|
+
function corrupt() { throw new StorageError('STORAGE_UNAVAILABLE', 'Durable budget metadata failed integrity validation.'); }
|
|
10
|
+
function object(value) { if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
11
|
+
invalid(); return value; }
|
|
12
|
+
function fields(value, names) {
|
|
13
|
+
if (Object.keys(value).length !== names.length || names.some(name => !Object.hasOwn(value, name)))
|
|
14
|
+
invalid();
|
|
15
|
+
}
|
|
16
|
+
function integer(value, minimum = 0, maximum = Number.MAX_SAFE_INTEGER) {
|
|
17
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < minimum || value > maximum)
|
|
18
|
+
invalid();
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
function id(value) { if (typeof value !== 'string' || !identifierPattern.test(value))
|
|
22
|
+
invalid(); return value; }
|
|
23
|
+
function identifier(value) {
|
|
24
|
+
// Unicode mode treats a valid surrogate pair as one supplementary code point;
|
|
25
|
+
// only unpaired units match. Native SQL UTF-8 encoding must not alias keys.
|
|
26
|
+
if (typeof value !== 'string' || !value.length || value.includes('\0') || /[\uD800-\uDFFF]/u.test(value) || encoder.encode(value).length > 256)
|
|
27
|
+
invalid();
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function key(value) {
|
|
31
|
+
identifier(value['scope']);
|
|
32
|
+
identifier(value['id']);
|
|
33
|
+
if (typeof value['policyHash'] !== 'string' || !/^[a-f0-9]{64}$/.test(value['policyHash']))
|
|
34
|
+
invalid();
|
|
35
|
+
}
|
|
36
|
+
function limits(value) { integer(value['maxCostMicros']); integer(value['maxCalls'], 1); }
|
|
37
|
+
function operations(raw) {
|
|
38
|
+
if (!Array.isArray(raw) || raw.length < 1 || raw.length > 32)
|
|
39
|
+
invalid();
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
for (const item of raw) {
|
|
42
|
+
const value = object(item);
|
|
43
|
+
fields(value, ['id', 'maxCostMicros']);
|
|
44
|
+
const name = id(value['id']);
|
|
45
|
+
if (seen.has(name))
|
|
46
|
+
invalid();
|
|
47
|
+
seen.add(name);
|
|
48
|
+
integer(value['maxCostMicros']);
|
|
49
|
+
}
|
|
50
|
+
return raw;
|
|
51
|
+
}
|
|
52
|
+
function capture(raw, bytes = 1_048_576) {
|
|
53
|
+
return object(jsonValue(raw, { maxBytes: bytes, maxNodes: 30_000, maxDepth: 24 }));
|
|
54
|
+
}
|
|
55
|
+
function immutable(value) { return freezeJson(value); }
|
|
56
|
+
/** Exact owned command snapshots must be produced before any asynchronous transport. */
|
|
57
|
+
export function durableBudgetCommand(method, raw) {
|
|
58
|
+
try {
|
|
59
|
+
if (!methods.has(method))
|
|
60
|
+
invalid();
|
|
61
|
+
const value = capture(raw, 32_768);
|
|
62
|
+
if (method === 'initialize') {
|
|
63
|
+
fields(value, []);
|
|
64
|
+
return immutable(value);
|
|
65
|
+
}
|
|
66
|
+
key(value);
|
|
67
|
+
const common = ['scope', 'id', 'policyHash'];
|
|
68
|
+
switch (method) {
|
|
69
|
+
case 'create':
|
|
70
|
+
fields(value, [...common, 'maxCostMicros', 'maxCalls']);
|
|
71
|
+
limits(value);
|
|
72
|
+
break;
|
|
73
|
+
case 'fork':
|
|
74
|
+
fields(value, [...common, 'parentId', 'accountId', 'maxCostMicros', 'maxCalls']);
|
|
75
|
+
id(value['parentId']);
|
|
76
|
+
id(value['accountId']);
|
|
77
|
+
limits(value);
|
|
78
|
+
break;
|
|
79
|
+
case 'reserveBundle':
|
|
80
|
+
fields(value, [...common, 'accountId', 'bundleId', 'operations']);
|
|
81
|
+
id(value['accountId']);
|
|
82
|
+
id(value['bundleId']);
|
|
83
|
+
operations(value['operations']);
|
|
84
|
+
break;
|
|
85
|
+
case 'start':
|
|
86
|
+
case 'markUnknown':
|
|
87
|
+
case 'cancelReservation':
|
|
88
|
+
fields(value, [...common, 'accountId', 'reservationId']);
|
|
89
|
+
id(value['accountId']);
|
|
90
|
+
id(value['reservationId']);
|
|
91
|
+
break;
|
|
92
|
+
case 'settle':
|
|
93
|
+
fields(value, [...common, 'accountId', 'reservationId', 'actualMicros']);
|
|
94
|
+
id(value['accountId']);
|
|
95
|
+
id(value['reservationId']);
|
|
96
|
+
integer(value['actualMicros']);
|
|
97
|
+
break;
|
|
98
|
+
case 'closeSubtree':
|
|
99
|
+
fields(value, [...common, 'accountId']);
|
|
100
|
+
id(value['accountId']);
|
|
101
|
+
break;
|
|
102
|
+
case 'inspect':
|
|
103
|
+
fields(value, common);
|
|
104
|
+
break;
|
|
105
|
+
case 'events':
|
|
106
|
+
if (!Object.hasOwn(value, 'after'))
|
|
107
|
+
value['after'] = 0;
|
|
108
|
+
fields(value, [...common, 'after']);
|
|
109
|
+
integer(value['after']);
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
return immutable(value);
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return invalid();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function spent(value) {
|
|
119
|
+
if (typeof value === 'number')
|
|
120
|
+
return BigInt(integer(value));
|
|
121
|
+
if (typeof value !== 'string' || !/^[1-9][0-9]{0,20}$/.test(value))
|
|
122
|
+
invalid();
|
|
123
|
+
const amount = BigInt(value);
|
|
124
|
+
if (amount <= safe || amount > maximumSpent)
|
|
125
|
+
invalid();
|
|
126
|
+
return amount;
|
|
127
|
+
}
|
|
128
|
+
function sortedArray(value, maximum, minimum = 0) {
|
|
129
|
+
if (!Array.isArray(value) || value.length < minimum || value.length > maximum)
|
|
130
|
+
invalid();
|
|
131
|
+
let previous = '';
|
|
132
|
+
const result = [];
|
|
133
|
+
for (const entry of value) {
|
|
134
|
+
const item = object(entry);
|
|
135
|
+
const name = id(item['id']);
|
|
136
|
+
if (name <= previous)
|
|
137
|
+
invalid();
|
|
138
|
+
previous = name;
|
|
139
|
+
result.push(item);
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
/** Validate complete immutable evidence and independently rederive every inclusive account total. */
|
|
144
|
+
export function durableBudgetSnapshot(raw, context) {
|
|
145
|
+
try {
|
|
146
|
+
const value = capture(raw);
|
|
147
|
+
fields(value, ['format', 'mode', 'owner', 'scope', 'id', 'policyHash', 'version', 'eventSequence', 'blocked', 'accounts', 'bundles', 'reservations']);
|
|
148
|
+
key(value);
|
|
149
|
+
if (value['format'] !== 1 || value['mode'] !== 'shared-ceiling-v1' || value['owner'] !== 'host-v1' || typeof value['blocked'] !== 'boolean')
|
|
150
|
+
invalid();
|
|
151
|
+
integer(value['version'], 1, 2_048);
|
|
152
|
+
if (value['eventSequence'] !== value['version'])
|
|
153
|
+
invalid();
|
|
154
|
+
if (context) {
|
|
155
|
+
const expected = durableBudgetCommand('inspect', context);
|
|
156
|
+
for (const name of ['scope', 'id', 'policyHash'])
|
|
157
|
+
if (value[name] !== expected[name])
|
|
158
|
+
invalid();
|
|
159
|
+
}
|
|
160
|
+
const accountRows = sortedArray(value['accounts'], 128, 1);
|
|
161
|
+
const accounts = new Map();
|
|
162
|
+
for (const account of accountRows) {
|
|
163
|
+
fields(account, ['id', 'parentId', 'maxCostMicros', 'maxCalls', 'closed', 'spentMicros', 'reservedMicros', 'calls', 'heldCalls']);
|
|
164
|
+
limits(account);
|
|
165
|
+
if (typeof account['closed'] !== 'boolean')
|
|
166
|
+
invalid();
|
|
167
|
+
if (account['id'] === 'root') {
|
|
168
|
+
if (account['parentId'] !== null)
|
|
169
|
+
invalid();
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
id(account['parentId']);
|
|
173
|
+
spent(account['spentMicros']);
|
|
174
|
+
integer(account['reservedMicros']);
|
|
175
|
+
integer(account['calls']);
|
|
176
|
+
integer(account['heldCalls']);
|
|
177
|
+
accounts.set(account['id'], account);
|
|
178
|
+
}
|
|
179
|
+
if (!accounts.has('root'))
|
|
180
|
+
invalid();
|
|
181
|
+
const paths = new Map();
|
|
182
|
+
const usage = new Map();
|
|
183
|
+
for (const account of accounts.values()) {
|
|
184
|
+
const path = [];
|
|
185
|
+
const seen = new Set();
|
|
186
|
+
let current = account;
|
|
187
|
+
while (current) {
|
|
188
|
+
if (seen.has(current.id) || path.length > 16)
|
|
189
|
+
invalid();
|
|
190
|
+
seen.add(current.id);
|
|
191
|
+
path.push(current);
|
|
192
|
+
if (current.parentId === null)
|
|
193
|
+
break;
|
|
194
|
+
const parent = accounts.get(current.parentId);
|
|
195
|
+
if (!parent || current.maxCostMicros > parent.maxCostMicros || current.maxCalls > parent.maxCalls)
|
|
196
|
+
invalid();
|
|
197
|
+
current = parent;
|
|
198
|
+
}
|
|
199
|
+
if (path.at(-1)?.id !== 'root')
|
|
200
|
+
invalid();
|
|
201
|
+
paths.set(account.id, path);
|
|
202
|
+
usage.set(account.id, { spent: 0n, nominalSpent: 0n, reserved: 0n, calls: 0, held: 0 });
|
|
203
|
+
}
|
|
204
|
+
const bundleRows = sortedArray(value['bundles'], 128);
|
|
205
|
+
const admitted = new Map();
|
|
206
|
+
for (const bundle of bundleRows) {
|
|
207
|
+
fields(bundle, ['id', 'accountId', 'operations']);
|
|
208
|
+
const accountId = id(bundle['accountId']);
|
|
209
|
+
if (!accounts.has(accountId))
|
|
210
|
+
invalid();
|
|
211
|
+
const items = operations(bundle['operations']);
|
|
212
|
+
const bound = items.reduce((sum, operation) => sum + BigInt(operation.maxCostMicros), 0n);
|
|
213
|
+
// Released tickets still attest an atomic historical admission; cancellation
|
|
214
|
+
// must not hide a bundle that could never fit its immutable ancestor ceilings.
|
|
215
|
+
for (const ancestor of paths.get(accountId))
|
|
216
|
+
if (bound > BigInt(ancestor.maxCostMicros) || items.length > ancestor.maxCalls)
|
|
217
|
+
invalid();
|
|
218
|
+
for (const operation of items) {
|
|
219
|
+
if (admitted.has(operation.id))
|
|
220
|
+
invalid();
|
|
221
|
+
admitted.set(operation.id, { bundleId: bundle['id'], accountId, bound: operation.maxCostMicros });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const reservations = sortedArray(value['reservations'], 512);
|
|
225
|
+
if (reservations.length !== admitted.size)
|
|
226
|
+
invalid();
|
|
227
|
+
let blocked = false;
|
|
228
|
+
let minimumVersion = accounts.size + bundleRows.length + accountRows.filter(account => account['closed'] === true).length;
|
|
229
|
+
let maximumVersion = minimumVersion;
|
|
230
|
+
for (const reservation of reservations) {
|
|
231
|
+
fields(reservation, ['id', 'accountId', 'bundleId', 'maxCostMicros', 'status', 'actualMicros']);
|
|
232
|
+
const entry = admitted.get(reservation['id']);
|
|
233
|
+
if (!entry || reservation['accountId'] !== entry.accountId || reservation['bundleId'] !== entry.bundleId || reservation['maxCostMicros'] !== entry.bound)
|
|
234
|
+
invalid();
|
|
235
|
+
const status = reservation['status'];
|
|
236
|
+
if (!['held', 'started', 'unknown', 'settled', 'cancelled'].includes(status))
|
|
237
|
+
invalid();
|
|
238
|
+
const actual = status === 'settled' ? integer(reservation['actualMicros']) : 0;
|
|
239
|
+
if (status !== 'settled' && reservation['actualMicros'] !== null)
|
|
240
|
+
invalid();
|
|
241
|
+
const overrun = status === 'settled' && actual > entry.bound;
|
|
242
|
+
blocked ||= overrun;
|
|
243
|
+
const path = paths.get(entry.accountId);
|
|
244
|
+
// Unknown-before-settlement and individual-versus-subtree cancellation are
|
|
245
|
+
// intentionally not replayed here. Their finite ranges still reject forged
|
|
246
|
+
// version inflation that would consume required terminal evidence headroom.
|
|
247
|
+
const minimumTransitions = status === 'held' ? 0 : status === 'started' ? 1 : status === 'unknown' || status === 'settled' ? 2
|
|
248
|
+
: path.some(ancestor => ancestor.closed) ? 0 : 1;
|
|
249
|
+
const maximumTransitions = status === 'settled' ? 3 : status === 'cancelled' ? 1 : minimumTransitions;
|
|
250
|
+
minimumVersion += minimumTransitions;
|
|
251
|
+
maximumVersion += maximumTransitions;
|
|
252
|
+
for (const ancestor of path) {
|
|
253
|
+
if (status === 'held' && ancestor.closed)
|
|
254
|
+
invalid();
|
|
255
|
+
const total = usage.get(ancestor.id);
|
|
256
|
+
if (status === 'held')
|
|
257
|
+
total.held++;
|
|
258
|
+
if (status === 'started' || status === 'unknown' || status === 'settled')
|
|
259
|
+
total.calls++;
|
|
260
|
+
if (status === 'held' || status === 'started' || status === 'unknown')
|
|
261
|
+
total.reserved += BigInt(entry.bound);
|
|
262
|
+
if (status === 'settled') {
|
|
263
|
+
total.spent += BigInt(actual);
|
|
264
|
+
// Excess actual cost is truthful evidence, not a reason to bypass the
|
|
265
|
+
// original admission ceilings. Retain both exact and nominal spending.
|
|
266
|
+
total.nominalSpent += BigInt(Math.min(actual, entry.bound));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (value['blocked'] !== blocked)
|
|
271
|
+
invalid();
|
|
272
|
+
if (value['version'] < minimumVersion || value['version'] > maximumVersion)
|
|
273
|
+
invalid();
|
|
274
|
+
for (const account of accounts.values()) {
|
|
275
|
+
const total = usage.get(account.id);
|
|
276
|
+
if (spent(account.spentMicros) !== total.spent || BigInt(account.reservedMicros) !== total.reserved || account.calls !== total.calls || account.heldCalls !== total.held
|
|
277
|
+
|| total.calls + total.held > account.maxCalls || total.reserved > BigInt(account.maxCostMicros)
|
|
278
|
+
|| total.nominalSpent + total.reserved > BigInt(account.maxCostMicros))
|
|
279
|
+
invalid();
|
|
280
|
+
}
|
|
281
|
+
return immutable(value);
|
|
282
|
+
}
|
|
283
|
+
catch {
|
|
284
|
+
return corrupt();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function eventPage(raw, after) {
|
|
288
|
+
const value = jsonValue(raw, { maxBytes: 1_048_576, maxNodes: 30_000, maxDepth: 8 });
|
|
289
|
+
if (!Array.isArray(value) || value.length > 1_000)
|
|
290
|
+
invalid();
|
|
291
|
+
let sequence = after;
|
|
292
|
+
for (const entry of value) {
|
|
293
|
+
const event = object(entry);
|
|
294
|
+
fields(event, ['sequence', 'type', 'data', 'createdAt']);
|
|
295
|
+
const next = integer(event['sequence'], 1, 2_048);
|
|
296
|
+
if (next !== sequence + 1)
|
|
297
|
+
invalid();
|
|
298
|
+
sequence = next;
|
|
299
|
+
const date = event['createdAt'];
|
|
300
|
+
if (typeof date !== 'string' || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(date) || new Date(date).toISOString() !== date)
|
|
301
|
+
invalid();
|
|
302
|
+
const data = object(event['data']);
|
|
303
|
+
switch (event['type']) {
|
|
304
|
+
case 'budget.created':
|
|
305
|
+
fields(data, []);
|
|
306
|
+
if (next !== 1)
|
|
307
|
+
invalid();
|
|
308
|
+
break;
|
|
309
|
+
case 'budget.forked':
|
|
310
|
+
fields(data, ['accountId', 'parentId']);
|
|
311
|
+
id(data['accountId']);
|
|
312
|
+
id(data['parentId']);
|
|
313
|
+
break;
|
|
314
|
+
case 'budget.reserved':
|
|
315
|
+
fields(data, ['accountId', 'bundleId']);
|
|
316
|
+
id(data['accountId']);
|
|
317
|
+
id(data['bundleId']);
|
|
318
|
+
break;
|
|
319
|
+
case 'budget.started':
|
|
320
|
+
case 'budget.unknown':
|
|
321
|
+
case 'budget.reservation_cancelled':
|
|
322
|
+
fields(data, ['accountId', 'reservationId']);
|
|
323
|
+
id(data['accountId']);
|
|
324
|
+
id(data['reservationId']);
|
|
325
|
+
break;
|
|
326
|
+
case 'budget.settled':
|
|
327
|
+
fields(data, ['accountId', 'reservationId', 'overrun']);
|
|
328
|
+
id(data['accountId']);
|
|
329
|
+
id(data['reservationId']);
|
|
330
|
+
if (typeof data['overrun'] !== 'boolean')
|
|
331
|
+
invalid();
|
|
332
|
+
break;
|
|
333
|
+
case 'budget.subtree_closed':
|
|
334
|
+
fields(data, ['accountId', 'cancelledReservations']);
|
|
335
|
+
id(data['accountId']);
|
|
336
|
+
integer(data['cancelledReservations'], 0, 512);
|
|
337
|
+
break;
|
|
338
|
+
default: invalid();
|
|
339
|
+
}
|
|
340
|
+
if (next === 1 && event['type'] !== 'budget.created')
|
|
341
|
+
invalid();
|
|
342
|
+
}
|
|
343
|
+
return immutable(value);
|
|
344
|
+
}
|
|
345
|
+
/** Validate replies independently of adapter assertions, including command-specific ownership and transitions. */
|
|
346
|
+
export function durableBudgetResult(method, raw, context) {
|
|
347
|
+
const command = durableBudgetCommand(method, context);
|
|
348
|
+
try {
|
|
349
|
+
if (method === 'initialize') {
|
|
350
|
+
if (raw !== undefined)
|
|
351
|
+
invalid();
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
354
|
+
if (method === 'events')
|
|
355
|
+
return eventPage(raw, command['after']);
|
|
356
|
+
if (method === 'inspect' && raw === undefined)
|
|
357
|
+
return undefined;
|
|
358
|
+
const envelope = ['create', 'start', 'settle'].includes(method) ? capture(raw) : undefined;
|
|
359
|
+
const state = durableBudgetSnapshot(envelope ? envelope['snapshot'] : raw, { scope: command['scope'], id: command['id'], policyHash: command['policyHash'] });
|
|
360
|
+
const account = state.accounts.find(item => item.id === command['accountId']);
|
|
361
|
+
const ticket = state.reservations.find(item => item.id === command['reservationId']);
|
|
362
|
+
if (['fork', 'reserveBundle', 'start', 'markUnknown', 'settle', 'cancelReservation', 'closeSubtree'].includes(method) && !account)
|
|
363
|
+
invalid();
|
|
364
|
+
if (['start', 'markUnknown', 'settle', 'cancelReservation'].includes(method) && (!ticket || ticket.accountId !== command['accountId']))
|
|
365
|
+
invalid();
|
|
366
|
+
if (method === 'create') {
|
|
367
|
+
fields(envelope, ['snapshot', 'created']);
|
|
368
|
+
if (typeof envelope['created'] !== 'boolean')
|
|
369
|
+
invalid();
|
|
370
|
+
const root = state.accounts.find(item => item.id === 'root');
|
|
371
|
+
if (root.maxCostMicros !== command['maxCostMicros'] || root.maxCalls !== command['maxCalls'])
|
|
372
|
+
invalid();
|
|
373
|
+
if (envelope['created'] === true && (state.version !== 1 || state.accounts.length !== 1 || state.bundles.length || root.closed || state.blocked))
|
|
374
|
+
invalid();
|
|
375
|
+
}
|
|
376
|
+
else if (method === 'fork') {
|
|
377
|
+
if (account.parentId !== command['parentId'] || account.maxCostMicros !== command['maxCostMicros'] || account.maxCalls !== command['maxCalls'])
|
|
378
|
+
invalid();
|
|
379
|
+
}
|
|
380
|
+
else if (method === 'reserveBundle') {
|
|
381
|
+
const bundle = state.bundles.find(item => item.id === command['bundleId']);
|
|
382
|
+
const requested = command['operations'];
|
|
383
|
+
if (!bundle || bundle.accountId !== command['accountId'] || bundle.operations.length !== requested.length
|
|
384
|
+
|| bundle.operations.some((item, index) => item.id !== requested[index].id || item.maxCostMicros !== requested[index].maxCostMicros))
|
|
385
|
+
invalid();
|
|
386
|
+
}
|
|
387
|
+
else if (method === 'start') {
|
|
388
|
+
fields(envelope, ['snapshot', 'status']);
|
|
389
|
+
const status = envelope['status'];
|
|
390
|
+
if (!['started', 'already_started'].includes(status) || !['started', 'unknown', 'settled'].includes(ticket.status)
|
|
391
|
+
|| (status === 'started' && ticket.status !== 'started'))
|
|
392
|
+
invalid();
|
|
393
|
+
if (status === 'started') {
|
|
394
|
+
if (state.blocked)
|
|
395
|
+
invalid();
|
|
396
|
+
let current = account;
|
|
397
|
+
for (;;) {
|
|
398
|
+
if (current.closed)
|
|
399
|
+
invalid();
|
|
400
|
+
if (current.parentId === null)
|
|
401
|
+
break;
|
|
402
|
+
current = state.accounts.find(item => item.id === current.parentId);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else if (method === 'markUnknown') {
|
|
407
|
+
if (!['unknown', 'settled'].includes(ticket.status))
|
|
408
|
+
invalid();
|
|
409
|
+
}
|
|
410
|
+
else if (method === 'settle') {
|
|
411
|
+
fields(envelope, ['snapshot', 'overrun']);
|
|
412
|
+
if (ticket.status !== 'settled' || ticket.actualMicros !== command['actualMicros']
|
|
413
|
+
|| envelope['overrun'] !== (ticket.actualMicros > ticket.maxCostMicros))
|
|
414
|
+
invalid();
|
|
415
|
+
}
|
|
416
|
+
else if (method === 'cancelReservation') {
|
|
417
|
+
if (ticket.status !== 'cancelled')
|
|
418
|
+
invalid();
|
|
419
|
+
}
|
|
420
|
+
else if (method === 'closeSubtree') {
|
|
421
|
+
if (!account.closed)
|
|
422
|
+
invalid();
|
|
423
|
+
}
|
|
424
|
+
return (envelope ? immutable({ ...envelope, snapshot: state }) : state);
|
|
425
|
+
}
|
|
426
|
+
catch {
|
|
427
|
+
return corrupt();
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=durable-budget-contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-budget-contracts.js","sourceRoot":"","sources":["../src/durable-budget-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAmC,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,YAAY,EAAyC,MAAM,gBAAgB,CAAC;AAoDrF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAC7C,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AACjC,MAAM,iBAAiB,GAAG,sCAAsC,CAAC;AACjE,MAAM,OAAO,GAAG,IAAI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,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAO,CAAC,MAAM,CAAC;gBAAE,OAAO,EAAE,CAAC;QAAC,CAAC;aACpG,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,CAAC,QAAS,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;YAAC,IAAI,MAAO,CAAC,MAAM,KAAK,SAAS,IAAI,MAAO,CAAC,YAAY,KAAK,OAAO,CAAC,cAAc,CAAC;mBAC3H,QAAS,CAAC,SAAS,CAAC,KAAK,CAAC,MAAO,CAAC,YAAa,GAAG,MAAO,CAAC,aAAa,CAAC;gBAAE,OAAO,EAAE,CAAC;QAC3F,CAAC;aAAM,IAAI,MAAM,KAAK,mBAAmB,EAAE,CAAC;YAAC,IAAI,MAAO,CAAC,MAAM,KAAK,WAAW;gBAAE,OAAO,EAAE,CAAC;QAAC,CAAC;aACxF,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;YAAC,IAAI,CAAC,OAAQ,CAAC,MAAM;gBAAE,OAAO,EAAE,CAAC;QAAC,CAAC;QACxE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,KAA6B,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAiC,CAAC;IAClI,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;IAAC,CAAC;AAC/B,CAAC","sourcesContent":["import { freezeJson, jsonValue, type JsonObject, type JsonValue } from '@mayura/core';\nimport { StorageError, type AggregateStore, type StoredEvent } from './contracts.js';\n\n/** Correlation pins for trusted-host accounting, never runnable execution authority. */\nexport interface DurableBudgetKey { readonly scope: string; readonly id: string; readonly policyHash: string }\nexport interface DurableBudgetLimits { readonly maxCostMicros: number; readonly maxCalls: number }\nexport interface DurableBudgetAccount extends DurableBudgetLimits {\n readonly id: string; readonly parentId: string | null; readonly closed: boolean;\n /** Inclusive of descendants; do not add ancestor and descendant snapshots. */\n readonly spentMicros: number | string; readonly reservedMicros: number; readonly calls: number; readonly heldCalls: number;\n}\nexport interface DurableBudgetOperation { readonly id: string; readonly maxCostMicros: number }\nexport interface DurableBudgetBundle { readonly id: string; readonly accountId: string; readonly operations: readonly DurableBudgetOperation[] }\nexport interface DurableBudgetReservation extends DurableBudgetOperation {\n readonly accountId: string; readonly bundleId: string;\n readonly status: 'held' | 'started' | 'unknown' | 'settled' | 'cancelled'; readonly actualMicros: number | null;\n}\nexport interface DurableBudgetSnapshot extends DurableBudgetKey {\n readonly format: 1; readonly mode: 'shared-ceiling-v1'; readonly owner: 'host-v1';\n readonly version: number; readonly eventSequence: number; readonly blocked: boolean;\n readonly accounts: readonly DurableBudgetAccount[]; readonly bundles: readonly DurableBudgetBundle[];\n readonly reservations: readonly DurableBudgetReservation[];\n}\nexport interface DurableBudgetCreate extends DurableBudgetKey, DurableBudgetLimits {}\nexport interface DurableBudgetFork extends DurableBudgetKey, DurableBudgetLimits { readonly parentId: string; readonly accountId: string }\nexport interface DurableBudgetReserveBundle extends DurableBudgetKey {\n readonly accountId: string; readonly bundleId: string; readonly operations: readonly DurableBudgetOperation[];\n}\nexport interface DurableBudgetTicket extends DurableBudgetKey { readonly accountId: string; readonly reservationId: string }\nexport interface DurableBudgetSettle extends DurableBudgetTicket { readonly actualMicros: number }\nexport interface DurableBudgetCloseSubtree extends DurableBudgetKey { readonly accountId: string }\nexport interface DurableBudgetEvents extends DurableBudgetKey { readonly after?: number }\nexport interface DurableBudgetCreateResult { readonly snapshot: DurableBudgetSnapshot; readonly created: boolean }\nexport interface DurableBudgetStartResult { readonly snapshot: DurableBudgetSnapshot; readonly status: 'started' | 'already_started' }\nexport interface DurableBudgetSettleResult { readonly snapshot: DurableBudgetSnapshot; readonly overrun: boolean }\n/** Optional financial ledger. Hosts authenticate access and supply truthful cost evidence. */\nexport interface DurableBudgetStore {\n initialize(): Promise<void>;\n create(command: DurableBudgetCreate): Promise<DurableBudgetCreateResult>;\n fork(command: DurableBudgetFork): Promise<DurableBudgetSnapshot>;\n reserveBundle(command: DurableBudgetReserveBundle): Promise<DurableBudgetSnapshot>;\n start(command: DurableBudgetTicket): Promise<DurableBudgetStartResult>;\n markUnknown(command: DurableBudgetTicket): Promise<DurableBudgetSnapshot>;\n settle(command: DurableBudgetSettle): Promise<DurableBudgetSettleResult>;\n cancelReservation(command: DurableBudgetTicket): Promise<DurableBudgetSnapshot>;\n closeSubtree(command: DurableBudgetCloseSubtree): Promise<DurableBudgetSnapshot>;\n inspect(command: DurableBudgetKey): Promise<DurableBudgetSnapshot | undefined>;\n events(command: DurableBudgetEvents): Promise<readonly StoredEvent[]>;\n}\nexport interface DurableBudgetAggregateStore extends AggregateStore { readonly durableBudgets: DurableBudgetStore }\nexport type DurableBudgetMethod = keyof DurableBudgetStore;\nexport type DurableBudgetMethodResult<M extends DurableBudgetMethod> = Awaited<ReturnType<DurableBudgetStore[M]>>;\n\nconst safe = BigInt(Number.MAX_SAFE_INTEGER);\nconst maximumSpent = safe * 512n;\nconst identifierPattern = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;\nconst encoder = new TextEncoder();\nconst methods = new Set<DurableBudgetMethod>(['initialize', 'create', 'fork', 'reserveBundle', 'start', 'markUnknown', 'settle', 'cancelReservation', 'closeSubtree', 'inspect', 'events']);\nfunction invalid(): never { throw new StorageError('INVALID_INPUT', 'Invalid bounded durable budget metadata.'); }\nfunction corrupt(): never { throw new StorageError('STORAGE_UNAVAILABLE', 'Durable budget metadata failed integrity validation.'); }\nfunction object(value: JsonValue | undefined): JsonObject { if (!value || typeof value !== 'object' || Array.isArray(value)) invalid(); return value; }\nfunction fields(value: JsonObject, names: readonly string[]): void {\n if (Object.keys(value).length !== names.length || names.some(name => !Object.hasOwn(value, name))) invalid();\n}\nfunction integer(value: unknown, minimum = 0, maximum = Number.MAX_SAFE_INTEGER): number {\n if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < minimum || value > maximum) invalid(); return value;\n}\nfunction id(value: unknown): string { if (typeof value !== 'string' || !identifierPattern.test(value)) invalid(); return value; }\nfunction identifier(value: unknown): string {\n // Unicode mode treats a valid surrogate pair as one supplementary code point;\n // only unpaired units match. Native SQL UTF-8 encoding must not alias keys.\n if (typeof value !== 'string' || !value.length || value.includes('\\0') || /[\\uD800-\\uDFFF]/u.test(value) || encoder.encode(value).length > 256) invalid(); return value;\n}\nfunction key(value: JsonObject): void {\n identifier(value['scope']); identifier(value['id']);\n if (typeof value['policyHash'] !== 'string' || !/^[a-f0-9]{64}$/.test(value['policyHash'])) invalid();\n}\nfunction limits(value: JsonObject): void { integer(value['maxCostMicros']); integer(value['maxCalls'], 1); }\nfunction operations(raw: JsonValue | undefined): readonly DurableBudgetOperation[] {\n if (!Array.isArray(raw) || raw.length < 1 || raw.length > 32) invalid();\n const seen = new Set<string>();\n for (const item of raw) { const value = object(item); fields(value, ['id', 'maxCostMicros']); const name = id(value['id']);\n if (seen.has(name)) invalid(); seen.add(name); integer(value['maxCostMicros']); }\n return raw as unknown as readonly DurableBudgetOperation[];\n}\nfunction capture(raw: unknown, bytes = 1_048_576): JsonObject {\n return object(jsonValue(raw, { maxBytes: bytes, maxNodes: 30_000, maxDepth: 24 }));\n}\nfunction immutable<T>(value: JsonValue): T { return freezeJson(value) as unknown as T; }\n\n/** Exact owned command snapshots must be produced before any asynchronous transport. */\nexport function durableBudgetCommand(method: DurableBudgetMethod, raw: unknown): JsonObject {\n try {\n if (!methods.has(method)) invalid(); const value = capture(raw, 32_768);\n if (method === 'initialize') { fields(value, []); return immutable(value); }\n key(value); const common = ['scope', 'id', 'policyHash'];\n switch (method) {\n case 'create': fields(value, [...common, 'maxCostMicros', 'maxCalls']); limits(value); break;\n case 'fork': fields(value, [...common, 'parentId', 'accountId', 'maxCostMicros', 'maxCalls']); id(value['parentId']); id(value['accountId']); limits(value); break;\n case 'reserveBundle': fields(value, [...common, 'accountId', 'bundleId', 'operations']); id(value['accountId']); id(value['bundleId']); operations(value['operations']); break;\n case 'start': case 'markUnknown': case 'cancelReservation':\n fields(value, [...common, 'accountId', 'reservationId']); id(value['accountId']); id(value['reservationId']); break;\n case 'settle': fields(value, [...common, 'accountId', 'reservationId', 'actualMicros']); id(value['accountId']); id(value['reservationId']); integer(value['actualMicros']); break;\n case 'closeSubtree': fields(value, [...common, 'accountId']); id(value['accountId']); break;\n case 'inspect': fields(value, common); break;\n case 'events': if (!Object.hasOwn(value, 'after')) value['after'] = 0; fields(value, [...common, 'after']); integer(value['after']); break;\n }\n return immutable(value);\n } catch { return invalid(); }\n}\n\ninterface Usage { spent: bigint; nominalSpent: bigint; reserved: bigint; calls: number; held: number }\nfunction spent(value: unknown): bigint {\n if (typeof value === 'number') return BigInt(integer(value));\n if (typeof value !== 'string' || !/^[1-9][0-9]{0,20}$/.test(value)) invalid();\n const amount = BigInt(value); if (amount <= safe || amount > maximumSpent) invalid(); return amount;\n}\nfunction sortedArray(value: JsonValue | undefined, maximum: number, minimum = 0): JsonObject[] {\n if (!Array.isArray(value) || value.length < minimum || value.length > maximum) invalid();\n let previous = ''; const result: JsonObject[] = [];\n for (const entry of value) { const item = object(entry); const name = id(item['id']); if (name <= previous) invalid(); previous = name; result.push(item); }\n return result;\n}\n\n/** Validate complete immutable evidence and independently rederive every inclusive account total. */\nexport function durableBudgetSnapshot(raw: unknown, context?: DurableBudgetKey): DurableBudgetSnapshot {\n try {\n const value = capture(raw);\n fields(value, ['format', 'mode', 'owner', 'scope', 'id', 'policyHash', 'version', 'eventSequence', 'blocked', 'accounts', 'bundles', 'reservations']); key(value);\n if (value['format'] !== 1 || value['mode'] !== 'shared-ceiling-v1' || value['owner'] !== 'host-v1' || typeof value['blocked'] !== 'boolean') invalid();\n integer(value['version'], 1, 2_048); if (value['eventSequence'] !== value['version']) invalid();\n if (context) { const expected = durableBudgetCommand('inspect', context); for (const name of ['scope', 'id', 'policyHash']) if (value[name] !== expected[name]) invalid(); }\n const accountRows = sortedArray(value['accounts'], 128, 1); const accounts = new Map<string, DurableBudgetAccount>();\n for (const account of accountRows) {\n fields(account, ['id', 'parentId', 'maxCostMicros', 'maxCalls', 'closed', 'spentMicros', 'reservedMicros', 'calls', 'heldCalls']); limits(account);\n if (typeof account['closed'] !== 'boolean') invalid();\n if (account['id'] === 'root') { if (account['parentId'] !== null) invalid(); } else id(account['parentId']);\n spent(account['spentMicros']); integer(account['reservedMicros']); integer(account['calls']); integer(account['heldCalls']);\n accounts.set(account['id'] as string, account as unknown as DurableBudgetAccount);\n }\n if (!accounts.has('root')) invalid();\n const paths = new Map<string, readonly DurableBudgetAccount[]>(); const usage = new Map<string, Usage>();\n for (const account of accounts.values()) {\n const path: DurableBudgetAccount[] = []; const seen = new Set<string>(); let current: DurableBudgetAccount | undefined = account;\n while (current) {\n if (seen.has(current.id) || path.length > 16) invalid(); seen.add(current.id); path.push(current);\n if (current.parentId === null) break;\n const parent = accounts.get(current.parentId); if (!parent || current.maxCostMicros > parent.maxCostMicros || current.maxCalls > parent.maxCalls) invalid(); current = parent;\n }\n if (path.at(-1)?.id !== 'root') invalid(); paths.set(account.id, path); usage.set(account.id, { spent: 0n, nominalSpent: 0n, reserved: 0n, calls: 0, held: 0 });\n }\n const bundleRows = sortedArray(value['bundles'], 128); const admitted = new Map<string, { bundleId: string; accountId: string; bound: number }>();\n for (const bundle of bundleRows) {\n fields(bundle, ['id', 'accountId', 'operations']); const accountId = id(bundle['accountId']); if (!accounts.has(accountId)) invalid();\n const items = operations(bundle['operations']); const bound = items.reduce((sum, operation) => sum + BigInt(operation.maxCostMicros), 0n);\n // Released tickets still attest an atomic historical admission; cancellation\n // must not hide a bundle that could never fit its immutable ancestor ceilings.\n for (const ancestor of paths.get(accountId)!) if (bound > BigInt(ancestor.maxCostMicros) || items.length > ancestor.maxCalls) invalid();\n for (const operation of items) { if (admitted.has(operation.id)) invalid(); admitted.set(operation.id, { bundleId: bundle['id'] as string, accountId, bound: operation.maxCostMicros }); }\n }\n const reservations = sortedArray(value['reservations'], 512); if (reservations.length !== admitted.size) invalid();\n let blocked = false;\n let minimumVersion = accounts.size + bundleRows.length + accountRows.filter(account => account['closed'] === true).length;\n let maximumVersion = minimumVersion;\n for (const reservation of reservations) {\n fields(reservation, ['id', 'accountId', 'bundleId', 'maxCostMicros', 'status', 'actualMicros']);\n const entry = admitted.get(reservation['id'] as string);\n if (!entry || reservation['accountId'] !== entry.accountId || reservation['bundleId'] !== entry.bundleId || reservation['maxCostMicros'] !== entry.bound) invalid();\n const status = reservation['status']; if (!['held', 'started', 'unknown', 'settled', 'cancelled'].includes(status as string)) invalid();\n const actual = status === 'settled' ? integer(reservation['actualMicros']) : 0;\n if (status !== 'settled' && reservation['actualMicros'] !== null) invalid();\n const overrun = status === 'settled' && actual > entry.bound; blocked ||= overrun;\n const path = paths.get(entry.accountId)!;\n // Unknown-before-settlement and individual-versus-subtree cancellation are\n // intentionally not replayed here. Their finite ranges still reject forged\n // version inflation that would consume required terminal evidence headroom.\n const minimumTransitions = status === 'held' ? 0 : status === 'started' ? 1 : status === 'unknown' || status === 'settled' ? 2\n : path.some(ancestor => ancestor.closed) ? 0 : 1;\n const maximumTransitions = status === 'settled' ? 3 : status === 'cancelled' ? 1 : minimumTransitions;\n minimumVersion += minimumTransitions; maximumVersion += maximumTransitions;\n for (const ancestor of path) {\n if (status === 'held' && ancestor.closed) invalid(); const total = usage.get(ancestor.id)!;\n if (status === 'held') total.held++; if (status === 'started' || status === 'unknown' || status === 'settled') total.calls++;\n if (status === 'held' || status === 'started' || status === 'unknown') total.reserved += BigInt(entry.bound);\n if (status === 'settled') {\n total.spent += BigInt(actual);\n // Excess actual cost is truthful evidence, not a reason to bypass the\n // original admission ceilings. Retain both exact and nominal spending.\n total.nominalSpent += BigInt(Math.min(actual, entry.bound));\n }\n }\n }\n if (value['blocked'] !== blocked) invalid();\n if ((value['version'] as number) < minimumVersion || (value['version'] as number) > maximumVersion) invalid();\n for (const account of accounts.values()) {\n const total = usage.get(account.id)!;\n if (spent(account.spentMicros) !== total.spent || BigInt(account.reservedMicros) !== total.reserved || account.calls !== total.calls || account.heldCalls !== total.held\n || total.calls + total.held > account.maxCalls || total.reserved > BigInt(account.maxCostMicros)\n || total.nominalSpent + total.reserved > BigInt(account.maxCostMicros)) invalid();\n }\n return immutable(value);\n } catch { return corrupt(); }\n}\n\nfunction eventPage(raw: unknown, after: number): readonly StoredEvent[] {\n const value = jsonValue(raw, { maxBytes: 1_048_576, maxNodes: 30_000, maxDepth: 8 });\n if (!Array.isArray(value) || value.length > 1_000) invalid(); let sequence = after;\n for (const entry of value) {\n const event = object(entry); fields(event, ['sequence', 'type', 'data', 'createdAt']);\n const next = integer(event['sequence'], 1, 2_048); if (next !== sequence + 1) invalid(); sequence = next;\n const date = event['createdAt']; if (typeof date !== 'string' || !/^\\d{4}-\\d\\d-\\d\\dT\\d\\d:\\d\\d:\\d\\d\\.\\d{3}Z$/.test(date) || new Date(date).toISOString() !== date) invalid();\n const data = object(event['data']);\n switch (event['type']) {\n case 'budget.created': fields(data, []); if (next !== 1) invalid(); break;\n case 'budget.forked': fields(data, ['accountId', 'parentId']); id(data['accountId']); id(data['parentId']); break;\n case 'budget.reserved': fields(data, ['accountId', 'bundleId']); id(data['accountId']); id(data['bundleId']); break;\n case 'budget.started': case 'budget.unknown': case 'budget.reservation_cancelled': fields(data, ['accountId', 'reservationId']); id(data['accountId']); id(data['reservationId']); break;\n case 'budget.settled': fields(data, ['accountId', 'reservationId', 'overrun']); id(data['accountId']); id(data['reservationId']); if (typeof data['overrun'] !== 'boolean') invalid(); break;\n case 'budget.subtree_closed': fields(data, ['accountId', 'cancelledReservations']); id(data['accountId']); integer(data['cancelledReservations'], 0, 512); break;\n default: invalid();\n }\n if (next === 1 && event['type'] !== 'budget.created') invalid();\n }\n return immutable(value);\n}\n\n/** Validate replies independently of adapter assertions, including command-specific ownership and transitions. */\nexport function durableBudgetResult<M extends DurableBudgetMethod>(method: M, raw: unknown, context: unknown): DurableBudgetMethodResult<M> {\n const command = durableBudgetCommand(method, context);\n try {\n if (method === 'initialize') { if (raw !== undefined) invalid(); return undefined as DurableBudgetMethodResult<M>; }\n if (method === 'events') return eventPage(raw, command['after'] as number) as DurableBudgetMethodResult<M>;\n if (method === 'inspect' && raw === undefined) return undefined as DurableBudgetMethodResult<M>;\n const envelope = ['create', 'start', 'settle'].includes(method) ? capture(raw) : undefined;\n const state = durableBudgetSnapshot(envelope ? envelope['snapshot'] : raw, { scope: command['scope'] as string, id: command['id'] as string, policyHash: command['policyHash'] as string });\n const account = state.accounts.find(item => item.id === command['accountId']);\n const ticket = state.reservations.find(item => item.id === command['reservationId']);\n if (['fork', 'reserveBundle', 'start', 'markUnknown', 'settle', 'cancelReservation', 'closeSubtree'].includes(method) && !account) invalid();\n if (['start', 'markUnknown', 'settle', 'cancelReservation'].includes(method) && (!ticket || ticket.accountId !== command['accountId'])) invalid();\n if (method === 'create') {\n fields(envelope!, ['snapshot', 'created']); if (typeof envelope!['created'] !== 'boolean') invalid(); const root = state.accounts.find(item => item.id === 'root')!;\n if (root.maxCostMicros !== command['maxCostMicros'] || root.maxCalls !== command['maxCalls']) invalid();\n if (envelope!['created'] === true && (state.version !== 1 || state.accounts.length !== 1 || state.bundles.length || root.closed || state.blocked)) invalid();\n } else if (method === 'fork') {\n if (account!.parentId !== command['parentId'] || account!.maxCostMicros !== command['maxCostMicros'] || account!.maxCalls !== command['maxCalls']) invalid();\n } else if (method === 'reserveBundle') {\n const bundle = state.bundles.find(item => item.id === command['bundleId']); const requested = command['operations'] as unknown as readonly DurableBudgetOperation[];\n if (!bundle || bundle.accountId !== command['accountId'] || bundle.operations.length !== requested.length\n || bundle.operations.some((item, index) => item.id !== requested[index]!.id || item.maxCostMicros !== requested[index]!.maxCostMicros)) invalid();\n } else if (method === 'start') {\n fields(envelope!, ['snapshot', 'status']); const status = envelope!['status'];\n if (!['started', 'already_started'].includes(status as string) || !['started', 'unknown', 'settled'].includes(ticket!.status)\n || (status === 'started' && ticket!.status !== 'started')) invalid();\n if (status === 'started') {\n if (state.blocked) invalid(); let current = account!;\n for (;;) { if (current.closed) invalid(); if (current.parentId === null) break; current = state.accounts.find(item => item.id === current.parentId)!; }\n }\n } else if (method === 'markUnknown') { if (!['unknown', 'settled'].includes(ticket!.status)) invalid(); }\n else if (method === 'settle') {\n fields(envelope!, ['snapshot', 'overrun']); if (ticket!.status !== 'settled' || ticket!.actualMicros !== command['actualMicros']\n || envelope!['overrun'] !== (ticket!.actualMicros! > ticket!.maxCostMicros)) invalid();\n } else if (method === 'cancelReservation') { if (ticket!.status !== 'cancelled') invalid(); }\n else if (method === 'closeSubtree') { if (!account!.closed) invalid(); }\n return (envelope ? immutable({ ...envelope, snapshot: state as unknown as JsonValue }) : state) as DurableBudgetMethodResult<M>;\n } catch { return corrupt(); }\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type JsonObject } from '../../core/dist/index.js';
|
|
2
|
+
import { type StoredEvent } from './contracts.js';
|
|
3
|
+
import type { ScheduledWorkflowAggregateStore } from './scheduled-workflow-contracts.js';
|
|
4
|
+
/** Immutable scheduled-run identity, not an authorization capability or backend identity proof. */
|
|
5
|
+
export interface ExecutionRef {
|
|
6
|
+
readonly kind: 'scheduled-workflow';
|
|
7
|
+
readonly runId: string;
|
|
8
|
+
readonly definitionHash: string;
|
|
9
|
+
readonly policyHash: string;
|
|
10
|
+
}
|
|
11
|
+
/** A terminal observation contains no workflow payload, error, receipt or provider data. */
|
|
12
|
+
export interface ExecutionCompletion {
|
|
13
|
+
readonly reference: ExecutionRef;
|
|
14
|
+
readonly outcome: 'succeeded' | 'failed' | 'blocked' | 'cancelled' | 'outcome_unknown';
|
|
15
|
+
readonly sourceVersion: number;
|
|
16
|
+
readonly sourceEventSequence: number;
|
|
17
|
+
}
|
|
18
|
+
/** A finite all-target join. Initial states have version 1; later resolution/cancellation has 2. */
|
|
19
|
+
export interface ExecutionWaitSnapshot {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly version: number;
|
|
22
|
+
readonly definitionHash: string;
|
|
23
|
+
readonly status: 'waiting' | 'resolved' | 'cancelled';
|
|
24
|
+
readonly targets: readonly ExecutionRef[];
|
|
25
|
+
readonly observations: readonly ExecutionCompletion[];
|
|
26
|
+
}
|
|
27
|
+
/** Scope is the existing mayura:scope:v1 digest, not a caller-supplied principal record. */
|
|
28
|
+
export interface ExecutionWaitStreamKey {
|
|
29
|
+
readonly scope: string;
|
|
30
|
+
readonly streamId: string;
|
|
31
|
+
readonly policyHash: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ExecutionWaitKey extends ExecutionWaitStreamKey {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Finite trusted-host commands. There are no replacement-state updates, callbacks, clocks,
|
|
38
|
+
* dispatches or per-wait pending promises. Cancellation affects only the wait, never its targets.
|
|
39
|
+
*/
|
|
40
|
+
export interface ExecutionWaitStore {
|
|
41
|
+
initialize(): Promise<void>;
|
|
42
|
+
open(command: ExecutionWaitStreamKey): Promise<void>;
|
|
43
|
+
materialize(command: {
|
|
44
|
+
readonly scope: string;
|
|
45
|
+
readonly reference: ExecutionRef;
|
|
46
|
+
}): Promise<ExecutionCompletion | undefined>;
|
|
47
|
+
register(command: ExecutionWaitKey & {
|
|
48
|
+
readonly targets: readonly ExecutionRef[];
|
|
49
|
+
}): Promise<ExecutionWaitSnapshot>;
|
|
50
|
+
inspect(command: ExecutionWaitKey): Promise<ExecutionWaitSnapshot | undefined>;
|
|
51
|
+
cancel(command: ExecutionWaitKey): Promise<ExecutionWaitSnapshot>;
|
|
52
|
+
drainReady(command: ExecutionWaitStreamKey & {
|
|
53
|
+
readonly limit: number;
|
|
54
|
+
}): Promise<readonly ExecutionWaitSnapshot[]>;
|
|
55
|
+
events(command: ExecutionWaitStreamKey & {
|
|
56
|
+
readonly after: number;
|
|
57
|
+
}): Promise<readonly StoredEvent[]>;
|
|
58
|
+
}
|
|
59
|
+
/** Explicit opt-in: existing scheduled/aggregate-only custom adapters are not widened. */
|
|
60
|
+
export interface ExecutionWaitAggregateStore extends ScheduledWorkflowAggregateStore {
|
|
61
|
+
readonly executionWaits: ExecutionWaitStore;
|
|
62
|
+
}
|
|
63
|
+
export type ExecutionWaitMethod = keyof ExecutionWaitStore;
|
|
64
|
+
/** Validate and own an exact bounded, deeply frozen reference. */
|
|
65
|
+
export declare function executionRef(value: unknown): ExecutionRef;
|
|
66
|
+
/** Validate an immutable terminal observation without inventing source history or success. */
|
|
67
|
+
export declare function executionCompletion(value: unknown): ExecutionCompletion;
|
|
68
|
+
/** Validate structural continuity; the configured host must separately verify the definition digest. */
|
|
69
|
+
export declare function executionWaitSnapshot(value: unknown): ExecutionWaitSnapshot;
|
|
70
|
+
/** Snapshot/validate a whole command before a driver queue or asynchronous operation sees it. */
|
|
71
|
+
export declare function executionWaitCommand(method: ExecutionWaitMethod, value: unknown): JsonObject;
|
|
72
|
+
/** Canonical domain-separated hash input; drivers/hosts select their own SHA-256 implementation. */
|
|
73
|
+
export declare function executionWaitHashMaterial(key: ExecutionWaitStreamKey, id: string, targets: readonly ExecutionRef[]): string;
|
|
74
|
+
//# sourceMappingURL=execution-wait-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-wait-contracts.d.ts","sourceRoot":"","sources":["../src/execution-wait-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,UAAU,EAAkB,MAAM,cAAc,CAAC;AACtF,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAGzF,mGAAmG;AACnG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC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