kiokuko-dsh 0.2.8 → 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 +35 -10
- package/README.ko.md +30 -3
- package/README.md +36 -12
- package/README.zh-CN.md +30 -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 +14 -0
- package/dist/dsh/agenticreplay-read-service.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-read-service.js +17 -0
- package/dist/dsh/agenticreplay-read-service.js.map +1 -1
- package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-recorder.js +5 -2
- package/dist/dsh/agenticreplay-recorder.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 +5 -2
- 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/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 +151 -33
- 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 +101 -1
- package/dist/dsh/decisions/request-intent.d.ts.map +1 -1
- package/dist/dsh/decisions/request-intent.js +77 -15
- 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.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.js +104 -90
- 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 +115 -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 +30 -29
- package/dist/dsh/lifecycle-memory.d.ts.map +1 -1
- package/dist/dsh/lifecycle-memory.js +309 -431
- package/dist/dsh/lifecycle-memory.js.map +1 -1
- 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/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/on-demand-intake.d.ts +23 -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/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/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.d.ts +1 -1
- package/dist/memory/lifecycle.d.ts.map +1 -1
- package/dist/memory/lifecycle.js +4 -79
- package/dist/memory/lifecycle.js.map +1 -1
- 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 +2 -2
- 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/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/lisp.md +33 -9
- package/docs/memory-evolution.md +6 -6
- package/docs/replay-memory-review.md +26 -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/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
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';
|
|
@@ -26,7 +32,7 @@ import { mountModelAutoCommand } from '../model-auto/command.js';
|
|
|
26
32
|
import { nativeModelCatalog } from '../native-model-catalog.js';
|
|
27
33
|
import { installDshModelRouting } from '../model-routing.js';
|
|
28
34
|
import { attachmentTypesFromMessages, nativeContextTokens, projectModelBinding } from '../model-auto/policy.js';
|
|
29
|
-
import { LISP_CODING_SERVICE } from '../lisp-service-key.js';
|
|
35
|
+
import { LISP_CODING_SERVICE, LISP_ASSEMBLY_SERVICE } from '../lisp-service-key.js';
|
|
30
36
|
import { SemanticCompactionConfig } from '../semantic-compaction/contracts.js';
|
|
31
37
|
import { MemoryReuseConfig } from '../../memory/reuse.js';
|
|
32
38
|
import { MemoryRetrievalConfig } from '../../memory/retrieval-contracts.js';
|
|
@@ -61,7 +67,7 @@ import { LedgerStore } from '../../ledger/store.js';
|
|
|
61
67
|
import { resolveProjectWorkspaceReadOnly } from '../../memory/workspaces.js';
|
|
62
68
|
import { readExecutionFrame } from '../execution-frame.js';
|
|
63
69
|
import { findSecret } from '../../memory/secrets.js';
|
|
64
|
-
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';
|
|
65
71
|
import { assertMemoryOwner, createMemoryOwner } from '../memory-owner.js';
|
|
66
72
|
import { executionClarification } from '../intake-clarification.js';
|
|
67
73
|
export const CoreConfig = z.object({
|
|
@@ -141,9 +147,10 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
141
147
|
const facts = await runtime.withDatabase(async (db) => {
|
|
142
148
|
const project = await resolveProjectWorkspaceReadOnly(db, root, { allowDirectory: true });
|
|
143
149
|
if (!project)
|
|
144
|
-
return { activeGoal: undefined, proposals: [] };
|
|
145
|
-
|
|
146
|
-
|
|
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);
|
|
147
154
|
if (!runId) {
|
|
148
155
|
const owner = readExecutionOwner(db, session.id);
|
|
149
156
|
const run = owner?.run_id ? new LedgerStore(db).readRun(owner.run_id) : undefined;
|
|
@@ -152,7 +159,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
152
159
|
}
|
|
153
160
|
}
|
|
154
161
|
if (!runId)
|
|
155
|
-
return { activeGoal: undefined, proposals: [] };
|
|
162
|
+
return { activeGoal: undefined, activeTask, proposals: [] };
|
|
156
163
|
const workflow = readCodingWorkflow(db, runId);
|
|
157
164
|
const definition = workflow && !['completed', 'cancelled', 'superseded'].includes(workflow.state) ? workflow.definition : undefined;
|
|
158
165
|
const activeGoal = workflow && !['completed', 'cancelled', 'superseded'].includes(workflow.state) ? {
|
|
@@ -169,7 +176,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
169
176
|
.map(condition => ({ id: `condition-${canonicalContentHash([runId, frame.revision, condition.field, condition.text, condition.planRevision])}`,
|
|
170
177
|
revision: condition.planRevision ?? frame.revision, digest: canonicalContentHash(condition),
|
|
171
178
|
text: `${condition.field}: ${condition.text}`, field: condition.field }));
|
|
172
|
-
return { activeGoal, proposals };
|
|
179
|
+
return { activeGoal, activeTask, proposals };
|
|
173
180
|
});
|
|
174
181
|
const precedingAssistant = [...(session.snapshotEvents?.() ?? [])].reverse().find(event => event.type === 'assistant/message'
|
|
175
182
|
&& (coreEventTurn(event) ?? Number.MAX_SAFE_INTEGER) < input.turn);
|
|
@@ -188,22 +195,64 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
188
195
|
digest: canonicalContentHash(text), text }];
|
|
189
196
|
}
|
|
190
197
|
}
|
|
191
|
-
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);
|
|
192
217
|
};
|
|
193
218
|
const interpretRequestIntent = async (input, task) => {
|
|
194
219
|
const context = await requestIntentContextFor(input, task);
|
|
195
220
|
if (!context)
|
|
196
221
|
return undefined;
|
|
197
|
-
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);
|
|
198
225
|
return decision ? { context, decision } : undefined;
|
|
199
226
|
};
|
|
200
227
|
const demand = new OnDemandIntake({
|
|
201
228
|
answerContext: new DshAnswerContext(runtime, { root, projectOnly: true, memoryRetrieval: config.memoryRetrieval,
|
|
202
229
|
instructions: (input, task, taskType) => answerSkillContext(input, task, taskType, { skills, prompts, decisions, cwd: root }),
|
|
203
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
|
+
},
|
|
204
252
|
nativeChild: agent => agents?.get(agent.id) === agent && sessions?.get(agent.session?.id) === agent.session && isNativeSubagent(agent),
|
|
205
253
|
validate: async (input) => {
|
|
206
254
|
bind(input.agent);
|
|
255
|
+
await discardStaleActive(input.agent);
|
|
207
256
|
await runtime.withDatabase(db => {
|
|
208
257
|
for (const id of legacyModuleRequirements(db, input.agent.session.id)) {
|
|
209
258
|
if (!modules.ids().includes(id))
|
|
@@ -244,7 +293,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
244
293
|
return;
|
|
245
294
|
const retainsGoal = (requestIntent?.relation === 'same_scope_continuation' || requestIntent?.relation === 'scope_change')
|
|
246
295
|
&& requestIntent.action !== 'answer'
|
|
247
|
-
&& requestIntent.evidence.runId === current.task.runId;
|
|
296
|
+
&& (requestIntent.evidence.runId === current.task.runId || requestIntent.evidence.taskId === current.task.runId);
|
|
248
297
|
if (retainsGoal)
|
|
249
298
|
return;
|
|
250
299
|
await finishSession(sessionId);
|
|
@@ -253,24 +302,21 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
253
302
|
},
|
|
254
303
|
existing: async (input, requestIntent) => {
|
|
255
304
|
const sessionId = input.agent.session.id;
|
|
256
|
-
|
|
257
|
-
&& requestIntent.action !== 'answer' && requestIntent.action !== 'unknown';
|
|
258
|
-
if (!sameScope)
|
|
305
|
+
if (requestIntent?.relation !== 'same_scope_continuation' || ['answer', 'unknown'].includes(requestIntent.action))
|
|
259
306
|
return false;
|
|
260
307
|
return runtime.withDatabase(async (db) => {
|
|
261
308
|
const project = await resolveProjectWorkspaceReadOnly(db, root, { allowDirectory: true });
|
|
262
309
|
if (!project)
|
|
263
310
|
return false;
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
266
|
-
|
|
267
|
-
const run = new LedgerStore(db).readRun(owner.run_id);
|
|
268
|
-
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)
|
|
269
314
|
return false;
|
|
270
|
-
|
|
315
|
+
const owner = readExecutionOwner(db, sessionId);
|
|
316
|
+
if (owner && (owner.run_id !== task.runId || owner.mode !== 'normal' || owner.workspace !== project.workspace))
|
|
271
317
|
return false;
|
|
272
|
-
|
|
273
|
-
return
|
|
318
|
+
captureTaskLease(db, task);
|
|
319
|
+
return true;
|
|
274
320
|
});
|
|
275
321
|
},
|
|
276
322
|
classify: (input, task) => classifyTaskForIntake(decisions, dshTurnRequestId({ dshSessionId: input.agent.session.id, turn: input.turn }), task, undefined, input.signal),
|
|
@@ -284,14 +330,32 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
284
330
|
return false;
|
|
285
331
|
const current = active.get(agent.session?.id ?? '');
|
|
286
332
|
return !!current && current.agent === agent && current.agent.session === agent.session && (turn === undefined || current.turn === turn)
|
|
287
|
-
&& current.task.admitted && !current.failed && !current.checkpointed && !stopped;
|
|
333
|
+
&& current.task.admitted && !current.failed && !current.checkpointed && !current.invalidated && !stopped;
|
|
288
334
|
},
|
|
289
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); } });
|
|
290
341
|
const conversationSessions = new WeakSet();
|
|
291
342
|
function bind(agent) {
|
|
292
343
|
if (!agent?.session || agents?.get(agent.id) !== agent || sessions?.get(agent.session.id) !== agent.session || realpathSync(agent.session.header.cwd) !== root)
|
|
293
344
|
throw new Error('Native task identity mismatch');
|
|
294
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
|
+
}
|
|
295
359
|
function track(promise) {
|
|
296
360
|
pending.add(promise);
|
|
297
361
|
void promise.then(() => pending.delete(promise), () => pending.delete(promise));
|
|
@@ -304,6 +368,9 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
304
368
|
if (current.finishing)
|
|
305
369
|
return current.finishing;
|
|
306
370
|
bind(current.agent);
|
|
371
|
+
await discardStaleActive(current.agent);
|
|
372
|
+
if (active.get(sessionId) !== current)
|
|
373
|
+
return;
|
|
307
374
|
const boundary = [...current.agent.session.snapshotEvents()].reverse().find(event => event.type === 'turn/end' && event.data?.turn === current.turn);
|
|
308
375
|
const reason = boundary?.data?.reason?.kind;
|
|
309
376
|
if (!['completed', 'error', 'aborted', 'max-tokens', 'blocked'].includes(reason))
|
|
@@ -371,6 +438,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
371
438
|
}
|
|
372
439
|
async function prepareCoreTask(payload, signal, advisoryType, suppliedIntent, suppliedContext) {
|
|
373
440
|
const key = `${payload.agent.session.id}\u0000${payload.turn}`;
|
|
441
|
+
await discardStaleActive(payload.agent);
|
|
374
442
|
const existing = active.get(payload.agent.session.id);
|
|
375
443
|
const newText = humanTask(payload.messages);
|
|
376
444
|
const steering = existing?.turn === payload.turn && newText.length > 0 && newText !== existing.taskText;
|
|
@@ -401,9 +469,11 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
401
469
|
else if (!exactPreparedRequest && requestIntentContext) {
|
|
402
470
|
requestIntent = await classifyRequestIntent(decisions, requestId, requestIntentContext, signal);
|
|
403
471
|
}
|
|
472
|
+
if (requestIntentContext)
|
|
473
|
+
await persistRequestIntent(requestId, requestIntentContext, requestIntent);
|
|
404
474
|
const intentUnresolved = requestIntent?.relation === 'unknown' || requestIntent?.action === 'unknown';
|
|
405
475
|
const legacyTaskTypeAllowed = advisoryType !== undefined && advisoryType !== 'chat'
|
|
406
|
-
&& !requestIntentContext?.activeGoal && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
476
|
+
&& !requestIntentContext?.activeGoal && !requestIntentContext?.activeTask && (requestIntentContext?.proposals.length ?? 0) === 0;
|
|
407
477
|
if ((intentUnresolved && !legacyTaskTypeAllowed) || requestIntent?.action === 'answer') {
|
|
408
478
|
throw new KiokukoError('CONFLICT', 'request_intent_unresolved');
|
|
409
479
|
}
|
|
@@ -412,7 +482,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
412
482
|
throw new KiokukoError('VALIDATION_ERROR', clarification);
|
|
413
483
|
if (intentUnresolved && legacyTaskTypeAllowed)
|
|
414
484
|
requestIntent = undefined;
|
|
415
|
-
if (requestIntentContext?.activeGoal && requestIntent === undefined) {
|
|
485
|
+
if ((requestIntentContext?.activeGoal || requestIntentContext?.activeTask) && requestIntent === undefined) {
|
|
416
486
|
throw new KiokukoError('CONFLICT', 'request_intent_required_for_active_goal');
|
|
417
487
|
}
|
|
418
488
|
const resumesScope = requestIntent && (requestIntent.relation === 'same_scope_continuation' || requestIntent.relation === 'scope_change');
|
|
@@ -485,7 +555,22 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
485
555
|
throw new Error('Native capability inventory is incomplete');
|
|
486
556
|
const schemas = stableLispCapabilities(await tools.schemas(payload.agent), payload.agent);
|
|
487
557
|
request = { ...request, capabilities: [...snapshot.skills.filter((skill) => skill.invocation?.modelInvocable !== false).map((skill) => ({ kind: 'skill', name: skill.name, ...(skill.description ? { description: skill.description } : {}) })),
|
|
488
|
-
...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
|
+
} };
|
|
489
574
|
const resuming = !!resumesScope;
|
|
490
575
|
let task = resuming ? await tasks.resume(request) : await tasks.prepare(request);
|
|
491
576
|
if (resuming && requestIntent?.relation === 'same_scope_continuation' && task.memoryOwner?.kind === 'execution') {
|
|
@@ -521,6 +606,11 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
521
606
|
attachmentTypes: attachmentTypesFromMessages(payload.messages), failed: false, checkpointed: false, contextDelivered: false, memoryRebuildAttempts: 0 });
|
|
522
607
|
if (!task.admitted)
|
|
523
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);
|
|
524
614
|
if (task.profile.taskType === 'chat')
|
|
525
615
|
conversationSessions.add(payload.agent.session);
|
|
526
616
|
else
|
|
@@ -530,7 +620,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
530
620
|
answerReview.bind({ runId: task.runId, workspace: task.workspace, requestId: task.requestId, task: text, catalogDigest: capabilityCatalogDigest(task.capabilities),
|
|
531
621
|
turn: payload.turn, agent: reviewAgent,
|
|
532
622
|
current: () => active.get(task.sessionId) === owner && agents?.get(payload.agent.id) === payload.agent && sessions?.get(task.sessionId) === payload.agent.session,
|
|
533
|
-
eligible: () => !stopped && owner.task.admitted && !owner.failed && !owner.checkpointed && !reviewAgent
|
|
623
|
+
eligible: () => !stopped && owner.task.admitted && !owner.failed && !owner.checkpointed && !isNativeSubagent(reviewAgent),
|
|
534
624
|
settled: async () => { if (active.get(task.sessionId) === owner)
|
|
535
625
|
await finishSession(task.sessionId); },
|
|
536
626
|
});
|
|
@@ -613,7 +703,14 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
613
703
|
if (!skills?.registerProvider || !skills.snapshot || !tools?.schemas || !tools.guard || !tools.register || !sessions?.get || !sessions.flush || !agents?.get || !systemPrompt?.section)
|
|
614
704
|
throw new Error('Core requires native Skill, prompt, tool, session and agent services');
|
|
615
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
|
+
}));
|
|
616
712
|
lifecycleMemory = new DshLifecycleMemory(ctx, runtime, root);
|
|
713
|
+
lifecycleMemory.connectIntake(demand);
|
|
617
714
|
await decisions.initialize();
|
|
618
715
|
const provider = configuredSkillProvider(modules.resources(), prompts);
|
|
619
716
|
disposers.push(() => provider.dispose());
|
|
@@ -631,13 +728,33 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
631
728
|
throw new Error('Native ingress already has an owner'); claimed = true; },
|
|
632
729
|
beforeTask(handler) { beforeTask.add(handler); return () => { beforeTask.delete(handler); }; } });
|
|
633
730
|
if (!claimed) {
|
|
634
|
-
|
|
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) => {
|
|
635
734
|
if (!execution.agent)
|
|
636
735
|
return undefined;
|
|
637
736
|
bind(execution.agent);
|
|
638
737
|
const current = active.get(execution.agent.session.id);
|
|
639
|
-
return current && current.agent === execution.agent && current.task.admitted && !current.failed && !current.checkpointed
|
|
640
|
-
? { ...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);
|
|
641
758
|
};
|
|
642
759
|
disposers.push(mountTaskCompletion({ tools, on: ctx.on.bind(ctx) }, { runtime, resolve: resolveOwned, approve: async () => true }));
|
|
643
760
|
disposers.push(mountCodingWorkflow({ tools, on: ctx.on.bind(ctx) }, { runtime,
|
|
@@ -695,7 +812,9 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
695
812
|
return memory;
|
|
696
813
|
},
|
|
697
814
|
}));
|
|
698
|
-
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,
|
|
699
818
|
planActive: agent => get('planMode')?.get(agent)?.active === true,
|
|
700
819
|
async confirm(identity, detail, signal) {
|
|
701
820
|
if (!questions)
|
|
@@ -748,7 +867,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
748
867
|
if (mode === 'off')
|
|
749
868
|
return undefined;
|
|
750
869
|
if (!owner || owner.agent !== agent || !owner.task.admitted || owner.failed || owner.checkpointed
|
|
751
|
-
|| agent
|
|
870
|
+
|| isNativeSubagent(agent))
|
|
752
871
|
return { kind: 'native' };
|
|
753
872
|
if (get(LISP_CODING_SERVICE)?.enabled(agent))
|
|
754
873
|
return { kind: 'native' };
|
|
@@ -958,7 +1077,7 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
958
1077
|
return undefined;
|
|
959
1078
|
}));
|
|
960
1079
|
const argumentsSchema = z.object({ outcome: z.enum(['completed', 'failed', 'cancelled']), memories: z.array(z.unknown()).max(100).optional(), evidence: z.unknown().optional() }).strict();
|
|
961
|
-
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))),
|
|
962
1081
|
execute: (args, execution) => track((async () => {
|
|
963
1082
|
if (stopped)
|
|
964
1083
|
throw new Error('Core is stopped');
|
|
@@ -967,7 +1086,6 @@ export async function mountCore(ctx, input = {}, registrations = []) {
|
|
|
967
1086
|
if (!current || current.agent !== execution.agent || current.checkpointed || execution.name !== 'memory_checkpoint')
|
|
968
1087
|
throw new Error('No open bound task for memory checkpoint');
|
|
969
1088
|
const result = await tasks.checkpoint(current.task, argumentsSchema.parse(args), execution.signal);
|
|
970
|
-
current.checkpointed = true;
|
|
971
1089
|
return result;
|
|
972
1090
|
})()) }));
|
|
973
1091
|
}
|