@zhin.js/agent 1.1.13 → 1.1.14
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/README.md +40 -20
- package/lib/ai-event-bus.d.ts +1 -1
- package/lib/ai-hook-handlers.d.ts +1 -1
- package/lib/assistant/config.d.ts +3 -17
- package/lib/assistant/config.d.ts.map +1 -1
- package/lib/assistant/config.js +1 -8
- package/lib/assistant/config.js.map +1 -1
- package/lib/assistant/index.d.ts +6 -9
- package/lib/assistant/index.d.ts.map +1 -1
- package/lib/assistant/index.js +4 -6
- package/lib/assistant/index.js.map +1 -1
- package/lib/assistant/job-engine.d.ts +0 -4
- package/lib/assistant/job-engine.d.ts.map +1 -1
- package/lib/assistant/job-engine.js +0 -2
- package/lib/assistant/job-engine.js.map +1 -1
- package/lib/assistant/job-store.d.ts +1 -8
- package/lib/assistant/job-store.d.ts.map +1 -1
- package/lib/assistant/job-store.js +3 -9
- package/lib/assistant/job-store.js.map +1 -1
- package/lib/assistant/job-worker.d.ts +2 -3
- package/lib/assistant/job-worker.d.ts.map +1 -1
- package/lib/assistant/job-worker.js +15 -25
- package/lib/assistant/job-worker.js.map +1 -1
- package/lib/assistant/runtime-contract.d.ts +22 -0
- package/lib/assistant/runtime-contract.d.ts.map +1 -0
- package/lib/assistant/runtime-contract.js +2 -0
- package/lib/assistant/runtime-contract.js.map +1 -0
- package/lib/assistant/types.d.ts +0 -10
- package/lib/assistant/types.d.ts.map +1 -1
- package/lib/assistant/types.js +0 -4
- package/lib/assistant/types.js.map +1 -1
- package/lib/authoring/bridge.d.ts +1 -1
- package/lib/authoring/index.d.ts +0 -4
- package/lib/authoring/index.d.ts.map +1 -1
- package/lib/authoring/index.js +0 -2
- package/lib/authoring/index.js.map +1 -1
- package/lib/authoring/types.d.ts +3 -39
- package/lib/authoring/types.d.ts.map +1 -1
- package/lib/authoring/types.js.map +1 -1
- package/lib/builtin/bash-tool.d.ts.map +1 -1
- package/lib/builtin/bash-tool.js +15 -2
- package/lib/builtin/bash-tool.js.map +1 -1
- package/lib/builtin/five-agent/index.d.ts +0 -1
- package/lib/builtin/five-agent/index.d.ts.map +1 -1
- package/lib/builtin/five-agent/index.js +0 -1
- package/lib/builtin/five-agent/index.js.map +1 -1
- package/lib/builtin/five-agent/role-capability-policy.d.ts +1 -1
- package/lib/builtin/five-agent/role-capability-policy.d.ts.map +1 -1
- package/lib/builtin/five-agent/role-capability-policy.js +1 -1
- package/lib/builtin/five-agent/role-capability-policy.js.map +1 -1
- package/lib/builtin/spawn-task-tool.d.ts +1 -1
- package/lib/builtin/spawn-task-tool.d.ts.map +1 -1
- package/lib/builtin/spawn-task-tool.js +4 -100
- package/lib/builtin/spawn-task-tool.js.map +1 -1
- package/lib/builtin-tools.d.ts +0 -2
- package/lib/builtin-tools.d.ts.map +1 -1
- package/lib/builtin-tools.js +0 -6
- package/lib/builtin-tools.js.map +1 -1
- package/lib/common-adapter-tools.d.ts +1 -1
- package/lib/config/agent-interfaces.d.ts +2 -1
- package/lib/config/agent-interfaces.d.ts.map +1 -1
- package/lib/config/index.d.ts +3 -3
- package/lib/config/index.d.ts.map +1 -1
- package/lib/config/index.js +2 -2
- package/lib/config/index.js.map +1 -1
- package/lib/config/keyword-triggers.d.ts +0 -1
- package/lib/config/keyword-triggers.d.ts.map +1 -1
- package/lib/config/keyword-triggers.js +0 -1
- package/lib/config/keyword-triggers.js.map +1 -1
- package/lib/config/normalize-ai-config.d.ts.map +1 -1
- package/lib/config/normalize-ai-config.js +9 -0
- package/lib/config/normalize-ai-config.js.map +1 -1
- package/lib/config/validate-ai-config.d.ts +1 -0
- package/lib/config/validate-ai-config.d.ts.map +1 -1
- package/lib/config/validate-ai-config.js +179 -0
- package/lib/config/validate-ai-config.js.map +1 -1
- package/lib/config/zhin-agent-config.d.ts +0 -3
- package/lib/config/zhin-agent-config.d.ts.map +1 -1
- package/lib/config/zhin-agent-constants.d.ts +0 -3
- package/lib/config/zhin-agent-constants.d.ts.map +1 -1
- package/lib/config/zhin-agent-constants.js +0 -14
- package/lib/config/zhin-agent-constants.js.map +1 -1
- package/lib/config/zhin-agent-defaults.d.ts.map +1 -1
- package/lib/config/zhin-agent-defaults.js +0 -3
- package/lib/config/zhin-agent-defaults.js.map +1 -1
- package/lib/config/zhin-agent-dependencies.d.ts +4 -5
- package/lib/config/zhin-agent-dependencies.d.ts.map +1 -1
- package/lib/context/context-system.d.ts +2 -1
- package/lib/context/context-system.d.ts.map +1 -1
- package/lib/context/context-system.js +1 -0
- package/lib/context/context-system.js.map +1 -1
- package/lib/context/context-tail-limit.d.ts +2 -2
- package/lib/context/context-tail-limit.d.ts.map +1 -1
- package/lib/context/context-tail-limit.js +2 -3
- package/lib/context/context-tail-limit.js.map +1 -1
- package/lib/context/im-turn-context-adapter.d.ts +1 -2
- package/lib/context/im-turn-context-adapter.d.ts.map +1 -1
- package/lib/context/im-turn-context-adapter.js +1 -5
- package/lib/context/im-turn-context-adapter.js.map +1 -1
- package/lib/context/turn-envelope.d.ts +1 -1
- package/lib/context/turn-envelope.d.ts.map +1 -1
- package/lib/context/turn-envelope.js +4 -0
- package/lib/context/turn-envelope.js.map +1 -1
- package/lib/context/turn-user-message.d.ts +1 -1
- package/lib/context/turn-user-message.d.ts.map +1 -1
- package/lib/context/turn-user-message.js +3 -3
- package/lib/context/turn-user-message.js.map +1 -1
- package/lib/core/agent-core-run.d.ts.map +1 -1
- package/lib/core/agent-core-run.js +36 -12
- package/lib/core/agent-core-run.js.map +1 -1
- package/lib/core/agent-loop-standalone.d.ts +1 -1
- package/lib/core/agent-loop-standalone.js +13 -6
- package/lib/core/agent-loop-standalone.js.map +1 -1
- package/lib/core/tool-execution-authority.d.ts +2 -2
- package/lib/core/tool-execution-authority.d.ts.map +1 -1
- package/lib/data-governance/data-governance.d.ts +198 -0
- package/lib/data-governance/data-governance.d.ts.map +1 -0
- package/lib/data-governance/data-governance.js +660 -0
- package/lib/data-governance/data-governance.js.map +1 -0
- package/lib/data-governance/database-payload-lifecycle-repository.d.ts +68 -0
- package/lib/data-governance/database-payload-lifecycle-repository.d.ts.map +1 -0
- package/lib/data-governance/database-payload-lifecycle-repository.js +226 -0
- package/lib/data-governance/database-payload-lifecycle-repository.js.map +1 -0
- package/lib/data-governance/disclosure-manifest.d.ts +110 -0
- package/lib/data-governance/disclosure-manifest.d.ts.map +1 -0
- package/lib/data-governance/disclosure-manifest.js +264 -0
- package/lib/data-governance/disclosure-manifest.js.map +1 -0
- package/lib/data-governance/encrypted-database-payload-vault.d.ts +107 -0
- package/lib/data-governance/encrypted-database-payload-vault.d.ts.map +1 -0
- package/lib/data-governance/encrypted-database-payload-vault.js +236 -0
- package/lib/data-governance/encrypted-database-payload-vault.js.map +1 -0
- package/lib/data-governance/encrypted-file-payload-vault.d.ts +117 -0
- package/lib/data-governance/encrypted-file-payload-vault.d.ts.map +1 -0
- package/lib/data-governance/encrypted-file-payload-vault.js +507 -0
- package/lib/data-governance/encrypted-file-payload-vault.js.map +1 -0
- package/lib/data-governance/file-payload-lifecycle-repository.d.ts +19 -0
- package/lib/data-governance/file-payload-lifecycle-repository.d.ts.map +1 -0
- package/lib/data-governance/file-payload-lifecycle-repository.js +194 -0
- package/lib/data-governance/file-payload-lifecycle-repository.js.map +1 -0
- package/lib/data-governance/governance-authority-repository.d.ts +148 -0
- package/lib/data-governance/governance-authority-repository.d.ts.map +1 -0
- package/lib/data-governance/governance-authority-repository.js +439 -0
- package/lib/data-governance/governance-authority-repository.js.map +1 -0
- package/lib/data-governance/governed-payload-write-saga.d.ts +126 -0
- package/lib/data-governance/governed-payload-write-saga.d.ts.map +1 -0
- package/lib/data-governance/governed-payload-write-saga.js +471 -0
- package/lib/data-governance/governed-payload-write-saga.js.map +1 -0
- package/lib/data-governance/payload-hold-overdue-projection.d.ts +57 -0
- package/lib/data-governance/payload-hold-overdue-projection.d.ts.map +1 -0
- package/lib/data-governance/payload-hold-overdue-projection.js +80 -0
- package/lib/data-governance/payload-hold-overdue-projection.js.map +1 -0
- package/lib/data-governance/payload-lifecycle.d.ts +359 -0
- package/lib/data-governance/payload-lifecycle.d.ts.map +1 -0
- package/lib/data-governance/payload-lifecycle.js +930 -0
- package/lib/data-governance/payload-lifecycle.js.map +1 -0
- package/lib/data-governance/payload-vault-storage-handoff.d.ts +255 -0
- package/lib/data-governance/payload-vault-storage-handoff.d.ts.map +1 -0
- package/lib/data-governance/payload-vault-storage-handoff.js +471 -0
- package/lib/data-governance/payload-vault-storage-handoff.js.map +1 -0
- package/lib/defaults/hooks.d.ts +2 -2
- package/lib/defaults/hooks.d.ts.map +1 -1
- package/lib/defaults/hooks.js +2 -2
- package/lib/defaults/hooks.js.map +1 -1
- package/lib/defaults/subagents.d.ts +2 -2
- package/lib/defaults/subagents.d.ts.map +1 -1
- package/lib/defaults/subagents.js +2 -2
- package/lib/defaults/subagents.js.map +1 -1
- package/lib/defaults/tools.d.ts +1 -2
- package/lib/defaults/tools.js +2 -2
- package/lib/defaults/tools.js.map +1 -1
- package/lib/discovery/agent-surface-info.d.ts +0 -2
- package/lib/discovery/agent-surface-info.d.ts.map +1 -1
- package/lib/discovery/agent-surface-info.js +0 -5
- package/lib/discovery/agent-surface-info.js.map +1 -1
- package/lib/discovery/agent-surface.d.ts.map +1 -1
- package/lib/discovery/agent-surface.js +0 -39
- package/lib/discovery/agent-surface.js.map +1 -1
- package/lib/event/agent-stream-hooks.d.ts +1 -1
- package/lib/event/hook-stream-sink.d.ts +1 -1
- package/lib/event/publish-agent-stream.d.ts +3 -3
- package/lib/event/publish-agent-stream.d.ts.map +1 -1
- package/lib/event/publish-agent-stream.js +1 -1
- package/lib/event/publish-agent-stream.js.map +1 -1
- package/lib/event/session-events.d.ts +1 -1
- package/lib/event/turn-event.d.ts +22 -2
- package/lib/event/turn-event.d.ts.map +1 -1
- package/lib/event/turn-event.js.map +1 -1
- package/lib/event/turn-to-agent-stream.js +6 -0
- package/lib/event/turn-to-agent-stream.js.map +1 -1
- package/lib/features/agent-feature.d.ts +1 -1
- package/lib/features/mcp-feature.d.ts +1 -1
- package/lib/index.d.ts +99 -33
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +94 -21
- package/lib/index.js.map +1 -1
- package/lib/ingress/capability-ingress.d.ts +5 -5
- package/lib/ingress/capability-ingress.d.ts.map +1 -1
- package/lib/ingress/capability-ingress.js +26 -26
- package/lib/ingress/capability-ingress.js.map +1 -1
- package/lib/init/activate-ai-database-storage.d.ts +5 -3
- package/lib/init/activate-ai-database-storage.d.ts.map +1 -1
- package/lib/init/activate-ai-database-storage.js +23 -32
- package/lib/init/activate-ai-database-storage.js.map +1 -1
- package/lib/init/configure-zhin-agent.d.ts +1 -1
- package/lib/init/configure-zhin-agent.d.ts.map +1 -1
- package/lib/init/configure-zhin-agent.js +3 -5
- package/lib/init/configure-zhin-agent.js.map +1 -1
- package/lib/init/define-ai-database-models.d.ts.map +1 -1
- package/lib/init/define-ai-database-models.js +21 -5
- package/lib/init/define-ai-database-models.js.map +1 -1
- package/lib/init/dispose-zhin-agent.d.ts +1 -3
- package/lib/init/dispose-zhin-agent.d.ts.map +1 -1
- package/lib/init/dispose-zhin-agent.js +0 -2
- package/lib/init/dispose-zhin-agent.js.map +1 -1
- package/lib/init/introspection-collectors.d.ts +1 -1
- package/lib/init/introspection-collectors.d.ts.map +1 -1
- package/lib/init/introspection-collectors.js +13 -14
- package/lib/init/introspection-collectors.js.map +1 -1
- package/lib/internal/agent-host.d.ts +5 -8
- package/lib/internal/agent-host.d.ts.map +1 -1
- package/lib/internal/host-types.d.ts +4 -0
- package/lib/internal/host-types.d.ts.map +1 -1
- package/lib/journal/persistent-turn-journal.d.ts +5 -1
- package/lib/journal/persistent-turn-journal.d.ts.map +1 -1
- package/lib/journal/persistent-turn-journal.js +11 -1
- package/lib/journal/persistent-turn-journal.js.map +1 -1
- package/lib/mcp-client/bridge.d.ts +1 -1
- package/lib/mcp-client/connection.d.ts +1 -1
- package/lib/mcp-client/index.d.ts +1 -1
- package/lib/media/media-normalize.d.ts +9 -5
- package/lib/media/media-normalize.d.ts.map +1 -1
- package/lib/media/media-normalize.js +125 -69
- package/lib/media/media-normalize.js.map +1 -1
- package/lib/media/media-publisher.d.ts.map +1 -1
- package/lib/media/media-publisher.js +48 -3
- package/lib/media/media-publisher.js.map +1 -1
- package/lib/media/vision-capability.js +1 -1
- package/lib/media/vision-capability.js.map +1 -1
- package/lib/memory/index.d.ts +1 -1
- package/lib/memory/index.d.ts.map +1 -1
- package/lib/plugin-ai-hook-bus.d.ts +1 -1
- package/lib/plugin-runtime/agent-host-port.d.ts +66 -4
- package/lib/plugin-runtime/agent-host-port.d.ts.map +1 -1
- package/lib/plugin-runtime/agent-host-port.js.map +1 -1
- package/lib/plugin-runtime/agent-runtime.d.ts +3 -0
- package/lib/plugin-runtime/agent-runtime.d.ts.map +1 -1
- package/lib/plugin-runtime/agent-runtime.js +73 -3
- package/lib/plugin-runtime/agent-runtime.js.map +1 -1
- package/lib/plugin-runtime/agent-trace-runtime.d.ts +37 -0
- package/lib/plugin-runtime/agent-trace-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/agent-trace-runtime.js +150 -0
- package/lib/plugin-runtime/agent-trace-runtime.js.map +1 -0
- package/lib/plugin-runtime/capability-tools.js +2 -2
- package/lib/plugin-runtime/capability-tools.js.map +1 -1
- package/lib/plugin-runtime/database-overlay-pack-promotion-repository.d.ts +70 -0
- package/lib/plugin-runtime/database-overlay-pack-promotion-repository.d.ts.map +1 -0
- package/lib/plugin-runtime/database-overlay-pack-promotion-repository.js +203 -0
- package/lib/plugin-runtime/database-overlay-pack-promotion-repository.js.map +1 -0
- package/lib/plugin-runtime/deferred-capability-plan.d.ts +26 -0
- package/lib/plugin-runtime/deferred-capability-plan.d.ts.map +1 -1
- package/lib/plugin-runtime/deferred-capability-plan.js +98 -4
- package/lib/plugin-runtime/deferred-capability-plan.js.map +1 -1
- package/lib/plugin-runtime/full-agent-turn-engine.js +48 -5
- package/lib/plugin-runtime/full-agent-turn-engine.js.map +1 -1
- package/lib/plugin-runtime/host-mcp-projection.d.ts +1 -1
- package/lib/plugin-runtime/index.d.ts +66 -0
- package/lib/plugin-runtime/index.d.ts.map +1 -1
- package/lib/plugin-runtime/index.js +65 -0
- package/lib/plugin-runtime/index.js.map +1 -1
- package/lib/plugin-runtime/native-interaction-tools.js +1 -1
- package/lib/plugin-runtime/native-interaction-tools.js.map +1 -1
- package/lib/plugin-runtime/native-semantic-memory-tools.d.ts +17 -0
- package/lib/plugin-runtime/native-semantic-memory-tools.d.ts.map +1 -0
- package/lib/plugin-runtime/native-semantic-memory-tools.js +169 -0
- package/lib/plugin-runtime/native-semantic-memory-tools.js.map +1 -0
- package/lib/plugin-runtime/turn-intent-resolver.d.ts +20 -0
- package/lib/plugin-runtime/turn-intent-resolver.d.ts.map +1 -0
- package/lib/plugin-runtime/turn-intent-resolver.js +8 -0
- package/lib/plugin-runtime/turn-intent-resolver.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-authority.d.ts +5 -0
- package/lib/plugin-runtime/workroom-acceptance-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-authority.js +14 -0
- package/lib/plugin-runtime/workroom-acceptance-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-fact-providers.d.ts +233 -0
- package/lib/plugin-runtime/workroom-acceptance-fact-providers.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-fact-providers.js +517 -0
- package/lib/plugin-runtime/workroom-acceptance-fact-providers.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-internal-providers.d.ts +139 -0
- package/lib/plugin-runtime/workroom-acceptance-internal-providers.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-internal-providers.js +430 -0
- package/lib/plugin-runtime/workroom-acceptance-internal-providers.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-policy.d.ts +4 -0
- package/lib/plugin-runtime/workroom-acceptance-policy.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-policy.js +20 -0
- package/lib/plugin-runtime/workroom-acceptance-policy.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-production-composition.d.ts +175 -0
- package/lib/plugin-runtime/workroom-acceptance-production-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-production-composition.js +793 -0
- package/lib/plugin-runtime/workroom-acceptance-production-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-provider-composition.d.ts +186 -0
- package/lib/plugin-runtime/workroom-acceptance-provider-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-acceptance-provider-composition.js +553 -0
- package/lib/plugin-runtime/workroom-acceptance-provider-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-accepted-source-runtime.d.ts +75 -0
- package/lib/plugin-runtime/workroom-accepted-source-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-accepted-source-runtime.js +267 -0
- package/lib/plugin-runtime/workroom-accepted-source-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.d.ts +42 -0
- package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.js +90 -0
- package/lib/plugin-runtime/workroom-assignment-authority-grant-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-authority-provider.d.ts +159 -0
- package/lib/plugin-runtime/workroom-assignment-authority-provider.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-authority-provider.js +595 -0
- package/lib/plugin-runtime/workroom-assignment-authority-provider.js.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-knowledge-composition.d.ts +58 -0
- package/lib/plugin-runtime/workroom-assignment-knowledge-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-assignment-knowledge-composition.js +218 -0
- package/lib/plugin-runtime/workroom-assignment-knowledge-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-authority-writer.d.ts +47 -0
- package/lib/plugin-runtime/workroom-data-governance-authority-writer.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-authority-writer.js +115 -0
- package/lib/plugin-runtime/workroom-data-governance-authority-writer.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-composition.d.ts +28 -0
- package/lib/plugin-runtime/workroom-data-governance-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-composition.js +41 -0
- package/lib/plugin-runtime/workroom-data-governance-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-root-provider.d.ts +51 -0
- package/lib/plugin-runtime/workroom-data-governance-root-provider.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-root-provider.js +66 -0
- package/lib/plugin-runtime/workroom-data-governance-root-provider.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-runtime.d.ts +134 -0
- package/lib/plugin-runtime/workroom-data-governance-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-runtime.js +1253 -0
- package/lib/plugin-runtime/workroom-data-governance-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-storage.d.ts +66 -0
- package/lib/plugin-runtime/workroom-data-governance-storage.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-governance-storage.js +160 -0
- package/lib/plugin-runtime/workroom-data-governance-storage.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-composition.d.ts +37 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-composition.js +131 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-console.d.ts +238 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-console.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-console.js +495 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-console.js.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.d.ts +15 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.js +119 -0
- package/lib/plugin-runtime/workroom-data-lifecycle-human-ingress.js.map +1 -0
- package/lib/plugin-runtime/workroom-dynamic-planning-provider.d.ts +142 -0
- package/lib/plugin-runtime/workroom-dynamic-planning-provider.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-dynamic-planning-provider.js +301 -0
- package/lib/plugin-runtime/workroom-dynamic-planning-provider.js.map +1 -0
- package/lib/plugin-runtime/workroom-dynamic-planning.d.ts +4 -0
- package/lib/plugin-runtime/workroom-dynamic-planning.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-dynamic-planning.js +13 -0
- package/lib/plugin-runtime/workroom-dynamic-planning.js.map +1 -0
- package/lib/plugin-runtime/workroom-effect-composition.d.ts +37 -0
- package/lib/plugin-runtime/workroom-effect-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-effect-composition.js +69 -0
- package/lib/plugin-runtime/workroom-effect-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-effect-production.d.ts +133 -0
- package/lib/plugin-runtime/workroom-effect-production.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-effect-production.js +272 -0
- package/lib/plugin-runtime/workroom-effect-production.js.map +1 -0
- package/lib/plugin-runtime/workroom-effect-runtime.d.ts +72 -0
- package/lib/plugin-runtime/workroom-effect-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-effect-runtime.js +179 -0
- package/lib/plugin-runtime/workroom-effect-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-composition.d.ts +27 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-composition.js +40 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-reasons.d.ts +10 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-reasons.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-reasons.js +20 -0
- package/lib/plugin-runtime/workroom-governed-dispatch-reasons.js.map +1 -0
- package/lib/plugin-runtime/workroom-journal-payload-composition.d.ts +16 -0
- package/lib/plugin-runtime/workroom-journal-payload-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-journal-payload-composition.js +69 -0
- package/lib/plugin-runtime/workroom-journal-payload-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-local-agent-core-adapter.d.ts +17 -0
- package/lib/plugin-runtime/workroom-local-agent-core-adapter.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-local-agent-core-adapter.js +101 -0
- package/lib/plugin-runtime/workroom-local-agent-core-adapter.js.map +1 -0
- package/lib/plugin-runtime/workroom-local-agent-loop.d.ts +90 -0
- package/lib/plugin-runtime/workroom-local-agent-loop.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-local-agent-loop.js +303 -0
- package/lib/plugin-runtime/workroom-local-agent-loop.js.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-authority.d.ts +5 -0
- package/lib/plugin-runtime/workroom-local-assignment-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-authority.js +16 -0
- package/lib/plugin-runtime/workroom-local-assignment-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-runtime.d.ts +33 -0
- package/lib/plugin-runtime/workroom-local-assignment-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-runtime.js +189 -0
- package/lib/plugin-runtime/workroom-local-assignment-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-supply.d.ts +39 -0
- package/lib/plugin-runtime/workroom-local-assignment-supply.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-local-assignment-supply.js +107 -0
- package/lib/plugin-runtime/workroom-local-assignment-supply.js.map +1 -0
- package/lib/plugin-runtime/workroom-overlay-pack-promotion.d.ts +145 -0
- package/lib/plugin-runtime/workroom-overlay-pack-promotion.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-overlay-pack-promotion.js +516 -0
- package/lib/plugin-runtime/workroom-overlay-pack-promotion.js.map +1 -0
- package/lib/plugin-runtime/workroom-payload-processor-recall.d.ts +91 -0
- package/lib/plugin-runtime/workroom-payload-processor-recall.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-payload-processor-recall.js +189 -0
- package/lib/plugin-runtime/workroom-payload-processor-recall.js.map +1 -0
- package/lib/plugin-runtime/workroom-plan-gate-authority.d.ts +7 -0
- package/lib/plugin-runtime/workroom-plan-gate-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-plan-gate-authority.js +40 -0
- package/lib/plugin-runtime/workroom-plan-gate-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-capacity.d.ts +132 -0
- package/lib/plugin-runtime/workroom-portfolio-capacity.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-capacity.js +189 -0
- package/lib/plugin-runtime/workroom-portfolio-capacity.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.d.ts +38 -0
- package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.js +103 -0
- package/lib/plugin-runtime/workroom-portfolio-checkpoint-ack.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-control-composition.d.ts +30 -0
- package/lib/plugin-runtime/workroom-portfolio-control-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-control-composition.js +102 -0
- package/lib/plugin-runtime/workroom-portfolio-control-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-control-runtime.d.ts +41 -0
- package/lib/plugin-runtime/workroom-portfolio-control-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-control-runtime.js +208 -0
- package/lib/plugin-runtime/workroom-portfolio-control-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-grant-assignment.d.ts +141 -0
- package/lib/plugin-runtime/workroom-portfolio-grant-assignment.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-grant-assignment.js +331 -0
- package/lib/plugin-runtime/workroom-portfolio-grant-assignment.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-kernel-authority.d.ts +23 -0
- package/lib/plugin-runtime/workroom-portfolio-kernel-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-kernel-authority.js +82 -0
- package/lib/plugin-runtime/workroom-portfolio-kernel-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-sponsor.d.ts +96 -0
- package/lib/plugin-runtime/workroom-portfolio-sponsor.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-portfolio-sponsor.js +313 -0
- package/lib/plugin-runtime/workroom-portfolio-sponsor.js.map +1 -0
- package/lib/plugin-runtime/workroom-preemption-runtime.d.ts +57 -0
- package/lib/plugin-runtime/workroom-preemption-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-preemption-runtime.js +163 -0
- package/lib/plugin-runtime/workroom-preemption-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-priority-authority.d.ts +11 -0
- package/lib/plugin-runtime/workroom-priority-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-priority-authority.js +72 -0
- package/lib/plugin-runtime/workroom-priority-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-profile-authority-composition.d.ts +61 -0
- package/lib/plugin-runtime/workroom-profile-authority-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-profile-authority-composition.js +231 -0
- package/lib/plugin-runtime/workroom-profile-authority-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-profile-authority-runtime.d.ts +228 -0
- package/lib/plugin-runtime/workroom-profile-authority-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-profile-authority-runtime.js +1132 -0
- package/lib/plugin-runtime/workroom-profile-authority-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-projection-outbound.d.ts +10 -0
- package/lib/plugin-runtime/workroom-projection-outbound.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-projection-outbound.js +35 -0
- package/lib/plugin-runtime/workroom-projection-outbound.js.map +1 -0
- package/lib/plugin-runtime/workroom-projection-runtime.d.ts +87 -0
- package/lib/plugin-runtime/workroom-projection-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-projection-runtime.js +421 -0
- package/lib/plugin-runtime/workroom-projection-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-remote-assignment-authority.d.ts +9 -0
- package/lib/plugin-runtime/workroom-remote-assignment-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-remote-assignment-authority.js +20 -0
- package/lib/plugin-runtime/workroom-remote-assignment-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-remote-callback-runtime.d.ts +38 -0
- package/lib/plugin-runtime/workroom-remote-callback-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-remote-callback-runtime.js +80 -0
- package/lib/plugin-runtime/workroom-remote-callback-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-remote-executor.d.ts +20 -0
- package/lib/plugin-runtime/workroom-remote-executor.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-remote-executor.js +42 -0
- package/lib/plugin-runtime/workroom-remote-executor.js.map +1 -0
- package/lib/plugin-runtime/workroom-reviewer-authority-runtime.d.ts +72 -0
- package/lib/plugin-runtime/workroom-reviewer-authority-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-reviewer-authority-runtime.js +142 -0
- package/lib/plugin-runtime/workroom-reviewer-authority-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-risk-acceptance-runtime.d.ts +112 -0
- package/lib/plugin-runtime/workroom-risk-acceptance-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-risk-acceptance-runtime.js +376 -0
- package/lib/plugin-runtime/workroom-risk-acceptance-runtime.js.map +1 -0
- package/lib/plugin-runtime/workroom-run-profile-pin-authority.d.ts +42 -0
- package/lib/plugin-runtime/workroom-run-profile-pin-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-run-profile-pin-authority.js +125 -0
- package/lib/plugin-runtime/workroom-run-profile-pin-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.d.ts +25 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.js +79 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-composition.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.d.ts +16 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.js +49 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-contract.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.d.ts +63 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.js +233 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-request-authority.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.d.ts +37 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.js +122 -0
- package/lib/plugin-runtime/workroom-scheduler-portfolio-supply.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-route-registry.d.ts +27 -0
- package/lib/plugin-runtime/workroom-scheduler-route-registry.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-route-registry.js +136 -0
- package/lib/plugin-runtime/workroom-scheduler-route-registry.js.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-runtime.d.ts +84 -0
- package/lib/plugin-runtime/workroom-scheduler-runtime.d.ts.map +1 -0
- package/lib/plugin-runtime/workroom-scheduler-runtime.js +231 -0
- package/lib/plugin-runtime/workroom-scheduler-runtime.js.map +1 -0
- package/lib/portfolio/capacity-control-outbox.d.ts +174 -0
- package/lib/portfolio/capacity-control-outbox.d.ts.map +1 -0
- package/lib/portfolio/capacity-control-outbox.js +338 -0
- package/lib/portfolio/capacity-control-outbox.js.map +1 -0
- package/lib/portfolio/database-capacity-control-outbox.d.ts +62 -0
- package/lib/portfolio/database-capacity-control-outbox.d.ts.map +1 -0
- package/lib/portfolio/database-capacity-control-outbox.js +166 -0
- package/lib/portfolio/database-capacity-control-outbox.js.map +1 -0
- package/lib/portfolio/file-capacity-control-outbox.d.ts +10 -0
- package/lib/portfolio/file-capacity-control-outbox.d.ts.map +1 -0
- package/lib/portfolio/file-capacity-control-outbox.js +113 -0
- package/lib/portfolio/file-capacity-control-outbox.js.map +1 -0
- package/lib/portfolio/file-portfolio-journal.d.ts +11 -0
- package/lib/portfolio/file-portfolio-journal.d.ts.map +1 -0
- package/lib/portfolio/file-portfolio-journal.js +196 -0
- package/lib/portfolio/file-portfolio-journal.js.map +1 -0
- package/lib/portfolio/portfolio-admission.d.ts +95 -0
- package/lib/portfolio/portfolio-admission.d.ts.map +1 -0
- package/lib/portfolio/portfolio-admission.js +1080 -0
- package/lib/portfolio/portfolio-admission.js.map +1 -0
- package/lib/portfolio/portfolio-journal.d.ts +359 -0
- package/lib/portfolio/portfolio-journal.d.ts.map +1 -0
- package/lib/portfolio/portfolio-journal.js +844 -0
- package/lib/portfolio/portfolio-journal.js.map +1 -0
- package/lib/portfolio/resource-bundle.d.ts +136 -0
- package/lib/portfolio/resource-bundle.d.ts.map +1 -0
- package/lib/portfolio/resource-bundle.js +387 -0
- package/lib/portfolio/resource-bundle.js.map +1 -0
- package/lib/portfolio/sponsor-projection.d.ts +78 -0
- package/lib/portfolio/sponsor-projection.d.ts.map +1 -0
- package/lib/portfolio/sponsor-projection.js +135 -0
- package/lib/portfolio/sponsor-projection.js.map +1 -0
- package/lib/prompt/assembly.d.ts.map +1 -1
- package/lib/prompt/assembly.js +1 -3
- package/lib/prompt/assembly.js.map +1 -1
- package/lib/prompt/prompt-builder.d.ts +1 -1
- package/lib/prompt/prompt-builder.d.ts.map +1 -1
- package/lib/prompt/system-prompt.d.ts +1 -1
- package/lib/prompt/system-prompt.js +2 -2
- package/lib/prompt/system-prompt.js.map +1 -1
- package/lib/reserved-tools.d.ts.map +1 -1
- package/lib/reserved-tools.js +0 -1
- package/lib/reserved-tools.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/hook-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/hook-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/index.d.ts +4 -11
- package/lib/{orchestrator → resource-hub}/index.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/index.js +4 -8
- package/lib/{orchestrator → resource-hub}/index.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/mcp-lifecycle.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/mcp-lifecycle.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/mcp-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/mcp-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/resolve-subagent-tools.d.ts +3 -3
- package/lib/resource-hub/resolve-subagent-tools.d.ts.map +1 -0
- package/lib/{orchestrator → resource-hub}/resolve-subagent-tools.js +18 -13
- package/lib/resource-hub/resolve-subagent-tools.js.map +1 -0
- package/lib/{orchestrator → resource-hub}/resource-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/resource-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/role-configs.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/role-configs.js +0 -2
- package/lib/{orchestrator → resource-hub}/role-configs.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/skill-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/skill-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/subagent-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/subagent-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/tool-registry.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/tool-registry.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/tool-selection.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/tool-selection.js.map +1 -1
- package/lib/{orchestrator → resource-hub}/types.d.ts +1 -1
- package/lib/{orchestrator → resource-hub}/types.d.ts.map +1 -1
- package/lib/{orchestrator → resource-hub}/types.js.map +1 -1
- package/lib/routing/workroom-bot-identity.d.ts +22 -0
- package/lib/routing/workroom-bot-identity.d.ts.map +1 -0
- package/lib/routing/workroom-bot-identity.js +46 -0
- package/lib/routing/workroom-bot-identity.js.map +1 -0
- package/lib/schedule-domain/budget-guard.d.ts +1 -1
- package/lib/schedule-domain/budget-guard.d.ts.map +1 -1
- package/lib/schedule-domain/budget-guard.js +9 -1
- package/lib/schedule-domain/budget-guard.js.map +1 -1
- package/lib/schedule-domain/execution-domain.d.ts +1 -0
- package/lib/schedule-domain/execution-domain.d.ts.map +1 -1
- package/lib/schedule-domain/execution-domain.js +3 -1
- package/lib/schedule-domain/execution-domain.js.map +1 -1
- package/lib/schedule-domain/schedule-execution-queue.d.ts +24 -0
- package/lib/schedule-domain/schedule-execution-queue.d.ts.map +1 -0
- package/lib/schedule-domain/schedule-execution-queue.js +123 -0
- package/lib/schedule-domain/schedule-execution-queue.js.map +1 -0
- package/lib/seam/seam-integration.d.ts +1 -1
- package/lib/seam/seam-integration.js +1 -1
- package/lib/seam/skill-service.d.ts +1 -1
- package/lib/security/exec-policy.d.ts +11 -1
- package/lib/security/exec-policy.d.ts.map +1 -1
- package/lib/security/exec-policy.js +16 -4
- package/lib/security/exec-policy.js.map +1 -1
- package/lib/security/policy-facade.d.ts.map +1 -1
- package/lib/security/policy-facade.js +60 -5
- package/lib/security/policy-facade.js.map +1 -1
- package/lib/security/sandbox-docker.js +1 -1
- package/lib/security/sandbox-docker.js.map +1 -1
- package/lib/security/sandbox.d.ts +2 -0
- package/lib/security/sandbox.d.ts.map +1 -1
- package/lib/security/sandbox.js +16 -4
- package/lib/security/sandbox.js.map +1 -1
- package/lib/security/turn-file-authority.d.ts +1 -1
- package/lib/security/turn-file-authority.d.ts.map +1 -1
- package/lib/security/turn-file-authority.js +10 -3
- package/lib/security/turn-file-authority.js.map +1 -1
- package/lib/security/turn-sandbox-authority.d.ts +13 -0
- package/lib/security/turn-sandbox-authority.d.ts.map +1 -0
- package/lib/security/turn-sandbox-authority.js +42 -0
- package/lib/security/turn-sandbox-authority.js.map +1 -0
- package/lib/service.d.ts +2 -0
- package/lib/service.d.ts.map +1 -1
- package/lib/service.js +2 -1
- package/lib/service.js.map +1 -1
- package/lib/session/approval-port.d.ts +2 -0
- package/lib/session/approval-port.d.ts.map +1 -1
- package/lib/session/approval-port.js.map +1 -1
- package/lib/session/index.d.ts +2 -6
- package/lib/session/index.d.ts.map +1 -1
- package/lib/session/index.js +2 -4
- package/lib/session/index.js.map +1 -1
- package/lib/session/session-io.d.ts +2 -6
- package/lib/session/session-io.d.ts.map +1 -1
- package/lib/session/session-io.js +4 -20
- package/lib/session/session-io.js.map +1 -1
- package/lib/session/session-system.d.ts +0 -2
- package/lib/session/session-system.d.ts.map +1 -1
- package/lib/session/session-system.js +2 -13
- package/lib/session/session-system.js.map +1 -1
- package/lib/session/turn-ingress-session.d.ts +1 -5
- package/lib/session/turn-ingress-session.d.ts.map +1 -1
- package/lib/session/turn-ingress-session.js +27 -29
- package/lib/session/turn-ingress-session.js.map +1 -1
- package/lib/session-tree-runtime.d.ts +15 -0
- package/lib/session-tree-runtime.d.ts.map +1 -0
- package/lib/{session-tree-runtime-registry.js → session-tree-runtime.js} +5 -15
- package/lib/session-tree-runtime.js.map +1 -0
- package/lib/skill/index.d.ts +2 -2
- package/lib/skill/index.d.ts.map +1 -1
- package/lib/skill/index.js +1 -1
- package/lib/skill/skill-registry-as-service.d.ts +1 -1
- package/lib/skill/skill-system.d.ts +4 -4
- package/lib/skill/skill-system.d.ts.map +1 -1
- package/lib/skill/skill-system.js +2 -2
- package/lib/skill/skill-system.js.map +1 -1
- package/lib/subagent/subagent-runtime.d.ts +2 -7
- package/lib/subagent/subagent-runtime.d.ts.map +1 -1
- package/lib/subagent/subagent-runtime.js +4 -43
- package/lib/subagent/subagent-runtime.js.map +1 -1
- package/lib/subagent/subagent-system-init.d.ts.map +1 -1
- package/lib/subagent/subagent-system-init.js +0 -2
- package/lib/subagent/subagent-system-init.js.map +1 -1
- package/lib/subagent-ai-events.d.ts +1 -1
- package/lib/subagent-ai-events.js +1 -1
- package/lib/subagent-preset.d.ts +1 -1
- package/lib/subagent-preset.d.ts.map +1 -1
- package/lib/subagent-prompt.d.ts +0 -2
- package/lib/subagent-prompt.d.ts.map +1 -1
- package/lib/subagent-prompt.js +3 -3
- package/lib/subagent-prompt.js.map +1 -1
- package/lib/task-executor.d.ts +1 -0
- package/lib/task-executor.d.ts.map +1 -1
- package/lib/task-executor.js +4 -1
- package/lib/task-executor.js.map +1 -1
- package/lib/tool/classic-tool-execution-authority.js +2 -2
- package/lib/tool/classic-tool-execution-authority.js.map +1 -1
- package/lib/tool/context-tools.d.ts +1 -4
- package/lib/tool/context-tools.d.ts.map +1 -1
- package/lib/tool/context-tools.js +0 -50
- package/lib/tool/context-tools.js.map +1 -1
- package/lib/tool/contracts.d.ts +1 -1
- package/lib/tool/conversation-reference-tool.d.ts +5 -0
- package/lib/tool/conversation-reference-tool.d.ts.map +1 -0
- package/lib/tool/conversation-reference-tool.js +40 -0
- package/lib/tool/conversation-reference-tool.js.map +1 -0
- package/lib/tool/index.d.ts +1 -0
- package/lib/tool/index.d.ts.map +1 -1
- package/lib/tool/index.js +1 -0
- package/lib/tool/index.js.map +1 -1
- package/lib/tool/prepare-turn-tools.d.ts.map +1 -1
- package/lib/tool/prepare-turn-tools.js +7 -22
- package/lib/tool/prepare-turn-tools.js.map +1 -1
- package/lib/tool/runtime.d.ts +3 -4
- package/lib/tool/runtime.d.ts.map +1 -1
- package/lib/tool/runtime.js +0 -1
- package/lib/tool/runtime.js.map +1 -1
- package/lib/tool/sources.d.ts +3 -4
- package/lib/tool/sources.d.ts.map +1 -1
- package/lib/tool/sources.js +2 -6
- package/lib/tool/sources.js.map +1 -1
- package/lib/tool/tool-approval-once-store.d.ts +1 -1
- package/lib/tool/tool-approval-once-store.js +1 -1
- package/lib/tool/tool-system.d.ts.map +1 -1
- package/lib/tool/tool-system.js.map +1 -1
- package/lib/tool/turn-tool-runtime.d.ts +2 -1
- package/lib/tool/turn-tool-runtime.d.ts.map +1 -1
- package/lib/tool/turn-tool-runtime.js +76 -21
- package/lib/tool/turn-tool-runtime.js.map +1 -1
- package/lib/tool-bridge.d.ts +2 -2
- package/lib/tool-bridge.js +1 -1
- package/lib/tool-catalog/deferred-turn-controller.d.ts +1 -1
- package/lib/tool-catalog/tool-catalog.d.ts +1 -1
- package/lib/turn/auto-continue.d.ts +1 -1
- package/lib/turn/deferred-delivery.d.ts +1 -1
- package/lib/turn/inbound-media.d.ts +12 -8
- package/lib/turn/inbound-media.d.ts.map +1 -1
- package/lib/turn/inbound-media.js +61 -42
- package/lib/turn/inbound-media.js.map +1 -1
- package/lib/turn/inbound-queue-config.d.ts +1 -1
- package/lib/turn/inbound-queue-runtime.d.ts +1 -1
- package/lib/turn/inbound-turn-queue.d.ts +1 -1
- package/lib/turn/index.d.ts +1 -1
- package/lib/turn/index.d.ts.map +1 -1
- package/lib/turn/index.js.map +1 -1
- package/lib/turn/persist-deferred-context.d.ts +1 -1
- package/lib/turn/persist-subagent-context.d.ts +1 -1
- package/lib/turn/process-stream.d.ts +1 -1
- package/lib/turn/prompt-api.d.ts +1 -1
- package/lib/turn/prompt-controller.d.ts +6 -0
- package/lib/turn/prompt-controller.d.ts.map +1 -1
- package/lib/turn/prompt-controller.js +58 -5
- package/lib/turn/prompt-controller.js.map +1 -1
- package/lib/turn/turn-ingress.d.ts +55 -5
- package/lib/turn/turn-ingress.d.ts.map +1 -1
- package/lib/turn/turn-ingress.js +18 -0
- package/lib/turn/turn-ingress.js.map +1 -1
- package/lib/turn/turn-pipeline.d.ts.map +1 -1
- package/lib/turn/turn-pipeline.js +5 -4
- package/lib/turn/turn-pipeline.js.map +1 -1
- package/lib/utils/keyed-mutex.d.ts +1 -1
- package/lib/utils/keyed-mutex.d.ts.map +1 -1
- package/lib/utils/keyed-mutex.js +32 -5
- package/lib/utils/keyed-mutex.js.map +1 -1
- package/lib/workroom/acceptance-control.d.ts +76 -0
- package/lib/workroom/acceptance-control.d.ts.map +1 -0
- package/lib/workroom/acceptance-control.js +335 -0
- package/lib/workroom/acceptance-control.js.map +1 -0
- package/lib/workroom/acceptance-policy.d.ts +152 -0
- package/lib/workroom/acceptance-policy.d.ts.map +1 -0
- package/lib/workroom/acceptance-policy.js +610 -0
- package/lib/workroom/acceptance-policy.js.map +1 -0
- package/lib/workroom/accepted-source-memory-application.d.ts +113 -0
- package/lib/workroom/accepted-source-memory-application.d.ts.map +1 -0
- package/lib/workroom/accepted-source-memory-application.js +327 -0
- package/lib/workroom/accepted-source-memory-application.js.map +1 -0
- package/lib/workroom/accepted-source-projector.d.ts +89 -0
- package/lib/workroom/accepted-source-projector.d.ts.map +1 -0
- package/lib/workroom/accepted-source-projector.js +281 -0
- package/lib/workroom/accepted-source-projector.js.map +1 -0
- package/lib/workroom/assignment-authority-grant-application.d.ts +125 -0
- package/lib/workroom/assignment-authority-grant-application.d.ts.map +1 -0
- package/lib/workroom/assignment-authority-grant-application.js +317 -0
- package/lib/workroom/assignment-authority-grant-application.js.map +1 -0
- package/lib/workroom/assignment-authority-grant-repository.d.ts +151 -0
- package/lib/workroom/assignment-authority-grant-repository.d.ts.map +1 -0
- package/lib/workroom/assignment-authority-grant-repository.js +387 -0
- package/lib/workroom/assignment-authority-grant-repository.js.map +1 -0
- package/lib/workroom/assignment-executor.d.ts +110 -0
- package/lib/workroom/assignment-executor.d.ts.map +1 -0
- package/lib/workroom/assignment-executor.js +371 -0
- package/lib/workroom/assignment-executor.js.map +1 -0
- package/lib/workroom/assignment-observation-ingress.d.ts +21 -0
- package/lib/workroom/assignment-observation-ingress.d.ts.map +1 -0
- package/lib/workroom/assignment-observation-ingress.js +24 -0
- package/lib/workroom/assignment-observation-ingress.js.map +1 -0
- package/lib/workroom/canonical-value.d.ts +7 -0
- package/lib/workroom/canonical-value.d.ts.map +1 -0
- package/lib/workroom/canonical-value.js +32 -0
- package/lib/workroom/canonical-value.js.map +1 -0
- package/lib/workroom/catalog-definition.d.ts +49 -0
- package/lib/workroom/catalog-definition.d.ts.map +1 -0
- package/lib/workroom/catalog-definition.js +2 -0
- package/lib/workroom/catalog-definition.js.map +1 -0
- package/lib/workroom/catalog.d.ts +80 -0
- package/lib/workroom/catalog.d.ts.map +1 -0
- package/lib/workroom/catalog.js +372 -0
- package/lib/workroom/catalog.js.map +1 -0
- package/lib/workroom/database-project-knowledge-journal.d.ts +62 -0
- package/lib/workroom/database-project-knowledge-journal.d.ts.map +1 -0
- package/lib/workroom/database-project-knowledge-journal.js +161 -0
- package/lib/workroom/database-project-knowledge-journal.js.map +1 -0
- package/lib/workroom/durable-file-store.d.ts +52 -0
- package/lib/workroom/durable-file-store.d.ts.map +1 -0
- package/lib/workroom/durable-file-store.js +117 -0
- package/lib/workroom/durable-file-store.js.map +1 -0
- package/lib/workroom/dynamic-workflow-planner.d.ts +86 -0
- package/lib/workroom/dynamic-workflow-planner.d.ts.map +1 -0
- package/lib/workroom/dynamic-workflow-planner.js +260 -0
- package/lib/workroom/dynamic-workflow-planner.js.map +1 -0
- package/lib/workroom/effect-blocker-repository.d.ts +35 -0
- package/lib/workroom/effect-blocker-repository.d.ts.map +1 -0
- package/lib/workroom/effect-blocker-repository.js +174 -0
- package/lib/workroom/effect-blocker-repository.js.map +1 -0
- package/lib/workroom/effect-ledger.d.ts +191 -0
- package/lib/workroom/effect-ledger.d.ts.map +1 -0
- package/lib/workroom/effect-ledger.js +443 -0
- package/lib/workroom/effect-ledger.js.map +1 -0
- package/lib/workroom/file-accepted-source-memory-repository.d.ts +15 -0
- package/lib/workroom/file-accepted-source-memory-repository.d.ts.map +1 -0
- package/lib/workroom/file-accepted-source-memory-repository.js +133 -0
- package/lib/workroom/file-accepted-source-memory-repository.js.map +1 -0
- package/lib/workroom/file-effect-ledger.d.ts +10 -0
- package/lib/workroom/file-effect-ledger.d.ts.map +1 -0
- package/lib/workroom/file-effect-ledger.js +118 -0
- package/lib/workroom/file-effect-ledger.js.map +1 -0
- package/lib/workroom/file-human-ingress-application.d.ts +10 -0
- package/lib/workroom/file-human-ingress-application.d.ts.map +1 -0
- package/lib/workroom/file-human-ingress-application.js +177 -0
- package/lib/workroom/file-human-ingress-application.js.map +1 -0
- package/lib/workroom/file-human-ingress.d.ts +24 -0
- package/lib/workroom/file-human-ingress.d.ts.map +1 -0
- package/lib/workroom/file-human-ingress.js +234 -0
- package/lib/workroom/file-human-ingress.js.map +1 -0
- package/lib/workroom/file-interaction-space-binding-repository.d.ts +24 -0
- package/lib/workroom/file-interaction-space-binding-repository.d.ts.map +1 -0
- package/lib/workroom/file-interaction-space-binding-repository.js +293 -0
- package/lib/workroom/file-interaction-space-binding-repository.js.map +1 -0
- package/lib/workroom/file-profile-journal.d.ts +32 -0
- package/lib/workroom/file-profile-journal.d.ts.map +1 -0
- package/lib/workroom/file-profile-journal.js +308 -0
- package/lib/workroom/file-profile-journal.js.map +1 -0
- package/lib/workroom/git-workspace-gateway.d.ts +149 -0
- package/lib/workroom/git-workspace-gateway.d.ts.map +1 -0
- package/lib/workroom/git-workspace-gateway.js +248 -0
- package/lib/workroom/git-workspace-gateway.js.map +1 -0
- package/lib/workroom/human-ingress-application.d.ts +126 -0
- package/lib/workroom/human-ingress-application.d.ts.map +1 -0
- package/lib/workroom/human-ingress-application.js +414 -0
- package/lib/workroom/human-ingress-application.js.map +1 -0
- package/lib/workroom/human-ingress-orchestrator.d.ts +99 -0
- package/lib/workroom/human-ingress-orchestrator.d.ts.map +1 -0
- package/lib/workroom/human-ingress-orchestrator.js +234 -0
- package/lib/workroom/human-ingress-orchestrator.js.map +1 -0
- package/lib/workroom/human-ingress-source-reader.d.ts +29 -0
- package/lib/workroom/human-ingress-source-reader.d.ts.map +1 -0
- package/lib/workroom/human-ingress-source-reader.js +119 -0
- package/lib/workroom/human-ingress-source-reader.js.map +1 -0
- package/lib/workroom/human-ingress.d.ts +182 -0
- package/lib/workroom/human-ingress.d.ts.map +1 -0
- package/lib/workroom/human-ingress.js +526 -0
- package/lib/workroom/human-ingress.js.map +1 -0
- package/lib/workroom/interaction-space-binding-service.d.ts +57 -0
- package/lib/workroom/interaction-space-binding-service.d.ts.map +1 -0
- package/lib/workroom/interaction-space-binding-service.js +197 -0
- package/lib/workroom/interaction-space-binding-service.js.map +1 -0
- package/lib/workroom/interaction-space-router.d.ts +75 -0
- package/lib/workroom/interaction-space-router.d.ts.map +1 -0
- package/lib/workroom/interaction-space-router.js +243 -0
- package/lib/workroom/interaction-space-router.js.map +1 -0
- package/lib/workroom/journal-model.d.ts +40 -0
- package/lib/workroom/journal-model.d.ts.map +1 -0
- package/lib/workroom/journal-model.js +12 -0
- package/lib/workroom/journal-model.js.map +1 -0
- package/lib/workroom/journal.d.ts +214 -0
- package/lib/workroom/journal.d.ts.map +1 -0
- package/lib/workroom/journal.js +1935 -0
- package/lib/workroom/journal.js.map +1 -0
- package/lib/workroom/kernel-contracts.d.ts +167 -0
- package/lib/workroom/kernel-contracts.d.ts.map +1 -0
- package/lib/workroom/kernel-contracts.js +2 -0
- package/lib/workroom/kernel-contracts.js.map +1 -0
- package/lib/workroom/kernel-state.d.ts +5 -0
- package/lib/workroom/kernel-state.d.ts.map +1 -0
- package/lib/workroom/kernel-state.js +819 -0
- package/lib/workroom/kernel-state.js.map +1 -0
- package/lib/workroom/legacy-embedded-payload-migration.d.ts +89 -0
- package/lib/workroom/legacy-embedded-payload-migration.d.ts.map +1 -0
- package/lib/workroom/legacy-embedded-payload-migration.js +312 -0
- package/lib/workroom/legacy-embedded-payload-migration.js.map +1 -0
- package/lib/workroom/legacy-run-offline-migration.d.ts +84 -0
- package/lib/workroom/legacy-run-offline-migration.d.ts.map +1 -0
- package/lib/workroom/legacy-run-offline-migration.js +470 -0
- package/lib/workroom/legacy-run-offline-migration.js.map +1 -0
- package/lib/workroom/local-assignment-executor.d.ts +59 -0
- package/lib/workroom/local-assignment-executor.d.ts.map +1 -0
- package/lib/workroom/local-assignment-executor.js +197 -0
- package/lib/workroom/local-assignment-executor.js.map +1 -0
- package/lib/workroom/local-assignment-issuance.d.ts +68 -0
- package/lib/workroom/local-assignment-issuance.d.ts.map +1 -0
- package/lib/workroom/local-assignment-issuance.js +128 -0
- package/lib/workroom/local-assignment-issuance.js.map +1 -0
- package/lib/workroom/plan-approval-control.d.ts +52 -0
- package/lib/workroom/plan-approval-control.d.ts.map +1 -0
- package/lib/workroom/plan-approval-control.js +9 -0
- package/lib/workroom/plan-approval-control.js.map +1 -0
- package/lib/workroom/plan-revision.d.ts +44 -0
- package/lib/workroom/plan-revision.d.ts.map +1 -0
- package/lib/workroom/plan-revision.js +133 -0
- package/lib/workroom/plan-revision.js.map +1 -0
- package/lib/workroom/profile-compiler.d.ts +130 -0
- package/lib/workroom/profile-compiler.d.ts.map +1 -0
- package/lib/workroom/profile-compiler.js +357 -0
- package/lib/workroom/profile-compiler.js.map +1 -0
- package/lib/workroom/profile-registry.d.ts +191 -0
- package/lib/workroom/profile-registry.d.ts.map +1 -0
- package/lib/workroom/profile-registry.js +698 -0
- package/lib/workroom/profile-registry.js.map +1 -0
- package/lib/workroom/project-knowledge-registry.d.ts +136 -0
- package/lib/workroom/project-knowledge-registry.d.ts.map +1 -0
- package/lib/workroom/project-knowledge-registry.js +429 -0
- package/lib/workroom/project-knowledge-registry.js.map +1 -0
- package/lib/workroom/projection-outbox.d.ts +254 -0
- package/lib/workroom/projection-outbox.d.ts.map +1 -0
- package/lib/workroom/projection-outbox.js +1312 -0
- package/lib/workroom/projection-outbox.js.map +1 -0
- package/lib/workroom/remote-assignment-dispatch-command.d.ts +31 -0
- package/lib/workroom/remote-assignment-dispatch-command.d.ts.map +1 -0
- package/lib/workroom/remote-assignment-dispatch-command.js +56 -0
- package/lib/workroom/remote-assignment-dispatch-command.js.map +1 -0
- package/lib/workroom/remote-assignment-issuance.d.ts +88 -0
- package/lib/workroom/remote-assignment-issuance.d.ts.map +1 -0
- package/lib/workroom/remote-assignment-issuance.js +201 -0
- package/lib/workroom/remote-assignment-issuance.js.map +1 -0
- package/lib/workroom/remote-callback-application.d.ts +115 -0
- package/lib/workroom/remote-callback-application.d.ts.map +1 -0
- package/lib/workroom/remote-callback-application.js +570 -0
- package/lib/workroom/remote-callback-application.js.map +1 -0
- package/lib/workroom/remote-callback-gateway.d.ts +60 -0
- package/lib/workroom/remote-callback-gateway.d.ts.map +1 -0
- package/lib/workroom/remote-callback-gateway.js +173 -0
- package/lib/workroom/remote-callback-gateway.js.map +1 -0
- package/lib/workroom/remote-callback-inbox.d.ts +278 -0
- package/lib/workroom/remote-callback-inbox.d.ts.map +1 -0
- package/lib/workroom/remote-callback-inbox.js +1088 -0
- package/lib/workroom/remote-callback-inbox.js.map +1 -0
- package/lib/workroom/remote-callback-reconciliation-worker.d.ts +60 -0
- package/lib/workroom/remote-callback-reconciliation-worker.d.ts.map +1 -0
- package/lib/workroom/remote-callback-reconciliation-worker.js +197 -0
- package/lib/workroom/remote-callback-reconciliation-worker.js.map +1 -0
- package/lib/workroom/remote-dispatch-admission.d.ts +45 -0
- package/lib/workroom/remote-dispatch-admission.d.ts.map +1 -0
- package/lib/workroom/remote-dispatch-admission.js +187 -0
- package/lib/workroom/remote-dispatch-admission.js.map +1 -0
- package/lib/workroom/remote-dispatch-outbox.d.ts +203 -0
- package/lib/workroom/remote-dispatch-outbox.d.ts.map +1 -0
- package/lib/workroom/remote-dispatch-outbox.js +765 -0
- package/lib/workroom/remote-dispatch-outbox.js.map +1 -0
- package/lib/workroom/remote-dispatch-scheduler.d.ts +36 -0
- package/lib/workroom/remote-dispatch-scheduler.d.ts.map +1 -0
- package/lib/workroom/remote-dispatch-scheduler.js +133 -0
- package/lib/workroom/remote-dispatch-scheduler.js.map +1 -0
- package/lib/workroom/remote-dispatch-worker.d.ts +22 -0
- package/lib/workroom/remote-dispatch-worker.d.ts.map +1 -0
- package/lib/workroom/remote-dispatch-worker.js +124 -0
- package/lib/workroom/remote-dispatch-worker.js.map +1 -0
- package/lib/workroom/remote-dispatch.d.ts +79 -0
- package/lib/workroom/remote-dispatch.d.ts.map +1 -0
- package/lib/workroom/remote-dispatch.js +220 -0
- package/lib/workroom/remote-dispatch.js.map +1 -0
- package/lib/workroom/role-capability-snapshot.d.ts +88 -0
- package/lib/workroom/role-capability-snapshot.d.ts.map +1 -0
- package/lib/workroom/role-capability-snapshot.js +456 -0
- package/lib/workroom/role-capability-snapshot.js.map +1 -0
- package/lib/workroom/runtime.d.ts +109 -0
- package/lib/workroom/runtime.d.ts.map +1 -0
- package/lib/workroom/runtime.js +450 -0
- package/lib/workroom/runtime.js.map +1 -0
- package/lib/workroom/scheduler-priority-control.d.ts +35 -0
- package/lib/workroom/scheduler-priority-control.d.ts.map +1 -0
- package/lib/workroom/scheduler-priority-control.js +9 -0
- package/lib/workroom/scheduler-priority-control.js.map +1 -0
- package/lib/workroom/workflow-plan-builder.d.ts +88 -0
- package/lib/workroom/workflow-plan-builder.d.ts.map +1 -0
- package/lib/workroom/workflow-plan-builder.js +232 -0
- package/lib/workroom/workflow-plan-builder.js.map +1 -0
- package/lib/workroom/workroom-assignment-knowledge-context.d.ts +102 -0
- package/lib/workroom/workroom-assignment-knowledge-context.d.ts.map +1 -0
- package/lib/workroom/workroom-assignment-knowledge-context.js +127 -0
- package/lib/workroom/workroom-assignment-knowledge-context.js.map +1 -0
- package/lib/workroom/workroom-kernel.d.ts +141 -0
- package/lib/workroom/workroom-kernel.d.ts.map +1 -0
- package/lib/workroom/workroom-kernel.js +1325 -0
- package/lib/workroom/workroom-kernel.js.map +1 -0
- package/lib/workroom/workroom-preemption.d.ts +65 -0
- package/lib/workroom/workroom-preemption.d.ts.map +1 -0
- package/lib/workroom/workroom-preemption.js +213 -0
- package/lib/workroom/workroom-preemption.js.map +1 -0
- package/lib/workroom/workroom-scheduler-application.d.ts +43 -0
- package/lib/workroom/workroom-scheduler-application.d.ts.map +1 -0
- package/lib/workroom/workroom-scheduler-application.js +71 -0
- package/lib/workroom/workroom-scheduler-application.js.map +1 -0
- package/lib/workroom/workroom-scheduler.d.ts +135 -0
- package/lib/workroom/workroom-scheduler.d.ts.map +1 -0
- package/lib/workroom/workroom-scheduler.js +649 -0
- package/lib/workroom/workroom-scheduler.js.map +1 -0
- package/lib/workroom/workroom-task-report-store.d.ts +131 -0
- package/lib/workroom/workroom-task-report-store.d.ts.map +1 -0
- package/lib/workroom/workroom-task-report-store.js +528 -0
- package/lib/workroom/workroom-task-report-store.js.map +1 -0
- package/lib/zhin-agent/index.d.ts +7 -22
- package/lib/zhin-agent/index.d.ts.map +1 -1
- package/lib/zhin-agent/index.js +5 -33
- package/lib/zhin-agent/index.js.map +1 -1
- package/lib/zhin-agent/runtime-modules.d.ts +3 -3
- package/lib/zhin-agent/runtime-modules.d.ts.map +1 -1
- package/lib/zhin-agent/runtime-modules.js +3 -3
- package/lib/zhin-agent/runtime-modules.js.map +1 -1
- package/package.json +10 -16
- package/lib/a2a/delegation-message.d.ts +0 -14
- package/lib/a2a/delegation-message.d.ts.map +0 -1
- package/lib/a2a/delegation-message.js +0 -53
- package/lib/a2a/delegation-message.js.map +0 -1
- package/lib/a2a/task-state.d.ts +0 -9
- package/lib/a2a/task-state.d.ts.map +0 -1
- package/lib/a2a/task-state.js +0 -53
- package/lib/a2a/task-state.js.map +0 -1
- package/lib/assistant/runtime-registry.d.ts +0 -23
- package/lib/assistant/runtime-registry.d.ts.map +0 -1
- package/lib/assistant/runtime-registry.js +0 -27
- package/lib/assistant/runtime-registry.js.map +0 -1
- package/lib/authoring/define-dynamic.d.ts +0 -4
- package/lib/authoring/define-dynamic.d.ts.map +0 -1
- package/lib/authoring/define-dynamic.js +0 -8
- package/lib/authoring/define-dynamic.js.map +0 -1
- package/lib/authoring/define-state.d.ts +0 -4
- package/lib/authoring/define-state.d.ts.map +0 -1
- package/lib/authoring/define-state.js +0 -8
- package/lib/authoring/define-state.js.map +0 -1
- package/lib/builtin/five-agent/strategy.d.ts +0 -4
- package/lib/builtin/five-agent/strategy.d.ts.map +0 -1
- package/lib/builtin/five-agent/strategy.js +0 -42
- package/lib/builtin/five-agent/strategy.js.map +0 -1
- package/lib/builtin/memory-search-tool.d.ts +0 -2
- package/lib/builtin/memory-search-tool.d.ts.map +0 -1
- package/lib/builtin/memory-search-tool.js +0 -58
- package/lib/builtin/memory-search-tool.js.map +0 -1
- package/lib/builtin/memory-upsert-tool.d.ts +0 -2
- package/lib/builtin/memory-upsert-tool.d.ts.map +0 -1
- package/lib/builtin/memory-upsert-tool.js +0 -72
- package/lib/builtin/memory-upsert-tool.js.map +0 -1
- package/lib/builtin/orchestration-tools.d.ts +0 -7
- package/lib/builtin/orchestration-tools.d.ts.map +0 -1
- package/lib/builtin/orchestration-tools.js +0 -259
- package/lib/builtin/orchestration-tools.js.map +0 -1
- package/lib/connection/authorization-flow.d.ts +0 -26
- package/lib/connection/authorization-flow.d.ts.map +0 -1
- package/lib/connection/authorization-flow.js +0 -76
- package/lib/connection/authorization-flow.js.map +0 -1
- package/lib/connection/index.d.ts +0 -3
- package/lib/connection/index.d.ts.map +0 -1
- package/lib/connection/index.js +0 -2
- package/lib/connection/index.js.map +0 -1
- package/lib/dynamic/dynamic-registry.d.ts +0 -34
- package/lib/dynamic/dynamic-registry.d.ts.map +0 -1
- package/lib/dynamic/dynamic-registry.js +0 -52
- package/lib/dynamic/dynamic-registry.js.map +0 -1
- package/lib/init/bootstrap-gate.d.ts +0 -6
- package/lib/init/bootstrap-gate.d.ts.map +0 -1
- package/lib/init/bootstrap-gate.js +0 -28
- package/lib/init/bootstrap-gate.js.map +0 -1
- package/lib/memory-entry-registry.d.ts +0 -13
- package/lib/memory-entry-registry.d.ts.map +0 -1
- package/lib/memory-entry-registry.js +0 -24
- package/lib/memory-entry-registry.js.map +0 -1
- package/lib/orchestration-memory-hook.d.ts +0 -3
- package/lib/orchestration-memory-hook.d.ts.map +0 -1
- package/lib/orchestration-memory-hook.js +0 -22
- package/lib/orchestration-memory-hook.js.map +0 -1
- package/lib/orchestration-runtime-registry.d.ts +0 -16
- package/lib/orchestration-runtime-registry.d.ts.map +0 -1
- package/lib/orchestration-runtime-registry.js +0 -20
- package/lib/orchestration-runtime-registry.js.map +0 -1
- package/lib/orchestrator/agent-dispatcher.d.ts +0 -171
- package/lib/orchestrator/agent-dispatcher.d.ts.map +0 -1
- package/lib/orchestrator/agent-dispatcher.js +0 -415
- package/lib/orchestrator/agent-dispatcher.js.map +0 -1
- package/lib/orchestrator/bootstrap-executors.d.ts +0 -7
- package/lib/orchestrator/bootstrap-executors.d.ts.map +0 -1
- package/lib/orchestrator/bootstrap-executors.js +0 -73
- package/lib/orchestrator/bootstrap-executors.js.map +0 -1
- package/lib/orchestrator/orchestration-mappers.d.ts +0 -9
- package/lib/orchestrator/orchestration-mappers.d.ts.map +0 -1
- package/lib/orchestrator/orchestration-mappers.js +0 -117
- package/lib/orchestrator/orchestration-mappers.js.map +0 -1
- package/lib/orchestrator/orchestration-repository.d.ts +0 -91
- package/lib/orchestrator/orchestration-repository.d.ts.map +0 -1
- package/lib/orchestrator/orchestration-repository.js +0 -389
- package/lib/orchestrator/orchestration-repository.js.map +0 -1
- package/lib/orchestrator/orchestration-service.d.ts +0 -133
- package/lib/orchestrator/orchestration-service.d.ts.map +0 -1
- package/lib/orchestrator/orchestration-service.js +0 -582
- package/lib/orchestrator/orchestration-service.js.map +0 -1
- package/lib/orchestrator/orchestration-source.d.ts +0 -5
- package/lib/orchestrator/orchestration-source.d.ts.map +0 -1
- package/lib/orchestrator/orchestration-source.js +0 -22
- package/lib/orchestrator/orchestration-source.js.map +0 -1
- package/lib/orchestrator/orchestration-types.d.ts +0 -88
- package/lib/orchestrator/orchestration-types.d.ts.map +0 -1
- package/lib/orchestrator/orchestration-types.js +0 -2
- package/lib/orchestrator/orchestration-types.js.map +0 -1
- package/lib/orchestrator/remote-agent-registry.d.ts +0 -37
- package/lib/orchestrator/remote-agent-registry.d.ts.map +0 -1
- package/lib/orchestrator/remote-agent-registry.js +0 -178
- package/lib/orchestrator/remote-agent-registry.js.map +0 -1
- package/lib/orchestrator/remote-task-executor.d.ts +0 -10
- package/lib/orchestrator/remote-task-executor.d.ts.map +0 -1
- package/lib/orchestrator/remote-task-executor.js +0 -231
- package/lib/orchestrator/remote-task-executor.js.map +0 -1
- package/lib/orchestrator/remote-task-poller.d.ts +0 -18
- package/lib/orchestrator/remote-task-poller.d.ts.map +0 -1
- package/lib/orchestrator/remote-task-poller.js +0 -84
- package/lib/orchestrator/remote-task-poller.js.map +0 -1
- package/lib/orchestrator/resolve-subagent-tools.d.ts.map +0 -1
- package/lib/orchestrator/resolve-subagent-tools.js.map +0 -1
- package/lib/orchestrator/task-queue.d.ts +0 -167
- package/lib/orchestrator/task-queue.d.ts.map +0 -1
- package/lib/orchestrator/task-queue.js +0 -416
- package/lib/orchestrator/task-queue.js.map +0 -1
- package/lib/session/passive-group-buffer.d.ts +0 -15
- package/lib/session/passive-group-buffer.d.ts.map +0 -1
- package/lib/session/passive-group-buffer.js +0 -50
- package/lib/session/passive-group-buffer.js.map +0 -1
- package/lib/session/passive-group-session.d.ts +0 -10
- package/lib/session/passive-group-session.d.ts.map +0 -1
- package/lib/session/passive-group-session.js +0 -32
- package/lib/session/passive-group-session.js.map +0 -1
- package/lib/session-tree-runtime-registry.d.ts +0 -22
- package/lib/session-tree-runtime-registry.d.ts.map +0 -1
- package/lib/session-tree-runtime-registry.js.map +0 -1
- package/lib/state/agent-state-store.d.ts +0 -18
- package/lib/state/agent-state-store.d.ts.map +0 -1
- package/lib/state/agent-state-store.js +0 -50
- package/lib/state/agent-state-store.js.map +0 -1
- /package/lib/{orchestrator → resource-hub}/hook-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/hook-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/mcp-lifecycle.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/mcp-lifecycle.js +0 -0
- /package/lib/{orchestrator → resource-hub}/mcp-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/mcp-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/resource-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/resource-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/role-configs.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/skill-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/skill-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/subagent-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/subagent-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/tool-registry.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/tool-registry.js +0 -0
- /package/lib/{orchestrator → resource-hub}/tool-selection.d.ts +0 -0
- /package/lib/{orchestrator → resource-hub}/tool-selection.js +0 -0
- /package/lib/{orchestrator → resource-hub}/types.js +0 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { link as nodeLink, mkdir as nodeMkdir, open as nodeOpen, readFile as nodeReadFile, readdir as nodeReaddir, unlink as nodeUnlink, } from 'node:fs/promises';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { compareCanonicalWorkroomText, canonicalWorkroomJson as stableJson, deepFreezeWorkroomValue as deepFreeze, } from './canonical-value.js';
|
|
5
|
+
import { assertWorkroomRemoteDispatchRetry, createWorkroomRemoteDispatchOutboxItem, } from './remote-dispatch.js';
|
|
6
|
+
const nodeFileSystem = Object.freeze({
|
|
7
|
+
mkdir: async (path) => {
|
|
8
|
+
await nodeMkdir(path);
|
|
9
|
+
},
|
|
10
|
+
readdir: async (path) => await nodeReaddir(path),
|
|
11
|
+
readFile: async (path, encoding) => await nodeReadFile(path, encoding),
|
|
12
|
+
open: async (path, flags) => await nodeOpen(path, flags),
|
|
13
|
+
link: async (existingPath, newPath) => await nodeLink(existingPath, newPath),
|
|
14
|
+
unlink: async (path) => await nodeUnlink(path),
|
|
15
|
+
});
|
|
16
|
+
export class WorkroomRemoteDispatchOutboxSequenceConflictError extends Error {
|
|
17
|
+
dispatchId;
|
|
18
|
+
expectedSequence;
|
|
19
|
+
actualSequence;
|
|
20
|
+
constructor(dispatchId, expectedSequence, actualSequence) {
|
|
21
|
+
super(`Workroom Remote Dispatch Outbox ${dispatchId} sequence conflict: `
|
|
22
|
+
+ `expected ${expectedSequence}, actual ${actualSequence}`);
|
|
23
|
+
this.dispatchId = dispatchId;
|
|
24
|
+
this.expectedSequence = expectedSequence;
|
|
25
|
+
this.actualSequence = actualSequence;
|
|
26
|
+
this.name = 'WorkroomRemoteDispatchOutboxSequenceConflictError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class MemoryWorkroomRemoteDispatchOutboxRepository {
|
|
30
|
+
#events = new Map();
|
|
31
|
+
async read(dispatchId) {
|
|
32
|
+
return project(this.#events.get(identifier(dispatchId, 'dispatchId')) ?? []);
|
|
33
|
+
}
|
|
34
|
+
async listRunnable(now) {
|
|
35
|
+
const trustedNow = timestamp(now, 'now');
|
|
36
|
+
return Object.freeze([...this.#events.values()]
|
|
37
|
+
.map(events => project(events))
|
|
38
|
+
.filter((entry) => entry !== undefined && isRunnable(entry, trustedNow))
|
|
39
|
+
.sort((left, right) => compareCanonicalWorkroomText(left.dispatchId, right.dispatchId)));
|
|
40
|
+
}
|
|
41
|
+
async listGovernanceBlocked(input) {
|
|
42
|
+
return Object.freeze([...this.#events.values()]
|
|
43
|
+
.map(events => project(events))
|
|
44
|
+
.filter((entry) => entry?.status === 'blocked'
|
|
45
|
+
&& entry.item.envelope.projectId === input.projectId
|
|
46
|
+
&& entry.item.envelope.runId === input.runId
|
|
47
|
+
&& entry.item.envelope.taskKey === input.taskKey
|
|
48
|
+
&& entry.item.envelope.taskRevision === input.taskRevision)
|
|
49
|
+
.sort(compareBlockedDispatch));
|
|
50
|
+
}
|
|
51
|
+
async append(dispatchId, expectedSequence, drafts) {
|
|
52
|
+
const id = identifier(dispatchId, 'dispatchId');
|
|
53
|
+
const current = this.#events.get(id) ?? [];
|
|
54
|
+
const appended = materializeAppend(id, current, expectedSequence, drafts);
|
|
55
|
+
if (appended.length > 0 && appended.some(event => event.sequence >= current.length)) {
|
|
56
|
+
this.#events.set(id, Object.freeze([...current, ...appended]));
|
|
57
|
+
}
|
|
58
|
+
return appended;
|
|
59
|
+
}
|
|
60
|
+
async enqueue(item, expectedSequence, enqueuedAt) {
|
|
61
|
+
return enqueue(this, item, expectedSequence, enqueuedAt);
|
|
62
|
+
}
|
|
63
|
+
async claim(input) {
|
|
64
|
+
return claim(this, input);
|
|
65
|
+
}
|
|
66
|
+
async recordTransportObservation(input) {
|
|
67
|
+
return recordTransportObservation(this, input);
|
|
68
|
+
}
|
|
69
|
+
async recordGovernanceBlock(input) {
|
|
70
|
+
return recordGovernanceBlock(this, input);
|
|
71
|
+
}
|
|
72
|
+
async recover(input) {
|
|
73
|
+
return recover(this, input);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Durable adapter. Each append is an immutable segment and the first sequence
|
|
78
|
+
* path is claimed with a hard link, making expectedSequence a filesystem CAS.
|
|
79
|
+
*/
|
|
80
|
+
export class FileWorkroomRemoteDispatchOutboxRepository {
|
|
81
|
+
directory;
|
|
82
|
+
fileSystem;
|
|
83
|
+
constructor(directory, fileSystem = nodeFileSystem) {
|
|
84
|
+
this.directory = directory;
|
|
85
|
+
this.fileSystem = fileSystem;
|
|
86
|
+
}
|
|
87
|
+
async read(dispatchId) {
|
|
88
|
+
return project(await this.#readEvents(identifier(dispatchId, 'dispatchId')));
|
|
89
|
+
}
|
|
90
|
+
async listRunnable(now) {
|
|
91
|
+
const trustedNow = timestamp(now, 'now');
|
|
92
|
+
return Object.freeze((await this.#readAllProjections())
|
|
93
|
+
.filter(entry => isRunnable(entry, trustedNow)));
|
|
94
|
+
}
|
|
95
|
+
async listGovernanceBlocked(input) {
|
|
96
|
+
const entries = await this.#readAllProjections();
|
|
97
|
+
return Object.freeze(entries.filter(entry => entry.status === 'blocked'
|
|
98
|
+
&& entry.item.envelope.projectId === input.projectId
|
|
99
|
+
&& entry.item.envelope.runId === input.runId
|
|
100
|
+
&& entry.item.envelope.taskKey === input.taskKey
|
|
101
|
+
&& entry.item.envelope.taskRevision === input.taskRevision)
|
|
102
|
+
.sort(compareBlockedDispatch));
|
|
103
|
+
}
|
|
104
|
+
async #readAllProjections() {
|
|
105
|
+
let names;
|
|
106
|
+
try {
|
|
107
|
+
names = (await this.fileSystem.readdir(this.directory)).filter(name => name.endsWith('.json')).sort();
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (isMissingFile(error))
|
|
111
|
+
return [];
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
const byDispatch = new Map();
|
|
115
|
+
for (const name of names) {
|
|
116
|
+
const value = JSON.parse(await this.fileSystem.readFile(join(this.directory, name), 'utf8'));
|
|
117
|
+
if (!Array.isArray(value))
|
|
118
|
+
throw new Error('Remote Dispatch Outbox segment must be an event array');
|
|
119
|
+
for (const event of value.map(parseEvent)) {
|
|
120
|
+
if (!name.startsWith(`${digest(event.dispatchId)}.`)) {
|
|
121
|
+
throw new Error('Remote Dispatch Outbox segment identity does not match its filename');
|
|
122
|
+
}
|
|
123
|
+
const stream = byDispatch.get(event.dispatchId) ?? [];
|
|
124
|
+
stream.push(event);
|
|
125
|
+
byDispatch.set(event.dispatchId, stream);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return [...byDispatch.entries()]
|
|
129
|
+
.sort(([left], [right]) => compareCanonicalWorkroomText(left, right))
|
|
130
|
+
.map(([, events]) => project(events.sort((left, right) => left.sequence - right.sequence)))
|
|
131
|
+
.filter((entry) => entry !== undefined);
|
|
132
|
+
}
|
|
133
|
+
async append(dispatchId, expectedSequence, drafts) {
|
|
134
|
+
const id = identifier(dispatchId, 'dispatchId');
|
|
135
|
+
const current = await this.#readEvents(id);
|
|
136
|
+
const appended = materializeAppend(id, current, expectedSequence, drafts);
|
|
137
|
+
if (appended.length === 0 || appended.every(event => event.sequence < current.length)) {
|
|
138
|
+
if (current.length > 0)
|
|
139
|
+
await this.#syncDirectory();
|
|
140
|
+
return appended;
|
|
141
|
+
}
|
|
142
|
+
await this.#ensureDurableOutboxDirectory();
|
|
143
|
+
const segment = this.#segmentPath(id, appended[0].sequence);
|
|
144
|
+
const temporary = `${segment}.${randomUUID()}.tmp`;
|
|
145
|
+
let temporaryExists = false;
|
|
146
|
+
try {
|
|
147
|
+
const handle = await this.fileSystem.open(temporary, 'wx');
|
|
148
|
+
temporaryExists = true;
|
|
149
|
+
try {
|
|
150
|
+
await handle.writeFile(JSON.stringify(appended), 'utf8');
|
|
151
|
+
await handle.sync();
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
await handle.close();
|
|
155
|
+
}
|
|
156
|
+
await this.fileSystem.link(temporary, segment);
|
|
157
|
+
await this.fileSystem.unlink(temporary);
|
|
158
|
+
temporaryExists = false;
|
|
159
|
+
await this.#syncDirectory();
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (temporaryExists) {
|
|
163
|
+
await this.fileSystem.unlink(temporary).catch(cleanupError => {
|
|
164
|
+
if (!isMissingFile(cleanupError))
|
|
165
|
+
throw cleanupError;
|
|
166
|
+
});
|
|
167
|
+
temporaryExists = false;
|
|
168
|
+
}
|
|
169
|
+
if (isAlreadyExists(error)) {
|
|
170
|
+
const winner = await this.#readEvents(id);
|
|
171
|
+
const replay = materializeAppend(id, winner, expectedSequence, drafts);
|
|
172
|
+
await this.#syncDirectory();
|
|
173
|
+
if (replay.length > 0 && replay.every(event => event.sequence < winner.length)) {
|
|
174
|
+
return replay;
|
|
175
|
+
}
|
|
176
|
+
throw new WorkroomRemoteDispatchOutboxSequenceConflictError(id, expectedSequence, winner.at(-1)?.sequence ?? -1);
|
|
177
|
+
}
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
if (temporaryExists) {
|
|
182
|
+
await this.fileSystem.unlink(temporary).catch(error => {
|
|
183
|
+
if (!isMissingFile(error))
|
|
184
|
+
throw error;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return appended;
|
|
189
|
+
}
|
|
190
|
+
async enqueue(item, expectedSequence, enqueuedAt) {
|
|
191
|
+
return enqueue(this, item, expectedSequence, enqueuedAt);
|
|
192
|
+
}
|
|
193
|
+
async claim(input) {
|
|
194
|
+
return claim(this, input);
|
|
195
|
+
}
|
|
196
|
+
async recordTransportObservation(input) {
|
|
197
|
+
return recordTransportObservation(this, input);
|
|
198
|
+
}
|
|
199
|
+
async recordGovernanceBlock(input) {
|
|
200
|
+
return recordGovernanceBlock(this, input);
|
|
201
|
+
}
|
|
202
|
+
async recover(input) {
|
|
203
|
+
return recover(this, input);
|
|
204
|
+
}
|
|
205
|
+
async #readEvents(dispatchId) {
|
|
206
|
+
const prefix = `${digest(dispatchId)}.`;
|
|
207
|
+
let names;
|
|
208
|
+
try {
|
|
209
|
+
names = (await this.fileSystem.readdir(this.directory))
|
|
210
|
+
.filter(name => name.startsWith(prefix) && name.endsWith('.json'))
|
|
211
|
+
.sort();
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
if (isMissingFile(error))
|
|
215
|
+
return [];
|
|
216
|
+
throw error;
|
|
217
|
+
}
|
|
218
|
+
const events = (await Promise.all(names.map(async (name) => {
|
|
219
|
+
const value = JSON.parse(await this.fileSystem.readFile(join(this.directory, name), 'utf8'));
|
|
220
|
+
if (!Array.isArray(value))
|
|
221
|
+
throw new Error('Remote Dispatch Outbox segment must be an event array');
|
|
222
|
+
return value.map(parseEvent);
|
|
223
|
+
}))).flat().sort((left, right) => left.sequence - right.sequence);
|
|
224
|
+
if (events.some(event => event.dispatchId !== dispatchId)) {
|
|
225
|
+
throw new Error('Remote Dispatch Outbox dispatch identity collision');
|
|
226
|
+
}
|
|
227
|
+
assertContiguous(events);
|
|
228
|
+
return Object.freeze(events);
|
|
229
|
+
}
|
|
230
|
+
#segmentPath(dispatchId, firstSequence) {
|
|
231
|
+
return join(this.directory, `${digest(dispatchId)}.${String(firstSequence).padStart(16, '0')}.json`);
|
|
232
|
+
}
|
|
233
|
+
async #syncDirectory() {
|
|
234
|
+
await this.#syncDirectoryPath(this.directory);
|
|
235
|
+
}
|
|
236
|
+
async #ensureDurableOutboxDirectory() {
|
|
237
|
+
try {
|
|
238
|
+
await this.fileSystem.mkdir(this.directory);
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
if (!isAlreadyExists(error)) {
|
|
242
|
+
if (isMissingFile(error)) {
|
|
243
|
+
throw new Error(`Remote Dispatch Outbox requires a pre-existing durable parent directory: `
|
|
244
|
+
+ dirname(this.directory), { cause: error });
|
|
245
|
+
}
|
|
246
|
+
throw error;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// Repeating this for an already-live empty leaf is intentional: a prior
|
|
250
|
+
// parent fsync may have failed, so existence alone is not durability proof.
|
|
251
|
+
await this.#syncDirectoryPath(dirname(this.directory));
|
|
252
|
+
}
|
|
253
|
+
async #syncDirectoryPath(path) {
|
|
254
|
+
const handle = await this.fileSystem.open(path, 'r');
|
|
255
|
+
try {
|
|
256
|
+
await handle.sync();
|
|
257
|
+
}
|
|
258
|
+
finally {
|
|
259
|
+
await handle.close();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
async function enqueue(repository, item, expectedSequence, enqueuedAt) {
|
|
264
|
+
const normalized = normalizeItem(item);
|
|
265
|
+
const [event] = await repository.append(normalized.dispatchId, expectedSequence, [{
|
|
266
|
+
eventId: `${normalized.dispatchId}:enqueued`,
|
|
267
|
+
occurredAt: timestamp(enqueuedAt, 'enqueuedAt'),
|
|
268
|
+
type: 'dispatch.enqueued',
|
|
269
|
+
payload: { item: normalized },
|
|
270
|
+
}]);
|
|
271
|
+
return event;
|
|
272
|
+
}
|
|
273
|
+
async function claim(repository, input) {
|
|
274
|
+
const dispatchId = identifier(input.dispatchId, 'dispatchId');
|
|
275
|
+
const state = await repository.read(dispatchId);
|
|
276
|
+
if (!state)
|
|
277
|
+
throw new Error(`Remote Dispatch Outbox item does not exist: ${dispatchId}`);
|
|
278
|
+
const replayingInitialClaim = state.status === 'leased'
|
|
279
|
+
&& state.attemptCount === 1
|
|
280
|
+
&& state.observations.length === 0
|
|
281
|
+
&& state.lease?.ownerId === input.ownerId
|
|
282
|
+
&& state.lease.leaseId === input.leaseId
|
|
283
|
+
&& state.lease.leaseFence === input.leaseFence
|
|
284
|
+
&& state.lease.claimedAt === input.now
|
|
285
|
+
&& state.lease.expiresAt === input.leaseExpiresAt;
|
|
286
|
+
if ((state.status !== 'pending' || state.lease) && !replayingInitialClaim) {
|
|
287
|
+
throw new Error('Remote Dispatch Outbox item is not available for an initial claim');
|
|
288
|
+
}
|
|
289
|
+
const now = timestamp(input.now, 'now');
|
|
290
|
+
const lease = normalizeLease({
|
|
291
|
+
ownerId: input.ownerId,
|
|
292
|
+
leaseId: input.leaseId,
|
|
293
|
+
leaseFence: input.leaseFence,
|
|
294
|
+
claimedAt: now,
|
|
295
|
+
expiresAt: input.leaseExpiresAt,
|
|
296
|
+
});
|
|
297
|
+
if (lease.leaseFence !== 1) {
|
|
298
|
+
throw new Error('Initial Remote Dispatch Outbox leaseFence must be 1');
|
|
299
|
+
}
|
|
300
|
+
if (lease.expiresAt <= now) {
|
|
301
|
+
throw new Error('Remote Dispatch Outbox lease must expire after now');
|
|
302
|
+
}
|
|
303
|
+
const [event] = await repository.append(dispatchId, input.expectedSequence, [{
|
|
304
|
+
eventId: `${dispatchId}:claimed:${lease.leaseFence}:${encodeURIComponent(lease.leaseId)}`,
|
|
305
|
+
occurredAt: now,
|
|
306
|
+
type: 'dispatch.claimed',
|
|
307
|
+
payload: { lease },
|
|
308
|
+
}]);
|
|
309
|
+
return event;
|
|
310
|
+
}
|
|
311
|
+
async function recordTransportObservation(repository, input) {
|
|
312
|
+
const dispatchId = identifier(input.dispatchId, 'dispatchId');
|
|
313
|
+
const observationId = identifier(input.observationId, 'observationId');
|
|
314
|
+
const [event] = await repository.append(dispatchId, input.expectedSequence, [{
|
|
315
|
+
eventId: `${dispatchId}:transport-observed:${encodeURIComponent(observationId)}`,
|
|
316
|
+
occurredAt: timestamp(input.now, 'now'),
|
|
317
|
+
type: 'dispatch.transport_observed',
|
|
318
|
+
payload: {
|
|
319
|
+
leaseId: identifier(input.leaseId, 'leaseId'),
|
|
320
|
+
leaseFence: positiveSequence(input.leaseFence, 'leaseFence'),
|
|
321
|
+
observationId,
|
|
322
|
+
observation: normalizeTransportObservation(input.observation),
|
|
323
|
+
},
|
|
324
|
+
}]);
|
|
325
|
+
return event;
|
|
326
|
+
}
|
|
327
|
+
async function recordGovernanceBlock(repository, input) {
|
|
328
|
+
const dispatchId = identifier(input.dispatchId, 'dispatchId');
|
|
329
|
+
const reason = identifier(input.reason, 'governance reason');
|
|
330
|
+
const manifestDigest = sha(input.manifestDigest, 'manifestDigest');
|
|
331
|
+
const [event] = await repository.append(dispatchId, input.expectedSequence, [{
|
|
332
|
+
eventId: `${dispatchId}:governance-blocked:${input.attempt}:${input.assignmentFence}`,
|
|
333
|
+
occurredAt: timestamp(input.now, 'now'),
|
|
334
|
+
type: 'dispatch.governance_blocked',
|
|
335
|
+
payload: {
|
|
336
|
+
reason,
|
|
337
|
+
manifestDigest,
|
|
338
|
+
attempt: positiveSequence(input.attempt, 'attempt'),
|
|
339
|
+
assignmentFence: positiveSequence(input.assignmentFence, 'assignmentFence'),
|
|
340
|
+
},
|
|
341
|
+
}]);
|
|
342
|
+
return event;
|
|
343
|
+
}
|
|
344
|
+
async function recover(repository, input) {
|
|
345
|
+
const dispatchId = identifier(input.dispatchId, 'dispatchId');
|
|
346
|
+
const state = await repository.read(dispatchId);
|
|
347
|
+
if (!state)
|
|
348
|
+
throw new Error(`Remote Dispatch Outbox item does not exist: ${dispatchId}`);
|
|
349
|
+
const now = timestamp(input.now, 'now');
|
|
350
|
+
let cause;
|
|
351
|
+
if (state.status === 'reconcile_required')
|
|
352
|
+
cause = 'outcome_unknown';
|
|
353
|
+
else if (state.status === 'retryable')
|
|
354
|
+
cause = 'transport_failed';
|
|
355
|
+
else if (state.status === 'leased' && state.lease && now >= state.lease.expiresAt) {
|
|
356
|
+
cause = 'lease_expired';
|
|
357
|
+
}
|
|
358
|
+
else if (state.status === 'leased'
|
|
359
|
+
&& state.lease?.leaseId === input.leaseId
|
|
360
|
+
&& state.lease.leaseFence === input.leaseFence
|
|
361
|
+
&& state.lastRecoveryCause) {
|
|
362
|
+
cause = state.lastRecoveryCause;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
throw new Error('Remote Dispatch Outbox item is not eligible for recovery');
|
|
366
|
+
}
|
|
367
|
+
const lease = normalizeLease({
|
|
368
|
+
ownerId: input.ownerId,
|
|
369
|
+
leaseId: input.leaseId,
|
|
370
|
+
leaseFence: input.leaseFence,
|
|
371
|
+
claimedAt: now,
|
|
372
|
+
expiresAt: input.leaseExpiresAt,
|
|
373
|
+
});
|
|
374
|
+
if (lease.expiresAt <= now)
|
|
375
|
+
throw new Error('Remote Dispatch Outbox lease must expire after now');
|
|
376
|
+
const [event] = await repository.append(dispatchId, input.expectedSequence, [{
|
|
377
|
+
eventId: `${dispatchId}:recovered:${lease.leaseFence}:${encodeURIComponent(lease.leaseId)}`,
|
|
378
|
+
occurredAt: now,
|
|
379
|
+
type: 'dispatch.recovered',
|
|
380
|
+
payload: { lease, cause },
|
|
381
|
+
}]);
|
|
382
|
+
return event;
|
|
383
|
+
}
|
|
384
|
+
function materializeAppend(dispatchId, current, expectedSequence, drafts) {
|
|
385
|
+
sequence(expectedSequence, 'expectedSequence');
|
|
386
|
+
const normalized = deduplicateDrafts(drafts.map(normalizeDraft));
|
|
387
|
+
const byEventId = new Map(current.map(event => [event.eventId, event]));
|
|
388
|
+
const replayed = [];
|
|
389
|
+
for (const draft of normalized) {
|
|
390
|
+
const existing = byEventId.get(draft.eventId);
|
|
391
|
+
if (!existing)
|
|
392
|
+
continue;
|
|
393
|
+
if (stableJson({
|
|
394
|
+
occurredAt: existing.occurredAt,
|
|
395
|
+
type: existing.type,
|
|
396
|
+
payload: existing.payload,
|
|
397
|
+
}) !== stableJson({
|
|
398
|
+
occurredAt: draft.occurredAt,
|
|
399
|
+
type: draft.type,
|
|
400
|
+
payload: draft.payload,
|
|
401
|
+
})) {
|
|
402
|
+
throw new Error(`Remote Dispatch Outbox eventId payload conflict: ${draft.eventId}`);
|
|
403
|
+
}
|
|
404
|
+
replayed.push(existing);
|
|
405
|
+
}
|
|
406
|
+
if (replayed.length > 0) {
|
|
407
|
+
if (replayed.length !== normalized.length) {
|
|
408
|
+
throw new Error('Remote Dispatch Outbox append cannot mix replayed and new events');
|
|
409
|
+
}
|
|
410
|
+
return Object.freeze(replayed);
|
|
411
|
+
}
|
|
412
|
+
const actualSequence = current.at(-1)?.sequence ?? -1;
|
|
413
|
+
if (actualSequence !== expectedSequence) {
|
|
414
|
+
throw new WorkroomRemoteDispatchOutboxSequenceConflictError(dispatchId, expectedSequence, actualSequence);
|
|
415
|
+
}
|
|
416
|
+
const appended = Object.freeze(normalized.map((draft, index) => deepFreeze({
|
|
417
|
+
...draft,
|
|
418
|
+
version: 1,
|
|
419
|
+
dispatchId,
|
|
420
|
+
sequence: expectedSequence + index + 1,
|
|
421
|
+
})));
|
|
422
|
+
project(Object.freeze([...current, ...appended]));
|
|
423
|
+
return appended;
|
|
424
|
+
}
|
|
425
|
+
function normalizeDraft(draft) {
|
|
426
|
+
const eventId = identifier(draft.eventId, 'eventId');
|
|
427
|
+
const occurredAt = timestamp(draft.occurredAt, 'occurredAt');
|
|
428
|
+
if (draft.type === 'dispatch.enqueued') {
|
|
429
|
+
return deepFreeze({
|
|
430
|
+
eventId,
|
|
431
|
+
occurredAt,
|
|
432
|
+
type: draft.type,
|
|
433
|
+
payload: { item: normalizeItem(draft.payload?.item) },
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
if (draft.type === 'dispatch.claimed') {
|
|
437
|
+
return deepFreeze({
|
|
438
|
+
eventId,
|
|
439
|
+
occurredAt,
|
|
440
|
+
type: draft.type,
|
|
441
|
+
payload: { lease: normalizeLease(draft.payload?.lease) },
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
if (draft.type === 'dispatch.transport_observed') {
|
|
445
|
+
return deepFreeze({
|
|
446
|
+
eventId,
|
|
447
|
+
occurredAt,
|
|
448
|
+
type: draft.type,
|
|
449
|
+
payload: {
|
|
450
|
+
leaseId: identifier(draft.payload?.leaseId, 'leaseId'),
|
|
451
|
+
leaseFence: positiveSequence(draft.payload?.leaseFence, 'leaseFence'),
|
|
452
|
+
observationId: identifier(draft.payload?.observationId, 'observationId'),
|
|
453
|
+
observation: normalizeTransportObservation(draft.payload?.observation),
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
if (draft.type === 'dispatch.governance_blocked') {
|
|
458
|
+
return deepFreeze({
|
|
459
|
+
eventId,
|
|
460
|
+
occurredAt,
|
|
461
|
+
type: draft.type,
|
|
462
|
+
payload: {
|
|
463
|
+
reason: identifier(draft.payload?.reason, 'governance reason'),
|
|
464
|
+
manifestDigest: sha(draft.payload?.manifestDigest, 'manifestDigest'),
|
|
465
|
+
attempt: positiveSequence(draft.payload?.attempt, 'attempt'),
|
|
466
|
+
assignmentFence: positiveSequence(draft.payload?.assignmentFence, 'assignmentFence'),
|
|
467
|
+
},
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
if (draft.type === 'dispatch.recovered') {
|
|
471
|
+
return deepFreeze({
|
|
472
|
+
eventId,
|
|
473
|
+
occurredAt,
|
|
474
|
+
type: draft.type,
|
|
475
|
+
payload: {
|
|
476
|
+
lease: normalizeLease(draft.payload?.lease),
|
|
477
|
+
cause: recoveryCause(draft.payload?.cause),
|
|
478
|
+
},
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
throw new Error('Invalid Remote Dispatch Outbox event type');
|
|
482
|
+
}
|
|
483
|
+
function parseEvent(value) {
|
|
484
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
485
|
+
throw new Error('Invalid Remote Dispatch Outbox event');
|
|
486
|
+
}
|
|
487
|
+
const event = value;
|
|
488
|
+
const draft = normalizeDraft(event);
|
|
489
|
+
return deepFreeze({
|
|
490
|
+
...draft,
|
|
491
|
+
version: event.version === 1 ? 1 : fail('Invalid Remote Dispatch Outbox event version'),
|
|
492
|
+
dispatchId: identifier(event.dispatchId, 'dispatchId'),
|
|
493
|
+
sequence: sequence(event.sequence, 'sequence'),
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
function project(events) {
|
|
497
|
+
if (events.length === 0)
|
|
498
|
+
return undefined;
|
|
499
|
+
assertContiguous(events);
|
|
500
|
+
const first = events[0];
|
|
501
|
+
if (first.type !== 'dispatch.enqueued' || first.sequence !== 0) {
|
|
502
|
+
throw new Error('Remote Dispatch Outbox must begin with dispatch.enqueued');
|
|
503
|
+
}
|
|
504
|
+
if (first.dispatchId !== first.payload.item.dispatchId) {
|
|
505
|
+
throw new Error('Remote Dispatch Outbox item identity does not match stream identity');
|
|
506
|
+
}
|
|
507
|
+
assertDeterministicEventId(first);
|
|
508
|
+
let status = 'pending';
|
|
509
|
+
let lease;
|
|
510
|
+
let lastLeaseFence;
|
|
511
|
+
let attemptCount = 0;
|
|
512
|
+
const observations = [];
|
|
513
|
+
const observationIds = new Set();
|
|
514
|
+
let lastRecoveryCause;
|
|
515
|
+
let governanceBlock;
|
|
516
|
+
for (const event of events.slice(1)) {
|
|
517
|
+
assertDeterministicEventId(event);
|
|
518
|
+
if (event.type === 'dispatch.claimed') {
|
|
519
|
+
if (status !== 'pending') {
|
|
520
|
+
throw new Error(`Invalid Remote Dispatch Outbox transition: ${event.type}`);
|
|
521
|
+
}
|
|
522
|
+
if (event.payload.lease.leaseFence !== 1
|
|
523
|
+
|| event.payload.lease.claimedAt !== event.occurredAt) {
|
|
524
|
+
throw new Error('Invalid initial Remote Dispatch Outbox lease/fence');
|
|
525
|
+
}
|
|
526
|
+
lease = event.payload.lease;
|
|
527
|
+
lastLeaseFence = lease.leaseFence;
|
|
528
|
+
status = 'leased';
|
|
529
|
+
attemptCount += 1;
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
if (event.type === 'dispatch.transport_observed') {
|
|
533
|
+
if (status !== 'leased' || !lease
|
|
534
|
+
|| event.payload.leaseId !== lease.leaseId
|
|
535
|
+
|| event.payload.leaseFence !== lease.leaseFence) {
|
|
536
|
+
throw new Error('Remote Dispatch Outbox observation does not match the active lease/fence');
|
|
537
|
+
}
|
|
538
|
+
if (event.occurredAt >= lease.expiresAt) {
|
|
539
|
+
throw new Error('Remote Dispatch Outbox observation arrived after lease expiry');
|
|
540
|
+
}
|
|
541
|
+
if (observationIds.has(event.payload.observationId)) {
|
|
542
|
+
throw new Error(`Remote Dispatch Outbox observationId conflict: ${event.payload.observationId}`);
|
|
543
|
+
}
|
|
544
|
+
observationIds.add(event.payload.observationId);
|
|
545
|
+
observations.push(deepFreeze({
|
|
546
|
+
observationId: event.payload.observationId,
|
|
547
|
+
observedAt: event.occurredAt,
|
|
548
|
+
leaseId: event.payload.leaseId,
|
|
549
|
+
leaseFence: event.payload.leaseFence,
|
|
550
|
+
...event.payload.observation,
|
|
551
|
+
}));
|
|
552
|
+
status = event.payload.observation.outcome === 'delivered'
|
|
553
|
+
? 'delivered'
|
|
554
|
+
: event.payload.observation.outcome === 'outcome_unknown'
|
|
555
|
+
? 'reconcile_required'
|
|
556
|
+
: 'retryable';
|
|
557
|
+
lease = undefined;
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
if (event.type === 'dispatch.governance_blocked') {
|
|
561
|
+
if (status !== 'pending' && status !== 'retryable') {
|
|
562
|
+
throw new Error('Invalid Remote Dispatch governance block transition');
|
|
563
|
+
}
|
|
564
|
+
if (event.payload.attempt !== first.payload.item.envelope.attempt
|
|
565
|
+
|| event.payload.assignmentFence !== first.payload.item.envelope.fence
|
|
566
|
+
|| event.payload.manifestDigest
|
|
567
|
+
!== first.payload.item.envelope.disclosureManifest.manifest.digest) {
|
|
568
|
+
throw new Error('Remote Dispatch governance block escaped exact Assignment/Manifest authority');
|
|
569
|
+
}
|
|
570
|
+
status = 'blocked';
|
|
571
|
+
governanceBlock = deepFreeze({ ...event.payload, blockedAt: event.occurredAt });
|
|
572
|
+
lease = undefined;
|
|
573
|
+
continue;
|
|
574
|
+
}
|
|
575
|
+
if (event.type === 'dispatch.recovered') {
|
|
576
|
+
const expectedCause = status === 'reconcile_required'
|
|
577
|
+
? 'outcome_unknown'
|
|
578
|
+
: status === 'retryable'
|
|
579
|
+
? 'transport_failed'
|
|
580
|
+
: status === 'leased' && lease && event.occurredAt >= lease.expiresAt
|
|
581
|
+
? 'lease_expired'
|
|
582
|
+
: undefined;
|
|
583
|
+
if (!expectedCause || event.payload.cause !== expectedCause) {
|
|
584
|
+
throw new Error('Invalid Remote Dispatch Outbox recovery transition');
|
|
585
|
+
}
|
|
586
|
+
if (lastLeaseFence === undefined || event.payload.lease.leaseFence !== lastLeaseFence + 1) {
|
|
587
|
+
throw new Error('Remote Dispatch Outbox recovery must increase the lease fence by one');
|
|
588
|
+
}
|
|
589
|
+
if (event.payload.lease.claimedAt !== event.occurredAt) {
|
|
590
|
+
throw new Error('Remote Dispatch Outbox recovery lease does not match Kernel clock input');
|
|
591
|
+
}
|
|
592
|
+
lease = event.payload.lease;
|
|
593
|
+
lastLeaseFence = lease.leaseFence;
|
|
594
|
+
lastRecoveryCause = event.payload.cause;
|
|
595
|
+
status = 'leased';
|
|
596
|
+
attemptCount += 1;
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
throw new Error(`Invalid Remote Dispatch Outbox transition: ${event.type}`);
|
|
600
|
+
}
|
|
601
|
+
return deepFreeze({
|
|
602
|
+
version: 1,
|
|
603
|
+
dispatchId: first.dispatchId,
|
|
604
|
+
sequence: events.at(-1).sequence,
|
|
605
|
+
status,
|
|
606
|
+
item: first.payload.item,
|
|
607
|
+
attemptCount,
|
|
608
|
+
observations: Object.freeze(observations),
|
|
609
|
+
...(lease ? { lease } : {}),
|
|
610
|
+
...(lastLeaseFence === undefined ? {} : { lastLeaseFence }),
|
|
611
|
+
...(lastRecoveryCause === undefined ? {} : { lastRecoveryCause }),
|
|
612
|
+
...(governanceBlock === undefined ? {} : { governanceBlock }),
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
function isRunnable(projection, now) {
|
|
616
|
+
return projection.status === 'pending'
|
|
617
|
+
|| projection.status === 'retryable'
|
|
618
|
+
|| (projection.status === 'leased'
|
|
619
|
+
&& projection.lease !== undefined
|
|
620
|
+
&& now >= projection.lease.expiresAt);
|
|
621
|
+
}
|
|
622
|
+
function compareBlockedDispatch(left, right) {
|
|
623
|
+
return right.item.envelope.attempt - left.item.envelope.attempt
|
|
624
|
+
|| right.item.envelope.fence - left.item.envelope.fence
|
|
625
|
+
|| compareCanonicalWorkroomText(left.dispatchId, right.dispatchId);
|
|
626
|
+
}
|
|
627
|
+
function assertDeterministicEventId(event) {
|
|
628
|
+
const expected = event.type === 'dispatch.enqueued'
|
|
629
|
+
? `${event.dispatchId}:enqueued`
|
|
630
|
+
: event.type === 'dispatch.claimed'
|
|
631
|
+
? `${event.dispatchId}:claimed:${event.payload.lease.leaseFence}:`
|
|
632
|
+
+ encodeURIComponent(event.payload.lease.leaseId)
|
|
633
|
+
: event.type === 'dispatch.transport_observed'
|
|
634
|
+
? `${event.dispatchId}:transport-observed:`
|
|
635
|
+
+ encodeURIComponent(event.payload.observationId)
|
|
636
|
+
: event.type === 'dispatch.governance_blocked'
|
|
637
|
+
? `${event.dispatchId}:governance-blocked:${event.payload.attempt}:`
|
|
638
|
+
+ event.payload.assignmentFence
|
|
639
|
+
: `${event.dispatchId}:recovered:${event.payload.lease.leaseFence}:`
|
|
640
|
+
+ encodeURIComponent(event.payload.lease.leaseId);
|
|
641
|
+
if (event.eventId !== expected) {
|
|
642
|
+
throw new Error(`Remote Dispatch Outbox event identity is not deterministic: ${event.eventId}`);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
function normalizeLease(value) {
|
|
646
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
647
|
+
throw new Error('Invalid Remote Dispatch Outbox lease');
|
|
648
|
+
}
|
|
649
|
+
const lease = value;
|
|
650
|
+
const claimedAt = timestamp(lease.claimedAt, 'lease.claimedAt');
|
|
651
|
+
const expiresAt = timestamp(lease.expiresAt, 'lease.expiresAt');
|
|
652
|
+
if (expiresAt <= claimedAt)
|
|
653
|
+
throw new Error('Remote Dispatch Outbox lease expiry is invalid');
|
|
654
|
+
return deepFreeze({
|
|
655
|
+
ownerId: identifier(lease.ownerId, 'lease.ownerId'),
|
|
656
|
+
leaseId: identifier(lease.leaseId, 'lease.leaseId'),
|
|
657
|
+
leaseFence: positiveSequence(lease.leaseFence, 'lease.leaseFence'),
|
|
658
|
+
claimedAt,
|
|
659
|
+
expiresAt,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
function normalizeTransportObservation(value) {
|
|
663
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
664
|
+
throw new Error('Invalid Remote Dispatch Outbox transport observation');
|
|
665
|
+
}
|
|
666
|
+
const observation = value;
|
|
667
|
+
if (!['delivered', 'outcome_unknown', 'failed'].includes(observation.outcome ?? '')) {
|
|
668
|
+
throw new Error('Invalid Remote Dispatch Outbox transport outcome');
|
|
669
|
+
}
|
|
670
|
+
return deepFreeze({
|
|
671
|
+
outcome: observation.outcome,
|
|
672
|
+
receiptId: identifier(observation.receiptId, 'observation.receiptId'),
|
|
673
|
+
...optionalIdentifier(observation.remoteTaskId, 'observation.remoteTaskId'),
|
|
674
|
+
...optionalIdentifier(observation.remoteContextId, 'observation.remoteContextId'),
|
|
675
|
+
...optionalIdentifier(observation.reason, 'observation.reason'),
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
function recoveryCause(value) {
|
|
679
|
+
if (!['outcome_unknown', 'transport_failed', 'lease_expired'].includes(String(value))) {
|
|
680
|
+
throw new Error('Invalid Remote Dispatch Outbox recovery cause');
|
|
681
|
+
}
|
|
682
|
+
return value;
|
|
683
|
+
}
|
|
684
|
+
function optionalIdentifier(value, name) {
|
|
685
|
+
if (value === undefined)
|
|
686
|
+
return {};
|
|
687
|
+
const key = name.slice(name.lastIndexOf('.') + 1);
|
|
688
|
+
return { [key]: identifier(value, name) };
|
|
689
|
+
}
|
|
690
|
+
function normalizeItem(value) {
|
|
691
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
692
|
+
throw new Error('Invalid Remote Dispatch Outbox item');
|
|
693
|
+
}
|
|
694
|
+
const item = value;
|
|
695
|
+
const { version: _version, dispatchId: _dispatchId, messageId: _messageId, ...input } = item.envelope;
|
|
696
|
+
const canonical = createWorkroomRemoteDispatchOutboxItem(input);
|
|
697
|
+
assertWorkroomRemoteDispatchRetry(canonical, item);
|
|
698
|
+
if (item.version !== 1
|
|
699
|
+
|| item.dispatchId !== item.envelope.dispatchId
|
|
700
|
+
|| item.messageId !== item.envelope.messageId) {
|
|
701
|
+
throw new Error('Remote Dispatch Outbox item identity does not match its envelope');
|
|
702
|
+
}
|
|
703
|
+
return canonical;
|
|
704
|
+
}
|
|
705
|
+
function deduplicateDrafts(drafts) {
|
|
706
|
+
const result = [];
|
|
707
|
+
const byId = new Map();
|
|
708
|
+
for (const draft of drafts) {
|
|
709
|
+
const existing = byId.get(draft.eventId);
|
|
710
|
+
if (existing) {
|
|
711
|
+
if (stableJson(existing) !== stableJson(draft)) {
|
|
712
|
+
throw new Error(`Remote Dispatch Outbox eventId payload conflict: ${draft.eventId}`);
|
|
713
|
+
}
|
|
714
|
+
continue;
|
|
715
|
+
}
|
|
716
|
+
byId.set(draft.eventId, draft);
|
|
717
|
+
result.push(draft);
|
|
718
|
+
}
|
|
719
|
+
return Object.freeze(result);
|
|
720
|
+
}
|
|
721
|
+
function assertContiguous(events) {
|
|
722
|
+
events.forEach((event, index) => {
|
|
723
|
+
if (event.sequence !== index)
|
|
724
|
+
throw new Error('Remote Dispatch Outbox sequence is not contiguous');
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
function digest(value) {
|
|
728
|
+
return createHash('sha256').update(value).digest('hex');
|
|
729
|
+
}
|
|
730
|
+
function identifier(value, name) {
|
|
731
|
+
if (typeof value !== 'string' || !value.trim())
|
|
732
|
+
throw new Error(`Invalid ${name}`);
|
|
733
|
+
return value;
|
|
734
|
+
}
|
|
735
|
+
function sha(value, name) {
|
|
736
|
+
const normalized = identifier(value, name);
|
|
737
|
+
if (!/^sha256:[a-f0-9]{64}$/u.test(normalized))
|
|
738
|
+
throw new Error(`Invalid ${name}`);
|
|
739
|
+
return normalized;
|
|
740
|
+
}
|
|
741
|
+
function timestamp(value, name) {
|
|
742
|
+
if (!Number.isFinite(value) || value < 0)
|
|
743
|
+
throw new Error(`Invalid ${name}`);
|
|
744
|
+
return value;
|
|
745
|
+
}
|
|
746
|
+
function sequence(value, name) {
|
|
747
|
+
if (!Number.isSafeInteger(value) || value < -1)
|
|
748
|
+
throw new Error(`Invalid ${name}`);
|
|
749
|
+
return value;
|
|
750
|
+
}
|
|
751
|
+
function positiveSequence(value, name) {
|
|
752
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
753
|
+
throw new Error(`Invalid ${name}`);
|
|
754
|
+
return value;
|
|
755
|
+
}
|
|
756
|
+
function fail(message) {
|
|
757
|
+
throw new Error(message);
|
|
758
|
+
}
|
|
759
|
+
function isMissingFile(error) {
|
|
760
|
+
return error instanceof Error && 'code' in error && error.code === 'ENOENT';
|
|
761
|
+
}
|
|
762
|
+
function isAlreadyExists(error) {
|
|
763
|
+
return error instanceof Error && 'code' in error && error.code === 'EEXIST';
|
|
764
|
+
}
|
|
765
|
+
//# sourceMappingURL=remote-dispatch-outbox.js.map
|