kiokuko-dsh 0.2.7 → 0.2.9
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/PERMISSIONS.md +1 -1
- package/README.ja.md +38 -11
- package/README.ko.md +34 -3
- package/README.md +39 -13
- package/README.zh-CN.md +34 -3
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/db/transaction.d.ts +2 -1
- package/dist/db/transaction.d.ts.map +1 -1
- package/dist/db/transaction.js +44 -7
- package/dist/db/transaction.js.map +1 -1
- package/dist/deep-planning-config.d.ts +32 -0
- package/dist/deep-planning-config.d.ts.map +1 -0
- package/dist/deep-planning-config.js +20 -0
- package/dist/deep-planning-config.js.map +1 -0
- package/dist/deep-thinker/core/contracts.d.ts +1 -29
- package/dist/deep-thinker/core/contracts.d.ts.map +1 -1
- package/dist/deep-thinker/core/contracts.js +2 -17
- package/dist/deep-thinker/core/contracts.js.map +1 -1
- package/dist/deep-thinker/memory-finalizer.d.ts.map +1 -1
- package/dist/deep-thinker/memory-finalizer.js +1 -114
- package/dist/deep-thinker/memory-finalizer.js.map +1 -1
- package/dist/deep-thinker/native-executor.d.ts.map +1 -1
- package/dist/deep-thinker/native-executor.js +3 -4
- package/dist/deep-thinker/native-executor.js.map +1 -1
- package/dist/deep-thinker/store.js +1 -2
- package/dist/deep-thinker/store.js.map +1 -1
- package/dist/dsh/agenticreplay-event-mapper.d.ts +1 -1
- package/dist/dsh/agenticreplay-event-mapper.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-event-mapper.js +5 -1
- package/dist/dsh/agenticreplay-event-mapper.js.map +1 -1
- package/dist/dsh/agenticreplay-files.d.ts +1 -0
- package/dist/dsh/agenticreplay-files.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-files.js +19 -2
- package/dist/dsh/agenticreplay-files.js.map +1 -1
- package/dist/dsh/agenticreplay-host.js +3 -3
- package/dist/dsh/agenticreplay-host.js.map +1 -1
- package/dist/dsh/agenticreplay-read-service.d.ts +20 -0
- package/dist/dsh/agenticreplay-read-service.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-read-service.js +27 -0
- package/dist/dsh/agenticreplay-read-service.js.map +1 -1
- package/dist/dsh/agenticreplay-recorder.d.ts +18 -12
- package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-recorder.js +43 -13
- package/dist/dsh/agenticreplay-recorder.js.map +1 -1
- package/dist/dsh/agenticreplay-security.d.ts +1 -0
- package/dist/dsh/agenticreplay-security.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-security.js +84 -3
- package/dist/dsh/agenticreplay-security.js.map +1 -1
- package/dist/dsh/answer-review/coordinator.js +2 -1
- package/dist/dsh/answer-review/coordinator.js.map +1 -1
- package/dist/dsh/auto-memory-review.d.ts.map +1 -1
- package/dist/dsh/auto-memory-review.js +10 -193
- package/dist/dsh/auto-memory-review.js.map +1 -1
- package/dist/dsh/coding-workflow/contracts.d.ts +2 -0
- package/dist/dsh/coding-workflow/contracts.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/contracts.js.map +1 -1
- package/dist/dsh/coding-workflow/intent.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/intent.js +12 -4
- package/dist/dsh/coding-workflow/intent.js.map +1 -1
- package/dist/dsh/coding-workflow/service.d.ts +10 -81
- package/dist/dsh/coding-workflow/service.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/service.js +52 -1
- package/dist/dsh/coding-workflow/service.js.map +1 -1
- package/dist/dsh/coding-workflow/store.d.ts +22 -0
- package/dist/dsh/coding-workflow/store.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/store.js +51 -0
- package/dist/dsh/coding-workflow/store.js.map +1 -1
- package/dist/dsh/completion-verifiers.d.ts +6 -0
- package/dist/dsh/completion-verifiers.d.ts.map +1 -1
- package/dist/dsh/completion-verifiers.js.map +1 -1
- package/dist/dsh/composition.d.ts +2 -0
- package/dist/dsh/composition.d.ts.map +1 -1
- package/dist/dsh/composition.js +3 -0
- package/dist/dsh/composition.js.map +1 -1
- package/dist/dsh/config.d.ts +1 -1
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/config.js +3 -3
- package/dist/dsh/config.js.map +1 -1
- package/dist/dsh/core/host.d.ts.map +1 -1
- package/dist/dsh/core/host.js +159 -34
- package/dist/dsh/core/host.js.map +1 -1
- package/dist/dsh/core/tasks.d.ts +5 -2
- package/dist/dsh/core/tasks.d.ts.map +1 -1
- package/dist/dsh/core/tasks.js +124 -93
- package/dist/dsh/core/tasks.js.map +1 -1
- package/dist/dsh/decisions/request-intent.d.ts +114 -1
- package/dist/dsh/decisions/request-intent.d.ts.map +1 -1
- package/dist/dsh/decisions/request-intent.js +102 -18
- package/dist/dsh/decisions/request-intent.js.map +1 -1
- package/dist/dsh/execution-result.d.ts +1 -0
- package/dist/dsh/execution-result.d.ts.map +1 -1
- package/dist/dsh/execution-support.d.ts +2 -0
- package/dist/dsh/execution-support.d.ts.map +1 -1
- package/dist/dsh/execution-support.js +39 -4
- package/dist/dsh/execution-support.js.map +1 -1
- package/dist/dsh/existing-task-intake.d.ts +22 -0
- package/dist/dsh/existing-task-intake.d.ts.map +1 -0
- package/dist/dsh/existing-task-intake.js +46 -0
- package/dist/dsh/existing-task-intake.js.map +1 -0
- package/dist/dsh/finalization-request.d.ts +1 -1
- package/dist/dsh/finalization-request.d.ts.map +1 -1
- package/dist/dsh/finalization-request.js +1 -1
- package/dist/dsh/finalization-request.js.map +1 -1
- package/dist/dsh/guardrail/contracts.d.ts +85 -0
- package/dist/dsh/guardrail/contracts.d.ts.map +1 -0
- package/dist/dsh/guardrail/contracts.js +10 -0
- package/dist/dsh/guardrail/contracts.js.map +1 -0
- package/dist/dsh/guardrail/engine.d.ts +19 -0
- package/dist/dsh/guardrail/engine.d.ts.map +1 -0
- package/dist/dsh/guardrail/engine.js +178 -0
- package/dist/dsh/guardrail/engine.js.map +1 -0
- package/dist/dsh/guardrail/evidence.d.ts +16 -0
- package/dist/dsh/guardrail/evidence.d.ts.map +1 -0
- package/dist/dsh/guardrail/evidence.js +101 -0
- package/dist/dsh/guardrail/evidence.js.map +1 -0
- package/dist/dsh/guardrail/service.d.ts +27 -0
- package/dist/dsh/guardrail/service.d.ts.map +1 -0
- package/dist/dsh/guardrail/service.js +253 -0
- package/dist/dsh/guardrail/service.js.map +1 -0
- package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
- package/dist/dsh/host-adapter/admission.js +143 -144
- package/dist/dsh/host-adapter/admission.js.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.d.ts +1 -0
- package/dist/dsh/host-adapter/lifecycle.d.ts.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.js +107 -77
- package/dist/dsh/host-adapter/lifecycle.js.map +1 -1
- package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
- package/dist/dsh/host-adapter/routing.js +4 -4
- package/dist/dsh/host-adapter/routing.js.map +1 -1
- package/dist/dsh/host-adapter/turn-state.d.ts +4 -2
- package/dist/dsh/host-adapter/turn-state.d.ts.map +1 -1
- package/dist/dsh/host-adapter/turn-state.js +14 -7
- package/dist/dsh/host-adapter/turn-state.js.map +1 -1
- package/dist/dsh/host-adapter.d.ts.map +1 -1
- package/dist/dsh/host-adapter.js +125 -24
- package/dist/dsh/host-adapter.js.map +1 -1
- package/dist/dsh/intake-clarification.js +2 -2
- package/dist/dsh/intake-clarification.js.map +1 -1
- package/dist/dsh/intake-gate.js +6 -7
- package/dist/dsh/intake-gate.js.map +1 -1
- package/dist/dsh/legacy-session-codecs.d.ts +1 -0
- package/dist/dsh/legacy-session-codecs.d.ts.map +1 -1
- package/dist/dsh/legacy-session-codecs.js +831 -127
- package/dist/dsh/legacy-session-codecs.js.map +4 -4
- package/dist/dsh/lifecycle-memory.d.ts +66 -0
- package/dist/dsh/lifecycle-memory.d.ts.map +1 -0
- package/dist/dsh/lifecycle-memory.js +380 -0
- package/dist/dsh/lifecycle-memory.js.map +1 -0
- package/dist/dsh/lisp/candidate.d.ts +2 -2
- package/dist/dsh/lisp/ci.d.ts +2 -1
- package/dist/dsh/lisp/ci.d.ts.map +1 -1
- package/dist/dsh/lisp/ci.js +15 -2
- package/dist/dsh/lisp/ci.js.map +1 -1
- package/dist/dsh/lisp/contracts.d.ts +1 -18
- package/dist/dsh/lisp/contracts.d.ts.map +1 -1
- package/dist/dsh/lisp/contracts.js +1 -10
- package/dist/dsh/lisp/contracts.js.map +1 -1
- package/dist/dsh/lisp/files.d.ts +1 -1
- package/dist/dsh/lisp/files.d.ts.map +1 -1
- package/dist/dsh/lisp/files.js +17 -4
- package/dist/dsh/lisp/files.js.map +1 -1
- package/dist/dsh/lisp/hot-store.d.ts.map +1 -1
- package/dist/dsh/lisp/hot-store.js +4 -0
- package/dist/dsh/lisp/hot-store.js.map +1 -1
- package/dist/dsh/lisp/hot-tools.d.ts +2 -0
- package/dist/dsh/lisp/hot-tools.d.ts.map +1 -1
- package/dist/dsh/lisp/hot-tools.js +10 -0
- package/dist/dsh/lisp/hot-tools.js.map +1 -1
- package/dist/dsh/lisp/manager.d.ts +14 -1
- package/dist/dsh/lisp/manager.d.ts.map +1 -1
- package/dist/dsh/lisp/manager.js +238 -37
- package/dist/dsh/lisp/manager.js.map +1 -1
- package/dist/dsh/lisp/memory-verification.d.ts +5 -2
- package/dist/dsh/lisp/memory-verification.d.ts.map +1 -1
- package/dist/dsh/lisp/memory-verification.js +5 -1
- package/dist/dsh/lisp/memory-verification.js.map +1 -1
- package/dist/dsh/lisp/package-manager.d.ts +1 -1
- package/dist/dsh/lisp/package-manager.d.ts.map +1 -1
- package/dist/dsh/lisp/package-manager.js +10 -1
- package/dist/dsh/lisp/package-manager.js.map +1 -1
- package/dist/dsh/lisp/packages.d.ts +1 -1
- package/dist/dsh/lisp/packages.d.ts.map +1 -1
- package/dist/dsh/lisp/packages.js +15 -5
- package/dist/dsh/lisp/packages.js.map +1 -1
- package/dist/dsh/lisp/proposal-batch.d.ts +2 -0
- package/dist/dsh/lisp/proposal-batch.d.ts.map +1 -1
- package/dist/dsh/lisp/proposal-batch.js +17 -3
- package/dist/dsh/lisp/proposal-batch.js.map +1 -1
- package/dist/dsh/lisp/request-surface.d.ts +12 -0
- package/dist/dsh/lisp/request-surface.d.ts.map +1 -1
- package/dist/dsh/lisp/store.d.ts +2 -1
- package/dist/dsh/lisp/store.d.ts.map +1 -1
- package/dist/dsh/lisp/store.js +5 -1
- package/dist/dsh/lisp/store.js.map +1 -1
- package/dist/dsh/lisp/surface.d.ts.map +1 -1
- package/dist/dsh/lisp/surface.js +107 -13
- package/dist/dsh/lisp/surface.js.map +1 -1
- package/dist/dsh/lisp/task-authority.d.ts +29 -0
- package/dist/dsh/lisp/task-authority.d.ts.map +1 -0
- package/dist/dsh/lisp/task-authority.js +87 -0
- package/dist/dsh/lisp/task-authority.js.map +1 -0
- package/dist/dsh/lisp/worker.d.ts +3 -1
- package/dist/dsh/lisp/worker.d.ts.map +1 -1
- package/dist/dsh/lisp/worker.js +26 -4
- package/dist/dsh/lisp/worker.js.map +1 -1
- package/dist/dsh/lisp-config.d.ts +21 -0
- package/dist/dsh/lisp-config.d.ts.map +1 -0
- package/dist/dsh/lisp-config.js +13 -0
- package/dist/dsh/lisp-config.js.map +1 -0
- package/dist/dsh/memory-application.d.ts +3 -2
- package/dist/dsh/memory-application.d.ts.map +1 -1
- package/dist/dsh/memory-application.js +31 -22
- package/dist/dsh/memory-application.js.map +1 -1
- package/dist/dsh/model-handoff.d.ts.map +1 -1
- package/dist/dsh/model-handoff.js +2 -1
- package/dist/dsh/model-handoff.js.map +1 -1
- package/dist/dsh/models/service.d.ts.map +1 -1
- package/dist/dsh/models/service.js +13 -2
- package/dist/dsh/models/service.js.map +1 -1
- package/dist/dsh/models/vendor/opencode-codec.d.ts.map +1 -1
- package/dist/dsh/models/vendor/opencode-codec.js +71 -0
- package/dist/dsh/models/vendor/opencode-codec.js.map +1 -1
- package/dist/dsh/native-cancellation-observer.d.ts +13 -0
- package/dist/dsh/native-cancellation-observer.d.ts.map +1 -0
- package/dist/dsh/native-cancellation-observer.js +54 -0
- package/dist/dsh/native-cancellation-observer.js.map +1 -0
- package/dist/dsh/native-execution-ownership.d.ts +6 -0
- package/dist/dsh/native-execution-ownership.d.ts.map +1 -0
- package/dist/dsh/native-execution-ownership.js +34 -0
- package/dist/dsh/native-execution-ownership.js.map +1 -0
- package/dist/dsh/native-subagent.d.ts +2 -2
- package/dist/dsh/native-subagent.d.ts.map +1 -1
- package/dist/dsh/native-subagent.js +2 -3
- package/dist/dsh/native-subagent.js.map +1 -1
- package/dist/dsh/native-task-authority.d.ts +66 -0
- package/dist/dsh/native-task-authority.d.ts.map +1 -0
- package/dist/dsh/native-task-authority.js +220 -0
- package/dist/dsh/native-task-authority.js.map +1 -0
- package/dist/dsh/node-tap-summary.d.ts +1 -2
- package/dist/dsh/node-tap-summary.d.ts.map +1 -1
- package/dist/dsh/node-tap-summary.js +2 -24
- package/dist/dsh/node-tap-summary.js.map +1 -1
- package/dist/dsh/observation-pack/policy.d.ts +1 -0
- package/dist/dsh/observation-pack/policy.d.ts.map +1 -1
- package/dist/dsh/observation-pack/policy.js +3 -0
- package/dist/dsh/observation-pack/policy.js.map +1 -1
- package/dist/dsh/observation-pack/service.d.ts.map +1 -1
- package/dist/dsh/observation-pack/service.js +3 -1
- package/dist/dsh/observation-pack/service.js.map +1 -1
- package/dist/dsh/on-demand-intake.d.ts +28 -1
- package/dist/dsh/on-demand-intake.d.ts.map +1 -1
- package/dist/dsh/on-demand-intake.js +171 -10
- package/dist/dsh/on-demand-intake.js.map +1 -1
- package/dist/dsh/orchestration/execution-owner.js +1 -1
- package/dist/dsh/orchestration/execution-owner.js.map +1 -1
- package/dist/dsh/orchestration/managed-agent-executor.d.ts +12 -1
- package/dist/dsh/orchestration/managed-agent-executor.d.ts.map +1 -1
- package/dist/dsh/orchestration/managed-agent-executor.js +28 -2
- package/dist/dsh/orchestration/managed-agent-executor.js.map +1 -1
- package/dist/dsh/owned-completion-evidence.d.ts +11 -0
- package/dist/dsh/owned-completion-evidence.d.ts.map +1 -0
- package/dist/dsh/owned-completion-evidence.js +59 -0
- package/dist/dsh/owned-completion-evidence.js.map +1 -0
- package/dist/dsh/owned-execution.d.ts +28 -1
- package/dist/dsh/owned-execution.d.ts.map +1 -1
- package/dist/dsh/owned-execution.js +325 -101
- package/dist/dsh/owned-execution.js.map +1 -1
- package/dist/dsh/owned-read-owner.d.ts +6 -0
- package/dist/dsh/owned-read-owner.d.ts.map +1 -0
- package/dist/dsh/owned-read-owner.js +22 -0
- package/dist/dsh/owned-read-owner.js.map +1 -0
- package/dist/dsh/replay-memory-extract.d.ts +36 -0
- package/dist/dsh/replay-memory-extract.d.ts.map +1 -0
- package/dist/dsh/replay-memory-extract.js +192 -0
- package/dist/dsh/replay-memory-extract.js.map +1 -0
- package/dist/dsh/semantic-compaction/coordinator.d.ts.map +1 -1
- package/dist/dsh/semantic-compaction/coordinator.js +2 -1
- package/dist/dsh/semantic-compaction/coordinator.js.map +1 -1
- package/dist/dsh/session-bridge.d.ts +3 -0
- package/dist/dsh/session-bridge.d.ts.map +1 -1
- package/dist/dsh/session-bridge.js +22 -25
- package/dist/dsh/session-bridge.js.map +1 -1
- package/dist/dsh/session-history-compatibility.d.ts.map +1 -1
- package/dist/dsh/session-history-compatibility.js +15 -1
- package/dist/dsh/session-history-compatibility.js.map +1 -1
- package/dist/dsh/session-history-lookup.d.ts +1 -1
- package/dist/dsh/session-history-lookup.d.ts.map +1 -1
- package/dist/dsh/session-history-lookup.js +4 -3
- package/dist/dsh/session-history-lookup.js.map +1 -1
- package/dist/dsh/session-memory-finalizer.d.ts.map +1 -1
- package/dist/dsh/session-memory-finalizer.js +129 -117
- package/dist/dsh/session-memory-finalizer.js.map +1 -1
- package/dist/dsh/setup.d.ts +1 -1
- package/dist/dsh/setup.d.ts.map +1 -1
- package/dist/dsh/setup.js +1 -1
- package/dist/dsh/skill-prompts.json +1 -1
- package/dist/dsh/task-authority-context.d.ts +8 -0
- package/dist/dsh/task-authority-context.d.ts.map +1 -0
- package/dist/dsh/task-authority-context.js +28 -0
- package/dist/dsh/task-authority-context.js.map +1 -0
- package/dist/dsh/task-completion-host.d.ts +2 -1
- package/dist/dsh/task-completion-host.d.ts.map +1 -1
- package/dist/dsh/task-completion-host.js +17 -5
- package/dist/dsh/task-completion-host.js.map +1 -1
- package/dist/dsh/task-completion.d.ts +13 -0
- package/dist/dsh/task-completion.d.ts.map +1 -1
- package/dist/dsh/task-completion.js +23 -6
- package/dist/dsh/task-completion.js.map +1 -1
- package/dist/dsh/task-intake.d.ts.map +1 -1
- package/dist/dsh/task-intake.js +7 -16
- package/dist/dsh/task-intake.js.map +1 -1
- package/dist/dsh/task-source-history.d.ts +33 -0
- package/dist/dsh/task-source-history.d.ts.map +1 -0
- package/dist/dsh/task-source-history.js +62 -0
- package/dist/dsh/task-source-history.js.map +1 -0
- package/dist/dsh/task-state-host.d.ts +124 -0
- package/dist/dsh/task-state-host.d.ts.map +1 -0
- package/dist/dsh/task-state-host.js +403 -0
- package/dist/dsh/task-state-host.js.map +1 -0
- package/dist/dsh/task-state-surface.d.ts +8 -0
- package/dist/dsh/task-state-surface.d.ts.map +1 -0
- package/dist/dsh/task-state-surface.js +113 -0
- package/dist/dsh/task-state-surface.js.map +1 -0
- package/dist/dsh/task-state.d.ts +217 -0
- package/dist/dsh/task-state.d.ts.map +1 -0
- package/dist/dsh/task-state.js +315 -0
- package/dist/dsh/task-state.js.map +1 -0
- package/dist/dsh/tool-exposure-config.d.ts +12 -0
- package/dist/dsh/tool-exposure-config.d.ts.map +1 -0
- package/dist/dsh/tool-exposure-config.js +4 -0
- package/dist/dsh/tool-exposure-config.js.map +1 -0
- package/dist/dsh/tool-exposure.d.ts +2 -11
- package/dist/dsh/tool-exposure.d.ts.map +1 -1
- package/dist/dsh/tool-exposure.js +2 -2
- package/dist/dsh/tool-exposure.js.map +1 -1
- package/dist/dsh/tools.d.ts +2 -2
- package/dist/dsh/tools.d.ts.map +1 -1
- package/dist/dsh/tools.js +3 -2
- package/dist/dsh/tools.js.map +1 -1
- package/dist/enno-oduno/memory-verification.d.ts +2 -1
- package/dist/enno-oduno/memory-verification.d.ts.map +1 -1
- package/dist/enno-oduno/memory-verification.js +42 -30
- package/dist/enno-oduno/memory-verification.js.map +1 -1
- package/dist/enno-oduno/schemas.d.ts +1 -1
- package/dist/enno-oduno/store.d.ts +7 -0
- package/dist/enno-oduno/store.d.ts.map +1 -1
- package/dist/enno-oduno/store.js +42 -0
- package/dist/enno-oduno/store.js.map +1 -1
- package/dist/ledger/store.d.ts.map +1 -1
- package/dist/ledger/store.js +0 -5
- package/dist/ledger/store.js.map +1 -1
- package/dist/locale/en.json +1 -1
- package/dist/locale/ja.json +1 -1
- package/dist/locale/ko.json +1 -1
- package/dist/locale/zh-CN.json +1 -1
- package/dist/memory/application.js +1 -1
- package/dist/memory/application.js.map +1 -1
- package/dist/memory/auto-globalization.d.ts.map +1 -1
- package/dist/memory/auto-globalization.js +4 -82
- package/dist/memory/auto-globalization.js.map +1 -1
- package/dist/memory/evolution/contracts.d.ts +3 -1
- package/dist/memory/evolution/contracts.d.ts.map +1 -1
- package/dist/memory/evolution/contracts.js +1 -1
- package/dist/memory/evolution/contracts.js.map +1 -1
- package/dist/memory/evolution/store.d.ts +2 -1
- package/dist/memory/evolution/store.d.ts.map +1 -1
- package/dist/memory/evolution/store.js +75 -34
- package/dist/memory/evolution/store.js.map +1 -1
- package/dist/memory/evolution/worker.d.ts +1 -0
- package/dist/memory/evolution/worker.d.ts.map +1 -1
- package/dist/memory/evolution/worker.js +6 -18
- package/dist/memory/evolution/worker.js.map +1 -1
- package/dist/memory/explain.d.ts.map +1 -1
- package/dist/memory/explain.js +2 -2
- package/dist/memory/explain.js.map +1 -1
- package/dist/memory/forget.d.ts.map +1 -1
- package/dist/memory/forget.js +12 -3
- package/dist/memory/forget.js.map +1 -1
- package/dist/memory/hybrid-retrieval.d.ts.map +1 -1
- package/dist/memory/hybrid-retrieval.js +3 -0
- package/dist/memory/hybrid-retrieval.js.map +1 -1
- package/dist/memory/index-reasoning/service.d.ts.map +1 -1
- package/dist/memory/index-reasoning/service.js +5 -43
- package/dist/memory/index-reasoning/service.js.map +1 -1
- package/dist/memory/index-reasoning/worker.d.ts.map +1 -1
- package/dist/memory/index-reasoning/worker.js +1 -15
- package/dist/memory/index-reasoning/worker.js.map +1 -1
- package/dist/memory/lifecycle-cache.d.ts +12 -0
- package/dist/memory/lifecycle-cache.d.ts.map +1 -0
- package/dist/memory/lifecycle-cache.js +36 -0
- package/dist/memory/lifecycle-cache.js.map +1 -0
- package/dist/memory/lifecycle-database.d.ts +5 -0
- package/dist/memory/lifecycle-database.d.ts.map +1 -0
- package/dist/memory/lifecycle-database.js +32 -0
- package/dist/memory/lifecycle-database.js.map +1 -0
- package/dist/memory/lifecycle-global-state.d.ts +5 -0
- package/dist/memory/lifecycle-global-state.d.ts.map +1 -0
- package/dist/memory/lifecycle-global-state.js +23 -0
- package/dist/memory/lifecycle-global-state.js.map +1 -0
- package/dist/memory/lifecycle-global.d.ts +23 -0
- package/dist/memory/lifecycle-global.d.ts.map +1 -0
- package/dist/memory/lifecycle-global.js +56 -0
- package/dist/memory/lifecycle-global.js.map +1 -0
- package/dist/memory/lifecycle.d.ts +152 -0
- package/dist/memory/lifecycle.d.ts.map +1 -0
- package/dist/memory/lifecycle.js +152 -0
- package/dist/memory/lifecycle.js.map +1 -0
- package/dist/memory/replay-review.d.ts +90 -0
- package/dist/memory/replay-review.d.ts.map +1 -0
- package/dist/memory/replay-review.js +82 -0
- package/dist/memory/replay-review.js.map +1 -0
- package/dist/memory/replay-store.d.ts +14 -0
- package/dist/memory/replay-store.d.ts.map +1 -0
- package/dist/memory/replay-store.js +117 -0
- package/dist/memory/replay-store.js.map +1 -0
- package/dist/memory/review/adoption.d.ts.map +1 -1
- package/dist/memory/review/adoption.js +2 -106
- package/dist/memory/review/adoption.js.map +1 -1
- package/dist/memory/review/store.d.ts.map +1 -1
- package/dist/memory/review/store.js +9 -5
- package/dist/memory/review/store.js.map +1 -1
- package/dist/memory/review/worker.d.ts.map +1 -1
- package/dist/memory/review/worker.js +1 -7
- package/dist/memory/review/worker.js.map +1 -1
- package/dist/memory/scoped-memory.js +1 -1
- package/dist/memory/scoped-memory.js.map +1 -1
- package/dist/model-tools/contracts.d.ts +4 -4
- package/dist/model-tools/contracts.d.ts.map +1 -1
- package/dist/model-tools/contracts.js +1 -11
- package/dist/model-tools/contracts.js.map +1 -1
- package/dist/model-tools/names.d.ts +4 -0
- package/dist/model-tools/names.d.ts.map +1 -0
- package/dist/model-tools/names.js +13 -0
- package/dist/model-tools/names.js.map +1 -0
- package/docs/agenticreplay-recording.md +1 -1
- package/docs/code-intelligence.md +54 -119
- package/docs/dsh-plugin.md +86 -9
- package/docs/getting-started.md +10 -0
- package/docs/guardrail-licenses/Apache-2.0.txt +73 -0
- package/docs/guardrail-licenses/BSD-2-Clause.txt +9 -0
- package/docs/guardrail-licenses/COPYRIGHT-Rust.txt +34 -0
- package/docs/guardrail-licenses/COPYRIGHT-library.html +29357 -0
- package/docs/guardrail-licenses/ISC.txt +7 -0
- package/docs/guardrail-licenses/LICENSE-APACHE +176 -0
- package/docs/guardrail-licenses/LICENSE-MIT +25 -0
- package/docs/guardrail-licenses/LLVM-exception.txt +15 -0
- package/docs/guardrail-licenses/MIT.txt +9 -0
- package/docs/guardrail-licenses/NCSA.txt +29 -0
- package/docs/guardrail-licenses/README.md +7 -0
- package/docs/guardrail-licenses/Unicode-3.0.txt +39 -0
- package/docs/guardrail-licenses/libunwind-LICENSE.txt +311 -0
- package/docs/guardrail-licenses/manifest.json +71 -0
- package/docs/guardrail-licenses/musl-COPYRIGHT.txt +193 -0
- package/docs/guardrail.md +33 -0
- package/docs/lifecycle-memory.md +25 -0
- package/docs/lisp.md +33 -9
- package/docs/memory-evolution.md +6 -6
- package/docs/owned-execution.md +3 -3
- package/docs/replay-memory-review.md +26 -0
- package/docs/semantic-compaction.md +2 -0
- package/guardrail/aarch64-apple-darwin/kiokuko-guardrail +0 -0
- package/guardrail/aarch64-apple-darwin/manifest.json +71 -0
- package/guardrail/aarch64-unknown-linux-musl/kiokuko-guardrail +0 -0
- package/guardrail/aarch64-unknown-linux-musl/manifest.json +69 -0
- package/guardrail/manifest.json +204 -0
- package/guardrail/node-runner.mjs +37 -0
- package/guardrail/protocols/coding-routine.lisp +33 -0
- package/guardrail/x86_64-apple-darwin/kiokuko-guardrail +0 -0
- package/guardrail/x86_64-apple-darwin/manifest.json +71 -0
- package/guardrail/x86_64-unknown-linux-musl/kiokuko-guardrail +0 -0
- package/guardrail/x86_64-unknown-linux-musl/manifest.json +68 -0
- package/migrations/038_coding_admission.sql +19 -0
- package/migrations/039_memory_lifecycle.sql +336 -0
- package/migrations/040_task_state.sql +45 -0
- package/migrations/041_task_source_history.sql +88 -0
- package/migrations/042_evolution_source_epochs.sql +148 -0
- package/package.json +45 -27
- package/scripts/guardrail-artifacts.d.mts +13 -0
- package/scripts/guardrail-artifacts.mjs +136 -0
- package/skills/kiokuko-lisp/SKILL.md +1 -1
- package/skills/kiokuko-soul/SKILL.md +6 -6
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { renameSync, openSync, closeSync, writeFileSync, fsyncSync, fchmodSync, rmSync, statSync } from 'node:fs';
|
|
2
|
+
import { assertProtocolRoute, reserveProtocolFile, applyProtocolFile, withProtocolEffect, reserveProtocolTest, authorizeProtocolTest, finishProtocolTest } from './guardrail/service.js';
|
|
3
|
+
import { runProtocolTests } from './guardrail/engine.js';
|
|
4
|
+
import { retainProtocolResult, protocolReceiptUncertain } from './guardrail/evidence.js';
|
|
5
|
+
import { recordOwnedCompletionObservation } from './owned-completion-evidence.js';
|
|
1
6
|
import { spawn } from 'node:child_process';
|
|
2
7
|
import { createHash, randomUUID } from 'node:crypto';
|
|
3
8
|
import { readFile, open, rename, mkdir, rm, realpath, stat } from 'node:fs/promises';
|
|
@@ -17,14 +22,43 @@ import { shellArguments } from './execution-command.js';
|
|
|
17
22
|
import { assertCodingDispatch, assertCodingCommandRetry } from './coding-workflow/service.js';
|
|
18
23
|
import { readCodingWorkflow } from './coding-workflow/store.js';
|
|
19
24
|
import { executionRequestAction } from './coding-workflow/intent.js';
|
|
25
|
+
import { withImmediateTransaction } from '../db/transaction.js';
|
|
26
|
+
import { TASK_AUTHORITY, authorizeTaskLease, readTaskSnapshot } from './task-state.js';
|
|
27
|
+
import { captureExecutionTaskLease, withTaskAuthority, currentTaskAuthority, hasNoTaskAuthority, withNoTaskAuthority } from './task-authority-context.js';
|
|
20
28
|
const hash = (data) => createHash('sha256').update(data).digest('hex');
|
|
21
29
|
const within = (root, target) => { const relative = path.relative(root, target); return relative === '' || !relative.startsWith('..' + path.sep) && relative !== '..' && !path.isAbsolute(relative); };
|
|
22
30
|
const safeText = (text) => findSecret(text) ? '[redacted secret-bearing text]' : text;
|
|
23
31
|
const ownedCalls = new WeakSet();
|
|
24
32
|
export const isOwnedExecutionCall = (execution) => ownedCalls.has(execution);
|
|
33
|
+
/** Known effect surfaces. Composite Lisp/PTC programs guard their inner calls;
|
|
34
|
+
* reading, cancellation and pure evaluation do not acquire execution authority. */
|
|
35
|
+
export function taskEffectTool(name, args) {
|
|
36
|
+
if (name === 'str_replace_editor')
|
|
37
|
+
return args?.command !== 'view';
|
|
38
|
+
return ['kioku_write', 'kioku_edit', 'kioku_remove', 'kioku_exec', 'write', 'edit', 'bash', 'spawn', 'fork', 'subagent', 'enno_delegate', 'task_operation'].includes(name);
|
|
39
|
+
}
|
|
25
40
|
const fileInput = z.object({ path: z.string().min(1), content: z.string().optional(), expectedHash: z.string().nullable().optional(), oldText: z.string().optional(), newText: z.string().optional() }).strict();
|
|
26
41
|
const commandInput = z.object({ command: z.string().min(1), cwd: z.string().optional(), shell: z.enum(['bash', 'zsh']).default('bash'), background: z.boolean().default(false), timeoutMs: z.number().int().min(1).max(3600000).default(300000), destructiveTargets: z.array(z.string()).optional() }).strict();
|
|
27
42
|
const resultInput = z.object({ operationId: z.string().min(1), cancel: z.boolean().default(false) }).strict();
|
|
43
|
+
const runtimeServices = new WeakMap();
|
|
44
|
+
/** Host-only stop observation. A crash receipt is not proof of a stopped child. */
|
|
45
|
+
export async function stopTaskOwnedExecutions(runtime, identity, signal) {
|
|
46
|
+
signal?.throwIfAborted();
|
|
47
|
+
await Promise.all([...runtimeServices.get(runtime) ?? []].map(service => service.stopTask(identity, signal)));
|
|
48
|
+
signal?.throwIfAborted();
|
|
49
|
+
try {
|
|
50
|
+
return await runtime.withDatabase(db => db.prepare('SELECT receipt_json FROM dsh_owned_operations WHERE run_id=?')
|
|
51
|
+
.all(identity.taskId).every(row => {
|
|
52
|
+
const receipt = JSON.parse(row.receipt_json);
|
|
53
|
+
if (receipt.repositoryRoot !== identity.repositoryRoot || receipt.state === 'started')
|
|
54
|
+
return false;
|
|
55
|
+
return receipt.kind !== 'kioku_exec' || receipt.state === 'completed' && receipt.processStopped === true;
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
28
62
|
/** One owner for effects and observed evidence. Saved-result reads never execute an effect. */
|
|
29
63
|
export class OwnedExecutionService {
|
|
30
64
|
host;
|
|
@@ -32,13 +66,62 @@ export class OwnedExecutionService {
|
|
|
32
66
|
#legacyRuns = new Set();
|
|
33
67
|
constructor(host) {
|
|
34
68
|
this.host = host;
|
|
69
|
+
const services = runtimeServices.get(host.runtime) ?? new Set();
|
|
70
|
+
services.add(this);
|
|
71
|
+
runtimeServices.set(host.runtime, services);
|
|
35
72
|
}
|
|
36
73
|
current(execution) {
|
|
37
74
|
execution.signal.throwIfAborted();
|
|
38
75
|
const identity = this.host.resolve(execution);
|
|
39
76
|
if (!identity)
|
|
40
77
|
throw new Error('No current admitted execution owner');
|
|
41
|
-
return identity;
|
|
78
|
+
return Object.freeze({ ...identity });
|
|
79
|
+
}
|
|
80
|
+
assertAuthority(identity, lease, database) {
|
|
81
|
+
const current = this.host.resolve({ agent: identity.agent, callId: 'task-authority', name: 'kioku_exec', signal: new AbortController().signal });
|
|
82
|
+
if (!current || current.runId !== identity.runId || current.sessionId !== identity.sessionId
|
|
83
|
+
|| current.repositoryRoot !== identity.repositoryRoot || current.generation !== identity.generation
|
|
84
|
+
|| lease.taskId !== identity.runId || lease.sessionId !== (identity.workflowSessionId ?? identity.sessionId)
|
|
85
|
+
|| lease.repositoryRoot !== identity.repositoryRoot)
|
|
86
|
+
throw new KiokukoError('CONFLICT', 'Task execution owner changed');
|
|
87
|
+
authorizeTaskLease(database, lease);
|
|
88
|
+
}
|
|
89
|
+
async checkAuthority(identity, lease) {
|
|
90
|
+
await this.host.runtime.withDatabase(db => this.assertAuthority(identity, lease, db));
|
|
91
|
+
}
|
|
92
|
+
/** The caller may carry an earlier lease (for example an asynchronous Lisp job).
|
|
93
|
+
* Never replace it with the current task after a stop/resume or owner change. */
|
|
94
|
+
async captureAuthority(execution, identity = this.current(execution)) {
|
|
95
|
+
return this.host.runtime.withDatabase(db => {
|
|
96
|
+
const lease = captureExecutionTaskLease(db, {
|
|
97
|
+
taskId: identity.runId, sessionId: identity.workflowSessionId ?? identity.sessionId, repositoryRoot: identity.repositoryRoot,
|
|
98
|
+
}, execution);
|
|
99
|
+
this.assertAuthority(identity, lease, db);
|
|
100
|
+
execution[TASK_AUTHORITY] = lease;
|
|
101
|
+
return lease;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/** A pure composite may run in any state, but its later inner effects must
|
|
105
|
+
* retain the task (or absence of one) observed when the composite began. */
|
|
106
|
+
async composite(execution, next) {
|
|
107
|
+
if (hasNoTaskAuthority())
|
|
108
|
+
return withNoTaskAuthority(next);
|
|
109
|
+
const inherited = execution[TASK_AUTHORITY] ?? currentTaskAuthority();
|
|
110
|
+
if (inherited)
|
|
111
|
+
return withTaskAuthority(inherited, next);
|
|
112
|
+
let lease;
|
|
113
|
+
try {
|
|
114
|
+
const identity = this.host.resolve(execution) ?? await this.host.resolveRead?.(execution);
|
|
115
|
+
if (execution[TASK_AUTHORITY])
|
|
116
|
+
return withTaskAuthority(execution[TASK_AUTHORITY], next);
|
|
117
|
+
if (identity)
|
|
118
|
+
lease = await this.host.runtime.withDatabase(db => {
|
|
119
|
+
const task = readTaskSnapshot(db, { taskId: identity.runId, sessionId: identity.workflowSessionId ?? identity.sessionId, repositoryRoot: identity.repositoryRoot });
|
|
120
|
+
return { taskId: task.taskId, sessionId: task.sessionId, repositoryRoot: task.repositoryRoot, revision: task.revision, generation: task.generation };
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
catch { /* Pure calculations remain available; inner effects fail closed. */ }
|
|
124
|
+
return lease ? withTaskAuthority(lease, next) : withNoTaskAuthority(next);
|
|
42
125
|
}
|
|
43
126
|
async persist(receipt, digest) {
|
|
44
127
|
const journal = this.journal(receipt.repositoryRoot);
|
|
@@ -82,6 +165,8 @@ export class OwnedExecutionService {
|
|
|
82
165
|
return;
|
|
83
166
|
try {
|
|
84
167
|
await this.host.runtime.withDatabase(db => {
|
|
168
|
+
const lease = captureExecutionTaskLease(db, { taskId: identity.runId, sessionId: identity.workflowSessionId ?? identity.sessionId, repositoryRoot: identity.repositoryRoot }, execution);
|
|
169
|
+
this.assertAuthority(identity, lease, db);
|
|
85
170
|
// Coding checks carry source/config/artifact dependencies. Assessment
|
|
86
171
|
// invalidates the affected checks instead of discarding unrelated items.
|
|
87
172
|
if (readCodingWorkflow(db, identity.runId)) {
|
|
@@ -94,11 +179,13 @@ export class OwnedExecutionService {
|
|
|
94
179
|
}
|
|
95
180
|
catch { /* Missing auxiliary evidence never rejects development. */ }
|
|
96
181
|
}
|
|
97
|
-
async evidence(identity, receipt, command, execute) {
|
|
182
|
+
async evidence(identity, receipt, command, lease, execute) {
|
|
98
183
|
let completion = false, memory = false;
|
|
99
184
|
let sourcePaths = [];
|
|
185
|
+
await this.checkAuthority(identity, lease);
|
|
100
186
|
try {
|
|
101
187
|
await this.host.runtime.withDatabase(db => {
|
|
188
|
+
this.assertAuthority(identity, lease, db);
|
|
102
189
|
completion = beginTaskCompletionExecution(db, { runId: identity.runId, callId: receipt.operationId, command, repositoryRoot: identity.repositoryRoot, cwd: receipt.cwd });
|
|
103
190
|
if (completion) {
|
|
104
191
|
const method = db.prepare(`SELECT b.method_json FROM dsh_completion_executions e JOIN dsh_completion_bindings b
|
|
@@ -110,7 +197,7 @@ export class OwnedExecutionService {
|
|
|
110
197
|
}
|
|
111
198
|
catch { /* Evidence failure is exposed as unknown; effects continue. */ }
|
|
112
199
|
try {
|
|
113
|
-
memory = await this.host.runtime.withDatabase(db => beginMemoryExecution(db, identity, receipt.operationId, command, receipt.cwd));
|
|
200
|
+
memory = await this.host.runtime.withDatabase(db => { this.assertAuthority(identity, lease, db); return beginMemoryExecution(db, identity, receipt.operationId, command, receipt.cwd); });
|
|
114
201
|
}
|
|
115
202
|
catch { /* Memory bookkeeping cannot suppress completion observations. */ }
|
|
116
203
|
for (const source of sourcePaths) {
|
|
@@ -130,7 +217,8 @@ export class OwnedExecutionService {
|
|
|
130
217
|
const argv = shellArguments(command);
|
|
131
218
|
const readOnly = argv && ['cat', 'head', 'tail', 'ls', 'pwd', 'wc', 'stat', 'readlink'].includes(path.basename(argv[0] ?? ''));
|
|
132
219
|
if (!completion && !readOnly)
|
|
133
|
-
await this.unknownEffects({ agent: identity.agent, callId: receipt.operationId, name: 'kioku_exec', signal: new AbortController().signal });
|
|
220
|
+
await this.unknownEffects({ agent: identity.agent, callId: receipt.operationId, name: 'kioku_exec', signal: new AbortController().signal, [TASK_AUTHORITY]: lease });
|
|
221
|
+
await this.checkAuthority(identity, lease);
|
|
134
222
|
const result = await execute();
|
|
135
223
|
for (const target of receipt.targets) {
|
|
136
224
|
try {
|
|
@@ -145,36 +233,41 @@ export class OwnedExecutionService {
|
|
|
145
233
|
}
|
|
146
234
|
}
|
|
147
235
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
236
|
+
try {
|
|
237
|
+
await this.host.runtime.withDatabase(db => withImmediateTransaction(db, () => {
|
|
238
|
+
this.assertAuthority(identity, lease, db);
|
|
239
|
+
if (completion) {
|
|
240
|
+
finishTaskCompletionExecution(db, { runId: identity.runId, callId: receipt.operationId, result });
|
|
241
|
+
saveTaskCompletionReceipt(db, identity.runId);
|
|
242
|
+
const row = db.prepare(`SELECT e.source_digest,e.outcome,b.method_json FROM dsh_completion_executions e
|
|
155
243
|
JOIN dsh_completion_bindings b ON b.run_id=e.run_id AND b.method_digest=e.method_digest WHERE e.run_id=? AND e.call_id=? LIMIT 1`)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
catch { /* Missing inputs remain unknown. */ }
|
|
164
|
-
receipt.checks = [{ sourcePaths: method.sourcePaths, sourceDigest: row.source_digest, ...(postSourceDigest ? { postSourceDigest } : {}), outcome: row.outcome, assertion: method.assertion }];
|
|
165
|
-
receipt.verification = row.outcome === 'passed' ? 'passed' : row.outcome === 'failed' ? 'failed' : 'unknown';
|
|
244
|
+
.get(identity.runId, receipt.operationId);
|
|
245
|
+
if (row) {
|
|
246
|
+
const method = JSON.parse(row.method_json);
|
|
247
|
+
let postSourceDigest;
|
|
248
|
+
try {
|
|
249
|
+
postSourceDigest = completionSourceDigest(db, identity.runId, identity.repositoryRoot, method.sourcePaths);
|
|
166
250
|
}
|
|
251
|
+
catch { /* Missing inputs remain unknown. */ }
|
|
252
|
+
receipt.checks = [{ sourcePaths: method.sourcePaths, sourceDigest: row.source_digest, ...(postSourceDigest ? { postSourceDigest } : {}), outcome: row.outcome, assertion: method.assertion }];
|
|
253
|
+
receipt.verification = row.outcome === 'passed' ? 'passed' : row.outcome === 'failed' ? 'failed' : 'unknown';
|
|
167
254
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
255
|
+
}
|
|
256
|
+
if (memory)
|
|
257
|
+
completeMemoryExecution(db, identity, receipt.operationId, result);
|
|
258
|
+
}));
|
|
259
|
+
receipt.authority = 'current';
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
receipt.verification = 'unknown';
|
|
263
|
+
try {
|
|
264
|
+
await this.checkAuthority(identity, lease);
|
|
171
265
|
}
|
|
172
266
|
catch {
|
|
173
|
-
receipt.
|
|
267
|
+
receipt.authority = 'stale';
|
|
268
|
+
receipt.error = safeText(error instanceof Error ? error.message : String(error));
|
|
174
269
|
}
|
|
175
270
|
}
|
|
176
|
-
else
|
|
177
|
-
receipt.verification = 'unknown';
|
|
178
271
|
return result;
|
|
179
272
|
}
|
|
180
273
|
async approve(identity, detail, signal) {
|
|
@@ -191,7 +284,13 @@ export class OwnedExecutionService {
|
|
|
191
284
|
return { ...value, receipt, ...(replayed ? { replayed: true } : {}), status: { work: receipt.state, verification: receipt.verification ?? 'unknown', receiptPersistence: receipt.persistence, memoryStorage } };
|
|
192
285
|
}
|
|
193
286
|
async execute(name, raw, execution) {
|
|
194
|
-
const identity = this.
|
|
287
|
+
const identity = (name === 'kioku_read' || name === 'kioku_result') && this.host.resolveRead
|
|
288
|
+
? await this.host.resolveRead(execution).then(value => {
|
|
289
|
+
execution.signal.throwIfAborted();
|
|
290
|
+
if (!value)
|
|
291
|
+
throw new Error('No current execution result owner');
|
|
292
|
+
return Object.freeze({ ...value });
|
|
293
|
+
}) : this.current(execution);
|
|
195
294
|
const action = executionRequestAction(identity.requestIntent, identity.requestIntentContext, name);
|
|
196
295
|
ownedCalls.add(execution);
|
|
197
296
|
if (name === 'kioku_read' || name === 'kioku_result') {
|
|
@@ -205,6 +304,7 @@ export class OwnedExecutionService {
|
|
|
205
304
|
if (name === 'kioku_result')
|
|
206
305
|
return this.result(identity, resultInput.parse(raw));
|
|
207
306
|
const input = name === 'kioku_exec' ? commandInput.parse(raw) : fileInput.parse(raw);
|
|
307
|
+
const lease = name === 'kioku_read' ? await this.captureAuthority(execution, identity).catch(() => undefined) : await this.captureAuthority(execution, identity);
|
|
208
308
|
if (name !== 'kioku_read') {
|
|
209
309
|
try {
|
|
210
310
|
await this.host.runtime.withDatabase(db => {
|
|
@@ -264,7 +364,7 @@ export class OwnedExecutionService {
|
|
|
264
364
|
await this.persist(prior, digest);
|
|
265
365
|
return this.reply(prior, {}, true);
|
|
266
366
|
}
|
|
267
|
-
const receipt = { version: 1, operationId, runId: identity.runId, sessionId: identity.sessionId, generation: identity.generation, kind: name, repositoryRoot: identity.repositoryRoot, cwd: identity.repositoryRoot, targets: [], state: 'started', evidenceRef: `owned:${operationId}`, persistence: 'pending' };
|
|
367
|
+
const receipt = { version: 1, operationId, runId: identity.runId, sessionId: identity.sessionId, generation: identity.generation, kind: name, repositoryRoot: identity.repositoryRoot, cwd: identity.repositoryRoot, targets: [], state: 'started', evidenceRef: `owned:${operationId}`, persistence: 'pending', ...(lease ? { taskAuthority: Object.freeze({ ...lease }) } : {}) };
|
|
268
368
|
const controller = new AbortController();
|
|
269
369
|
const operation = { digest, receipt, controller };
|
|
270
370
|
// A second concurrent call may have completed the database lookup too.
|
|
@@ -304,8 +404,8 @@ export class OwnedExecutionService {
|
|
|
304
404
|
await this.persist(receipt, digest);
|
|
305
405
|
const done = (async () => {
|
|
306
406
|
try {
|
|
307
|
-
operation.value = name === 'kioku_exec' ? await this.command(identity, receipt, input, signal)
|
|
308
|
-
: await this.file(identity, receipt, name, input, signal);
|
|
407
|
+
operation.value = name === 'kioku_exec' ? await this.command(identity, receipt, input, signal, lease)
|
|
408
|
+
: await this.file(identity, receipt, name, input, signal, lease);
|
|
309
409
|
receipt.state = 'completed';
|
|
310
410
|
}
|
|
311
411
|
catch (error) {
|
|
@@ -315,6 +415,18 @@ export class OwnedExecutionService {
|
|
|
315
415
|
receipt.verification = 'unknown';
|
|
316
416
|
}
|
|
317
417
|
await this.persist(receipt, digest);
|
|
418
|
+
if (name === 'kioku_exec') {
|
|
419
|
+
try {
|
|
420
|
+
await finishProtocolTest(action => this.host.runtime.withDatabase(action), receipt);
|
|
421
|
+
await this.host.runtime.withDatabase(db => saveTaskCompletionReceipt(db, identity.runId));
|
|
422
|
+
}
|
|
423
|
+
catch (error) {
|
|
424
|
+
receipt.verification = 'unknown';
|
|
425
|
+
receipt.error = safeText(error instanceof Error ? error.message : String(error));
|
|
426
|
+
await this.persist(receipt, digest);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
await this.host.runtime.withDatabase(db => withImmediateTransaction(db, () => recordOwnedCompletionObservation(db, receipt))).catch(() => { });
|
|
318
430
|
return this.reply(receipt, operation.value);
|
|
319
431
|
})();
|
|
320
432
|
operation.done = done;
|
|
@@ -322,7 +434,7 @@ export class OwnedExecutionService {
|
|
|
322
434
|
return this.reply(receipt);
|
|
323
435
|
return done;
|
|
324
436
|
}
|
|
325
|
-
async file(identity, receipt, name, input, signal) {
|
|
437
|
+
async file(identity, receipt, name, input, signal, lease) {
|
|
326
438
|
const target = path.resolve(identity.repositoryRoot, input.path);
|
|
327
439
|
// Resolve the parent as well as existing target to identify symlink exits.
|
|
328
440
|
let actual;
|
|
@@ -351,8 +463,20 @@ export class OwnedExecutionService {
|
|
|
351
463
|
await this.persist(receipt, this.#operations.get(receipt.operationId).digest);
|
|
352
464
|
if (input.expectedHash !== undefined && input.expectedHash !== before)
|
|
353
465
|
throw new Error('File changed before the operation');
|
|
354
|
-
if (name === 'kioku_read')
|
|
355
|
-
|
|
466
|
+
if (name === 'kioku_read') {
|
|
467
|
+
const content = await readFile(actual, 'utf8'), observedHash = hash(content);
|
|
468
|
+
if (lease && observedHash === before) {
|
|
469
|
+
try {
|
|
470
|
+
await this.checkAuthority(identity, lease);
|
|
471
|
+
receipt.authority = 'current';
|
|
472
|
+
receipt.verification = 'passed';
|
|
473
|
+
}
|
|
474
|
+
catch {
|
|
475
|
+
receipt.authority = 'stale';
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return { content, hash: observedHash };
|
|
479
|
+
}
|
|
356
480
|
const disposable = await this.disposable(identity, actual);
|
|
357
481
|
const database = before !== null && (/\.(?:db|sqlite3?)(?:-(?:wal|shm|journal))?$/iu.test(actual) || (await readFile(actual)).subarray(0, 16).equals(Buffer.from('SQLite format 3\0')));
|
|
358
482
|
if (!disposable && (!within(identity.repositoryRoot, actual) || name === 'kioku_remove' || database))
|
|
@@ -360,8 +484,11 @@ export class OwnedExecutionService {
|
|
|
360
484
|
signal.throwIfAborted();
|
|
361
485
|
if (await this.snapshot(actual) !== before)
|
|
362
486
|
throw new Error('File changed during operation approval');
|
|
363
|
-
|
|
487
|
+
const protocol = await this.host.runtime.withDatabase(db => reserveProtocolFile(db, lease, receipt.operationId, name, actual, this.#operations.get(receipt.operationId).digest));
|
|
488
|
+
if (name === 'kioku_remove') {
|
|
489
|
+
await this.checkAuthority(identity, lease);
|
|
364
490
|
await rm(actual, { recursive: false, force: false });
|
|
491
|
+
}
|
|
365
492
|
else {
|
|
366
493
|
const existing = before === null ? '' : await readFile(actual, 'utf8');
|
|
367
494
|
let content = input.content;
|
|
@@ -372,30 +499,61 @@ export class OwnedExecutionService {
|
|
|
372
499
|
}
|
|
373
500
|
if (content === undefined)
|
|
374
501
|
throw new Error('Write content is required');
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
502
|
+
if (protocol && Buffer.byteLength(content) > 8 * 1024 * 1024)
|
|
503
|
+
throw new Error('Protocol file byte limit');
|
|
504
|
+
if (protocol) {
|
|
505
|
+
// Existing parents were bound at enrollment. Stage and commit inside the same final
|
|
506
|
+
// synchronous authority boundary; cancellation committed before it prevents all writes.
|
|
507
|
+
await this.host.runtime.withDatabase(db => applyProtocolFile(db, lease, receipt.operationId, signal, () => {
|
|
508
|
+
const mode = before === null ? 0o644 : statSync(actual).mode & 0o7777;
|
|
509
|
+
const temporary = path.join(path.dirname(actual), `.kioku-${randomUUID()}.tmp`);
|
|
510
|
+
try {
|
|
511
|
+
const file = openSync(temporary, 'wx', mode);
|
|
512
|
+
try {
|
|
513
|
+
fchmodSync(file, mode);
|
|
514
|
+
writeFileSync(file, content);
|
|
515
|
+
fsyncSync(file);
|
|
516
|
+
}
|
|
517
|
+
finally {
|
|
518
|
+
closeSync(file);
|
|
519
|
+
}
|
|
520
|
+
renameSync(temporary, actual);
|
|
521
|
+
}
|
|
522
|
+
finally {
|
|
523
|
+
rmSync(temporary, { force: true });
|
|
524
|
+
}
|
|
525
|
+
}));
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
await this.checkAuthority(identity, lease);
|
|
529
|
+
await mkdir(path.dirname(actual), { recursive: true });
|
|
530
|
+
const mode = before === null ? 0o644 : (await stat(actual)).mode;
|
|
531
|
+
const temporary = path.join(path.dirname(actual), `.kioku-${randomUUID()}.tmp`);
|
|
380
532
|
try {
|
|
381
|
-
await
|
|
382
|
-
|
|
383
|
-
|
|
533
|
+
const file = await open(temporary, 'wx', mode);
|
|
534
|
+
try {
|
|
535
|
+
await file.chmod(mode & 0o7777);
|
|
536
|
+
await file.writeFile(content);
|
|
537
|
+
await file.sync();
|
|
538
|
+
}
|
|
539
|
+
finally {
|
|
540
|
+
await file.close();
|
|
541
|
+
}
|
|
542
|
+
signal.throwIfAborted();
|
|
543
|
+
await this.checkAuthority(identity, lease);
|
|
544
|
+
await rename(temporary, actual);
|
|
384
545
|
}
|
|
385
546
|
finally {
|
|
386
|
-
await
|
|
547
|
+
await rm(temporary, { force: true });
|
|
387
548
|
}
|
|
388
|
-
signal.throwIfAborted();
|
|
389
|
-
await rename(temporary, actual);
|
|
390
|
-
}
|
|
391
|
-
finally {
|
|
392
|
-
await rm(temporary, { force: true });
|
|
393
549
|
}
|
|
394
550
|
if (await this.snapshot(actual) !== hash(content))
|
|
395
551
|
throw new Error('Written content differs from requested content');
|
|
396
552
|
}
|
|
397
553
|
receipt.targets[0].after = await this.snapshot(actual);
|
|
554
|
+
await this.checkAuthority(identity, lease);
|
|
398
555
|
receipt.verification = 'passed';
|
|
556
|
+
receipt.authority = 'current';
|
|
399
557
|
return { applied: true };
|
|
400
558
|
}
|
|
401
559
|
async disposable(identity, target) {
|
|
@@ -403,50 +561,78 @@ export class OwnedExecutionService {
|
|
|
403
561
|
return /^(?:dist|build|target|node_modules)(?:[/\\]|$)/u.test(path.relative(identity.repositoryRoot, target));
|
|
404
562
|
return within(await realpath(tmpdir()), target);
|
|
405
563
|
}
|
|
406
|
-
async command(identity, receipt, input, signal) {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
564
|
+
async command(identity, receipt, input, signal, lease) {
|
|
565
|
+
let launchAttempted = false;
|
|
566
|
+
try {
|
|
567
|
+
receipt.cwd = await realpath(path.resolve(identity.repositoryRoot, input.cwd ?? '.'));
|
|
568
|
+
receipt.command = safeText(input.command);
|
|
569
|
+
receipt.commandDigest = hash(input.command);
|
|
570
|
+
await this.persist(receipt, this.#operations.get(receipt.operationId).digest);
|
|
571
|
+
// Known destructive intent gets a concrete review. Unknown arbitrary code
|
|
572
|
+
// is executed without pretending that static analysis can prove its effects.
|
|
573
|
+
const argv = shellArguments(input.command);
|
|
574
|
+
const removals = argv && path.basename(argv[0] ?? '') === 'rm' ? argv.slice(1).filter(arg => arg !== '--' && !arg.startsWith('-')) : undefined;
|
|
575
|
+
const disposableRemoval = removals?.length && (await Promise.all(removals.map(async (target) => {
|
|
576
|
+
const absolute = path.resolve(receipt.cwd, target);
|
|
577
|
+
try {
|
|
578
|
+
return this.disposable(identity, await realpath(absolute));
|
|
579
|
+
}
|
|
580
|
+
catch {
|
|
581
|
+
return false;
|
|
582
|
+
}
|
|
583
|
+
}))).every(Boolean);
|
|
584
|
+
let durableSql = !!(argv && ['sqlite3', 'psql', 'mysql'].includes(path.basename(argv[0] ?? '')) && /\b(?:insert|update|delete|replace|drop|alter|truncate|create)\b/iu.test(argv.slice(1).join(' ')));
|
|
585
|
+
if (durableSql && path.basename(argv[0]) === 'sqlite3' && argv[1] && !argv[1].startsWith('-')) {
|
|
586
|
+
const database = path.resolve(receipt.cwd, argv[1]);
|
|
587
|
+
durableSql = argv[1] !== ':memory:' && await this.snapshot(database) !== null && !await this.disposable(identity, database);
|
|
422
588
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
receipt.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
589
|
+
if (input.destructiveTargets?.length || durableSql || removals?.length && !disposableRemoval || !disposableRemoval && /(?:^|[;&|]\s*)(?:rm\s|git\s+(?:reset\s+--hard|clean\s+-[a-z]*f)|(?:drop\s+(?:table|database)|truncate\s+table)\b)/iu.test(input.command))
|
|
590
|
+
await this.approve(identity, `Command: ${safeText(input.command)}\nCwd: ${receipt.cwd}\nTargets: ${input.destructiveTargets?.join(', ') ?? 'see command'}`, signal);
|
|
591
|
+
const protocol = await this.host.runtime.withDatabase(db => reserveProtocolTest(db, lease, receipt.operationId, input.command, receipt.cwd));
|
|
592
|
+
return await this.evidence(identity, receipt, input.command, lease, async () => {
|
|
593
|
+
signal.throwIfAborted();
|
|
594
|
+
await this.checkAuthority(identity, lease);
|
|
595
|
+
launchAttempted = true;
|
|
596
|
+
const result = protocol
|
|
597
|
+
? await this.host.runtime.withDatabase(db => { const current = authorizeProtocolTest(db, lease, receipt.operationId, signal); return runProtocolTests(current, receipt.operationId, signal, input.timeoutMs, () => { receipt.processStarted = true; }, launch => withProtocolEffect(db, () => { authorizeProtocolTest(db, lease, receipt.operationId, signal); return launch(); })); })
|
|
598
|
+
: await runOwnedProcess(input.command, receipt.cwd, input.shell, signal, input.timeoutMs, () => { receipt.processStarted = true; });
|
|
599
|
+
if (protocol)
|
|
600
|
+
retainProtocolResult(receipt, result);
|
|
601
|
+
const output = result.content[0].text;
|
|
602
|
+
receipt.exitCode = result.value.exitCode;
|
|
603
|
+
receipt.signal = result.value.signal;
|
|
604
|
+
receipt.cancelled = result.value.aborted;
|
|
605
|
+
receipt.timedOut = result.value.timedOut;
|
|
606
|
+
receipt.processStarted = result.value.processStarted === true;
|
|
607
|
+
receipt.processStopped = result.value.processStopped === true;
|
|
608
|
+
receipt.outputComplete = result.value.outputComplete === true;
|
|
609
|
+
receipt.observedBytes = Buffer.byteLength(output);
|
|
610
|
+
receipt.outputDigest = hash(output);
|
|
611
|
+
if (protocol && protocolReceiptUncertain(receipt))
|
|
612
|
+
throw Error('Protocol launch transaction outcome is uncertain; reconcile the pending operation before explicit resume/rebind');
|
|
613
|
+
if (result.value.summary)
|
|
614
|
+
receipt.summary = result.value.summary;
|
|
615
|
+
receipt.verification = result.isError ? 'failed' : 'unknown';
|
|
616
|
+
const preview = safeText(output).slice(-24000);
|
|
617
|
+
receipt.displayedBytes = Buffer.byteLength(preview);
|
|
618
|
+
// Evidence consumes the full output here, before the public preview.
|
|
619
|
+
return result;
|
|
620
|
+
}).then(result => ({ exitCode: receipt.exitCode, output: safeText(result.content[0].text).slice(-24000) }));
|
|
621
|
+
}
|
|
622
|
+
catch (error) {
|
|
623
|
+
// Before the only launch boundary, cancellation proves that no child ran.
|
|
624
|
+
// Once launch was attempted, preserve unknown outcomes and reconcile them.
|
|
625
|
+
if (!signal.aborted || launchAttempted)
|
|
626
|
+
throw error;
|
|
627
|
+
receipt.processStarted = false;
|
|
628
|
+
receipt.processStopped = true;
|
|
629
|
+
receipt.cancelled = true;
|
|
630
|
+
receipt.exitCode = null;
|
|
631
|
+
receipt.signal = null;
|
|
632
|
+
receipt.outputComplete = false;
|
|
633
|
+
receipt.verification = 'failed';
|
|
634
|
+
return { exitCode: null, output: '' };
|
|
635
|
+
}
|
|
450
636
|
}
|
|
451
637
|
async result(identity, input) {
|
|
452
638
|
const operation = this.#operations.get(input.operationId);
|
|
@@ -470,13 +656,24 @@ export class OwnedExecutionService {
|
|
|
470
656
|
await this.persist(receipt, journal.digest);
|
|
471
657
|
return this.reply(receipt.state === 'started' ? { ...receipt, state: 'unknown', error: 'Host restarted before final process result was saved; effects will not be replayed.' } : receipt);
|
|
472
658
|
}
|
|
473
|
-
async
|
|
474
|
-
|
|
659
|
+
async stopTask(identity, signal) {
|
|
660
|
+
const operations = [...this.#operations.values()].filter(op => op.receipt.runId === identity.taskId && op.receipt.repositoryRoot === identity.repositoryRoot);
|
|
661
|
+
for (const operation of operations)
|
|
662
|
+
operation.controller.abort();
|
|
663
|
+
await Promise.allSettled(operations.map(operation => operation.done));
|
|
664
|
+
signal?.throwIfAborted();
|
|
665
|
+
}
|
|
666
|
+
async close() {
|
|
667
|
+
for (const op of this.#operations.values())
|
|
668
|
+
op.controller.abort();
|
|
669
|
+
await Promise.allSettled([...this.#operations.values()].map(op => op.done));
|
|
670
|
+
runtimeServices.get(this.host.runtime)?.delete(this);
|
|
671
|
+
}
|
|
475
672
|
}
|
|
476
673
|
/** Normal user environment, process group cancellation, bounded complete output. */
|
|
477
674
|
export function runOwnedProcess(command, cwd, shell, signal, timeoutMs, onStarted) {
|
|
478
675
|
if (signal.aborted)
|
|
479
|
-
return Promise.resolve(observeProcessResult({ isError: true, value: { exitCode: null, signal: null, timedOut: false, aborted: true, processStarted: false, outputComplete: false }, content: [{ type: 'text', text: '' }] }));
|
|
676
|
+
return Promise.resolve(observeProcessResult({ isError: true, value: { exitCode: null, signal: null, timedOut: false, aborted: true, processStarted: false, processStopped: true, outputComplete: false }, content: [{ type: 'text', text: '' }] }));
|
|
480
677
|
return new Promise(resolve => {
|
|
481
678
|
const env = { ...process.env };
|
|
482
679
|
delete env.NODE_TEST_CONTEXT;
|
|
@@ -519,12 +716,14 @@ export function runOwnedProcess(command, cwd, shell, signal, timeoutMs, onStarte
|
|
|
519
716
|
clearTimeout(timer);
|
|
520
717
|
signal.removeEventListener('abort', abort);
|
|
521
718
|
const output = Buffer.concat(chunks).toString('utf8') + (error ? `\n${error}` : '');
|
|
719
|
+
let processStopped = false;
|
|
522
720
|
try {
|
|
523
721
|
const reported = terminal.trim().split('\n').map(line => JSON.parse(line)).find(item => item.kind === 'completed' || item.kind === undefined);
|
|
524
|
-
if (!reported)
|
|
722
|
+
if (!reported || reported.processStarted !== true || !(reported.exitCode === null || Number.isInteger(reported.exitCode)) || !(reported.signal === null || typeof reported.signal === 'string'))
|
|
525
723
|
throw new Error('Missing completion');
|
|
526
724
|
exitCode = reported.exitCode;
|
|
527
725
|
termSignal = reported.signal;
|
|
726
|
+
processStopped = true;
|
|
528
727
|
}
|
|
529
728
|
catch {
|
|
530
729
|
error ||= 'Missing final process report';
|
|
@@ -532,7 +731,7 @@ export function runOwnedProcess(command, cwd, shell, signal, timeoutMs, onStarte
|
|
|
532
731
|
const outputComplete = !capped && !error && !timedOut && !signal.aborted && !termSignal;
|
|
533
732
|
const summary = outputComplete ? parseTestSummary(output, true) : undefined;
|
|
534
733
|
resolve(observeProcessResult({ isError: exitCode !== 0 || !!termSignal || timedOut || signal.aborted || capped || !!error,
|
|
535
|
-
value: { exitCode, signal: termSignal, timedOut, aborted: signal.aborted, processStarted, outputComplete, ...(summary ? { summary } : {}) }, content: [{ type: 'text', text: output }] }));
|
|
734
|
+
value: { exitCode, signal: termSignal, timedOut, aborted: signal.aborted, processStarted, processStopped, outputComplete, ...(summary ? { summary } : {}) }, content: [{ type: 'text', text: output }] }));
|
|
536
735
|
});
|
|
537
736
|
});
|
|
538
737
|
}
|
|
@@ -547,12 +746,37 @@ export function mountOwnedExecution(ctx, host) {
|
|
|
547
746
|
parameters: JSON.parse(JSON.stringify(z.toJSONSchema(name === 'kioku_exec' ? commandInput : name === 'kioku_result' ? resultInput : fileInput))),
|
|
548
747
|
output: { schema: {}, render: (_, value) => [{ type: 'text', text: JSON.stringify(value) }] }, execute }));
|
|
549
748
|
}
|
|
550
|
-
if (ctx.on
|
|
551
|
-
disposers.push(ctx.on('tools/pre-execute', (execution, next) => {
|
|
552
|
-
if (implementations.has(ctx.tools.get(execution.name, execution.agent)?.execute))
|
|
749
|
+
if (ctx.on)
|
|
750
|
+
disposers.push(ctx.on('tools/pre-execute', async (execution, next) => {
|
|
751
|
+
if (implementations.has(ctx.tools.get?.(execution.name, execution.agent)?.execute))
|
|
553
752
|
ownedCalls.add(execution);
|
|
554
|
-
|
|
753
|
+
const effect = taskEffectTool(execution.name, execution.arguments) && host.isTaskControl?.(execution) !== true;
|
|
754
|
+
// Pin an admitted owner before an approval can await a human. On-demand
|
|
755
|
+
// admission without a task is allowed to finish before the first capture.
|
|
756
|
+
if (effect && host.resolve(execution))
|
|
757
|
+
await service.captureAuthority(execution);
|
|
758
|
+
const decision = await next();
|
|
759
|
+
if (decision?.kind === 'deny')
|
|
760
|
+
return decision;
|
|
761
|
+
if (effect && host.isTaskControl?.(execution) !== true && host.unownedNative?.(execution) !== true)
|
|
762
|
+
await service.captureAuthority(execution);
|
|
763
|
+
return decision;
|
|
555
764
|
}, { prepend: true }));
|
|
765
|
+
if (ctx.on)
|
|
766
|
+
disposers.push(ctx.on('tools/execute', async (execution, next) => {
|
|
767
|
+
if (host.isTaskControl?.(execution) === true)
|
|
768
|
+
return next();
|
|
769
|
+
if (execution.name === 'bash' && host.unownedNative?.(execution) === true)
|
|
770
|
+
return withNoTaskAuthority(next);
|
|
771
|
+
if (execution.name === 'run_code')
|
|
772
|
+
return service.composite(execution, next);
|
|
773
|
+
if (!taskEffectTool(execution.name, execution.arguments))
|
|
774
|
+
return next();
|
|
775
|
+
const lease = await service.captureAuthority(execution);
|
|
776
|
+
await host.runtime.withDatabase(db => assertProtocolRoute(db, lease, execution.name, isOwnedExecutionCall(execution)));
|
|
777
|
+
execution.signal.throwIfAborted();
|
|
778
|
+
return withTaskAuthority(lease, next);
|
|
779
|
+
}));
|
|
556
780
|
if (ctx.on)
|
|
557
781
|
disposers.push(ctx.on('tools/pre-execute', async (execution, next) => {
|
|
558
782
|
if (['lisp_eval', 'lisp_call', 'lisp_define', 'lisp_hot_install', 'lisp_hot_call'].includes(execution.name))
|