@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,1253 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { classifyDataDescriptor, } from '../data-governance/data-governance.js';
|
|
3
|
+
import { materializeDisclosureManifest, } from '../data-governance/disclosure-manifest.js';
|
|
4
|
+
import { EncryptedFilePayloadVault, PayloadVaultCryptographyUnavailableError, } from '../data-governance/encrypted-file-payload-vault.js';
|
|
5
|
+
import { FileDataGovernanceAuthorityRepository, DataGovernanceAuthorityUnauthorizedError, createGovernedSourceAuthority, } from '../data-governance/governance-authority-repository.js';
|
|
6
|
+
import { FileGovernedPayloadWriteSagaRepository, GovernedPayloadPublicationReconciler, GovernedPayloadWritePurgeConsumer, createGovernedPayloadWriteIntentId, } from '../data-governance/governed-payload-write-saga.js';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { createToken } from '@zhin.js/plugin-runtime';
|
|
9
|
+
import { WorkroomPlanningClarificationError, } from '../workroom/human-ingress-orchestrator.js';
|
|
10
|
+
import { canonicalWorkroomJson, deepFreezeWorkroomValue as deepFreeze, digestCanonicalWorkroomValue as digest, } from '../workroom/canonical-value.js';
|
|
11
|
+
import { WorkroomGovernedPayloadHeaderCasLostError, WorkroomGovernedPayloadPublicationAbandonedError, } from '../workroom/workroom-task-report-store.js';
|
|
12
|
+
import { createWorkroomJournalPayloadObjectId, } from '../workroom/journal.js';
|
|
13
|
+
import { createWorkroomDynamicPlanningGenerationSnapshot, createWorkroomPlanningDisclosure, createWorkroomPlanningDisclosureSourceBinding, } from './workroom-dynamic-planning-provider.js';
|
|
14
|
+
import { createWorkroomGovernedAcceptanceProjection, } from './workroom-acceptance-provider-composition.js';
|
|
15
|
+
export const workroomDisclosureManifestAuthorityToken = createToken('zhin.agent.workroom-disclosure-manifest-authority', 'Authority-owned exact sink-rule Disclosure Manifest materializer');
|
|
16
|
+
/** Trusted Root composition helper; raw repository/Vault are intentionally not returned. */
|
|
17
|
+
export function createFileWorkroomDataGovernanceRuntime(options) {
|
|
18
|
+
const repository = new FileDataGovernanceAuthorityRepository(join(options.stateRoot, 'workroom-data-governance-authority'), options.governance);
|
|
19
|
+
const cryptography = options.cryptography ?? Object.freeze({
|
|
20
|
+
wrap: async () => null,
|
|
21
|
+
unwrap: async () => null,
|
|
22
|
+
});
|
|
23
|
+
const vault = options.vault ?? new EncryptedFilePayloadVault({
|
|
24
|
+
directory: join(options.stateRoot, 'workroom-payload-vault'),
|
|
25
|
+
generation: options.generation,
|
|
26
|
+
cryptography,
|
|
27
|
+
});
|
|
28
|
+
const payloadWrites = new FileGovernedPayloadWriteSagaRepository(join(options.stateRoot, 'workroom-payload-write-sagas'));
|
|
29
|
+
const payloadPurge = options.payloadPurge
|
|
30
|
+
? new GovernedPayloadWritePurgeConsumer({
|
|
31
|
+
generation: options.generation,
|
|
32
|
+
repository: payloadWrites,
|
|
33
|
+
provider: options.payloadPurge,
|
|
34
|
+
})
|
|
35
|
+
: undefined;
|
|
36
|
+
return new WorkroomDataGovernanceRuntime({
|
|
37
|
+
generation: options.generation,
|
|
38
|
+
repository,
|
|
39
|
+
vault,
|
|
40
|
+
payloadWrites,
|
|
41
|
+
...(payloadPurge ? { payloadPurge } : {}),
|
|
42
|
+
...(options.payloadPublicationVerifier
|
|
43
|
+
? { payloadPublicationVerifier: options.payloadPublicationVerifier }
|
|
44
|
+
: {}),
|
|
45
|
+
...(options.payloadLifecycleIndex ? { payloadLifecycleIndex: options.payloadLifecycleIndex } : {}),
|
|
46
|
+
signal: options.signal,
|
|
47
|
+
...(options.evidenceSources ? { evidenceSources: options.evidenceSources } : {}),
|
|
48
|
+
...(options.acceptanceProjectionSources
|
|
49
|
+
? { acceptanceProjectionSources: options.acceptanceProjectionSources }
|
|
50
|
+
: {}),
|
|
51
|
+
...(options.transforms ? { transforms: options.transforms } : {}),
|
|
52
|
+
...(options.now ? { now: options.now } : {}),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export const workroomAcceptanceProjectionSourceAuthorityToken = createToken('zhin.agent.workroom-acceptance-projection-source-authority', 'Trusted exact Profile-policy source resolver for governed Acceptance projection payloads');
|
|
56
|
+
/**
|
|
57
|
+
* One immutable Root-generation adapter over persistent policy/source facts.
|
|
58
|
+
* It never falls back to config or request metadata authority.
|
|
59
|
+
*/
|
|
60
|
+
export class WorkroomDataGovernanceRuntime {
|
|
61
|
+
options;
|
|
62
|
+
generation;
|
|
63
|
+
planningDisclosure;
|
|
64
|
+
disclosureManifest;
|
|
65
|
+
assignmentDisclosure;
|
|
66
|
+
evidencePayloads;
|
|
67
|
+
taskReportPayloads;
|
|
68
|
+
acceptanceProjectionPayloads;
|
|
69
|
+
journalPayloads;
|
|
70
|
+
#now;
|
|
71
|
+
constructor(options) {
|
|
72
|
+
this.options = options;
|
|
73
|
+
this.generation = positive(options.generation, 'generation');
|
|
74
|
+
this.#now = options.now ?? Date.now;
|
|
75
|
+
this.planningDisclosure = Object.freeze({
|
|
76
|
+
materialize: async (request, signal) => await this.#materializePlanning(request, signal),
|
|
77
|
+
});
|
|
78
|
+
this.disclosureManifest = Object.freeze({
|
|
79
|
+
materialize: async (request, signal) => await this.#materializeRegistered(request, signal),
|
|
80
|
+
revalidate: async (input, signal) => await this.#revalidateRegistered(input, signal),
|
|
81
|
+
prepareProjection: async (input, signal) => await this.#prepareProjection(input, signal),
|
|
82
|
+
});
|
|
83
|
+
this.assignmentDisclosure = Object.freeze({
|
|
84
|
+
materialize: async (request) => await this.#materializeAssignment(request),
|
|
85
|
+
});
|
|
86
|
+
this.evidencePayloads = Object.freeze({
|
|
87
|
+
write: async (input, signal) => await this.#writeEvidence(input, signal),
|
|
88
|
+
});
|
|
89
|
+
this.taskReportPayloads = Object.freeze({
|
|
90
|
+
write: async (input, signal) => await this.#writeTaskReport(input, signal),
|
|
91
|
+
read: async (input, signal) => await this.#readTaskReport(input, signal),
|
|
92
|
+
});
|
|
93
|
+
this.acceptanceProjectionPayloads = Object.freeze({
|
|
94
|
+
write: async (input, signal) => await this.#writeAcceptanceProjection(input, signal),
|
|
95
|
+
read: async (input, signal) => await this.#readAcceptanceProjection(input, signal),
|
|
96
|
+
});
|
|
97
|
+
this.journalPayloads = Object.freeze({
|
|
98
|
+
write: async (input) => await this.#writeJournalPayload(input),
|
|
99
|
+
read: async (input) => await this.#readJournalPayload(input),
|
|
100
|
+
publish: async (input) => await this.#publishJournalPayloads(input),
|
|
101
|
+
prepare: async (input) => await this.#prepareJournalPayloads(input),
|
|
102
|
+
abandon: async (input) => await this.#abandonJournalPayloads(input),
|
|
103
|
+
reconcile: async (input) => await this.#reconcileJournalPayloads(input),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** Trusted generation handoff hook; no raw Vault or receipt body is returned. */
|
|
107
|
+
async reconcilePayloadPurges(projectIds, signal) {
|
|
108
|
+
if (!this.options.payloadPurge || !this.options.payloadWrites)
|
|
109
|
+
return;
|
|
110
|
+
const publications = new GovernedPayloadPublicationReconciler({
|
|
111
|
+
repository: this.options.payloadWrites,
|
|
112
|
+
purge: this.options.payloadPurge,
|
|
113
|
+
...(this.options.payloadPublicationVerifier
|
|
114
|
+
? { verifier: this.options.payloadPublicationVerifier }
|
|
115
|
+
: {}),
|
|
116
|
+
});
|
|
117
|
+
for (const projectId of [...new Set(projectIds)].sort()) {
|
|
118
|
+
await publications.drainProject(projectId, signal);
|
|
119
|
+
await this.options.payloadPurge.drainProject(projectId, signal);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async #writeJournalPayload(input) {
|
|
123
|
+
const operationId = `workroom-journal-write:${input.eventId}:${digest(input.fieldPath)}`;
|
|
124
|
+
await this.#requirePayloadInfrastructure(this.options.signal, {
|
|
125
|
+
operationId,
|
|
126
|
+
projectId: input.projectId,
|
|
127
|
+
});
|
|
128
|
+
const payload = new TextEncoder().encode(canonicalWorkroomJson(input.value));
|
|
129
|
+
if (hashBytes(payload) !== input.contentHash) {
|
|
130
|
+
throw new Error('Governed Workroom Journal payload content hash drift');
|
|
131
|
+
}
|
|
132
|
+
const source = deepFreeze({
|
|
133
|
+
kind: 'command',
|
|
134
|
+
ref: input.source.ref,
|
|
135
|
+
digest: input.source.digest,
|
|
136
|
+
bindingDigest: input.source.bindingDigest,
|
|
137
|
+
verification: 'verified',
|
|
138
|
+
});
|
|
139
|
+
return await this.#writeDerivedPayload({
|
|
140
|
+
operationId,
|
|
141
|
+
projectId: input.projectId,
|
|
142
|
+
kind: 'journal',
|
|
143
|
+
objectId: createWorkroomJournalPayloadObjectId(input),
|
|
144
|
+
payload,
|
|
145
|
+
source,
|
|
146
|
+
signal: this.options.signal,
|
|
147
|
+
publicationScope: input.runId,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async #publishJournalPayloads(input) {
|
|
151
|
+
if (!this.options.payloadWrites)
|
|
152
|
+
return;
|
|
153
|
+
for (const receipt of input.receipts) {
|
|
154
|
+
await this.options.payloadWrites.publish(journalIntentId(input.projectId, input.runId, receipt), input.publicationDigest);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async #prepareJournalPayloads(input) {
|
|
158
|
+
if (!this.options.payloadWrites)
|
|
159
|
+
return;
|
|
160
|
+
const candidates = new Set(input.receipts.map(receipt => journalIntentId(input.projectId, input.runId, receipt)));
|
|
161
|
+
for (const pending of await this.options.payloadWrites.listUnpublished(input.projectId, input.runId)) {
|
|
162
|
+
if (!candidates.has(pending.intentId)) {
|
|
163
|
+
await this.options.payloadWrites.requirePurge(pending.intentId, 'restart_unpublished');
|
|
164
|
+
await this.#purgeIntent(pending.intentId);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async #abandonJournalPayloads(input) {
|
|
169
|
+
if (!this.options.payloadWrites)
|
|
170
|
+
return;
|
|
171
|
+
for (const receipt of input.receipts) {
|
|
172
|
+
await this.options.payloadWrites.requirePurge(journalIntentId(input.projectId, input.runId, receipt), input.reason);
|
|
173
|
+
await this.#purgeIntent(journalIntentId(input.projectId, input.runId, receipt));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async #reconcileJournalPayloads(input) {
|
|
177
|
+
if (!this.options.payloadWrites)
|
|
178
|
+
return;
|
|
179
|
+
const published = new Set(input.receipts.map(receipt => journalIntentId(input.projectId, input.runId, receipt)));
|
|
180
|
+
for (const pending of await this.options.payloadWrites.listUnpublished(input.projectId, input.runId)) {
|
|
181
|
+
if (published.has(pending.intentId)) {
|
|
182
|
+
await this.options.payloadWrites.publish(pending.intentId, input.publicationDigest);
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
await this.options.payloadWrites.requirePurge(pending.intentId, 'restart_unpublished');
|
|
186
|
+
await this.#purgeIntent(pending.intentId);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async #readJournalPayload(input) {
|
|
191
|
+
await this.#requirePayloadInfrastructure(this.options.signal, {
|
|
192
|
+
operationId: `workroom-journal-read:${input.eventId}:${digest(input.fieldPath)}`,
|
|
193
|
+
projectId: input.projectId,
|
|
194
|
+
});
|
|
195
|
+
const authority = await this.options.repository.readProject(input.projectId);
|
|
196
|
+
const sinkRuleId = 'workroom-journal:kernel-replay';
|
|
197
|
+
const sink = authority?.sinks[sinkRuleId];
|
|
198
|
+
if (!authority || !sink?.fixedPrincipalId) {
|
|
199
|
+
throw new Error('Workroom Journal replay disclosure authority is unavailable');
|
|
200
|
+
}
|
|
201
|
+
const manifest = await this.disclosureManifest.materialize({
|
|
202
|
+
operationId: `workroom-journal-read:${input.eventId}:${digest(input.fieldPath)}`,
|
|
203
|
+
projectId: input.projectId,
|
|
204
|
+
sourceRef: input.receipt.descriptor.objectId,
|
|
205
|
+
sourceDigest: input.receipt.descriptor.payloadHash,
|
|
206
|
+
sinkRuleId,
|
|
207
|
+
principalId: sink.fixedPrincipalId,
|
|
208
|
+
}, this.options.signal);
|
|
209
|
+
if (!manifest || manifest.output.mode !== 'full'
|
|
210
|
+
|| manifest.output.handle.vaultObjectId !== input.receipt.descriptor.vaultObjectId
|
|
211
|
+
|| manifest.output.handle.descriptorDigest !== input.receipt.descriptor.descriptorDigest
|
|
212
|
+
|| manifest.output.handle.locationManifestDigest !== input.receipt.descriptor.locationManifestDigest
|
|
213
|
+
|| manifest.output.payloadHash !== input.contentHash) {
|
|
214
|
+
throw new Error('Workroom Journal replay disclosure is not exact/full');
|
|
215
|
+
}
|
|
216
|
+
await this.#requirePayloadInfrastructure(this.options.signal);
|
|
217
|
+
const payload = await this.options.vault.readExact({
|
|
218
|
+
handle: manifest.output.handle,
|
|
219
|
+
requestDigest: manifest.requestDigest,
|
|
220
|
+
purpose: manifest.purpose,
|
|
221
|
+
principalId: manifest.principal.principalId,
|
|
222
|
+
destinationId: manifest.destination.id,
|
|
223
|
+
}, this.options.signal);
|
|
224
|
+
if (hashBytes(payload) !== input.contentHash) {
|
|
225
|
+
throw new Error('Governed Workroom Journal payload content hash mismatch');
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(payload));
|
|
229
|
+
}
|
|
230
|
+
catch (error) {
|
|
231
|
+
throw new Error('Governed Workroom Journal payload is not canonical JSON', { cause: error });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
async #writeEvidence(input, signal) {
|
|
235
|
+
const operationId = `evidence:${input.attribution.assignmentId}:${input.attribution.attempt}:${input.attribution.fence}`;
|
|
236
|
+
await this.#requirePayloadInfrastructure(signal, {
|
|
237
|
+
operationId,
|
|
238
|
+
projectId: input.attribution.projectId,
|
|
239
|
+
});
|
|
240
|
+
const payload = new TextEncoder().encode(input.content);
|
|
241
|
+
const payloadHash = hashBytes(payload);
|
|
242
|
+
const trusted = await this.options.evidenceSources?.resolve({
|
|
243
|
+
claimedSource: structuredClone(input.claimedSource),
|
|
244
|
+
attribution: structuredClone(input.attribution),
|
|
245
|
+
payloadHash,
|
|
246
|
+
}) ?? null;
|
|
247
|
+
const source = trusted
|
|
248
|
+
? validateReceiptSource(trusted)
|
|
249
|
+
: deepFreeze({
|
|
250
|
+
kind: input.claimedSource.kind,
|
|
251
|
+
ref: `quarantine:workroom-evidence:${digest({
|
|
252
|
+
attribution: input.attribution,
|
|
253
|
+
mediaType: input.mediaType,
|
|
254
|
+
payloadHash,
|
|
255
|
+
})}`,
|
|
256
|
+
digest: digest({ version: 1, disposition: 'unverified', payloadHash }),
|
|
257
|
+
bindingDigest: digest({ version: 1, attribution: input.attribution, payloadHash }),
|
|
258
|
+
verification: 'unverified',
|
|
259
|
+
});
|
|
260
|
+
return await this.#writeDerivedPayload({
|
|
261
|
+
operationId,
|
|
262
|
+
projectId: input.attribution.projectId,
|
|
263
|
+
kind: 'evidence',
|
|
264
|
+
objectId: `workroom-evidence-payload:${digest({
|
|
265
|
+
attribution: input.attribution,
|
|
266
|
+
mediaType: input.mediaType,
|
|
267
|
+
payloadHash,
|
|
268
|
+
})}`,
|
|
269
|
+
payload,
|
|
270
|
+
source,
|
|
271
|
+
signal,
|
|
272
|
+
consumer: 'evidence_header',
|
|
273
|
+
publicationScope: digest({
|
|
274
|
+
version: 1,
|
|
275
|
+
attribution: input.attribution,
|
|
276
|
+
payloadHash,
|
|
277
|
+
}),
|
|
278
|
+
publication: input.publication,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
async #writeTaskReport(input, signal) {
|
|
282
|
+
const operationId = `task-report:${input.report.candidateHash}`;
|
|
283
|
+
await this.#requirePayloadInfrastructure(signal, {
|
|
284
|
+
operationId,
|
|
285
|
+
projectId: input.attribution.projectId,
|
|
286
|
+
});
|
|
287
|
+
const payload = new TextEncoder().encode(canonicalWorkroomJson(input.report));
|
|
288
|
+
const payloadHash = hashBytes(payload);
|
|
289
|
+
const source = deepFreeze({
|
|
290
|
+
kind: 'tool',
|
|
291
|
+
ref: `workroom-task:${encodeURIComponent(input.attribution.projectId)}:`
|
|
292
|
+
+ `${encodeURIComponent(input.attribution.runId)}:${encodeURIComponent(input.attribution.taskKey)}:`
|
|
293
|
+
+ input.attribution.taskRevision,
|
|
294
|
+
digest: digest({ version: 1, reportRef: input.report.ref, candidateHash: input.report.candidateHash }),
|
|
295
|
+
bindingDigest: digest({ version: 1, attribution: input.attribution, reportDigest: input.report.digest }),
|
|
296
|
+
verification: 'verified',
|
|
297
|
+
});
|
|
298
|
+
return await this.#writeDerivedPayload({
|
|
299
|
+
operationId,
|
|
300
|
+
projectId: input.attribution.projectId,
|
|
301
|
+
kind: 'taskReport',
|
|
302
|
+
objectId: `workroom-task-report-payload:${input.report.candidateHash}`,
|
|
303
|
+
payload,
|
|
304
|
+
source,
|
|
305
|
+
signal,
|
|
306
|
+
consumer: 'task_report_header',
|
|
307
|
+
publicationScope: input.report.ref,
|
|
308
|
+
publication: input.publication,
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
async #writeAcceptanceProjection(input, signal) {
|
|
312
|
+
const linked = linkSignals(this.options.signal, signal);
|
|
313
|
+
try {
|
|
314
|
+
linked.signal.throwIfAborted();
|
|
315
|
+
const projection = createWorkroomGovernedAcceptanceProjection(input.projection);
|
|
316
|
+
if (canonicalWorkroomJson(projection) !== canonicalWorkroomJson(input.projection)
|
|
317
|
+
|| projection.projectId !== input.projectId) {
|
|
318
|
+
throw new Error('Acceptance projection governed payload candidate drift');
|
|
319
|
+
}
|
|
320
|
+
const trusted = await this.options.acceptanceProjectionSources?.resolve({
|
|
321
|
+
projectId: input.projectId,
|
|
322
|
+
projectionDigest: projection.digest,
|
|
323
|
+
source: structuredClone(input.source),
|
|
324
|
+
}, linked.signal);
|
|
325
|
+
linked.signal.throwIfAborted();
|
|
326
|
+
if (!trusted || trusted.kind !== 'profile-policy' || trusted.verification !== 'verified'
|
|
327
|
+
|| trusted.ref !== input.source.ref || trusted.digest !== input.source.digest
|
|
328
|
+
|| trusted.issuer !== input.source.issuer || trusted.issuerDigest !== input.source.issuerDigest
|
|
329
|
+
|| trusted.revision !== input.source.revision
|
|
330
|
+
|| trusted.bindingDigest !== input.source.bindingDigest) {
|
|
331
|
+
throw new Error('Trusted Acceptance projection Profile-policy source is unavailable');
|
|
332
|
+
}
|
|
333
|
+
const { digest: _projectionDigest, ...projectionInput } = projection;
|
|
334
|
+
const payload = new TextEncoder().encode(canonicalWorkroomJson(projectionInput));
|
|
335
|
+
if (hashBytes(payload) !== projection.digest) {
|
|
336
|
+
throw new Error('Acceptance projection canonical payload hash drift');
|
|
337
|
+
}
|
|
338
|
+
const receipt = await this.#writeDerivedPayload({
|
|
339
|
+
operationId: input.operationId,
|
|
340
|
+
projectId: input.projectId,
|
|
341
|
+
kind: 'acceptanceProjection',
|
|
342
|
+
objectId: `workroom-acceptance-projection:${projection.digest.slice('sha256:'.length)}`,
|
|
343
|
+
payload,
|
|
344
|
+
source: deepFreeze(structuredClone(trusted)),
|
|
345
|
+
signal: linked.signal,
|
|
346
|
+
});
|
|
347
|
+
return deepFreeze({
|
|
348
|
+
vaultObjectId: receipt.descriptor.vaultObjectId,
|
|
349
|
+
objectId: receipt.descriptor.objectId,
|
|
350
|
+
payloadHash: receipt.descriptor.payloadHash,
|
|
351
|
+
descriptorDigest: receipt.descriptor.descriptorDigest,
|
|
352
|
+
locationManifestDigest: receipt.descriptor.locationManifestDigest,
|
|
353
|
+
source: receipt.source,
|
|
354
|
+
sourceBindingDigest: receipt.source.bindingDigest,
|
|
355
|
+
bytes: receipt.descriptor.bytes,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
finally {
|
|
359
|
+
linked.dispose();
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
async #readAcceptanceProjection(input, signal) {
|
|
363
|
+
const linked = linkSignals(this.options.signal, signal);
|
|
364
|
+
try {
|
|
365
|
+
linked.signal.throwIfAborted();
|
|
366
|
+
if (input.purpose !== 'acceptance-policy') {
|
|
367
|
+
throw new Error('Acceptance projection disclosure purpose is invalid');
|
|
368
|
+
}
|
|
369
|
+
assertAcceptanceProjectionReceipt(input.receipt);
|
|
370
|
+
const trusted = await this.options.acceptanceProjectionSources?.resolve({
|
|
371
|
+
projectId: input.projectId,
|
|
372
|
+
projectionDigest: input.receipt.payloadHash,
|
|
373
|
+
source: {
|
|
374
|
+
kind: input.receipt.source.kind,
|
|
375
|
+
ref: input.receipt.source.ref,
|
|
376
|
+
digest: input.receipt.source.digest,
|
|
377
|
+
issuer: input.receipt.source.issuer,
|
|
378
|
+
issuerDigest: input.receipt.source.issuerDigest,
|
|
379
|
+
revision: input.receipt.source.revision,
|
|
380
|
+
bindingDigest: input.receipt.source.bindingDigest,
|
|
381
|
+
},
|
|
382
|
+
}, linked.signal);
|
|
383
|
+
linked.signal.throwIfAborted();
|
|
384
|
+
if (!trusted || canonicalWorkroomJson(trusted) !== canonicalWorkroomJson(input.receipt.source)) {
|
|
385
|
+
return undefined;
|
|
386
|
+
}
|
|
387
|
+
const authority = await this.options.repository.readProject(input.projectId);
|
|
388
|
+
const sinkRuleId = 'acceptance-projection:acceptance-policy';
|
|
389
|
+
const sink = authority?.sinks[sinkRuleId];
|
|
390
|
+
if (!authority || !sink?.fixedPrincipalId)
|
|
391
|
+
return undefined;
|
|
392
|
+
const manifest = await this.disclosureManifest.materialize({
|
|
393
|
+
operationId: input.operationId,
|
|
394
|
+
projectId: input.projectId,
|
|
395
|
+
sourceRef: input.receipt.objectId,
|
|
396
|
+
sourceDigest: input.receipt.payloadHash,
|
|
397
|
+
sinkRuleId,
|
|
398
|
+
principalId: sink.fixedPrincipalId,
|
|
399
|
+
}, linked.signal);
|
|
400
|
+
if (!manifest || manifest.output.mode !== 'full'
|
|
401
|
+
|| manifest.output.handle.vaultObjectId !== input.receipt.vaultObjectId
|
|
402
|
+
|| manifest.output.handle.descriptorDigest !== input.receipt.descriptorDigest
|
|
403
|
+
|| manifest.output.handle.locationManifestDigest !== input.receipt.locationManifestDigest
|
|
404
|
+
|| manifest.output.payloadHash !== input.receipt.payloadHash)
|
|
405
|
+
return undefined;
|
|
406
|
+
await this.#requirePayloadInfrastructure(linked.signal);
|
|
407
|
+
const payload = await this.options.vault.readExact({
|
|
408
|
+
handle: manifest.output.handle,
|
|
409
|
+
requestDigest: manifest.requestDigest,
|
|
410
|
+
purpose: manifest.purpose,
|
|
411
|
+
principalId: manifest.principal.principalId,
|
|
412
|
+
destinationId: manifest.destination.id,
|
|
413
|
+
}, linked.signal);
|
|
414
|
+
let candidate;
|
|
415
|
+
try {
|
|
416
|
+
candidate = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(payload));
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
throw new Error('Acceptance projection governed payload is malformed', { cause: error });
|
|
420
|
+
}
|
|
421
|
+
if (!isAcceptanceProjectionInput(candidate)) {
|
|
422
|
+
throw new Error('Acceptance projection governed payload is malformed');
|
|
423
|
+
}
|
|
424
|
+
const projection = createWorkroomGovernedAcceptanceProjection(candidate);
|
|
425
|
+
if (projection.digest !== input.receipt.payloadHash || projection.projectId !== input.projectId) {
|
|
426
|
+
throw new Error('Acceptance projection governed payload binding drift');
|
|
427
|
+
}
|
|
428
|
+
return projection;
|
|
429
|
+
}
|
|
430
|
+
finally {
|
|
431
|
+
linked.dispose();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
async #writeDerivedPayload(input) {
|
|
435
|
+
const linked = linkSignals(this.options.signal, input.signal);
|
|
436
|
+
let intentId;
|
|
437
|
+
let authorityIndexed = false;
|
|
438
|
+
let publicationStarted = false;
|
|
439
|
+
let publicationConfirmed = false;
|
|
440
|
+
try {
|
|
441
|
+
const infrastructure = await this.#requirePayloadInfrastructure(linked.signal);
|
|
442
|
+
const authority = await this.options.repository.readProject(input.projectId);
|
|
443
|
+
if (!authority)
|
|
444
|
+
throw new Error('Data Governance Project authority is unavailable');
|
|
445
|
+
const rule = authority.derivedPayloads[input.kind];
|
|
446
|
+
if (!rule)
|
|
447
|
+
throw new Error(`Governed ${input.kind} payload authority is unavailable`);
|
|
448
|
+
const createdAt = this.#now();
|
|
449
|
+
const classified = classifyDataDescriptor({
|
|
450
|
+
objectId: input.objectId,
|
|
451
|
+
payloadHash: hashBytes(input.payload),
|
|
452
|
+
tenantId: authority.tenantId,
|
|
453
|
+
projectId: authority.projectId,
|
|
454
|
+
kind: input.kind === 'evidence'
|
|
455
|
+
? 'evidence'
|
|
456
|
+
: input.kind === 'taskReport'
|
|
457
|
+
? 'task_report'
|
|
458
|
+
: input.kind === 'acceptanceProjection' || input.kind === 'journal'
|
|
459
|
+
? 'workroom_fact'
|
|
460
|
+
: 'projection_payload',
|
|
461
|
+
proposedConfidentiality: rule.proposedConfidentiality,
|
|
462
|
+
categories: rule.categories,
|
|
463
|
+
allowedPurposes: rule.allowedPurposes,
|
|
464
|
+
allowedRegions: rule.allowedRegions,
|
|
465
|
+
subjectRefs: [],
|
|
466
|
+
retention: {
|
|
467
|
+
class: rule.retentionClass,
|
|
468
|
+
minimumRetainUntil: safeAdd(createdAt, rule.minimumRetentionMs),
|
|
469
|
+
deleteAfter: safeAdd(createdAt, rule.maximumRetentionMs),
|
|
470
|
+
},
|
|
471
|
+
lineage: { sourceObjectIds: [input.source.ref] },
|
|
472
|
+
}, authority.categoryRegistry);
|
|
473
|
+
if (classified.status === 'quarantined') {
|
|
474
|
+
await this.#block(input.operationId, input.projectId, 'source_classification_quarantined');
|
|
475
|
+
throw new Error(`Governed ${input.kind} payload classification is quarantined`);
|
|
476
|
+
}
|
|
477
|
+
const descriptor = classified.descriptor;
|
|
478
|
+
const descriptorDigest = digest(descriptor);
|
|
479
|
+
let intent = await infrastructure.payloadWrites.begin({
|
|
480
|
+
operationId: input.operationId,
|
|
481
|
+
projectId: input.projectId,
|
|
482
|
+
objectId: descriptor.objectId,
|
|
483
|
+
payloadHash: descriptor.payloadHash,
|
|
484
|
+
descriptorDigest,
|
|
485
|
+
sourceBindingDigest: input.source.bindingDigest,
|
|
486
|
+
consumer: input.consumer ?? (input.kind === 'journal' ? 'journal_header' : 'authority_source'),
|
|
487
|
+
...(input.publicationScope ? { publicationScope: input.publicationScope } : {}),
|
|
488
|
+
});
|
|
489
|
+
intentId = intent.intentId;
|
|
490
|
+
if (intent.state === 'purge_required') {
|
|
491
|
+
throw new Error('Governed Payload write was abandoned and cannot be republished');
|
|
492
|
+
}
|
|
493
|
+
let handle = intent.handle;
|
|
494
|
+
if (!handle) {
|
|
495
|
+
handle = await this.options.vault.putSource({
|
|
496
|
+
descriptor,
|
|
497
|
+
descriptorDigest,
|
|
498
|
+
payload: input.payload,
|
|
499
|
+
sourceBindingDigest: input.source.bindingDigest,
|
|
500
|
+
}, linked.signal);
|
|
501
|
+
intent = await infrastructure.payloadWrites.recordVault(intentId, handle);
|
|
502
|
+
}
|
|
503
|
+
if (intent.state === 'vault_written') {
|
|
504
|
+
const lifecycleIndex = await infrastructure.payloadLifecycleIndex.register({
|
|
505
|
+
operationId: input.operationId,
|
|
506
|
+
handle,
|
|
507
|
+
}, linked.signal);
|
|
508
|
+
const sourceAuthority = createGovernedSourceAuthority({
|
|
509
|
+
version: 1,
|
|
510
|
+
projectId: authority.projectId,
|
|
511
|
+
sourceRef: descriptor.objectId,
|
|
512
|
+
sourceDigest: descriptor.payloadHash,
|
|
513
|
+
sourceBindingDigest: input.source.bindingDigest,
|
|
514
|
+
descriptor,
|
|
515
|
+
handle,
|
|
516
|
+
projectAuthorityRevision: authority.revision,
|
|
517
|
+
projectAuthorityDigest: authority.digest,
|
|
518
|
+
});
|
|
519
|
+
const persistedSource = await this.options.repository.appendSource(sourceAuthority);
|
|
520
|
+
if (canonicalWorkroomJson(persistedSource) !== canonicalWorkroomJson(sourceAuthority)) {
|
|
521
|
+
throw new Error('Governed Payload source authority CAS winner drift');
|
|
522
|
+
}
|
|
523
|
+
intent = await infrastructure.payloadWrites.recordAuthorityIndex(intentId, digest({
|
|
524
|
+
sourceAuthorityDigest: sourceAuthority.digest,
|
|
525
|
+
lifecycleIndexDigest: lifecycleIndex.digest,
|
|
526
|
+
}));
|
|
527
|
+
}
|
|
528
|
+
authorityIndexed = intent.state === 'authority_indexed' || intent.state === 'published';
|
|
529
|
+
const receipt = deepFreeze({
|
|
530
|
+
descriptor: {
|
|
531
|
+
vaultObjectId: handle.vaultObjectId,
|
|
532
|
+
objectId: handle.objectId,
|
|
533
|
+
payloadHash: handle.payloadHash,
|
|
534
|
+
descriptorDigest: handle.descriptorDigest,
|
|
535
|
+
locationManifestDigest: handle.locationManifestDigest,
|
|
536
|
+
bytes: input.payload.byteLength,
|
|
537
|
+
},
|
|
538
|
+
source: structuredClone(input.source),
|
|
539
|
+
});
|
|
540
|
+
if (input.publication && intent.state !== 'published') {
|
|
541
|
+
publicationStarted = true;
|
|
542
|
+
const publicationReceipt = deepFreeze({
|
|
543
|
+
descriptor: receipt.descriptor,
|
|
544
|
+
source: validatePublicationReceiptSource(input.source),
|
|
545
|
+
});
|
|
546
|
+
const publication = await input.publication.publish(publicationReceipt, linked.signal);
|
|
547
|
+
publicationConfirmed = true;
|
|
548
|
+
await infrastructure.payloadWrites.publish(intentId, exactDigest(publication.publicationDigest, 'payload publicationDigest'));
|
|
549
|
+
}
|
|
550
|
+
return receipt;
|
|
551
|
+
}
|
|
552
|
+
catch (error) {
|
|
553
|
+
if (intentId) {
|
|
554
|
+
const snapshot = await this.options.payloadWrites?.read(intentId);
|
|
555
|
+
const definiteAbandon = !authorityIndexed
|
|
556
|
+
|| error instanceof WorkroomGovernedPayloadHeaderCasLostError
|
|
557
|
+
|| error instanceof WorkroomGovernedPayloadPublicationAbandonedError;
|
|
558
|
+
if (snapshot && snapshot.state !== 'published' && definiteAbandon
|
|
559
|
+
&& !(publicationStarted && publicationConfirmed)) {
|
|
560
|
+
if (snapshot.state !== 'purge_required') {
|
|
561
|
+
await this.options.payloadWrites?.requirePurge(intentId, error instanceof WorkroomGovernedPayloadHeaderCasLostError
|
|
562
|
+
? 'cas_lost'
|
|
563
|
+
: 'write_failed');
|
|
564
|
+
}
|
|
565
|
+
await this.#purgeIntent(intentId);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
if (linked.signal.aborted) {
|
|
569
|
+
throw linked.signal.reason ?? new DOMException('Governed payload write cancelled', 'AbortError');
|
|
570
|
+
}
|
|
571
|
+
await this.#block(input.operationId, input.projectId, blockerKind(error));
|
|
572
|
+
throw error;
|
|
573
|
+
}
|
|
574
|
+
finally {
|
|
575
|
+
linked.dispose();
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
async #purgeIntent(intentId) {
|
|
579
|
+
if (!this.options.payloadPurge)
|
|
580
|
+
return;
|
|
581
|
+
await this.options.payloadPurge.processIntent(intentId, this.options.signal);
|
|
582
|
+
}
|
|
583
|
+
async #requirePayloadInfrastructure(signal, blocker) {
|
|
584
|
+
signal.throwIfAborted();
|
|
585
|
+
const payloadWrites = this.options.payloadWrites;
|
|
586
|
+
const payloadLifecycleIndex = this.options.payloadLifecycleIndex;
|
|
587
|
+
const payloadPurge = this.options.payloadPurge;
|
|
588
|
+
const rejectUnavailable = async (unavailable) => {
|
|
589
|
+
if (blocker) {
|
|
590
|
+
await this.#block(blocker.operationId, blocker.projectId, blockerKind(unavailable));
|
|
591
|
+
}
|
|
592
|
+
throw unavailable;
|
|
593
|
+
};
|
|
594
|
+
if (!payloadWrites) {
|
|
595
|
+
return await rejectUnavailable(new Error('Governed Payload durable write saga authority is unavailable'));
|
|
596
|
+
}
|
|
597
|
+
if (!payloadLifecycleIndex) {
|
|
598
|
+
return await rejectUnavailable(new Error('Governed Payload Lifecycle index authority is unavailable'));
|
|
599
|
+
}
|
|
600
|
+
if (!payloadPurge) {
|
|
601
|
+
return await rejectUnavailable(new Error('Governed Payload orphan purge authority is unavailable'));
|
|
602
|
+
}
|
|
603
|
+
await payloadWrites.assertReady();
|
|
604
|
+
signal.throwIfAborted();
|
|
605
|
+
return Object.freeze({
|
|
606
|
+
payloadWrites,
|
|
607
|
+
payloadLifecycleIndex,
|
|
608
|
+
payloadPurge,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
async #readTaskReport(input, signal) {
|
|
612
|
+
await this.#requirePayloadInfrastructure(signal, {
|
|
613
|
+
operationId: `accepted-source-read:${input.candidateHash}`,
|
|
614
|
+
projectId: input.projectId,
|
|
615
|
+
});
|
|
616
|
+
const authority = await this.options.repository.readProject(input.projectId);
|
|
617
|
+
const sinkRuleId = 'task-report:accepted-source-memory-projector';
|
|
618
|
+
const sink = authority?.sinks[sinkRuleId];
|
|
619
|
+
if (!authority || !sink?.fixedPrincipalId) {
|
|
620
|
+
throw new Error('Accepted-source Task Report disclosure authority is unavailable');
|
|
621
|
+
}
|
|
622
|
+
const manifest = await this.disclosureManifest.materialize({
|
|
623
|
+
operationId: `accepted-source-read:${input.candidateHash}`,
|
|
624
|
+
projectId: input.projectId,
|
|
625
|
+
sourceRef: input.receipt.descriptor.objectId,
|
|
626
|
+
sourceDigest: input.receipt.descriptor.payloadHash,
|
|
627
|
+
sinkRuleId,
|
|
628
|
+
principalId: sink.fixedPrincipalId,
|
|
629
|
+
}, signal);
|
|
630
|
+
if (!manifest || manifest.output.mode !== 'full'
|
|
631
|
+
|| manifest.output.handle.vaultObjectId !== input.receipt.descriptor.vaultObjectId
|
|
632
|
+
|| manifest.output.handle.descriptorDigest !== input.receipt.descriptor.descriptorDigest
|
|
633
|
+
|| manifest.output.payloadHash !== input.receipt.descriptor.payloadHash) {
|
|
634
|
+
throw new Error('Accepted-source Task Report disclosure is not exact/full');
|
|
635
|
+
}
|
|
636
|
+
const payload = await this.options.vault.readExact({
|
|
637
|
+
handle: manifest.output.handle,
|
|
638
|
+
requestDigest: manifest.requestDigest,
|
|
639
|
+
purpose: manifest.purpose,
|
|
640
|
+
principalId: manifest.principal.principalId,
|
|
641
|
+
destinationId: manifest.destination.id,
|
|
642
|
+
}, signal);
|
|
643
|
+
let report;
|
|
644
|
+
try {
|
|
645
|
+
report = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(payload));
|
|
646
|
+
}
|
|
647
|
+
catch (error) {
|
|
648
|
+
throw new Error('Governed Task Report payload is not canonical JSON', { cause: error });
|
|
649
|
+
}
|
|
650
|
+
if (!report || typeof report !== 'object'
|
|
651
|
+
|| report.projectId !== input.projectId
|
|
652
|
+
|| report.runId !== input.runId
|
|
653
|
+
|| report.taskKey !== input.taskKey
|
|
654
|
+
|| report.ref !== input.reportRef
|
|
655
|
+
|| report.candidateHash !== input.candidateHash) {
|
|
656
|
+
throw new Error('Governed Task Report payload escaped accepted-source scope');
|
|
657
|
+
}
|
|
658
|
+
return deepFreeze(report);
|
|
659
|
+
}
|
|
660
|
+
async #materializePlanning(request, operationSignal) {
|
|
661
|
+
const linked = linkSignals(this.options.signal, operationSignal);
|
|
662
|
+
const binding = createWorkroomPlanningDisclosureSourceBinding(request.input.source);
|
|
663
|
+
try {
|
|
664
|
+
this.#assertGeneration(request);
|
|
665
|
+
if (canonicalWorkroomJson(binding) !== canonicalWorkroomJson(request.source)) {
|
|
666
|
+
throw new Error('Planning disclosure source binding drift');
|
|
667
|
+
}
|
|
668
|
+
const authority = await this.options.repository.readProject(request.input.projectId);
|
|
669
|
+
if (!authority) {
|
|
670
|
+
await this.#block(request.input.operationId, request.input.projectId, 'project_authority_unavailable', binding.digest);
|
|
671
|
+
throw new WorkroomPlanningClarificationError('planning_disclosure_unavailable');
|
|
672
|
+
}
|
|
673
|
+
const source = await this.#resolvePlanningSource(request, authority, binding.digest, linked.signal);
|
|
674
|
+
const manifest = await this.#materialize({
|
|
675
|
+
operationId: request.input.operationId,
|
|
676
|
+
authority,
|
|
677
|
+
source,
|
|
678
|
+
context: {
|
|
679
|
+
channel: 'model_provider',
|
|
680
|
+
purpose: 'orchestration',
|
|
681
|
+
requestedMode: authority.planning.source.requestedMode,
|
|
682
|
+
policyRevision: authority.policy.revision,
|
|
683
|
+
principal: {
|
|
684
|
+
principalId: request.input.principalId,
|
|
685
|
+
tenantId: authority.tenantId,
|
|
686
|
+
projectId: authority.projectId,
|
|
687
|
+
...authority.planning.principal,
|
|
688
|
+
},
|
|
689
|
+
destination: authority.policy.destinations[authority.planning.destinationId],
|
|
690
|
+
recipients: authority.planning.recipients,
|
|
691
|
+
},
|
|
692
|
+
signal: linked.signal,
|
|
693
|
+
});
|
|
694
|
+
await this.#requirePayloadInfrastructure(linked.signal);
|
|
695
|
+
const payload = await this.options.vault.readExact(deepFreeze({
|
|
696
|
+
handle: structuredClone(manifest.output.handle),
|
|
697
|
+
requestDigest: manifest.requestDigest,
|
|
698
|
+
purpose: manifest.purpose,
|
|
699
|
+
principalId: manifest.principal.principalId,
|
|
700
|
+
destinationId: manifest.destination.id,
|
|
701
|
+
}), linked.signal);
|
|
702
|
+
if (hashBytes(payload) !== manifest.output.payloadHash) {
|
|
703
|
+
throw new Error('Planning disclosure output body hash mismatch');
|
|
704
|
+
}
|
|
705
|
+
let text;
|
|
706
|
+
try {
|
|
707
|
+
text = new TextDecoder('utf-8', { fatal: true }).decode(payload);
|
|
708
|
+
}
|
|
709
|
+
catch (error) {
|
|
710
|
+
throw new Error('Planning disclosure output is not valid UTF-8', { cause: error });
|
|
711
|
+
}
|
|
712
|
+
return createWorkroomPlanningDisclosure({ source: request.source, manifest, text });
|
|
713
|
+
}
|
|
714
|
+
catch (error) {
|
|
715
|
+
if (error instanceof WorkroomPlanningClarificationError)
|
|
716
|
+
throw error;
|
|
717
|
+
const kind = blockerKind(error);
|
|
718
|
+
await this.#block(request.input.operationId, request.input.projectId, kind, binding.digest);
|
|
719
|
+
if (linked.signal.aborted) {
|
|
720
|
+
throw linked.signal.reason ?? new DOMException('Data Governance planning cancelled', 'AbortError');
|
|
721
|
+
}
|
|
722
|
+
throw new WorkroomPlanningClarificationError('planning_disclosure_unavailable');
|
|
723
|
+
}
|
|
724
|
+
finally {
|
|
725
|
+
linked.dispose();
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
async #resolvePlanningSource(request, authority, sourceBindingDigest, signal) {
|
|
729
|
+
const existing = await this.options.repository.readSource(request.input.projectId, request.input.source.ref, request.input.source.digest);
|
|
730
|
+
if (existing) {
|
|
731
|
+
if (existing.sourceBindingDigest !== sourceBindingDigest
|
|
732
|
+
|| existing.projectAuthorityDigest !== authority.digest
|
|
733
|
+
|| existing.projectAuthorityRevision !== authority.revision) {
|
|
734
|
+
throw new Error('Governed source authority is stale for current policy');
|
|
735
|
+
}
|
|
736
|
+
return existing;
|
|
737
|
+
}
|
|
738
|
+
await this.#requirePayloadInfrastructure(signal);
|
|
739
|
+
const payload = new TextEncoder().encode(request.input.source.text);
|
|
740
|
+
const payloadHash = hashBytes(payload);
|
|
741
|
+
const timestamp = nonNegative(request.input.source.event.timestamp, 'source timestamp');
|
|
742
|
+
const rule = authority.planning.source;
|
|
743
|
+
const classified = classifyDataDescriptor({
|
|
744
|
+
objectId: `workroom-source:${request.input.source.digest}`,
|
|
745
|
+
payloadHash,
|
|
746
|
+
tenantId: authority.tenantId,
|
|
747
|
+
projectId: authority.projectId,
|
|
748
|
+
kind: 'source_message',
|
|
749
|
+
proposedConfidentiality: rule.proposedConfidentiality,
|
|
750
|
+
categories: rule.categories,
|
|
751
|
+
allowedPurposes: rule.allowedPurposes,
|
|
752
|
+
allowedRegions: rule.allowedRegions,
|
|
753
|
+
subjectRefs: rule.linkPrincipalAsSubject ? [request.input.principalId] : [],
|
|
754
|
+
retention: {
|
|
755
|
+
class: rule.retentionClass,
|
|
756
|
+
minimumRetainUntil: safeAdd(timestamp, rule.minimumRetentionMs),
|
|
757
|
+
deleteAfter: safeAdd(timestamp, rule.maximumRetentionMs),
|
|
758
|
+
},
|
|
759
|
+
lineage: { sourceObjectIds: [request.input.source.ref] },
|
|
760
|
+
}, authority.categoryRegistry);
|
|
761
|
+
if (classified.status === 'quarantined') {
|
|
762
|
+
throw new Error(`Source classification quarantined: ${classified.reasonCodes.join(',')}`);
|
|
763
|
+
}
|
|
764
|
+
const descriptor = classified.descriptor;
|
|
765
|
+
const handle = await this.options.vault.putSource({
|
|
766
|
+
descriptor,
|
|
767
|
+
descriptorDigest: digest(descriptor),
|
|
768
|
+
payload,
|
|
769
|
+
sourceBindingDigest,
|
|
770
|
+
}, signal);
|
|
771
|
+
return await this.options.repository.appendSource(createGovernedSourceAuthority({
|
|
772
|
+
version: 1,
|
|
773
|
+
projectId: authority.projectId,
|
|
774
|
+
sourceRef: request.input.source.ref,
|
|
775
|
+
sourceDigest: request.input.source.digest,
|
|
776
|
+
sourceBindingDigest,
|
|
777
|
+
descriptor,
|
|
778
|
+
handle,
|
|
779
|
+
projectAuthorityRevision: authority.revision,
|
|
780
|
+
projectAuthorityDigest: authority.digest,
|
|
781
|
+
}));
|
|
782
|
+
}
|
|
783
|
+
async #materializeRegistered(request, operationSignal) {
|
|
784
|
+
const linked = linkSignals(this.options.signal, operationSignal);
|
|
785
|
+
try {
|
|
786
|
+
const authority = await this.options.repository.readProject(request.projectId);
|
|
787
|
+
if (!authority) {
|
|
788
|
+
await this.#block(request.operationId, request.projectId, 'project_authority_unavailable');
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
const source = await this.options.repository.readSource(request.projectId, request.sourceRef, request.sourceDigest);
|
|
792
|
+
if (!source || source.projectAuthorityDigest !== authority.digest) {
|
|
793
|
+
await this.#block(request.operationId, request.projectId, 'source_authority_conflict', undefined, authority.digest);
|
|
794
|
+
return null;
|
|
795
|
+
}
|
|
796
|
+
const rule = authority.sinks[request.sinkRuleId];
|
|
797
|
+
const destination = rule && authority.policy.destinations[rule.destinationId];
|
|
798
|
+
if (!rule || !destination
|
|
799
|
+
|| (rule.fixedPrincipalId !== undefined && request.principalId !== rule.fixedPrincipalId)) {
|
|
800
|
+
await this.#block(request.operationId, request.projectId, 'disclosure_denied', source.sourceBindingDigest, authority.digest);
|
|
801
|
+
return null;
|
|
802
|
+
}
|
|
803
|
+
return await this.#materialize({
|
|
804
|
+
operationId: request.operationId,
|
|
805
|
+
authority,
|
|
806
|
+
source,
|
|
807
|
+
context: {
|
|
808
|
+
channel: rule.channel,
|
|
809
|
+
purpose: rule.purpose,
|
|
810
|
+
requestedMode: rule.requestedMode,
|
|
811
|
+
policyRevision: authority.policy.revision,
|
|
812
|
+
principal: {
|
|
813
|
+
principalId: request.principalId,
|
|
814
|
+
...(request.assignmentId === undefined ? {} : { assignmentId: request.assignmentId }),
|
|
815
|
+
tenantId: authority.tenantId,
|
|
816
|
+
projectId: authority.projectId,
|
|
817
|
+
...rule.principal,
|
|
818
|
+
},
|
|
819
|
+
destination,
|
|
820
|
+
recipients: structuredClone(rule.recipients),
|
|
821
|
+
},
|
|
822
|
+
signal: linked.signal,
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
catch (error) {
|
|
826
|
+
await this.#block(request.operationId, request.projectId, blockerKind(error));
|
|
827
|
+
if (linked.signal.aborted) {
|
|
828
|
+
throw linked.signal.reason ?? new DOMException('Data Governance operation cancelled', 'AbortError');
|
|
829
|
+
}
|
|
830
|
+
return null;
|
|
831
|
+
}
|
|
832
|
+
finally {
|
|
833
|
+
linked.dispose();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
async #prepareProjection(input, operationSignal) {
|
|
837
|
+
const linked = linkSignals(this.options.signal, operationSignal);
|
|
838
|
+
try {
|
|
839
|
+
const authority = await this.options.repository.readProject(input.projectId);
|
|
840
|
+
const sink = authority?.sinks[input.sinkRuleId];
|
|
841
|
+
const expectedChannel = input.sinkRuleId === 'projection:sponsor-room'
|
|
842
|
+
? 'sponsor_projection'
|
|
843
|
+
: 'workroom_projection';
|
|
844
|
+
if (!authority || !sink || sink.channel !== expectedChannel || !sink.fixedPrincipalId
|
|
845
|
+
|| !authority.derivedPayloads.projection) {
|
|
846
|
+
const reason = authority ? 'disclosure_denied' : 'project_authority_unavailable';
|
|
847
|
+
await this.#block(input.operationId, input.projectId, reason, undefined, authority?.digest);
|
|
848
|
+
return deepFreeze({ status: 'blocked', reason });
|
|
849
|
+
}
|
|
850
|
+
if (input.sourceEventIds.length === 0 || input.sourceEventIds.some(value => !value.trim())) {
|
|
851
|
+
await this.#block(input.operationId, input.projectId, 'source_authority_conflict', undefined, authority.digest);
|
|
852
|
+
return deepFreeze({ status: 'blocked', reason: 'source_authority_conflict' });
|
|
853
|
+
}
|
|
854
|
+
const payload = new TextEncoder().encode(input.body);
|
|
855
|
+
const payloadHash = hashBytes(payload);
|
|
856
|
+
const source = deepFreeze({
|
|
857
|
+
kind: 'tool',
|
|
858
|
+
ref: `workroom-projection-events:${digest({
|
|
859
|
+
projectId: input.projectId,
|
|
860
|
+
sourceEventIds: input.sourceEventIds,
|
|
861
|
+
})}`,
|
|
862
|
+
digest: digest({ version: 1, sourceEventIds: input.sourceEventIds }),
|
|
863
|
+
bindingDigest: digest({
|
|
864
|
+
version: 1, projectId: input.projectId, sourceEventIds: input.sourceEventIds, payloadHash,
|
|
865
|
+
}),
|
|
866
|
+
verification: 'verified',
|
|
867
|
+
});
|
|
868
|
+
const receipt = await this.#writeDerivedPayload({
|
|
869
|
+
operationId: input.operationId,
|
|
870
|
+
projectId: input.projectId,
|
|
871
|
+
kind: 'projection',
|
|
872
|
+
objectId: `workroom-projection-payload:${digest({
|
|
873
|
+
projectId: input.projectId, sourceEventIds: input.sourceEventIds, payloadHash,
|
|
874
|
+
})}`,
|
|
875
|
+
payload,
|
|
876
|
+
source,
|
|
877
|
+
signal: linked.signal,
|
|
878
|
+
});
|
|
879
|
+
const request = deepFreeze({
|
|
880
|
+
operationId: input.operationId,
|
|
881
|
+
projectId: input.projectId,
|
|
882
|
+
sourceRef: receipt.descriptor.objectId,
|
|
883
|
+
sourceDigest: receipt.descriptor.payloadHash,
|
|
884
|
+
sinkRuleId: input.sinkRuleId,
|
|
885
|
+
principalId: sink.fixedPrincipalId,
|
|
886
|
+
});
|
|
887
|
+
const manifest = await this.#materializeRegistered(request, linked.signal);
|
|
888
|
+
if (!manifest)
|
|
889
|
+
return deepFreeze({ status: 'blocked', reason: 'disclosure_denied' });
|
|
890
|
+
return deepFreeze({ status: 'ready', request, manifest });
|
|
891
|
+
}
|
|
892
|
+
catch (error) {
|
|
893
|
+
if (linked.signal.aborted) {
|
|
894
|
+
throw linked.signal.reason ?? new DOMException('Projection disclosure cancelled', 'AbortError');
|
|
895
|
+
}
|
|
896
|
+
const reason = blockerKind(error);
|
|
897
|
+
await this.#block(input.operationId, input.projectId, reason);
|
|
898
|
+
return deepFreeze({ status: 'blocked', reason });
|
|
899
|
+
}
|
|
900
|
+
finally {
|
|
901
|
+
linked.dispose();
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
async #revalidateRegistered(input, operationSignal) {
|
|
905
|
+
const linked = linkSignals(this.options.signal, operationSignal);
|
|
906
|
+
let reason;
|
|
907
|
+
try {
|
|
908
|
+
const { request, manifest } = input;
|
|
909
|
+
const authority = await this.options.repository.readProject(request.projectId);
|
|
910
|
+
if (!authority)
|
|
911
|
+
reason = 'project_authority_unavailable';
|
|
912
|
+
const source = authority
|
|
913
|
+
? await this.options.repository.readSource(request.projectId, request.sourceRef, request.sourceDigest)
|
|
914
|
+
: undefined;
|
|
915
|
+
const sourceInvalid = !source
|
|
916
|
+
|| source.sourceRef !== request.sourceRef
|
|
917
|
+
|| source.sourceDigest !== request.sourceDigest
|
|
918
|
+
|| source.projectAuthorityDigest !== authority.digest
|
|
919
|
+
|| source.projectAuthorityRevision !== authority.revision
|
|
920
|
+
|| source.descriptor.objectId !== manifest.source.objectId
|
|
921
|
+
|| source.descriptor.payloadHash !== manifest.source.payloadHash
|
|
922
|
+
|| digest(source.descriptor) !== manifest.source.descriptorDigest
|
|
923
|
+
|| digest(source.descriptor.lineage) !== manifest.source.lineageDigest
|
|
924
|
+
|| canonicalWorkroomJson(source.handle) !== canonicalWorkroomJson(manifest.source.handle);
|
|
925
|
+
const rule = authority?.sinks[request.sinkRuleId];
|
|
926
|
+
const destination = rule && authority?.policy.destinations[rule.destinationId];
|
|
927
|
+
if (!reason && (!rule || !destination
|
|
928
|
+
|| (rule.fixedPrincipalId !== undefined && request.principalId !== rule.fixedPrincipalId)
|
|
929
|
+
|| manifest.channel !== rule.channel
|
|
930
|
+
|| manifest.purpose !== rule.purpose
|
|
931
|
+
|| manifest.principal.principalId !== request.principalId
|
|
932
|
+
|| manifest.principal.assignmentId !== request.assignmentId
|
|
933
|
+
|| manifest.destination.id !== rule.destinationId)) {
|
|
934
|
+
reason = 'disclosure_manifest_stale';
|
|
935
|
+
}
|
|
936
|
+
if (!reason && (manifest.destination.recipientRevision !== rule.recipients.revision
|
|
937
|
+
|| manifest.destination.recipientDigest !== rule.recipients.digest
|
|
938
|
+
|| destination.recipientSnapshotRevision !== rule.recipients.revision
|
|
939
|
+
|| destination.recipientSnapshotDigest !== rule.recipients.digest)) {
|
|
940
|
+
reason = 'disclosure_recipient_revoked';
|
|
941
|
+
}
|
|
942
|
+
if (!reason && manifest.destination.contractDigest !== destination.contractDigest) {
|
|
943
|
+
reason = 'disclosure_manifest_stale';
|
|
944
|
+
}
|
|
945
|
+
// Any policy replacement invalidates the persisted decision. A wider
|
|
946
|
+
// current policy must never silently extend an older Manifest.
|
|
947
|
+
if (!reason && (manifest.policy.revision !== authority.policy.revision
|
|
948
|
+
|| manifest.policy.digest !== authority.policy.digest)) {
|
|
949
|
+
reason = 'disclosure_manifest_stale';
|
|
950
|
+
}
|
|
951
|
+
if (!reason && sourceInvalid)
|
|
952
|
+
reason = 'source_authority_conflict';
|
|
953
|
+
const now = this.#now();
|
|
954
|
+
if (!reason && now >= manifest.expiresAt)
|
|
955
|
+
reason = 'disclosure_manifest_expired';
|
|
956
|
+
if (!reason && !exactCurrentApprovals(manifest, authority.approvals, now)) {
|
|
957
|
+
reason = 'disclosure_approval_required';
|
|
958
|
+
}
|
|
959
|
+
if (reason) {
|
|
960
|
+
await this.#block(request.operationId, request.projectId, reason, source?.sourceBindingDigest, authority?.digest);
|
|
961
|
+
return deepFreeze({ status: 'blocked', reason });
|
|
962
|
+
}
|
|
963
|
+
linked.signal.throwIfAborted();
|
|
964
|
+
await this.#requirePayloadInfrastructure(linked.signal);
|
|
965
|
+
const body = await this.options.vault.readExact({
|
|
966
|
+
handle: structuredClone(manifest.output.handle),
|
|
967
|
+
requestDigest: manifest.requestDigest,
|
|
968
|
+
purpose: manifest.purpose,
|
|
969
|
+
principalId: manifest.principal.principalId,
|
|
970
|
+
destinationId: manifest.destination.id,
|
|
971
|
+
}, linked.signal);
|
|
972
|
+
if (hashBytes(body) !== manifest.output.payloadHash) {
|
|
973
|
+
await this.#block(request.operationId, request.projectId, 'source_authority_conflict', source?.sourceBindingDigest, authority?.digest);
|
|
974
|
+
return deepFreeze({ status: 'blocked', reason: 'source_authority_conflict' });
|
|
975
|
+
}
|
|
976
|
+
return Object.freeze({ status: 'ready', manifest: deepFreeze(structuredClone(manifest)), body });
|
|
977
|
+
}
|
|
978
|
+
catch (error) {
|
|
979
|
+
if (linked.signal.aborted) {
|
|
980
|
+
throw linked.signal.reason ?? new DOMException('Data Governance dispatch cancelled', 'AbortError');
|
|
981
|
+
}
|
|
982
|
+
const blocked = blockerKind(error);
|
|
983
|
+
await this.#block(input.request.operationId, input.request.projectId, blocked);
|
|
984
|
+
return deepFreeze({ status: 'blocked', reason: blocked });
|
|
985
|
+
}
|
|
986
|
+
finally {
|
|
987
|
+
linked.dispose();
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
async #materializeAssignment(request) {
|
|
991
|
+
let authority;
|
|
992
|
+
try {
|
|
993
|
+
authority = await this.options.repository.readProject(request.preview.projectId);
|
|
994
|
+
}
|
|
995
|
+
catch (error) {
|
|
996
|
+
if (this.options.signal.aborted)
|
|
997
|
+
throw this.options.signal.reason;
|
|
998
|
+
await this.#block(request.preview.operationId, request.preview.projectId, blockerKind(error));
|
|
999
|
+
return null;
|
|
1000
|
+
}
|
|
1001
|
+
const rule = authority?.remote[request.endpointId];
|
|
1002
|
+
if (!authority || !rule || request.preview.generation !== this.generation
|
|
1003
|
+
|| rule.principal.role !== request.preview.role) {
|
|
1004
|
+
await this.#block(request.preview.operationId, request.preview.projectId, authority ? 'disclosure_denied' : 'project_authority_unavailable', undefined, authority?.digest);
|
|
1005
|
+
return null;
|
|
1006
|
+
}
|
|
1007
|
+
return await this.disclosureManifest.materialize({
|
|
1008
|
+
operationId: request.preview.operationId,
|
|
1009
|
+
projectId: request.preview.projectId,
|
|
1010
|
+
sourceRef: request.contextView.ref,
|
|
1011
|
+
sourceDigest: request.contextView.hash,
|
|
1012
|
+
sinkRuleId: `remote:${request.endpointId}`,
|
|
1013
|
+
principalId: request.principalId,
|
|
1014
|
+
assignmentId: request.assignmentId,
|
|
1015
|
+
}, this.options.signal);
|
|
1016
|
+
}
|
|
1017
|
+
async #materialize(input) {
|
|
1018
|
+
const decisionInput = deepFreeze({
|
|
1019
|
+
descriptor: structuredClone(input.source.descriptor),
|
|
1020
|
+
policy: structuredClone(input.authority.policy),
|
|
1021
|
+
context: structuredClone(input.context),
|
|
1022
|
+
approvals: structuredClone(input.authority.approvals),
|
|
1023
|
+
evaluatedAt: this.#now(),
|
|
1024
|
+
});
|
|
1025
|
+
return await materializeDisclosureManifest({
|
|
1026
|
+
decisionInput,
|
|
1027
|
+
categoryRegistry: input.authority.categoryRegistry,
|
|
1028
|
+
source: input.source.handle,
|
|
1029
|
+
vault: this.options.vault,
|
|
1030
|
+
...(this.options.transforms ? { transforms: this.options.transforms } : {}),
|
|
1031
|
+
signal: input.signal,
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
#assertGeneration(request) {
|
|
1035
|
+
const expected = createWorkroomDynamicPlanningGenerationSnapshot(this.generation);
|
|
1036
|
+
if (canonicalWorkroomJson(request.generation) !== canonicalWorkroomJson(expected)) {
|
|
1037
|
+
throw new Error('Data Governance request escaped its Root generation');
|
|
1038
|
+
}
|
|
1039
|
+
this.options.signal.throwIfAborted();
|
|
1040
|
+
}
|
|
1041
|
+
async #block(operationId, projectId, kind, sourceBindingDigest, authorityDigest) {
|
|
1042
|
+
await this.options.repository.recordBlocker({
|
|
1043
|
+
version: 1,
|
|
1044
|
+
generation: this.generation,
|
|
1045
|
+
operationId,
|
|
1046
|
+
projectId,
|
|
1047
|
+
kind,
|
|
1048
|
+
...(authorityDigest ? { authorityDigest } : {}),
|
|
1049
|
+
...(sourceBindingDigest && /^sha256:[a-f\d]{64}$/u.test(sourceBindingDigest)
|
|
1050
|
+
? { sourceBindingDigest }
|
|
1051
|
+
: {}),
|
|
1052
|
+
createdAt: this.#now(),
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
function blockerKind(error) {
|
|
1057
|
+
if (error instanceof DOMException && error.name === 'AbortError')
|
|
1058
|
+
return 'generation_retired';
|
|
1059
|
+
if (error instanceof DataGovernanceAuthorityUnauthorizedError)
|
|
1060
|
+
return 'project_authority_unavailable';
|
|
1061
|
+
if (error instanceof PayloadVaultCryptographyUnavailableError)
|
|
1062
|
+
return 'payload_vault_key_unavailable';
|
|
1063
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1064
|
+
if (message.includes('Project authority is unavailable'))
|
|
1065
|
+
return 'project_authority_unavailable';
|
|
1066
|
+
if (message.includes('quarantined'))
|
|
1067
|
+
return 'source_classification_quarantined';
|
|
1068
|
+
if (message.includes('approval'))
|
|
1069
|
+
return 'disclosure_approval_required';
|
|
1070
|
+
if (message.includes('stale') || message.includes('conflict'))
|
|
1071
|
+
return 'source_authority_conflict';
|
|
1072
|
+
if (message.includes('Abort') || message.includes('retired'))
|
|
1073
|
+
return 'generation_retired';
|
|
1074
|
+
return 'disclosure_denied';
|
|
1075
|
+
}
|
|
1076
|
+
function exactCurrentApprovals(manifest, approvals, now) {
|
|
1077
|
+
if (manifest.approvalIds.length === 0)
|
|
1078
|
+
return true;
|
|
1079
|
+
const byId = new Map(approvals.map(approval => [approval.id, approval]));
|
|
1080
|
+
return manifest.approvalIds.every((id) => {
|
|
1081
|
+
const approval = byId.get(id);
|
|
1082
|
+
return approval?.decision === 'approved'
|
|
1083
|
+
&& approval.requestDigest === manifest.requestDigest
|
|
1084
|
+
&& approval.policyRevision === manifest.policy.revision
|
|
1085
|
+
&& now < approval.expiresAt;
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
function validateReceiptSource(value) {
|
|
1089
|
+
if (!value || !['command', 'file', 'url', 'tool', 'human'].includes(value.kind)
|
|
1090
|
+
|| typeof value.ref !== 'string' || !value.ref.trim()
|
|
1091
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(value.digest)
|
|
1092
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(value.bindingDigest)
|
|
1093
|
+
|| (value.verification !== 'verified' && value.verification !== 'unverified')) {
|
|
1094
|
+
throw new Error('Trusted Evidence source resolver returned invalid canonical authority');
|
|
1095
|
+
}
|
|
1096
|
+
return deepFreeze(structuredClone(value));
|
|
1097
|
+
}
|
|
1098
|
+
function validatePublicationReceiptSource(value) {
|
|
1099
|
+
const kind = (() => {
|
|
1100
|
+
switch (value.kind) {
|
|
1101
|
+
case 'command': return 'command';
|
|
1102
|
+
case 'file': return 'file';
|
|
1103
|
+
case 'url': return 'url';
|
|
1104
|
+
case 'tool': return 'tool';
|
|
1105
|
+
case 'human': return 'human';
|
|
1106
|
+
default: throw new Error('Governed Payload header publication source kind is invalid');
|
|
1107
|
+
}
|
|
1108
|
+
})();
|
|
1109
|
+
return validateReceiptSource(deepFreeze({
|
|
1110
|
+
kind,
|
|
1111
|
+
ref: value.ref,
|
|
1112
|
+
digest: value.digest,
|
|
1113
|
+
bindingDigest: value.bindingDigest,
|
|
1114
|
+
verification: value.verification,
|
|
1115
|
+
}));
|
|
1116
|
+
}
|
|
1117
|
+
function exactDigest(value, label) {
|
|
1118
|
+
if (!/^sha256:[a-f\d]{64}$/u.test(value)) {
|
|
1119
|
+
throw new Error(`${label} is invalid`);
|
|
1120
|
+
}
|
|
1121
|
+
return value;
|
|
1122
|
+
}
|
|
1123
|
+
function assertAcceptanceProjectionReceipt(receipt) {
|
|
1124
|
+
if (!receipt.vaultObjectId.trim() || !receipt.objectId.trim()
|
|
1125
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.payloadHash)
|
|
1126
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.descriptorDigest)
|
|
1127
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.locationManifestDigest)
|
|
1128
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.sourceBindingDigest)
|
|
1129
|
+
|| receipt.source.kind !== 'profile-policy'
|
|
1130
|
+
|| !receipt.source.ref.trim()
|
|
1131
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.source.digest)
|
|
1132
|
+
|| !receipt.source.issuer.trim()
|
|
1133
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.source.issuerDigest)
|
|
1134
|
+
|| !Number.isSafeInteger(receipt.source.revision) || receipt.source.revision < 1
|
|
1135
|
+
|| !/^sha256:[a-f\d]{64}$/u.test(receipt.source.bindingDigest)
|
|
1136
|
+
|| receipt.source.bindingDigest !== receipt.sourceBindingDigest
|
|
1137
|
+
|| receipt.source.verification !== 'verified'
|
|
1138
|
+
|| !Number.isSafeInteger(receipt.bytes) || receipt.bytes < 1) {
|
|
1139
|
+
throw new Error('Acceptance projection governed payload receipt is malformed');
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
function isAcceptanceProjectionInput(value) {
|
|
1143
|
+
if (!isRecord(value)
|
|
1144
|
+
|| value.version !== 1
|
|
1145
|
+
|| typeof value.projectId !== 'string'
|
|
1146
|
+
|| typeof value.profileRevisionId !== 'string'
|
|
1147
|
+
|| typeof value.profileDigest !== 'string'
|
|
1148
|
+
|| typeof value.revision !== 'number'
|
|
1149
|
+
|| typeof value.issuer !== 'string'
|
|
1150
|
+
|| !Array.isArray(value.tasks)
|
|
1151
|
+
|| !value.tasks.every(isAcceptanceTaskPolicy)
|
|
1152
|
+
|| !isRecord(value.memorySchema)
|
|
1153
|
+
|| typeof value.memorySchema.revision !== 'number'
|
|
1154
|
+
|| !Array.isArray(value.memorySchema.claimRules)
|
|
1155
|
+
|| !value.memorySchema.claimRules.every(isMemoryClaimRule)) {
|
|
1156
|
+
return false;
|
|
1157
|
+
}
|
|
1158
|
+
return Object.keys(value).every(key => [
|
|
1159
|
+
'version', 'projectId', 'profileRevisionId', 'profileDigest', 'revision', 'issuer', 'tasks', 'memorySchema',
|
|
1160
|
+
].includes(key));
|
|
1161
|
+
}
|
|
1162
|
+
function isAcceptanceTaskPolicy(value) {
|
|
1163
|
+
if (!isRecord(value)
|
|
1164
|
+
|| typeof value.taskKey !== 'string'
|
|
1165
|
+
|| !['task_result', 'integration_candidate', 'effect_intent'].includes(String(value.kind))
|
|
1166
|
+
|| !Array.isArray(value.criteria)
|
|
1167
|
+
|| !value.criteria.every(isAcceptanceCriterion)
|
|
1168
|
+
|| !Array.isArray(value.requiredEvidence)
|
|
1169
|
+
|| !value.requiredEvidence.every(item => typeof item === 'string')
|
|
1170
|
+
|| !['baseline', 'reviewer_required', 'sponsor_required', 'reviewer_then_sponsor']
|
|
1171
|
+
.includes(String(value.minimumRoute))
|
|
1172
|
+
|| typeof value.reviewerPrincipalId !== 'string'
|
|
1173
|
+
|| typeof value.sponsorPrincipalId !== 'string'
|
|
1174
|
+
|| typeof value.reviewerTimeoutMs !== 'number'
|
|
1175
|
+
|| typeof value.sponsorTimeoutMs !== 'number') {
|
|
1176
|
+
return false;
|
|
1177
|
+
}
|
|
1178
|
+
return Object.keys(value).every(key => [
|
|
1179
|
+
'taskKey', 'kind', 'criteria', 'requiredEvidence', 'minimumRoute', 'reviewerPrincipalId',
|
|
1180
|
+
'sponsorPrincipalId', 'reviewerTimeoutMs', 'sponsorTimeoutMs',
|
|
1181
|
+
].includes(key));
|
|
1182
|
+
}
|
|
1183
|
+
function isAcceptanceCriterion(value) {
|
|
1184
|
+
return isRecord(value)
|
|
1185
|
+
&& typeof value.id === 'string'
|
|
1186
|
+
&& ['deterministic', 'judgment'].includes(String(value.kind))
|
|
1187
|
+
&& typeof value.description === 'string'
|
|
1188
|
+
&& Object.keys(value).every(key => ['id', 'kind', 'description'].includes(key));
|
|
1189
|
+
}
|
|
1190
|
+
function isMemoryClaimRule(value) {
|
|
1191
|
+
return isRecord(value)
|
|
1192
|
+
&& typeof value.key === 'string'
|
|
1193
|
+
&& value.valueType === 'string'
|
|
1194
|
+
&& Array.isArray(value.allowedStatuses)
|
|
1195
|
+
&& value.allowedStatuses.every(status => status === 'verified' || status === 'assumed')
|
|
1196
|
+
&& typeof value.allowSupersedes === 'boolean'
|
|
1197
|
+
&& Object.keys(value).every(key => [
|
|
1198
|
+
'key', 'valueType', 'allowedStatuses', 'allowSupersedes',
|
|
1199
|
+
].includes(key));
|
|
1200
|
+
}
|
|
1201
|
+
function isRecord(value) {
|
|
1202
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1203
|
+
}
|
|
1204
|
+
function linkSignals(generation, operation) {
|
|
1205
|
+
const controller = new AbortController();
|
|
1206
|
+
const abortGeneration = () => controller.abort(generation.reason);
|
|
1207
|
+
const abortOperation = () => controller.abort(operation.reason);
|
|
1208
|
+
generation.addEventListener('abort', abortGeneration, { once: true });
|
|
1209
|
+
operation.addEventListener('abort', abortOperation, { once: true });
|
|
1210
|
+
if (generation.aborted)
|
|
1211
|
+
abortGeneration();
|
|
1212
|
+
else if (operation.aborted)
|
|
1213
|
+
abortOperation();
|
|
1214
|
+
return {
|
|
1215
|
+
signal: controller.signal,
|
|
1216
|
+
dispose: () => {
|
|
1217
|
+
generation.removeEventListener('abort', abortGeneration);
|
|
1218
|
+
operation.removeEventListener('abort', abortOperation);
|
|
1219
|
+
},
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
function journalIntentId(projectId, runId, receipt) {
|
|
1223
|
+
return createGovernedPayloadWriteIntentId({
|
|
1224
|
+
operationId: `journal-publication:${runId}`,
|
|
1225
|
+
projectId,
|
|
1226
|
+
objectId: receipt.descriptor.objectId,
|
|
1227
|
+
payloadHash: receipt.descriptor.payloadHash,
|
|
1228
|
+
descriptorDigest: receipt.descriptor.descriptorDigest,
|
|
1229
|
+
sourceBindingDigest: receipt.source.bindingDigest,
|
|
1230
|
+
consumer: 'journal_header',
|
|
1231
|
+
publicationScope: runId,
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
function hashBytes(value) {
|
|
1235
|
+
return `sha256:${createHash('sha256').update(value).digest('hex')}`;
|
|
1236
|
+
}
|
|
1237
|
+
function positive(value, label) {
|
|
1238
|
+
if (!Number.isSafeInteger(value) || Number(value) < 1)
|
|
1239
|
+
throw new Error(`Data Governance ${label} is invalid`);
|
|
1240
|
+
return Number(value);
|
|
1241
|
+
}
|
|
1242
|
+
function nonNegative(value, label) {
|
|
1243
|
+
if (!Number.isSafeInteger(value) || Number(value) < 0)
|
|
1244
|
+
throw new Error(`Data Governance ${label} is invalid`);
|
|
1245
|
+
return Number(value);
|
|
1246
|
+
}
|
|
1247
|
+
function safeAdd(left, right) {
|
|
1248
|
+
const value = left + right;
|
|
1249
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
1250
|
+
throw new Error('Data Governance retention overflow');
|
|
1251
|
+
return value;
|
|
1252
|
+
}
|
|
1253
|
+
//# sourceMappingURL=workroom-data-governance-runtime.js.map
|