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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/dsh/core/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/dsh/core/host.ts"],"names":[],"mappings":"AAWA,OAAO,EAAoC,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAa1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAA;AAmBrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAK9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAInD,OAAO,EAAc,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AACzG,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAE5E,OAAO,EAAyD,KAAK,yBAAyB,EAAoB,MAAM,+BAA+B,CAAA;AAsBvJ,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,kBAAkB,EAAE,6BAA6B,CAAA;IAC1D,QAAQ,CAAC,kBAAkB,EAAE,yBAAyB,CAAA;IACtD,QAAQ,CAAC,0BAA0B,EAAE,OAAO,2CAA2C,EAAE,oBAAoB,CAAA;IAC7G,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;IACxC,+FAA+F;IAC/F,YAAY,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAA;IACtD,iGAAiG;IACjG,kBAAkB,IAAI,IAAI,CAAA;IAC1B,kEAAkE;IAClE,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,GAAG,MAAM,IAAI,CAAA;CAChG;AACD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgBZ,CAAA;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAiBnD,sFAAsF;AACtF,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,GAAE,UAAe,EAAE,aAAa,GAAE,SAAS,kBAAkB,CAAC,cAAc,CAAC,EAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CA0yB9J"}
|
package/dist/dsh/core/host.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { nativeExecutionOwnership } from '../native-execution-ownership.js';
|
|
2
|
+
import { NativeTaskAuthority } from '../native-task-authority.js';
|
|
3
|
+
import { readOwnedIdentity } from '../owned-read-owner.js';
|
|
1
4
|
import { MemoryRequestFence, MemorySnapshotStale } from '../memory-request-fence.js';
|
|
2
5
|
import { retainedEvents } from '../context-projection.js';
|
|
3
6
|
import { readAkinatorSession, readRunIntakeLink } from '../../akinator/store.js';
|
|
@@ -7,6 +10,9 @@ import { DshAnswerContext } from '../answer-context.js';
|
|
|
7
10
|
import { IntakeModeConfig } from '../intake-mode.js';
|
|
8
11
|
import { isNativeSubagent } from '../native-subagent.js';
|
|
9
12
|
import { OnDemandIntake } from '../on-demand-intake.js';
|
|
13
|
+
import { DshTaskWorkflow, TASK_STATE_EVENT, TASK_WORKFLOW_SERVICE } from '../task-state-host.js';
|
|
14
|
+
import { mountTaskWorkflowSurface } from '../task-state-surface.js';
|
|
15
|
+
import { findSessionTask, recordTaskUnresolved, readTaskSnapshot, clearTaskUnresolved, authorizeTaskLease, captureTaskLease, taskCanExecute } from '../task-state.js';
|
|
10
16
|
import { readExecutionOwner } from '../orchestration/execution-owner.js';
|
|
11
17
|
import { KiokukoError } from '../../errors.js';
|
|
12
18
|
import { ObservationPackConfig } from '../observation-pack/policy.js';
|
|
@@ -18,6 +24,7 @@ import { memoryApplicationMode } from '../../memory/application.js';
|
|
|
18
24
|
import { mountMemoryApplication, MEMORY_APPLICATION_GUIDANCE } from '../memory-application.js';
|
|
19
25
|
import { SemanticCompactionCoordinator } from '../semantic-compaction/coordinator.js';
|
|
20
26
|
import { ModelHandoff, ModelHandoffConfig } from '../model-handoff.js';
|
|
27
|
+
import { DshLifecycleMemory } from '../lifecycle-memory.js';
|
|
21
28
|
import { ModelAutoConfig } from '../model-auto/contracts.js';
|
|
22
29
|
import { ModelAutoCoordinator } from '../model-auto/coordinator.js';
|
|
23
30
|
import { ModelAutoStore } from '../model-auto/store.js';
|
|
@@ -25,7 +32,7 @@ import { mountModelAutoCommand } from '../model-auto/command.js';
|
|
|
25
32
|
import { nativeModelCatalog } from '../native-model-catalog.js';
|
|
26
33
|
import { installDshModelRouting } from '../model-routing.js';
|
|
27
34
|
import { attachmentTypesFromMessages, nativeContextTokens, projectModelBinding } from '../model-auto/policy.js';
|
|
28
|
-
import { LISP_CODING_SERVICE } from '../lisp-service-key.js';
|
|
35
|
+
import { LISP_CODING_SERVICE, LISP_ASSEMBLY_SERVICE } from '../lisp-service-key.js';
|
|
29
36
|
import { SemanticCompactionConfig } from '../semantic-compaction/contracts.js';
|
|
30
37
|
import { MemoryReuseConfig } from '../../memory/reuse.js';
|
|
31
38
|
import { MemoryRetrievalConfig } from '../../memory/retrieval-contracts.js';
|
|
@@ -60,7 +67,7 @@ import { LedgerStore } from '../../ledger/store.js';
|
|
|
60
67
|
import { resolveProjectWorkspaceReadOnly } from '../../memory/workspaces.js';
|
|
61
68
|
import { readExecutionFrame } from '../execution-frame.js';
|
|
62
69
|
import { findSecret } from '../../memory/secrets.js';
|
|
63
|
-
import { classifyRequestIntent, createRequestIntentContext, rebindRequestIntentDecision, requestIntentMessageRefs, requestIntentReferenceIds, requestIntentTaskType } from '../decisions/request-intent.js';
|
|
70
|
+
import { classifyRequestIntent, createRequestIntentContext, rebindRequestIntentDecision, requestIntentMessageRefs, requestIntentReferenceIds, requestIntentTaskType, requestIntentIsUnresolved } from '../decisions/request-intent.js';
|
|
64
71
|
import { assertMemoryOwner, createMemoryOwner } from '../memory-owner.js';
|
|
65
72
|
import { executionClarification } from '../intake-clarification.js';
|
|
66
73
|
export const CoreConfig = z.object({
|
|
@@ -102,6 +109,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
102
109
|
const lifecycle = new AbortController();
|
|
103
110
|
let stopped = false, claimed = false, shutdown;
|
|
104
111
|
let indexReasoning;
|
|
112
|
+
let lifecycleMemory;
|
|
105
113
|
const get = (name) => ctx.get(name, false);
|
|
106
114
|
const skills = get('skills'), tools = get('tools'), sessions = get('sessions'), agents = get('agents'), systemPrompt = get('systemPrompt');
|
|
107
115
|
const modelScope = get('profileContext') && typeof ctx.inject === 'function'
|
|
@@ -139,9 +147,10 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
139
147
|
const facts = await runtime.withDatabase(async (db) => {
|
|
140
148
|
const project = await resolveProjectWorkspaceReadOnly(db, root, { allowDirectory: true });
|
|
141
149
|
if (!project)
|
|
142
|
-
return { activeGoal: undefined, proposals: [] };
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
return { activeGoal: undefined, activeTask: undefined, proposals: [] };
|
|
151
|
+
const activeTask = findSessionTask(db, { sessionId: session.id, repositoryRoot: project.repositoryRoot }, { includeLatestTerminal: true });
|
|
152
|
+
let runId = activeTask?.runId ?? (current?.agent === input.agent && current.task.admitted && !current.failed && !current.checkpointed
|
|
153
|
+
&& current.task.workspace === project.workspace ? current.task.runId : undefined);
|
|
145
154
|
if (!runId) {
|
|
146
155
|
const owner = readExecutionOwner(db, session.id);
|
|
147
156
|
const run = owner?.run_id ? new LedgerStore(db).readRun(owner.run_id) : undefined;
|
|
@@ -150,7 +159,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
150
159
|
}
|
|
151
160
|
}
|
|
152
161
|
if (!runId)
|
|
153
|
-
return { activeGoal: undefined, proposals: [] };
|
|
162
|
+
return { activeGoal: undefined, activeTask, proposals: [] };
|
|
154
163
|
const workflow = readCodingWorkflow(db, runId);
|
|
155
164
|
const definition = workflow && !['completed', 'cancelled', 'superseded'].includes(workflow.state) ? workflow.definition : undefined;
|
|
156
165
|
const activeGoal = workflow && !['completed', 'cancelled', 'superseded'].includes(workflow.state) ? {
|
|
@@ -167,7 +176,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
167
176
|
.map(condition => ({ id: `condition-${canonicalContentHash([runId, frame.revision, condition.field, condition.text, condition.planRevision])}`,
|
|
168
177
|
revision: condition.planRevision ?? frame.revision, digest: canonicalContentHash(condition),
|
|
169
178
|
text: `${condition.field}: ${condition.text}`, field: condition.field }));
|
|
170
|
-
return { activeGoal, proposals };
|
|
179
|
+
return { activeGoal, activeTask, proposals };
|
|
171
180
|
});
|
|
172
181
|
const precedingAssistant = [...(session.snapshotEvents?.() ?? [])].reverse().find(event => event.type === 'assistant/message'
|
|
173
182
|
&& (coreEventTurn(event) ?? Number.MAX_SAFE_INTEGER) < input.turn);
|
|
@@ -186,22 +195,64 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
186
195
|
digest: canonicalContentHash(text), text }];
|
|
187
196
|
}
|
|
188
197
|
}
|
|
189
|
-
return createRequestIntentContext({ task, messageRefs, ...(facts.activeGoal ? { activeGoal: facts.activeGoal } : {}), proposals: proposals.slice(0, 8) });
|
|
198
|
+
return createRequestIntentContext({ task, messageRefs, ...(facts.activeGoal ? { activeGoal: facts.activeGoal } : {}), ...(facts.activeTask ? { activeTask: facts.activeTask } : {}), proposals: proposals.slice(0, 8) });
|
|
199
|
+
};
|
|
200
|
+
const persistRequestIntent = async (requestId, context, decision) => {
|
|
201
|
+
if (!context.activeTask)
|
|
202
|
+
return;
|
|
203
|
+
const identity = context.activeTask, contextDigest = canonicalContentHash(context);
|
|
204
|
+
const snapshot = await runtime.withDatabase(db => {
|
|
205
|
+
if (requestIntentIsUnresolved(decision))
|
|
206
|
+
return recordTaskUnresolved(db, identity, {
|
|
207
|
+
operationId: `intent:${canonicalContentHash([requestId, contextDigest, decision?.unresolvedReason ?? 'request_intent_unresolved'])}`,
|
|
208
|
+
expectedRevision: identity.revision, requestId, contextDigest,
|
|
209
|
+
reason: decision?.unresolvedReason ?? 'request_intent_unresolved', evidence: requestIntentReferenceIds(context),
|
|
210
|
+
});
|
|
211
|
+
const current = readTaskSnapshot(db, identity);
|
|
212
|
+
return current.unresolved?.requestId === requestId && current.unresolved.contextDigest === contextDigest
|
|
213
|
+
? clearTaskUnresolved(db, identity, { requestId, contextDigest, expectedRevision: identity.revision }) : undefined;
|
|
214
|
+
});
|
|
215
|
+
if (snapshot)
|
|
216
|
+
ctx.emit(TASK_STATE_EVENT, snapshot);
|
|
190
217
|
};
|
|
191
218
|
const interpretRequestIntent = async (input, task) => {
|
|
192
219
|
const context = await requestIntentContextFor(input, task);
|
|
193
220
|
if (!context)
|
|
194
221
|
return undefined;
|
|
195
|
-
const
|
|
222
|
+
const requestId = dshTurnRequestId({ dshSessionId: input.agent.session.id, turn: input.turn });
|
|
223
|
+
const decision = await classifyRequestIntent(decisions, requestId, context, input.signal);
|
|
224
|
+
await persistRequestIntent(requestId, context, decision);
|
|
196
225
|
return decision ? { context, decision } : undefined;
|
|
197
226
|
};
|
|
198
227
|
const demand = new OnDemandIntake({
|
|
199
228
|
answerContext: new DshAnswerContext(runtime, { root, projectOnly: true, memoryRetrieval: config.memoryRetrieval,
|
|
200
229
|
instructions: (input, task, taskType) => answerSkillContext(input, task, taskType, { skills, prompts, decisions, cwd: root }),
|
|
201
230
|
}),
|
|
231
|
+
nativeOwnership: async (input) => {
|
|
232
|
+
const agent = input.agent;
|
|
233
|
+
bind(agent);
|
|
234
|
+
const session = agent.session;
|
|
235
|
+
if (!session?.header)
|
|
236
|
+
throw new Error('Native ownership requires the current session header');
|
|
237
|
+
const header = session.header;
|
|
238
|
+
if (header.parentSession || header.isSeeded)
|
|
239
|
+
return 'owned';
|
|
240
|
+
const jobs = get('jobs');
|
|
241
|
+
if (jobs && jobs.list(session.id).some(job => !['completed', 'killed', 'failed'].includes(job.status)))
|
|
242
|
+
return 'owned';
|
|
243
|
+
const current = active.get(session.id);
|
|
244
|
+
const ownership = await runtime.withDatabase(db => nativeExecutionOwnership(db, session.id, current?.task.runId));
|
|
245
|
+
input.signal.throwIfAborted();
|
|
246
|
+
// Retire only the exact completed in-memory projection proven above.
|
|
247
|
+
// Durable history remains intact; no memory lookup or save is involved.
|
|
248
|
+
if (ownership === 'unowned' && current && active.get(session.id) === current)
|
|
249
|
+
active.delete(session.id);
|
|
250
|
+
return ownership;
|
|
251
|
+
},
|
|
202
252
|
nativeChild: agent => agents?.get(agent.id) === agent && sessions?.get(agent.session?.id) === agent.session && isNativeSubagent(agent),
|
|
203
253
|
validate: async (input) => {
|
|
204
254
|
bind(input.agent);
|
|
255
|
+
await discardStaleActive(input.agent);
|
|
205
256
|
await runtime.withDatabase(db => {
|
|
206
257
|
for (const id of legacyModuleRequirements(db, input.agent.session.id)) {
|
|
207
258
|
if (!modules.ids().includes(id))
|
|
@@ -242,7 +293,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
242
293
|
return;
|
|
243
294
|
const retainsGoal = (requestIntent?.relation === 'same_scope_continuation' || requestIntent?.relation === 'scope_change')
|
|
244
295
|
&& requestIntent.action !== 'answer'
|
|
245
|
-
&& requestIntent.evidence.runId === current.task.runId;
|
|
296
|
+
&& (requestIntent.evidence.runId === current.task.runId || requestIntent.evidence.taskId === current.task.runId);
|
|
246
297
|
if (retainsGoal)
|
|
247
298
|
return;
|
|
248
299
|
await finishSession(sessionId);
|
|
@@ -251,24 +302,21 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
251
302
|
},
|
|
252
303
|
existing: async (input, requestIntent) => {
|
|
253
304
|
const sessionId = input.agent.session.id;
|
|
254
|
-
|
|
255
|
-
&& requestIntent.action !== 'answer' && requestIntent.action !== 'unknown';
|
|
256
|
-
if (!sameScope)
|
|
305
|
+
if (requestIntent?.relation !== 'same_scope_continuation' || ['answer', 'unknown'].includes(requestIntent.action))
|
|
257
306
|
return false;
|
|
258
307
|
return runtime.withDatabase(async (db) => {
|
|
259
308
|
const project = await resolveProjectWorkspaceReadOnly(db, root, { allowDirectory: true });
|
|
260
309
|
if (!project)
|
|
261
310
|
return false;
|
|
262
|
-
const
|
|
263
|
-
if (!
|
|
264
|
-
|
|
265
|
-
const run = new LedgerStore(db).readRun(owner.run_id);
|
|
266
|
-
if (!run || run.status !== 'active' || run.dshSessionId !== sessionId)
|
|
311
|
+
const task = findSessionTask(db, { sessionId, repositoryRoot: project.repositoryRoot });
|
|
312
|
+
if (!task || !taskCanExecute(task) || requestIntent.evidence.taskId !== task.taskId
|
|
313
|
+
|| requestIntent.evidence.taskRevision !== task.revision || requestIntent.evidence.taskGeneration !== task.generation)
|
|
267
314
|
return false;
|
|
268
|
-
|
|
315
|
+
const owner = readExecutionOwner(db, sessionId);
|
|
316
|
+
if (owner && (owner.run_id !== task.runId || owner.mode !== 'normal' || owner.workspace !== project.workspace))
|
|
269
317
|
return false;
|
|
270
|
-
|
|
271
|
-
return
|
|
318
|
+
captureTaskLease(db, task);
|
|
319
|
+
return true;
|
|
272
320
|
});
|
|
273
321
|
},
|
|
274
322
|
classify: (input, task) => classifyTaskForIntake(decisions, dshTurnRequestId({ dshSessionId: input.agent.session.id, turn: input.turn }), task, undefined, input.signal),
|
|
@@ -282,14 +330,32 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
282
330
|
return false;
|
|
283
331
|
const current = active.get(agent.session?.id ?? '');
|
|
284
332
|
return !!current && current.agent === agent && current.agent.session === agent.session && (turn === undefined || current.turn === turn)
|
|
285
|
-
&& current.task.admitted && !current.failed && !current.checkpointed && !stopped;
|
|
333
|
+
&& current.task.admitted && !current.failed && !current.checkpointed && !current.invalidated && !stopped;
|
|
286
334
|
},
|
|
287
335
|
}, { onlyWhenDeferred: config.intakeMode === 'eager' });
|
|
336
|
+
const taskWorkflow = new DshTaskWorkflow({ runtime, demand, agents, sessions, skills, tools,
|
|
337
|
+
lisp: () => get(LISP_ASSEMBLY_SERVICE),
|
|
338
|
+
checkpointSource: async (agent) => { bind(agent); await sessions.flush(agent.session); bind(agent); },
|
|
339
|
+
onCompleted: task => lifecycleMemory?.completed(task.taskId, 'completed', task.sessionId, task),
|
|
340
|
+
emit: task => { ctx.emit(TASK_STATE_EVENT, task); } });
|
|
288
341
|
const conversationSessions = new WeakSet();
|
|
289
342
|
function bind(agent) {
|
|
290
343
|
if (!agent?.session || agents?.get(agent.id) !== agent || sessions?.get(agent.session.id) !== agent.session || realpathSync(agent.session.header.cwd) !== root)
|
|
291
344
|
throw new Error('Native task identity mismatch');
|
|
292
345
|
}
|
|
346
|
+
async function discardStaleActive(agent) {
|
|
347
|
+
const current = active.get(agent.session.id);
|
|
348
|
+
if (!current || current.agent !== agent || !current.task.authority)
|
|
349
|
+
return;
|
|
350
|
+
try {
|
|
351
|
+
await runtime.withDatabase(db => authorizeTaskLease(db, current.task.authority));
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
current.invalidated = true;
|
|
355
|
+
if (active.get(agent.session.id) === current)
|
|
356
|
+
active.delete(agent.session.id);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
293
359
|
function track(promise) {
|
|
294
360
|
pending.add(promise);
|
|
295
361
|
void promise.then(() => pending.delete(promise), () => pending.delete(promise));
|
|
@@ -302,6 +368,9 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
302
368
|
if (current.finishing)
|
|
303
369
|
return current.finishing;
|
|
304
370
|
bind(current.agent);
|
|
371
|
+
await discardStaleActive(current.agent);
|
|
372
|
+
if (active.get(sessionId) !== current)
|
|
373
|
+
return;
|
|
305
374
|
const boundary = [...current.agent.session.snapshotEvents()].reverse().find(event => event.type === 'turn/end' && event.data?.turn === current.turn);
|
|
306
375
|
const reason = boundary?.data?.reason?.kind;
|
|
307
376
|
if (!['completed', 'error', 'aborted', 'max-tokens', 'blocked'].includes(reason))
|
|
@@ -312,7 +381,9 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
312
381
|
return;
|
|
313
382
|
current.finishing = (async () => {
|
|
314
383
|
await sessions.flush(current.agent.session);
|
|
315
|
-
|
|
384
|
+
const outcome = reason === 'aborted' ? 'cancelled' : reason === 'max-tokens' ? 'interrupted' : reason === 'completed' && !current.failed && current.task.admitted ? 'completed' : 'failed';
|
|
385
|
+
await tasks.finish(current.task, outcome);
|
|
386
|
+
lifecycleMemory?.completed(current.task.runId, outcome, sessionId);
|
|
316
387
|
if (active.get(sessionId) === current)
|
|
317
388
|
active.delete(sessionId);
|
|
318
389
|
await answerReview.finish(current.agent);
|
|
@@ -367,6 +438,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
367
438
|
}
|
|
368
439
|
async function prepareCoreTask(payload, signal, advisoryType, suppliedIntent, suppliedContext) {
|
|
369
440
|
const key = `${payload.agent.session.id}\u0000${payload.turn}`;
|
|
441
|
+
await discardStaleActive(payload.agent);
|
|
370
442
|
const existing = active.get(payload.agent.session.id);
|
|
371
443
|
const newText = humanTask(payload.messages);
|
|
372
444
|
const steering = existing?.turn === payload.turn && newText.length > 0 && newText !== existing.taskText;
|
|
@@ -397,9 +469,11 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
397
469
|
else if (!exactPreparedRequest && requestIntentContext) {
|
|
398
470
|
requestIntent = await classifyRequestIntent(decisions, requestId, requestIntentContext, signal);
|
|
399
471
|
}
|
|
472
|
+
if (requestIntentContext)
|
|
473
|
+
await persistRequestIntent(requestId, requestIntentContext, requestIntent);
|
|
400
474
|
const intentUnresolved = requestIntent?.relation === 'unknown' || requestIntent?.action === 'unknown';
|
|
401
475
|
const legacyTaskTypeAllowed = advisoryType !== undefined && advisoryType !== 'chat'
|
|
402
|
-
&& !requestIntentContext?.activeGoal && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
476
|
+
&& !requestIntentContext?.activeGoal && !requestIntentContext?.activeTask && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
403
477
|
if ((intentUnresolved && !legacyTaskTypeAllowed) || requestIntent?.action === 'answer') {
|
|
404
478
|
throw new KiokukoError('CONFLICT', 'request_intent_unresolved');
|
|
405
479
|
}
|
|
@@ -408,7 +482,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
408
482
|
throw new KiokukoError('VALIDATION_ERROR', clarification);
|
|
409
483
|
if (intentUnresolved && legacyTaskTypeAllowed)
|
|
410
484
|
requestIntent = undefined;
|
|
411
|
-
if (requestIntentContext?.activeGoal && requestIntent === undefined) {
|
|
485
|
+
if ((requestIntentContext?.activeGoal || requestIntentContext?.activeTask) && requestIntent === undefined) {
|
|
412
486
|
throw new KiokukoError('CONFLICT', 'request_intent_required_for_active_goal');
|
|
413
487
|
}
|
|
414
488
|
const resumesScope = requestIntent && (requestIntent.relation === 'same_scope_continuation' || requestIntent.relation === 'scope_change');
|
|
@@ -481,7 +555,22 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
481
555
|
throw new Error('Native capability inventory is incomplete');
|
|
482
556
|
const schemas = stableLispCapabilities(await tools.schemas(payload.agent), payload.agent);
|
|
483
557
|
request = { ...request, capabilities: [...snapshot.skills.filter((skill) => skill.invocation?.modelInvocable !== false).map((skill) => ({ kind: 'skill', name: skill.name, ...(skill.description ? { description: skill.description } : {}) })),
|
|
484
|
-
...schemas.map((tool) => ({ kind: 'tool', name: tool.name, ...(tool.description ? { description: tool.description } : {}) }))]
|
|
558
|
+
...schemas.map((tool) => ({ kind: 'tool', name: tool.name, ...(tool.description ? { description: tool.description } : {}) }))],
|
|
559
|
+
validateCapabilities: async () => {
|
|
560
|
+
signal.throwIfAborted();
|
|
561
|
+
bind(payload.agent);
|
|
562
|
+
const latest = await skills.snapshot({ scope: payload.agent, cwd: root, signal });
|
|
563
|
+
if (!latest.complete)
|
|
564
|
+
throw new Error('Native capability inventory is incomplete');
|
|
565
|
+
const latestSchemas = stableLispCapabilities(await tools.schemas(payload.agent), payload.agent);
|
|
566
|
+
const capabilities = [...latest.skills.filter((skill) => skill.invocation?.modelInvocable !== false)
|
|
567
|
+
.map((skill) => ({ kind: 'skill', name: skill.name, ...(skill.description ? { description: skill.description } : {}) })),
|
|
568
|
+
...latestSchemas.map((tool) => ({ kind: 'tool', name: tool.name, ...(tool.description ? { description: tool.description } : {}) }))];
|
|
569
|
+
signal.throwIfAborted();
|
|
570
|
+
bind(payload.agent);
|
|
571
|
+
if (capabilityCatalogDigest(capabilities) !== capabilityCatalogDigest(request.capabilities))
|
|
572
|
+
throw new Error('Native capabilities changed during intake');
|
|
573
|
+
} };
|
|
485
574
|
const resuming = !!resumesScope;
|
|
486
575
|
let task = resuming ? await tasks.resume(request) : await tasks.prepare(request);
|
|
487
576
|
if (resuming && requestIntent?.relation === 'same_scope_continuation' && task.memoryOwner?.kind === 'execution') {
|
|
@@ -517,6 +606,11 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
517
606
|
attachmentTypes: attachmentTypesFromMessages(payload.messages), failed: false, checkpointed: false, contextDelivered: false, memoryRebuildAttempts: 0 });
|
|
518
607
|
if (!task.admitted)
|
|
519
608
|
return task;
|
|
609
|
+
const authority = task.authority;
|
|
610
|
+
if (!authority)
|
|
611
|
+
throw new Error('Admitted core task has no repository authority');
|
|
612
|
+
const taskSnapshot = await runtime.withDatabase(db => authorizeTaskLease(db, authority));
|
|
613
|
+
ctx.emit(TASK_STATE_EVENT, taskSnapshot);
|
|
520
614
|
if (task.profile.taskType === 'chat')
|
|
521
615
|
conversationSessions.add(payload.agent.session);
|
|
522
616
|
else
|
|
@@ -526,7 +620,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
526
620
|
answerReview.bind({ runId: task.runId, workspace: task.workspace, requestId: task.requestId, task: text, catalogDigest: capabilityCatalogDigest(task.capabilities),
|
|
527
621
|
turn: payload.turn, agent: reviewAgent,
|
|
528
622
|
current: () => active.get(task.sessionId) === owner && agents?.get(payload.agent.id) === payload.agent && sessions?.get(task.sessionId) === payload.agent.session,
|
|
529
|
-
eligible: () => !stopped && owner.task.admitted && !owner.failed && !owner.checkpointed && !reviewAgent
|
|
623
|
+
eligible: () => !stopped && owner.task.admitted && !owner.failed && !owner.checkpointed && !isNativeSubagent(reviewAgent),
|
|
530
624
|
settled: async () => { if (active.get(task.sessionId) === owner)
|
|
531
625
|
await finishSession(task.sessionId); },
|
|
532
626
|
});
|
|
@@ -549,6 +643,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
549
643
|
stopped = true;
|
|
550
644
|
semanticCompaction.stop();
|
|
551
645
|
modelHandoff.stop();
|
|
646
|
+
lifecycleMemory?.stop();
|
|
552
647
|
lifecycle.abort(new Error('Kiokuko core stopped'));
|
|
553
648
|
modules.stopIngress();
|
|
554
649
|
for (const dispose of disposers.reverse()) {
|
|
@@ -572,6 +667,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
572
667
|
await answerReview.dispose();
|
|
573
668
|
await semanticCompaction.drain();
|
|
574
669
|
await modelHandoff.drain();
|
|
670
|
+
await lifecycleMemory?.whenIdle();
|
|
575
671
|
await Promise.allSettled([...pending]);
|
|
576
672
|
await modules.dispose();
|
|
577
673
|
await demand?.dispose();
|
|
@@ -607,6 +703,14 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
607
703
|
if (!skills?.registerProvider || !skills.snapshot || !tools?.schemas || !tools.guard || !tools.register || !sessions?.get || !sessions.flush || !agents?.get || !systemPrompt?.section)
|
|
608
704
|
throw new Error('Core requires native Skill, prompt, tool, session and agent services');
|
|
609
705
|
await runtime.start();
|
|
706
|
+
disposers.push(ctx.on(TASK_STATE_EVENT, (snapshot) => {
|
|
707
|
+
const current = active.get(snapshot.sessionId);
|
|
708
|
+
if (current?.task.authority && current.task.runId === snapshot.taskId
|
|
709
|
+
&& (current.task.authority.revision !== snapshot.revision || current.task.authority.generation !== snapshot.generation))
|
|
710
|
+
current.invalidated = true;
|
|
711
|
+
}));
|
|
712
|
+
lifecycleMemory = new DshLifecycleMemory(ctx, runtime, root);
|
|
713
|
+
lifecycleMemory.connectIntake(demand);
|
|
610
714
|
await decisions.initialize();
|
|
611
715
|
const provider = configuredSkillProvider(modules.resources(), prompts);
|
|
612
716
|
disposers.push(() => provider.dispose());
|
|
@@ -624,13 +728,33 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
624
728
|
throw new Error('Native ingress already has an owner'); claimed = true; },
|
|
625
729
|
beforeTask(handler) { beforeTask.add(handler); return () => { beforeTask.delete(handler); }; } });
|
|
626
730
|
if (!claimed) {
|
|
627
|
-
|
|
731
|
+
// The native-ingress owner also owns its task-control surface and intake proofs.
|
|
732
|
+
disposers.push(mountTaskWorkflowSurface(ctx, taskWorkflow, demand));
|
|
733
|
+
const resolveParentOwned = (execution) => {
|
|
628
734
|
if (!execution.agent)
|
|
629
735
|
return undefined;
|
|
630
736
|
bind(execution.agent);
|
|
631
737
|
const current = active.get(execution.agent.session.id);
|
|
632
|
-
return current && current.agent === execution.agent && current.task.admitted && !current.failed && !current.checkpointed
|
|
633
|
-
? { ...current.task, repositoryRoot:
|
|
738
|
+
return current && current.agent === execution.agent && current.task.admitted && current.task.authority && !current.failed && !current.checkpointed
|
|
739
|
+
? { ...current.task, repositoryRoot: current.task.authority.repositoryRoot, generation: canonicalContentHash({ run: current.task.runId, task: current.taskText }), agent: execution.agent } : undefined;
|
|
740
|
+
};
|
|
741
|
+
const nativeTaskAuthority = new NativeTaskAuthority({ runtime, repositoryRoot: root, backend: get('subagents'), agents, sessions, resolveParent: resolveParentOwned });
|
|
742
|
+
disposers.push(() => nativeTaskAuthority.dispose());
|
|
743
|
+
const resolveOwned = (execution) => nativeTaskAuthority.resolve(execution) ?? resolveParentOwned(execution);
|
|
744
|
+
const resolveOwnedRead = async (execution) => {
|
|
745
|
+
if (!execution.agent)
|
|
746
|
+
return undefined;
|
|
747
|
+
bind(execution.agent);
|
|
748
|
+
if (isNativeSubagent(execution.agent))
|
|
749
|
+
return nativeTaskAuthority.read(execution);
|
|
750
|
+
const current = resolveParentOwned(execution);
|
|
751
|
+
if (execution.name === 'kioku_read' && current)
|
|
752
|
+
return current;
|
|
753
|
+
return await runtime.withDatabase(async (db) => {
|
|
754
|
+
const project = await resolveProjectWorkspaceReadOnly(db, root, { allowDirectory: true });
|
|
755
|
+
return project ? readOwnedIdentity(db, execution.agent, project.repositoryRoot, execution.name === 'kioku_result' ? execution.arguments?.operationId : undefined) : undefined;
|
|
756
|
+
})
|
|
757
|
+
?? resolveParentOwned(execution);
|
|
634
758
|
};
|
|
635
759
|
disposers.push(mountTaskCompletion({ tools, on: ctx.on.bind(ctx) }, { runtime, resolve: resolveOwned, approve: async () => true }));
|
|
636
760
|
disposers.push(mountCodingWorkflow({ tools, on: ctx.on.bind(ctx) }, { runtime,
|
|
@@ -688,7 +812,9 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
688
812
|
return memory;
|
|
689
813
|
},
|
|
690
814
|
}));
|
|
691
|
-
disposers.push(mountOwnedExecution({ tools, on: ctx.on.bind(ctx) }, { runtime, resolve: resolveOwned,
|
|
815
|
+
disposers.push(mountOwnedExecution({ tools, on: ctx.on.bind(ctx) }, { runtime, resolve: resolveOwned, resolveRead: resolveOwnedRead,
|
|
816
|
+
unownedNative: execution => demand?.unownedNative(execution) === true,
|
|
817
|
+
isTaskControl: execution => get(TASK_WORKFLOW_SERVICE)?.isControl(execution) === true,
|
|
692
818
|
planActive: agent => get('planMode')?.get(agent)?.active === true,
|
|
693
819
|
async confirm(identity, detail, signal) {
|
|
694
820
|
if (!questions)
|
|
@@ -741,7 +867,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
741
867
|
if (mode === 'off')
|
|
742
868
|
return undefined;
|
|
743
869
|
if (!owner || owner.agent !== agent || !owner.task.admitted || owner.failed || owner.checkpointed
|
|
744
|
-
|| agent
|
|
870
|
+
|| isNativeSubagent(agent))
|
|
745
871
|
return { kind: 'native' };
|
|
746
872
|
if (get(LISP_CODING_SERVICE)?.enabled(agent))
|
|
747
873
|
return { kind: 'native' };
|
|
@@ -951,7 +1077,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
951
1077
|
return undefined;
|
|
952
1078
|
}));
|
|
953
1079
|
const argumentsSchema = z.object({ outcome: z.enum(['completed', 'failed', 'cancelled']), memories: z.array(z.unknown()).max(100).optional(), evidence: z.unknown().optional() }).strict();
|
|
954
|
-
disposers.push(tools.register({ name: 'memory_checkpoint', description: '
|
|
1080
|
+
disposers.push(tools.register({ name: 'memory_checkpoint', description: 'Memory saving requires post-task human review. This legacy tool does not save memories.', modelFacing: true, output: { schema: {}, render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }] }, parameters: JSON.parse(JSON.stringify(z.toJSONSchema(argumentsSchema))),
|
|
955
1081
|
execute: (args, execution) => track((async () => {
|
|
956
1082
|
if (stopped)
|
|
957
1083
|
throw new Error('Core is stopped');
|
|
@@ -960,7 +1086,6 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
960
1086
|
if (!current || current.agent !== execution.agent || current.checkpointed || execution.name !== 'memory_checkpoint')
|
|
961
1087
|
throw new Error('No open bound task for memory checkpoint');
|
|
962
1088
|
const result = await tasks.checkpoint(current.task, argumentsSchema.parse(args), execution.signal);
|
|
963
|
-
current.checkpointed = true;
|
|
964
1089
|
return result;
|
|
965
1090
|
})()) }));
|
|
966
1091
|
}
|