@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,844 @@
|
|
|
1
|
+
import { compareCanonicalWorkroomText, digestCanonicalWorkroomValue as digest } from '../workroom/canonical-value.js';
|
|
2
|
+
export class PortfolioSequenceConflictError extends Error {
|
|
3
|
+
portfolioId;
|
|
4
|
+
expectedSequence;
|
|
5
|
+
actualSequence;
|
|
6
|
+
constructor(portfolioId, expectedSequence, actualSequence) {
|
|
7
|
+
super(`Portfolio ${portfolioId} sequence conflict: expected ${expectedSequence}, actual ${actualSequence}`);
|
|
8
|
+
this.portfolioId = portfolioId;
|
|
9
|
+
this.expectedSequence = expectedSequence;
|
|
10
|
+
this.actualSequence = actualSequence;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export class PortfolioEventIdentityConflictError extends Error {
|
|
14
|
+
portfolioId;
|
|
15
|
+
eventId;
|
|
16
|
+
constructor(portfolioId, eventId) {
|
|
17
|
+
super(`Portfolio ${portfolioId} eventId conflict: ${eventId}`);
|
|
18
|
+
this.portfolioId = portfolioId;
|
|
19
|
+
this.eventId = eventId;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class PortfolioRequestIdentityConflictError extends Error {
|
|
23
|
+
portfolioId;
|
|
24
|
+
identity;
|
|
25
|
+
constructor(portfolioId, identity) {
|
|
26
|
+
super(`Portfolio ${portfolioId} Capacity Request identity conflict: ${identity}`);
|
|
27
|
+
this.portfolioId = portfolioId;
|
|
28
|
+
this.identity = identity;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** In-memory adapter for the Portfolio Journal port; authoritative ordering is CAS-only. */
|
|
32
|
+
export class InMemoryPortfolioJournalRepository {
|
|
33
|
+
#journals = new Map();
|
|
34
|
+
async listPortfolioIds() {
|
|
35
|
+
return Object.freeze([...this.#journals.keys()].sort());
|
|
36
|
+
}
|
|
37
|
+
async read(portfolioId) {
|
|
38
|
+
identifier(portfolioId, 'portfolioId');
|
|
39
|
+
return this.#journals.get(portfolioId) ?? Object.freeze([]);
|
|
40
|
+
}
|
|
41
|
+
async append(portfolioId, expectedSequence, drafts) {
|
|
42
|
+
identifier(portfolioId, 'portfolioId');
|
|
43
|
+
if (!Number.isSafeInteger(expectedSequence) || expectedSequence < -1) {
|
|
44
|
+
throw new Error('Invalid Portfolio append position');
|
|
45
|
+
}
|
|
46
|
+
const current = this.#journals.get(portfolioId) ?? Object.freeze([]);
|
|
47
|
+
const actualSequence = current.at(-1)?.sequence ?? -1;
|
|
48
|
+
if (drafts.length === 0) {
|
|
49
|
+
if (actualSequence !== expectedSequence) {
|
|
50
|
+
throw new PortfolioSequenceConflictError(portfolioId, expectedSequence, actualSequence);
|
|
51
|
+
}
|
|
52
|
+
return Object.freeze([]);
|
|
53
|
+
}
|
|
54
|
+
const normalized = deduplicateDrafts(portfolioId, drafts.map((draft) => parsePortfolioFactDraft(draft)));
|
|
55
|
+
const eventsById = new Map(current.map((event) => [event.eventId, event]));
|
|
56
|
+
const requestEvents = current.filter((event) => event.type === 'capacity.requested');
|
|
57
|
+
const requestsById = new Map(requestEvents.map((event) => [event.payload.request.requestId, event]));
|
|
58
|
+
const requestsByHead = new Map(requestEvents.map((event) => [headKey(event.payload.request), event]));
|
|
59
|
+
const idempotent = new Set();
|
|
60
|
+
for (const draft of normalized) {
|
|
61
|
+
const existingEvent = eventsById.get(draft.eventId);
|
|
62
|
+
if (existingEvent) {
|
|
63
|
+
if (existingEvent.type !== draft.type
|
|
64
|
+
|| stableJson(existingEvent.payload) !== stableJson(draft.payload)) {
|
|
65
|
+
throw new PortfolioEventIdentityConflictError(portfolioId, draft.eventId);
|
|
66
|
+
}
|
|
67
|
+
idempotent.add(existingEvent);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (draft.type === 'capacity.requested') {
|
|
71
|
+
for (const [identity, existingRequest] of [
|
|
72
|
+
[`requestId:${draft.payload.request.requestId}`, requestsById.get(draft.payload.request.requestId)],
|
|
73
|
+
[`opaqueHeadId:${headKey(draft.payload.request)}`, requestsByHead.get(headKey(draft.payload.request))],
|
|
74
|
+
]) {
|
|
75
|
+
if (!existingRequest)
|
|
76
|
+
continue;
|
|
77
|
+
throw new PortfolioRequestIdentityConflictError(portfolioId, identity);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (idempotent.size > 0) {
|
|
82
|
+
if (idempotent.size !== normalized.length) {
|
|
83
|
+
throw new Error('Portfolio append cannot mix replayed and new facts');
|
|
84
|
+
}
|
|
85
|
+
return Object.freeze([...idempotent].sort((left, right) => left.sequence - right.sequence));
|
|
86
|
+
}
|
|
87
|
+
if (actualSequence !== expectedSequence) {
|
|
88
|
+
throw new PortfolioSequenceConflictError(portfolioId, expectedSequence, actualSequence);
|
|
89
|
+
}
|
|
90
|
+
const appended = normalized.map((draft, index) => deepFreeze({
|
|
91
|
+
version: 1,
|
|
92
|
+
portfolioId,
|
|
93
|
+
sequence: expectedSequence + index + 1,
|
|
94
|
+
eventId: draft.eventId,
|
|
95
|
+
occurredAt: draft.occurredAt,
|
|
96
|
+
type: draft.type,
|
|
97
|
+
payload: draft.payload,
|
|
98
|
+
}));
|
|
99
|
+
this.#journals.set(portfolioId, Object.freeze([...current, ...appended]));
|
|
100
|
+
return Object.freeze(appended);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const REQUEST_KEYS = new Set([
|
|
104
|
+
'requestId',
|
|
105
|
+
'projectId',
|
|
106
|
+
'workRef',
|
|
107
|
+
'schedulerRevision',
|
|
108
|
+
'schedulerSequence',
|
|
109
|
+
'localOrder',
|
|
110
|
+
'projectPolicyRevision',
|
|
111
|
+
'opaqueHeadId',
|
|
112
|
+
'payloadDigest',
|
|
113
|
+
'resourceBundle',
|
|
114
|
+
'preemptibility',
|
|
115
|
+
'deadlineAt',
|
|
116
|
+
'starvationAt',
|
|
117
|
+
]);
|
|
118
|
+
const WORK_REF_KEYS = new Set(['runId', 'profileRevisionId', 'profileDigest']);
|
|
119
|
+
const RESOURCE_BUNDLE_KEYS = new Set(['demands']);
|
|
120
|
+
const RESOURCE_DEMAND_KEYS = new Set(['poolId', 'capacityUnits', 'rateUnits', 'budgetUnits']);
|
|
121
|
+
export function parsePortfolioCapacityRequest(value) {
|
|
122
|
+
const request = exactRecord(value, REQUEST_KEYS, 'Capacity Request');
|
|
123
|
+
const workRef = exactRecord(request.workRef, WORK_REF_KEYS, 'Capacity Request workRef');
|
|
124
|
+
const resourceBundle = exactRecord(request.resourceBundle, RESOURCE_BUNDLE_KEYS, 'Capacity Request resourceBundle');
|
|
125
|
+
const bundle = parsePortfolioResourceBundle(resourceBundle);
|
|
126
|
+
const preemptibility = request.preemptibility;
|
|
127
|
+
if (preemptibility !== 'checkpointable' && preemptibility !== 'atomic') {
|
|
128
|
+
throw new Error('Invalid Capacity Request preemptibility');
|
|
129
|
+
}
|
|
130
|
+
const deadlineAt = request.deadlineAt === undefined
|
|
131
|
+
? undefined
|
|
132
|
+
: positiveSafeInteger(request.deadlineAt, 'deadlineAt');
|
|
133
|
+
const starvationAt = positiveSafeInteger(request.starvationAt, 'starvationAt');
|
|
134
|
+
if (deadlineAt !== undefined && starvationAt > deadlineAt) {
|
|
135
|
+
throw new Error('Capacity Request starvationAt cannot exceed deadlineAt');
|
|
136
|
+
}
|
|
137
|
+
return deepFreeze({
|
|
138
|
+
requestId: identifier(request.requestId, 'requestId'),
|
|
139
|
+
projectId: identifier(request.projectId, 'projectId'),
|
|
140
|
+
workRef: {
|
|
141
|
+
runId: identifier(workRef.runId, 'workRef.runId'),
|
|
142
|
+
profileRevisionId: identifier(workRef.profileRevisionId, 'workRef.profileRevisionId'),
|
|
143
|
+
profileDigest: contentDigest(workRef.profileDigest, 'workRef.profileDigest'),
|
|
144
|
+
},
|
|
145
|
+
schedulerRevision: identifier(request.schedulerRevision, 'schedulerRevision'),
|
|
146
|
+
schedulerSequence: nonNegativeSafeInteger(request.schedulerSequence, 'schedulerSequence'),
|
|
147
|
+
localOrder: nonNegativeSafeInteger(request.localOrder, 'localOrder'),
|
|
148
|
+
projectPolicyRevision: positiveSafeInteger(request.projectPolicyRevision, 'projectPolicyRevision'),
|
|
149
|
+
opaqueHeadId: identifier(request.opaqueHeadId, 'opaqueHeadId'),
|
|
150
|
+
payloadDigest: contentDigest(request.payloadDigest, 'payloadDigest'),
|
|
151
|
+
resourceBundle: bundle,
|
|
152
|
+
preemptibility,
|
|
153
|
+
...(deadlineAt === undefined ? {} : { deadlineAt }),
|
|
154
|
+
starvationAt,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export function parsePortfolioResourceBundle(value) {
|
|
158
|
+
const resourceBundle = exactRecord(value, RESOURCE_BUNDLE_KEYS, 'Portfolio Resource Bundle');
|
|
159
|
+
if (!Array.isArray(resourceBundle.demands) || resourceBundle.demands.length === 0) {
|
|
160
|
+
throw new Error('Capacity Request requires a non-empty atomic Resource Bundle');
|
|
161
|
+
}
|
|
162
|
+
const seenPools = new Set();
|
|
163
|
+
const demands = resourceBundle.demands.map((raw, index) => {
|
|
164
|
+
const demand = exactRecord(raw, RESOURCE_DEMAND_KEYS, `Capacity Request demand ${index}`);
|
|
165
|
+
const poolId = identifier(demand.poolId, `resourceBundle.demands[${index}].poolId`);
|
|
166
|
+
if (seenPools.has(poolId))
|
|
167
|
+
throw new Error(`Duplicate Resource Pool demand: ${poolId}`);
|
|
168
|
+
seenPools.add(poolId);
|
|
169
|
+
return {
|
|
170
|
+
poolId,
|
|
171
|
+
capacityUnits: positiveSafeInteger(demand.capacityUnits, `${poolId}.capacityUnits`),
|
|
172
|
+
rateUnits: positiveSafeInteger(demand.rateUnits, `${poolId}.rateUnits`),
|
|
173
|
+
budgetUnits: nonNegativeSafeInteger(demand.budgetUnits, `${poolId}.budgetUnits`),
|
|
174
|
+
};
|
|
175
|
+
}).sort((left, right) => compareCanonicalWorkroomText(left.poolId, right.poolId));
|
|
176
|
+
return deepFreeze({ demands });
|
|
177
|
+
}
|
|
178
|
+
const PORTFOLIO_FACT_TYPES = new Set([
|
|
179
|
+
'portfolio.policy_pinned', 'project.policy_updated', 'priority.override_set',
|
|
180
|
+
'capacity.requested', 'capacity.grant_offered', 'capacity.grant_consumed',
|
|
181
|
+
'capacity.grant_assignment_failed',
|
|
182
|
+
'capacity.grant_lease_renewed',
|
|
183
|
+
'capacity.grant_expired', 'capacity.grant_lease_lost', 'capacity.usage_settled',
|
|
184
|
+
'capacity.reclaim_requested', 'capacity.reclaim_acknowledged',
|
|
185
|
+
'capacity.reclaim_timed_out', 'clock.advanced', 'service.normalized',
|
|
186
|
+
]);
|
|
187
|
+
export function parsePortfolioFactPayload(type, value) {
|
|
188
|
+
let payload;
|
|
189
|
+
switch (type) {
|
|
190
|
+
case 'portfolio.policy_pinned': {
|
|
191
|
+
const record = exactRecord(value, new Set(['policy', 'governance']), type);
|
|
192
|
+
payload = {
|
|
193
|
+
policy: parsePortfolioPolicySnapshot(record.policy),
|
|
194
|
+
governance: parseGovernanceProof(record.governance),
|
|
195
|
+
};
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
case 'project.policy_updated': {
|
|
199
|
+
const record = exactRecord(value, new Set(['policy', 'governance']), type);
|
|
200
|
+
payload = {
|
|
201
|
+
policy: parsePortfolioProjectPolicy(record.policy),
|
|
202
|
+
governance: parseGovernanceProof(record.governance),
|
|
203
|
+
};
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
case 'priority.override_set': {
|
|
207
|
+
const record = exactRecord(value, new Set(['override', 'governance']), type);
|
|
208
|
+
payload = {
|
|
209
|
+
override: parsePriorityOverride(record.override),
|
|
210
|
+
governance: parseGovernanceProof(record.governance),
|
|
211
|
+
};
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case 'capacity.requested': {
|
|
215
|
+
const record = exactRecord(value, new Set(['request', 'bundleAuthority']), type);
|
|
216
|
+
payload = {
|
|
217
|
+
request: parsePortfolioCapacityRequest(record.request),
|
|
218
|
+
...(record.bundleAuthority === undefined
|
|
219
|
+
? {}
|
|
220
|
+
: { bundleAuthority: parseValidatedBundleAuthority(record.bundleAuthority) }),
|
|
221
|
+
};
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
case 'capacity.grant_offered': {
|
|
225
|
+
const record = exactRecord(value, new Set(['grant']), type);
|
|
226
|
+
payload = { grant: parseCapacityGrant(record.grant) };
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
case 'capacity.grant_consumed': {
|
|
230
|
+
const record = exactRecord(value, new Set([
|
|
231
|
+
'grantId', 'projectId', 'fence', 'assignmentRef', 'consumedAt', 'leaseExpiresAt',
|
|
232
|
+
'maxLeaseExpiresAt', 'authority',
|
|
233
|
+
]), type);
|
|
234
|
+
payload = {
|
|
235
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
236
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
237
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
238
|
+
assignmentRef: identifier(record.assignmentRef, 'assignmentRef'),
|
|
239
|
+
consumedAt: nonNegativeSafeInteger(record.consumedAt, 'consumedAt'),
|
|
240
|
+
leaseExpiresAt: positiveSafeInteger(record.leaseExpiresAt, 'leaseExpiresAt'),
|
|
241
|
+
maxLeaseExpiresAt: positiveSafeInteger(record.maxLeaseExpiresAt, 'maxLeaseExpiresAt'),
|
|
242
|
+
authority: parseKernelCommandAuthority(record.authority),
|
|
243
|
+
};
|
|
244
|
+
if (payload.leaseExpiresAt <= payload.consumedAt
|
|
245
|
+
|| payload.maxLeaseExpiresAt < payload.leaseExpiresAt) {
|
|
246
|
+
throw new Error('Capacity Grant lease/max quantum must expire after consume');
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
case 'capacity.grant_assignment_failed': {
|
|
251
|
+
const record = exactRecord(value, new Set([
|
|
252
|
+
'grantId', 'projectId', 'fence', 'assignmentRef', 'reason', 'kernelSequence',
|
|
253
|
+
'kernelFactDigest', 'failedAt', 'authority',
|
|
254
|
+
]), type);
|
|
255
|
+
if (record.reason !== 'task_stale' && record.reason !== 'task_terminal'
|
|
256
|
+
&& record.reason !== 'run_terminal') {
|
|
257
|
+
throw new Error('Invalid Capacity Grant Assignment failure reason');
|
|
258
|
+
}
|
|
259
|
+
payload = {
|
|
260
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
261
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
262
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
263
|
+
assignmentRef: identifier(record.assignmentRef, 'assignmentRef'),
|
|
264
|
+
reason: record.reason,
|
|
265
|
+
kernelSequence: nonNegativeSafeInteger(record.kernelSequence, 'kernelSequence'),
|
|
266
|
+
kernelFactDigest: contentDigest(record.kernelFactDigest, 'kernelFactDigest'),
|
|
267
|
+
failedAt: nonNegativeSafeInteger(record.failedAt, 'failedAt'),
|
|
268
|
+
authority: parseKernelCommandAuthority(record.authority),
|
|
269
|
+
};
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
case 'capacity.grant_lease_renewed': {
|
|
273
|
+
const record = exactRecord(value, new Set([
|
|
274
|
+
'grantId', 'projectId', 'fence', 'assignmentRef', 'heartbeatSequence', 'renewedAt',
|
|
275
|
+
'previousLeaseExpiresAt', 'leaseExpiresAt', 'maxLeaseExpiresAt', 'policyDigest',
|
|
276
|
+
'clockSequence', 'clockDigest', 'usageSettlementCursor', 'authority',
|
|
277
|
+
]), type);
|
|
278
|
+
payload = {
|
|
279
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
280
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
281
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
282
|
+
assignmentRef: identifier(record.assignmentRef, 'assignmentRef'),
|
|
283
|
+
heartbeatSequence: positiveSafeInteger(record.heartbeatSequence, 'heartbeatSequence'),
|
|
284
|
+
renewedAt: nonNegativeSafeInteger(record.renewedAt, 'renewedAt'),
|
|
285
|
+
previousLeaseExpiresAt: positiveSafeInteger(record.previousLeaseExpiresAt, 'previousLeaseExpiresAt'),
|
|
286
|
+
leaseExpiresAt: positiveSafeInteger(record.leaseExpiresAt, 'leaseExpiresAt'),
|
|
287
|
+
maxLeaseExpiresAt: positiveSafeInteger(record.maxLeaseExpiresAt, 'maxLeaseExpiresAt'),
|
|
288
|
+
policyDigest: contentDigest(record.policyDigest, 'policyDigest'),
|
|
289
|
+
clockSequence: nonNegativeSafeInteger(record.clockSequence, 'clockSequence'),
|
|
290
|
+
clockDigest: contentDigest(record.clockDigest, 'clockDigest'),
|
|
291
|
+
usageSettlementCursor: cursor(record.usageSettlementCursor, 'usageSettlementCursor'),
|
|
292
|
+
authority: parseKernelCommandAuthority(record.authority),
|
|
293
|
+
};
|
|
294
|
+
if (payload.leaseExpiresAt <= payload.previousLeaseExpiresAt
|
|
295
|
+
|| payload.leaseExpiresAt > payload.maxLeaseExpiresAt) {
|
|
296
|
+
throw new Error('Capacity Grant Lease renewal escaped max quantum');
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
case 'capacity.grant_expired':
|
|
301
|
+
case 'capacity.reclaim_timed_out': {
|
|
302
|
+
const allowed = type === 'capacity.grant_expired'
|
|
303
|
+
? new Set(['grantId', 'fence'])
|
|
304
|
+
: new Set(['reclaimId', 'grantId', 'fence']);
|
|
305
|
+
const record = exactRecord(value, allowed, type);
|
|
306
|
+
payload = type === 'capacity.grant_expired'
|
|
307
|
+
? { grantId: identifier(record.grantId, 'grantId'), fence: positiveSafeInteger(record.fence, 'fence') }
|
|
308
|
+
: {
|
|
309
|
+
reclaimId: identifier(record.reclaimId, 'reclaimId'),
|
|
310
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
311
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
312
|
+
};
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
case 'capacity.grant_lease_lost': {
|
|
316
|
+
const record = exactRecord(value, new Set(['grantId', 'fence', 'usage']), type);
|
|
317
|
+
if (record.usage !== 'unknown')
|
|
318
|
+
throw new Error('Lost Capacity Grant usage must remain unknown');
|
|
319
|
+
payload = {
|
|
320
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
321
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
322
|
+
usage: 'unknown',
|
|
323
|
+
};
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
case 'capacity.usage_settled': {
|
|
327
|
+
const record = exactRecord(value, new Set([
|
|
328
|
+
'receiptId', 'grantId', 'fence', 'actualCostMicros', 'settlementRef', 'authenticatedBy', 'authority',
|
|
329
|
+
]), type);
|
|
330
|
+
payload = {
|
|
331
|
+
receiptId: identifier(record.receiptId, 'receiptId'),
|
|
332
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
333
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
334
|
+
actualCostMicros: nonNegativeSafeInteger(record.actualCostMicros, 'actualCostMicros'),
|
|
335
|
+
settlementRef: identifier(record.settlementRef, 'settlementRef'),
|
|
336
|
+
authenticatedBy: identifier(record.authenticatedBy, 'authenticatedBy'),
|
|
337
|
+
authority: parseUsageGatewayAuthority(record.authority),
|
|
338
|
+
};
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
case 'capacity.reclaim_requested': {
|
|
342
|
+
const record = exactRecord(value, new Set(['reclaim']), type);
|
|
343
|
+
payload = { reclaim: parseCapacityReclaim(record.reclaim) };
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
case 'capacity.reclaim_acknowledged': {
|
|
347
|
+
const record = exactRecord(value, new Set([
|
|
348
|
+
'reclaimId', 'grantId', 'projectId', 'fence', 'outcome', 'checkpointRef', 'checkpointDigest', 'authority',
|
|
349
|
+
]), type);
|
|
350
|
+
if (record.outcome !== 'checkpointed' && record.outcome !== 'declined') {
|
|
351
|
+
throw new Error('Invalid Capacity Reclaim outcome');
|
|
352
|
+
}
|
|
353
|
+
payload = {
|
|
354
|
+
reclaimId: identifier(record.reclaimId, 'reclaimId'),
|
|
355
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
356
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
357
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
358
|
+
outcome: record.outcome,
|
|
359
|
+
...(record.checkpointRef === undefined
|
|
360
|
+
? {}
|
|
361
|
+
: { checkpointRef: identifier(record.checkpointRef, 'checkpointRef') }),
|
|
362
|
+
...(record.checkpointDigest === undefined
|
|
363
|
+
? {}
|
|
364
|
+
: { checkpointDigest: contentDigest(record.checkpointDigest, 'checkpointDigest') }),
|
|
365
|
+
authority: parseKernelCommandAuthority(record.authority),
|
|
366
|
+
};
|
|
367
|
+
if (payload.outcome === 'checkpointed' && (!payload.checkpointRef || !payload.checkpointDigest)) {
|
|
368
|
+
throw new Error('Checkpointed Capacity Reclaim requires checkpoint ref/digest');
|
|
369
|
+
}
|
|
370
|
+
if (payload.outcome === 'declined' && (payload.checkpointRef || payload.checkpointDigest)) {
|
|
371
|
+
throw new Error('Declined Capacity Reclaim cannot claim a checkpoint');
|
|
372
|
+
}
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
case 'clock.advanced': {
|
|
376
|
+
const record = exactRecord(value, new Set(['now', 'authority']), type);
|
|
377
|
+
payload = {
|
|
378
|
+
now: nonNegativeSafeInteger(record.now, 'Portfolio clock'),
|
|
379
|
+
authority: parseClockAuthority(record.authority),
|
|
380
|
+
};
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
case 'service.normalized': {
|
|
384
|
+
const record = exactRecord(value, new Set(['normalization']), type);
|
|
385
|
+
payload = { normalization: parseServiceNormalization(record.normalization) };
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return deepFreeze(payload);
|
|
390
|
+
}
|
|
391
|
+
export function parsePortfolioPolicySnapshot(value) {
|
|
392
|
+
const record = exactRecord(value, new Set([
|
|
393
|
+
'revision', 'digest', 'globalBudgetMicros', 'offerTtlTicks', 'leaseTtlTicks',
|
|
394
|
+
'leaseHeartbeatTicks', 'maxLeaseQuantumTicks', 'maxLeaseRenewals',
|
|
395
|
+
'reclaimTtlTicks', 'pools', 'projects',
|
|
396
|
+
]), 'Portfolio Policy');
|
|
397
|
+
const poolsRecord = dictionary(record.pools, 'Portfolio Policy pools');
|
|
398
|
+
const pools = {};
|
|
399
|
+
for (const poolId of Object.keys(poolsRecord).sort()) {
|
|
400
|
+
const pool = exactRecord(poolsRecord[poolId], new Set([
|
|
401
|
+
'poolId', 'capacityUnits', 'rateUnitsPerWindow', 'rateWindowTicks',
|
|
402
|
+
'priceMicrosPerBudgetUnit',
|
|
403
|
+
]), `Portfolio Pool ${poolId}`);
|
|
404
|
+
if (pool.poolId !== poolId)
|
|
405
|
+
throw new Error('Portfolio Pool dictionary identity drift');
|
|
406
|
+
pools[poolId] = deepFreeze({
|
|
407
|
+
poolId: identifier(pool.poolId, 'poolId'),
|
|
408
|
+
capacityUnits: positiveSafeInteger(pool.capacityUnits, 'pool.capacityUnits'),
|
|
409
|
+
rateUnitsPerWindow: positiveSafeInteger(pool.rateUnitsPerWindow, 'pool.rateUnitsPerWindow'),
|
|
410
|
+
rateWindowTicks: positiveSafeInteger(pool.rateWindowTicks, 'pool.rateWindowTicks'),
|
|
411
|
+
priceMicrosPerBudgetUnit: nonNegativeSafeInteger(pool.priceMicrosPerBudgetUnit, 'pool.priceMicrosPerBudgetUnit'),
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
if (Object.keys(pools).length === 0)
|
|
415
|
+
throw new Error('Portfolio Policy requires Resource Pools');
|
|
416
|
+
const projectsRecord = dictionary(record.projects, 'Portfolio Policy projects');
|
|
417
|
+
const projects = {};
|
|
418
|
+
for (const projectId of Object.keys(projectsRecord).sort()) {
|
|
419
|
+
const project = parsePortfolioProjectPolicy(projectsRecord[projectId]);
|
|
420
|
+
if (project.projectId !== projectId)
|
|
421
|
+
throw new Error('Portfolio Project Policy dictionary identity drift');
|
|
422
|
+
for (const poolId of project.allowedPools) {
|
|
423
|
+
if (!pools[poolId])
|
|
424
|
+
throw new Error(`Portfolio Project Policy references unknown Pool ${poolId}`);
|
|
425
|
+
}
|
|
426
|
+
projects[projectId] = project;
|
|
427
|
+
}
|
|
428
|
+
const leaseTtlTicks = positiveSafeInteger(record.leaseTtlTicks, 'leaseTtlTicks');
|
|
429
|
+
const leaseHeartbeatTicks = positiveSafeInteger(record.leaseHeartbeatTicks, 'leaseHeartbeatTicks');
|
|
430
|
+
const maxLeaseQuantumTicks = positiveSafeInteger(record.maxLeaseQuantumTicks, 'maxLeaseQuantumTicks');
|
|
431
|
+
const maxLeaseRenewals = nonNegativeSafeInteger(record.maxLeaseRenewals, 'maxLeaseRenewals');
|
|
432
|
+
if (leaseHeartbeatTicks >= leaseTtlTicks) {
|
|
433
|
+
throw new Error('Portfolio lease heartbeat must be shorter than its lease TTL');
|
|
434
|
+
}
|
|
435
|
+
if (maxLeaseQuantumTicks < leaseTtlTicks) {
|
|
436
|
+
throw new Error('Portfolio max lease quantum cannot be shorter than its lease TTL');
|
|
437
|
+
}
|
|
438
|
+
const projection = deepFreeze({
|
|
439
|
+
revision: positiveSafeInteger(record.revision, 'Portfolio Policy revision'),
|
|
440
|
+
globalBudgetMicros: nonNegativeSafeInteger(record.globalBudgetMicros, 'globalBudgetMicros'),
|
|
441
|
+
offerTtlTicks: positiveSafeInteger(record.offerTtlTicks, 'offerTtlTicks'),
|
|
442
|
+
leaseTtlTicks,
|
|
443
|
+
leaseHeartbeatTicks,
|
|
444
|
+
maxLeaseQuantumTicks,
|
|
445
|
+
maxLeaseRenewals,
|
|
446
|
+
reclaimTtlTicks: positiveSafeInteger(record.reclaimTtlTicks, 'reclaimTtlTicks'),
|
|
447
|
+
pools,
|
|
448
|
+
projects,
|
|
449
|
+
});
|
|
450
|
+
const actualDigest = contentDigest(record.digest, 'Portfolio Policy digest');
|
|
451
|
+
if (actualDigest !== digest(projection))
|
|
452
|
+
throw new Error('Portfolio Policy digest drift');
|
|
453
|
+
return deepFreeze({ ...projection, digest: actualDigest });
|
|
454
|
+
}
|
|
455
|
+
export function createPortfolioPolicySnapshot(input) {
|
|
456
|
+
const projection = deepFreeze(structuredClone(input));
|
|
457
|
+
return parsePortfolioPolicySnapshot({ ...projection, digest: digest(projection) });
|
|
458
|
+
}
|
|
459
|
+
export function parsePortfolioProjectPolicy(value) {
|
|
460
|
+
const record = exactRecord(value, new Set([
|
|
461
|
+
'projectId', 'revision', 'lane', 'weight', 'hardBudgetMicros', 'allowedPools',
|
|
462
|
+
'maxOutstandingRequests', 'maxConcurrentGrants', 'burstLimit', 'starvationTicks', 'status',
|
|
463
|
+
]), 'Portfolio Project Policy');
|
|
464
|
+
const lane = portfolioLane(record.lane);
|
|
465
|
+
const status = record.status;
|
|
466
|
+
if (status !== 'active' && status !== 'paused' && status !== 'reclaim_checkpointable') {
|
|
467
|
+
throw new Error('Invalid Portfolio Project status');
|
|
468
|
+
}
|
|
469
|
+
const allowedPools = stringList(record.allowedPools, 'allowedPools');
|
|
470
|
+
if (allowedPools.length === 0)
|
|
471
|
+
throw new Error('Portfolio Project Policy requires allowed Pools');
|
|
472
|
+
const maxOutstandingRequests = positiveSafeInteger(record.maxOutstandingRequests, 'maxOutstandingRequests');
|
|
473
|
+
const maxConcurrentGrants = positiveSafeInteger(record.maxConcurrentGrants, 'maxConcurrentGrants');
|
|
474
|
+
const burstLimit = positiveSafeInteger(record.burstLimit, 'burstLimit');
|
|
475
|
+
if (maxConcurrentGrants > maxOutstandingRequests || burstLimit > maxOutstandingRequests) {
|
|
476
|
+
throw new Error('Portfolio Project caps are inconsistent');
|
|
477
|
+
}
|
|
478
|
+
return deepFreeze({
|
|
479
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
480
|
+
revision: positiveSafeInteger(record.revision, 'Project Policy revision'),
|
|
481
|
+
lane,
|
|
482
|
+
weight: positiveSafeInteger(record.weight, 'Project Policy weight'),
|
|
483
|
+
hardBudgetMicros: nonNegativeSafeInteger(record.hardBudgetMicros, 'hardBudgetMicros'),
|
|
484
|
+
allowedPools,
|
|
485
|
+
maxOutstandingRequests,
|
|
486
|
+
maxConcurrentGrants,
|
|
487
|
+
burstLimit,
|
|
488
|
+
starvationTicks: positiveSafeInteger(record.starvationTicks, 'starvationTicks'),
|
|
489
|
+
status,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function parsePriorityOverride(value) {
|
|
493
|
+
const record = exactRecord(value, new Set([
|
|
494
|
+
'overrideId', 'requestId', 'projectId', 'lane', 'policyRevision',
|
|
495
|
+
'requestPayloadDigest', 'expiresAt',
|
|
496
|
+
]), 'Portfolio Priority Override');
|
|
497
|
+
return deepFreeze({
|
|
498
|
+
overrideId: identifier(record.overrideId, 'overrideId'),
|
|
499
|
+
requestId: identifier(record.requestId, 'requestId'),
|
|
500
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
501
|
+
lane: portfolioLane(record.lane),
|
|
502
|
+
policyRevision: positiveSafeInteger(record.policyRevision, 'policyRevision'),
|
|
503
|
+
requestPayloadDigest: contentDigest(record.requestPayloadDigest, 'requestPayloadDigest'),
|
|
504
|
+
expiresAt: positiveSafeInteger(record.expiresAt, 'expiresAt'),
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function parseGovernanceProof(value) {
|
|
508
|
+
const record = exactRecord(value, new Set([
|
|
509
|
+
'principalId', 'authorizedBy', 'reasonDigest', 'targetDigest', 'expectedRevision',
|
|
510
|
+
]), 'Portfolio Governance proof');
|
|
511
|
+
return deepFreeze({
|
|
512
|
+
principalId: identifier(record.principalId, 'principalId'),
|
|
513
|
+
authorizedBy: identifier(record.authorizedBy, 'authorizedBy'),
|
|
514
|
+
reasonDigest: contentDigest(record.reasonDigest, 'reasonDigest'),
|
|
515
|
+
targetDigest: contentDigest(record.targetDigest, 'targetDigest'),
|
|
516
|
+
expectedRevision: nonNegativeSafeInteger(record.expectedRevision, 'expectedRevision'),
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
function parseValidatedBundleAuthority(value) {
|
|
520
|
+
const record = exactRecord(value, new Set([
|
|
521
|
+
'requestDigest', 'resourceBundleDigest',
|
|
522
|
+
'catalogGenerationId', 'catalogRevision', 'catalogDigest', 'profileRevisionId',
|
|
523
|
+
'profileDigest', 'profileCeilingDigest', 'validatedBundleDigest', 'reservedCostMicros',
|
|
524
|
+
]), 'Validated Atomic Resource Bundle authority');
|
|
525
|
+
return deepFreeze({
|
|
526
|
+
requestDigest: contentDigest(record.requestDigest, 'requestDigest'),
|
|
527
|
+
resourceBundleDigest: contentDigest(record.resourceBundleDigest, 'resourceBundleDigest'),
|
|
528
|
+
catalogGenerationId: identifier(record.catalogGenerationId, 'catalogGenerationId'),
|
|
529
|
+
catalogRevision: positiveSafeInteger(record.catalogRevision, 'catalogRevision'),
|
|
530
|
+
catalogDigest: contentDigest(record.catalogDigest, 'catalogDigest'),
|
|
531
|
+
profileRevisionId: identifier(record.profileRevisionId, 'profileRevisionId'),
|
|
532
|
+
profileDigest: contentDigest(record.profileDigest, 'profileDigest'),
|
|
533
|
+
profileCeilingDigest: contentDigest(record.profileCeilingDigest, 'profileCeilingDigest'),
|
|
534
|
+
validatedBundleDigest: contentDigest(record.validatedBundleDigest, 'validatedBundleDigest'),
|
|
535
|
+
reservedCostMicros: nonNegativeSafeInteger(record.reservedCostMicros, 'reservedCostMicros'),
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function parseKernelCommandAuthority(value) {
|
|
539
|
+
const record = exactRecord(value, new Set([
|
|
540
|
+
'portfolioId', 'action', 'projectId', 'requestId', 'grantId', 'fence',
|
|
541
|
+
'assignmentRef', 'reclaimId', 'outcome', 'checkpointRef', 'checkpointDigest',
|
|
542
|
+
'heartbeatSequence', 'clockSequence', 'clockDigest', 'policyDigest', 'usageSettlementCursor',
|
|
543
|
+
'failureReason', 'kernelSequence', 'kernelFactDigest',
|
|
544
|
+
'commandDigest', 'authorizedBy',
|
|
545
|
+
]), 'Portfolio Kernel command authority');
|
|
546
|
+
if (record.action !== 'consume' && record.action !== 'assignment_failed'
|
|
547
|
+
&& record.action !== 'reclaim_acknowledge' && record.action !== 'renew') {
|
|
548
|
+
throw new Error('Invalid Portfolio Kernel command authority action');
|
|
549
|
+
}
|
|
550
|
+
if (record.outcome !== undefined && record.outcome !== 'checkpointed' && record.outcome !== 'declined') {
|
|
551
|
+
throw new Error('Invalid Portfolio Kernel command authority outcome');
|
|
552
|
+
}
|
|
553
|
+
return deepFreeze({
|
|
554
|
+
portfolioId: identifier(record.portfolioId, 'portfolioId'),
|
|
555
|
+
action: record.action,
|
|
556
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
557
|
+
requestId: identifier(record.requestId, 'requestId'),
|
|
558
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
559
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
560
|
+
assignmentRef: identifier(record.assignmentRef, 'assignmentRef'),
|
|
561
|
+
...(record.reclaimId === undefined ? {} : { reclaimId: identifier(record.reclaimId, 'reclaimId') }),
|
|
562
|
+
...(record.outcome === undefined ? {} : { outcome: record.outcome }),
|
|
563
|
+
...(record.checkpointRef === undefined
|
|
564
|
+
? {}
|
|
565
|
+
: { checkpointRef: identifier(record.checkpointRef, 'checkpointRef') }),
|
|
566
|
+
...(record.checkpointDigest === undefined
|
|
567
|
+
? {}
|
|
568
|
+
: { checkpointDigest: contentDigest(record.checkpointDigest, 'checkpointDigest') }),
|
|
569
|
+
...(record.heartbeatSequence === undefined
|
|
570
|
+
? {}
|
|
571
|
+
: { heartbeatSequence: positiveSafeInteger(record.heartbeatSequence, 'heartbeatSequence') }),
|
|
572
|
+
...(record.clockSequence === undefined
|
|
573
|
+
? {}
|
|
574
|
+
: { clockSequence: nonNegativeSafeInteger(record.clockSequence, 'clockSequence') }),
|
|
575
|
+
...(record.clockDigest === undefined
|
|
576
|
+
? {}
|
|
577
|
+
: { clockDigest: contentDigest(record.clockDigest, 'clockDigest') }),
|
|
578
|
+
...(record.policyDigest === undefined
|
|
579
|
+
? {}
|
|
580
|
+
: { policyDigest: contentDigest(record.policyDigest, 'policyDigest') }),
|
|
581
|
+
...(record.usageSettlementCursor === undefined
|
|
582
|
+
? {}
|
|
583
|
+
: { usageSettlementCursor: cursor(record.usageSettlementCursor, 'usageSettlementCursor') }),
|
|
584
|
+
...(record.failureReason === undefined ? {} : {
|
|
585
|
+
failureReason: failureReason(record.failureReason),
|
|
586
|
+
}),
|
|
587
|
+
...(record.kernelSequence === undefined ? {} : {
|
|
588
|
+
kernelSequence: nonNegativeSafeInteger(record.kernelSequence, 'kernelSequence'),
|
|
589
|
+
}),
|
|
590
|
+
...(record.kernelFactDigest === undefined ? {} : {
|
|
591
|
+
kernelFactDigest: contentDigest(record.kernelFactDigest, 'kernelFactDigest'),
|
|
592
|
+
}),
|
|
593
|
+
commandDigest: contentDigest(record.commandDigest, 'commandDigest'),
|
|
594
|
+
authorizedBy: identifier(record.authorizedBy, 'authorizedBy'),
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
function failureReason(value) {
|
|
598
|
+
if (value !== 'task_stale' && value !== 'task_terminal' && value !== 'run_terminal') {
|
|
599
|
+
throw new Error('Invalid Portfolio Kernel command failure reason');
|
|
600
|
+
}
|
|
601
|
+
return value;
|
|
602
|
+
}
|
|
603
|
+
function parseUsageGatewayAuthority(value) {
|
|
604
|
+
const record = exactRecord(value, new Set([
|
|
605
|
+
'portfolioId', 'receiptId', 'requestId', 'grantId', 'fence', 'actualCostMicros',
|
|
606
|
+
'settlementRef', 'receiptDigest', 'authenticatedBy',
|
|
607
|
+
]), 'Portfolio Usage Gateway authority');
|
|
608
|
+
return deepFreeze({
|
|
609
|
+
portfolioId: identifier(record.portfolioId, 'portfolioId'),
|
|
610
|
+
receiptId: identifier(record.receiptId, 'receiptId'),
|
|
611
|
+
requestId: identifier(record.requestId, 'requestId'),
|
|
612
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
613
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
614
|
+
actualCostMicros: nonNegativeSafeInteger(record.actualCostMicros, 'actualCostMicros'),
|
|
615
|
+
settlementRef: identifier(record.settlementRef, 'settlementRef'),
|
|
616
|
+
receiptDigest: contentDigest(record.receiptDigest, 'receiptDigest'),
|
|
617
|
+
authenticatedBy: identifier(record.authenticatedBy, 'authenticatedBy'),
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
function parseClockAuthority(value) {
|
|
621
|
+
const record = exactRecord(value, new Set([
|
|
622
|
+
'portfolioId', 'now', 'clockDigest', 'authorizedBy',
|
|
623
|
+
]), 'Portfolio clock authority');
|
|
624
|
+
return deepFreeze({
|
|
625
|
+
portfolioId: identifier(record.portfolioId, 'portfolioId'),
|
|
626
|
+
now: nonNegativeSafeInteger(record.now, 'Portfolio clock'),
|
|
627
|
+
clockDigest: contentDigest(record.clockDigest, 'clockDigest'),
|
|
628
|
+
authorizedBy: identifier(record.authorizedBy, 'authorizedBy'),
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
function parseCapacityGrant(value) {
|
|
632
|
+
const record = exactRecord(value, new Set([
|
|
633
|
+
'grantId', 'requestId', 'projectId', 'fence', 'resourceBundle',
|
|
634
|
+
'requestDigest', 'resourceBundleDigest',
|
|
635
|
+
'catalogGenerationId', 'catalogRevision', 'catalogDigest', 'profileRevisionId',
|
|
636
|
+
'profileDigest', 'profileCeilingDigest', 'validatedBundleDigest', 'reservedCostMicros',
|
|
637
|
+
'portfolioPolicyRevision', 'portfolioPolicyDigest', 'projectPolicyRevision', 'lane',
|
|
638
|
+
'issuedAt', 'issuedSequence', 'offerExpiresAt', 'status',
|
|
639
|
+
]), 'Portfolio Capacity Grant');
|
|
640
|
+
const status = record.status;
|
|
641
|
+
if (status !== 'offered')
|
|
642
|
+
throw new Error('Capacity Grant offer fact cannot forge a terminal status');
|
|
643
|
+
const issuedAt = nonNegativeSafeInteger(record.issuedAt, 'issuedAt');
|
|
644
|
+
const offerExpiresAt = positiveSafeInteger(record.offerExpiresAt, 'offerExpiresAt');
|
|
645
|
+
if (offerExpiresAt <= issuedAt)
|
|
646
|
+
throw new Error('Capacity Grant offer expiry is stale');
|
|
647
|
+
return deepFreeze({
|
|
648
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
649
|
+
requestId: identifier(record.requestId, 'requestId'),
|
|
650
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
651
|
+
fence: positiveSafeInteger(record.fence, 'fence'),
|
|
652
|
+
resourceBundle: parsePortfolioResourceBundle(record.resourceBundle),
|
|
653
|
+
requestDigest: contentDigest(record.requestDigest, 'requestDigest'),
|
|
654
|
+
resourceBundleDigest: contentDigest(record.resourceBundleDigest, 'resourceBundleDigest'),
|
|
655
|
+
catalogGenerationId: identifier(record.catalogGenerationId, 'catalogGenerationId'),
|
|
656
|
+
catalogRevision: positiveSafeInteger(record.catalogRevision, 'catalogRevision'),
|
|
657
|
+
catalogDigest: contentDigest(record.catalogDigest, 'catalogDigest'),
|
|
658
|
+
profileRevisionId: identifier(record.profileRevisionId, 'profileRevisionId'),
|
|
659
|
+
profileDigest: contentDigest(record.profileDigest, 'profileDigest'),
|
|
660
|
+
profileCeilingDigest: contentDigest(record.profileCeilingDigest, 'profileCeilingDigest'),
|
|
661
|
+
validatedBundleDigest: contentDigest(record.validatedBundleDigest, 'validatedBundleDigest'),
|
|
662
|
+
reservedCostMicros: nonNegativeSafeInteger(record.reservedCostMicros, 'reservedCostMicros'),
|
|
663
|
+
portfolioPolicyRevision: positiveSafeInteger(record.portfolioPolicyRevision, 'portfolioPolicyRevision'),
|
|
664
|
+
portfolioPolicyDigest: contentDigest(record.portfolioPolicyDigest, 'portfolioPolicyDigest'),
|
|
665
|
+
projectPolicyRevision: positiveSafeInteger(record.projectPolicyRevision, 'projectPolicyRevision'),
|
|
666
|
+
lane: portfolioLane(record.lane),
|
|
667
|
+
issuedAt,
|
|
668
|
+
issuedSequence: nonNegativeSafeInteger(record.issuedSequence, 'issuedSequence'),
|
|
669
|
+
offerExpiresAt,
|
|
670
|
+
status: 'offered',
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
function parseCapacityReclaim(value) {
|
|
674
|
+
const record = exactRecord(value, new Set([
|
|
675
|
+
'reclaimId', 'grantId', 'projectId', 'reservedForRequestId', 'requestedAt',
|
|
676
|
+
'deadline', 'reason', 'status',
|
|
677
|
+
]), 'Portfolio Capacity Reclaim');
|
|
678
|
+
const reason = record.reason;
|
|
679
|
+
if (!['higher_portfolio_priority', 'starvation_bound', 'project_pause'].includes(String(reason))) {
|
|
680
|
+
throw new Error('Invalid Capacity Reclaim reason');
|
|
681
|
+
}
|
|
682
|
+
const status = record.status;
|
|
683
|
+
if (status !== 'pending')
|
|
684
|
+
throw new Error('Capacity Reclaim request fact cannot forge a terminal status');
|
|
685
|
+
const requestedAt = nonNegativeSafeInteger(record.requestedAt, 'requestedAt');
|
|
686
|
+
const deadline = positiveSafeInteger(record.deadline, 'deadline');
|
|
687
|
+
if (deadline <= requestedAt)
|
|
688
|
+
throw new Error('Capacity Reclaim deadline is stale');
|
|
689
|
+
return deepFreeze({
|
|
690
|
+
reclaimId: identifier(record.reclaimId, 'reclaimId'),
|
|
691
|
+
grantId: identifier(record.grantId, 'grantId'),
|
|
692
|
+
projectId: identifier(record.projectId, 'projectId'),
|
|
693
|
+
...(record.reservedForRequestId === undefined
|
|
694
|
+
? {}
|
|
695
|
+
: { reservedForRequestId: identifier(record.reservedForRequestId, 'reservedForRequestId') }),
|
|
696
|
+
requestedAt,
|
|
697
|
+
deadline,
|
|
698
|
+
reason: reason,
|
|
699
|
+
status: 'pending',
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
function parseServiceNormalization(value) {
|
|
703
|
+
const record = exactRecord(value, new Set([
|
|
704
|
+
'normalizationId', 'divisor', 'projectService',
|
|
705
|
+
]), 'Portfolio Service Normalization');
|
|
706
|
+
const service = dictionary(record.projectService, 'projectService');
|
|
707
|
+
const projectService = {};
|
|
708
|
+
for (const projectId of Object.keys(service).sort()) {
|
|
709
|
+
projectService[identifier(projectId, 'projectService projectId')] =
|
|
710
|
+
nonNegativeSafeInteger(service[projectId], `projectService.${projectId}`);
|
|
711
|
+
}
|
|
712
|
+
return deepFreeze({
|
|
713
|
+
normalizationId: identifier(record.normalizationId, 'normalizationId'),
|
|
714
|
+
divisor: positiveSafeInteger(record.divisor, 'normalization divisor'),
|
|
715
|
+
projectService,
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
export function parsePortfolioFactDraft(draft) {
|
|
719
|
+
if (!draft || typeof draft !== 'object' || Array.isArray(draft)) {
|
|
720
|
+
throw new Error('Invalid Portfolio fact draft');
|
|
721
|
+
}
|
|
722
|
+
if (!PORTFOLIO_FACT_TYPES.has(draft.type))
|
|
723
|
+
throw new Error('Invalid Portfolio fact type');
|
|
724
|
+
if (!Number.isFinite(draft.occurredAt) || draft.occurredAt < 0) {
|
|
725
|
+
throw new Error('Invalid Portfolio fact occurredAt');
|
|
726
|
+
}
|
|
727
|
+
return deepFreeze({
|
|
728
|
+
eventId: identifier(draft.eventId, 'eventId'),
|
|
729
|
+
occurredAt: draft.occurredAt,
|
|
730
|
+
type: draft.type,
|
|
731
|
+
payload: parsePortfolioFactPayload(draft.type, draft.payload),
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
function deduplicateDrafts(portfolioId, drafts) {
|
|
735
|
+
const result = [];
|
|
736
|
+
const byEventId = new Map();
|
|
737
|
+
const byRequestId = new Map();
|
|
738
|
+
const byHead = new Map();
|
|
739
|
+
for (const draft of drafts) {
|
|
740
|
+
const eventMatch = byEventId.get(draft.eventId);
|
|
741
|
+
if (eventMatch) {
|
|
742
|
+
if (eventMatch.type !== draft.type || stableJson(eventMatch.payload) !== stableJson(draft.payload)) {
|
|
743
|
+
throw new PortfolioEventIdentityConflictError(portfolioId, draft.eventId);
|
|
744
|
+
}
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
byEventId.set(draft.eventId, draft);
|
|
748
|
+
if (draft.type === 'capacity.requested') {
|
|
749
|
+
const requestMatch = byRequestId.get(draft.payload.request.requestId);
|
|
750
|
+
const headMatch = byHead.get(headKey(draft.payload.request));
|
|
751
|
+
for (const [identity, match] of [
|
|
752
|
+
[`requestId:${draft.payload.request.requestId}`, requestMatch],
|
|
753
|
+
[`opaqueHeadId:${headKey(draft.payload.request)}`, headMatch],
|
|
754
|
+
]) {
|
|
755
|
+
if (match)
|
|
756
|
+
throw new PortfolioRequestIdentityConflictError(portfolioId, identity);
|
|
757
|
+
}
|
|
758
|
+
byRequestId.set(draft.payload.request.requestId, draft);
|
|
759
|
+
byHead.set(headKey(draft.payload.request), draft);
|
|
760
|
+
}
|
|
761
|
+
result.push(draft);
|
|
762
|
+
}
|
|
763
|
+
return Object.freeze(result);
|
|
764
|
+
}
|
|
765
|
+
function headKey(request) {
|
|
766
|
+
return `${request.projectId}:${request.opaqueHeadId}`;
|
|
767
|
+
}
|
|
768
|
+
function exactRecord(value, allowed, label) {
|
|
769
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
770
|
+
throw new Error(`${label} must be an object`);
|
|
771
|
+
}
|
|
772
|
+
const record = value;
|
|
773
|
+
const unknown = Object.keys(record).filter((key) => !allowed.has(key)).sort();
|
|
774
|
+
if (unknown.length > 0) {
|
|
775
|
+
throw new Error(`${label} cannot carry Workroom content or unknown fields: ${unknown.join(', ')}`);
|
|
776
|
+
}
|
|
777
|
+
return record;
|
|
778
|
+
}
|
|
779
|
+
function dictionary(value, label) {
|
|
780
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
781
|
+
throw new Error(`${label} must be a dictionary`);
|
|
782
|
+
}
|
|
783
|
+
return value;
|
|
784
|
+
}
|
|
785
|
+
function stringList(value, label) {
|
|
786
|
+
if (!Array.isArray(value))
|
|
787
|
+
throw new Error(`${label} must be an array`);
|
|
788
|
+
const result = value.map((item, index) => identifier(item, `${label}.${index}`));
|
|
789
|
+
if (new Set(result).size !== result.length)
|
|
790
|
+
throw new Error(`${label} contains duplicates`);
|
|
791
|
+
return Object.freeze([...result].sort());
|
|
792
|
+
}
|
|
793
|
+
function portfolioLane(value) {
|
|
794
|
+
if (value !== 'urgent' && value !== 'high' && value !== 'normal' && value !== 'low') {
|
|
795
|
+
throw new Error('Invalid Portfolio lane');
|
|
796
|
+
}
|
|
797
|
+
return value;
|
|
798
|
+
}
|
|
799
|
+
function identifier(value, path) {
|
|
800
|
+
if (typeof value !== 'string' || value.length === 0 || value.length > 256) {
|
|
801
|
+
throw new Error(`Invalid opaque ${path}`);
|
|
802
|
+
}
|
|
803
|
+
return value;
|
|
804
|
+
}
|
|
805
|
+
function contentDigest(value, path) {
|
|
806
|
+
const result = identifier(value, path);
|
|
807
|
+
if (!result.startsWith('sha256:'))
|
|
808
|
+
throw new Error(`Invalid ${path}`);
|
|
809
|
+
return result;
|
|
810
|
+
}
|
|
811
|
+
function positiveSafeInteger(value, path) {
|
|
812
|
+
if (!Number.isSafeInteger(value) || Number(value) <= 0)
|
|
813
|
+
throw new Error(`${path} must be a positive safe integer`);
|
|
814
|
+
return Number(value);
|
|
815
|
+
}
|
|
816
|
+
function nonNegativeSafeInteger(value, path) {
|
|
817
|
+
if (!Number.isSafeInteger(value) || Number(value) < 0)
|
|
818
|
+
throw new Error(`${path} must be a non-negative safe integer`);
|
|
819
|
+
return Number(value);
|
|
820
|
+
}
|
|
821
|
+
function cursor(value, path) {
|
|
822
|
+
if (!Number.isSafeInteger(value) || Number(value) < -1)
|
|
823
|
+
throw new Error(`${path} must be a safe cursor`);
|
|
824
|
+
return Number(value);
|
|
825
|
+
}
|
|
826
|
+
function stableJson(value) {
|
|
827
|
+
if (Array.isArray(value))
|
|
828
|
+
return `[${value.map(stableJson).join(',')}]`;
|
|
829
|
+
if (value && typeof value === 'object') {
|
|
830
|
+
return `{${Object.entries(value)
|
|
831
|
+
.sort(([left], [right]) => compareCanonicalWorkroomText(left, right))
|
|
832
|
+
.map(([key, item]) => `${JSON.stringify(key)}:${stableJson(item)}`)
|
|
833
|
+
.join(',')}}`;
|
|
834
|
+
}
|
|
835
|
+
return JSON.stringify(value);
|
|
836
|
+
}
|
|
837
|
+
function deepFreeze(value) {
|
|
838
|
+
if (!value || typeof value !== 'object' || Object.isFrozen(value))
|
|
839
|
+
return value;
|
|
840
|
+
for (const item of Object.values(value))
|
|
841
|
+
deepFreeze(item);
|
|
842
|
+
return Object.freeze(value);
|
|
843
|
+
}
|
|
844
|
+
//# sourceMappingURL=portfolio-journal.js.map
|