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,11 +1,9 @@
|
|
|
1
|
+
import { isNativeSubagent } from '../native-subagent.js';
|
|
1
2
|
import { policyState } from '../host-adapter/turn-state.js';
|
|
2
|
-
import { bindMemoryApplication, memoryRetrievalStatus } from '../../memory/application.js';
|
|
3
|
-
import { createMemoryReuseRuntime } from '../memory-reuse.js';
|
|
4
3
|
import { dshTurnRequestId } from '../intake-profile-resolver.js';
|
|
5
4
|
import { classifyTaskForIntake, selectInstalledSkills } from '../decisions/workflows.js';
|
|
6
|
-
import { classifyRequestIntent, createRequestIntentContext, rebindRequestIntentDecision, requestIntentMessageRefs, requestIntentReferenceIds, requestIntentTaskType } from '../decisions/request-intent.js';
|
|
5
|
+
import { classifyRequestIntent, createRequestIntentContext, rebindRequestIntentDecision, requestIntentMessageRefs, requestIntentReferenceIds, requestIntentTaskType, requestIntentIsUnresolved } from '../decisions/request-intent.js';
|
|
7
6
|
import { ANSWER_REVIEW_FORM, hasHumanInput } from '../answer-review/contracts.js';
|
|
8
|
-
import { refreshContinuedTaskContext } from '../task-intake.js';
|
|
9
7
|
import { saveSessionNotice } from '../plugin-records.js';
|
|
10
8
|
import { explicitExecutionMode, initializeExecutionSelection, readExecutionSelection, writeExecutionSelection } from '../execution-selection.js';
|
|
11
9
|
import { getHeadWorkerForSession } from '../models/session-selection.js';
|
|
@@ -16,8 +14,8 @@ import { withImmediateTransaction } from '../../db/transaction.js';
|
|
|
16
14
|
import { DshIntakeGate } from '../intake-gate.js';
|
|
17
15
|
import { resolveGroundedIntakeProfile } from '../intake-profile-resolver.js';
|
|
18
16
|
import { deriveAkinatorReasoning } from '../../akinator/reasoning.js';
|
|
19
|
-
import { resolveCapabilities } from '../../akinator/capabilities.js';
|
|
20
|
-
import { readAkinatorSession
|
|
17
|
+
import { resolveCapabilities, hasBlockingRequiredCapability } from '../../akinator/capabilities.js';
|
|
18
|
+
import { readAkinatorSession } from '../../akinator/store.js';
|
|
21
19
|
import { dshTurnBoundarySeq } from '../session-memory-finalizer.js';
|
|
22
20
|
import { createDshIntakeAnswerer } from '../user-interaction.js';
|
|
23
21
|
import { canonicalContentHash } from '../../serialization/validate.js';
|
|
@@ -33,9 +31,16 @@ import { resetLoopGuardForUserInTransaction } from '../loop-guard.js';
|
|
|
33
31
|
import { readCodingWorkflow } from '../coding-workflow/store.js';
|
|
34
32
|
import { markCodingScopeChange } from '../coding-workflow/service.js';
|
|
35
33
|
import { readExecutionFrame } from '../execution-frame.js';
|
|
36
|
-
import {
|
|
34
|
+
import { createMemoryOwner, memoryOwnerKind } from '../memory-owner.js';
|
|
37
35
|
import { findSecret } from '../../memory/secrets.js';
|
|
38
36
|
import { executionClarification, isContinuationReference } from '../intake-clarification.js';
|
|
37
|
+
import { authorizeTaskLease, bindTaskRepository, captureTaskLease, clearTaskUnresolved, findSessionTask, readTaskSnapshot, recordTaskUnresolved, taskCanExecute } from '../task-state.js';
|
|
38
|
+
import { continueTaskIntake } from '../existing-task-intake.js';
|
|
39
|
+
import { LedgerStore } from '../../ledger/store.js';
|
|
40
|
+
import { claimExecutionOwner, readExecutionOwner } from '../orchestration/execution-owner.js';
|
|
41
|
+
import { initializeCodingWorkflow } from '../coding-workflow/store.js';
|
|
42
|
+
import { codingWorkRequested } from '../coding-workflow/intent.js';
|
|
43
|
+
import { initializeTaskCompletion } from '../task-completion.js';
|
|
39
44
|
export function createAdmission({ native, skills, tools, userQuestions, sessions, agents, deepPlanning, modelCatalog, modelCompatibility, modelRoutes, now, runtime, decisions, answerReview, delegation, executionSupport, ennoMemory, memoryFinalizer, autoReview, sessionMirror, akinatorMemoryConfig, memoryRetrievalConfig, completionMode, turnState, getSelection, setSelection, refreshEnnoMemory, executionBinding, captureInitialInput, contextMessages, resolveIdleClose, retireSupersededRun, cancelBoundarySession, isSelectionBlocked, closeTurn, readStateForRun, capabilityCatalog, sessionEventSource, objectRecord, isHumanMessage, textFromMessages, pluginContinuationId, isLoopRecoveryMessage, }) {
|
|
40
45
|
const currentSession = turnState.currentSession;
|
|
41
46
|
const currentForAgentEvent = turnState.currentForAgentEvent;
|
|
@@ -65,25 +70,35 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
65
70
|
const continuedTurns = new Map();
|
|
66
71
|
const resumedTurns = new Map();
|
|
67
72
|
const bindAndRecord = async (event, result, generation) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const authority = await runtime.withDatabase(database => {
|
|
74
|
+
const identity = { taskId: result.prepared.run.runId, sessionId: event.sessionId,
|
|
75
|
+
repositoryRoot: result.prepared.project.repositoryRoot };
|
|
76
|
+
bindTaskRepository(database, identity);
|
|
77
|
+
if (event.signal.aborted)
|
|
78
|
+
return undefined;
|
|
79
|
+
// A continued native turn can reuse an already Working task without a
|
|
80
|
+
// fresh admission. Capture its current lease from SQLite as well; never
|
|
81
|
+
// synthesize authority from the model or a cached turn record.
|
|
82
|
+
try {
|
|
83
|
+
return captureTaskLease(database, identity);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if (result.admitted)
|
|
87
|
+
throw error;
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
76
90
|
});
|
|
77
|
-
|
|
91
|
+
if (authority)
|
|
92
|
+
await runtime.withDatabase(database => authorizeTaskLease(database, authority));
|
|
93
|
+
turnState.record(event, result, generation, authority);
|
|
78
94
|
const reviewItem = currentSession(event.sessionId);
|
|
79
95
|
const reviewAgent = event.nativeAgent;
|
|
80
96
|
if (reviewItem && reviewAgent?.session && typeof reviewAgent.session.snapshotEvents === 'function') {
|
|
81
97
|
const eligible = () => {
|
|
82
98
|
const item = currentSession(event.sessionId), selection = getSelection(reviewItem.runId)?.value;
|
|
83
|
-
const header = reviewAgent.session.header;
|
|
84
99
|
return item?.runId === reviewItem.runId && !item.closed && !item.failed && item.prepared.run.status === 'active'
|
|
85
100
|
&& !item.prepared.ennoOduno.applicable && !selection?.discussion && (!selection || selection.mode === 'normal' && selection.status === 'ready')
|
|
86
|
-
&& !delegation.isChild(reviewAgent) && !deepPlanning.executor.isChild(reviewAgent) && !
|
|
101
|
+
&& !delegation.isChild(reviewAgent) && !deepPlanning.executor.isChild(reviewAgent) && !isNativeSubagent(reviewAgent)
|
|
87
102
|
&& !executionSupport.paused(event.sessionId);
|
|
88
103
|
};
|
|
89
104
|
answerReview.bind({ runId: reviewItem.runId, workspace: reviewItem.workspace, requestId: `run:${reviewItem.runId}`, task: reviewItem.task,
|
|
@@ -99,26 +114,7 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
99
114
|
},
|
|
100
115
|
});
|
|
101
116
|
}
|
|
102
|
-
|
|
103
|
-
&& result.prepared.memoryOwner?.kind === 'execution'
|
|
104
|
-
&& currentSession(event.sessionId)?.prepareGeneration === generation && !delegation.isChild(event.nativeAgent ?? {})) {
|
|
105
|
-
assertMemoryOwner(result.prepared.memoryOwner, { agentId: event.agent.id, sessionId: event.sessionId, turn: event.turn,
|
|
106
|
-
requestDigest: canonicalContentHash(event.task), runId: result.prepared.run.runId }, 'execution');
|
|
107
|
-
await runtime.withDatabase(db => {
|
|
108
|
-
if (currentSession(event.sessionId)?.prepareGeneration !== generation)
|
|
109
|
-
return;
|
|
110
|
-
bindMemoryApplication(db, {
|
|
111
|
-
runId: result.prepared.run.runId, workspace: result.prepared.project.workspace,
|
|
112
|
-
sessionId: event.sessionId, repositoryRoot: result.prepared.project.repositoryRoot,
|
|
113
|
-
}, result.prepared.intake.profile, result.prepared.context, memoryRetrievalStatus(db, result.prepared.project.workspace, result.prepared.context, result.prepared.memoryPolicy.contextWithheld));
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
if (event.nativeSession && !delegation.isChild(event.nativeAgent ?? {})) {
|
|
117
|
-
try {
|
|
118
|
-
await autoReview.bind({ workspace: result.prepared.project.workspace, runId: result.prepared.run.runId, session: event.nativeSession, startSeq: sourceStartSeq });
|
|
119
|
-
}
|
|
120
|
-
catch { /* Unsupported or unavailable review source must not veto a native request. */ }
|
|
121
|
-
}
|
|
117
|
+
// Memory delivery/binding is not an admission prerequisite.
|
|
122
118
|
};
|
|
123
119
|
async function hasPendingExecutionDiscussion(sessionId, cwd) {
|
|
124
120
|
return runtime.withDatabase(async (db) => {
|
|
@@ -234,6 +230,25 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
234
230
|
// context deliveries that finish out of order.
|
|
235
231
|
const generation = ++prepareGeneration;
|
|
236
232
|
const prior = currentForAgentEvent(event.agent.id, event.sessionId, undefined, event.nativeSession, event.nativeAgent);
|
|
233
|
+
const canonical = event.requestIntentContext?.activeTask;
|
|
234
|
+
if (canonical && continuesCodingScope(event)) {
|
|
235
|
+
const current = await runtime.withDatabase(database => readTaskSnapshot(database, canonical));
|
|
236
|
+
if (current.revision !== canonical.revision || current.generation !== canonical.generation)
|
|
237
|
+
throw new KiokukoError('CONFLICT', 'Task continuation revision changed');
|
|
238
|
+
// An explicit resume invalidates the old in-memory preparation and memory
|
|
239
|
+
// delivery, even when the native session and logical run ID are unchanged.
|
|
240
|
+
if (!taskCanExecute(current) || prior?.runId === current.taskId && prior.authority
|
|
241
|
+
&& (prior.authority.revision !== current.revision || prior.authority.generation !== current.generation)) {
|
|
242
|
+
const refreshed = await resumeExistingRun?.(event);
|
|
243
|
+
if (!refreshed)
|
|
244
|
+
throw new KiokukoError('CONFLICT', 'Current task could not be resumed');
|
|
245
|
+
continuedTurns.delete(`${event.sessionId}\u0000${event.turn}`);
|
|
246
|
+
resumedTurns.delete(`${event.sessionId}\u0000${event.turn}`);
|
|
247
|
+
const selected = refreshed.admitted ? await this.choose(event, refreshed) : refreshed;
|
|
248
|
+
await bindAndRecord(event, selected, generation);
|
|
249
|
+
return selected;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
237
252
|
if (prior && prior.turn === event.turn && !prior.closed && prior.task !== event.task && hasHumanInput(event.nativeMessages ?? [])
|
|
238
253
|
&& event.requestIntent?.relation === 'new') {
|
|
239
254
|
const choice = getSelection(prior.runId);
|
|
@@ -408,37 +423,8 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
408
423
|
const next = policyState(refreshedWork.state, previous, previous.sessionId, refreshedWork.lease);
|
|
409
424
|
turnState.applyPolicy(previous.runId, next);
|
|
410
425
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
continuedMemory = { context: null,
|
|
414
|
-
memoryPolicy: { memoryReasoningRequired: false, contextWithheld: false, withheldReason: null, deliveryEmpty: true } };
|
|
415
|
-
else if (!ennoMemory.ownsActiveRefresh(previous.prepared.ennoOduno)) {
|
|
416
|
-
const captured = previous.prepared, started = performance.now();
|
|
417
|
-
const inboxIdentity = () => canonicalContentHash([...(event.nativeAgent?.inbox?.nextStep ?? []), ...(event.nativeAgent?.inbox?.nextTurn ?? [])].filter(isHumanMessage));
|
|
418
|
-
const pendingInput = inboxIdentity();
|
|
419
|
-
const assertCurrent = () => {
|
|
420
|
-
event.signal.throwIfAborted();
|
|
421
|
-
if (inboxIdentity() !== pendingInput || previous.closed || previous.prepared !== captured || currentSession(event.sessionId) !== previous || prepareGeneration !== generation)
|
|
422
|
-
throw new KiokukoError('CONFLICT', 'continued_memory_stale');
|
|
423
|
-
if (event.nativeSession !== previous.nativeSession || event.nativeAgent !== previous.nativeAgent)
|
|
424
|
-
throw new KiokukoError('CONFLICT', 'continued_memory_owner_changed');
|
|
425
|
-
if (performance.now() - started > 1000 + (decisions.memoryReuse.mode === 'auto' ? decisions.memoryReuse.budgetMs : 0))
|
|
426
|
-
throw new Error('continued_memory_deadline');
|
|
427
|
-
};
|
|
428
|
-
try {
|
|
429
|
-
continuedMemory = await runtime.withDatabase(async (database, embedding) => {
|
|
430
|
-
if (embedding.mode === 'required')
|
|
431
|
-
throw new Error('required_embedding_unavailable');
|
|
432
|
-
return refreshContinuedTaskContext({ database, memoryReuse: await createMemoryReuseRuntime(decisions, `run:${captured.run.runId}`, event.signal), memoryRetrieval: memoryRetrievalConfig, prepared: captured, task: event.task, capabilities: [...event.capabilities.skills, ...event.capabilities.tools], assertCurrent,
|
|
433
|
-
validateCapabilities: async () => { const fresh = await capabilityCatalog(skills, tools, { agent: event.agent, ...(event.nativeAgent ? { nativeAgent: event.nativeAgent } : {}), cwd: event.cwd, signal: event.signal }); this.assertCatalog(event.capabilities, fresh); assertCurrent(); } });
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
catch (error) {
|
|
437
|
-
if (event.signal.aborted || error instanceof KiokukoError && ['CONFLICT', 'SECURITY_REJECTION', 'AUTHENTICATION_ERROR', 'INTEGRITY_ERROR'].includes(error.code))
|
|
438
|
-
throw error;
|
|
439
|
-
/* Optional retrieval failure retains the previous delivery, whose state is validated before injection. */
|
|
440
|
-
}
|
|
441
|
-
}
|
|
426
|
+
const continuedMemory = { context: null,
|
|
427
|
+
memoryPolicy: { memoryReasoningRequired: false, contextWithheld: false, withheldReason: null, deliveryEmpty: true } };
|
|
442
428
|
const ownerKind = event.memoryOwner ?? memoryOwnerKind(intent, event.profileHints?.taskType ?? previous.prepared.intake.profile.taskType);
|
|
443
429
|
const continuedPrepared = { ...previous.prepared, ...(continuedMemory ?? {}),
|
|
444
430
|
memoryOwner: createMemoryOwner(ownerKind, { agentId: event.agent.id, sessionId: event.sessionId, turn: event.turn,
|
|
@@ -634,74 +620,44 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
634
620
|
}
|
|
635
621
|
const gate = new CapturingGate(runtime, userQuestions === undefined ? undefined : createDshIntakeAnswerer(userQuestions), (context) => capabilityCatalog(skills, tools, context), true, akinatorMemoryConfig, decisions, completionMode, memoryRetrievalConfig);
|
|
636
622
|
const refreshMemoryOwner = async (item, signal) => {
|
|
637
|
-
const prepared = item.prepared;
|
|
638
|
-
const owner = prepared.memoryOwner;
|
|
639
|
-
if (!owner || owner.kind !== 'execution')
|
|
640
|
-
throw new KiokukoError('CONFLICT', 'memory_owner_unavailable');
|
|
641
|
-
const ownerIdentity = { agentId: item.agentId, sessionId: item.sessionId, turn: item.turn,
|
|
642
|
-
requestDigest: canonicalContentHash(item.task), runId: item.runId };
|
|
643
|
-
assertMemoryOwner(owner, ownerIdentity, 'execution');
|
|
644
|
-
const started = performance.now();
|
|
645
|
-
const refreshed = await runtime.withDatabase(async (database, embedding) => {
|
|
646
|
-
const assertCurrent = () => {
|
|
647
|
-
signal.throwIfAborted();
|
|
648
|
-
if (currentSession(item.sessionId) !== item || item.prepared !== prepared || item.closed || item.failed
|
|
649
|
-
|| item.nativeAgent === undefined || agents?.get(item.nativeAgent.id) !== item.nativeAgent
|
|
650
|
-
|| item.nativeSession === undefined || sessions?.get(item.sessionId) !== item.nativeSession) {
|
|
651
|
-
throw new KiokukoError('CONFLICT', 'memory_owner_changed');
|
|
652
|
-
}
|
|
653
|
-
assertMemoryOwner(owner, ownerIdentity, 'execution');
|
|
654
|
-
if (performance.now() - started > 1000 + (decisions.memoryReuse.mode === 'auto' ? decisions.memoryReuse.budgetMs : 0)) {
|
|
655
|
-
throw new KiokukoError('CONFLICT', 'memory_owner_rebuild_deadline');
|
|
656
|
-
}
|
|
657
|
-
};
|
|
658
|
-
if (embedding.mode === 'required')
|
|
659
|
-
throw new KiokukoError('SERVICE_UNAVAILABLE', 'required_embedding_unavailable');
|
|
660
|
-
const capabilities = [...item.catalog.skills, ...item.catalog.tools];
|
|
661
|
-
const memoryReuse = await createMemoryReuseRuntime(decisions, `run:${item.runId}`, signal);
|
|
662
|
-
return refreshContinuedTaskContext({ database, memoryReuse, memoryRetrieval: memoryRetrievalConfig, prepared,
|
|
663
|
-
task: item.memoryInput ?? item.task, capabilities, assertCurrent,
|
|
664
|
-
validateCapabilities: async () => {
|
|
665
|
-
const fresh = await capabilityCatalog(skills, tools, { agent: { id: item.agentId },
|
|
666
|
-
...(item.nativeAgent ? { nativeAgent: item.nativeAgent } : {}), cwd: item.cwd, signal });
|
|
667
|
-
gate.assertCatalog(item.catalog, fresh);
|
|
668
|
-
assertCurrent();
|
|
669
|
-
} });
|
|
670
|
-
});
|
|
671
623
|
signal.throwIfAborted();
|
|
672
|
-
|
|
673
|
-
throw new KiokukoError('CONFLICT', 'memory_owner_changed');
|
|
674
|
-
item.prepared = { ...prepared, ...refreshed };
|
|
675
|
-
await runtime.withDatabase(database => bindMemoryApplication(database, {
|
|
676
|
-
runId: item.runId, workspace: item.workspace, sessionId: item.sessionId, repositoryRoot: item.repositoryRoot,
|
|
677
|
-
}, item.prepared.intake.profile, item.prepared.context, memoryRetrievalStatus(database, item.workspace, item.prepared.context, item.prepared.memoryPolicy.contextWithheld)));
|
|
624
|
+
item.prepared = { ...item.prepared, context: null, memoryPolicy: { memoryReasoningRequired: false, contextWithheld: false, withheldReason: null, deliveryEmpty: true } };
|
|
678
625
|
};
|
|
679
626
|
resumeExistingRun = async (event) => runtime.withDatabase(async (database) => {
|
|
680
627
|
const project = await resolveProjectWorkspaceReadOnly(database, event.cwd, { allowDirectory: true });
|
|
681
628
|
if (project === undefined)
|
|
682
629
|
return undefined;
|
|
683
|
-
const
|
|
684
|
-
|
|
685
|
-
FROM ledger_runs AS lr
|
|
686
|
-
LEFT JOIN enno_contracts AS ec ON ec.run_id = lr.run_id
|
|
687
|
-
LEFT JOIN dsh_exploration_states AS es ON es.run_id = lr.run_id
|
|
688
|
-
LEFT JOIN dsh_execution_selections AS xs ON xs.run_id = lr.run_id
|
|
689
|
-
LEFT JOIN dsh_coding_workflows AS cw ON cw.run_id = lr.run_id
|
|
690
|
-
WHERE lr.workspace = ? AND lr.dsh_session_id = ? AND lr.status = 'active'
|
|
691
|
-
AND ((ec.repository_root = ? AND ec.status NOT IN ('completed', 'cancelled', 'blocked'))
|
|
692
|
-
OR (ec.run_id IS NULL AND (json_extract(es.state_json, '$.paused') = 1 OR xs.run_id IS NOT NULL)))
|
|
693
|
-
AND (cw.run_id IS NULL OR (? = 1 AND json_extract(cw.snapshot_json, '$.state') NOT IN ('completed', 'cancelled', 'superseded')))
|
|
694
|
-
ORDER BY lr.created_at, lr.run_id LIMIT 2
|
|
695
|
-
`).all(project.workspace, event.sessionId, project.repositoryRoot, continuesCodingScope(event) ? 1 : 0);
|
|
696
|
-
if (candidates.length === 0)
|
|
630
|
+
const task = findSessionTask(database, { sessionId: event.sessionId, repositoryRoot: project.repositoryRoot });
|
|
631
|
+
if (!task)
|
|
697
632
|
return undefined;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
633
|
+
const context = event.requestIntentContext;
|
|
634
|
+
if (hasHumanInput(event.nativeMessages ?? [])) {
|
|
635
|
+
if (!event.requestIntent || !context || !rebindRequestIntentDecision(event.requestIntent, context))
|
|
636
|
+
throw new KiokukoError('CONFLICT', 'A source-bound interpretation is required for the current task');
|
|
637
|
+
if (event.requestIntent.relation === 'new')
|
|
638
|
+
return undefined;
|
|
639
|
+
if (!continuesCodingScope(event) || context.activeTask?.taskId !== task.taskId
|
|
640
|
+
|| context.activeTask.revision !== task.revision || context.activeTask.generation !== task.generation)
|
|
641
|
+
throw new KiokukoError('CONFLICT', 'The current task continuation is unresolved or stale');
|
|
642
|
+
}
|
|
643
|
+
const runId = task.taskId;
|
|
644
|
+
const run = new LedgerStore(database).readRun(runId);
|
|
645
|
+
const selection = readExecutionSelection(database, runId)?.value;
|
|
646
|
+
if (selection?.mode === 'deep-thinker')
|
|
647
|
+
throw new KiokukoError('CONFLICT', 'Deep Thinker recovery requires its own execution lane');
|
|
648
|
+
// Pending selection still goes through choose(); only an explicit persisted
|
|
649
|
+
// Enno selection can recover Enno ownership instead of ordinary execution.
|
|
650
|
+
const executionMode = selection?.mode === 'enno' ? 'enno' : 'normal';
|
|
651
|
+
const owner = readExecutionOwner(database, event.sessionId);
|
|
652
|
+
if (owner && (owner.run_id !== runId || owner.workspace !== project.workspace || owner.mode !== executionMode))
|
|
653
|
+
throw new KiokukoError('CONFLICT', 'Task execution owner changed');
|
|
654
|
+
const orchestration = database.prepare('SELECT orchestration_session_id AS id FROM enno_contracts WHERE run_id=?')
|
|
655
|
+
.get(runId);
|
|
656
|
+
const snapshot = !orchestration ? undefined : readEnnoSnapshot(database, {
|
|
657
|
+
runId, workspace: project.workspace, orchestrationId: orchestration.id,
|
|
704
658
|
});
|
|
659
|
+
if (executionMode === 'enno' && !snapshot)
|
|
660
|
+
throw new KiokukoError('CONFLICT', 'Persisted Enno selection has no matching execution contract');
|
|
705
661
|
if (snapshot && !event.signal.aborted && supersedesUnstartedEnno(event, stateForSnapshot(snapshot))) {
|
|
706
662
|
terminalizeLedgerRunInTransaction(database, runId, 'cancelled');
|
|
707
663
|
return undefined;
|
|
@@ -725,11 +681,15 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
725
681
|
if (decision && (!decision.continue || decision.runId !== runId)) {
|
|
726
682
|
throw new KiokukoError('CONFLICT', decision.warning ?? 'The active run cannot be resumed by this DSH session');
|
|
727
683
|
}
|
|
728
|
-
const intakeLink = readRunIntakeLink(database, { workspace: project.workspace, runId });
|
|
729
|
-
const intake = readAkinatorSession(database, { workspace: project.workspace, sessionId: intakeLink.sessionId });
|
|
730
|
-
if (intake.status === 'active')
|
|
731
|
-
throw new KiokukoError('INTEGRITY_ERROR', 'Resumable Enno-Oduno run has unfinished intake');
|
|
732
684
|
const capabilityEntries = [...event.capabilities.skills, ...event.capabilities.tools];
|
|
685
|
+
const { state: intakeState, link: intakeLink } = await continueTaskIntake(database, {
|
|
686
|
+
...task, workspace: project.workspace, expectedRevision: task.revision, expectedGeneration: task.generation,
|
|
687
|
+
capabilities: capabilityEntries, signal: event.signal,
|
|
688
|
+
answerer: userQuestions ? createDshIntakeAnswerer(userQuestions) : undefined,
|
|
689
|
+
agent: event.nativeAgent,
|
|
690
|
+
validateCapabilities: async () => gate.assertCatalog(event.capabilities, await capabilityCatalog(skills, tools, { agent: event.agent, ...(event.nativeAgent ? { nativeAgent: event.nativeAgent } : {}), cwd: event.cwd, signal: event.signal })),
|
|
691
|
+
});
|
|
692
|
+
const intake = intakeState.session;
|
|
733
693
|
const capabilityResolution = resolveCapabilities({
|
|
734
694
|
task: intake.task,
|
|
735
695
|
profile: intake.profile,
|
|
@@ -738,6 +698,20 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
738
698
|
memoryUse: 'none',
|
|
739
699
|
});
|
|
740
700
|
const canonicalCwd = realpathSync(event.cwd);
|
|
701
|
+
const admitted = !event.signal.aborted && intakeState.status !== 'needs_answer'
|
|
702
|
+
&& taskCanExecute(readTaskSnapshot(database, task)) && !hasBlockingRequiredCapability(capabilityResolution);
|
|
703
|
+
const runStatus = new LedgerStore(database).readRun(runId).status;
|
|
704
|
+
if (runStatus !== 'active' && runStatus !== 'intake')
|
|
705
|
+
throw new KiokukoError('CONFLICT', 'Task requires an explicit resume');
|
|
706
|
+
if (admitted) {
|
|
707
|
+
if (!owner)
|
|
708
|
+
claimExecutionOwner(database, { sessionId: event.sessionId, workspace: project.workspace,
|
|
709
|
+
mode: executionMode, startId: typeof run.metadata.requestId === 'string' ? run.metadata.requestId : `run:${runId}`, runId });
|
|
710
|
+
initializeTaskCompletion(database, runId, completionMode);
|
|
711
|
+
if (executionMode === 'normal' && !readCodingWorkflow(database, runId) && codingWorkRequested(intake.task, event.requestIntent, intake.profile.taskType))
|
|
712
|
+
initializeCodingWorkflow(database, { runId, sessionId: event.sessionId, repositoryRoot: project.repositoryRoot,
|
|
713
|
+
requestId: typeof run.metadata.requestId === 'string' ? run.metadata.requestId : `run:${runId}`, task: intake.task });
|
|
714
|
+
}
|
|
741
715
|
const prepared = {
|
|
742
716
|
memoryOwner: createMemoryOwner(event.memoryOwner ?? memoryOwnerKind(event.requestIntent, intake.profile.taskType), {
|
|
743
717
|
agentId: event.agent.id, sessionId: event.sessionId, turn: event.turn,
|
|
@@ -751,27 +725,28 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
751
725
|
pathPolicy: 'canonical_absolute_under_repository_root',
|
|
752
726
|
},
|
|
753
727
|
intake: {
|
|
754
|
-
status:
|
|
728
|
+
status: intakeState.status,
|
|
755
729
|
sessionId: intake.id,
|
|
756
730
|
profile: intake.profile,
|
|
757
|
-
question:
|
|
758
|
-
missingFields:
|
|
731
|
+
question: intakeState.question,
|
|
732
|
+
missingFields: intakeState.missingFields,
|
|
759
733
|
recommendedTags: intakeLink.recommendedTags,
|
|
760
734
|
reasoning: deriveAkinatorReasoning(intake.task, intake.profile),
|
|
761
735
|
},
|
|
762
736
|
capabilities: capabilityResolution,
|
|
763
|
-
run: { runId, status:
|
|
737
|
+
run: { runId, status: runStatus },
|
|
764
738
|
skillDiscovery: { attempted: false, mode: 'off', requirements: [], queries: [], cacheHits: 0, candidates: 0, selected: [], failures: [] },
|
|
765
739
|
context: null,
|
|
766
740
|
memoryPolicy: { memoryReasoningRequired: false, contextWithheld: false, withheldReason: null, deliveryEmpty: true },
|
|
767
741
|
warnings: capabilityResolution.warnings,
|
|
768
|
-
nextAction: 'proceed'
|
|
742
|
+
nextAction: admitted ? 'proceed' : hasBlockingRequiredCapability(capabilityResolution)
|
|
743
|
+
? 'required_capability_unavailable' : 'answer_from_evidence_or_ask_user',
|
|
769
744
|
securityNotice: 'This resumed DSH run uses only current repository evidence and the current host capability catalog; previously delivered ordinary memory is not replayed implicitly. Active ennoMemory may make a new bounded selection under current authority.',
|
|
770
745
|
ennoOduno: snapshot ? stateForSnapshot(snapshot) : inapplicableEnnoState(),
|
|
771
746
|
};
|
|
772
747
|
if (decision?.executionLease)
|
|
773
748
|
turnState.stageLease(runId, decision.executionLease);
|
|
774
|
-
return { admitted
|
|
749
|
+
return { admitted, prepared, catalog: event.capabilities };
|
|
775
750
|
});
|
|
776
751
|
const requestIntentContextFor = async (input, sessionId, nativeSession, previous, task) => {
|
|
777
752
|
const human = input.messages.filter(isHumanMessage);
|
|
@@ -782,6 +757,10 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
782
757
|
if (!cwd)
|
|
783
758
|
return undefined;
|
|
784
759
|
const messageRefs = requestIntentMessageRefs(human, task);
|
|
760
|
+
const activeTask = await runtime.withDatabase(async (database) => {
|
|
761
|
+
const project = await resolveProjectWorkspaceReadOnly(database, cwd, { allowDirectory: true });
|
|
762
|
+
return project ? findSessionTask(database, { sessionId, repositoryRoot: project.repositoryRoot }) : undefined;
|
|
763
|
+
});
|
|
785
764
|
let activeGoal;
|
|
786
765
|
let proposals = [];
|
|
787
766
|
const sameOwner = previous && previous.sessionId === sessionId && previous.nativeAgent === input.agent && previous.nativeSession === nativeSession;
|
|
@@ -794,7 +773,8 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
794
773
|
FROM ledger_runs AS lr
|
|
795
774
|
LEFT JOIN dsh_coding_workflows AS cw ON cw.run_id = lr.run_id
|
|
796
775
|
LEFT JOIN enno_contracts AS ec ON ec.run_id = lr.run_id
|
|
797
|
-
WHERE lr.workspace = ? AND lr.dsh_session_id = ? AND lr.status = 'active'
|
|
776
|
+
WHERE lr.workspace = ? AND COALESCE(lr.task_owner_session_id, lr.dsh_session_id) = ? AND lr.status = 'active'
|
|
777
|
+
AND lr.task_state NOT IN ('Done', 'Ignore')
|
|
798
778
|
AND ((json_extract(cw.snapshot_json, '$.repositoryRoot') = ?
|
|
799
779
|
AND json_extract(cw.snapshot_json, '$.sessionId') = ?
|
|
800
780
|
AND json_extract(cw.snapshot_json, '$.state') NOT IN ('completed', 'cancelled', 'superseded'))
|
|
@@ -861,7 +841,8 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
861
841
|
digest: canonicalContentHash(text), text }];
|
|
862
842
|
}
|
|
863
843
|
}
|
|
864
|
-
return createRequestIntentContext({ task, messageRefs, ...(activeGoal ? { activeGoal } : {}),
|
|
844
|
+
return createRequestIntentContext({ task, messageRefs, ...(activeGoal ? { activeGoal } : {}),
|
|
845
|
+
...(activeTask ? { activeTask } : {}), proposals: proposals.slice(0, 8) });
|
|
865
846
|
};
|
|
866
847
|
const mapPreStep = async (payload, advisoryType, suppliedIntent, interpretationOnly = false) => {
|
|
867
848
|
const nativeSession = payload.agent.session;
|
|
@@ -922,7 +903,8 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
922
903
|
if (!reviewing && hasHumanInput(payload.messages) && !delegation.isChild(payload.agent) && intentTask.trim()) {
|
|
923
904
|
requestIntentContext = await requestIntentContextFor(payload, sessionId, boundSession, activeRecord, intentTask);
|
|
924
905
|
const requestId = dshTurnRequestId({ dshSessionId: sessionId, turn: payload.turn });
|
|
925
|
-
const establishedConversation = profile?.taskType === 'chat' && !requestIntentContext?.activeGoal
|
|
906
|
+
const establishedConversation = profile?.taskType === 'chat' && !requestIntentContext?.activeGoal
|
|
907
|
+
&& (!requestIntentContext?.activeTask || requestIntentContext.activeTask.type === 'chat');
|
|
926
908
|
if (requestIntentContext && !establishedConversation) {
|
|
927
909
|
requestIntent = await classifyRequestIntent(decisions, requestId, requestIntentContext, payload.signal);
|
|
928
910
|
}
|
|
@@ -955,16 +937,33 @@ export function createAdmission({ native, skills, tools, userQuestions, sessions
|
|
|
955
937
|
requestIntent = requestIntent?.source === 'decision-provider' && requestIntent.relation !== 'unknown' && requestIntent.action !== 'unknown'
|
|
956
938
|
? { ...requestIntent, evidence: rebound.evidence } : rebound;
|
|
957
939
|
}
|
|
940
|
+
if (requestIntentContext?.activeTask && hasHumanInput(payload.messages)) {
|
|
941
|
+
const identity = requestIntentContext.activeTask;
|
|
942
|
+
const contextDigest = canonicalContentHash(requestIntentContext);
|
|
943
|
+
const requestId = dshTurnRequestId({ dshSessionId: sessionId, turn: payload.turn });
|
|
944
|
+
await runtime.withDatabase(db => {
|
|
945
|
+
if (requestIntentIsUnresolved(requestIntent))
|
|
946
|
+
return recordTaskUnresolved(db, identity, {
|
|
947
|
+
operationId: `intent:${canonicalContentHash([requestId, contextDigest, requestIntent?.unresolvedReason ?? 'request_intent_unresolved'])}`,
|
|
948
|
+
expectedRevision: identity.revision, requestId, contextDigest,
|
|
949
|
+
reason: requestIntent?.unresolvedReason ?? 'request_intent_unresolved',
|
|
950
|
+
evidence: requestIntentReferenceIds(requestIntentContext),
|
|
951
|
+
});
|
|
952
|
+
const current = readTaskSnapshot(db, identity);
|
|
953
|
+
return current.unresolved?.requestId === requestId && current.unresolved.contextDigest === contextDigest
|
|
954
|
+
? clearTaskUnresolved(db, identity, { requestId, contextDigest, expectedRevision: identity.revision }) : undefined;
|
|
955
|
+
});
|
|
956
|
+
}
|
|
958
957
|
const pendingDiscussion = isContinuationReference(intentTask)
|
|
959
958
|
&& await hasPendingExecutionDiscussion(sessionId, cwd);
|
|
960
|
-
const establishedConversation = profile?.taskType === 'chat' && !requestIntentContext?.activeGoal;
|
|
959
|
+
const establishedConversation = profile?.taskType === 'chat' && !requestIntentContext?.activeGoal && !requestIntentContext?.activeTask;
|
|
961
960
|
if (!interpretationOnly && intentTask.trim() && !pendingDiscussion && !establishedConversation) {
|
|
962
961
|
const clarification = executionClarification(intentTask, requestIntent, requestIntentContext);
|
|
963
962
|
if (clarification)
|
|
964
963
|
throw new KiokukoError('VALIDATION_ERROR', clarification);
|
|
965
964
|
}
|
|
966
965
|
const legacyTaskType = advisoryType !== undefined && advisoryType !== 'chat'
|
|
967
|
-
&& !requestIntentContext?.activeGoal && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
966
|
+
&& !requestIntentContext?.activeGoal && !requestIntentContext?.activeTask && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
968
967
|
if (requestIntent?.source === 'unresolved' && legacyTaskType)
|
|
969
968
|
requestIntent = undefined;
|
|
970
969
|
if (requestIntent?.source !== 'unresolved') {
|