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 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAqC,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,WAAW,EAA2B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EACE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAajI,SAAS,KAAK,CAAC,KAAyB,EAAE,QAAgB;IACxD,MAAM,QAAQ,GAAG,KAAK,IAAI,QAAQ,CAAC;IACnC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;IACnK,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAyB;IACrF,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAAC,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAAC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC5I,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM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AC,QAAQ,EAAE,IAAI,EAAE,eAAe,CAAC,EAC9C,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAC7G,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAC9F,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,qBAAqB,EAAE,aAAa,EAAE,EAAE,QAAQ,CAAC,EACxI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,6BAA6B,CAAC,CAAC,CAAC;AACpI,CAAC","sourcesContent":["import { createElement, useCallback, useEffect, useRef, useState, type FormEvent, type ReactElement } from 'react';\nimport { ClientError, type RemoteHumanRequest } from '@mayura/client';\nimport { validateHumanResponse, type HumanResponseCommandState, type HumanResponseField, type HumanResponseFormDefinition,\n type HumanResponseSubmission } from '@mayura/client/forms';\nimport type { HeadlessRunStore } from '@mayura/client/headless';\nimport type { WorkflowCommandState, WorkflowViewInput } from '@mayura/client/workflows';\nimport { MayuraReactError, useMayuraHumanRequest, useMayuraRun, useMayuraRunActivity, useMayuraWorkflowGraph } from './index.js';\n\nexport interface MayuraRunSummaryProps { readonly store: HeadlessRunStore; readonly label?: string }\nexport interface MayuraWorkflowGraphProps { readonly input: WorkflowViewInput; readonly label?: string }\nexport interface MayuraHumanRequestCardProps {\n readonly request: RemoteHumanRequest; readonly nowMs: number; readonly label?: string;\n readonly onRespond?: (request: { readonly id: string; readonly digest: string }) => void;\n}\nexport interface MayuraHumanResponseFormProps {\n readonly request: RemoteHumanRequest; readonly definition: HumanResponseFormDefinition; readonly nowMs: number;\n readonly label?: string; readonly submitText?: string; readonly commandState?: HumanResponseCommandState;\n readonly onSubmit: (submission: HumanResponseSubmission) => void;\n}\nfunction label(value: string | undefined, fallback: string): string {\n const selected = value ?? fallback;\n if (typeof selected !== 'string' || selected.length < 1 || selected.length > 128 || selected.includes('\\0')) throw new MayuraReactError('INVALID_COMPONENT_PROPS');\n return selected;\n}\n\n/** Accessible run summary over one caller-owned store. Rendering starts no remote operation. */\nexport function MayuraRunSummary({ store, label: suppliedLabel }: MayuraRunSummaryProps): ReactElement {\n const state = useMayuraRun(store); const activity = useMayuraRunActivity(state); const accessibleLabel = label(suppliedLabel, 'Run status');\n const status = state.snapshot?.status ?? state.connection;\n const items = activity.items.length === 0\n ? createElement('p', { 'data-mayura-empty': true }, 'No activity recorded')\n : createElement('ol', { 'aria-label': 'Run activity' }, activity.items.map(item => createElement('li', {\n key: item.id, 'data-kind': item.kind, 'data-status': item.status,\n }, `${item.label}: ${item.status}`)));\n return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'run-summary' },\n createElement('p', { role: 'status', 'aria-live': 'polite' }, `Run ${status}`), items);\n}\n\n/** Accessible ordered representation of a validated durable DAG; it performs no layout or command. */\nexport function MayuraWorkflowGraph({ input, label: suppliedLabel }: MayuraWorkflowGraphProps): ReactElement {\n const graph = useMayuraWorkflowGraph(input); const accessibleLabel = label(suppliedLabel, 'Workflow progress');\n const dependencies = new Map<string, string[]>();\n for (const edge of graph.edges) { const list = dependencies.get(edge.to) ?? []; list.push(edge.from); dependencies.set(edge.to, list); }\n return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'workflow-graph' },\n createElement('p', { role: 'status', 'aria-live': 'polite' }, `${graph.progress.terminal} of ${graph.progress.total} steps terminal`),\n createElement('ol', { 'aria-label': 'Workflow steps' }, graph.nodes.map(node => {\n const parents = dependencies.get(node.id) ?? [];\n return createElement('li', { key: node.id, 'data-kind': node.kind, 'data-status': node.status, 'data-depth': node.depth },\n createElement('span', null, `${node.id}: ${node.status}`),\n parents.length > 0 ? createElement('span', null, `; depends on ${parents.join(', ')}`) : null,\n node.childRunId !== null ? createElement('span', null, '; required child attached') : null);\n })));\n}\n\n/** Text-only request presentation. The optional callback is invoked only by the explicit button event. */\nexport function MayuraHumanRequestCard({ request, nowMs, label: suppliedLabel, onRespond }: MayuraHumanRequestCardProps): ReactElement {\n const view = useMayuraHumanRequest(request, nowMs); const accessibleLabel = label(suppliedLabel, 'Human request');\n const respond = useCallback(() => { onRespond?.(Object.freeze({ id: request.id, digest: request.digest })); }, [onRespond, request.id, request.digest]);\n const action = view.canRespond && onRespond !== undefined\n ? createElement('button', { type: 'button', onClick: respond }, view.actionText)\n : null;\n return createElement('article', { 'aria-label': accessibleLabel, 'data-mayura-component': 'human-request' },\n createElement('p', { 'data-mayura-prompt': true }, view.prompt),\n createElement('p', { role: 'status', 'aria-live': 'polite' }, view.statusText), action);\n}\n\nexport interface MayuraWorkflowPauseControlProps {\n readonly workflow: WorkflowViewInput; readonly commandState?: WorkflowCommandState; readonly label?: string;\n /** Distinguishes otherwise identical buttons for assistive technology, e.g. \"run 7d2ddd96\" gives \"Pause workflow for run 7d2ddd96\". */\n readonly subject?: string;\n readonly onPause?: (target: { readonly runId: string; readonly revision: number }) => void;\n readonly onResume?: (target: { readonly runId: string; readonly revision: number }) => void;\n}\n/** Explicit per-run pause/resume intent. Mounting performs no request; the application routes each event to its command controller. */\nexport function MayuraWorkflowPauseControl({ workflow, commandState, label: suppliedLabel, subject, onPause, onResume }: MayuraWorkflowPauseControlProps): ReactElement {\n const accessibleLabel = label(suppliedLabel, 'Workflow pause control'); const subjectText = subject === undefined ? undefined : label(subject, 'workflow');\n if (commandState !== undefined && (!Object.isFrozen(commandState) || commandState.runId !== workflow.runId)) throw new MayuraReactError('INVALID_COMPONENT_PROPS');\n // Feedback describes one revision; once the view has moved on (another operator, a fleet sweep) it is stale and hidden.\n const current = commandState !== undefined && (commandState.status === 'submitting' || commandState.workflowRevision === workflow.revision);\n const status = current ? commandState!.status : 'idle'; const busy = status === 'submitting' || status === 'disposed';\n const pausable = ['running', 'waiting'].includes(workflow.status) && onPause !== undefined;\n const resumable = workflow.status === 'paused' && onResume !== undefined;\n const target = Object.freeze({ runId: workflow.runId, revision: workflow.revision });\n const act = useCallback(() => {\n // aria-disabled keeps focus on the control while a command is in flight; the handler itself enforces the lock.\n if (busy) return;\n if (pausable) onPause!(target); else if (resumable) onResume!(target);\n }, [busy, pausable, resumable, onPause, onResume, target.runId, target.revision]);\n const action = current ? commandState!.action : null;\n const feedback = status === 'submitting' ? (action === 'pause' ? 'Pausing workflow' : action === 'resume' ? 'Resuming workflow' : 'Command in progress')\n : status === 'succeeded' ? (action === 'pause' ? 'Pause applied' : action === 'resume' ? 'Resume requested' : 'Command applied')\n : status === 'conflict' ? 'Workflow changed or has an effect in flight; refresh before retrying'\n : status === 'failed' ? 'Command outcome unknown; refresh before retrying'\n : status === 'disposed' ? 'Command controller closed' : null;\n return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'workflow-pause-control', 'aria-busy': status === 'submitting' },\n createElement('p', { role: 'status', 'aria-live': 'polite', 'data-workflow-status': workflow.status, 'data-command-status': status },\n feedback === null ? `Workflow ${workflow.status}` : `Workflow ${workflow.status}. ${feedback}`),\n pausable || resumable ? createElement('button', { key: 'action', type: 'button', onClick: act, 'aria-disabled': busy,\n 'data-action': pausable ? 'pause' : 'resume',\n ...(subjectText === undefined ? {} : { 'aria-label': `${pausable ? 'Pause workflow' : 'Resume workflow'} for ${subjectText}` }) },\n pausable ? 'Pause workflow' : 'Resume workflow') : null);\n}\n\nexport interface MayuraFleetHoldControlProps {\n readonly fleet: { readonly held: boolean; readonly generation: number; readonly changedAtMs: number | null };\n readonly status?: 'idle' | 'submitting' | 'succeeded' | 'conflict' | 'failed'; readonly label?: string;\n readonly onHold?: () => void; readonly onRelease?: () => void;\n}\n/** Fleet hold/release intent with a two-step confirmation before holding every run in the scope. */\nexport function MayuraFleetHoldControl({ fleet, status = 'idle', label: suppliedLabel, onHold, onRelease }: MayuraFleetHoldControlProps): ReactElement {\n const accessibleLabel = label(suppliedLabel, 'Fleet hold control'); const [confirming, setConfirming] = useState(false);\n const primary = useRef<HTMLButtonElement | null>(null); const wasConfirming = useRef(false);\n // Return focus to the primary action when the confirmation closes, so keyboard users are not dropped to the page body.\n useEffect(() => { if (wasConfirming.current && !confirming) primary.current?.focus(); wasConfirming.current = confirming; }, [confirming]);\n if (!fleet || typeof fleet.held !== 'boolean' || !Number.isSafeInteger(fleet.generation) || fleet.generation < 0\n || !['idle', 'submitting', 'succeeded', 'conflict', 'failed'].includes(status)) throw new MayuraReactError('INVALID_COMPONENT_PROPS');\n const busy = status === 'submitting';\n const request = useCallback(() => { if (!busy) setConfirming(true); }, [busy]);\n const cancel = useCallback(() => { setConfirming(false); }, []);\n const confirm = useCallback(() => { if (busy) return; setConfirming(false); onHold?.(); }, [busy, onHold]);\n const release = useCallback(() => { if (!busy) onRelease?.(); }, [busy, onRelease]);\n const summary = fleet.held ? `Fleet held (generation ${fleet.generation}); hosts and coordinators drive no runs` : 'Fleet running';\n const feedback = status === 'submitting' ? 'Updating fleet hold' : status === 'conflict' ? 'Fleet state changed; refresh before retrying'\n : status === 'failed' ? 'Fleet command outcome unknown; refresh before retrying' : null;\n const actions = fleet.held\n ? (onRelease === undefined ? null : createElement('button', { key: 'primary', ref: primary, type: 'button', onClick: release, 'aria-disabled': busy }, 'Release fleet hold'))\n : onHold === undefined ? null : confirming\n ? createElement('div', { key: 'confirm', role: 'group', 'aria-label': 'Confirm fleet hold' },\n createElement('p', { id: 'mayura-fleet-hold-warning' }, 'Holding stops every host and coordinator in this scope from driving runs.'),\n createElement('button', { type: 'button', onClick: confirm, 'aria-disabled': busy, 'aria-describedby': 'mayura-fleet-hold-warning', autoFocus: true }, 'Confirm hold'),\n createElement('button', { type: 'button', onClick: cancel }, 'Cancel'))\n : createElement('button', { key: 'primary', ref: primary, type: 'button', onClick: request, 'aria-disabled': busy }, 'Hold fleet');\n return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'fleet-hold-control', 'aria-busy': busy },\n createElement('p', { role: 'status', 'aria-live': 'polite', 'data-fleet-held': fleet.held, 'data-command-status': status },\n feedback === null ? summary : `${summary}. ${feedback}`), actions);\n}\n\nfunction fieldControl(field: HumanResponseField): ReactElement {\n const common = { name: field.name, required: field.required, 'aria-label': field.label };\n if (field.kind === 'textarea') return createElement('textarea', { ...common, minLength: field.minLength, maxLength: field.maxLength });\n if (field.kind === 'text') return createElement('input', { ...common, type: 'text', minLength: field.minLength, maxLength: field.maxLength });\n if (field.kind === 'number' || field.kind === 'integer') return createElement('input', {\n ...common, type: 'number', min: field.minimum, max: field.maximum, step: field.kind === 'integer' ? 1 : 'any',\n });\n if (field.kind === 'boolean') return createElement('input', { ...common, type: 'checkbox' });\n if (field.kind !== 'select') throw new MayuraReactError('INVALID_COMPONENT_PROPS');\n return createElement('select', common,\n createElement('option', { value: '' }, 'Select an option'),\n field.options.map(option => createElement('option', { key: option.value, value: option.value }, option.label)));\n}\n\n/** Schema-bound uncontrolled form. Validation and the application callback run only on an explicit submit event. */\nexport function MayuraHumanResponseForm({ request, definition, nowMs, label: suppliedLabel, submitText, commandState, onSubmit }: MayuraHumanResponseFormProps): ReactElement {\n const view = useMayuraHumanRequest(request, nowMs); const accessibleLabel = label(suppliedLabel, 'Human response');\n const actionText = label(submitText, 'Submit response'); const [errorCode, setErrorCode] = useState<string | null>(null);\n if (commandState !== undefined && (!Object.isFrozen(commandState) || commandState.requestId !== request.id || commandState.requestDigest !== request.digest))\n throw new MayuraReactError('INVALID_COMPONENT_PROPS');\n const commandStatus = commandState?.status ?? 'idle'; const locked = ['submitting', 'succeeded', 'conflict', 'disposed'].includes(commandStatus);\n const submit = useCallback((event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n if (!view.canRespond || locked) { setErrorCode('INVALID_FORM_VALUE'); return; }\n const data = new FormData(event.currentTarget); const draft: Record<string, string | boolean> = Object.create(null) as Record<string, string | boolean>;\n for (const field of definition.fields) {\n if (field.kind === 'boolean') { draft[field.name] = data.has(field.name); continue; }\n const value = data.get(field.name); if (typeof value === 'string') draft[field.name] = value;\n }\n let submission: HumanResponseSubmission;\n try { submission = validateHumanResponse(request, definition, Object.freeze(draft)); }\n catch (error) { if (error instanceof ClientError) { setErrorCode(error.code); return; } throw error; }\n setErrorCode(null); onSubmit(submission);\n }, [definition, locked, onSubmit, request, view.canRespond]);\n const feedback = commandStatus === 'submitting' ? 'Submitting response' : commandStatus === 'succeeded' ? 'Response submitted'\n : commandStatus === 'conflict' ? 'Request changed; refresh required' : commandStatus === 'failed' ? 'Response submission failed'\n : commandStatus === 'disposed' ? 'Response controller disposed' : null;\n return createElement('form', { 'aria-label': accessibleLabel, 'data-mayura-component': 'human-response-form', onSubmit: submit },\n createElement('p', { 'data-mayura-prompt': true }, view.prompt),\n createElement('fieldset', { disabled: !view.canRespond || locked },\n createElement('legend', null, accessibleLabel),\n definition.fields.map(field => createElement('label', { key: field.name }, field.label, fieldControl(field))),\n view.canRespond && !locked ? createElement('button', { type: 'submit' }, actionText) : null),\n feedback === null ? null : createElement('p', { role: 'status', 'aria-live': 'polite', 'data-command-status': commandStatus }, feedback),\n errorCode === null ? null : createElement('p', { role: 'alert', 'data-error-code': errorCode }, 'Response values are invalid'));\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type HeadlessRunState, type HeadlessRunStore, type HumanRequestView, type RunActivityProjection } from '../../client/dist/headless.js';
|
|
2
|
+
import type { RemoteHumanRequest } from '../../client/dist/index.js';
|
|
3
|
+
import type { HumanResponseCommandState, HumanResponseController } from '../../client/dist/forms.js';
|
|
4
|
+
import { type WorkflowCommandController, type WorkflowCommandState, type WorkflowGraphProjection, type WorkflowViewInput } from '../../client/dist/workflows.js';
|
|
5
|
+
export interface MayuraRunActions {
|
|
6
|
+
readonly refresh: HeadlessRunStore['refresh'];
|
|
7
|
+
readonly observe: HeadlessRunStore['observe'];
|
|
8
|
+
readonly cancel: HeadlessRunStore['cancel'];
|
|
9
|
+
}
|
|
10
|
+
export declare class MayuraReactError extends Error {
|
|
11
|
+
readonly code: 'INVALID_REACT_STORE' | 'INVALID_RESPONSE_CONTROLLER' | 'INVALID_WORKFLOW_CONTROLLER' | 'INVALID_COMPONENT_PROPS';
|
|
12
|
+
readonly name = "MayuraReactError";
|
|
13
|
+
constructor(code: 'INVALID_REACT_STORE' | 'INVALID_RESPONSE_CONTROLLER' | 'INVALID_WORKFLOW_CONTROLLER' | 'INVALID_COMPONENT_PROPS');
|
|
14
|
+
}
|
|
15
|
+
/** Subscribe to caller-owned human command state without submitting, retrying or starting any effect. */
|
|
16
|
+
export declare function useMayuraHumanResponseCommand(controller: HumanResponseController): HumanResponseCommandState;
|
|
17
|
+
/** Subscribe to caller-owned workflow command state without reading or mutating on mount. */
|
|
18
|
+
export declare function useMayuraWorkflowCommand(controller: WorkflowCommandController): WorkflowCommandState;
|
|
19
|
+
/** Subscribe to one caller-owned headless store. This hook starts no reads, streams, timers or commands. */
|
|
20
|
+
export declare function useMayuraRun(value: HeadlessRunStore): HeadlessRunState;
|
|
21
|
+
/** Stable explicit actions for event handlers. Observation and cancellation are never invoked by an effect. */
|
|
22
|
+
export declare function useMayuraRunActions(value: HeadlessRunStore): MayuraRunActions;
|
|
23
|
+
/** Derive text-only human request metadata during render without copying it into component state. */
|
|
24
|
+
export declare function useMayuraHumanRequest(request: RemoteHumanRequest, nowMs: number): HumanRequestView;
|
|
25
|
+
/** Derive a stable, content-free activity timeline from the current bounded run state. */
|
|
26
|
+
export declare function useMayuraRunActivity(state: HeadlessRunState): RunActivityProjection;
|
|
27
|
+
/** Validate and memoize one content-free durable workflow DAG supplied by an authenticated application adapter. */
|
|
28
|
+
export declare function useMayuraWorkflowGraph(input: WorkflowViewInput): WorkflowGraphProjection;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAuD,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAC/H,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAiC,KAAK,yBAAyB,EAAE,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAC7H,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CAC7C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IAE7B,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,6BAA6B,GAAG,6BAA6B,GAAG,yBAAyB;IAD5I,SAAkB,IAAI,sBAAsB;IAC5C,YAAqB,IAAI,EAAE,qBAAqB,GAAG,6BAA6B,GAAG,6BAA6B,GAAG,yBAAyB,EAE3I;CACF;AAED,yGAAyG;AACzG,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,uBAAuB,GAAG,yBAAyB,CAK5G;AAED,6FAA6F;AAC7F,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,yBAAyB,GAAG,oBAAoB,CAMpG;AAQD,4GAA4G;AAC5G,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAGtE;AAED,+GAA+G;AAC/G,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAG7E;AAED,qGAAqG;AACrG,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAElG;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,qBAAqB,CAEnF;AAED,mHAAmH;AACnH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,uBAAuB,CAExF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { useMemo, useSyncExternalStore } from 'react';
|
|
2
|
+
import { createHumanRequestView, createRunActivityProjection } from '../../client/dist/headless.js';
|
|
3
|
+
import { createWorkflowGraphProjection } from '../../client/dist/workflows.js';
|
|
4
|
+
export class MayuraReactError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
name = 'MayuraReactError';
|
|
7
|
+
constructor(code) {
|
|
8
|
+
super(`Mayura React binding failed (${code}).`);
|
|
9
|
+
this.code = code;
|
|
10
|
+
Object.freeze(this);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Subscribe to caller-owned human command state without submitting, retrying or starting any effect. */
|
|
14
|
+
export function useMayuraHumanResponseCommand(controller) {
|
|
15
|
+
if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'
|
|
16
|
+
|| typeof controller.submit !== 'function' || typeof controller.reset !== 'function' || typeof controller.dispose !== 'function')
|
|
17
|
+
throw new MayuraReactError('INVALID_RESPONSE_CONTROLLER');
|
|
18
|
+
return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
19
|
+
}
|
|
20
|
+
/** Subscribe to caller-owned workflow command state without reading or mutating on mount. */
|
|
21
|
+
export function useMayuraWorkflowCommand(controller) {
|
|
22
|
+
if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'
|
|
23
|
+
|| typeof controller.cancel !== 'function' || typeof controller.approve !== 'function' || typeof controller.signal !== 'function'
|
|
24
|
+
|| typeof controller.resume !== 'function' || typeof controller.pause !== 'function' || typeof controller.reset !== 'function'
|
|
25
|
+
|| typeof controller.dispose !== 'function')
|
|
26
|
+
throw new MayuraReactError('INVALID_WORKFLOW_CONTROLLER');
|
|
27
|
+
return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
28
|
+
}
|
|
29
|
+
function store(value) {
|
|
30
|
+
if (!value || typeof value.getSnapshot !== 'function' || typeof value.subscribe !== 'function' || typeof value.refresh !== 'function'
|
|
31
|
+
|| typeof value.observe !== 'function' || typeof value.cancel !== 'function')
|
|
32
|
+
throw new MayuraReactError('INVALID_REACT_STORE');
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
/** Subscribe to one caller-owned headless store. This hook starts no reads, streams, timers or commands. */
|
|
36
|
+
export function useMayuraRun(value) {
|
|
37
|
+
const selected = store(value);
|
|
38
|
+
return useSyncExternalStore(selected.subscribe, selected.getSnapshot, selected.getSnapshot);
|
|
39
|
+
}
|
|
40
|
+
/** Stable explicit actions for event handlers. Observation and cancellation are never invoked by an effect. */
|
|
41
|
+
export function useMayuraRunActions(value) {
|
|
42
|
+
const selected = store(value);
|
|
43
|
+
return useMemo(() => Object.freeze({ refresh: selected.refresh, observe: selected.observe, cancel: selected.cancel }), [selected]);
|
|
44
|
+
}
|
|
45
|
+
/** Derive text-only human request metadata during render without copying it into component state. */
|
|
46
|
+
export function useMayuraHumanRequest(request, nowMs) {
|
|
47
|
+
return useMemo(() => createHumanRequestView(request, nowMs), [request, nowMs]);
|
|
48
|
+
}
|
|
49
|
+
/** Derive a stable, content-free activity timeline from the current bounded run state. */
|
|
50
|
+
export function useMayuraRunActivity(state) {
|
|
51
|
+
return useMemo(() => createRunActivityProjection(state), [state]);
|
|
52
|
+
}
|
|
53
|
+
/** Validate and memoize one content-free durable workflow DAG supplied by an authenticated application adapter. */
|
|
54
|
+
export function useMayuraWorkflowGraph(input) {
|
|
55
|
+
return useMemo(() => createWorkflowGraphProjection(input), [input]);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAC9B,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,6BAA6B,EACZ,MAAM,0BAA0B,CAAC;AAQ3D,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAEpB,IAAI;IADP,IAAI,GAAG,kBAAkB,CAAC;IAC5C,YAAqB,IAAuH;QAC1I,KAAK,CAAC,gCAAgC,IAAI,IAAI,CAAC,CAAC;oBAD7B,IAAI;QAC0B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvE,CAAC;CACF;AAED,yGAAyG;AACzG,MAAM,UAAU,6BAA6B,CAAC,UAAmC;IAC/E,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,UAAU,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,UAAU;WACxG,OAAO,UAAU,CAAC,MAAM,KAAK,UAAU,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,UAAU;QAChI,MAAM,IAAI,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;IAC5D,OAAO,oBAAoB,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC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AC9F,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,mBAAmB,CAAC,KAAuB;IACzD,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrI,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,qBAAqB,CAAC,OAA2B,EAAE,KAAa;IAC9E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AACjF,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB,CAAC,KAAuB;IAC1D,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,2BAA2B,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,sBAAsB,CAAC,KAAwB;IAC7D,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACtE,CAAC","sourcesContent":["import { useMemo, useSyncExternalStore } from 'react';\nimport { createHumanRequestView, createRunActivityProjection, type HeadlessRunState, type HeadlessRunStore, type HumanRequestView,\n type RunActivityProjection } from '@mayura/client/headless';\nimport type { RemoteHumanRequest } from '@mayura/client';\nimport type { HumanResponseCommandState, HumanResponseController } from '@mayura/client/forms';\nimport { createWorkflowGraphProjection, type WorkflowCommandController, type WorkflowCommandState, type WorkflowGraphProjection,\n type WorkflowViewInput } from '@mayura/client/workflows';\n\nexport interface MayuraRunActions {\n readonly refresh: HeadlessRunStore['refresh'];\n readonly observe: HeadlessRunStore['observe'];\n readonly cancel: HeadlessRunStore['cancel'];\n}\n\nexport class MayuraReactError extends Error {\n override readonly name = 'MayuraReactError';\n constructor(readonly code: 'INVALID_REACT_STORE' | 'INVALID_RESPONSE_CONTROLLER' | 'INVALID_WORKFLOW_CONTROLLER' | 'INVALID_COMPONENT_PROPS') {\n super(`Mayura React binding failed (${code}).`); Object.freeze(this);\n }\n}\n\n/** Subscribe to caller-owned human command state without submitting, retrying or starting any effect. */\nexport function useMayuraHumanResponseCommand(controller: HumanResponseController): HumanResponseCommandState {\n if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'\n || typeof controller.submit !== 'function' || typeof controller.reset !== 'function' || typeof controller.dispose !== 'function')\n throw new MayuraReactError('INVALID_RESPONSE_CONTROLLER');\n return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);\n}\n\n/** Subscribe to caller-owned workflow command state without reading or mutating on mount. */\nexport function useMayuraWorkflowCommand(controller: WorkflowCommandController): WorkflowCommandState {\n if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'\n || typeof controller.cancel !== 'function' || typeof controller.approve !== 'function' || typeof controller.signal !== 'function'\n || typeof controller.resume !== 'function' || typeof controller.pause !== 'function' || typeof controller.reset !== 'function'\n || typeof controller.dispose !== 'function') throw new MayuraReactError('INVALID_WORKFLOW_CONTROLLER');\n return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);\n}\n\nfunction store(value: HeadlessRunStore): HeadlessRunStore {\n if (!value || typeof value.getSnapshot !== 'function' || typeof value.subscribe !== 'function' || typeof value.refresh !== 'function'\n || typeof value.observe !== 'function' || typeof value.cancel !== 'function') throw new MayuraReactError('INVALID_REACT_STORE');\n return value;\n}\n\n/** Subscribe to one caller-owned headless store. This hook starts no reads, streams, timers or commands. */\nexport function useMayuraRun(value: HeadlessRunStore): HeadlessRunState {\n const selected = store(value);\n return useSyncExternalStore(selected.subscribe, selected.getSnapshot, selected.getSnapshot);\n}\n\n/** Stable explicit actions for event handlers. Observation and cancellation are never invoked by an effect. */\nexport function useMayuraRunActions(value: HeadlessRunStore): MayuraRunActions {\n const selected = store(value);\n return useMemo(() => Object.freeze({ refresh: selected.refresh, observe: selected.observe, cancel: selected.cancel }), [selected]);\n}\n\n/** Derive text-only human request metadata during render without copying it into component state. */\nexport function useMayuraHumanRequest(request: RemoteHumanRequest, nowMs: number): HumanRequestView {\n return useMemo(() => createHumanRequestView(request, nowMs), [request, nowMs]);\n}\n\n/** Derive a stable, content-free activity timeline from the current bounded run state. */\nexport function useMayuraRunActivity(state: HeadlessRunState): RunActivityProjection {\n return useMemo(() => createRunActivityProjection(state), [state]);\n}\n\n/** Validate and memoize one content-free durable workflow DAG supplied by an authenticated application adapter. */\nexport function useMayuraWorkflowGraph(input: WorkflowViewInput): WorkflowGraphProjection {\n return useMemo(() => createWorkflowGraphProjection(input), [input]);\n}\n"]}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { createElement, useCallback, useEffect, useRef, useState, type FormEvent, type ReactElement } from 'react';
|
|
2
|
+
import { ClientError, type RemoteHumanRequest } from '@mayura/client';
|
|
3
|
+
import { validateHumanResponse, type HumanResponseCommandState, type HumanResponseField, type HumanResponseFormDefinition,
|
|
4
|
+
type HumanResponseSubmission } from '@mayura/client/forms';
|
|
5
|
+
import type { HeadlessRunStore } from '@mayura/client/headless';
|
|
6
|
+
import type { WorkflowCommandState, WorkflowViewInput } from '@mayura/client/workflows';
|
|
7
|
+
import { MayuraReactError, useMayuraHumanRequest, useMayuraRun, useMayuraRunActivity, useMayuraWorkflowGraph } from './index.js';
|
|
8
|
+
|
|
9
|
+
export interface MayuraRunSummaryProps { readonly store: HeadlessRunStore; readonly label?: string }
|
|
10
|
+
export interface MayuraWorkflowGraphProps { readonly input: WorkflowViewInput; readonly label?: string }
|
|
11
|
+
export interface MayuraHumanRequestCardProps {
|
|
12
|
+
readonly request: RemoteHumanRequest; readonly nowMs: number; readonly label?: string;
|
|
13
|
+
readonly onRespond?: (request: { readonly id: string; readonly digest: string }) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface MayuraHumanResponseFormProps {
|
|
16
|
+
readonly request: RemoteHumanRequest; readonly definition: HumanResponseFormDefinition; readonly nowMs: number;
|
|
17
|
+
readonly label?: string; readonly submitText?: string; readonly commandState?: HumanResponseCommandState;
|
|
18
|
+
readonly onSubmit: (submission: HumanResponseSubmission) => void;
|
|
19
|
+
}
|
|
20
|
+
function label(value: string | undefined, fallback: string): string {
|
|
21
|
+
const selected = value ?? fallback;
|
|
22
|
+
if (typeof selected !== 'string' || selected.length < 1 || selected.length > 128 || selected.includes('\0')) throw new MayuraReactError('INVALID_COMPONENT_PROPS');
|
|
23
|
+
return selected;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Accessible run summary over one caller-owned store. Rendering starts no remote operation. */
|
|
27
|
+
export function MayuraRunSummary({ store, label: suppliedLabel }: MayuraRunSummaryProps): ReactElement {
|
|
28
|
+
const state = useMayuraRun(store); const activity = useMayuraRunActivity(state); const accessibleLabel = label(suppliedLabel, 'Run status');
|
|
29
|
+
const status = state.snapshot?.status ?? state.connection;
|
|
30
|
+
const items = activity.items.length === 0
|
|
31
|
+
? createElement('p', { 'data-mayura-empty': true }, 'No activity recorded')
|
|
32
|
+
: createElement('ol', { 'aria-label': 'Run activity' }, activity.items.map(item => createElement('li', {
|
|
33
|
+
key: item.id, 'data-kind': item.kind, 'data-status': item.status,
|
|
34
|
+
}, `${item.label}: ${item.status}`)));
|
|
35
|
+
return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'run-summary' },
|
|
36
|
+
createElement('p', { role: 'status', 'aria-live': 'polite' }, `Run ${status}`), items);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Accessible ordered representation of a validated durable DAG; it performs no layout or command. */
|
|
40
|
+
export function MayuraWorkflowGraph({ input, label: suppliedLabel }: MayuraWorkflowGraphProps): ReactElement {
|
|
41
|
+
const graph = useMayuraWorkflowGraph(input); const accessibleLabel = label(suppliedLabel, 'Workflow progress');
|
|
42
|
+
const dependencies = new Map<string, string[]>();
|
|
43
|
+
for (const edge of graph.edges) { const list = dependencies.get(edge.to) ?? []; list.push(edge.from); dependencies.set(edge.to, list); }
|
|
44
|
+
return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'workflow-graph' },
|
|
45
|
+
createElement('p', { role: 'status', 'aria-live': 'polite' }, `${graph.progress.terminal} of ${graph.progress.total} steps terminal`),
|
|
46
|
+
createElement('ol', { 'aria-label': 'Workflow steps' }, graph.nodes.map(node => {
|
|
47
|
+
const parents = dependencies.get(node.id) ?? [];
|
|
48
|
+
return createElement('li', { key: node.id, 'data-kind': node.kind, 'data-status': node.status, 'data-depth': node.depth },
|
|
49
|
+
createElement('span', null, `${node.id}: ${node.status}`),
|
|
50
|
+
parents.length > 0 ? createElement('span', null, `; depends on ${parents.join(', ')}`) : null,
|
|
51
|
+
node.childRunId !== null ? createElement('span', null, '; required child attached') : null);
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Text-only request presentation. The optional callback is invoked only by the explicit button event. */
|
|
56
|
+
export function MayuraHumanRequestCard({ request, nowMs, label: suppliedLabel, onRespond }: MayuraHumanRequestCardProps): ReactElement {
|
|
57
|
+
const view = useMayuraHumanRequest(request, nowMs); const accessibleLabel = label(suppliedLabel, 'Human request');
|
|
58
|
+
const respond = useCallback(() => { onRespond?.(Object.freeze({ id: request.id, digest: request.digest })); }, [onRespond, request.id, request.digest]);
|
|
59
|
+
const action = view.canRespond && onRespond !== undefined
|
|
60
|
+
? createElement('button', { type: 'button', onClick: respond }, view.actionText)
|
|
61
|
+
: null;
|
|
62
|
+
return createElement('article', { 'aria-label': accessibleLabel, 'data-mayura-component': 'human-request' },
|
|
63
|
+
createElement('p', { 'data-mayura-prompt': true }, view.prompt),
|
|
64
|
+
createElement('p', { role: 'status', 'aria-live': 'polite' }, view.statusText), action);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface MayuraWorkflowPauseControlProps {
|
|
68
|
+
readonly workflow: WorkflowViewInput; readonly commandState?: WorkflowCommandState; readonly label?: string;
|
|
69
|
+
/** Distinguishes otherwise identical buttons for assistive technology, e.g. "run 7d2ddd96" gives "Pause workflow for run 7d2ddd96". */
|
|
70
|
+
readonly subject?: string;
|
|
71
|
+
readonly onPause?: (target: { readonly runId: string; readonly revision: number }) => void;
|
|
72
|
+
readonly onResume?: (target: { readonly runId: string; readonly revision: number }) => void;
|
|
73
|
+
}
|
|
74
|
+
/** Explicit per-run pause/resume intent. Mounting performs no request; the application routes each event to its command controller. */
|
|
75
|
+
export function MayuraWorkflowPauseControl({ workflow, commandState, label: suppliedLabel, subject, onPause, onResume }: MayuraWorkflowPauseControlProps): ReactElement {
|
|
76
|
+
const accessibleLabel = label(suppliedLabel, 'Workflow pause control'); const subjectText = subject === undefined ? undefined : label(subject, 'workflow');
|
|
77
|
+
if (commandState !== undefined && (!Object.isFrozen(commandState) || commandState.runId !== workflow.runId)) throw new MayuraReactError('INVALID_COMPONENT_PROPS');
|
|
78
|
+
// Feedback describes one revision; once the view has moved on (another operator, a fleet sweep) it is stale and hidden.
|
|
79
|
+
const current = commandState !== undefined && (commandState.status === 'submitting' || commandState.workflowRevision === workflow.revision);
|
|
80
|
+
const status = current ? commandState!.status : 'idle'; const busy = status === 'submitting' || status === 'disposed';
|
|
81
|
+
const pausable = ['running', 'waiting'].includes(workflow.status) && onPause !== undefined;
|
|
82
|
+
const resumable = workflow.status === 'paused' && onResume !== undefined;
|
|
83
|
+
const target = Object.freeze({ runId: workflow.runId, revision: workflow.revision });
|
|
84
|
+
const act = useCallback(() => {
|
|
85
|
+
// aria-disabled keeps focus on the control while a command is in flight; the handler itself enforces the lock.
|
|
86
|
+
if (busy) return;
|
|
87
|
+
if (pausable) onPause!(target); else if (resumable) onResume!(target);
|
|
88
|
+
}, [busy, pausable, resumable, onPause, onResume, target.runId, target.revision]);
|
|
89
|
+
const action = current ? commandState!.action : null;
|
|
90
|
+
const feedback = status === 'submitting' ? (action === 'pause' ? 'Pausing workflow' : action === 'resume' ? 'Resuming workflow' : 'Command in progress')
|
|
91
|
+
: status === 'succeeded' ? (action === 'pause' ? 'Pause applied' : action === 'resume' ? 'Resume requested' : 'Command applied')
|
|
92
|
+
: status === 'conflict' ? 'Workflow changed or has an effect in flight; refresh before retrying'
|
|
93
|
+
: status === 'failed' ? 'Command outcome unknown; refresh before retrying'
|
|
94
|
+
: status === 'disposed' ? 'Command controller closed' : null;
|
|
95
|
+
return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'workflow-pause-control', 'aria-busy': status === 'submitting' },
|
|
96
|
+
createElement('p', { role: 'status', 'aria-live': 'polite', 'data-workflow-status': workflow.status, 'data-command-status': status },
|
|
97
|
+
feedback === null ? `Workflow ${workflow.status}` : `Workflow ${workflow.status}. ${feedback}`),
|
|
98
|
+
pausable || resumable ? createElement('button', { key: 'action', type: 'button', onClick: act, 'aria-disabled': busy,
|
|
99
|
+
'data-action': pausable ? 'pause' : 'resume',
|
|
100
|
+
...(subjectText === undefined ? {} : { 'aria-label': `${pausable ? 'Pause workflow' : 'Resume workflow'} for ${subjectText}` }) },
|
|
101
|
+
pausable ? 'Pause workflow' : 'Resume workflow') : null);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface MayuraFleetHoldControlProps {
|
|
105
|
+
readonly fleet: { readonly held: boolean; readonly generation: number; readonly changedAtMs: number | null };
|
|
106
|
+
readonly status?: 'idle' | 'submitting' | 'succeeded' | 'conflict' | 'failed'; readonly label?: string;
|
|
107
|
+
readonly onHold?: () => void; readonly onRelease?: () => void;
|
|
108
|
+
}
|
|
109
|
+
/** Fleet hold/release intent with a two-step confirmation before holding every run in the scope. */
|
|
110
|
+
export function MayuraFleetHoldControl({ fleet, status = 'idle', label: suppliedLabel, onHold, onRelease }: MayuraFleetHoldControlProps): ReactElement {
|
|
111
|
+
const accessibleLabel = label(suppliedLabel, 'Fleet hold control'); const [confirming, setConfirming] = useState(false);
|
|
112
|
+
const primary = useRef<HTMLButtonElement | null>(null); const wasConfirming = useRef(false);
|
|
113
|
+
// Return focus to the primary action when the confirmation closes, so keyboard users are not dropped to the page body.
|
|
114
|
+
useEffect(() => { if (wasConfirming.current && !confirming) primary.current?.focus(); wasConfirming.current = confirming; }, [confirming]);
|
|
115
|
+
if (!fleet || typeof fleet.held !== 'boolean' || !Number.isSafeInteger(fleet.generation) || fleet.generation < 0
|
|
116
|
+
|| !['idle', 'submitting', 'succeeded', 'conflict', 'failed'].includes(status)) throw new MayuraReactError('INVALID_COMPONENT_PROPS');
|
|
117
|
+
const busy = status === 'submitting';
|
|
118
|
+
const request = useCallback(() => { if (!busy) setConfirming(true); }, [busy]);
|
|
119
|
+
const cancel = useCallback(() => { setConfirming(false); }, []);
|
|
120
|
+
const confirm = useCallback(() => { if (busy) return; setConfirming(false); onHold?.(); }, [busy, onHold]);
|
|
121
|
+
const release = useCallback(() => { if (!busy) onRelease?.(); }, [busy, onRelease]);
|
|
122
|
+
const summary = fleet.held ? `Fleet held (generation ${fleet.generation}); hosts and coordinators drive no runs` : 'Fleet running';
|
|
123
|
+
const feedback = status === 'submitting' ? 'Updating fleet hold' : status === 'conflict' ? 'Fleet state changed; refresh before retrying'
|
|
124
|
+
: status === 'failed' ? 'Fleet command outcome unknown; refresh before retrying' : null;
|
|
125
|
+
const actions = fleet.held
|
|
126
|
+
? (onRelease === undefined ? null : createElement('button', { key: 'primary', ref: primary, type: 'button', onClick: release, 'aria-disabled': busy }, 'Release fleet hold'))
|
|
127
|
+
: onHold === undefined ? null : confirming
|
|
128
|
+
? createElement('div', { key: 'confirm', role: 'group', 'aria-label': 'Confirm fleet hold' },
|
|
129
|
+
createElement('p', { id: 'mayura-fleet-hold-warning' }, 'Holding stops every host and coordinator in this scope from driving runs.'),
|
|
130
|
+
createElement('button', { type: 'button', onClick: confirm, 'aria-disabled': busy, 'aria-describedby': 'mayura-fleet-hold-warning', autoFocus: true }, 'Confirm hold'),
|
|
131
|
+
createElement('button', { type: 'button', onClick: cancel }, 'Cancel'))
|
|
132
|
+
: createElement('button', { key: 'primary', ref: primary, type: 'button', onClick: request, 'aria-disabled': busy }, 'Hold fleet');
|
|
133
|
+
return createElement('section', { 'aria-label': accessibleLabel, 'data-mayura-component': 'fleet-hold-control', 'aria-busy': busy },
|
|
134
|
+
createElement('p', { role: 'status', 'aria-live': 'polite', 'data-fleet-held': fleet.held, 'data-command-status': status },
|
|
135
|
+
feedback === null ? summary : `${summary}. ${feedback}`), actions);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function fieldControl(field: HumanResponseField): ReactElement {
|
|
139
|
+
const common = { name: field.name, required: field.required, 'aria-label': field.label };
|
|
140
|
+
if (field.kind === 'textarea') return createElement('textarea', { ...common, minLength: field.minLength, maxLength: field.maxLength });
|
|
141
|
+
if (field.kind === 'text') return createElement('input', { ...common, type: 'text', minLength: field.minLength, maxLength: field.maxLength });
|
|
142
|
+
if (field.kind === 'number' || field.kind === 'integer') return createElement('input', {
|
|
143
|
+
...common, type: 'number', min: field.minimum, max: field.maximum, step: field.kind === 'integer' ? 1 : 'any',
|
|
144
|
+
});
|
|
145
|
+
if (field.kind === 'boolean') return createElement('input', { ...common, type: 'checkbox' });
|
|
146
|
+
if (field.kind !== 'select') throw new MayuraReactError('INVALID_COMPONENT_PROPS');
|
|
147
|
+
return createElement('select', common,
|
|
148
|
+
createElement('option', { value: '' }, 'Select an option'),
|
|
149
|
+
field.options.map(option => createElement('option', { key: option.value, value: option.value }, option.label)));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Schema-bound uncontrolled form. Validation and the application callback run only on an explicit submit event. */
|
|
153
|
+
export function MayuraHumanResponseForm({ request, definition, nowMs, label: suppliedLabel, submitText, commandState, onSubmit }: MayuraHumanResponseFormProps): ReactElement {
|
|
154
|
+
const view = useMayuraHumanRequest(request, nowMs); const accessibleLabel = label(suppliedLabel, 'Human response');
|
|
155
|
+
const actionText = label(submitText, 'Submit response'); const [errorCode, setErrorCode] = useState<string | null>(null);
|
|
156
|
+
if (commandState !== undefined && (!Object.isFrozen(commandState) || commandState.requestId !== request.id || commandState.requestDigest !== request.digest))
|
|
157
|
+
throw new MayuraReactError('INVALID_COMPONENT_PROPS');
|
|
158
|
+
const commandStatus = commandState?.status ?? 'idle'; const locked = ['submitting', 'succeeded', 'conflict', 'disposed'].includes(commandStatus);
|
|
159
|
+
const submit = useCallback((event: FormEvent<HTMLFormElement>) => {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
if (!view.canRespond || locked) { setErrorCode('INVALID_FORM_VALUE'); return; }
|
|
162
|
+
const data = new FormData(event.currentTarget); const draft: Record<string, string | boolean> = Object.create(null) as Record<string, string | boolean>;
|
|
163
|
+
for (const field of definition.fields) {
|
|
164
|
+
if (field.kind === 'boolean') { draft[field.name] = data.has(field.name); continue; }
|
|
165
|
+
const value = data.get(field.name); if (typeof value === 'string') draft[field.name] = value;
|
|
166
|
+
}
|
|
167
|
+
let submission: HumanResponseSubmission;
|
|
168
|
+
try { submission = validateHumanResponse(request, definition, Object.freeze(draft)); }
|
|
169
|
+
catch (error) { if (error instanceof ClientError) { setErrorCode(error.code); return; } throw error; }
|
|
170
|
+
setErrorCode(null); onSubmit(submission);
|
|
171
|
+
}, [definition, locked, onSubmit, request, view.canRespond]);
|
|
172
|
+
const feedback = commandStatus === 'submitting' ? 'Submitting response' : commandStatus === 'succeeded' ? 'Response submitted'
|
|
173
|
+
: commandStatus === 'conflict' ? 'Request changed; refresh required' : commandStatus === 'failed' ? 'Response submission failed'
|
|
174
|
+
: commandStatus === 'disposed' ? 'Response controller disposed' : null;
|
|
175
|
+
return createElement('form', { 'aria-label': accessibleLabel, 'data-mayura-component': 'human-response-form', onSubmit: submit },
|
|
176
|
+
createElement('p', { 'data-mayura-prompt': true }, view.prompt),
|
|
177
|
+
createElement('fieldset', { disabled: !view.canRespond || locked },
|
|
178
|
+
createElement('legend', null, accessibleLabel),
|
|
179
|
+
definition.fields.map(field => createElement('label', { key: field.name }, field.label, fieldControl(field))),
|
|
180
|
+
view.canRespond && !locked ? createElement('button', { type: 'submit' }, actionText) : null),
|
|
181
|
+
feedback === null ? null : createElement('p', { role: 'status', 'aria-live': 'polite', 'data-command-status': commandStatus }, feedback),
|
|
182
|
+
errorCode === null ? null : createElement('p', { role: 'alert', 'data-error-code': errorCode }, 'Response values are invalid'));
|
|
183
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useMemo, useSyncExternalStore } from 'react';
|
|
2
|
+
import { createHumanRequestView, createRunActivityProjection, type HeadlessRunState, type HeadlessRunStore, type HumanRequestView,
|
|
3
|
+
type RunActivityProjection } from '@mayura/client/headless';
|
|
4
|
+
import type { RemoteHumanRequest } from '@mayura/client';
|
|
5
|
+
import type { HumanResponseCommandState, HumanResponseController } from '@mayura/client/forms';
|
|
6
|
+
import { createWorkflowGraphProjection, type WorkflowCommandController, type WorkflowCommandState, type WorkflowGraphProjection,
|
|
7
|
+
type WorkflowViewInput } from '@mayura/client/workflows';
|
|
8
|
+
|
|
9
|
+
export interface MayuraRunActions {
|
|
10
|
+
readonly refresh: HeadlessRunStore['refresh'];
|
|
11
|
+
readonly observe: HeadlessRunStore['observe'];
|
|
12
|
+
readonly cancel: HeadlessRunStore['cancel'];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class MayuraReactError extends Error {
|
|
16
|
+
override readonly name = 'MayuraReactError';
|
|
17
|
+
constructor(readonly code: 'INVALID_REACT_STORE' | 'INVALID_RESPONSE_CONTROLLER' | 'INVALID_WORKFLOW_CONTROLLER' | 'INVALID_COMPONENT_PROPS') {
|
|
18
|
+
super(`Mayura React binding failed (${code}).`); Object.freeze(this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Subscribe to caller-owned human command state without submitting, retrying or starting any effect. */
|
|
23
|
+
export function useMayuraHumanResponseCommand(controller: HumanResponseController): HumanResponseCommandState {
|
|
24
|
+
if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'
|
|
25
|
+
|| typeof controller.submit !== 'function' || typeof controller.reset !== 'function' || typeof controller.dispose !== 'function')
|
|
26
|
+
throw new MayuraReactError('INVALID_RESPONSE_CONTROLLER');
|
|
27
|
+
return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Subscribe to caller-owned workflow command state without reading or mutating on mount. */
|
|
31
|
+
export function useMayuraWorkflowCommand(controller: WorkflowCommandController): WorkflowCommandState {
|
|
32
|
+
if (!controller || typeof controller.getSnapshot !== 'function' || typeof controller.subscribe !== 'function'
|
|
33
|
+
|| typeof controller.cancel !== 'function' || typeof controller.approve !== 'function' || typeof controller.signal !== 'function'
|
|
34
|
+
|| typeof controller.resume !== 'function' || typeof controller.pause !== 'function' || typeof controller.reset !== 'function'
|
|
35
|
+
|| typeof controller.dispose !== 'function') throw new MayuraReactError('INVALID_WORKFLOW_CONTROLLER');
|
|
36
|
+
return useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function store(value: HeadlessRunStore): HeadlessRunStore {
|
|
40
|
+
if (!value || typeof value.getSnapshot !== 'function' || typeof value.subscribe !== 'function' || typeof value.refresh !== 'function'
|
|
41
|
+
|| typeof value.observe !== 'function' || typeof value.cancel !== 'function') throw new MayuraReactError('INVALID_REACT_STORE');
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Subscribe to one caller-owned headless store. This hook starts no reads, streams, timers or commands. */
|
|
46
|
+
export function useMayuraRun(value: HeadlessRunStore): HeadlessRunState {
|
|
47
|
+
const selected = store(value);
|
|
48
|
+
return useSyncExternalStore(selected.subscribe, selected.getSnapshot, selected.getSnapshot);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Stable explicit actions for event handlers. Observation and cancellation are never invoked by an effect. */
|
|
52
|
+
export function useMayuraRunActions(value: HeadlessRunStore): MayuraRunActions {
|
|
53
|
+
const selected = store(value);
|
|
54
|
+
return useMemo(() => Object.freeze({ refresh: selected.refresh, observe: selected.observe, cancel: selected.cancel }), [selected]);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Derive text-only human request metadata during render without copying it into component state. */
|
|
58
|
+
export function useMayuraHumanRequest(request: RemoteHumanRequest, nowMs: number): HumanRequestView {
|
|
59
|
+
return useMemo(() => createHumanRequestView(request, nowMs), [request, nowMs]);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Derive a stable, content-free activity timeline from the current bounded run state. */
|
|
63
|
+
export function useMayuraRunActivity(state: HeadlessRunState): RunActivityProjection {
|
|
64
|
+
return useMemo(() => createRunActivityProjection(state), [state]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Validate and memoize one content-free durable workflow DAG supplied by an authenticated application adapter. */
|
|
68
|
+
export function useMayuraWorkflowGraph(input: WorkflowViewInput): WorkflowGraphProjection {
|
|
69
|
+
return useMemo(() => createWorkflowGraphProjection(input), [input]);
|
|
70
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { type ErrorCode, type InferInput, type InferOutput, type JsonObject, type JsonValue, type Outcome, type Schema, type Scope } from '../../core/dist/index.js';
|
|
2
|
+
import { type AnyTool } from '../../tools/dist/index.js';
|
|
3
|
+
export type CodeLanguage = 'javascript' | 'typescript';
|
|
4
|
+
export type SandboxQualification = 'test' | 'production';
|
|
5
|
+
export interface CodeLimits {
|
|
6
|
+
readonly cpuMillis: number;
|
|
7
|
+
readonly wallTimeMillis: number;
|
|
8
|
+
readonly memoryBytes: number;
|
|
9
|
+
readonly scratchBytes: number;
|
|
10
|
+
readonly maxInputBytes: number;
|
|
11
|
+
readonly maxOutputBytes: number;
|
|
12
|
+
readonly maxToolInputBytes: number;
|
|
13
|
+
readonly maxToolCalls: number;
|
|
14
|
+
readonly maxToolConcurrency: number;
|
|
15
|
+
}
|
|
16
|
+
export interface CodeToolManifest {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly version: string;
|
|
19
|
+
readonly description: string;
|
|
20
|
+
readonly effects: AnyTool['effects'];
|
|
21
|
+
readonly capabilities: readonly string[];
|
|
22
|
+
readonly costMicros: number;
|
|
23
|
+
readonly inputJsonSchema?: JsonObject;
|
|
24
|
+
}
|
|
25
|
+
export interface CodeProgramManifest {
|
|
26
|
+
readonly format: 1;
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly version: string;
|
|
29
|
+
readonly intent: string;
|
|
30
|
+
readonly language: CodeLanguage;
|
|
31
|
+
readonly inputSchemaId: string;
|
|
32
|
+
readonly outputSchemaId: string;
|
|
33
|
+
readonly approvedImports: readonly string[];
|
|
34
|
+
readonly tools: readonly CodeToolManifest[];
|
|
35
|
+
readonly limits: CodeLimits;
|
|
36
|
+
readonly sourceBytes: number;
|
|
37
|
+
readonly digest: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CodeProgramOptions<I extends Schema, O extends Schema> {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly version: string;
|
|
42
|
+
readonly intent: string;
|
|
43
|
+
readonly language: CodeLanguage;
|
|
44
|
+
readonly source: string;
|
|
45
|
+
readonly input: I;
|
|
46
|
+
readonly output: O;
|
|
47
|
+
readonly inputSchemaId: string;
|
|
48
|
+
readonly outputSchemaId: string;
|
|
49
|
+
readonly tools?: readonly AnyTool[];
|
|
50
|
+
readonly approvedImports?: readonly string[];
|
|
51
|
+
readonly limits: CodeLimits;
|
|
52
|
+
}
|
|
53
|
+
export interface CodeProgramDefinition<I extends Schema = Schema, O extends Schema = Schema> {
|
|
54
|
+
readonly manifest: CodeProgramManifest;
|
|
55
|
+
readonly input: Schema<InferInput<I>, InferOutput<I>>;
|
|
56
|
+
readonly output: Schema<InferInput<O>, InferOutput<O>>;
|
|
57
|
+
}
|
|
58
|
+
export interface CodeToolOutcome {
|
|
59
|
+
readonly status: Outcome<JsonValue>['status'];
|
|
60
|
+
readonly output?: JsonValue;
|
|
61
|
+
readonly error?: {
|
|
62
|
+
readonly code: ErrorCode;
|
|
63
|
+
readonly message: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface CodeToolBridge {
|
|
67
|
+
call(toolId: string, input: unknown): Promise<CodeToolOutcome>;
|
|
68
|
+
}
|
|
69
|
+
export interface SandboxExecutionRequest {
|
|
70
|
+
readonly executionId: string;
|
|
71
|
+
readonly manifest: CodeProgramManifest;
|
|
72
|
+
readonly source: string;
|
|
73
|
+
readonly input: JsonValue;
|
|
74
|
+
readonly signal: AbortSignal;
|
|
75
|
+
readonly tools: CodeToolBridge;
|
|
76
|
+
}
|
|
77
|
+
export type SandboxExecutionResult = {
|
|
78
|
+
readonly status: 'succeeded';
|
|
79
|
+
readonly output: unknown;
|
|
80
|
+
} | {
|
|
81
|
+
readonly status: 'failed';
|
|
82
|
+
};
|
|
83
|
+
export interface SandboxAdapterOptions {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly version: string;
|
|
86
|
+
readonly qualification: SandboxQualification;
|
|
87
|
+
readonly isAvailable: () => boolean | Promise<boolean>;
|
|
88
|
+
readonly execute: (request: SandboxExecutionRequest) => Promise<SandboxExecutionResult>;
|
|
89
|
+
}
|
|
90
|
+
/** Metadata-only handle. Its registered callbacks remain private to this package instance. */
|
|
91
|
+
export interface SandboxAdapter {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly version: string;
|
|
94
|
+
readonly qualification: SandboxQualification;
|
|
95
|
+
}
|
|
96
|
+
export interface CodeToolInvocationContext {
|
|
97
|
+
readonly runId: string;
|
|
98
|
+
readonly executionId: string;
|
|
99
|
+
readonly callId: string;
|
|
100
|
+
readonly programDigest: string;
|
|
101
|
+
readonly scope: Scope;
|
|
102
|
+
readonly signal: AbortSignal;
|
|
103
|
+
}
|
|
104
|
+
export interface CreateCodeModeOptions {
|
|
105
|
+
readonly adapter: SandboxAdapter;
|
|
106
|
+
/** Explicit test-only escape hatch; production callers fail closed for unqualified adapters. */
|
|
107
|
+
readonly allowTestAdapter?: boolean;
|
|
108
|
+
readonly invokeTool: (tool: AnyTool, input: JsonValue, context: CodeToolInvocationContext) => Promise<Outcome<JsonValue>>;
|
|
109
|
+
}
|
|
110
|
+
export interface ExecuteCodeOptions {
|
|
111
|
+
readonly runId: string;
|
|
112
|
+
readonly executionId: string;
|
|
113
|
+
readonly scope: Scope;
|
|
114
|
+
readonly signal: AbortSignal;
|
|
115
|
+
}
|
|
116
|
+
/** Host-derived nested-tool accounting. Unknown cost remains reserved for reconciliation. */
|
|
117
|
+
export interface CodeExecutionUsage {
|
|
118
|
+
readonly toolCalls: number;
|
|
119
|
+
readonly unknownCalls: number;
|
|
120
|
+
readonly knownCostMicros: number;
|
|
121
|
+
readonly unknownCostMicros: number;
|
|
122
|
+
readonly maximumCostMicros: number;
|
|
123
|
+
}
|
|
124
|
+
export type CodeExecutionOutcome<T> = Outcome<T> & {
|
|
125
|
+
readonly usage: CodeExecutionUsage;
|
|
126
|
+
};
|
|
127
|
+
export interface CodeMode {
|
|
128
|
+
execute<I extends Schema, O extends Schema>(program: CodeProgramDefinition<I, O>, input: InferInput<I>, options: ExecuteCodeOptions): Promise<CodeExecutionOutcome<InferOutput<O>>>;
|
|
129
|
+
}
|
|
130
|
+
/** Creates an immutable, content-addressed program definition without compiling or executing source. */
|
|
131
|
+
export declare function defineCodeProgram<I extends Schema, O extends Schema>(options: CodeProgramOptions<I, O>): CodeProgramDefinition<I, O>;
|
|
132
|
+
/** Rejects forged or foreign-instance program metadata before durable composition. */
|
|
133
|
+
export declare function assertCodeProgram(program: CodeProgramDefinition): void;
|
|
134
|
+
/** Registers trusted adapter callbacks behind an immutable metadata-only handle. */
|
|
135
|
+
export declare function defineSandboxAdapter(options: SandboxAdapterOptions): SandboxAdapter;
|
|
136
|
+
/** Creates an ephemeral Code Mode executor. It never evaluates source outside the supplied adapter. */
|
|
137
|
+
export declare function createCodeMode(options: CreateCodeModeOptions): CodeMode;
|
|
138
|
+
/** Rejects forged executors before they are captured by a durable phase tool. */
|
|
139
|
+
export declare function assertCodeMode(mode: CodeMode): void;
|
|
140
|
+
/** Runtime assertion for callers that persist or compare program digests. */
|
|
141
|
+
export declare function isCodeProgramDigest(value: string): boolean;
|
|
142
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EAGd,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,KAAK,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;AACvD,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,YAAY,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AAED,MAAM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