@zhin.js/agent 1.1.13 → 1.1.15
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 +100 -33
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +95 -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 +74 -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 +67 -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 +217 -0
- package/lib/workroom/journal.d.ts.map +1 -0
- package/lib/workroom/journal.js +2022 -0
- package/lib/workroom/journal.js.map +1 -0
- package/lib/workroom/kernel-contracts.d.ts +168 -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 +853 -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 +142 -0
- package/lib/workroom/runtime.d.ts.map +1 -0
- package/lib/workroom/runtime.js +542 -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 +147 -0
- package/lib/workroom/workroom-kernel.d.ts.map +1 -0
- package/lib/workroom/workroom-kernel.js +1454 -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-run-control.d.ts +69 -0
- package/lib/workroom/workroom-run-control.d.ts.map +1 -0
- package/lib/workroom/workroom-run-control.js +144 -0
- package/lib/workroom/workroom-run-control.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 +657 -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,930 @@
|
|
|
1
|
+
import { canonicalWorkroomJson, compareCanonicalWorkroomText, deepFreezeWorkroomValue as deepFreeze, digestCanonicalWorkroomValue as digest, } from '../workroom/canonical-value.js';
|
|
2
|
+
export function digestPayloadSubjectRef(tenantId, subjectRef) {
|
|
3
|
+
text(tenantId, 'Payload subject tenantId');
|
|
4
|
+
text(subjectRef, 'Payload subject ref');
|
|
5
|
+
return digest({ version: 1, tenantId, subjectRef });
|
|
6
|
+
}
|
|
7
|
+
export function createPayloadLocationManifest(input) {
|
|
8
|
+
if (input.version !== 1)
|
|
9
|
+
throw new Error('Payload Location Manifest version is invalid');
|
|
10
|
+
text(input.tenantId, 'Location Manifest tenantId');
|
|
11
|
+
text(input.projectId, 'Location Manifest projectId');
|
|
12
|
+
text(input.objectId, 'Location Manifest objectId');
|
|
13
|
+
text(input.vaultObjectId, 'Location Manifest vaultObjectId');
|
|
14
|
+
requiredDigest(input.descriptorDigest, 'Location Manifest Descriptor digest');
|
|
15
|
+
positive(input.revision, 'Location Manifest revision');
|
|
16
|
+
if (!Array.isArray(input.locations) || input.locations.length === 0) {
|
|
17
|
+
throw new Error('Payload Location Manifest must contain at least one location');
|
|
18
|
+
}
|
|
19
|
+
const locations = input.locations.map(location => {
|
|
20
|
+
text(location.id, 'Payload location id');
|
|
21
|
+
if (!['vault_primary', 'index', 'cache', 'replica', 'backup', 'processor'].includes(location.kind)) {
|
|
22
|
+
throw new Error('Payload location kind is invalid');
|
|
23
|
+
}
|
|
24
|
+
if (!['crypto_erase', 'delete', 'processor_recall'].includes(location.deletionMode)) {
|
|
25
|
+
throw new Error('Payload location deletion mode is invalid');
|
|
26
|
+
}
|
|
27
|
+
requiredDigest(location.authorityDigest, 'Payload location authority digest');
|
|
28
|
+
return deepFreeze(structuredClone(location));
|
|
29
|
+
}).sort((left, right) => compareCanonicalWorkroomText(left.id, right.id));
|
|
30
|
+
if (new Set(locations.map(location => location.id)).size !== locations.length) {
|
|
31
|
+
throw new Error('Payload Location Manifest contains duplicate locations');
|
|
32
|
+
}
|
|
33
|
+
if (locations.filter(location => location.deletionMode === 'crypto_erase').length > 1) {
|
|
34
|
+
throw new Error('Payload Location Manifest has multiple object-key authorities');
|
|
35
|
+
}
|
|
36
|
+
const body = deepFreeze({
|
|
37
|
+
version: 1,
|
|
38
|
+
tenantId: input.tenantId,
|
|
39
|
+
projectId: input.projectId,
|
|
40
|
+
objectId: input.objectId,
|
|
41
|
+
vaultObjectId: input.vaultObjectId,
|
|
42
|
+
descriptorDigest: input.descriptorDigest,
|
|
43
|
+
revision: input.revision,
|
|
44
|
+
locations,
|
|
45
|
+
});
|
|
46
|
+
return deepFreeze({ ...body, digest: digest(body) });
|
|
47
|
+
}
|
|
48
|
+
export function createPayloadLifecycleObjectAuthority(input) {
|
|
49
|
+
if (input.version !== 1)
|
|
50
|
+
throw new Error('Payload Lifecycle object authority version is invalid');
|
|
51
|
+
assertHandle(input.handle);
|
|
52
|
+
const manifest = createPayloadLocationManifest(input.locations);
|
|
53
|
+
if (canonicalWorkroomJson(manifest) !== canonicalWorkroomJson(input.locations)
|
|
54
|
+
|| manifest.tenantId !== input.handle.tenantId
|
|
55
|
+
|| manifest.projectId !== input.handle.projectId
|
|
56
|
+
|| manifest.objectId !== input.handle.objectId
|
|
57
|
+
|| manifest.vaultObjectId !== input.handle.vaultObjectId
|
|
58
|
+
|| manifest.descriptorDigest !== input.handle.descriptorDigest
|
|
59
|
+
|| manifest.digest !== input.handle.locationManifestDigest) {
|
|
60
|
+
throw new Error('Payload Lifecycle object/Location Manifest binding is invalid');
|
|
61
|
+
}
|
|
62
|
+
if (!input.retention || !['transient', 'operational', 'project_record', 'regulated_record']
|
|
63
|
+
.includes(input.retention.class)
|
|
64
|
+
|| !Number.isSafeInteger(input.retention.minimumRetainUntil)
|
|
65
|
+
|| !Number.isSafeInteger(input.retention.deleteAfter)
|
|
66
|
+
|| input.retention.minimumRetainUntil < 0
|
|
67
|
+
|| input.retention.deleteAfter < input.retention.minimumRetainUntil) {
|
|
68
|
+
throw new Error('Payload Lifecycle retention authority is invalid');
|
|
69
|
+
}
|
|
70
|
+
const subjectDigests = uniqueDigests(input.subjectDigests, 'Payload Lifecycle subject digest');
|
|
71
|
+
const body = deepFreeze({
|
|
72
|
+
version: 1,
|
|
73
|
+
handle: structuredClone(input.handle),
|
|
74
|
+
retention: structuredClone(input.retention),
|
|
75
|
+
subjectDigests,
|
|
76
|
+
locations: manifest,
|
|
77
|
+
});
|
|
78
|
+
return deepFreeze({ ...body, digest: digest(body) });
|
|
79
|
+
}
|
|
80
|
+
export function createPayloadLifecycleClockSnapshot(input) {
|
|
81
|
+
if (input.version !== 1 || !Number.isSafeInteger(input.now) || input.now < 0
|
|
82
|
+
|| !Number.isSafeInteger(input.revision) || input.revision < 0) {
|
|
83
|
+
throw new Error('Payload Lifecycle Kernel clock is invalid');
|
|
84
|
+
}
|
|
85
|
+
const body = deepFreeze({ version: 1, now: input.now, revision: input.revision });
|
|
86
|
+
return deepFreeze({ ...body, digest: digest(body) });
|
|
87
|
+
}
|
|
88
|
+
export function replayPayloadLifecycle(projectId, objectId, events) {
|
|
89
|
+
text(projectId, 'Lifecycle Project id');
|
|
90
|
+
text(objectId, 'Lifecycle object id');
|
|
91
|
+
let authority;
|
|
92
|
+
const holds = {};
|
|
93
|
+
const erasures = [];
|
|
94
|
+
const purges = {};
|
|
95
|
+
let cryptoErased;
|
|
96
|
+
let purgeComplete;
|
|
97
|
+
events.forEach((event, index) => {
|
|
98
|
+
assertEvent(event, projectId, objectId, index);
|
|
99
|
+
switch (event.type) {
|
|
100
|
+
case 'object.registered':
|
|
101
|
+
if (authority)
|
|
102
|
+
throw new Error('Payload Lifecycle object is already registered');
|
|
103
|
+
authority = createPayloadLifecycleObjectAuthority(event.payload.authority);
|
|
104
|
+
assertGovernanceBinding(event.payload.governance, authority, 'register_object');
|
|
105
|
+
assertCandidate(event.payload.governance, authority.digest);
|
|
106
|
+
break;
|
|
107
|
+
case 'hold.placed':
|
|
108
|
+
if (!authority || holds[event.payload.id] || Object.keys(purges).length > 0
|
|
109
|
+
|| cryptoErased || purgeComplete) {
|
|
110
|
+
throw new Error('Payload Lifecycle Hold placement is invalid');
|
|
111
|
+
}
|
|
112
|
+
assertGovernanceBinding({ request: event.payload.placeRequest, decision: event.payload.placeDecision }, authority, 'place_hold');
|
|
113
|
+
assertCandidate({ request: event.payload.placeRequest, decision: event.payload.placeDecision }, digest({
|
|
114
|
+
holdId: event.payload.id,
|
|
115
|
+
owner: event.payload.ownerPrincipalId,
|
|
116
|
+
reasonCode: event.payload.reasonCode,
|
|
117
|
+
reviewAt: event.payload.reviewAt,
|
|
118
|
+
}));
|
|
119
|
+
if (event.payload.placedAt !== event.payload.placeRequest.clock.now
|
|
120
|
+
|| event.payload.reviewAt <= event.payload.placedAt) {
|
|
121
|
+
throw new Error('Payload Lifecycle Hold placement clock binding is invalid');
|
|
122
|
+
}
|
|
123
|
+
holds[event.payload.id] = deepFreeze(structuredClone(event.payload));
|
|
124
|
+
break;
|
|
125
|
+
case 'hold.reviewed': {
|
|
126
|
+
const current = holds[event.payload.holdId];
|
|
127
|
+
const nextReview = event.payload.hold.review;
|
|
128
|
+
if (!current || current.release || current.review?.approved || !nextReview
|
|
129
|
+
|| canonicalWorkroomJson({ ...current, review: nextReview })
|
|
130
|
+
!== canonicalWorkroomJson(event.payload.hold)) {
|
|
131
|
+
throw new Error('Payload Lifecycle Hold review is stale');
|
|
132
|
+
}
|
|
133
|
+
assertGovernanceBinding({ request: nextReview.request, decision: nextReview.decision }, authority, 'review_hold');
|
|
134
|
+
assertCandidate({ request: nextReview.request, decision: nextReview.decision }, digest({
|
|
135
|
+
holdId: event.payload.holdId,
|
|
136
|
+
approved: nextReview.approved,
|
|
137
|
+
placeAuthority: current.placeDecision.authorityDigest,
|
|
138
|
+
}));
|
|
139
|
+
if (nextReview.reviewedAt !== nextReview.request.clock.now) {
|
|
140
|
+
throw new Error('Payload Lifecycle Hold review clock binding is invalid');
|
|
141
|
+
}
|
|
142
|
+
holds[event.payload.holdId] = deepFreeze(structuredClone(event.payload.hold));
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case 'hold.released': {
|
|
146
|
+
const current = holds[event.payload.holdId];
|
|
147
|
+
if (!current?.review?.approved || current.release)
|
|
148
|
+
throw new Error('Payload Lifecycle Hold release is invalid');
|
|
149
|
+
if (!event.payload.hold.release)
|
|
150
|
+
throw new Error('Payload Lifecycle Hold release proof is unavailable');
|
|
151
|
+
assertGovernanceBinding({ request: event.payload.hold.release.request, decision: event.payload.hold.release.decision }, authority, 'release_hold');
|
|
152
|
+
assertCandidate({ request: event.payload.hold.release.request, decision: event.payload.hold.release.decision }, digest({
|
|
153
|
+
holdId: event.payload.holdId,
|
|
154
|
+
placeAuthority: current.placeDecision.authorityDigest,
|
|
155
|
+
reviewAuthority: current.review.decision.authorityDigest,
|
|
156
|
+
}));
|
|
157
|
+
if (event.payload.hold.release.releasedAt !== event.payload.hold.release.request.clock.now) {
|
|
158
|
+
throw new Error('Payload Lifecycle Hold release clock binding is invalid');
|
|
159
|
+
}
|
|
160
|
+
holds[event.payload.holdId] = deepFreeze(structuredClone(event.payload.hold));
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case 'erasure.requested':
|
|
164
|
+
if (!authority || !authority.subjectDigests.includes(event.payload.subjectDigest)) {
|
|
165
|
+
throw new Error('Payload Lifecycle erasure subject binding is invalid');
|
|
166
|
+
}
|
|
167
|
+
assertGovernanceBinding({ request: event.payload.request, decision: event.payload.decision }, authority, 'request_subject_erasure');
|
|
168
|
+
assertCandidate({ request: event.payload.request, decision: event.payload.decision }, digest({
|
|
169
|
+
subjectDigest: event.payload.subjectDigest,
|
|
170
|
+
resolverAuthorityDigest: event.payload.resolverAuthorityDigest,
|
|
171
|
+
}));
|
|
172
|
+
if (event.payload.requestedAt !== event.payload.request.clock.now) {
|
|
173
|
+
throw new Error('Payload subject erasure clock binding is invalid');
|
|
174
|
+
}
|
|
175
|
+
erasures.push(deepFreeze(structuredClone(event.payload)));
|
|
176
|
+
break;
|
|
177
|
+
case 'purge.requested': {
|
|
178
|
+
if (!authority || event.payload.objectAuthorityDigest !== authority.digest
|
|
179
|
+
|| event.payload.locationManifestDigest !== authority.locations.digest
|
|
180
|
+
|| event.payload.digest !== digestWithoutDigest(event.payload)) {
|
|
181
|
+
throw new Error('Payload purge dispatch object authority is stale');
|
|
182
|
+
}
|
|
183
|
+
const exactLocation = authority.locations.locations.find(location => location.id === event.payload.location.id);
|
|
184
|
+
if (!exactLocation || canonicalWorkroomJson(exactLocation) !== canonicalWorkroomJson(event.payload.location)
|
|
185
|
+
|| event.payload.id !== purgeId(projectId, objectId, exactLocation.id)
|
|
186
|
+
|| event.payload.requestedAt !== event.payload.governance.request.clock.now) {
|
|
187
|
+
throw new Error('Payload purge dispatch Location Manifest binding is invalid');
|
|
188
|
+
}
|
|
189
|
+
assertGovernanceBinding(event.payload.governance, authority);
|
|
190
|
+
const allowedActions = event.payload.reason === 'subject_erasure'
|
|
191
|
+
? ['request_subject_erasure', 'reconcile_purge']
|
|
192
|
+
: ['schedule_retention_purge', 'reconcile_purge'];
|
|
193
|
+
if (!allowedActions.includes(event.payload.governance.request.action)) {
|
|
194
|
+
throw new Error('Payload purge governance action/reason binding is invalid');
|
|
195
|
+
}
|
|
196
|
+
const current = purges[event.payload.id];
|
|
197
|
+
switch (event.payload.governance.request.action) {
|
|
198
|
+
case 'request_subject_erasure':
|
|
199
|
+
if (!erasures.some(value => value.request.digest === event.payload.requestDigest)) {
|
|
200
|
+
throw new Error('Payload subject erasure purge lacks its exact erasure fact');
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
case 'schedule_retention_purge':
|
|
204
|
+
assertCandidate(event.payload.governance, digest({ deleteAfter: authority.retention.deleteAfter }));
|
|
205
|
+
break;
|
|
206
|
+
case 'reconcile_purge':
|
|
207
|
+
if (!current?.receipt)
|
|
208
|
+
throw new Error('Payload purge reconciliation lacks its prior receipt');
|
|
209
|
+
assertCandidate(event.payload.governance, digest({ purgeId: event.payload.id, receiptDigest: current.receipt.digest }));
|
|
210
|
+
break;
|
|
211
|
+
default:
|
|
212
|
+
throw new Error('Payload purge governance action is invalid');
|
|
213
|
+
}
|
|
214
|
+
if ((!current && (event.payload.attempt !== 1 || event.payload.fence !== 1))
|
|
215
|
+
|| (current && (event.payload.attempt !== current.dispatch.attempt + 1
|
|
216
|
+
|| event.payload.fence !== current.dispatch.fence + 1
|
|
217
|
+
|| current.receipt?.status === 'confirmed'))) {
|
|
218
|
+
throw new Error('Payload purge retry attempt/fence is invalid');
|
|
219
|
+
}
|
|
220
|
+
purges[event.payload.id] = { dispatch: deepFreeze(structuredClone(event.payload)) };
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case 'purge.receipt': {
|
|
224
|
+
const current = purges[event.payload.purgeId];
|
|
225
|
+
if (!current || current.receipt
|
|
226
|
+
|| !receiptMatchesDispatch(event.payload, current.dispatch)) {
|
|
227
|
+
throw new Error('Payload purge receipt is stale');
|
|
228
|
+
}
|
|
229
|
+
assertReceipt(event.payload, current.dispatch);
|
|
230
|
+
purges[event.payload.purgeId] = {
|
|
231
|
+
dispatch: current.dispatch,
|
|
232
|
+
receipt: deepFreeze(structuredClone(event.payload)),
|
|
233
|
+
};
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
case 'object.crypto_erased':
|
|
237
|
+
if (cryptoErased || !authority || event.payload.objectAuthorityDigest !== authority.digest
|
|
238
|
+
|| event.payload.locationManifestDigest !== authority.locations.digest
|
|
239
|
+
|| event.payload.digest !== digestWithoutDigest(event.payload)) {
|
|
240
|
+
throw new Error('Payload crypto-erasure tombstone is invalid');
|
|
241
|
+
}
|
|
242
|
+
{
|
|
243
|
+
const confirmation = Object.values(purges).find(value => value.dispatch.location.id === event.payload.locationId
|
|
244
|
+
&& value.dispatch.location.deletionMode === 'crypto_erase'
|
|
245
|
+
&& value.receipt?.status === 'confirmed'
|
|
246
|
+
&& value.receipt.cryptoEraseReceiptDigest === event.payload.cryptoEraseReceiptDigest
|
|
247
|
+
&& value.receipt.observedAt === event.payload.erasedAt);
|
|
248
|
+
if (!confirmation)
|
|
249
|
+
throw new Error('Payload crypto-erasure tombstone lacks an exact confirmed receipt');
|
|
250
|
+
}
|
|
251
|
+
cryptoErased = deepFreeze(structuredClone(event.payload));
|
|
252
|
+
break;
|
|
253
|
+
case 'object.purge_complete':
|
|
254
|
+
if (purgeComplete || !authority || event.payload.objectAuthorityDigest !== authority.digest
|
|
255
|
+
|| event.payload.locationManifestDigest !== authority.locations.digest
|
|
256
|
+
|| event.payload.digest !== digestWithoutDigest(event.payload)
|
|
257
|
+
|| Object.keys(purges).length !== authority.locations.locations.length
|
|
258
|
+
|| Object.values(purges).some(value => value.receipt?.status !== 'confirmed')) {
|
|
259
|
+
throw new Error('Payload purge completion is not supported by all location receipts');
|
|
260
|
+
}
|
|
261
|
+
{
|
|
262
|
+
const confirmed = Object.values(purges).map(value => value.receipt);
|
|
263
|
+
if (canonicalWorkroomJson(event.payload.receiptDigests)
|
|
264
|
+
!== canonicalWorkroomJson(confirmed.map(value => value.digest).sort())
|
|
265
|
+
|| event.payload.completedAt !== Math.max(...confirmed.map(value => value.observedAt))) {
|
|
266
|
+
throw new Error('Payload purge completion receipt summary is stale');
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
purgeComplete = deepFreeze(structuredClone(event.payload));
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
const sequence = events.at(-1)?.sequence ?? -1;
|
|
274
|
+
const body = deepFreeze({
|
|
275
|
+
projectId,
|
|
276
|
+
objectId,
|
|
277
|
+
sequence,
|
|
278
|
+
...(authority ? { authority } : {}),
|
|
279
|
+
holds: Object.fromEntries(Object.entries(holds).sort(([left], [right]) => compareCanonicalWorkroomText(left, right))),
|
|
280
|
+
erasures,
|
|
281
|
+
purges: Object.fromEntries(Object.entries(purges).sort(([left], [right]) => compareCanonicalWorkroomText(left, right))),
|
|
282
|
+
...(cryptoErased ? { cryptoErased } : {}),
|
|
283
|
+
...(purgeComplete ? { purgeComplete } : {}),
|
|
284
|
+
});
|
|
285
|
+
return deepFreeze({ ...body, digest: digest(body) });
|
|
286
|
+
}
|
|
287
|
+
export class PayloadLifecycleRuntime {
|
|
288
|
+
options;
|
|
289
|
+
control;
|
|
290
|
+
worker;
|
|
291
|
+
constructor(options) {
|
|
292
|
+
this.options = options;
|
|
293
|
+
this.control = Object.freeze({
|
|
294
|
+
register: (command, signal) => this.#register(command, signal),
|
|
295
|
+
placeHold: (command, signal) => this.#placeHold(command, signal),
|
|
296
|
+
reviewHold: (command, signal) => this.#reviewHold(command, signal),
|
|
297
|
+
releaseHold: (command, signal) => this.#releaseHold(command, signal),
|
|
298
|
+
requestSubjectErasure: (command, signal) => this.#requestErasure(command, signal),
|
|
299
|
+
evaluateRetention: (command, signal) => this.#evaluateRetention(command, signal),
|
|
300
|
+
reconcile: (command, signal) => this.#reconcile(command, signal),
|
|
301
|
+
});
|
|
302
|
+
this.worker = Object.freeze({
|
|
303
|
+
dispatch: (projectId, objectId, signal) => this.#dispatch(projectId, objectId, signal),
|
|
304
|
+
drainProject: (projectId, signal) => this.#drainProject(projectId, signal),
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
async read(projectId, objectId) {
|
|
308
|
+
const events = await this.options.journal.read(projectId, objectId);
|
|
309
|
+
const verifiedRequests = new Map();
|
|
310
|
+
for (const [eventIndex, event] of events.entries()) {
|
|
311
|
+
const stateBefore = replayPayloadLifecycle(projectId, objectId, events.slice(0, event.sequence));
|
|
312
|
+
for (const proof of eventAuthorityProofs(event)) {
|
|
313
|
+
const firstStateDigest = verifiedRequests.get(proof.request.digest);
|
|
314
|
+
if (firstStateDigest === undefined) {
|
|
315
|
+
if (proof.request.currentStateDigest !== stateBefore.digest) {
|
|
316
|
+
throw new Error('Payload Lifecycle persisted governance proof state binding is stale');
|
|
317
|
+
}
|
|
318
|
+
verifiedRequests.set(proof.request.digest, stateBefore.digest);
|
|
319
|
+
}
|
|
320
|
+
else if (firstStateDigest !== proof.request.currentStateDigest) {
|
|
321
|
+
throw new Error('Payload Lifecycle persisted governance proof replay binding is stale');
|
|
322
|
+
}
|
|
323
|
+
if (!await this.options.authority.verify(proof.request, proof.decision)) {
|
|
324
|
+
throw new Error('Payload Lifecycle persisted governance proof is untrusted');
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
if (event.type === 'purge.receipt') {
|
|
328
|
+
const dispatch = stateBefore.purges[event.payload.purgeId]?.dispatch;
|
|
329
|
+
if (!dispatch || !await this.options.receipts.verify(event.payload, dispatch)) {
|
|
330
|
+
throw new Error('Payload Lifecycle persisted purge receipt is untrusted');
|
|
331
|
+
}
|
|
332
|
+
if (event.payload.status === 'confirmed' && dispatch.location.deletionMode === 'crypto_erase') {
|
|
333
|
+
const tombstone = events[eventIndex + 1];
|
|
334
|
+
if (!tombstone || tombstone.type !== 'object.crypto_erased'
|
|
335
|
+
|| tombstone.payload.cryptoEraseReceiptDigest !== event.payload.cryptoEraseReceiptDigest
|
|
336
|
+
|| tombstone.payload.locationId !== event.payload.locationId) {
|
|
337
|
+
throw new Error('Payload crypto-erasure confirmation lacks its atomic tombstone');
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return replayPayloadLifecycle(projectId, objectId, events);
|
|
343
|
+
}
|
|
344
|
+
async #register(command, signal) {
|
|
345
|
+
exactKeys(command, ['version', 'operationId', 'authenticatedPrincipalId', 'handle'], 'register command');
|
|
346
|
+
header(command, signal);
|
|
347
|
+
const object = await this.options.objects.resolve(command.handle, signal);
|
|
348
|
+
if (!object || canonicalWorkroomJson(object.handle) !== canonicalWorkroomJson(command.handle)) {
|
|
349
|
+
throw new Error('Trusted Payload Lifecycle object authority is unavailable');
|
|
350
|
+
}
|
|
351
|
+
const current = await this.read(object.handle.projectId, object.handle.objectId);
|
|
352
|
+
if (current.authority) {
|
|
353
|
+
if (current.authority.digest !== object.digest)
|
|
354
|
+
throw new Error('Payload Lifecycle object authority drift');
|
|
355
|
+
return current;
|
|
356
|
+
}
|
|
357
|
+
const clock = await this.#clock(command.operationId, object.handle.projectId, object.handle.objectId, 'control');
|
|
358
|
+
const governance = await this.#authorize('register_object', 'data_steward', command, object, current, object.digest, clock);
|
|
359
|
+
await this.options.journal.append(object.handle.projectId, object.handle.objectId, current.sequence, [{
|
|
360
|
+
type: 'object.registered', payload: { authority: object, governance },
|
|
361
|
+
}]);
|
|
362
|
+
return await this.read(object.handle.projectId, object.handle.objectId);
|
|
363
|
+
}
|
|
364
|
+
async #placeHold(command, signal) {
|
|
365
|
+
exactKeys(command, [
|
|
366
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'projectId', 'objectId',
|
|
367
|
+
'holdId', 'ownerPrincipalId', 'reasonCode', 'reviewAt',
|
|
368
|
+
], 'place Hold command');
|
|
369
|
+
header(command, signal);
|
|
370
|
+
text(command.holdId, 'Hold id');
|
|
371
|
+
text(command.ownerPrincipalId, 'Hold owner');
|
|
372
|
+
if (command.ownerPrincipalId !== command.authenticatedPrincipalId)
|
|
373
|
+
throw new Error('Hold owner must place the Hold');
|
|
374
|
+
if (!['legal_hold', 'investigation', 'regulatory_preservation'].includes(command.reasonCode)) {
|
|
375
|
+
throw new Error('Hold reason code is invalid');
|
|
376
|
+
}
|
|
377
|
+
if (!Number.isSafeInteger(command.reviewAt) || command.reviewAt < 0) {
|
|
378
|
+
throw new Error('Hold reviewAt is invalid');
|
|
379
|
+
}
|
|
380
|
+
const state = await this.#registered(command.projectId, command.objectId);
|
|
381
|
+
const existing = state.holds[command.holdId];
|
|
382
|
+
if (existing) {
|
|
383
|
+
if (existing.ownerPrincipalId !== command.ownerPrincipalId
|
|
384
|
+
|| existing.reasonCode !== command.reasonCode
|
|
385
|
+
|| existing.reviewAt !== command.reviewAt) {
|
|
386
|
+
throw new Error('Retention Hold idempotency binding drift');
|
|
387
|
+
}
|
|
388
|
+
return state;
|
|
389
|
+
}
|
|
390
|
+
if (Object.keys(state.purges).length > 0 || state.cryptoErased || state.purgeComplete) {
|
|
391
|
+
throw new Error('Retention Hold cannot be placed after deletion is scheduled');
|
|
392
|
+
}
|
|
393
|
+
const clock = await this.#clock(command.operationId, command.projectId, command.objectId, 'control');
|
|
394
|
+
if (command.reviewAt <= clock.now)
|
|
395
|
+
throw new Error('Hold reviewAt must be after placement time');
|
|
396
|
+
const candidate = digest({
|
|
397
|
+
holdId: command.holdId,
|
|
398
|
+
owner: command.ownerPrincipalId,
|
|
399
|
+
reasonCode: command.reasonCode,
|
|
400
|
+
reviewAt: command.reviewAt,
|
|
401
|
+
});
|
|
402
|
+
const proof = await this.#authorize('place_hold', 'data_steward', command, state.authority, state, candidate, clock);
|
|
403
|
+
const hold = deepFreeze({
|
|
404
|
+
id: command.holdId,
|
|
405
|
+
ownerPrincipalId: command.ownerPrincipalId,
|
|
406
|
+
reasonCode: command.reasonCode,
|
|
407
|
+
placedAt: clock.now,
|
|
408
|
+
reviewAt: command.reviewAt,
|
|
409
|
+
placeRequest: proof.request,
|
|
410
|
+
placeDecision: proof.decision,
|
|
411
|
+
});
|
|
412
|
+
await this.options.journal.append(command.projectId, command.objectId, state.sequence, [{
|
|
413
|
+
type: 'hold.placed', payload: hold,
|
|
414
|
+
}]);
|
|
415
|
+
return await this.read(command.projectId, command.objectId);
|
|
416
|
+
}
|
|
417
|
+
async #reviewHold(command, signal) {
|
|
418
|
+
exactKeys(command, [
|
|
419
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'projectId', 'objectId', 'holdId', 'approved',
|
|
420
|
+
], 'review Hold command');
|
|
421
|
+
header(command, signal);
|
|
422
|
+
if (typeof command.approved !== 'boolean')
|
|
423
|
+
throw new Error('Hold review decision is invalid');
|
|
424
|
+
const state = await this.#registered(command.projectId, command.objectId);
|
|
425
|
+
const hold = state.holds[command.holdId];
|
|
426
|
+
if (!hold)
|
|
427
|
+
throw new Error('Retention Hold is unavailable');
|
|
428
|
+
if (hold.review?.approved) {
|
|
429
|
+
if (!command.approved || hold.review.reviewerPrincipalId !== command.authenticatedPrincipalId) {
|
|
430
|
+
throw new Error('Retention Hold review idempotency binding drift');
|
|
431
|
+
}
|
|
432
|
+
return state;
|
|
433
|
+
}
|
|
434
|
+
const clock = await this.#clock(command.operationId, command.projectId, command.objectId, 'control');
|
|
435
|
+
const proof = await this.#authorize('review_hold', 'compliance', command, state.authority, state, digest({ holdId: command.holdId, approved: command.approved, placeAuthority: hold.placeDecision.authorityDigest }), clock);
|
|
436
|
+
if (command.authenticatedPrincipalId === hold.ownerPrincipalId
|
|
437
|
+
&& proof.decision.separationPolicy?.allowsSelfReview !== true) {
|
|
438
|
+
throw new Error('Retention Hold owner cannot self-review without exact separation policy');
|
|
439
|
+
}
|
|
440
|
+
const next = deepFreeze({
|
|
441
|
+
...structuredClone(hold),
|
|
442
|
+
review: {
|
|
443
|
+
approved: command.approved,
|
|
444
|
+
reviewerPrincipalId: command.authenticatedPrincipalId,
|
|
445
|
+
reviewedAt: clock.now,
|
|
446
|
+
request: proof.request,
|
|
447
|
+
decision: proof.decision,
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
await this.options.journal.append(command.projectId, command.objectId, state.sequence, [{
|
|
451
|
+
type: 'hold.reviewed', payload: { holdId: hold.id, hold: next },
|
|
452
|
+
}]);
|
|
453
|
+
return await this.read(command.projectId, command.objectId);
|
|
454
|
+
}
|
|
455
|
+
async #releaseHold(command, signal) {
|
|
456
|
+
exactKeys(command, [
|
|
457
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'projectId', 'objectId', 'holdId',
|
|
458
|
+
], 'release Hold command');
|
|
459
|
+
header(command, signal);
|
|
460
|
+
const state = await this.#registered(command.projectId, command.objectId);
|
|
461
|
+
const hold = state.holds[command.holdId];
|
|
462
|
+
if (!hold?.review?.approved)
|
|
463
|
+
throw new Error('Retention Hold requires an approved independent review');
|
|
464
|
+
if (command.authenticatedPrincipalId !== hold.ownerPrincipalId)
|
|
465
|
+
throw new Error('Only the Hold owner can release it');
|
|
466
|
+
if (hold.release)
|
|
467
|
+
return state;
|
|
468
|
+
if (hold.review.reviewerPrincipalId === hold.ownerPrincipalId
|
|
469
|
+
&& hold.review.decision.separationPolicy?.allowsSelfReview !== true) {
|
|
470
|
+
throw new Error('Retention Hold release lacks an independent review');
|
|
471
|
+
}
|
|
472
|
+
const clock = await this.#clock(command.operationId, command.projectId, command.objectId, 'control');
|
|
473
|
+
const proof = await this.#authorize('release_hold', 'data_steward', command, state.authority, state, digest({ holdId: hold.id, placeAuthority: hold.placeDecision.authorityDigest,
|
|
474
|
+
reviewAuthority: hold.review.decision.authorityDigest }), clock);
|
|
475
|
+
const next = deepFreeze({
|
|
476
|
+
...structuredClone(hold),
|
|
477
|
+
release: {
|
|
478
|
+
releasedBy: command.authenticatedPrincipalId,
|
|
479
|
+
releasedAt: clock.now,
|
|
480
|
+
request: proof.request,
|
|
481
|
+
decision: proof.decision,
|
|
482
|
+
},
|
|
483
|
+
});
|
|
484
|
+
await this.options.journal.append(command.projectId, command.objectId, state.sequence, [{
|
|
485
|
+
type: 'hold.released', payload: { holdId: hold.id, hold: next },
|
|
486
|
+
}]);
|
|
487
|
+
return await this.read(command.projectId, command.objectId);
|
|
488
|
+
}
|
|
489
|
+
async #requestErasure(command, signal) {
|
|
490
|
+
exactKeys(command, [
|
|
491
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'tenantId', 'projectId', 'subjectRef',
|
|
492
|
+
], 'subject erasure command');
|
|
493
|
+
header(command, signal);
|
|
494
|
+
text(command.tenantId, 'subject erasure tenantId');
|
|
495
|
+
text(command.projectId, 'subject erasure projectId');
|
|
496
|
+
text(command.subjectRef, 'subject erasure subjectRef');
|
|
497
|
+
const resolution = await this.options.subjects.resolve({
|
|
498
|
+
tenantId: command.tenantId, projectId: command.projectId, subjectRef: command.subjectRef,
|
|
499
|
+
}, signal);
|
|
500
|
+
assertSubjectResolution(resolution, command.tenantId, command.projectId);
|
|
501
|
+
const results = [];
|
|
502
|
+
for (const handle of resolution.handles) {
|
|
503
|
+
signal.throwIfAborted();
|
|
504
|
+
const state = await this.#registered(command.projectId, handle.objectId);
|
|
505
|
+
if (state.authority.handle.tenantId !== command.tenantId
|
|
506
|
+
|| !state.authority.subjectDigests.includes(resolution.subjectDigest)) {
|
|
507
|
+
throw new Error('Subject erasure resolution escaped its trusted object authority');
|
|
508
|
+
}
|
|
509
|
+
if (state.erasures.some(value => value.subjectDigest === resolution.subjectDigest)) {
|
|
510
|
+
results.push(state);
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
const clock = await this.#clock(command.operationId, command.projectId, handle.objectId, 'control');
|
|
514
|
+
this.#assertNoActiveHold(state);
|
|
515
|
+
const proof = await this.#authorize('request_subject_erasure', 'privacy', command, state.authority, state, digest({ subjectDigest: resolution.subjectDigest, resolverAuthorityDigest: resolution.authorityDigest }), clock);
|
|
516
|
+
if (clock.now < state.authority.retention.minimumRetainUntil) {
|
|
517
|
+
const override = proof.decision.minimumRetentionOverride;
|
|
518
|
+
if (!override || override.objectAuthorityDigest !== state.authority.digest) {
|
|
519
|
+
throw new Error('Subject erasure cannot override minimum retention without exact legal policy authority');
|
|
520
|
+
}
|
|
521
|
+
requiredDigest(override.policyDigest, 'minimum retention override policy digest');
|
|
522
|
+
text(override.policyRef, 'minimum retention override policy ref');
|
|
523
|
+
}
|
|
524
|
+
const fact = deepFreeze({
|
|
525
|
+
subjectDigest: resolution.subjectDigest,
|
|
526
|
+
requestedAt: clock.now,
|
|
527
|
+
request: proof.request,
|
|
528
|
+
decision: proof.decision,
|
|
529
|
+
resolverAuthorityDigest: resolution.authorityDigest,
|
|
530
|
+
});
|
|
531
|
+
const drafts = [{ type: 'erasure.requested', payload: fact }];
|
|
532
|
+
if (Object.keys(state.purges).length === 0 && !state.purgeComplete) {
|
|
533
|
+
drafts.push(...purgeDrafts(state, 'subject_erasure', clock.now, proof));
|
|
534
|
+
}
|
|
535
|
+
await this.options.journal.append(command.projectId, handle.objectId, state.sequence, drafts);
|
|
536
|
+
results.push(await this.read(command.projectId, handle.objectId));
|
|
537
|
+
}
|
|
538
|
+
return deepFreeze(results);
|
|
539
|
+
}
|
|
540
|
+
async #evaluateRetention(command, signal) {
|
|
541
|
+
exactKeys(command, [
|
|
542
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'projectId', 'objectId',
|
|
543
|
+
], 'retention evaluation command');
|
|
544
|
+
header(command, signal);
|
|
545
|
+
const state = await this.#registered(command.projectId, command.objectId);
|
|
546
|
+
if (state.purgeComplete || Object.keys(state.purges).length > 0)
|
|
547
|
+
return state;
|
|
548
|
+
const clock = await this.#clock(command.operationId, command.projectId, command.objectId, 'retention');
|
|
549
|
+
if (clock.now < state.authority.retention.deleteAfter)
|
|
550
|
+
throw new Error('Payload retention has not expired');
|
|
551
|
+
this.#assertNoActiveHold(state);
|
|
552
|
+
const proof = await this.#authorize('schedule_retention_purge', 'data_steward', command, state.authority, state, digest({ deleteAfter: state.authority.retention.deleteAfter }), clock);
|
|
553
|
+
await this.options.journal.append(command.projectId, command.objectId, state.sequence, purgeDrafts(state, 'retention_expired', clock.now, proof));
|
|
554
|
+
return await this.read(command.projectId, command.objectId);
|
|
555
|
+
}
|
|
556
|
+
async #reconcile(command, signal) {
|
|
557
|
+
exactKeys(command, [
|
|
558
|
+
'version', 'operationId', 'authenticatedPrincipalId', 'projectId', 'objectId', 'purgeId',
|
|
559
|
+
], 'purge reconciliation command');
|
|
560
|
+
header(command, signal);
|
|
561
|
+
const state = await this.#registered(command.projectId, command.objectId);
|
|
562
|
+
const current = state.purges[command.purgeId];
|
|
563
|
+
if (!current?.receipt || current.receipt.status === 'confirmed') {
|
|
564
|
+
throw new Error('Payload purge is not eligible for reconciliation');
|
|
565
|
+
}
|
|
566
|
+
const clock = await this.#clock(command.operationId, command.projectId, command.objectId, 'reconciliation');
|
|
567
|
+
const proof = await this.#authorize('reconcile_purge', 'data_steward', command, state.authority, state, digest({ purgeId: command.purgeId, receiptDigest: current.receipt.digest }), clock);
|
|
568
|
+
const { digest: _currentDigest, ...currentDispatch } = current.dispatch;
|
|
569
|
+
const retry = createPurgeDispatch({
|
|
570
|
+
...currentDispatch,
|
|
571
|
+
attempt: current.dispatch.attempt + 1,
|
|
572
|
+
fence: current.dispatch.fence + 1,
|
|
573
|
+
requestedAt: clock.now,
|
|
574
|
+
requestDigest: proof.request.digest,
|
|
575
|
+
governance: proof,
|
|
576
|
+
});
|
|
577
|
+
await this.options.journal.append(command.projectId, command.objectId, state.sequence, [{
|
|
578
|
+
type: 'purge.requested', payload: retry,
|
|
579
|
+
}]);
|
|
580
|
+
return await this.read(command.projectId, command.objectId);
|
|
581
|
+
}
|
|
582
|
+
async #dispatch(projectId, objectId, signal) {
|
|
583
|
+
signal.throwIfAborted();
|
|
584
|
+
let state = await this.#registered(projectId, objectId);
|
|
585
|
+
const pending = Object.values(state.purges)
|
|
586
|
+
.filter(value => !value.receipt)
|
|
587
|
+
.sort((left, right) => compareCanonicalWorkroomText(left.dispatch.location.id, right.dispatch.location.id));
|
|
588
|
+
for (const item of pending) {
|
|
589
|
+
const receipt = await this.options.deletion.purge(item.dispatch, signal);
|
|
590
|
+
assertReceipt(receipt, item.dispatch);
|
|
591
|
+
if (!await this.options.receipts.verify(receipt, item.dispatch)) {
|
|
592
|
+
throw new Error('Payload purge receipt authority denied the observation');
|
|
593
|
+
}
|
|
594
|
+
const drafts = [{ type: 'purge.receipt', payload: receipt }];
|
|
595
|
+
if (receipt.status === 'confirmed' && item.dispatch.location.deletionMode === 'crypto_erase') {
|
|
596
|
+
if (!receipt.cryptoEraseReceiptDigest)
|
|
597
|
+
throw new Error('Crypto erase confirmation lacks a receipt digest');
|
|
598
|
+
const body = deepFreeze({
|
|
599
|
+
version: 1,
|
|
600
|
+
projectId,
|
|
601
|
+
objectId,
|
|
602
|
+
vaultObjectId: state.authority.handle.vaultObjectId,
|
|
603
|
+
objectAuthorityDigest: state.authority.digest,
|
|
604
|
+
locationManifestDigest: state.authority.locations.digest,
|
|
605
|
+
locationId: item.dispatch.location.id,
|
|
606
|
+
cryptoEraseReceiptDigest: receipt.cryptoEraseReceiptDigest,
|
|
607
|
+
erasedAt: receipt.observedAt,
|
|
608
|
+
});
|
|
609
|
+
drafts.push({ type: 'object.crypto_erased', payload: deepFreeze({ ...body, digest: digest(body) }) });
|
|
610
|
+
}
|
|
611
|
+
await this.options.journal.append(projectId, objectId, state.sequence, drafts);
|
|
612
|
+
state = await this.read(projectId, objectId);
|
|
613
|
+
}
|
|
614
|
+
if (!state.purgeComplete
|
|
615
|
+
&& Object.keys(state.purges).length === state.authority.locations.locations.length
|
|
616
|
+
&& Object.values(state.purges).every(value => value.receipt?.status === 'confirmed')) {
|
|
617
|
+
const receipts = Object.values(state.purges).map(value => value.receipt.digest).sort();
|
|
618
|
+
const completedAt = Math.max(...Object.values(state.purges).map(value => value.receipt.observedAt));
|
|
619
|
+
const body = deepFreeze({
|
|
620
|
+
version: 1,
|
|
621
|
+
projectId,
|
|
622
|
+
objectId,
|
|
623
|
+
objectAuthorityDigest: state.authority.digest,
|
|
624
|
+
locationManifestDigest: state.authority.locations.digest,
|
|
625
|
+
completedAt,
|
|
626
|
+
receiptDigests: receipts,
|
|
627
|
+
});
|
|
628
|
+
await this.options.journal.append(projectId, objectId, state.sequence, [{
|
|
629
|
+
type: 'object.purge_complete', payload: deepFreeze({ ...body, digest: digest(body) }),
|
|
630
|
+
}]);
|
|
631
|
+
state = await this.read(projectId, objectId);
|
|
632
|
+
}
|
|
633
|
+
return state;
|
|
634
|
+
}
|
|
635
|
+
async #drainProject(projectId, signal) {
|
|
636
|
+
text(projectId, 'Lifecycle Project id');
|
|
637
|
+
const states = [];
|
|
638
|
+
for (const objectId of await this.options.journal.listObjectIds(projectId)) {
|
|
639
|
+
signal.throwIfAborted();
|
|
640
|
+
const state = await this.read(projectId, objectId);
|
|
641
|
+
const purges = Object.values(state.purges);
|
|
642
|
+
const hasPendingAttempt = purges.some(value => !value.receipt);
|
|
643
|
+
const needsCompletionRecovery = purges.length === state.authority?.locations.locations.length
|
|
644
|
+
&& purges.length > 0
|
|
645
|
+
&& purges.every(value => value.receipt?.status === 'confirmed');
|
|
646
|
+
if (state.purgeComplete || (!hasPendingAttempt && !needsCompletionRecovery))
|
|
647
|
+
continue;
|
|
648
|
+
states.push(await this.#dispatch(projectId, objectId, signal));
|
|
649
|
+
}
|
|
650
|
+
return deepFreeze(states);
|
|
651
|
+
}
|
|
652
|
+
async #registered(projectId, objectId) {
|
|
653
|
+
const state = await this.read(projectId, objectId);
|
|
654
|
+
if (!state.authority)
|
|
655
|
+
throw new Error('Payload Lifecycle object is not registered');
|
|
656
|
+
return state;
|
|
657
|
+
}
|
|
658
|
+
async #clock(operationId, projectId, objectId, purpose) {
|
|
659
|
+
const value = await this.options.clock.read({ operationId, projectId, objectId, purpose });
|
|
660
|
+
if (!value)
|
|
661
|
+
throw new Error('Payload Lifecycle Kernel clock authority is unavailable');
|
|
662
|
+
const canonical = createPayloadLifecycleClockSnapshot(value);
|
|
663
|
+
if (canonicalWorkroomJson(canonical) !== canonicalWorkroomJson(value)) {
|
|
664
|
+
throw new Error('Payload Lifecycle Kernel clock digest drift');
|
|
665
|
+
}
|
|
666
|
+
return canonical;
|
|
667
|
+
}
|
|
668
|
+
async #authorize(action, requiredRole, command, object, state, candidateDigest, clock) {
|
|
669
|
+
const body = deepFreeze({
|
|
670
|
+
version: 1,
|
|
671
|
+
action,
|
|
672
|
+
requiredRole,
|
|
673
|
+
operationId: command.operationId,
|
|
674
|
+
authenticatedPrincipalId: command.authenticatedPrincipalId,
|
|
675
|
+
tenantId: object.handle.tenantId,
|
|
676
|
+
projectId: object.handle.projectId,
|
|
677
|
+
objectId: object.handle.objectId,
|
|
678
|
+
objectAuthorityDigest: object.digest,
|
|
679
|
+
currentStateDigest: state.digest,
|
|
680
|
+
candidateDigest: requiredDigest(candidateDigest, 'Lifecycle candidate digest'),
|
|
681
|
+
clock,
|
|
682
|
+
});
|
|
683
|
+
const request = deepFreeze({ ...body, digest: digest(body) });
|
|
684
|
+
const result = await this.options.authority.authorize(request);
|
|
685
|
+
if (!result.approved) {
|
|
686
|
+
if (result.requestDigest !== request.digest)
|
|
687
|
+
throw new Error('Lifecycle authority denial echo mismatch');
|
|
688
|
+
throw new Error(`Lifecycle authority denied: ${result.reason}`);
|
|
689
|
+
}
|
|
690
|
+
if (result.requestDigest !== request.digest
|
|
691
|
+
|| result.principalId !== request.authenticatedPrincipalId
|
|
692
|
+
|| result.role !== requiredRole
|
|
693
|
+
|| !await this.options.authority.verify(request, result)) {
|
|
694
|
+
throw new Error('Lifecycle authority exact decision echo mismatch');
|
|
695
|
+
}
|
|
696
|
+
requiredDigest(result.authorityDigest, 'Lifecycle authority digest');
|
|
697
|
+
text(result.decisionId, 'Lifecycle decision id');
|
|
698
|
+
nonNegative(result.decidedAt, 'Lifecycle decision timestamp');
|
|
699
|
+
return deepFreeze({ request, decision: structuredClone(result) });
|
|
700
|
+
}
|
|
701
|
+
#assertNoActiveHold(state) {
|
|
702
|
+
if (Object.values(state.holds).some(hold => !hold.release)) {
|
|
703
|
+
throw new Error('Payload Lifecycle purge is blocked by an active Retention Hold');
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
function purgeDrafts(state, reason, requestedAt, governance) {
|
|
708
|
+
return state.authority.locations.locations.map(location => ({
|
|
709
|
+
type: 'purge.requested',
|
|
710
|
+
payload: createPurgeDispatch({
|
|
711
|
+
id: purgeId(state.projectId, state.objectId, location.id),
|
|
712
|
+
reason,
|
|
713
|
+
objectAuthorityDigest: state.authority.digest,
|
|
714
|
+
locationManifestDigest: state.authority.locations.digest,
|
|
715
|
+
location,
|
|
716
|
+
attempt: 1,
|
|
717
|
+
fence: 1,
|
|
718
|
+
requestedAt,
|
|
719
|
+
requestDigest: governance.request.digest,
|
|
720
|
+
governance,
|
|
721
|
+
}),
|
|
722
|
+
}));
|
|
723
|
+
}
|
|
724
|
+
function createPurgeDispatch(input) {
|
|
725
|
+
text(input.id, 'Purge id');
|
|
726
|
+
positive(input.attempt, 'Purge attempt');
|
|
727
|
+
positive(input.fence, 'Purge fence');
|
|
728
|
+
nonNegative(input.requestedAt, 'Purge requestedAt');
|
|
729
|
+
requiredDigest(input.objectAuthorityDigest, 'Purge object authority digest');
|
|
730
|
+
requiredDigest(input.locationManifestDigest, 'Purge Location Manifest digest');
|
|
731
|
+
requiredDigest(input.location.authorityDigest, 'Purge location authority digest');
|
|
732
|
+
requiredDigest(input.requestDigest, 'Purge request digest');
|
|
733
|
+
if (input.requestDigest !== input.governance.request.digest) {
|
|
734
|
+
throw new Error('Purge governance request binding is invalid');
|
|
735
|
+
}
|
|
736
|
+
const body = deepFreeze(structuredClone(input));
|
|
737
|
+
return deepFreeze({ ...body, digest: digest(body) });
|
|
738
|
+
}
|
|
739
|
+
function purgeId(projectId, objectId, locationId) {
|
|
740
|
+
return `purge:${digest({ projectId, objectId, locationId })}`;
|
|
741
|
+
}
|
|
742
|
+
function assertReceipt(receipt, dispatch) {
|
|
743
|
+
const { digest: supplied, ...body } = receipt;
|
|
744
|
+
if (receipt.version !== 1 || supplied !== digest(body) || !receiptMatchesDispatch(receipt, dispatch)
|
|
745
|
+
|| !['confirmed', 'failed', 'outcome_unknown'].includes(receipt.status)
|
|
746
|
+
|| !Number.isSafeInteger(receipt.observedAt) || receipt.observedAt < dispatch.requestedAt) {
|
|
747
|
+
throw new Error('Payload purge receipt is malformed or stale');
|
|
748
|
+
}
|
|
749
|
+
text(receipt.authenticatedBy, 'Purge receipt authority');
|
|
750
|
+
requiredDigest(receipt.authorityDigest, 'Purge receipt authority digest');
|
|
751
|
+
if (receipt.status === 'confirmed' && receipt.reasonCode !== undefined) {
|
|
752
|
+
throw new Error('Confirmed Payload purge receipt cannot carry a failure reason');
|
|
753
|
+
}
|
|
754
|
+
if (receipt.status !== 'confirmed' && receipt.reasonCode === undefined) {
|
|
755
|
+
throw new Error('Unconfirmed Payload purge receipt requires a bounded reason code');
|
|
756
|
+
}
|
|
757
|
+
if (receipt.reasonCode !== undefined && ![
|
|
758
|
+
'unsupported', 'provider_denied', 'transient_failure', 'timeout', 'unknown_external_copy',
|
|
759
|
+
].includes(receipt.reasonCode)) {
|
|
760
|
+
throw new Error('Payload purge receipt reason code is invalid');
|
|
761
|
+
}
|
|
762
|
+
if (receipt.cryptoEraseReceiptDigest !== undefined) {
|
|
763
|
+
requiredDigest(receipt.cryptoEraseReceiptDigest, 'Crypto erase receipt digest');
|
|
764
|
+
}
|
|
765
|
+
if (dispatch.location.deletionMode === 'crypto_erase') {
|
|
766
|
+
if (receipt.status === 'confirmed' && receipt.cryptoEraseReceiptDigest === undefined) {
|
|
767
|
+
throw new Error('Confirmed crypto erase receipt lacks its exact key-destruction proof');
|
|
768
|
+
}
|
|
769
|
+
if (receipt.status !== 'confirmed' && receipt.cryptoEraseReceiptDigest !== undefined) {
|
|
770
|
+
throw new Error('Unconfirmed crypto erase receipt cannot claim key destruction');
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
else if (receipt.cryptoEraseReceiptDigest !== undefined) {
|
|
774
|
+
throw new Error('Non-crypto purge receipt cannot claim key destruction');
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
function receiptMatchesDispatch(receipt, dispatch) {
|
|
778
|
+
return receipt.purgeId === dispatch.id
|
|
779
|
+
&& receipt.locationId === dispatch.location.id
|
|
780
|
+
&& receipt.locationAuthorityDigest === dispatch.location.authorityDigest
|
|
781
|
+
&& receipt.locationManifestDigest === dispatch.locationManifestDigest
|
|
782
|
+
&& receipt.attempt === dispatch.attempt
|
|
783
|
+
&& receipt.fence === dispatch.fence
|
|
784
|
+
&& receipt.requestDigest === dispatch.requestDigest;
|
|
785
|
+
}
|
|
786
|
+
function assertGovernanceBinding(proof, object, exactAction) {
|
|
787
|
+
if (!proof || proof.request.digest !== digestWithoutDigest(proof.request)
|
|
788
|
+
|| canonicalWorkroomJson(createPayloadLifecycleClockSnapshot(proof.request.clock))
|
|
789
|
+
!== canonicalWorkroomJson(proof.request.clock)
|
|
790
|
+
|| proof.decision.requestDigest !== proof.request.digest
|
|
791
|
+
|| proof.decision.principalId !== proof.request.authenticatedPrincipalId
|
|
792
|
+
|| proof.decision.role !== proof.request.requiredRole
|
|
793
|
+
|| proof.request.tenantId !== object.handle.tenantId
|
|
794
|
+
|| proof.request.projectId !== object.handle.projectId
|
|
795
|
+
|| proof.request.objectId !== object.handle.objectId
|
|
796
|
+
|| proof.request.objectAuthorityDigest !== object.digest
|
|
797
|
+
|| proof.request.requiredRole !== roleForAction(proof.request.action)
|
|
798
|
+
|| (exactAction !== undefined && proof.request.action !== exactAction)) {
|
|
799
|
+
throw new Error('Payload Lifecycle governance proof binding is invalid');
|
|
800
|
+
}
|
|
801
|
+
requiredDigest(proof.decision.authorityDigest, 'Lifecycle authority digest');
|
|
802
|
+
if (proof.decision.separationPolicy) {
|
|
803
|
+
requiredDigest(proof.decision.separationPolicy.policyDigest, 'separation policy digest');
|
|
804
|
+
}
|
|
805
|
+
if (proof.decision.minimumRetentionOverride) {
|
|
806
|
+
text(proof.decision.minimumRetentionOverride.policyRef, 'minimum retention override policy ref');
|
|
807
|
+
requiredDigest(proof.decision.minimumRetentionOverride.policyDigest, 'minimum retention override policy digest');
|
|
808
|
+
requiredDigest(proof.decision.minimumRetentionOverride.objectAuthorityDigest, 'minimum retention override object authority digest');
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
function assertCandidate(proof, candidateDigest) {
|
|
812
|
+
if (proof.request.candidateDigest !== candidateDigest) {
|
|
813
|
+
throw new Error('Payload Lifecycle governance candidate binding is stale');
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
function roleForAction(action) {
|
|
817
|
+
switch (action) {
|
|
818
|
+
case 'request_subject_erasure': return 'privacy';
|
|
819
|
+
case 'review_hold': return 'compliance';
|
|
820
|
+
case 'register_object':
|
|
821
|
+
case 'place_hold':
|
|
822
|
+
case 'release_hold':
|
|
823
|
+
case 'schedule_retention_purge':
|
|
824
|
+
case 'reconcile_purge':
|
|
825
|
+
return 'data_steward';
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function eventAuthorityProofs(event) {
|
|
829
|
+
switch (event.type) {
|
|
830
|
+
case 'object.registered': return [event.payload.governance];
|
|
831
|
+
case 'hold.placed': return [{ request: event.payload.placeRequest, decision: event.payload.placeDecision }];
|
|
832
|
+
case 'hold.reviewed': return event.payload.hold.review
|
|
833
|
+
? [{ request: event.payload.hold.review.request, decision: event.payload.hold.review.decision }]
|
|
834
|
+
: [];
|
|
835
|
+
case 'hold.released': return event.payload.hold.release
|
|
836
|
+
? [{ request: event.payload.hold.release.request, decision: event.payload.hold.release.decision }]
|
|
837
|
+
: [];
|
|
838
|
+
case 'erasure.requested': return [{ request: event.payload.request, decision: event.payload.decision }];
|
|
839
|
+
case 'purge.requested': return [event.payload.governance];
|
|
840
|
+
default: return [];
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
function assertEvent(event, projectId, objectId, sequence) {
|
|
844
|
+
if (event.version !== 1 || event.projectId !== projectId || event.objectId !== objectId
|
|
845
|
+
|| event.sequence !== sequence)
|
|
846
|
+
throw new Error('Payload Lifecycle event identity/sequence is invalid');
|
|
847
|
+
const { digest: supplied, ...body } = event;
|
|
848
|
+
if (supplied !== digest(body))
|
|
849
|
+
throw new Error('Payload Lifecycle event digest mismatch');
|
|
850
|
+
}
|
|
851
|
+
function digestWithoutDigest(value) {
|
|
852
|
+
const { digest: _supplied, ...body } = value;
|
|
853
|
+
return digest(body);
|
|
854
|
+
}
|
|
855
|
+
function assertSubjectResolution(value, tenantId, projectId) {
|
|
856
|
+
if (!value || value.version !== 1 || value.tenantId !== tenantId || value.projectId !== projectId
|
|
857
|
+
|| !Array.isArray(value.handles) || value.handles.length === 0) {
|
|
858
|
+
throw new Error('Trusted subject erasure resolution is unavailable');
|
|
859
|
+
}
|
|
860
|
+
requiredDigest(value.subjectDigest, 'subject digest');
|
|
861
|
+
requiredDigest(value.authorityDigest, 'subject resolver authority digest');
|
|
862
|
+
const { digest: supplied, ...body } = value;
|
|
863
|
+
if (supplied !== digest(body))
|
|
864
|
+
throw new Error('Subject erasure resolution digest mismatch');
|
|
865
|
+
value.handles.forEach(assertHandle);
|
|
866
|
+
}
|
|
867
|
+
function assertHandle(value) {
|
|
868
|
+
if (!value || value.version !== 1)
|
|
869
|
+
throw new Error('Payload Vault handle is invalid');
|
|
870
|
+
text(value.vaultObjectId, 'Vault object id');
|
|
871
|
+
text(value.objectId, 'Payload object id');
|
|
872
|
+
text(value.tenantId, 'Payload tenant id');
|
|
873
|
+
text(value.projectId, 'Payload Project id');
|
|
874
|
+
requiredDigest(value.payloadHash, 'Payload hash');
|
|
875
|
+
requiredDigest(value.descriptorDigest, 'Payload Descriptor digest');
|
|
876
|
+
requiredDigest(value.locationManifestDigest, 'Payload Location Manifest digest');
|
|
877
|
+
}
|
|
878
|
+
function header(command, signal) {
|
|
879
|
+
signal.throwIfAborted();
|
|
880
|
+
if (command.version !== 1)
|
|
881
|
+
throw new Error('Payload Lifecycle command version is invalid');
|
|
882
|
+
text(command.operationId, 'Payload Lifecycle operation id');
|
|
883
|
+
text(command.authenticatedPrincipalId, 'Payload Lifecycle authenticated principal');
|
|
884
|
+
}
|
|
885
|
+
function exactKeys(value, keys, label) {
|
|
886
|
+
const allowed = new Set(keys);
|
|
887
|
+
for (const key of Object.keys(value)) {
|
|
888
|
+
if (!allowed.has(key))
|
|
889
|
+
throw new Error(`Payload Lifecycle ${label} contains forbidden field ${key}`);
|
|
890
|
+
}
|
|
891
|
+
for (const key of keys) {
|
|
892
|
+
if (!(key in value))
|
|
893
|
+
throw new Error(`Payload Lifecycle ${label} is missing ${key}`);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
function uniqueDigests(values, label) {
|
|
897
|
+
if (!Array.isArray(values))
|
|
898
|
+
throw new Error(`${label} list is invalid`);
|
|
899
|
+
const normalized = [...new Set(values.map(value => requiredDigest(value, label)))].sort();
|
|
900
|
+
if (normalized.length !== values.length || canonicalWorkroomJson(normalized) !== canonicalWorkroomJson(values)) {
|
|
901
|
+
throw new Error(`${label} list is non-canonical`);
|
|
902
|
+
}
|
|
903
|
+
return deepFreeze(normalized);
|
|
904
|
+
}
|
|
905
|
+
function text(value, label) {
|
|
906
|
+
if (typeof value !== 'string' || !value.trim() || value !== value.trim()
|
|
907
|
+
|| value.length > 512 || [...value].some(character => {
|
|
908
|
+
const code = character.codePointAt(0);
|
|
909
|
+
return code <= 31 || code === 127;
|
|
910
|
+
})) {
|
|
911
|
+
throw new Error(`${label} is invalid`);
|
|
912
|
+
}
|
|
913
|
+
return value;
|
|
914
|
+
}
|
|
915
|
+
function requiredDigest(value, label) {
|
|
916
|
+
if (!/^sha256:[a-f0-9]{64}$/u.test(value))
|
|
917
|
+
throw new Error(`${label} is invalid`);
|
|
918
|
+
return value;
|
|
919
|
+
}
|
|
920
|
+
function positive(value, label) {
|
|
921
|
+
if (!Number.isSafeInteger(value) || value < 1)
|
|
922
|
+
throw new Error(`${label} must be positive`);
|
|
923
|
+
return value;
|
|
924
|
+
}
|
|
925
|
+
function nonNegative(value, label) {
|
|
926
|
+
if (!Number.isSafeInteger(value) || value < 0)
|
|
927
|
+
throw new Error(`${label} must be non-negative`);
|
|
928
|
+
return value;
|
|
929
|
+
}
|
|
930
|
+
//# sourceMappingURL=payload-lifecycle.js.map
|