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,271 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { readdir, mkdtemp, rm } from 'node:fs/promises';
|
|
4
|
+
import { createServer, type IncomingHttpHeaders } from 'node:http';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { describe, it } from 'node:test';
|
|
8
|
+
import { createClient } from 'mayura/client';
|
|
9
|
+
import { newToken, tokenDigest } from '../src/auth.js';
|
|
10
|
+
import { loadConfig } from '../src/config.js';
|
|
11
|
+
import { deskOutput, type DeskInput } from '../src/desk.js';
|
|
12
|
+
import { harlowCreekCorpus } from '../src/library/corpus.js';
|
|
13
|
+
import { localLibrary, type SourceLibrary } from '../src/library/index.js';
|
|
14
|
+
import { startServer } from '../src/server.js';
|
|
15
|
+
import { openServices } from '../src/services.js';
|
|
16
|
+
import { createResearchWorker } from '../src/worker.js';
|
|
17
|
+
import { researchSlots } from '../src/workflow.js';
|
|
18
|
+
|
|
19
|
+
// Everything runs offline: the rule-based stand-in models, SQLite and artifacts in a temporary directory, and a
|
|
20
|
+
// loopback server driven over real HTTP. Tests drive the worker one cycle at a time instead of starting its timer.
|
|
21
|
+
const QUESTION = 'How much did the Harlow Creek microgrid cost, who owns and governs it, and how did its batteries perform during outages?';
|
|
22
|
+
const corpusIds = new Set(harlowCreekCorpus.map(document => document.id));
|
|
23
|
+
|
|
24
|
+
async function harness(env: Record<string, string> = {}, options: { readonly library?: SourceLibrary } = {}) {
|
|
25
|
+
const directory = await mkdtemp(join(tmpdir(), 'research-test-'));
|
|
26
|
+
const operatorToken = newToken(); const deskToken = newToken();
|
|
27
|
+
const config = await loadConfig({ MAYURA_ENV: 'development', PORT: '0', MAYURA_SQLITE_PATH: join(directory, 'research.sqlite'),
|
|
28
|
+
RESEARCH_ARTIFACTS_DIR: join(directory, 'artifacts'), MAYURA_OPERATOR_TOKEN_SHA256: tokenDigest(operatorToken),
|
|
29
|
+
MAYURA_DESK_TOKEN_SHA256: tokenDigest(deskToken), ...env });
|
|
30
|
+
const services = await openServices(config, options);
|
|
31
|
+
const server = await startServer(config, services);
|
|
32
|
+
const { host } = createResearchWorker(config, services);
|
|
33
|
+
const desk = createClient({ baseUrl: server.origin, token: () => deskToken });
|
|
34
|
+
const operator = createClient({ baseUrl: server.origin, token: () => operatorToken });
|
|
35
|
+
/** One request to the research desk, over HTTP, to completion. */
|
|
36
|
+
const ask = async (input: DeskInput, idempotencyKey: string) => {
|
|
37
|
+
const run = await desk.submit('research.desk', input, { idempotencyKey });
|
|
38
|
+
for await (const _event of run.events()) { /* The stream ends when the desk run settles. */ }
|
|
39
|
+
return run.result(deskOutput);
|
|
40
|
+
};
|
|
41
|
+
const start = async (requestId: string, question = QUESTION) => {
|
|
42
|
+
const outcome = await ask({ requestId, question }, `desk-${requestId}`);
|
|
43
|
+
assert.equal(outcome?.status, 'succeeded'); return outcome.status === 'succeeded' ? outcome.output : assert.fail();
|
|
44
|
+
};
|
|
45
|
+
const report = async (runId: string, key: string) => {
|
|
46
|
+
const outcome = await ask({ runId }, key);
|
|
47
|
+
assert.equal(outcome?.status, 'succeeded'); return outcome.status === 'succeeded' ? outcome.output : assert.fail();
|
|
48
|
+
};
|
|
49
|
+
/** Run worker cycles until the research run leaves `running`. */
|
|
50
|
+
const settle = async (runId: string) => {
|
|
51
|
+
for (let cycle = 0; cycle < 8; cycle++) { await host.runOnce(); const view = await operator.workflow(runId); if (view.status !== 'running') return view; }
|
|
52
|
+
throw new Error('The research run did not settle.');
|
|
53
|
+
};
|
|
54
|
+
const artifactFiles = async (): Promise<string[]> => {
|
|
55
|
+
try { return (await readdir(join(directory, 'artifacts', 'objects'), { recursive: true, withFileTypes: true })).filter(entry => entry.isFile()).map(entry => entry.name); }
|
|
56
|
+
catch { return []; }
|
|
57
|
+
};
|
|
58
|
+
return { config, services, host, desk, operator, ask, start, report, settle, artifactFiles, origin: server.origin,
|
|
59
|
+
close: async () => { await host.close(); await server.close(); await services.close(); await rm(directory, { recursive: true, force: true }); } };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** A library whose searches wait until the test releases them, so a running researcher keeps its budget reservation. */
|
|
63
|
+
function gatedSearches(): SourceLibrary & { readonly release: () => void } {
|
|
64
|
+
const inner = localLibrary(harlowCreekCorpus); let open: () => void = () => {};
|
|
65
|
+
const gate = new Promise<void>(resolve => { open = resolve; });
|
|
66
|
+
return {
|
|
67
|
+
release: () => open(),
|
|
68
|
+
read: id => inner.read(id),
|
|
69
|
+
async search(query, options) {
|
|
70
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
71
|
+
try {
|
|
72
|
+
await Promise.race([gate, new Promise<never>((_resolve, reject) => { timer = setTimeout(() => reject(new Error('The search was never released.')), 10_000); })]);
|
|
73
|
+
} finally { clearTimeout(timer); }
|
|
74
|
+
return inner.search(query, options);
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** A library whose searches wait for each other: it only answers once `expected` searches are in flight at once. */
|
|
80
|
+
function overlappingSearches(expected: number): SourceLibrary & { readonly peak: () => number } {
|
|
81
|
+
const inner = localLibrary(harlowCreekCorpus); let active = 0; let peak = 0; const waiting: (() => void)[] = [];
|
|
82
|
+
return {
|
|
83
|
+
peak: () => peak,
|
|
84
|
+
read: id => inner.read(id),
|
|
85
|
+
async search(query, options) {
|
|
86
|
+
active += 1; peak = Math.max(peak, active);
|
|
87
|
+
try {
|
|
88
|
+
if (active >= expected) waiting.splice(0).forEach(release => release());
|
|
89
|
+
else await new Promise<void>((resolve, reject) => {
|
|
90
|
+
const timer = setTimeout(() => reject(new Error('Research steps did not run in parallel.')), 10_000);
|
|
91
|
+
waiting.push(() => { clearTimeout(timer); resolve(); });
|
|
92
|
+
});
|
|
93
|
+
return await inner.search(query, options);
|
|
94
|
+
} finally { active -= 1; }
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
describe('research runs', () => {
|
|
100
|
+
it('plans, researches in parallel, writes a cited report and stores it as a content-addressed artifact', async () => {
|
|
101
|
+
const library = overlappingSearches(3);
|
|
102
|
+
const h = await harness({}, { library });
|
|
103
|
+
try {
|
|
104
|
+
const started = await h.start('rq-1');
|
|
105
|
+
assert.equal(started.status, 'running'); assert.equal(started.report, null);
|
|
106
|
+
|
|
107
|
+
const done = await h.settle(started.runId);
|
|
108
|
+
assert.equal(done.status, 'succeeded');
|
|
109
|
+
const status = Object.fromEntries(done.steps.map(step => [step.id, step.status]));
|
|
110
|
+
// Three sub-questions: three researchers run, and the fourth slot is bypassed (shown to operators as skipped).
|
|
111
|
+
assert.deepEqual(status, { plan: 'succeeded', 'research.1': 'succeeded', 'research.2': 'succeeded', 'research.3': 'succeeded',
|
|
112
|
+
'research.4': 'skipped', research: 'succeeded', write: 'succeeded', store: 'succeeded' });
|
|
113
|
+
// The three researchers searched at the same time: the library only answers once all three are waiting.
|
|
114
|
+
assert.equal(library.peak(), 3);
|
|
115
|
+
|
|
116
|
+
const result = await h.report(started.runId, 'report-rq-1');
|
|
117
|
+
assert.equal(result.status, 'succeeded'); assert.equal(result.stopReason, null);
|
|
118
|
+
const text = result.report ?? assert.fail('The finished run has no report.');
|
|
119
|
+
assert.ok(text.startsWith('# Research brief: How much did the Harlow Creek microgrid cost'));
|
|
120
|
+
for (const heading of ['## How much did the Harlow Creek microgrid cost?', '## Who owns and governs it?', '## How did its batteries perform during outages?', '## Sources']) {
|
|
121
|
+
assert.ok(text.includes(heading), heading);
|
|
122
|
+
}
|
|
123
|
+
// Every citation is a real library document, and so is every source marker in the text.
|
|
124
|
+
assert.ok(result.citations.length >= 3);
|
|
125
|
+
for (const item of result.citations) assert.ok(corpusIds.has(item.sourceId), item.sourceId);
|
|
126
|
+
const markers = [...text.matchAll(/\[([a-z0-9-]+)\]/gu)].map(match => match[1]!);
|
|
127
|
+
assert.ok(markers.length > 0); for (const id of markers) assert.ok(corpusIds.has(id), id);
|
|
128
|
+
assert.ok(text.includes('The microgrid cost 4.8 million dollars to build'));
|
|
129
|
+
assert.ok(result.citations.some(item => item.sourceId === 'hc-finance'));
|
|
130
|
+
// Content-addressed: the digest is the SHA-256 of the exact report bytes read back from the artifact store.
|
|
131
|
+
assert.equal(result.artifactDigest, `sha256:${createHash('sha256').update(text).digest('hex')}`);
|
|
132
|
+
assert.equal((await h.artifactFiles()).length, 1);
|
|
133
|
+
assert.ok(result.budget && result.budget.spentMicros <= result.budget.maxCostMicros);
|
|
134
|
+
} finally { await h.close(); }
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('starts one run per request id, and refuses a request id reused for a different question', async () => {
|
|
138
|
+
const h = await harness();
|
|
139
|
+
try {
|
|
140
|
+
const first = await h.start('rq-2');
|
|
141
|
+
const again = await h.ask({ requestId: 'rq-2', question: QUESTION }, 'desk-rq-2-retry');
|
|
142
|
+
assert.equal(again?.status, 'succeeded');
|
|
143
|
+
assert.equal(again.status === 'succeeded' && again.output.runId, first.runId);
|
|
144
|
+
|
|
145
|
+
const reused = await h.ask({ requestId: 'rq-2', question: 'What did the co-operative learn after two years of operation?' }, 'desk-rq-2-other');
|
|
146
|
+
assert.notEqual(reused?.status, 'succeeded');
|
|
147
|
+
assert.equal((await h.operator.workflows()).items.length, 1);
|
|
148
|
+
|
|
149
|
+
const unfinished = await h.report(first.runId, 'report-rq-2');
|
|
150
|
+
assert.equal(unfinished.status, 'running'); assert.equal(unfinished.report, null);
|
|
151
|
+
const missing = await h.report('0'.repeat(64), 'report-missing');
|
|
152
|
+
assert.equal(missing.status, 'not_found');
|
|
153
|
+
} finally { await h.close(); }
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('stops a run that exhausts its shared budget before any report is written', async () => {
|
|
157
|
+
// Each agent step may spend 1,000 and a step starts only if that ceiling fits in what the run has left. The run may
|
|
158
|
+
// spend 1,500: after the plan, the researchers the plan needs (at least two) start together, and while the first one
|
|
159
|
+
// holds its 1,000 reservation (its searches wait for the test) the others cannot fit and are blocked. Slots the plan
|
|
160
|
+
// did not use are bypassed and reserve nothing. The offline models cost nothing, so nothing is actually charged.
|
|
161
|
+
const library = gatedSearches();
|
|
162
|
+
const h = await harness({ MAYURA_MAX_RUN_COST_MICROS: '1000', RESEARCH_BUDGET_MICROS: '1500' }, { library });
|
|
163
|
+
try {
|
|
164
|
+
const started = await h.start('rq-3');
|
|
165
|
+
const settling = h.settle(started.runId);
|
|
166
|
+
for (let poll = 0; ; poll++) {
|
|
167
|
+
const view = await h.operator.workflow(started.runId);
|
|
168
|
+
if (view.steps.some(step => researchSlots.includes(step.id) && step.status === 'blocked')) break;
|
|
169
|
+
if (poll > 200) assert.fail('No research step was blocked by the budget.');
|
|
170
|
+
await new Promise(resolve => setTimeout(resolve, 25));
|
|
171
|
+
}
|
|
172
|
+
library.release();
|
|
173
|
+
const stopped = await settling;
|
|
174
|
+
assert.equal(stopped.status, 'blocked');
|
|
175
|
+
const research = stopped.steps.filter(step => researchSlots.includes(step.id));
|
|
176
|
+
const used = research.filter(step => step.status !== 'skipped');
|
|
177
|
+
assert.ok(used.length >= 2, 'The plan uses at least two researchers.');
|
|
178
|
+
assert.equal(research.filter(step => step.status === 'succeeded').length, 1);
|
|
179
|
+
assert.equal(research.filter(step => step.status === 'blocked').length, used.length - 1);
|
|
180
|
+
for (const id of ['research', 'write', 'store']) assert.equal(stopped.steps.find(step => step.id === id)?.status, 'skipped', id);
|
|
181
|
+
|
|
182
|
+
const result = await h.report(started.runId, 'report-rq-3');
|
|
183
|
+
assert.equal(result.status, 'blocked'); assert.equal(result.stopReason, 'budget_exhausted');
|
|
184
|
+
assert.equal(result.report, null); assert.equal(result.artifactDigest, null);
|
|
185
|
+
assert.deepEqual(result.budget, { spentMicros: 0, reservedMicros: 0, maxCostMicros: 1_500 });
|
|
186
|
+
assert.deepEqual(await h.artifactFiles(), []);
|
|
187
|
+
// Nothing is retried: another worker cycle leaves the run exactly where it stopped.
|
|
188
|
+
await h.host.runOnce();
|
|
189
|
+
assert.equal((await h.operator.workflow(started.runId)).status, 'blocked');
|
|
190
|
+
} finally { await h.close(); }
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('keeps callers to their own capabilities', async () => {
|
|
194
|
+
const h = await harness();
|
|
195
|
+
try {
|
|
196
|
+
await assert.rejects(h.desk.workflows(), { status: 403 });
|
|
197
|
+
// The team's agents are invisible to desk callers: the server does not even confirm they exist.
|
|
198
|
+
await assert.rejects(h.desk.submit('research.planner', { question: QUESTION, maxSubQuestions: 2 }, { idempotencyKey: 'planner-1' }), { status: 404 });
|
|
199
|
+
await assert.rejects(h.operator.submit('research.desk', { requestId: 'rq-op', question: QUESTION }, { idempotencyKey: 'operator-1' }), { status: 403 });
|
|
200
|
+
const listed = (await h.operator.agents()).map(agent => agent.id).sort();
|
|
201
|
+
assert.deepEqual(listed, ['research.desk', 'research.planner', 'research.researcher', 'research.writer']);
|
|
202
|
+
const stranger = createClient({ baseUrl: h.origin, token: () => newToken() });
|
|
203
|
+
await assert.rejects(stranger.agents(), { status: 401 });
|
|
204
|
+
// The operator console is served; it asks for the operator token in the browser.
|
|
205
|
+
assert.equal((await fetch(`${h.origin}/inspector`)).status, 200);
|
|
206
|
+
} finally { await h.close(); }
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
describe('telemetry', () => {
|
|
211
|
+
it('exports metadata-only traces to the configured collector and never the research content', async () => {
|
|
212
|
+
const received: { readonly path: string; readonly headers: IncomingHttpHeaders; readonly body: string }[] = [];
|
|
213
|
+
const collector = createServer((request, response) => {
|
|
214
|
+
const chunks: Buffer[] = [];
|
|
215
|
+
request.on('data', chunk => chunks.push(chunk as Buffer));
|
|
216
|
+
request.on('end', () => {
|
|
217
|
+
received.push({ path: request.url ?? '', headers: request.headers, body: Buffer.concat(chunks).toString('utf8') });
|
|
218
|
+
response.writeHead(200, { 'content-type': 'application/json' }).end('{}');
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
await new Promise<void>(resolve => collector.listen(0, '127.0.0.1', resolve));
|
|
222
|
+
const { port } = collector.address() as { port: number };
|
|
223
|
+
const h = await harness({ OTEL_EXPORTER_OTLP_ENDPOINT: `http://127.0.0.1:${port}`, OTEL_EXPORTER_OTLP_HEADERS: 'x-collector-key=test%20key' });
|
|
224
|
+
try {
|
|
225
|
+
const started = await h.start('rq-4');
|
|
226
|
+
assert.equal((await h.settle(started.runId)).status, 'succeeded');
|
|
227
|
+
await h.services.telemetry.flush();
|
|
228
|
+
|
|
229
|
+
assert.ok(received.length > 0);
|
|
230
|
+
for (const request of received) { assert.equal(request.path, '/v1/traces'); assert.equal(request.headers['x-collector-key'], 'test key'); }
|
|
231
|
+
type Span = { traceId: string; spanId: string; parentSpanId?: string; name: string };
|
|
232
|
+
const spans = received.flatMap(request => (JSON.parse(request.body) as { resourceSpans: { scopeSpans: { spans: Span[] }[] }[] })
|
|
233
|
+
.resourceSpans.flatMap(resource => resource.scopeSpans.flatMap(scope => scope.spans)));
|
|
234
|
+
const names = new Set(spans.map(span => span.name));
|
|
235
|
+
for (const name of ['workflow:research.run', 'tool:plan', ...researchSlots.map(id => `tool:${id}`), 'join:research', 'tool:write', 'tool:store',
|
|
236
|
+
'agent:research.planner', 'agent:research.researcher', 'agent:research.writer', 'model.call', 'tool:library.search', 'tool:library.read']) {
|
|
237
|
+
assert.ok(names.has(name), name);
|
|
238
|
+
}
|
|
239
|
+
assert.equal(new Set(spans.map(span => span.traceId)).size, 1);
|
|
240
|
+
// One root, the run; every step hangs off it; every agent run hangs off the step that ran it.
|
|
241
|
+
const roots = spans.filter(span => span.parentSpanId === undefined);
|
|
242
|
+
assert.deepEqual(roots.map(span => span.name), ['workflow:research.run']);
|
|
243
|
+
const byId = new Map(spans.map(span => [span.spanId, span]));
|
|
244
|
+
for (const span of spans.filter(item => item.name.startsWith('agent:'))) {
|
|
245
|
+
assert.ok(/^tool:(plan|research\.\d|write)$/u.test(byId.get(span.parentSpanId ?? '')?.name ?? ''), span.name);
|
|
246
|
+
}
|
|
247
|
+
for (const span of spans) if (span.parentSpanId !== undefined) assert.ok(byId.has(span.parentSpanId), `${span.name} has its parent exported`);
|
|
248
|
+
// No question, finding, source or report text leaves the process: only names, ids and times.
|
|
249
|
+
const exported = received.map(request => request.body).join('\n');
|
|
250
|
+
for (const secret of ['Harlow', 'microgrid', 'batteries', 'co-operative', 'hc-finance', 'Research brief']) assert.ok(!exported.includes(secret), secret);
|
|
251
|
+
} finally { await h.close(); await new Promise(resolve => collector.close(resolve)); }
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
describe('configuration', () => {
|
|
256
|
+
it('runs offline by default and validates production, providers, budgets and telemetry', async () => {
|
|
257
|
+
const config = await loadConfig({});
|
|
258
|
+
assert.equal(config.model.provider, 'offline'); assert.equal(config.storage.kind, 'sqlite'); assert.equal(config.telemetry, undefined);
|
|
259
|
+
assert.deepEqual(config.budget, { stepMicros: 0, runMicros: 0 });
|
|
260
|
+
assert.deepEqual((await loadConfig({ MAYURA_MAX_RUN_COST_MICROS: '1000' })).budget, { stepMicros: 1_000, runMicros: 6_000 });
|
|
261
|
+
await assert.rejects(loadConfig({ MAYURA_MAX_RUN_COST_MICROS: '1000', RESEARCH_BUDGET_MICROS: '999' }), /RESEARCH_BUDGET_MICROS/u);
|
|
262
|
+
await assert.rejects(loadConfig({ MAYURA_ENV: 'production' }), /MAYURA_PUBLIC_ORIGIN/u);
|
|
263
|
+
await assert.rejects(loadConfig({ MAYURA_ENV: 'production', MAYURA_PUBLIC_ORIGIN: 'https://research.example.com' }), /MAYURA_OPERATOR_TOKEN_SHA256/u);
|
|
264
|
+
await assert.rejects(loadConfig({ MAYURA_MODEL_PROVIDER: 'openai' }), /OPENAI_API_KEY/u);
|
|
265
|
+
await assert.rejects(loadConfig({ OTEL_EXPORTER_OTLP_ENDPOINT: 'http://collector.internal:4318' }), /OTEL_EXPORTER_OTLP_ENDPOINT/u);
|
|
266
|
+
await assert.rejects(loadConfig({ OTEL_EXPORTER_OTLP_HEADERS: 'x-key=1' }), /OTEL_EXPORTER_OTLP_ENDPOINT/u);
|
|
267
|
+
await assert.rejects(loadConfig({ OTEL_EXPORTER_OTLP_ENDPOINT: 'https://collector.example.com', OTEL_EXPORTER_OTLP_HEADERS: 'no-value' }), /OTEL_EXPORTER_OTLP_HEADERS/u);
|
|
268
|
+
assert.equal((await loadConfig({ OTEL_EXPORTER_OTLP_ENDPOINT: 'https://collector.example.com/otlp/' })).telemetry?.tracesEndpoint, 'https://collector.example.com/otlp/v1/traces');
|
|
269
|
+
assert.equal((await loadConfig({ DATABASE_URL: 'postgres://research@db/research' })).storage.kind, 'postgres');
|
|
270
|
+
});
|
|
271
|
+
});
|
|
@@ -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,21 @@
|
|
|
1
|
+
# Server and worker image. Both run the same build; compose.yaml chooses the command. The chat UI (web/) is a static
|
|
2
|
+
# bundle: build it with `npx vite build web` and serve web/dist from your static host or reverse proxy.
|
|
3
|
+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5 AS build
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
COPY package.json package-lock.json* ./
|
|
6
|
+
RUN npm install --no-audit --no-fund
|
|
7
|
+
COPY tsconfig.json ./
|
|
8
|
+
COPY src ./src
|
|
9
|
+
COPY test ./test
|
|
10
|
+
RUN npx tsc -p tsconfig.json && npm prune --omit=dev
|
|
11
|
+
|
|
12
|
+
FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5
|
|
13
|
+
WORKDIR /app
|
|
14
|
+
COPY --from=build --chown=65532:65532 /app/package.json ./
|
|
15
|
+
COPY --from=build --chown=65532:65532 /app/node_modules ./node_modules
|
|
16
|
+
COPY --from=build --chown=65532:65532 /app/dist ./dist
|
|
17
|
+
USER 65532:65532
|
|
18
|
+
ENV NODE_ENV=production MAYURA_ENV=production
|
|
19
|
+
EXPOSE 8080 9090
|
|
20
|
+
ENTRYPOINT ["node", "node_modules/mayura/lib/cli/dist/bin.js"]
|
|
21
|
+
CMD ["serve", "--app", "dist/src/app.js"]
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Customer support chat on Mayura
|
|
2
|
+
|
|
3
|
+
A production-shaped starter for an online store's support assistant: customers chat in a **React chat UI**, a
|
|
4
|
+
**support agent** answers with **order tools that only ever see the signed-in customer's own data**, remembers
|
|
5
|
+
preferences in **per-customer native memory**, and **redacts card numbers, emails and phone numbers** on the way in and
|
|
6
|
+
out. Opening a return starts a small **durable follow-up workflow** that a **worker** advances, and operators watch
|
|
7
|
+
everything in the **console**.
|
|
8
|
+
|
|
9
|
+
It runs offline out of the box: a rule-based stand-in model, SQLite, sample orders and a simulated returns desk. One
|
|
10
|
+
environment switch uses OpenAI, Anthropic or an OpenAI-compatible provider, and another uses PostgreSQL.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
browser (web/) ──session token──▶ server ──▶ support.assistant ──▶ orders.list / orders.track (read, own orders only)
|
|
14
|
+
▲ │ │ returns.start ──▶ durable run returns.follow-up
|
|
15
|
+
│ your backend mints sessions │ │ memory.remember / memory.recall (native memory, own scope)
|
|
16
|
+
│ (mintSessionToken) │ └─ guardrails: redact PII in input and reply, block any leftover
|
|
17
|
+
operator ──token──▶ console /inspector: agents, tools, follow-ups (pause, resume, cancel, fleet hold)
|
|
18
|
+
worker: schedule ─▶ [timer] ─▶ remind
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install
|
|
25
|
+
npm run dev
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`npm run dev` compiles the server, builds the chat UI (`web/`), and starts in one process: the Mayura server and a worker
|
|
29
|
+
on `.data/support.sqlite`, plus a small front server for the chat. It prints:
|
|
30
|
+
|
|
31
|
+
`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.
|
|
32
|
+
|
|
33
|
+
- **chat**: `http://127.0.0.1:5173`. Pick a demo customer (Ada or Grace) and try:
|
|
34
|
+
- "Where is my order?": the assistant lists your orders, then tracks the most recent undelivered one. The chips
|
|
35
|
+
above each reply show the tools it used, live, and the reply streams in as it is written.
|
|
36
|
+
- "I want to return my mug set": opens a return for your latest delivered order. Asking again finds the same return.
|
|
37
|
+
- "Remember that I prefer weekend deliveries", then later "What do you remember about me?". Sign in as the other
|
|
38
|
+
customer: they see none of it.
|
|
39
|
+
- Type a card number or an email address: the assistant never sees it, and neither does memory.
|
|
40
|
+
- **console**: `http://127.0.0.1:8080/inspector` with a fresh **operator token**. Open **Workflows** to see each return's
|
|
41
|
+
follow-up waiting on its timer (`RETURN_REMINDER_HOURS`, default 72).
|
|
42
|
+
|
|
43
|
+
The front server serves `web/dist`, forwards `/v1/*` to the Mayura server (so the browser talks to one origin) and
|
|
44
|
+
offers `POST /dev/session`, which signs a session for a demo customer without a login. That endpoint is the stand-in for
|
|
45
|
+
your backend and exists only in `npm run dev`. Set `PORT` and `DEV_WEB_PORT` to move the ports.
|
|
46
|
+
|
|
47
|
+
`npm test` runs everything offline over real HTTP: sessions (tampered, expired, wrong key), a hostile model trying to
|
|
48
|
+
read and return another customer's order, the tracking conversation, idempotent returns and their durable follow-up,
|
|
49
|
+
memory across runs and restarts and between customers, PII redaction, caller scopes and configuration.
|
|
50
|
+
|
|
51
|
+
## What is where
|
|
52
|
+
|
|
53
|
+
| File | Purpose |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `src/assistant.ts` | The agent, its five tools, input/output schemas and the offline stand-in model |
|
|
56
|
+
| `src/orders.ts` | The order-directory interface (orders *of a customer*, nothing else) and the sample data |
|
|
57
|
+
| `src/returns.ts` | The returns-desk interface, the simulated desk and the `returns.follow-up` workflow |
|
|
58
|
+
| `src/guardrails.ts` | PII redaction (a `mayura/guardrails` pipeline) and the output guard that backs it up |
|
|
59
|
+
| `src/session.ts` | Customer session tokens: `mintSessionToken` for your backend, verification for the server |
|
|
60
|
+
| `src/auth.ts` | Who may do what: customers (own runs only) and operators (console) |
|
|
61
|
+
| `src/server.ts` | HTTP: the agent, the console at `/inspector` and the operator API |
|
|
62
|
+
| `src/worker.ts` | Advances follow-ups, with leadership so replicas never double-drive the fleet |
|
|
63
|
+
| `src/config.ts` | Every setting, from the environment, validated at startup |
|
|
64
|
+
| `src/model.ts` | Offline, OpenAI, Anthropic or OpenAI-compatible, chosen by `MAYURA_MODEL_PROVIDER` |
|
|
65
|
+
| `src/app.ts` | The entry point for `mayura serve`, `mayura worker` and `mayura migrate` |
|
|
66
|
+
| `src/dev.ts` | The one-process local run with the chat front server and demo data |
|
|
67
|
+
| `web/` | The chat UI: Vite, React, Tailwind and shadcn-style components, `mayura/client` and `mayura/client-react` |
|
|
68
|
+
|
|
69
|
+
## How customers are kept apart
|
|
70
|
+
|
|
71
|
+
- Your backend signs the shopper in (your login, your cookies) and calls `mintSessionToken(secret, customerId, ttlMs)`.
|
|
72
|
+
The browser holds only that short-lived token.
|
|
73
|
+
- The server verifies it (HMAC-SHA256, constant-time, expiry) and runs the chat in the scope
|
|
74
|
+
`customer/<id>`. Runs are keyed by scope, so one customer cannot read another's run.
|
|
75
|
+
- Every tool takes the customer from that verified scope, never from its arguments. Tool inputs are strict and have
|
|
76
|
+
no customer field, so a model that tries to name another customer makes an invalid call and the run stops. Asking
|
|
77
|
+
for someone else's order number returns "not found", exactly like an order that does not exist.
|
|
78
|
+
- Native memory is created per call in the customer's scope, so other customers' notes are not filtered out: they
|
|
79
|
+
are in a different partition. Notes carry provenance (which conversation, who said it).
|
|
80
|
+
|
|
81
|
+
## Make it yours
|
|
82
|
+
|
|
83
|
+
1. **Orders.** Replace `sampleOrders` in `src/orders.ts` with your order system. Keep the one query, "orders of this
|
|
84
|
+
customer"; do not add a lookup by order id alone.
|
|
85
|
+
2. **Returns.** Replace `simulatedReturnsDesk` in `src/returns.ts`. `open` must be idempotent per (customer, order) and
|
|
86
|
+
`remind` per return id.
|
|
87
|
+
3. **Sessions.** In your backend, sign shoppers in as you do today and return `mintSessionToken(...)` to the page.
|
|
88
|
+
Replace `demoCustomers` and `signIn` in `web/src/lib/api.ts` with that call, and remove the sign-in screen.
|
|
89
|
+
4. **Model.** Set `MAYURA_MODEL_PROVIDER=openai` (or `anthropic`) with the key, model name, prices and cost limits
|
|
90
|
+
listed in `.env.example`. The same agent, tools, guardrails and output schema are used; the offline stand-in is not.
|
|
91
|
+
5. **Look and feel.** The components in `web/src/components` are yours to restyle; colors live in `web/src/styles.css`.
|
|
92
|
+
|
|
93
|
+
## Production
|
|
94
|
+
|
|
95
|
+
1. Run `npm run token`: it prints an operator token with its digest, and a session secret. Put the digest in
|
|
96
|
+
`MAYURA_OPERATOR_TOKEN_SHA256`, and the session secret in `MAYURA_SESSION_SECRET` on every server replica **and** in
|
|
97
|
+
your application backend. Several comma-separated operator digests rotate without downtime.
|
|
98
|
+
2. Use PostgreSQL (`DATABASE_URL`). SQLite is for a single node.
|
|
99
|
+
3. Run `npm run migrate` before new code serves traffic (it also creates the native-memory tables), then
|
|
100
|
+
`npm run serve` and `npm run worker` as separate processes.
|
|
101
|
+
4. Terminate TLS in front of the server and set `MAYURA_PUBLIC_ORIGIN` to the exact `https://` origin.
|
|
102
|
+
5. **The chat UI** is static: `npx vite build web` produces `web/dist`. Serve it from any static host. Simplest is the
|
|
103
|
+
same origin as the API (your reverse proxy sends `/v1/*` to the Mayura server and everything else to `web/dist`); a
|
|
104
|
+
separate origin works too if you list it in `MAYURA_ALLOWED_ORIGINS` and point `apiOrigin` in `web/src/lib/api.ts`
|
|
105
|
+
at the API. The bundle contains no secrets.
|
|
106
|
+
|
|
107
|
+
`docker compose up --build` runs the server side locally (PostgreSQL, migrate, server, worker) from `.env`. The image
|
|
108
|
+
builds from the npm registry, so it needs published Mayura packages; it does not include the chat UI.
|
|
109
|
+
|
|
110
|
+
## Know the limits
|
|
111
|
+
|
|
112
|
+
- **Chat runs are held in server memory.** A finished chat stays readable for five minutes (sooner released under load
|
|
113
|
+
once the browser has read the reply); a server restart forgets chats in flight. Capacity counts concurrent chats
|
|
114
|
+
(`src/server.ts`), and a busy server answers HTTP 429. Customer data is not affected: memory, returns and
|
|
115
|
+
follow-ups are durable in the database.
|
|
116
|
+
- **Streamed text is provisional.** The reply streams in batches, each checked by the PII backstop first; the
|
|
117
|
+
validated reply replaces it when the run completes. A batch the backstop blocks stops the stream for that answer,
|
|
118
|
+
and the reply then arrives whole (redacted). Released text cannot be taken back, so keep checks that must see every
|
|
119
|
+
character in the stream guards.
|
|
120
|
+
- **PII redaction is heuristic.** Card numbers (Luhn-checked), emails and 10 to 15 digit phone numbers are recognized;
|
|
121
|
+
unusual formats slip through and long digit strings can be flagged. Anything the redaction would still change in a
|
|
122
|
+
tool result or reply is withheld (the run ends `blocked`), which is safe but blunt.
|
|
123
|
+
- **The offline model is keyword rules.** It shows the tool-call protocol; it does not understand language.
|
|
124
|
+
- **The returns desk is simulated.** "Already open" is remembered per process; a real desk must be idempotent itself.
|
|
125
|
+
- **Operators act as the service.** Every operator token authenticates as the service scope; for per-person
|
|
126
|
+
attribution put your identity provider in front of the API. Operators cannot read customer chats.
|
|
127
|
+
- A failed write tool (a return or a note) ends the chat run as `outcome_unknown`: Mayura does not guess whether a
|
|
128
|
+
write happened. The customer is asked to check before retrying; both writes are idempotent.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Production-shaped local stack: PostgreSQL, a one-shot schema migration, the server and one worker.
|
|
2
|
+
# Put the TLS proxy of your choice in front of `server`; it must forward to port 8080 with the public origin's Host.
|
|
3
|
+
# cp .env.example .env # then fill in the operator token digest and the session secret
|
|
4
|
+
# docker compose up --build
|
|
5
|
+
services:
|
|
6
|
+
postgres:
|
|
7
|
+
image: postgres@sha256:f02121de6f74d30d8a94cd1d9584125e2178d7e6c377d8130112d4e52d867995
|
|
8
|
+
environment: { POSTGRES_USER: support, POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}", POSTGRES_DB: support }
|
|
9
|
+
volumes: [postgres-data:/var/lib/postgresql/data]
|
|
10
|
+
healthcheck: { test: ["CMD-SHELL", "pg_isready -U support -d support"], interval: 2s, timeout: 5s, retries: 30 }
|
|
11
|
+
migrate:
|
|
12
|
+
build: .
|
|
13
|
+
command: ["migrate", "--app", "dist/src/app.js"]
|
|
14
|
+
env_file: .env
|
|
15
|
+
environment: { DATABASE_URL: "postgres://support:${POSTGRES_PASSWORD}@postgres:5432/support" }
|
|
16
|
+
depends_on: { postgres: { condition: service_healthy } }
|
|
17
|
+
server:
|
|
18
|
+
build: .
|
|
19
|
+
command: ["serve", "--app", "dist/src/app.js"]
|
|
20
|
+
env_file: .env
|
|
21
|
+
environment: { DATABASE_URL: "postgres://support:${POSTGRES_PASSWORD}@postgres:5432/support" }
|
|
22
|
+
ports: ["8080:8080"]
|
|
23
|
+
depends_on: { migrate: { condition: service_completed_successfully } }
|
|
24
|
+
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 }
|
|
25
|
+
worker:
|
|
26
|
+
build: .
|
|
27
|
+
command: ["worker", "--app", "dist/src/app.js", "--probe-host", "0.0.0.0", "--probe-port", "9090"]
|
|
28
|
+
env_file: .env
|
|
29
|
+
environment: { DATABASE_URL: "postgres://support:${POSTGRES_PASSWORD}@postgres:5432/support" }
|
|
30
|
+
depends_on: { migrate: { condition: service_completed_successfully } }
|
|
31
|
+
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 }
|
|
32
|
+
volumes:
|
|
33
|
+
postgres-data:
|
|
@@ -0,0 +1,44 @@
|
|
|
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 a fresh operator token and session secret.
|
|
3
|
+
|
|
4
|
+
# development | production. Production requires MAYURA_PUBLIC_ORIGIN, an operator token digest and a session secret.
|
|
5
|
+
MAYURA_ENV=production
|
|
6
|
+
MAYURA_PUBLIC_ORIGIN=https://support.example.com
|
|
7
|
+
MAYURA_PROJECT=support
|
|
8
|
+
PORT=8080
|
|
9
|
+
MAYURA_BIND=0.0.0.0
|
|
10
|
+
# Comma-separated browser origins allowed to call the API. Not needed when the chat UI is served from
|
|
11
|
+
# MAYURA_PUBLIC_ORIGIN itself (same origin); list the UI's origin here if it lives elsewhere.
|
|
12
|
+
MAYURA_ALLOWED_ORIGINS=
|
|
13
|
+
|
|
14
|
+
# Storage: PostgreSQL when DATABASE_URL is set, otherwise SQLite at MAYURA_SQLITE_PATH (single node only).
|
|
15
|
+
# compose.yaml sets DATABASE_URL from POSTGRES_PASSWORD.
|
|
16
|
+
POSTGRES_PASSWORD=change-me
|
|
17
|
+
# MAYURA_SQLITE_PATH=.data/support.sqlite
|
|
18
|
+
|
|
19
|
+
# Operator bearer tokens: configure SHA-256 digests only. `npm run token` prints a new token and its digest.
|
|
20
|
+
# Comma-separate several digests to rotate without downtime.
|
|
21
|
+
MAYURA_OPERATOR_TOKEN_SHA256=
|
|
22
|
+
# Customer sessions: 32+ random bytes as hex (`npm run token` prints one as sessionSecret). The same value goes to your
|
|
23
|
+
# application backend, which signs sessions with mintSessionToken (src/session.ts). Never ship it to a browser.
|
|
24
|
+
MAYURA_SESSION_SECRET=
|
|
25
|
+
|
|
26
|
+
# Model: offline (default, rule-based, no network), openai, anthropic, or compatible (any OpenAI-compatible endpoint).
|
|
27
|
+
MAYURA_MODEL_PROVIDER=offline
|
|
28
|
+
# OPENAI_API_KEY=
|
|
29
|
+
# ANTHROPIC_API_KEY=
|
|
30
|
+
# For compatible: the chat-completions URL, a short id for the provider, and its key (Azure OpenAI uses MAYURA_MODEL_AUTH=api-key).
|
|
31
|
+
# MAYURA_MODEL_ENDPOINT=https://api.groq.com/openai/v1/chat/completions
|
|
32
|
+
# MAYURA_MODEL_PROVIDER_ID=groq
|
|
33
|
+
# MAYURA_MODEL_AUTH=bearer
|
|
34
|
+
# MAYURA_MODEL_API_KEY=
|
|
35
|
+
# MAYURA_MODEL=
|
|
36
|
+
# Prices in micro-dollars per million tokens, and the most one call and one run may cost.
|
|
37
|
+
# MAYURA_MODEL_INPUT_MICROS_PER_MILLION_TOKENS=
|
|
38
|
+
# MAYURA_MODEL_OUTPUT_MICROS_PER_MILLION_TOKENS=
|
|
39
|
+
# MAYURA_MODEL_MAX_CALL_COST_MICROS=
|
|
40
|
+
# MAYURA_MAX_RUN_COST_MICROS=
|
|
41
|
+
|
|
42
|
+
# Hours after a return is opened before the customer is reminded to ship it (0 to 2160).
|
|
43
|
+
RETURN_REMINDER_HOURS=72
|
|
44
|
+
# 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,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "mayura.project.v1",
|
|
3
|
+
"name": "support-agent",
|
|
4
|
+
"template": "support-agent",
|
|
5
|
+
"definitions": [
|
|
6
|
+
{ "kind": "agent", "id": "support.assistant", "version": "1", "source": "src/assistant.ts" },
|
|
7
|
+
{ "kind": "workflow", "id": "returns.follow-up", "version": "1", "source": "src/returns.ts" }
|
|
8
|
+
],
|
|
9
|
+
"tools": [
|
|
10
|
+
{ "id": "orders.list", "version": "1", "effects": "read", "capabilities": [] },
|
|
11
|
+
{ "id": "orders.track", "version": "1", "effects": "read", "capabilities": [] },
|
|
12
|
+
{ "id": "returns.start", "version": "1", "effects": "write", "capabilities": ["returns:start"] },
|
|
13
|
+
{ "id": "memory.remember", "version": "1", "effects": "write", "capabilities": ["memory:write"] },
|
|
14
|
+
{ "id": "memory.recall", "version": "1", "effects": "read", "capabilities": ["memory:read"] },
|
|
15
|
+
{ "id": "returns.schedule", "version": "1", "effects": "none", "capabilities": [] },
|
|
16
|
+
{ "id": "returns.remind", "version": "1", "effects": "write", "capabilities": ["customers:notify"] }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mayura-starter-support-agent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Customer support chat on Mayura: a streaming agent with order tools scoped to the signed-in customer, per-customer native memory, PII redaction, a React chat UI and the operator console.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12.0 <23 || >=24.14.1 <25"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -p tsconfig.json && vite build web",
|
|
12
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p web/tsconfig.json",
|
|
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
|
+
"@tailwindcss/vite": "4.3.3",
|
|
28
|
+
"@types/node": "24.13.6",
|
|
29
|
+
"@types/react": "19.3.0",
|
|
30
|
+
"@types/react-dom": "19.3.0",
|
|
31
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
32
|
+
"class-variance-authority": "0.7.1",
|
|
33
|
+
"clsx": "2.1.1",
|
|
34
|
+
"lucide-react": "1.48.0",
|
|
35
|
+
"radix-ui": "1.6.7",
|
|
36
|
+
"react": "19.3.0",
|
|
37
|
+
"react-dom": "19.3.0",
|
|
38
|
+
"tailwind-merge": "3.7.0",
|
|
39
|
+
"tailwindcss": "4.3.3",
|
|
40
|
+
"typescript": "7.0.2",
|
|
41
|
+
"vite": "8.3.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -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 { createFollowUpWorker } 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 createFollowUpWorker(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
|
+
});
|