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,200 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { describe, it } from 'node:test';
|
|
6
|
+
import { createClient } from 'mayura/client';
|
|
7
|
+
import { newToken, tokenDigest } from '../src/auth.js';
|
|
8
|
+
import { loadConfig } from '../src/config.js';
|
|
9
|
+
import { mcpHttpClient } from '../src/mcp.js';
|
|
10
|
+
import { startServer } from '../src/server.js';
|
|
11
|
+
import { openServices } from '../src/services.js';
|
|
12
|
+
import { sendDelivery, signDelivery, webhookHeaders } from '../src/signing.js';
|
|
13
|
+
import { startTrackerMcpServer } from '../src/tracker/mcp-server.js';
|
|
14
|
+
import { sampleTickets, ticketCreatedEvent, type SampleName } from '../src/tracker/samples.js';
|
|
15
|
+
import { memoryTracker } from '../src/tracker/tickets.js';
|
|
16
|
+
import type { TriageOutput } from '../src/triage.js';
|
|
17
|
+
import { createTicketWorker } from '../src/worker.js';
|
|
18
|
+
|
|
19
|
+
// Everything runs offline over real HTTP: the local tracker's MCP server, the Mayura server, the webhook ingress, the
|
|
20
|
+
// rule-based triage model and SQLite in a temporary directory.
|
|
21
|
+
async function harness(options: { readonly revoke?: readonly string[] } = {}) {
|
|
22
|
+
const directory = await mkdtemp(join(tmpdir(), 'tickets-test-'));
|
|
23
|
+
const operatorToken = newToken(); const secret = newToken(); const trackerToken = newToken();
|
|
24
|
+
const tickets = memoryTracker(Object.values(sampleTickets));
|
|
25
|
+
const tracker = await startTrackerMcpServer({ tracker: tickets, port: 0, token: trackerToken });
|
|
26
|
+
const config = await loadConfig({ MAYURA_ENV: 'development', PORT: '0', WEBHOOK_PORT: '0', MAYURA_SQLITE_PATH: join(directory, 'tickets.sqlite'),
|
|
27
|
+
MAYURA_OPERATOR_TOKEN_SHA256: tokenDigest(operatorToken), WEBHOOK_SECRET: secret, TRACKER_MCP_URL: tracker.url, TRACKER_MCP_TOKEN: trackerToken });
|
|
28
|
+
const services = await openServices(config, options.revoke ? { revoke: options.revoke } : {});
|
|
29
|
+
const server = await startServer(config, services);
|
|
30
|
+
// Tests drive the worker one cycle at a time instead of starting its timer.
|
|
31
|
+
const { host } = createTicketWorker(config, services);
|
|
32
|
+
const operator = createClient({ baseUrl: server.origin, token: () => operatorToken });
|
|
33
|
+
const deliver = (name: SampleName, overrides: { readonly deliveryId?: string; readonly timestampMs?: number; readonly secret?: string; readonly event?: unknown } = {}) =>
|
|
34
|
+
sendDelivery(server.webhookUrl, overrides.secret ?? secret, { deliveryId: overrides.deliveryId ?? `delivery-${name}`,
|
|
35
|
+
event: overrides.event ?? ticketCreatedEvent(name), ...(overrides.timestampMs === undefined ? {} : { timestampMs: overrides.timestampMs }) });
|
|
36
|
+
/** Run worker cycles until the run leaves `running`. */
|
|
37
|
+
const settle = async (runId: string) => {
|
|
38
|
+
for (let cycle = 0; cycle < 8; cycle++) { await host.runOnce(); const view = await operator.workflow(runId); if (view.status !== 'running') return view; }
|
|
39
|
+
throw new Error('The run did not settle.');
|
|
40
|
+
};
|
|
41
|
+
return { config, services, host, operator, tickets, tracker, trackerToken, deliver, settle, server,
|
|
42
|
+
close: async () => { await host.close(); await server.close(); await services.close(); await tracker.close(); await rm(directory, { recursive: true, force: true }); } };
|
|
43
|
+
}
|
|
44
|
+
const runIdOf = (reply: { readonly body: unknown }): string => (reply.body as { readonly runId: string }).runId;
|
|
45
|
+
|
|
46
|
+
describe('ticket automation', () => {
|
|
47
|
+
it('turns one signed delivery into one durable run in which the agent labels and comments through MCP', async () => {
|
|
48
|
+
const h = await harness();
|
|
49
|
+
try {
|
|
50
|
+
const accepted = await h.deliver('billing');
|
|
51
|
+
assert.equal(accepted.status, 202);
|
|
52
|
+
const runId = runIdOf(accepted);
|
|
53
|
+
const done = await h.settle(runId);
|
|
54
|
+
assert.equal(done.definitionId, 'tickets.intake'); assert.equal(done.status, 'succeeded');
|
|
55
|
+
const output = (await h.services.submissions.inspect(runId)).output as TriageOutput;
|
|
56
|
+
assert.deepEqual(output, { ticketId: 'T-1002', priority: 'high', labels: ['triaged', 'priority:high', 'billing'],
|
|
57
|
+
summary: 'high priority (billing): Charged twice for one invoice', escalationRunId: null });
|
|
58
|
+
// The tracker holds exactly what the agent did through the MCP tools, and nothing it was not allowed to do.
|
|
59
|
+
const ticket = await h.tickets.get('T-1002');
|
|
60
|
+
assert.deepEqual(ticket?.labels, ['triaged', 'priority:high', 'billing']);
|
|
61
|
+
assert.equal(ticket?.comments.length, 1); assert.match(ticket?.comments[0]?.body ?? '', /^\[automated triage\]/u);
|
|
62
|
+
assert.equal(ticket?.assignee, null);
|
|
63
|
+
|
|
64
|
+
// The tracker retries the same delivery (fresh timestamp and signature, same id and body): same run, nothing new.
|
|
65
|
+
const retried = await h.deliver('billing');
|
|
66
|
+
assert.equal(retried.status, 202); assert.equal(runIdOf(retried), runId);
|
|
67
|
+
await h.host.runOnce();
|
|
68
|
+
assert.deepEqual(h.tickets.operations(), [{ operation: 'label', ticketId: 'T-1002' }, { operation: 'comment', ticketId: 'T-1002' }]);
|
|
69
|
+
// The same delivery id with a different body is a conflict, not a new delivery.
|
|
70
|
+
assert.deepEqual(await h.deliver('billing', { event: ticketCreatedEvent('docs') }), { status: 409, body: { error: 'conflict' } });
|
|
71
|
+
} finally { await h.close(); }
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('refuses forged, stale, unsigned and malformed deliveries before anything starts', async () => {
|
|
75
|
+
const h = await harness();
|
|
76
|
+
try {
|
|
77
|
+
const unauthorized = { status: 401, body: { error: 'unauthorized' } };
|
|
78
|
+
assert.deepEqual(await h.deliver('outage', { secret: newToken() }), unauthorized);
|
|
79
|
+
assert.deepEqual(await h.deliver('outage', { timestampMs: Date.now() - 10 * 60_000 }), unauthorized);
|
|
80
|
+
assert.deepEqual(await h.deliver('outage', { timestampMs: Date.now() + 10 * 60_000 }), unauthorized);
|
|
81
|
+
const body = JSON.stringify(ticketCreatedEvent('outage'));
|
|
82
|
+
const post = (headers: Record<string, string>, payload: string = body, path = '/webhooks/tickets', method = 'POST') =>
|
|
83
|
+
fetch(new URL(path, h.server.webhookUrl), { method, headers, ...(method === 'POST' ? { body: payload } : {}) });
|
|
84
|
+
const timestampMs = Date.now(); const signed = (deliveryId: string, payload: string = body) => ({ 'content-type': 'application/json',
|
|
85
|
+
[webhookHeaders.delivery]: deliveryId, [webhookHeaders.timestamp]: String(timestampMs), [webhookHeaders.signature]: signDelivery(h.config.webhook.secret, { deliveryId, timestampMs, body: payload }) });
|
|
86
|
+
assert.equal((await post({ 'content-type': 'application/json', [webhookHeaders.delivery]: 'd-1', [webhookHeaders.timestamp]: String(timestampMs) })).status, 401);
|
|
87
|
+
// A valid signature over a different body does not verify the body that was sent.
|
|
88
|
+
assert.equal((await post(signed('d-2', body.replace('502', '503')))).status, 401);
|
|
89
|
+
// Signed, but not a payload this trigger accepts.
|
|
90
|
+
const wrongEvent = JSON.stringify({ event: 'ticket.deleted', ticket: sampleTickets.outage });
|
|
91
|
+
assert.deepEqual([(await post(signed('d-3', wrongEvent), wrongEvent)).status], [400]);
|
|
92
|
+
assert.equal((await post({ ...signed('d-4'), 'content-type': 'text/plain' })).status, 415);
|
|
93
|
+
assert.equal((await post(signed('d-5', 'x'.repeat(70_000)), 'x'.repeat(70_000))).status, 413);
|
|
94
|
+
assert.equal((await post(signed('d-6'), body, '/webhooks/other')).status, 404);
|
|
95
|
+
assert.equal((await post({}, body, '/webhooks/tickets', 'GET')).status, 405);
|
|
96
|
+
|
|
97
|
+
assert.deepEqual((await h.operator.workflows()).items, []);
|
|
98
|
+
assert.deepEqual(h.tickets.operations(), []);
|
|
99
|
+
// A refused forgery does not use up the delivery id: the genuine delivery with that id is still accepted.
|
|
100
|
+
assert.deepEqual(await h.deliver('outage', { deliveryId: 'd-1', secret: newToken() }), unauthorized);
|
|
101
|
+
assert.equal((await h.deliver('outage', { deliveryId: 'd-1' })).status, 202);
|
|
102
|
+
} finally { await h.close(); }
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('assigns an urgent ticket to on-call only after an operator approves the exact MCP call', async () => {
|
|
106
|
+
const h = await harness();
|
|
107
|
+
try {
|
|
108
|
+
const runId = runIdOf(await h.deliver('outage'));
|
|
109
|
+
assert.equal((await h.settle(runId)).status, 'succeeded');
|
|
110
|
+
const output = (await h.services.submissions.inspect(runId)).output as TriageOutput;
|
|
111
|
+
assert.equal(output.priority, 'urgent'); assert.ok(output.escalationRunId);
|
|
112
|
+
|
|
113
|
+
const waiting = await h.settle(output.escalationRunId);
|
|
114
|
+
assert.equal(waiting.definitionId, 'tickets.escalation'); assert.equal(waiting.status, 'waiting');
|
|
115
|
+
const assign = waiting.steps.find(step => step.id === 'assign');
|
|
116
|
+
assert.equal(assign?.status, 'waiting');
|
|
117
|
+
// The operator sees the exact tool call, with the assignee from configuration rather than from the model.
|
|
118
|
+
assert.equal(assign?.approval?.subject?.toolId, 'tickets.assign');
|
|
119
|
+
assert.deepEqual(assign?.approval?.subject?.input, { ticketId: 'T-1001', assignee: 'oncall' });
|
|
120
|
+
await h.host.runOnce();
|
|
121
|
+
assert.equal((await h.tickets.get('T-1001'))?.assignee, null);
|
|
122
|
+
|
|
123
|
+
await h.operator.approveWorkflow(output.escalationRunId, { revision: waiting.revision, nodeId: 'assign', approvalDigest: assign!.approval!.digest },
|
|
124
|
+
{ commandId: 'approve-T-1001' });
|
|
125
|
+
const done = await h.settle(output.escalationRunId);
|
|
126
|
+
assert.equal(done.status, 'succeeded');
|
|
127
|
+
assert.deepEqual(done.steps.map(step => [step.id, step.status]), [['assign', 'succeeded'], ['announce', 'succeeded']]);
|
|
128
|
+
const ticket = await h.tickets.get('T-1001');
|
|
129
|
+
assert.equal(ticket?.assignee, 'oncall');
|
|
130
|
+
assert.deepEqual(ticket?.labels, ['triaged', 'priority:urgent', 'bug']);
|
|
131
|
+
assert.equal(ticket?.comments.length, 2);
|
|
132
|
+
} finally { await h.close(); }
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('refuses a tool whose capability is not granted before it reaches the tracker', async () => {
|
|
136
|
+
// Without `tickets:assign`, the escalation's assign step is blocked outright: no approval is requested, no call is made.
|
|
137
|
+
const withoutAssign = await harness({ revoke: ['tickets:assign'] });
|
|
138
|
+
try {
|
|
139
|
+
const runId = runIdOf(await withoutAssign.deliver('outage'));
|
|
140
|
+
await withoutAssign.settle(runId);
|
|
141
|
+
const { escalationRunId } = (await withoutAssign.services.submissions.inspect(runId)).output as TriageOutput;
|
|
142
|
+
const blocked = await withoutAssign.settle(escalationRunId!);
|
|
143
|
+
assert.equal(blocked.status, 'blocked');
|
|
144
|
+
assert.deepEqual(blocked.steps.map(step => [step.id, step.status]), [['assign', 'blocked'], ['announce', 'skipped']]);
|
|
145
|
+
assert.equal(blocked.steps[0]?.approval, undefined);
|
|
146
|
+
assert.deepEqual(withoutAssign.tickets.operations().filter(entry => entry.operation === 'assign'), []);
|
|
147
|
+
} finally { await withoutAssign.close(); }
|
|
148
|
+
|
|
149
|
+
// Without `tickets:write`, the agent's first label call is refused before any MCP request. The triage step is a
|
|
150
|
+
// write, so the run is conservatively left for an operator to reconcile; the tracker shows nothing happened.
|
|
151
|
+
const withoutWrite = await harness({ revoke: ['tickets:write'] });
|
|
152
|
+
try {
|
|
153
|
+
const runId = runIdOf(await withoutWrite.deliver('billing'));
|
|
154
|
+
const stopped = await withoutWrite.settle(runId);
|
|
155
|
+
assert.equal(stopped.status, 'outcome_unknown');
|
|
156
|
+
assert.deepEqual(withoutWrite.tickets.operations(), []);
|
|
157
|
+
} finally { await withoutWrite.close(); }
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it('keeps callers to their own capabilities', async () => {
|
|
161
|
+
const h = await harness();
|
|
162
|
+
try {
|
|
163
|
+
assert.deepEqual((await h.operator.agents()).map(agent => agent.id), ['tickets.triage']);
|
|
164
|
+
// Runs start only from verified deliveries: not even an operator can start the agent over the API.
|
|
165
|
+
await assert.rejects(h.operator.submit('tickets.triage', sampleTickets.billing, { idempotencyKey: 'direct-1' }), { status: 403 });
|
|
166
|
+
const stranger = createClient({ baseUrl: h.server.origin, token: () => newToken() });
|
|
167
|
+
await assert.rejects(stranger.agents(), { status: 401 });
|
|
168
|
+
await assert.rejects(stranger.workflows(), { status: 401 });
|
|
169
|
+
// The tracker's MCP endpoint wants its own token.
|
|
170
|
+
assert.equal((await fetch(h.tracker.url, { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' })).status, 401);
|
|
171
|
+
await assert.rejects(mcpHttpClient({ url: h.tracker.url, token: 'wrong' }).listTools());
|
|
172
|
+
const client = mcpHttpClient({ url: h.tracker.url, token: h.trackerToken });
|
|
173
|
+
assert.deepEqual((await client.listTools()).map(tool => tool.name), ['label_ticket', 'comment_on_ticket', 'assign_ticket']);
|
|
174
|
+
await client.close();
|
|
175
|
+
} finally { await h.close(); }
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
describe('configuration', () => {
|
|
180
|
+
it('runs offline by default and requires an origin, operator tokens, a webhook secret and a tracker in production', async () => {
|
|
181
|
+
const config = await loadConfig({});
|
|
182
|
+
assert.equal(config.model.provider, 'offline'); assert.equal(config.storage.kind, 'sqlite');
|
|
183
|
+
// Development without WEBHOOK_SECRET gets a throwaway random secret, so unsigned setups refuse every delivery.
|
|
184
|
+
assert.equal(config.webhook.secretGenerated, true); assert.match(config.webhook.secret, /^[a-f0-9]{64}$/u);
|
|
185
|
+
assert.notEqual((await loadConfig({})).webhook.secret, config.webhook.secret);
|
|
186
|
+
assert.equal(config.webhook.bind, '127.0.0.1');
|
|
187
|
+
const production = { MAYURA_ENV: 'production', MAYURA_PUBLIC_ORIGIN: 'https://tickets.example.com', MAYURA_OPERATOR_TOKEN_SHA256: tokenDigest(newToken()),
|
|
188
|
+
WEBHOOK_SECRET: newToken(), TRACKER_MCP_URL: 'https://tracker.example.com/mcp' };
|
|
189
|
+
assert.equal((await loadConfig(production)).webhook.secretGenerated, false);
|
|
190
|
+
await assert.rejects(loadConfig({ ...production, MAYURA_PUBLIC_ORIGIN: undefined }), /MAYURA_PUBLIC_ORIGIN/u);
|
|
191
|
+
await assert.rejects(loadConfig({ ...production, MAYURA_OPERATOR_TOKEN_SHA256: undefined }), /MAYURA_OPERATOR_TOKEN_SHA256/u);
|
|
192
|
+
await assert.rejects(loadConfig({ ...production, WEBHOOK_SECRET: undefined }), /WEBHOOK_SECRET/u);
|
|
193
|
+
await assert.rejects(loadConfig({ ...production, TRACKER_MCP_URL: undefined }), /TRACKER_MCP_URL/u);
|
|
194
|
+
// Values that fail the schema are refused without echoing them (the message does not name the variable either).
|
|
195
|
+
await assert.rejects(loadConfig({ WEBHOOK_SECRET: 'too-short' }), { code: 'INVALID_INPUT' });
|
|
196
|
+
await assert.rejects(loadConfig({ TRACKER_MCP_URL: 'ftp://tracker.example.com' }), { code: 'INVALID_INPUT' });
|
|
197
|
+
await assert.rejects(loadConfig({ MAYURA_MODEL_PROVIDER: 'openai' }), /OPENAI_API_KEY/u);
|
|
198
|
+
assert.equal((await loadConfig({ DATABASE_URL: 'postgres://tickets@db/tickets' })).storage.kind, 'postgres');
|
|
199
|
+
});
|
|
200
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"noUnusedLocals": true,
|
|
11
|
+
"noUnusedParameters": true,
|
|
12
|
+
"verbatimModuleSyntax": true,
|
|
13
|
+
"skipLibCheck": false,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"rootDir": ".",
|
|
16
|
+
"outDir": "dist",
|
|
17
|
+
"types": ["node"]
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts", "test/**/*.ts"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Server and worker image. Both run the same build; compose.yaml chooses the command.
|
|
2
|
+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5 AS build
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
COPY package.json package-lock.json* ./
|
|
5
|
+
RUN npm install --no-audit --no-fund
|
|
6
|
+
COPY tsconfig.json ./
|
|
7
|
+
COPY src ./src
|
|
8
|
+
COPY test ./test
|
|
9
|
+
RUN npx tsc -p tsconfig.json && npm prune --omit=dev
|
|
10
|
+
|
|
11
|
+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5
|
|
12
|
+
WORKDIR /app
|
|
13
|
+
COPY --from=build --chown=65532:65532 /app/package.json ./
|
|
14
|
+
COPY --from=build --chown=65532:65532 /app/node_modules ./node_modules
|
|
15
|
+
COPY --from=build --chown=65532:65532 /app/dist ./dist
|
|
16
|
+
# Report artifacts: mount shared storage here (compose.yaml uses a named volume shared by server and worker).
|
|
17
|
+
RUN mkdir -p /data/artifacts && chown 65532:65532 /data/artifacts
|
|
18
|
+
USER 65532:65532
|
|
19
|
+
ENV NODE_ENV=production MAYURA_ENV=production RESEARCH_ARTIFACTS_DIR=/data/artifacts
|
|
20
|
+
EXPOSE 8080 9090
|
|
21
|
+
ENTRYPOINT ["node", "node_modules/mayura/lib/cli/dist/bin.js"]
|
|
22
|
+
CMD ["serve", "--app", "dist/src/app.js"]
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Research team on Mayura
|
|
2
|
+
|
|
3
|
+
A complete, production-shaped starter for multi-agent research: a **planner** splits a question into sub-questions,
|
|
4
|
+
**researchers** answer them in parallel from a **source library**, and a **writer** produces a cited report. The whole
|
|
5
|
+
thing is one **durable workflow** run by a **worker**, under **one shared cost budget**, and the report is stored as a
|
|
6
|
+
**content-addressed artifact**. Optional **OpenTelemetry** traces carry timing metadata only, never content.
|
|
7
|
+
|
|
8
|
+
It runs offline out of the box: rule-based stand-in models, SQLite, a bundled six-document library and local artifact
|
|
9
|
+
files. One environment switch uses OpenAI, Anthropic or an OpenAI-compatible provider, another uses PostgreSQL, a third turns on tracing.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
your app ──desk token──▶ server ──▶ research.desk ──▶ research.start ──▶ durable run (research.run v1)
|
|
13
|
+
│ │
|
|
14
|
+
│ worker: plan ─▶ research.1 ┐
|
|
15
|
+
operator ──token──▶ console / operator API: ─▶ research.2 ├─▶ research ─▶ write ─▶ store
|
|
16
|
+
watch, pause, cancel, ─▶ research.3 │ (join) (artifact)
|
|
17
|
+
hold the fleet ─▶ research.4 ┘
|
|
18
|
+
research.desk ──▶ research.report ──▶ run status, or the report read back from the artifact store
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`npm run dev` builds, starts the server and a worker in one process on `.data/research-team.sqlite`, asks the desk
|
|
29
|
+
one demo question, waits for the report and prints the console URL, two tokens and the finished run. Open the
|
|
30
|
+
console, paste the **operator** token and open **Workflows**: the run shows `plan`, the four research slots (three
|
|
31
|
+
used; the fourth skipped because the plan did not need it), the `research` join, `write` and `store`.
|
|
32
|
+
|
|
33
|
+
`npm run dev` runs `mayura dev`: it loads `.env` if you have one, and rebuilds and restarts when you save a file. The tokens it prints are kept in `.data/dev-secrets.json`, so they stay the same across restarts.
|
|
34
|
+
|
|
35
|
+
Ask your own question as your application:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { createClient } from 'mayura/client';
|
|
39
|
+
import { deskOutput } from './src/desk.js'; // or your own copy of the output schema
|
|
40
|
+
const desk = createClient({ baseUrl: 'http://127.0.0.1:8080', token: () => process.env.DESK_TOKEN! });
|
|
41
|
+
async function ask(input: object, idempotencyKey: string) {
|
|
42
|
+
const run = await desk.submit('research.desk', input, { idempotencyKey });
|
|
43
|
+
for await (const _event of run.events()) { /* ends when the desk run settles */ }
|
|
44
|
+
const outcome = await run.result(deskOutput);
|
|
45
|
+
if (outcome?.status !== 'succeeded') throw new Error('The desk did not answer.');
|
|
46
|
+
return outcome.output;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Start: idempotent on your request id. Retrying the same request id returns the same run.
|
|
50
|
+
const { runId } = await ask({ requestId: 'q-42', question: 'What did the co-operative learn after two years, and what are its open risks?' }, 'start-q-42');
|
|
51
|
+
// Later: the report (Markdown with citations), or the run's status while it is unfinished.
|
|
52
|
+
const { status, report, citations } = await ask({ runId }, `report-q-42-${Date.now()}`);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`npm test` runs everything offline over real HTTP: a research run end to end with the researchers provably in
|
|
56
|
+
parallel, citations checked against the library, idempotent starts, a run stopped by its budget, token scopes,
|
|
57
|
+
metadata-only trace export to a local collector, and configuration checks.
|
|
58
|
+
|
|
59
|
+
## What is where
|
|
60
|
+
|
|
61
|
+
| File | Purpose |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `src/workflow.ts` | The research workflow: its steps, the shared budget, citation checks, report rendering and artifact storage |
|
|
64
|
+
| `src/team.ts` | The planner, researcher and writer agents and their offline stand-in models |
|
|
65
|
+
| `src/desk.ts` | The research desk agent, its `research.start` and `research.report` tools, and its offline stand-in |
|
|
66
|
+
| `src/library/` | The `SourceLibrary` interface, a local keyword index, the `library.search`/`library.read` tools and the bundled corpus |
|
|
67
|
+
| `src/telemetry.ts` | Optional metadata-only OpenTelemetry traces |
|
|
68
|
+
| `src/server.ts` | HTTP: the desk, the operator console at `/inspector` and the operator API |
|
|
69
|
+
| `src/worker.ts` | Advances research runs, with leadership so replicas never double-drive the fleet |
|
|
70
|
+
| `src/auth.ts` | Bearer tokens (digests in config) and caller scopes |
|
|
71
|
+
| `src/config.ts` | Every setting, from the environment, validated at startup |
|
|
72
|
+
| `src/model.ts` | Offline, OpenAI, Anthropic or OpenAI-compatible, chosen by `MAYURA_MODEL_PROVIDER` |
|
|
73
|
+
| `src/app.ts` | The entry point for `mayura serve`, `mayura worker` and `mayura migrate` |
|
|
74
|
+
| `src/dev.ts` | The one-process local run with a demo question |
|
|
75
|
+
|
|
76
|
+
## How it works
|
|
77
|
+
|
|
78
|
+
**Why a lifecycle workflow.** Mayura has several durable formats. This starter uses the lifecycle format
|
|
79
|
+
(`mayura/workflows/lifecycle`, format 5) because it covers what the team needs with the least machinery: tool steps
|
|
80
|
+
whose dependencies are met run **in parallel** in the same wave; every step is journaled before it runs and **never
|
|
81
|
+
replayed** after a crash; the run record carries **one cost budget** that every step draws on, checked before each
|
|
82
|
+
step starts; `createWorkflowLifecycleHost` is a ready-made worker unit (with leadership, the fleet hold and backoff);
|
|
83
|
+
and the operator console and API work as in the approval-workflow starter, where reviewed migrations are added the
|
|
84
|
+
same way.
|
|
85
|
+
It also has human and timer nodes, should you want an editor's approval before a report is published.
|
|
86
|
+
The alternatives were weighed: *workflow trees* (required child workflows with per-child cost ceilings under one root
|
|
87
|
+
account) are the closest conceptual fit, but the guide describes them as a preview limited to one level of tool/join
|
|
88
|
+
children, they need a coordinator wrapped as a worker unit, and each child would still be a static node, so they add
|
|
89
|
+
machinery without solving variable fan-out. *Graphs* add waits on other runs, which research does not need.
|
|
90
|
+
`agentAsDurableWorkflow` wraps one agent as one workflow, not a team. The store's `durableBudgets` ledger is a
|
|
91
|
+
lower-level primitive whose guide warns that calling it separately from the workflow is not a restart-safe
|
|
92
|
+
integration; the lifecycle budget is written in the same record update that claims each step.
|
|
93
|
+
|
|
94
|
+
**One shared budget.** `RESEARCH_BUDGET_MICROS` is the budget of a whole research run. Every agent step declares a
|
|
95
|
+
ceiling (`MAYURA_MAX_RUN_COST_MICROS`, which is also the agent's own `maxCostMicros`). Before a step runs, the runtime
|
|
96
|
+
reserves its ceiling from what the run has left, in the same storage write that claims the step; when the step
|
|
97
|
+
completes, the run is charged what it reported spending and the rest of the reservation is released. When the rest of the
|
|
98
|
+
budget cannot cover a step, that step is `blocked` with code `BUDGET_EXCEEDED`, every later step is skipped, and the
|
|
99
|
+
run ends `blocked`: no model is called and no report is written. The desk reports it as
|
|
100
|
+
`{ status: 'blocked', stopReason: 'budget_exhausted' }`. By default the budget is six step ceilings: plan, four
|
|
101
|
+
research slots and write (storing costs nothing), enough for the largest plan.
|
|
102
|
+
|
|
103
|
+
**Parallel research.** `fanOut` from `mayura/workflows/lifecycle` gives the graph one slot per possible researcher
|
|
104
|
+
(four). The planner returns as many assignments as it needs (two to four); slot n runs the researcher on assignment n,
|
|
105
|
+
and a slot without an assignment is bypassed: it never starts and reserves nothing from the budget. The `research`
|
|
106
|
+
join lists every slot's output in order, `null` for a bypassed slot, and the writer reads that list.
|
|
107
|
+
|
|
108
|
+
**Citations you can trust.** A researcher's tools are created per step and record which documents it read; a finding
|
|
109
|
+
that cites anything else fails the step. The writer may cite only sources the researchers reported, and every cited id
|
|
110
|
+
must resolve in the library, whose titles (not the model's) fill the reference list.
|
|
111
|
+
|
|
112
|
+
**Content-addressed reports.** The `store` step writes the Markdown report to `mayura/artifacts`; its reference
|
|
113
|
+
(`sha256:` digest of the exact bytes) is the run's result. `research.report` reads the bytes back through the store,
|
|
114
|
+
which re-verifies the digest.
|
|
115
|
+
|
|
116
|
+
**Traces.** Set `OTEL_EXPORTER_OTLP_ENDPOINT` (the collector's base URL; traces go to `/v1/traces`) and each research
|
|
117
|
+
run becomes one trace rooted at the run (`workflow:research.run`), with a span per step (`tool:plan`,
|
|
118
|
+
`tool:research.1`..`4`, `join:research`, `tool:write`, `tool:store`). Each agent a step runs is nested under that step
|
|
119
|
+
(`agent:research.planner`, ...), with its model calls (`model.call`) and tool calls (`tool:library.search`,
|
|
120
|
+
`tool:library.read`) under it. The run and step spans are built from the run's durable event log once it settles, so
|
|
121
|
+
a worker that restarts exports them later, and exporting twice sends the same span ids. Spans carry names, times,
|
|
122
|
+
ok/error, run and node ids, step statuses, definition id/version and budget figures. Questions, prompts, sources,
|
|
123
|
+
findings and reports are never exported: span attributes come from a fixed catalog of identifiers and integers, and
|
|
124
|
+
the observer admits only allow-listed metadata. Unset, nothing is collected or sent.
|
|
125
|
+
|
|
126
|
+
## Make it yours
|
|
127
|
+
|
|
128
|
+
1. **Sources.** Implement `SourceLibrary` (`search` and `read`) in `src/library/index.ts` and pass it to
|
|
129
|
+
`openServices` (or replace `localLibrary(harlowCreekCorpus)` in `src/services.ts`). For **web search**, `search`
|
|
130
|
+
calls your search API and returns URL-derived ids with snippets; `read` fetches and extracts the page, and must
|
|
131
|
+
return only what it fetched (keep ids short and stable: they are what reports cite). For a **vector store**,
|
|
132
|
+
`search` embeds the query and returns the nearest chunks' document ids; `read` returns the stored document. Keep
|
|
133
|
+
both read-only and bounded, and treat fetched text as untrusted input to the model.
|
|
134
|
+
2. **Model.** Set `MAYURA_MODEL_PROVIDER=openai` (or `anthropic`) with the key, model name, prices and cost limits in
|
|
135
|
+
`.env.example`. The same agents, tools and output schemas are used; the offline stand-ins are not.
|
|
136
|
+
3. **Budget.** Set `MAYURA_MAX_RUN_COST_MICROS` (one agent step) and `RESEARCH_BUDGET_MICROS` (one research run).
|
|
137
|
+
4. **Team.** Edit the instructions in `src/team.ts`, or change `MAX_RESEARCHERS` in `src/config.ts` (a new workflow
|
|
138
|
+
definition; see below).
|
|
139
|
+
|
|
140
|
+
### Changing the workflow
|
|
141
|
+
|
|
142
|
+
The run budget, every step's ceiling and capabilities, and the graph are pinned into each run. Never change them
|
|
143
|
+
under runs in flight: let runs finish (or cancel them from the console) first, or add a new version in
|
|
144
|
+
`src/workflow.ts`, keep the old one in `definitions`, declare a reviewed migration with `defineWorkflowMigration` and
|
|
145
|
+
pass it to `createWorkflowOperatorTransports({ migrations })` in `src/server.ts`, as the approval-workflow starter does
|
|
146
|
+
(see the Mayura guide *Migrating in-flight workflow runs*). Switching the model provider alone changes nothing pinned;
|
|
147
|
+
changing `MAYURA_MAX_RUN_COST_MICROS` or `RESEARCH_BUDGET_MICROS` does.
|
|
148
|
+
|
|
149
|
+
## Production
|
|
150
|
+
|
|
151
|
+
1. Create tokens with `npm run token`, once per caller. Give each token to its caller's secret store and put only the
|
|
152
|
+
digest in `MAYURA_OPERATOR_TOKEN_SHA256` or `MAYURA_DESK_TOKEN_SHA256`. Several comma-separated digests rotate
|
|
153
|
+
without downtime.
|
|
154
|
+
2. Use PostgreSQL (`DATABASE_URL`). SQLite is for a single node.
|
|
155
|
+
3. Give the server and every worker the **same** artifact directory (`RESEARCH_ARTIFACTS_DIR`): workers write
|
|
156
|
+
reports, the server reads them for `research.report`.
|
|
157
|
+
4. Run `npm run migrate` before new code serves traffic, then `npm run serve` and `npm run worker` as separate
|
|
158
|
+
processes. One worker leads at a time.
|
|
159
|
+
5. Terminate TLS in front of the server and set `MAYURA_PUBLIC_ORIGIN` to the exact `https://` origin. `/healthz` and
|
|
160
|
+
`/readyz` are unauthenticated and content-free; the worker serves its own on port 9090.
|
|
161
|
+
|
|
162
|
+
`docker compose up --build` runs this shape locally (PostgreSQL, migrate, server, worker, a shared artifact volume)
|
|
163
|
+
from `.env`. The image builds from the npm registry, so it needs published Mayura packages.
|
|
164
|
+
|
|
165
|
+
## Know the limits
|
|
166
|
+
|
|
167
|
+
- **Steps are admitted by ceiling, charged by use.** Before a step starts, its full ceiling must fit in what the run
|
|
168
|
+
has left; once it completes, the run is charged what the step reported spending and the rest is released. So a run
|
|
169
|
+
that is almost out of budget can stop at a step it could have afforded in practice; size `RESEARCH_BUDGET_MICROS`
|
|
170
|
+
with that headroom. Research slots the plan does not use are bypassed and reserve nothing. Offline, the ceilings
|
|
171
|
+
default to zero and the budget never binds.
|
|
172
|
+
- **Artifacts are local files.** `mayura/artifacts` is a same-host store. With several machines, mount shared storage
|
|
173
|
+
at `RESEARCH_ARTIFACTS_DIR` for the server and every worker, or replace the store with object storage. Artifact
|
|
174
|
+
files are not deleted when runs are; plan retention yourself.
|
|
175
|
+
- **A failed step fails the run.** Nothing is retried automatically (a model call costs money); submit again with a
|
|
176
|
+
new request id. A step cut off by a crash waits for operator reconciliation.
|
|
177
|
+
- **The desk relays the report through its model.** With a real provider, the desk's answer repeats the report, which
|
|
178
|
+
costs output tokens; reports are capped at 24,000 characters. For large reports, serve the artifact from your own
|
|
179
|
+
route with `artifacts.disclose` after checking the caller may read that run.
|
|
180
|
+
- **Any desk caller can read any run** whose id it has; run ids are unguessable digests, not access control. Add an
|
|
181
|
+
owner check in `research.report` if callers must not see each other's research.
|
|
182
|
+
- **The offline models are not research.** They split on punctuation, quote the sentence the keyword search matched
|
|
183
|
+
and assemble a report from those quotes. They show the protocol a real model follows.
|
|
184
|
+
- **The corpus is fictional.** Harlow Creek, its co-operative and every figure are invented for this starter.
|
|
185
|
+
- **Run traces arrive when the run settles.** The worker exports a run's workflow spans after it succeeds, fails, is
|
|
186
|
+
blocked or is cancelled (every 2 s while it leads); a run still waiting has only its agent spans so far. Agent spans
|
|
187
|
+
are best effort: a worker that dies mid-step loses that agent's spans, never the run's.
|
|
188
|
+
- Operator commands are attributed to the service principal. For per-person attribution, put your identity provider
|
|
189
|
+
in front of the API.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Production-shaped local stack: PostgreSQL, a one-shot schema migration, the server and one worker, with a report
|
|
2
|
+
# artifact volume shared by the server (which reads reports) and the worker (which writes them).
|
|
3
|
+
# Put the TLS proxy of your choice in front of `server`; it must forward to port 8080 with the public origin's Host.
|
|
4
|
+
# cp .env.example .env # then fill in the token digests
|
|
5
|
+
# docker compose up --build
|
|
6
|
+
services:
|
|
7
|
+
postgres:
|
|
8
|
+
image: postgres@sha256:f02121de6f74d30d8a94cd1d9584125e2178d7e6c377d8130112d4e52d867995
|
|
9
|
+
environment: { POSTGRES_USER: research, POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}", POSTGRES_DB: research }
|
|
10
|
+
volumes: [postgres-data:/var/lib/postgresql/data]
|
|
11
|
+
healthcheck: { test: ["CMD-SHELL", "pg_isready -U research -d research"], interval: 2s, timeout: 5s, retries: 30 }
|
|
12
|
+
migrate:
|
|
13
|
+
build: .
|
|
14
|
+
command: ["migrate", "--app", "dist/src/app.js"]
|
|
15
|
+
env_file: .env
|
|
16
|
+
environment: { DATABASE_URL: "postgres://research:${POSTGRES_PASSWORD}@postgres:5432/research", RESEARCH_ARTIFACTS_DIR: /data/artifacts }
|
|
17
|
+
volumes: [artifacts:/data/artifacts]
|
|
18
|
+
depends_on: { postgres: { condition: service_healthy } }
|
|
19
|
+
server:
|
|
20
|
+
build: .
|
|
21
|
+
command: ["serve", "--app", "dist/src/app.js"]
|
|
22
|
+
env_file: .env
|
|
23
|
+
environment: { DATABASE_URL: "postgres://research:${POSTGRES_PASSWORD}@postgres:5432/research", RESEARCH_ARTIFACTS_DIR: /data/artifacts }
|
|
24
|
+
volumes: [artifacts:/data/artifacts]
|
|
25
|
+
ports: ["8080:8080"]
|
|
26
|
+
depends_on: { migrate: { condition: service_completed_successfully } }
|
|
27
|
+
healthcheck: { test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:8080/readyz').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"], interval: 5s, timeout: 5s, retries: 30 }
|
|
28
|
+
worker:
|
|
29
|
+
build: .
|
|
30
|
+
command: ["worker", "--app", "dist/src/app.js", "--probe-host", "0.0.0.0", "--probe-port", "9090"]
|
|
31
|
+
env_file: .env
|
|
32
|
+
environment: { DATABASE_URL: "postgres://research:${POSTGRES_PASSWORD}@postgres:5432/research", RESEARCH_ARTIFACTS_DIR: /data/artifacts }
|
|
33
|
+
volumes: [artifacts:/data/artifacts]
|
|
34
|
+
depends_on: { migrate: { condition: service_completed_successfully } }
|
|
35
|
+
healthcheck: { test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:9090/readyz').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"], interval: 5s, timeout: 5s, retries: 30 }
|
|
36
|
+
volumes:
|
|
37
|
+
postgres-data:
|
|
38
|
+
artifacts:
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Copy to .env. Every setting is read from the environment and validated at startup (src/config.ts).
|
|
2
|
+
# `npm run dev` needs none of these: it runs offline on SQLite with fresh tokens.
|
|
3
|
+
|
|
4
|
+
# development | production. Production requires MAYURA_PUBLIC_ORIGIN and at least one operator token digest.
|
|
5
|
+
MAYURA_ENV=production
|
|
6
|
+
MAYURA_PUBLIC_ORIGIN=https://research.example.com
|
|
7
|
+
MAYURA_PROJECT=research
|
|
8
|
+
PORT=8080
|
|
9
|
+
MAYURA_BIND=0.0.0.0
|
|
10
|
+
# Comma-separated browser origins allowed to call the API (not needed for the console, which is same-origin).
|
|
11
|
+
MAYURA_ALLOWED_ORIGINS=
|
|
12
|
+
|
|
13
|
+
# Storage: PostgreSQL when DATABASE_URL is set, otherwise SQLite at MAYURA_SQLITE_PATH (single node only).
|
|
14
|
+
# compose.yaml sets DATABASE_URL from POSTGRES_PASSWORD.
|
|
15
|
+
POSTGRES_PASSWORD=change-me
|
|
16
|
+
# MAYURA_SQLITE_PATH=.data/research-team.sqlite
|
|
17
|
+
# Report artifacts (content-addressed files). The server and every worker must see the same directory.
|
|
18
|
+
# RESEARCH_ARTIFACTS_DIR=.data/artifacts
|
|
19
|
+
|
|
20
|
+
# Bearer tokens: configure SHA-256 digests only. `npm run token` prints a new token and its digest.
|
|
21
|
+
# Comma-separate several digests to rotate without downtime.
|
|
22
|
+
MAYURA_OPERATOR_TOKEN_SHA256=
|
|
23
|
+
MAYURA_DESK_TOKEN_SHA256=
|
|
24
|
+
|
|
25
|
+
# Model: offline (default, rule-based, no network), openai, anthropic, or compatible (any OpenAI-compatible endpoint).
|
|
26
|
+
MAYURA_MODEL_PROVIDER=offline
|
|
27
|
+
# OPENAI_API_KEY=
|
|
28
|
+
# ANTHROPIC_API_KEY=
|
|
29
|
+
# For compatible: the chat-completions URL, a short id for the provider, and its key (Azure OpenAI uses MAYURA_MODEL_AUTH=api-key).
|
|
30
|
+
# MAYURA_MODEL_ENDPOINT=https://api.groq.com/openai/v1/chat/completions
|
|
31
|
+
# MAYURA_MODEL_PROVIDER_ID=groq
|
|
32
|
+
# MAYURA_MODEL_AUTH=bearer
|
|
33
|
+
# MAYURA_MODEL_API_KEY=
|
|
34
|
+
# MAYURA_MODEL=
|
|
35
|
+
# Prices in micro-dollars per million tokens, and the most one model call and one agent step may cost.
|
|
36
|
+
# MAYURA_MODEL_INPUT_MICROS_PER_MILLION_TOKENS=
|
|
37
|
+
# MAYURA_MODEL_OUTPUT_MICROS_PER_MILLION_TOKENS=
|
|
38
|
+
# MAYURA_MODEL_MAX_CALL_COST_MICROS=
|
|
39
|
+
# MAYURA_MAX_RUN_COST_MICROS=
|
|
40
|
+
# The one budget of a whole research run (planner + every researcher + writer). Default: six step ceilings.
|
|
41
|
+
# RESEARCH_BUDGET_MICROS=
|
|
42
|
+
|
|
43
|
+
# Metadata-only OpenTelemetry traces (off when unset). The collector's base URL; traces go to <base>/v1/traces.
|
|
44
|
+
# https://, or http:// only to 127.0.0.1 / [::1]. Headers use `name=value,name2=value2` (values URL-encoded).
|
|
45
|
+
# OTEL_EXPORTER_OTLP_ENDPOINT=https://collector.example.com
|
|
46
|
+
# OTEL_EXPORTER_OTLP_HEADERS=
|
|
47
|
+
# OTEL_SERVICE_NAME=research-team
|
|
48
|
+
|
|
49
|
+
# MAYURA_WORKER_ID=worker-1
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
permissions: { contents: read }
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
runs-on: ubuntu-latest
|
|
7
|
+
steps:
|
|
8
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
9
|
+
with: { persist-credentials: false }
|
|
10
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
11
|
+
with: { node-version: 24.14.1 }
|
|
12
|
+
- run: npm install --no-audit --no-fund
|
|
13
|
+
- run: npm test
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "mayura.project.v1",
|
|
3
|
+
"name": "research-team",
|
|
4
|
+
"template": "research-team",
|
|
5
|
+
"definitions": [
|
|
6
|
+
{ "kind": "agent", "id": "research.desk", "version": "1", "source": "src/desk.ts" },
|
|
7
|
+
{ "kind": "agent", "id": "research.planner", "version": "1", "source": "src/team.ts" },
|
|
8
|
+
{ "kind": "agent", "id": "research.researcher", "version": "1", "source": "src/team.ts" },
|
|
9
|
+
{ "kind": "agent", "id": "research.writer", "version": "1", "source": "src/team.ts" },
|
|
10
|
+
{ "kind": "workflow", "id": "research.run", "version": "1", "source": "src/workflow.ts" }
|
|
11
|
+
],
|
|
12
|
+
"tools": [
|
|
13
|
+
{ "id": "research.start", "version": "1", "effects": "write", "capabilities": ["research:start"] },
|
|
14
|
+
{ "id": "research.report", "version": "1", "effects": "read", "capabilities": ["research:read"] },
|
|
15
|
+
{ "id": "library.search", "version": "1", "effects": "read", "capabilities": ["library:read"] },
|
|
16
|
+
{ "id": "library.read", "version": "1", "effects": "read", "capabilities": ["library:read"] },
|
|
17
|
+
{ "id": "research.plan", "version": "1", "effects": "none", "capabilities": ["research:plan"] },
|
|
18
|
+
{ "id": "research.investigate", "version": "1", "effects": "none", "capabilities": ["research:investigate"] },
|
|
19
|
+
{ "id": "research.write", "version": "1", "effects": "none", "capabilities": ["research:write"] },
|
|
20
|
+
{ "id": "research.store", "version": "1", "effects": "write", "capabilities": ["artifacts:write"] }
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mayura-starter-research-team",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Multi-agent research on Mayura: a planner, parallel researchers over a source library and a writer, as one durable workflow under one shared budget, with cited reports stored as content-addressed artifacts.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12.0 <23 || >=24.14.1 <25"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json",
|
|
12
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
13
|
+
"test": "tsc -p tsconfig.json && node --test \"dist/test/*.test.js\"",
|
|
14
|
+
"dev": "mayura dev",
|
|
15
|
+
"token": "node dist/src/token.js",
|
|
16
|
+
"migrate": "mayura migrate --app dist/src/app.js",
|
|
17
|
+
"serve": "mayura serve --app dist/src/app.js",
|
|
18
|
+
"worker": "mayura worker --app dist/src/app.js --probe-host 0.0.0.0 --probe-port 9090"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"better-sqlite3": "13.0.3",
|
|
22
|
+
"mayura": "workspace:*",
|
|
23
|
+
"pg": "8.23.0",
|
|
24
|
+
"zod": "4.6.5"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "24.13.6",
|
|
28
|
+
"typescript": "7.0.2"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineMayuraApplication } from 'mayura/cli';
|
|
2
|
+
import { loadConfig } from './config.js';
|
|
3
|
+
import { startServer } from './server.js';
|
|
4
|
+
import { openServices, type Services } from './services.js';
|
|
5
|
+
import { createResearchWorker } from './worker.js';
|
|
6
|
+
|
|
7
|
+
// The production entry point for `mayura serve`, `mayura worker` and `mayura migrate` (see package.json scripts).
|
|
8
|
+
// Run the server and the worker as separate processes; both read the same environment.
|
|
9
|
+
const config = await loadConfig();
|
|
10
|
+
let services: Promise<Services> | undefined;
|
|
11
|
+
const ready = (): Promise<Services> => (services ??= openServices(config));
|
|
12
|
+
|
|
13
|
+
export default defineMayuraApplication({
|
|
14
|
+
async server() { return startServer(config, await ready()); },
|
|
15
|
+
async worker() { return createResearchWorker(config, await ready()).worker; },
|
|
16
|
+
// Storage schema version 1 is the baseline. Later releases ship explicit, one-way, versioned migrations here.
|
|
17
|
+
async migrate() { await ready(); return { schemaVersion: 1 }; },
|
|
18
|
+
async shutdown() { if (services) await (await services).close(); },
|
|
19
|
+
});
|