@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,819 @@
|
|
|
1
|
+
import { assertAcceptanceContract, assertPinnedAcceptanceContract } from './acceptance-policy.js';
|
|
2
|
+
import { assertReviewerVerdictBindings, reviewerVerdictRequiresRework, } from './acceptance-control.js';
|
|
3
|
+
import { replayWorkroomPreemptions } from './workroom-preemption.js';
|
|
4
|
+
const TERMINAL_TASKS = new Set(['accepted', 'failed', 'cancelled']);
|
|
5
|
+
const ACTIVE_ASSIGNMENTS = new Set(['leased', 'running', 'cancel_requested']);
|
|
6
|
+
export function replayWorkroom(events) {
|
|
7
|
+
const first = events[0];
|
|
8
|
+
if (!first || first.type !== 'run.created' || first.sequence !== 0) {
|
|
9
|
+
throw new Error('Workroom journal must begin with run.created at sequence 0');
|
|
10
|
+
}
|
|
11
|
+
let state = {
|
|
12
|
+
runId: first.runId,
|
|
13
|
+
projectId: String(first.payload.projectId ?? ''),
|
|
14
|
+
title: String(first.payload.title ?? ''),
|
|
15
|
+
status: 'active',
|
|
16
|
+
sequence: -1,
|
|
17
|
+
now: first.occurredAt,
|
|
18
|
+
cancelRequested: false,
|
|
19
|
+
tasks: {},
|
|
20
|
+
assignments: {},
|
|
21
|
+
reviewerAssignments: {},
|
|
22
|
+
sponsorGates: {},
|
|
23
|
+
};
|
|
24
|
+
for (const event of events) {
|
|
25
|
+
if (event.runId !== state.runId)
|
|
26
|
+
throw new Error('Workroom journal contains another run');
|
|
27
|
+
if (event.sequence !== state.sequence + 1)
|
|
28
|
+
throw new Error('Workroom journal sequence is not contiguous');
|
|
29
|
+
state = evolveWorkroom(state, event);
|
|
30
|
+
}
|
|
31
|
+
replayWorkroomPreemptions(events);
|
|
32
|
+
return deriveRunStatus(state);
|
|
33
|
+
}
|
|
34
|
+
export function decideWorkroom(state, command, event) {
|
|
35
|
+
if (state.status === 'completed' || state.status === 'cancelled') {
|
|
36
|
+
throw new Error(`Workroom run is terminal: ${state.status}`);
|
|
37
|
+
}
|
|
38
|
+
switch (command.type) {
|
|
39
|
+
case 'plan_task':
|
|
40
|
+
if (state.cancelRequested)
|
|
41
|
+
throw new Error('Cannot plan while run cancellation is active');
|
|
42
|
+
if (state.tasks[command.taskKey])
|
|
43
|
+
throw new Error(`Task ${command.taskKey} already exists`);
|
|
44
|
+
if (!Number.isInteger(command.maxAttempts) || command.maxAttempts < 1) {
|
|
45
|
+
throw new Error('Task maxAttempts must be a positive integer');
|
|
46
|
+
}
|
|
47
|
+
return [event('task.planned', { ...command })];
|
|
48
|
+
case 'block_task': {
|
|
49
|
+
const task = requireTask(state, command.taskKey, ['ready']);
|
|
50
|
+
return [event('task.blocked', { ...command, taskKey: task.key })];
|
|
51
|
+
}
|
|
52
|
+
case 'resolve_blocker': {
|
|
53
|
+
const task = requireTask(state, command.taskKey, ['blocked']);
|
|
54
|
+
const blocker = task.blockers.find(item => item.id === command.blockerId);
|
|
55
|
+
if (!blocker) {
|
|
56
|
+
throw new Error(`Blocker ${command.blockerId} not found`);
|
|
57
|
+
}
|
|
58
|
+
if (blocker.kind === 'approval') {
|
|
59
|
+
throw new Error('Approval Blocker requires a typed Sponsor authority decision');
|
|
60
|
+
}
|
|
61
|
+
return [event('task.blocker_resolved', { ...command })];
|
|
62
|
+
}
|
|
63
|
+
case 'claim_task': {
|
|
64
|
+
const task = requireTask(state, command.taskKey, ['ready']);
|
|
65
|
+
if (!task.acceptanceContract)
|
|
66
|
+
throw new Error(`Task ${task.key} Acceptance Contract is not pinned`);
|
|
67
|
+
if (state.assignments[command.assignmentId])
|
|
68
|
+
throw new Error('Assignment already exists');
|
|
69
|
+
if (!Number.isSafeInteger(command.assignmentRevision) || command.assignmentRevision < 1) {
|
|
70
|
+
throw new Error('Assignment revision must be a positive safe integer');
|
|
71
|
+
}
|
|
72
|
+
if (!Number.isSafeInteger(command.fence) || command.fence < 1) {
|
|
73
|
+
throw new Error('Assignment fence must be a positive safe integer');
|
|
74
|
+
}
|
|
75
|
+
const priorFence = Object.values(state.assignments)
|
|
76
|
+
.filter(assignment => assignment.taskKey === task.key)
|
|
77
|
+
.reduce((highest, assignment) => Math.max(highest, assignment.fence), 0);
|
|
78
|
+
if (command.fence <= priorFence) {
|
|
79
|
+
throw new Error('Assignment fence must advance beyond every prior Task Assignment');
|
|
80
|
+
}
|
|
81
|
+
if (!/^sha256:[a-f0-9]{64}$/u.test(command.envelopeDigest)) {
|
|
82
|
+
throw new Error('Assignment Envelope digest must be a canonical sha256 digest');
|
|
83
|
+
}
|
|
84
|
+
return [event('assignment.claimed', {
|
|
85
|
+
...command,
|
|
86
|
+
taskRevision: task.revision,
|
|
87
|
+
attempt: task.attempt + 1,
|
|
88
|
+
})];
|
|
89
|
+
}
|
|
90
|
+
case 'start_assignment':
|
|
91
|
+
requireAssignment(state, command.assignmentId, ['leased']);
|
|
92
|
+
return [event('assignment.started', { assignmentId: command.assignmentId })];
|
|
93
|
+
case 'request_rework':
|
|
94
|
+
requireTask(state, command.taskKey, ['awaiting_acceptance']);
|
|
95
|
+
return [event('task.rework_requested', { ...command })];
|
|
96
|
+
case 'revise_task': {
|
|
97
|
+
requireTask(state, command.taskKey, ['failed']);
|
|
98
|
+
if (!Number.isInteger(command.maxAttempts) || command.maxAttempts < 1) {
|
|
99
|
+
throw new Error('Task maxAttempts must be a positive integer');
|
|
100
|
+
}
|
|
101
|
+
return [event('task.revised', { ...command })];
|
|
102
|
+
}
|
|
103
|
+
case 'cancel_run': {
|
|
104
|
+
if (state.cancelRequested)
|
|
105
|
+
return [];
|
|
106
|
+
const events = [event('run.cancel_requested', { reason: command.reason })];
|
|
107
|
+
let waiting = 0;
|
|
108
|
+
for (const task of Object.values(state.tasks)) {
|
|
109
|
+
if (TERMINAL_TASKS.has(task.status))
|
|
110
|
+
continue;
|
|
111
|
+
events.push(event('task.cancel_requested', { taskKey: task.key, reason: command.reason }));
|
|
112
|
+
const assignment = task.currentAssignmentId
|
|
113
|
+
? state.assignments[task.currentAssignmentId]
|
|
114
|
+
: undefined;
|
|
115
|
+
if (assignment && ACTIVE_ASSIGNMENTS.has(assignment.status)) {
|
|
116
|
+
waiting += 1;
|
|
117
|
+
events.push(event('assignment.cancel_requested', {
|
|
118
|
+
assignmentId: assignment.id,
|
|
119
|
+
controlDeadline: command.controlDeadline,
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
events.push(event('task.cancelled', { taskKey: task.key, reason: command.reason }));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (waiting === 0)
|
|
127
|
+
events.push(event('run.cancelled', { reason: command.reason }));
|
|
128
|
+
return events;
|
|
129
|
+
}
|
|
130
|
+
case 'advance_clock':
|
|
131
|
+
if (!Number.isFinite(command.now) || command.now <= state.now)
|
|
132
|
+
throw new Error('Clock must advance');
|
|
133
|
+
return decideClock(state, command.now, event);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export function evolveWorkroom(state, event) {
|
|
137
|
+
let tasks = state.tasks;
|
|
138
|
+
let assignments = state.assignments;
|
|
139
|
+
let reviewerAssignments = state.reviewerAssignments;
|
|
140
|
+
let sponsorGates = state.sponsorGates;
|
|
141
|
+
let cancelRequested = state.cancelRequested;
|
|
142
|
+
let status = state.status;
|
|
143
|
+
const payload = event.payload;
|
|
144
|
+
switch (event.type) {
|
|
145
|
+
case 'run.created': break;
|
|
146
|
+
case 'plan.admitted': break;
|
|
147
|
+
case 'plan.revision_applied': break;
|
|
148
|
+
case 'plan_gate.decided': break;
|
|
149
|
+
case 'local_execution.requested': break;
|
|
150
|
+
case 'remote_dispatch.requested': break;
|
|
151
|
+
case 'scheduler.dispatch_requested': break;
|
|
152
|
+
case 'scheduler.priority_changed': break;
|
|
153
|
+
case 'scheduler.preemption_requested': break;
|
|
154
|
+
case 'scheduler.preemption_checkpoint_acknowledged': break;
|
|
155
|
+
case 'scheduler.preemption_timed_out': break;
|
|
156
|
+
case 'assignment.checkpoint_requested': break;
|
|
157
|
+
case 'run.cancel_requested':
|
|
158
|
+
cancelRequested = true;
|
|
159
|
+
status = 'cancelling';
|
|
160
|
+
break;
|
|
161
|
+
case 'run.cancelled':
|
|
162
|
+
status = 'cancelled';
|
|
163
|
+
break;
|
|
164
|
+
case 'task.planned': {
|
|
165
|
+
const key = String(payload.taskKey);
|
|
166
|
+
tasks = { ...tasks, [key]: {
|
|
167
|
+
key,
|
|
168
|
+
title: String(payload.title),
|
|
169
|
+
status: 'ready',
|
|
170
|
+
revision: 1,
|
|
171
|
+
attempt: 0,
|
|
172
|
+
maxAttempts: Number(payload.maxAttempts),
|
|
173
|
+
required: payload.required === true,
|
|
174
|
+
blockers: [],
|
|
175
|
+
} };
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case 'task.blocked': {
|
|
179
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
180
|
+
tasks = replaceTask(tasks, task.key, {
|
|
181
|
+
...task,
|
|
182
|
+
status: 'blocked',
|
|
183
|
+
blockers: [...task.blockers, {
|
|
184
|
+
id: String(payload.blockerId),
|
|
185
|
+
kind: payload.kind,
|
|
186
|
+
owner: String(payload.owner),
|
|
187
|
+
reason: String(payload.reason),
|
|
188
|
+
deadline: Number(payload.deadline),
|
|
189
|
+
allowedActions: ['resolve', 'replan', 'cancel'],
|
|
190
|
+
}],
|
|
191
|
+
});
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
case 'task.blocker_resolved': {
|
|
195
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
196
|
+
const blockers = task.blockers.filter(blocker => blocker.id !== payload.blockerId);
|
|
197
|
+
tasks = replaceTask(tasks, task.key, { ...task, blockers, status: blockers.length ? 'blocked' : 'ready' });
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
case 'assignment.claimed': {
|
|
201
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
202
|
+
if (task.status !== 'ready'
|
|
203
|
+
|| Number(payload.taskRevision) !== task.revision
|
|
204
|
+
|| Number(payload.attempt) !== task.attempt + 1
|
|
205
|
+
|| state.assignments[String(payload.assignmentId)]) {
|
|
206
|
+
throw new Error('Persisted Assignment claim is stale or targets another Task revision');
|
|
207
|
+
}
|
|
208
|
+
const priorFence = Object.values(state.assignments)
|
|
209
|
+
.filter(assignment => assignment.taskKey === task.key)
|
|
210
|
+
.reduce((highest, assignment) => Math.max(highest, assignment.fence), 0);
|
|
211
|
+
if (Number(payload.fence) <= priorFence) {
|
|
212
|
+
throw new Error('Persisted Assignment claim fence does not advance');
|
|
213
|
+
}
|
|
214
|
+
const assignment = {
|
|
215
|
+
id: String(payload.assignmentId),
|
|
216
|
+
taskKey: task.key,
|
|
217
|
+
taskRevision: Number(payload.taskRevision),
|
|
218
|
+
revision: Number(payload.assignmentRevision),
|
|
219
|
+
attempt: Number(payload.attempt),
|
|
220
|
+
fence: Number(payload.fence),
|
|
221
|
+
envelopeDigest: String(payload.envelopeDigest),
|
|
222
|
+
role: payload.role,
|
|
223
|
+
status: 'leased',
|
|
224
|
+
owner: String(payload.owner),
|
|
225
|
+
leaseExpiresAt: Number(payload.leaseExpiresAt),
|
|
226
|
+
observationDigests: {},
|
|
227
|
+
};
|
|
228
|
+
assignments = { ...assignments, [assignment.id]: assignment };
|
|
229
|
+
tasks = replaceTask(tasks, task.key, {
|
|
230
|
+
...task,
|
|
231
|
+
status: 'executing',
|
|
232
|
+
attempt: assignment.attempt,
|
|
233
|
+
currentAssignmentId: assignment.id,
|
|
234
|
+
});
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
case 'assignment.started':
|
|
238
|
+
case 'assignment.progress':
|
|
239
|
+
case 'assignment.heartbeat':
|
|
240
|
+
case 'assignment.checkpointed':
|
|
241
|
+
case 'assignment.preempted':
|
|
242
|
+
case 'assignment.execution_completed':
|
|
243
|
+
case 'assignment.cancel_requested':
|
|
244
|
+
case 'assignment.cancelled':
|
|
245
|
+
case 'assignment.lease_expired': {
|
|
246
|
+
const assignment = requireAssignment(state, String(payload.assignmentId));
|
|
247
|
+
const next = evolveAssignment(assignment, event);
|
|
248
|
+
assignments = { ...assignments, [assignment.id]: next };
|
|
249
|
+
const task = requireTask(state, assignment.taskKey);
|
|
250
|
+
tasks = replaceTask(tasks, task.key, evolveTaskFromAssignment(task, next, event));
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
case 'task.accepted': {
|
|
254
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
255
|
+
const record = payload.record;
|
|
256
|
+
if (!task.acceptanceContract)
|
|
257
|
+
throw new Error(`Task ${task.key} Acceptance Contract is not pinned`);
|
|
258
|
+
assertPinnedAcceptanceContract(record.contract, task.acceptanceContract);
|
|
259
|
+
assertAcceptanceRecordControlBindings(state, task, record);
|
|
260
|
+
({ reviewerAssignments, sponsorGates } = settleAcceptanceWaits(task, reviewerAssignments, sponsorGates, 'satisfied'));
|
|
261
|
+
tasks = replaceTask(tasks, task.key, {
|
|
262
|
+
...task,
|
|
263
|
+
status: 'accepted',
|
|
264
|
+
acceptanceRecord: record,
|
|
265
|
+
currentReviewerAssignmentId: undefined,
|
|
266
|
+
currentSponsorGateId: undefined,
|
|
267
|
+
acceptanceBlockReason: undefined,
|
|
268
|
+
});
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
case 'task.acceptance_pinned': {
|
|
272
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
273
|
+
if (task.status !== 'ready')
|
|
274
|
+
throw new Error(`Task ${task.key} is ${task.status}`);
|
|
275
|
+
if (task.acceptanceContract)
|
|
276
|
+
throw new Error(`Task ${task.key} Acceptance Contract is already pinned`);
|
|
277
|
+
const contract = payload.contract;
|
|
278
|
+
assertAcceptanceContract(contract, task.key, task.revision);
|
|
279
|
+
tasks = replaceTask(tasks, task.key, {
|
|
280
|
+
...task,
|
|
281
|
+
acceptanceContract: contract,
|
|
282
|
+
});
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
case 'task.acceptance_blocked': {
|
|
286
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
287
|
+
tasks = replaceTask(tasks, task.key, {
|
|
288
|
+
...task,
|
|
289
|
+
acceptanceBlockReason: String(payload.reason),
|
|
290
|
+
});
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
case 'reviewer.assigned': {
|
|
294
|
+
const task = requireTask(state, String(payload.taskKey), ['awaiting_acceptance']);
|
|
295
|
+
const assignment = payload.assignment;
|
|
296
|
+
if (reviewerAssignments[assignment.id])
|
|
297
|
+
throw new Error(`Reviewer Assignment ${assignment.id} already exists`);
|
|
298
|
+
if (assignment.owner === assignment.producerPrincipalId) {
|
|
299
|
+
throw new Error('Producer and Reviewer Assignment owner must be different principals');
|
|
300
|
+
}
|
|
301
|
+
assertAcceptanceWaitBinding(task, assignment);
|
|
302
|
+
assertNoOpenAcceptanceWait(state, task);
|
|
303
|
+
reviewerAssignments = { ...reviewerAssignments, [assignment.id]: assignment };
|
|
304
|
+
tasks = replaceTask(tasks, task.key, {
|
|
305
|
+
...task,
|
|
306
|
+
currentReviewerAssignmentId: assignment.id,
|
|
307
|
+
currentSponsorGateId: undefined,
|
|
308
|
+
acceptanceBlockReason: String(payload.reason),
|
|
309
|
+
});
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
case 'reviewer.expired': {
|
|
313
|
+
const assignment = requireReviewerAssignment(state, String(payload.assignmentId), ['open', 'claimed']);
|
|
314
|
+
if (payload.taskKey !== assignment.taskKey)
|
|
315
|
+
throw new Error('Reviewer expiry targets another Task');
|
|
316
|
+
reviewerAssignments = {
|
|
317
|
+
...reviewerAssignments,
|
|
318
|
+
[assignment.id]: { ...assignment, status: 'expired' },
|
|
319
|
+
};
|
|
320
|
+
const task = requireTask(state, assignment.taskKey, ['awaiting_acceptance']);
|
|
321
|
+
tasks = replaceTask(tasks, task.key, {
|
|
322
|
+
...task,
|
|
323
|
+
acceptanceBlockReason: 'Reviewer deadline expired; reassign, replan or cancel',
|
|
324
|
+
});
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case 'reviewer.claimed': {
|
|
328
|
+
const assignment = requireReviewerAssignment(state, String(payload.assignmentId), ['open']);
|
|
329
|
+
if (payload.taskKey !== assignment.taskKey)
|
|
330
|
+
throw new Error('Reviewer claim targets another Task');
|
|
331
|
+
assertPersistedAcceptanceAuthorization(state, payload, {
|
|
332
|
+
action: 'claim_review', role: 'reviewer', principalKey: 'reviewerPrincipalId', targetId: assignment.id,
|
|
333
|
+
});
|
|
334
|
+
if (payload.reviewerPrincipalId === assignment.producerPrincipalId) {
|
|
335
|
+
throw new Error('Producer cannot review its own Candidate');
|
|
336
|
+
}
|
|
337
|
+
reviewerAssignments = {
|
|
338
|
+
...reviewerAssignments,
|
|
339
|
+
[assignment.id]: {
|
|
340
|
+
...assignment,
|
|
341
|
+
status: 'claimed',
|
|
342
|
+
reviewerPrincipalId: String(payload.reviewerPrincipalId),
|
|
343
|
+
authorizationRef: String(payload.authorizedBy),
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
case 'reviewer.verdict_recorded': {
|
|
349
|
+
const assignment = requireReviewerAssignment(state, String(payload.assignmentId), ['claimed']);
|
|
350
|
+
if (payload.taskKey !== assignment.taskKey)
|
|
351
|
+
throw new Error('Reviewer verdict targets another Task');
|
|
352
|
+
assertPersistedAcceptanceAuthorization(state, payload, {
|
|
353
|
+
action: 'submit_review', role: 'reviewer', principalKey: 'reviewerPrincipalId', targetId: assignment.id,
|
|
354
|
+
});
|
|
355
|
+
if (payload.reviewerPrincipalId !== assignment.reviewerPrincipalId) {
|
|
356
|
+
throw new Error('Reviewer verdict principal does not match the claimed Assignment');
|
|
357
|
+
}
|
|
358
|
+
assertReviewerVerdictBindings(assignment.evaluation, payload.verdict);
|
|
359
|
+
const verdict = payload.verdict;
|
|
360
|
+
const expectedOutcome = reviewerVerdictRequiresRework(verdict) ? 'rework' : 'passed';
|
|
361
|
+
if (payload.outcome !== expectedOutcome) {
|
|
362
|
+
throw new Error('Reviewer verdict outcome does not match its criterion disposition');
|
|
363
|
+
}
|
|
364
|
+
reviewerAssignments = {
|
|
365
|
+
...reviewerAssignments,
|
|
366
|
+
[assignment.id]: {
|
|
367
|
+
...assignment,
|
|
368
|
+
status: payload.outcome === 'passed' ? 'passed' : 'rework',
|
|
369
|
+
verdict: verdict,
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
break;
|
|
373
|
+
}
|
|
374
|
+
case 'sponsor_gate.opened': {
|
|
375
|
+
const task = requireTask(state, String(payload.taskKey), ['awaiting_acceptance']);
|
|
376
|
+
const gate = payload.gate;
|
|
377
|
+
if (sponsorGates[gate.id])
|
|
378
|
+
throw new Error(`Sponsor Gate ${gate.id} already exists`);
|
|
379
|
+
assertAcceptanceWaitBinding(task, gate);
|
|
380
|
+
assertNoOpenAcceptanceWait(state, task);
|
|
381
|
+
sponsorGates = { ...sponsorGates, [gate.id]: gate };
|
|
382
|
+
tasks = replaceTask(tasks, task.key, {
|
|
383
|
+
...task,
|
|
384
|
+
currentReviewerAssignmentId: undefined,
|
|
385
|
+
currentSponsorGateId: gate.id,
|
|
386
|
+
acceptanceBlockReason: String(payload.reason),
|
|
387
|
+
});
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
case 'sponsor_gate.expired': {
|
|
391
|
+
const gate = requireSponsorGate(state, String(payload.gateId), ['open']);
|
|
392
|
+
if (payload.taskKey !== gate.taskKey)
|
|
393
|
+
throw new Error('Sponsor Gate expiry targets another Task');
|
|
394
|
+
sponsorGates = { ...sponsorGates, [gate.id]: { ...gate, status: 'expired' } };
|
|
395
|
+
const task = requireTask(state, gate.taskKey, ['awaiting_acceptance']);
|
|
396
|
+
tasks = replaceTask(tasks, task.key, {
|
|
397
|
+
...task,
|
|
398
|
+
acceptanceBlockReason: 'Sponsor Gate expired; reopen, rebase, replan or cancel',
|
|
399
|
+
});
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
case 'sponsor_gate.decided': {
|
|
403
|
+
const gate = requireSponsorGate(state, String(payload.gateId), ['open']);
|
|
404
|
+
if (payload.taskKey !== gate.taskKey)
|
|
405
|
+
throw new Error('Sponsor decision targets another Task');
|
|
406
|
+
assertPersistedAcceptanceAuthorization(state, payload, {
|
|
407
|
+
action: 'decide_sponsor', role: 'sponsor', principalKey: 'sponsorPrincipalId', targetId: gate.id,
|
|
408
|
+
});
|
|
409
|
+
if (payload.candidateHash !== gate.candidateHash) {
|
|
410
|
+
throw new Error('Sponsor decision is stale for the current Candidate hash');
|
|
411
|
+
}
|
|
412
|
+
const decision = payload.decision;
|
|
413
|
+
sponsorGates = {
|
|
414
|
+
...sponsorGates,
|
|
415
|
+
[gate.id]: {
|
|
416
|
+
...gate,
|
|
417
|
+
status: decision === 'approve'
|
|
418
|
+
? 'approved'
|
|
419
|
+
: decision === 'request_changes'
|
|
420
|
+
? 'changes_requested'
|
|
421
|
+
: decision === 'reject' ? 'rejected' : 'cancelled',
|
|
422
|
+
sponsorPrincipalId: String(payload.sponsorPrincipalId),
|
|
423
|
+
authorizationRef: String(payload.authorizedBy),
|
|
424
|
+
decisionReason: String(payload.reason),
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
break;
|
|
428
|
+
}
|
|
429
|
+
case 'task.rework_requested': {
|
|
430
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
431
|
+
({ reviewerAssignments, sponsorGates } = settleAcceptanceWaits(task, reviewerAssignments, sponsorGates, 'cancelled'));
|
|
432
|
+
tasks = replaceTask(tasks, task.key, {
|
|
433
|
+
...task,
|
|
434
|
+
status: 'ready',
|
|
435
|
+
revision: task.revision + 1,
|
|
436
|
+
attempt: 0,
|
|
437
|
+
currentAssignmentId: undefined,
|
|
438
|
+
reportRef: undefined,
|
|
439
|
+
reportDigest: undefined,
|
|
440
|
+
candidateRef: undefined,
|
|
441
|
+
candidateHash: undefined,
|
|
442
|
+
completionReceiptDigest: undefined,
|
|
443
|
+
acceptanceContract: undefined,
|
|
444
|
+
acceptanceRecord: undefined,
|
|
445
|
+
currentReviewerAssignmentId: undefined,
|
|
446
|
+
currentSponsorGateId: undefined,
|
|
447
|
+
acceptanceBlockReason: undefined,
|
|
448
|
+
terminalReason: String(payload.reason),
|
|
449
|
+
});
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
case 'task.revised': {
|
|
453
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
454
|
+
tasks = replaceTask(tasks, task.key, {
|
|
455
|
+
...task,
|
|
456
|
+
title: String(payload.title),
|
|
457
|
+
status: 'ready',
|
|
458
|
+
revision: task.revision + 1,
|
|
459
|
+
attempt: 0,
|
|
460
|
+
maxAttempts: Number(payload.maxAttempts),
|
|
461
|
+
currentAssignmentId: undefined,
|
|
462
|
+
reportRef: undefined,
|
|
463
|
+
reportDigest: undefined,
|
|
464
|
+
candidateRef: undefined,
|
|
465
|
+
candidateHash: undefined,
|
|
466
|
+
completionReceiptDigest: undefined,
|
|
467
|
+
acceptanceContract: undefined,
|
|
468
|
+
acceptanceRecord: undefined,
|
|
469
|
+
currentReviewerAssignmentId: undefined,
|
|
470
|
+
currentSponsorGateId: undefined,
|
|
471
|
+
acceptanceBlockReason: undefined,
|
|
472
|
+
terminalReason: String(payload.reason),
|
|
473
|
+
});
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
case 'task.plan_revised': {
|
|
477
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
478
|
+
if (task.revision !== Number(payload.expectedTaskRevision)
|
|
479
|
+
|| Number(payload.newTaskRevision) !== task.revision + 1) {
|
|
480
|
+
throw new Error(`Task ${task.key} Plan Revision targets another revision`);
|
|
481
|
+
}
|
|
482
|
+
tasks = replaceTask(tasks, task.key, {
|
|
483
|
+
...task,
|
|
484
|
+
title: String(payload.title),
|
|
485
|
+
required: payload.required === true,
|
|
486
|
+
status: 'ready',
|
|
487
|
+
revision: task.revision + 1,
|
|
488
|
+
attempt: 0,
|
|
489
|
+
maxAttempts: Number(payload.maxAttempts),
|
|
490
|
+
blockers: [],
|
|
491
|
+
currentAssignmentId: undefined,
|
|
492
|
+
reportRef: undefined,
|
|
493
|
+
reportDigest: undefined,
|
|
494
|
+
candidateRef: undefined,
|
|
495
|
+
candidateHash: undefined,
|
|
496
|
+
completionReceiptDigest: undefined,
|
|
497
|
+
acceptanceContract: undefined,
|
|
498
|
+
acceptanceRecord: undefined,
|
|
499
|
+
currentReviewerAssignmentId: undefined,
|
|
500
|
+
currentSponsorGateId: undefined,
|
|
501
|
+
acceptanceBlockReason: undefined,
|
|
502
|
+
terminalReason: String(payload.reason),
|
|
503
|
+
});
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
case 'task.cancel_requested': {
|
|
507
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
508
|
+
tasks = replaceTask(tasks, task.key, { ...task, status: 'cancelling' });
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
case 'task.cancelled':
|
|
512
|
+
case 'task.failed': {
|
|
513
|
+
const task = requireTask(state, String(payload.taskKey));
|
|
514
|
+
({ reviewerAssignments, sponsorGates } = settleAcceptanceWaits(task, reviewerAssignments, sponsorGates, 'cancelled'));
|
|
515
|
+
tasks = replaceTask(tasks, task.key, {
|
|
516
|
+
...task,
|
|
517
|
+
status: event.type === 'task.cancelled' ? 'cancelled' : 'failed',
|
|
518
|
+
terminalReason: String(payload.reason ?? ''),
|
|
519
|
+
});
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
case 'clock.advanced': break;
|
|
523
|
+
}
|
|
524
|
+
return deriveRunStatus({
|
|
525
|
+
...state,
|
|
526
|
+
status,
|
|
527
|
+
sequence: event.sequence,
|
|
528
|
+
now: event.type === 'clock.advanced' ? Number(payload.now) : Math.max(state.now, event.occurredAt),
|
|
529
|
+
cancelRequested,
|
|
530
|
+
tasks,
|
|
531
|
+
assignments,
|
|
532
|
+
reviewerAssignments,
|
|
533
|
+
sponsorGates,
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
function decideClock(state, now, event) {
|
|
537
|
+
const events = [event('clock.advanced', { now })];
|
|
538
|
+
const newlyTerminal = new Set();
|
|
539
|
+
for (const assignment of Object.values(state.assignments)) {
|
|
540
|
+
if (assignment.status === 'cancel_requested' && (assignment.controlDeadline ?? Infinity) <= now) {
|
|
541
|
+
events.push(event('assignment.cancelled', { assignmentId: assignment.id, outcome: 'outcome_unknown' }));
|
|
542
|
+
events.push(event('task.cancelled', { taskKey: assignment.taskKey, reason: 'control deadline expired' }));
|
|
543
|
+
newlyTerminal.add(assignment.taskKey);
|
|
544
|
+
}
|
|
545
|
+
else if ((assignment.status === 'leased' || assignment.status === 'running')
|
|
546
|
+
&& assignment.leaseExpiresAt <= now) {
|
|
547
|
+
const task = state.tasks[assignment.taskKey];
|
|
548
|
+
events.push(event('assignment.lease_expired', { assignmentId: assignment.id }));
|
|
549
|
+
if (assignment.attempt >= task.maxAttempts) {
|
|
550
|
+
events.push(event('task.failed', { taskKey: task.key, reason: 'assignment attempts exhausted' }));
|
|
551
|
+
newlyTerminal.add(task.key);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
for (const assignment of Object.values(state.reviewerAssignments)) {
|
|
556
|
+
if ((assignment.status === 'open' || assignment.status === 'claimed') && assignment.deadline <= now) {
|
|
557
|
+
events.push(event('reviewer.expired', {
|
|
558
|
+
taskKey: assignment.taskKey,
|
|
559
|
+
assignmentId: assignment.id,
|
|
560
|
+
}));
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
for (const gate of Object.values(state.sponsorGates)) {
|
|
564
|
+
if (gate.status === 'open' && gate.deadline <= now) {
|
|
565
|
+
events.push(event('sponsor_gate.expired', { taskKey: gate.taskKey, gateId: gate.id }));
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
if (state.cancelRequested && Object.values(state.tasks).every(task => TERMINAL_TASKS.has(task.status) || newlyTerminal.has(task.key))) {
|
|
569
|
+
events.push(event('run.cancelled', { reason: 'all task cancellation controls settled' }));
|
|
570
|
+
}
|
|
571
|
+
return events;
|
|
572
|
+
}
|
|
573
|
+
function evolveAssignment(assignment, event) {
|
|
574
|
+
switch (event.type) {
|
|
575
|
+
case 'assignment.started': return { ...assignment, status: 'running' };
|
|
576
|
+
case 'assignment.progress':
|
|
577
|
+
requireAssignmentStatusForReplay(assignment, ['running'], event.type);
|
|
578
|
+
return withObservation(assignment, event, {
|
|
579
|
+
latestProgress: event.payload.progress,
|
|
580
|
+
});
|
|
581
|
+
case 'assignment.heartbeat':
|
|
582
|
+
requireAssignmentStatusForReplay(assignment, ['leased', 'running'], event.type);
|
|
583
|
+
return withObservation(assignment, event, {
|
|
584
|
+
leaseExpiresAt: Number(event.payload.leaseExpiresAt),
|
|
585
|
+
});
|
|
586
|
+
case 'assignment.checkpointed':
|
|
587
|
+
requireAssignmentStatusForReplay(assignment, ['running'], event.type);
|
|
588
|
+
return withObservation(assignment, event, {
|
|
589
|
+
checkpointRef: String(event.payload.checkpointRef),
|
|
590
|
+
checkpointDigest: String(event.payload.checkpointDigest),
|
|
591
|
+
});
|
|
592
|
+
case 'assignment.preempted':
|
|
593
|
+
requireAssignmentStatusForReplay(assignment, ['running'], event.type);
|
|
594
|
+
if (assignment.checkpointRef !== event.payload.checkpointRef
|
|
595
|
+
|| assignment.checkpointDigest !== event.payload.checkpointDigest) {
|
|
596
|
+
throw new Error('Persisted Assignment preemption is not bound to its checkpoint');
|
|
597
|
+
}
|
|
598
|
+
return { ...assignment, status: 'cancelled', outcome: 'interrupted' };
|
|
599
|
+
case 'assignment.execution_completed':
|
|
600
|
+
requireAssignmentStatusForReplay(assignment, ['running'], event.type);
|
|
601
|
+
return {
|
|
602
|
+
...withObservation(assignment, event),
|
|
603
|
+
status: 'execution_completed',
|
|
604
|
+
reportRef: String(event.payload.reportRef),
|
|
605
|
+
reportDigest: String(event.payload.reportDigest),
|
|
606
|
+
candidateRef: String(event.payload.candidateRef),
|
|
607
|
+
candidateHash: String(event.payload.candidateHash),
|
|
608
|
+
completionReceiptDigest: event.payload.completionReceiptDigest === undefined
|
|
609
|
+
? undefined
|
|
610
|
+
: String(event.payload.completionReceiptDigest),
|
|
611
|
+
};
|
|
612
|
+
case 'assignment.cancel_requested': return {
|
|
613
|
+
...assignment,
|
|
614
|
+
status: 'cancel_requested',
|
|
615
|
+
controlDeadline: Number(event.payload.controlDeadline),
|
|
616
|
+
};
|
|
617
|
+
case 'assignment.cancelled': return {
|
|
618
|
+
...assignment,
|
|
619
|
+
status: 'cancelled',
|
|
620
|
+
outcome: event.payload.outcome,
|
|
621
|
+
};
|
|
622
|
+
case 'assignment.lease_expired': return { ...assignment, status: 'lost', outcome: 'outcome_unknown' };
|
|
623
|
+
default: return assignment;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function evolveTaskFromAssignment(task, assignment, event) {
|
|
627
|
+
if (event.type === 'assignment.execution_completed') {
|
|
628
|
+
return {
|
|
629
|
+
...task,
|
|
630
|
+
status: 'awaiting_acceptance',
|
|
631
|
+
reportRef: assignment.reportRef,
|
|
632
|
+
reportDigest: assignment.reportDigest,
|
|
633
|
+
candidateRef: assignment.candidateRef,
|
|
634
|
+
candidateHash: assignment.candidateHash,
|
|
635
|
+
completionReceiptDigest: assignment.completionReceiptDigest,
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
if (event.type === 'assignment.cancel_requested')
|
|
639
|
+
return { ...task, status: 'cancelling' };
|
|
640
|
+
if (event.type === 'assignment.preempted') {
|
|
641
|
+
return { ...task, status: 'ready', currentAssignmentId: undefined };
|
|
642
|
+
}
|
|
643
|
+
if (event.type === 'assignment.cancelled')
|
|
644
|
+
return { ...task, status: 'cancelled' };
|
|
645
|
+
if (event.type === 'assignment.lease_expired') {
|
|
646
|
+
return task.attempt >= task.maxAttempts
|
|
647
|
+
? { ...task, status: 'failed', terminalReason: 'assignment attempts exhausted' }
|
|
648
|
+
: { ...task, status: 'ready', currentAssignmentId: undefined };
|
|
649
|
+
}
|
|
650
|
+
return task;
|
|
651
|
+
}
|
|
652
|
+
function withObservation(assignment, event, patch = {}) {
|
|
653
|
+
if (event.payload.envelopeDigest !== assignment.envelopeDigest) {
|
|
654
|
+
throw new Error('Persisted Assignment observation targets another Envelope');
|
|
655
|
+
}
|
|
656
|
+
const observationId = String(event.payload.observationId);
|
|
657
|
+
const observationDigest = String(event.payload.observationDigest);
|
|
658
|
+
if (assignment.observationDigests[observationId]) {
|
|
659
|
+
throw new Error(`Persisted Assignment observationId is duplicated: ${observationId}`);
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
...assignment,
|
|
663
|
+
...patch,
|
|
664
|
+
observationDigests: {
|
|
665
|
+
...assignment.observationDigests,
|
|
666
|
+
[observationId]: observationDigest,
|
|
667
|
+
},
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
function requireAssignmentStatusForReplay(assignment, allowed, eventType) {
|
|
671
|
+
if (!allowed.includes(assignment.status)) {
|
|
672
|
+
throw new Error(`Persisted ${eventType} is invalid while Assignment is ${assignment.status}`);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
function deriveRunStatus(state) {
|
|
676
|
+
if (state.status === 'cancelled')
|
|
677
|
+
return state;
|
|
678
|
+
const tasks = Object.values(state.tasks);
|
|
679
|
+
if (state.cancelRequested)
|
|
680
|
+
return { ...state, status: 'cancelling' };
|
|
681
|
+
if (tasks.length > 0 && tasks.every(task => task.status === 'accepted' || (!task.required && TERMINAL_TASKS.has(task.status)))) {
|
|
682
|
+
return { ...state, status: 'completed' };
|
|
683
|
+
}
|
|
684
|
+
if (tasks.some(task => task.required && (task.status === 'failed' || task.status === 'cancelled'))) {
|
|
685
|
+
return { ...state, status: 'needs_replan' };
|
|
686
|
+
}
|
|
687
|
+
if (tasks.some(task => (task.currentReviewerAssignmentId
|
|
688
|
+
&& state.reviewerAssignments[task.currentReviewerAssignmentId]?.status === 'expired')
|
|
689
|
+
|| (task.currentSponsorGateId
|
|
690
|
+
&& state.sponsorGates[task.currentSponsorGateId]?.status === 'expired'))) {
|
|
691
|
+
return { ...state, status: 'blocked' };
|
|
692
|
+
}
|
|
693
|
+
if (tasks.some(task => task.status === 'blocked'))
|
|
694
|
+
return { ...state, status: 'blocked' };
|
|
695
|
+
return { ...state, status: 'active' };
|
|
696
|
+
}
|
|
697
|
+
function replaceTask(tasks, key, task) {
|
|
698
|
+
return { ...tasks, [key]: task };
|
|
699
|
+
}
|
|
700
|
+
function requireTask(state, key, statuses) {
|
|
701
|
+
const task = state.tasks[key];
|
|
702
|
+
if (!task)
|
|
703
|
+
throw new Error(`Task ${key} not found`);
|
|
704
|
+
if (statuses && !statuses.includes(task.status))
|
|
705
|
+
throw new Error(`Task ${key} is ${task.status}`);
|
|
706
|
+
return task;
|
|
707
|
+
}
|
|
708
|
+
function requireAssignment(state, id, statuses) {
|
|
709
|
+
const assignment = state.assignments[id];
|
|
710
|
+
if (!assignment)
|
|
711
|
+
throw new Error(`Assignment ${id} not found`);
|
|
712
|
+
if (statuses && !statuses.includes(assignment.status))
|
|
713
|
+
throw new Error(`Assignment ${id} is ${assignment.status}`);
|
|
714
|
+
return assignment;
|
|
715
|
+
}
|
|
716
|
+
function requireReviewerAssignment(state, id, statuses) {
|
|
717
|
+
const assignment = state.reviewerAssignments[id];
|
|
718
|
+
if (!assignment)
|
|
719
|
+
throw new Error(`Reviewer Assignment ${id} not found`);
|
|
720
|
+
if (statuses && !statuses.includes(assignment.status)) {
|
|
721
|
+
throw new Error(`Reviewer Assignment ${id} is ${assignment.status}`);
|
|
722
|
+
}
|
|
723
|
+
return assignment;
|
|
724
|
+
}
|
|
725
|
+
function requireSponsorGate(state, id, statuses) {
|
|
726
|
+
const gate = state.sponsorGates[id];
|
|
727
|
+
if (!gate)
|
|
728
|
+
throw new Error(`Sponsor Gate ${id} not found`);
|
|
729
|
+
if (statuses && !statuses.includes(gate.status))
|
|
730
|
+
throw new Error(`Sponsor Gate ${id} is ${gate.status}`);
|
|
731
|
+
return gate;
|
|
732
|
+
}
|
|
733
|
+
function assertAcceptanceWaitBinding(task, wait) {
|
|
734
|
+
const contract = task.acceptanceContract;
|
|
735
|
+
if (!contract
|
|
736
|
+
|| wait.taskKey !== task.key
|
|
737
|
+
|| wait.taskRevision !== task.revision
|
|
738
|
+
|| wait.contractId !== contract.id
|
|
739
|
+
|| wait.policy.id !== contract.policy.id
|
|
740
|
+
|| wait.policy.revision !== contract.policy.revision
|
|
741
|
+
|| wait.policy.digest !== contract.policy.digest) {
|
|
742
|
+
throw new Error('Acceptance wait does not match the pinned Task, Contract and Policy snapshot');
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
function assertNoOpenAcceptanceWait(state, task) {
|
|
746
|
+
const review = task.currentReviewerAssignmentId
|
|
747
|
+
? state.reviewerAssignments[task.currentReviewerAssignmentId]
|
|
748
|
+
: undefined;
|
|
749
|
+
const gate = task.currentSponsorGateId ? state.sponsorGates[task.currentSponsorGateId] : undefined;
|
|
750
|
+
if (review?.status === 'open' || review?.status === 'claimed' || gate?.status === 'open') {
|
|
751
|
+
throw new Error(`Task ${task.key} already has an open Acceptance wait`);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
function assertAcceptanceRecordControlBindings(state, task, record) {
|
|
755
|
+
if (record.route === 'auto_accept') {
|
|
756
|
+
if (record.reviewerAssignmentId || record.sponsorGateId) {
|
|
757
|
+
throw new Error('Automatic Acceptance Record cannot reference Reviewer or Sponsor proof');
|
|
758
|
+
}
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
if (record.route === 'reviewer_required' || record.route === 'reviewer_then_sponsor') {
|
|
762
|
+
const reviewId = record.reviewerAssignmentId;
|
|
763
|
+
const review = reviewId ? state.reviewerAssignments[reviewId] : undefined;
|
|
764
|
+
if (!review
|
|
765
|
+
|| (record.route === 'reviewer_required' && task.currentReviewerAssignmentId !== review.id)
|
|
766
|
+
|| review.status !== 'passed'
|
|
767
|
+
|| review.reviewerPrincipalId !== record.reviewerPrincipalId
|
|
768
|
+
|| review.candidateHash !== record.candidateHash) {
|
|
769
|
+
throw new Error('Acceptance Record is not bound to a passed Reviewer verdict');
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
if (record.route === 'sponsor_required' || record.route === 'reviewer_then_sponsor') {
|
|
773
|
+
const gateId = record.sponsorGateId;
|
|
774
|
+
const gate = gateId ? state.sponsorGates[gateId] : undefined;
|
|
775
|
+
if (!gate
|
|
776
|
+
|| task.currentSponsorGateId !== gate.id
|
|
777
|
+
|| gate.status !== 'approved'
|
|
778
|
+
|| gate.sponsorPrincipalId !== record.sponsorPrincipalId
|
|
779
|
+
|| gate.candidateHash !== record.candidateHash
|
|
780
|
+
|| (record.route === 'reviewer_then_sponsor'
|
|
781
|
+
&& gate.reviewerAssignmentId !== record.reviewerAssignmentId)) {
|
|
782
|
+
throw new Error('Acceptance Record is not bound to an approved Sponsor Gate');
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
function assertPersistedAcceptanceAuthorization(state, payload, expected) {
|
|
787
|
+
const authorization = payload.authorization;
|
|
788
|
+
if (!authorization || typeof authorization !== 'object' || Array.isArray(authorization)) {
|
|
789
|
+
throw new Error('Acceptance control event is missing its authorization decision');
|
|
790
|
+
}
|
|
791
|
+
const value = authorization;
|
|
792
|
+
if (value.authorized !== true
|
|
793
|
+
|| value.action !== expected.action
|
|
794
|
+
|| value.role !== expected.role
|
|
795
|
+
|| value.principalId !== payload[expected.principalKey]
|
|
796
|
+
|| value.projectId !== state.projectId
|
|
797
|
+
|| value.runId !== state.runId
|
|
798
|
+
|| value.taskKey !== payload.taskKey
|
|
799
|
+
|| value.targetId !== expected.targetId
|
|
800
|
+
|| value.expectedSequence !== state.sequence
|
|
801
|
+
|| value.authorizedBy !== payload.authorizedBy) {
|
|
802
|
+
throw new Error('Acceptance control event authorization is stale or targets another scope');
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
function settleAcceptanceWaits(task, reviewerAssignments, sponsorGates, status) {
|
|
806
|
+
const reviewId = task.currentReviewerAssignmentId;
|
|
807
|
+
const review = reviewId ? reviewerAssignments[reviewId] : undefined;
|
|
808
|
+
const gateId = task.currentSponsorGateId;
|
|
809
|
+
const gate = gateId ? sponsorGates[gateId] : undefined;
|
|
810
|
+
return {
|
|
811
|
+
reviewerAssignments: review?.status === 'open' || review?.status === 'claimed'
|
|
812
|
+
? { ...reviewerAssignments, [review.id]: { ...review, status } }
|
|
813
|
+
: reviewerAssignments,
|
|
814
|
+
sponsorGates: gate?.status === 'open'
|
|
815
|
+
? { ...sponsorGates, [gate.id]: { ...gate, status } }
|
|
816
|
+
: sponsorGates,
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
//# sourceMappingURL=kernel-state.js.map
|