kiokuko-dsh 0.2.39 → 0.2.41
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 +2 -2
- package/README.ja.md +17 -5
- package/README.ko.md +17 -5
- package/README.md +17 -5
- package/README.zh-CN.md +17 -5
- package/dist/akinator/skill-discovery-attempt.d.ts +3 -1
- package/dist/akinator/skill-discovery-attempt.d.ts.map +1 -1
- package/dist/akinator/skill-discovery-attempt.js +12 -11
- package/dist/akinator/skill-discovery-attempt.js.map +1 -1
- package/dist/client.cjs +7 -10
- package/dist/client.d.ts.map +1 -1
- package/dist/context/continuity-view.d.ts +0 -11
- package/dist/context/continuity-view.d.ts.map +1 -1
- package/dist/context/continuity-view.js +5 -9
- package/dist/context/continuity-view.js.map +1 -1
- package/dist/deep-thinker/controller.d.ts +4 -1
- package/dist/deep-thinker/controller.d.ts.map +1 -1
- package/dist/deep-thinker/controller.js +10 -0
- package/dist/deep-thinker/controller.js.map +1 -1
- package/dist/deep-thinker/core/contracts.d.ts +11 -11
- package/dist/deep-thinker/memory-finalizer.d.ts +1 -1
- package/dist/deep-thinker/native-executor.d.ts +1 -1
- package/dist/deep-thinker/native-executor.d.ts.map +1 -1
- package/dist/deep-thinker/prompts.js +1 -1
- package/dist/deep-thinker/prompts.js.map +1 -1
- package/dist/deep-thinker/quality-prompts.js +1 -1
- package/dist/deep-thinker/quality-prompts.js.map +1 -1
- package/dist/deep-thinker/report.d.ts +1 -1
- package/dist/deep-thinker/store.d.ts +1 -1
- package/dist/dsh/agenticreplay-hooks.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-hooks.js +13 -0
- package/dist/dsh/agenticreplay-hooks.js.map +1 -1
- package/dist/dsh/agenticreplay-recorder.d.ts +5 -0
- package/dist/dsh/agenticreplay-recorder.d.ts.map +1 -1
- package/dist/dsh/agenticreplay-recorder.js +19 -0
- package/dist/dsh/agenticreplay-recorder.js.map +1 -1
- package/dist/dsh/coding-workflow/contracts.d.ts +2 -5
- package/dist/dsh/coding-workflow/contracts.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/contracts.js +1 -1
- package/dist/dsh/coding-workflow/contracts.js.map +1 -1
- package/dist/dsh/coding-workflow/host.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/host.js +1 -4
- package/dist/dsh/coding-workflow/host.js.map +1 -1
- package/dist/dsh/coding-workflow/intent.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/intent.js +0 -6
- package/dist/dsh/coding-workflow/intent.js.map +1 -1
- package/dist/dsh/coding-workflow/service.d.ts +4 -8
- package/dist/dsh/coding-workflow/service.d.ts.map +1 -1
- package/dist/dsh/coding-workflow/service.js +5 -57
- package/dist/dsh/coding-workflow/service.js.map +1 -1
- package/dist/dsh/completion-report.d.ts +0 -31
- package/dist/dsh/completion-report.d.ts.map +1 -1
- package/dist/dsh/completion-report.js +16 -94
- package/dist/dsh/completion-report.js.map +1 -1
- package/dist/dsh/composition.d.ts +1 -3
- package/dist/dsh/composition.d.ts.map +1 -1
- package/dist/dsh/composition.js +13 -34
- package/dist/dsh/composition.js.map +1 -1
- package/dist/dsh/config.d.ts +1 -22
- package/dist/dsh/config.d.ts.map +1 -1
- package/dist/dsh/config.js +0 -8
- package/dist/dsh/config.js.map +1 -1
- package/dist/dsh/context-injection.d.ts +1 -11
- package/dist/dsh/context-injection.d.ts.map +1 -1
- package/dist/dsh/context-injection.js +3 -24
- package/dist/dsh/context-injection.js.map +1 -1
- package/dist/dsh/continuity-adapter.d.ts +0 -5
- package/dist/dsh/continuity-adapter.d.ts.map +1 -1
- package/dist/dsh/continuity-adapter.js +1 -39
- package/dist/dsh/continuity-adapter.js.map +1 -1
- package/dist/dsh/decisions/contracts.d.ts +0 -1
- package/dist/dsh/decisions/contracts.d.ts.map +1 -1
- package/dist/dsh/decisions/contracts.js +1 -1
- package/dist/dsh/decisions/contracts.js.map +1 -1
- package/dist/dsh/decisions/diagnostics.d.ts +8 -11
- package/dist/dsh/decisions/diagnostics.d.ts.map +1 -1
- package/dist/dsh/decisions/diagnostics.js +1 -9
- package/dist/dsh/decisions/diagnostics.js.map +1 -1
- package/dist/dsh/decisions/intent-assessment.d.ts +2 -5
- package/dist/dsh/decisions/intent-assessment.d.ts.map +1 -1
- package/dist/dsh/decisions/intent-assessment.js +17 -9
- package/dist/dsh/decisions/intent-assessment.js.map +1 -1
- package/dist/dsh/efficiency.d.ts +0 -3
- package/dist/dsh/efficiency.d.ts.map +1 -1
- package/dist/dsh/efficiency.js +1 -9
- package/dist/dsh/efficiency.js.map +1 -1
- package/dist/dsh/execution-selection.d.ts +6 -7
- package/dist/dsh/execution-selection.d.ts.map +1 -1
- package/dist/dsh/execution-selection.js +10 -15
- package/dist/dsh/execution-selection.js.map +1 -1
- package/dist/dsh/execution-support.d.ts +0 -4
- package/dist/dsh/execution-support.d.ts.map +1 -1
- package/dist/dsh/execution-support.js +3 -15
- package/dist/dsh/execution-support.js.map +1 -1
- package/dist/dsh/harness/factory.d.ts +109 -0
- package/dist/dsh/harness/factory.d.ts.map +1 -0
- package/dist/dsh/harness/factory.js +566 -0
- package/dist/dsh/harness/factory.js.map +1 -0
- package/dist/dsh/harness/inbox.d.ts +22 -0
- package/dist/dsh/harness/inbox.d.ts.map +1 -0
- package/dist/dsh/harness/inbox.js +61 -0
- package/dist/dsh/harness/inbox.js.map +1 -0
- package/dist/dsh/harness/index.d.ts +19 -0
- package/dist/dsh/harness/index.d.ts.map +1 -0
- package/dist/dsh/harness/index.js +26 -0
- package/dist/dsh/harness/index.js.map +1 -0
- package/dist/dsh/harness/lifecycle.d.ts +26 -0
- package/dist/dsh/harness/lifecycle.d.ts.map +1 -0
- package/dist/dsh/harness/lifecycle.js +21 -0
- package/dist/dsh/harness/lifecycle.js.map +1 -0
- package/dist/dsh/harness/projections.d.ts +16 -0
- package/dist/dsh/harness/projections.d.ts.map +1 -0
- package/dist/dsh/harness/projections.js +34 -0
- package/dist/dsh/harness/projections.js.map +1 -0
- package/dist/dsh/head-worker-configuration.d.ts +1 -2
- package/dist/dsh/head-worker-configuration.d.ts.map +1 -1
- package/dist/dsh/head-worker-configuration.js +0 -5
- package/dist/dsh/head-worker-configuration.js.map +1 -1
- package/dist/dsh/host-adapter/admission.d.ts +1 -8
- package/dist/dsh/host-adapter/admission.d.ts.map +1 -1
- package/dist/dsh/host-adapter/admission.js +51 -260
- package/dist/dsh/host-adapter/admission.js.map +1 -1
- package/dist/dsh/host-adapter/boundaries.d.ts +1 -28
- package/dist/dsh/host-adapter/boundaries.d.ts.map +1 -1
- package/dist/dsh/host-adapter/boundaries.js +27 -328
- package/dist/dsh/host-adapter/boundaries.js.map +1 -1
- package/dist/dsh/host-adapter/context.d.ts +1 -7
- package/dist/dsh/host-adapter/context.d.ts.map +1 -1
- package/dist/dsh/host-adapter/context.js +5 -28
- package/dist/dsh/host-adapter/context.js.map +1 -1
- package/dist/dsh/host-adapter/efficiency-host.d.ts +0 -2
- package/dist/dsh/host-adapter/efficiency-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/efficiency-host.js +2 -2
- package/dist/dsh/host-adapter/efficiency-host.js.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.d.ts +0 -7
- package/dist/dsh/host-adapter/lifecycle.d.ts.map +1 -1
- package/dist/dsh/host-adapter/lifecycle.js +58 -71
- package/dist/dsh/host-adapter/lifecycle.js.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.d.ts +0 -2
- package/dist/dsh/host-adapter/memory-application-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/memory-application-host.js +2 -2
- package/dist/dsh/host-adapter/memory-application-host.js.map +1 -1
- package/dist/dsh/host-adapter/routing.d.ts +1 -5
- package/dist/dsh/host-adapter/routing.d.ts.map +1 -1
- package/dist/dsh/host-adapter/routing.js +21 -73
- package/dist/dsh/host-adapter/routing.js.map +1 -1
- package/dist/dsh/host-adapter/session-observation.d.ts +1 -8
- package/dist/dsh/host-adapter/session-observation.d.ts.map +1 -1
- package/dist/dsh/host-adapter/session-observation.js +2 -55
- package/dist/dsh/host-adapter/session-observation.js.map +1 -1
- package/dist/dsh/host-adapter/tool-host.d.ts +3 -41
- package/dist/dsh/host-adapter/tool-host.d.ts.map +1 -1
- package/dist/dsh/host-adapter/tool-host.js +14 -243
- package/dist/dsh/host-adapter/tool-host.js.map +1 -1
- package/dist/dsh/host-adapter/turn-state.d.ts +0 -4
- package/dist/dsh/host-adapter/turn-state.d.ts.map +1 -1
- package/dist/dsh/host-adapter/turn-state.js +16 -93
- package/dist/dsh/host-adapter/turn-state.js.map +1 -1
- package/dist/dsh/host-adapter.d.ts +0 -11
- package/dist/dsh/host-adapter.d.ts.map +1 -1
- package/dist/dsh/host-adapter.js +17 -179
- package/dist/dsh/host-adapter.js.map +1 -1
- package/dist/dsh/index.d.ts +3 -16
- package/dist/dsh/index.d.ts.map +1 -1
- package/dist/dsh/index.js +0 -6
- package/dist/dsh/index.js.map +1 -1
- package/dist/dsh/lifecycle-memory.d.ts +3 -0
- package/dist/dsh/lifecycle-memory.d.ts.map +1 -1
- package/dist/dsh/lifecycle-memory.js +67 -45
- package/dist/dsh/lifecycle-memory.js.map +1 -1
- package/dist/dsh/lisp/candidate.d.ts +2 -2
- package/dist/dsh/lisp/code-intelligence-contracts.d.ts +1 -1
- package/dist/dsh/lisp/compiled-cache.d.ts.map +1 -1
- package/dist/dsh/lisp/compiled-cache.js +27 -6
- package/dist/dsh/lisp/compiled-cache.js.map +1 -1
- package/dist/dsh/lisp/host-tool-dispatch.d.ts.map +1 -1
- package/dist/dsh/lisp/host-tool-dispatch.js +14 -5
- package/dist/dsh/lisp/host-tool-dispatch.js.map +1 -1
- package/dist/dsh/lisp/manager.d.ts +7 -4
- package/dist/dsh/lisp/manager.d.ts.map +1 -1
- package/dist/dsh/lisp/manager.js +132 -103
- package/dist/dsh/lisp/manager.js.map +1 -1
- package/dist/dsh/lisp/sandbox.d.ts.map +1 -1
- package/dist/dsh/lisp/sandbox.js +1 -5
- package/dist/dsh/lisp/sandbox.js.map +1 -1
- package/dist/dsh/lisp/supervision.d.ts +33 -0
- package/dist/dsh/lisp/supervision.d.ts.map +1 -0
- package/dist/dsh/lisp/supervision.js +89 -0
- package/dist/dsh/lisp/supervision.js.map +1 -0
- package/dist/dsh/lisp/surface.d.ts +2 -2
- package/dist/dsh/lisp/surface.d.ts.map +1 -1
- package/dist/dsh/lisp/surface.js +105 -11
- package/dist/dsh/lisp/surface.js.map +1 -1
- package/dist/dsh/lisp/worker.d.ts +2 -1
- package/dist/dsh/lisp/worker.d.ts.map +1 -1
- package/dist/dsh/lisp/worker.js +7 -1
- package/dist/dsh/lisp/worker.js.map +1 -1
- package/dist/dsh/loop-guard.d.ts +0 -8
- package/dist/dsh/loop-guard.d.ts.map +1 -1
- package/dist/dsh/loop-guard.js +0 -51
- package/dist/dsh/loop-guard.js.map +1 -1
- package/dist/dsh/memory-application.d.ts.map +1 -1
- package/dist/dsh/memory-application.js +0 -6
- package/dist/dsh/memory-application.js.map +1 -1
- package/dist/dsh/message-sources.d.ts +2 -12
- package/dist/dsh/message-sources.d.ts.map +1 -1
- package/dist/dsh/message-sources.js +20 -39
- package/dist/dsh/message-sources.js.map +1 -1
- package/dist/dsh/model-configuration.d.ts +6 -24
- package/dist/dsh/model-configuration.d.ts.map +1 -1
- package/dist/dsh/model-configuration.js +1 -78
- package/dist/dsh/model-configuration.js.map +1 -1
- package/dist/dsh/model-routing.d.ts +1 -3
- package/dist/dsh/model-routing.d.ts.map +1 -1
- package/dist/dsh/model-routing.js +0 -11
- package/dist/dsh/model-routing.js.map +1 -1
- package/dist/dsh/model-selection-ui.d.ts +1 -2
- package/dist/dsh/model-selection-ui.d.ts.map +1 -1
- package/dist/dsh/model-selection-ui.js +48 -309
- package/dist/dsh/model-selection-ui.js.map +1 -1
- package/dist/dsh/models/contracts.d.ts +2 -2
- package/dist/dsh/models/service.d.ts +1 -1
- package/dist/dsh/modules/legacy-bindings.d.ts +3 -1
- package/dist/dsh/modules/legacy-bindings.d.ts.map +1 -1
- package/dist/dsh/modules/legacy-bindings.js +5 -5
- package/dist/dsh/modules/legacy-bindings.js.map +1 -1
- package/dist/dsh/modules/lisp.js +1 -1
- package/dist/dsh/modules/lisp.js.map +1 -1
- package/dist/dsh/native-execution-ownership.d.ts.map +1 -1
- package/dist/dsh/native-execution-ownership.js +0 -2
- package/dist/dsh/native-execution-ownership.js.map +1 -1
- package/dist/dsh/native-worker-routing.d.ts.map +1 -1
- package/dist/dsh/native-worker-routing.js +7 -2
- package/dist/dsh/native-worker-routing.js.map +1 -1
- package/dist/dsh/on-demand-intake.d.ts.map +1 -1
- package/dist/dsh/on-demand-intake.js +17 -8
- package/dist/dsh/on-demand-intake.js.map +1 -1
- package/dist/dsh/orchestration/execution-owner.d.ts +3 -1
- package/dist/dsh/orchestration/execution-owner.d.ts.map +1 -1
- package/dist/dsh/orchestration/execution-owner.js.map +1 -1
- package/dist/dsh/owned-execution.js +1 -1
- package/dist/dsh/owned-execution.js.map +1 -1
- package/dist/dsh/replay-memory-extract.d.ts.map +1 -1
- package/dist/dsh/replay-memory-extract.js +15 -1
- package/dist/dsh/replay-memory-extract.js.map +1 -1
- package/dist/dsh/repository-learning.d.ts.map +1 -1
- package/dist/dsh/repository-learning.js +3 -0
- package/dist/dsh/repository-learning.js.map +1 -1
- package/dist/dsh/runtime.d.ts +10 -2
- package/dist/dsh/runtime.d.ts.map +1 -1
- package/dist/dsh/runtime.js +22 -43
- package/dist/dsh/runtime.js.map +1 -1
- package/dist/dsh/semantic-compaction/policy.js +1 -1
- package/dist/dsh/semantic-compaction/policy.js.map +1 -1
- package/dist/dsh/session-bridge.d.ts +1 -1
- package/dist/dsh/session-bridge.d.ts.map +1 -1
- package/dist/dsh/session-bridge.js +1 -1
- package/dist/dsh/session-bridge.js.map +1 -1
- package/dist/dsh/session-memory-finalizer.js +1 -1
- package/dist/dsh/session-memory-finalizer.js.map +1 -1
- package/dist/dsh/session-review-context.d.ts.map +1 -1
- package/dist/dsh/session-review-context.js +3 -16
- package/dist/dsh/session-review-context.js.map +1 -1
- package/dist/dsh/setup.d.ts +1 -1
- package/dist/dsh/setup.d.ts.map +1 -1
- package/dist/dsh/skill-compiler.js +1 -1
- package/dist/dsh/skill-compiler.js.map +1 -1
- package/dist/dsh/skill-prompt-contracts.d.ts +2 -2
- package/dist/dsh/skill-prompt-contracts.js +1 -1
- package/dist/dsh/skill-prompts.json +1 -1
- package/dist/dsh/standard-skills.d.ts +1 -8
- package/dist/dsh/standard-skills.d.ts.map +1 -1
- package/dist/dsh/standard-skills.js +1 -8
- package/dist/dsh/standard-skills.js.map +1 -1
- package/dist/dsh/task-authority-context.d.ts +3 -0
- package/dist/dsh/task-authority-context.d.ts.map +1 -1
- package/dist/dsh/task-authority-context.js +3 -0
- package/dist/dsh/task-authority-context.js.map +1 -1
- package/dist/dsh/task-completion-guidance.d.ts +1 -5
- package/dist/dsh/task-completion-guidance.d.ts.map +1 -1
- package/dist/dsh/task-completion-guidance.js +4 -6
- package/dist/dsh/task-completion-guidance.js.map +1 -1
- package/dist/dsh/task-completion-host.js +4 -4
- package/dist/dsh/task-completion-host.js.map +1 -1
- package/dist/dsh/task-completion.d.ts +1 -13
- package/dist/dsh/task-completion.d.ts.map +1 -1
- package/dist/dsh/task-completion.js +9 -104
- package/dist/dsh/task-completion.js.map +1 -1
- package/dist/dsh/task-intake.d.ts +2 -3
- package/dist/dsh/task-intake.d.ts.map +1 -1
- package/dist/dsh/task-intake.js +90 -86
- package/dist/dsh/task-intake.js.map +1 -1
- package/dist/dsh/task-state.d.ts.map +1 -1
- package/dist/dsh/task-state.js +0 -8
- package/dist/dsh/task-state.js.map +1 -1
- package/dist/dsh/tool-exposure.d.ts +1 -1
- package/dist/dsh/tool-exposure.d.ts.map +1 -1
- package/dist/dsh/tool-exposure.js +0 -2
- package/dist/dsh/tool-exposure.js.map +1 -1
- package/dist/dsh/tool-policy.d.ts +5 -8
- package/dist/dsh/tool-policy.d.ts.map +1 -1
- package/dist/dsh/tool-policy.js +3 -35
- package/dist/dsh/tool-policy.js.map +1 -1
- package/dist/dsh/tools.d.ts +2 -6
- package/dist/dsh/tools.d.ts.map +1 -1
- package/dist/dsh/tools.js +7 -63
- package/dist/dsh/tools.js.map +1 -1
- package/dist/dsh/turn-process.d.ts +0 -93
- package/dist/dsh/turn-process.d.ts.map +1 -1
- package/dist/dsh/turn-process.js +1 -307
- package/dist/dsh/turn-process.js.map +1 -1
- package/dist/dsh/user-interaction.d.ts +9 -16
- package/dist/dsh/user-interaction.d.ts.map +1 -1
- package/dist/dsh/user-interaction.js +19 -158
- package/dist/dsh/user-interaction.js.map +1 -1
- package/dist/index.js +2 -19
- package/dist/ledger/types.d.ts +1 -1
- package/dist/ledger/types.d.ts.map +1 -1
- package/dist/ledger/types.js +0 -7
- package/dist/ledger/types.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/correction-contract.d.ts +4 -4
- package/dist/memory/lifecycle.d.ts +1 -1
- package/dist/memory/review/evidence.js +1 -1
- package/dist/memory/review/evidence.js.map +1 -1
- package/dist/model-tools/contracts.d.ts +0 -437
- package/dist/model-tools/contracts.d.ts.map +1 -1
- package/dist/model-tools/contracts.js +0 -13
- package/dist/model-tools/contracts.js.map +1 -1
- package/dist/model-tools/names.d.ts +1 -1
- package/dist/model-tools/names.d.ts.map +1 -1
- package/dist/model-tools/names.js +0 -7
- package/dist/model-tools/names.js.map +1 -1
- package/dist/model-tools/registry.js +1 -1
- package/dist/model-tools/registry.js.map +1 -1
- package/dist/models-client.cjs +2 -2
- package/dist/models-client.js +2 -2
- package/dist/models-client.js.map +1 -1
- package/docs/README.ja.md +0 -1
- package/docs/README.md +0 -1
- package/docs/agenticreplay-recording.md +1 -1
- package/docs/agenticreplay-verification.md +1 -1
- package/docs/answer-review.md +2 -2
- package/docs/architecture.md +4 -7
- package/docs/auto-memory-review.md +3 -3
- package/docs/coding-workflow.md +1 -1
- package/docs/concepts.ja.md +3 -5
- package/docs/concepts.md +3 -5
- package/docs/core-modules.md +5 -16
- package/docs/database.md +5 -10
- package/docs/decision-diagnostics.md +1 -2
- package/docs/deep-planning.md +3 -3
- package/docs/dsh-plugin.md +42 -178
- package/docs/execution-ledger.md +1 -2
- package/docs/execution-support.md +6 -7
- package/docs/harness-map.md +1 -1
- package/docs/japanese-output.md +1 -1
- package/docs/keyboard-shortcuts.md +1 -1
- package/docs/kiokuko-harness.md +71 -0
- package/docs/kiokuko-models.md +4 -9
- package/docs/lisp-hot-tools.md +12 -7
- package/docs/lisp.md +43 -9
- package/docs/memory-application.md +5 -5
- package/docs/memory-delivery.md +1 -1
- package/docs/memory-reuse.md +1 -1
- package/docs/model-selection.ja.md +40 -123
- package/docs/model-selection.md +45 -114
- package/docs/on-demand-intake.md +2 -2
- package/docs/owned-execution.md +7 -7
- package/docs/pr72-ci-verification.md +2 -2
- package/docs/pstack-adaptation.json +0 -34
- package/docs/pstack-skills.md +1 -1
- package/docs/semantic-compaction.md +2 -2
- package/docs/session-history-repair.md +2 -2
- package/docs/skill-compiler.md +2 -4
- package/docs/tool-exposure.md +1 -1
- package/docs/typed-decisions.md +1 -9
- package/docs/verification.md +11 -7
- package/dsh/cordis.legacy.patch.yml +7 -0
- package/dsh/cordis.patch.yml +6 -1
- package/lisp/supervisor.mjs +16 -7
- package/lisp/tools.lisp +1 -1
- package/migrations/051_drop_enno.sql +19 -0
- package/package.json +5 -14
- package/scripts/session-history-codec.mjs +1 -1
- package/skills/coding-ideal-routine-skill/SKILL.md +1 -1
- package/skills/kiokuko-lisp/SKILL.md +11 -5
- package/skills/kiokuko-single-purpose-functions/SKILL.md +1 -1
- package/skills/kiokuko-ui-design-soul/SKILL.md +2 -2
- package/skills/one-shot-software-completion/SKILL.md +4 -7
- package/skills/one-shot-software-completion/references/boundaries-and-lifecycle.md +3 -5
- package/dist/dsh/advisory-runner.d.ts +0 -32
- package/dist/dsh/advisory-runner.d.ts.map +0 -1
- package/dist/dsh/advisory-runner.js +0 -116
- package/dist/dsh/advisory-runner.js.map +0 -1
- package/dist/dsh/completion-verifiers.d.ts +0 -45
- package/dist/dsh/completion-verifiers.d.ts.map +0 -1
- package/dist/dsh/completion-verifiers.js +0 -9
- package/dist/dsh/completion-verifiers.js.map +0 -1
- package/dist/dsh/continuation.d.ts +0 -24
- package/dist/dsh/continuation.d.ts.map +0 -1
- package/dist/dsh/continuation.js +0 -215
- package/dist/dsh/continuation.js.map +0 -1
- package/dist/dsh/decisions/check-model.d.ts +0 -6
- package/dist/dsh/decisions/check-model.d.ts.map +0 -1
- package/dist/dsh/decisions/check-model.js +0 -36
- package/dist/dsh/decisions/check-model.js.map +0 -1
- package/dist/dsh/decisions/plan-review.d.ts +0 -17
- package/dist/dsh/decisions/plan-review.d.ts.map +0 -1
- package/dist/dsh/decisions/plan-review.js +0 -68
- package/dist/dsh/decisions/plan-review.js.map +0 -1
- package/dist/dsh/directive-projection.d.ts +0 -7
- package/dist/dsh/directive-projection.d.ts.map +0 -1
- package/dist/dsh/directive-projection.js +0 -32
- package/dist/dsh/directive-projection.js.map +0 -1
- package/dist/dsh/enno-controller.d.ts +0 -132
- package/dist/dsh/enno-controller.d.ts.map +0 -1
- package/dist/dsh/enno-controller.js +0 -368
- package/dist/dsh/enno-controller.js.map +0 -1
- package/dist/dsh/enno-delegation.d.ts +0 -36
- package/dist/dsh/enno-delegation.d.ts.map +0 -1
- package/dist/dsh/enno-delegation.js +0 -203
- package/dist/dsh/enno-delegation.js.map +0 -1
- package/dist/dsh/enno-memory-refresh-store.d.ts +0 -26
- package/dist/dsh/enno-memory-refresh-store.d.ts.map +0 -1
- package/dist/dsh/enno-memory-refresh-store.js +0 -45
- package/dist/dsh/enno-memory-refresh-store.js.map +0 -1
- package/dist/dsh/enno-memory-refresh.d.ts +0 -57
- package/dist/dsh/enno-memory-refresh.d.ts.map +0 -1
- package/dist/dsh/enno-memory-refresh.js +0 -280
- package/dist/dsh/enno-memory-refresh.js.map +0 -1
- package/dist/dsh/host-adapter/enno-memory-host.d.ts +0 -29
- package/dist/dsh/host-adapter/enno-memory-host.d.ts.map +0 -1
- package/dist/dsh/host-adapter/enno-memory-host.js +0 -49
- package/dist/dsh/host-adapter/enno-memory-host.js.map +0 -1
- package/dist/dsh/modules/enno.d.ts +0 -70
- package/dist/dsh/modules/enno.d.ts.map +0 -1
- package/dist/dsh/modules/enno.js +0 -22
- package/dist/dsh/modules/enno.js.map +0 -1
- package/dist/dsh/verification-identity.d.ts +0 -3
- package/dist/dsh/verification-identity.d.ts.map +0 -1
- package/dist/dsh/verification-identity.js +0 -15
- package/dist/dsh/verification-identity.js.map +0 -1
- package/dist/enno-oduno/advisory-store.d.ts +0 -31
- package/dist/enno-oduno/advisory-store.d.ts.map +0 -1
- package/dist/enno-oduno/advisory-store.js +0 -105
- package/dist/enno-oduno/advisory-store.js.map +0 -1
- package/dist/enno-oduno/advisory.d.ts +0 -18
- package/dist/enno-oduno/advisory.d.ts.map +0 -1
- package/dist/enno-oduno/advisory.js +0 -311
- package/dist/enno-oduno/advisory.js.map +0 -1
- package/dist/enno-oduno/coding-workflow.d.ts +0 -39
- package/dist/enno-oduno/coding-workflow.d.ts.map +0 -1
- package/dist/enno-oduno/coding-workflow.js +0 -33
- package/dist/enno-oduno/coding-workflow.js.map +0 -1
- package/dist/enno-oduno/confirmation.d.ts +0 -4
- package/dist/enno-oduno/confirmation.d.ts.map +0 -1
- package/dist/enno-oduno/confirmation.js +0 -146
- package/dist/enno-oduno/confirmation.js.map +0 -1
- package/dist/enno-oduno/directives.d.ts +0 -10
- package/dist/enno-oduno/directives.d.ts.map +0 -1
- package/dist/enno-oduno/directives.js +0 -294
- package/dist/enno-oduno/directives.js.map +0 -1
- package/dist/enno-oduno/experts.d.ts +0 -3
- package/dist/enno-oduno/experts.d.ts.map +0 -1
- package/dist/enno-oduno/experts.js +0 -28
- package/dist/enno-oduno/experts.js.map +0 -1
- package/dist/enno-oduno/handoff.d.ts +0 -4
- package/dist/enno-oduno/handoff.d.ts.map +0 -1
- package/dist/enno-oduno/handoff.js +0 -18
- package/dist/enno-oduno/handoff.js.map +0 -1
- package/dist/enno-oduno/language.d.ts +0 -4
- package/dist/enno-oduno/language.d.ts.map +0 -1
- package/dist/enno-oduno/language.js +0 -6
- package/dist/enno-oduno/language.js.map +0 -1
- package/dist/enno-oduno/memory-focus.d.ts +0 -32
- package/dist/enno-oduno/memory-focus.d.ts.map +0 -1
- package/dist/enno-oduno/memory-focus.js +0 -87
- package/dist/enno-oduno/memory-focus.js.map +0 -1
- package/dist/enno-oduno/memory-refresh-policy.d.ts +0 -17
- package/dist/enno-oduno/memory-refresh-policy.d.ts.map +0 -1
- package/dist/enno-oduno/memory-refresh-policy.js +0 -11
- package/dist/enno-oduno/memory-refresh-policy.js.map +0 -1
- package/dist/enno-oduno/memory-verification.d.ts +0 -7
- package/dist/enno-oduno/memory-verification.d.ts.map +0 -1
- package/dist/enno-oduno/memory-verification.js +0 -59
- package/dist/enno-oduno/memory-verification.js.map +0 -1
- package/dist/enno-oduno/plan-draft.d.ts +0 -15
- package/dist/enno-oduno/plan-draft.d.ts.map +0 -1
- package/dist/enno-oduno/plan-draft.js +0 -20
- package/dist/enno-oduno/plan-draft.js.map +0 -1
- package/dist/enno-oduno/plan-recovery.d.ts +0 -44
- package/dist/enno-oduno/plan-recovery.d.ts.map +0 -1
- package/dist/enno-oduno/plan-recovery.js +0 -160
- package/dist/enno-oduno/plan-recovery.js.map +0 -1
- package/dist/enno-oduno/repository-state.d.ts +0 -10
- package/dist/enno-oduno/repository-state.d.ts.map +0 -1
- package/dist/enno-oduno/repository-state.js +0 -146
- package/dist/enno-oduno/repository-state.js.map +0 -1
- package/dist/enno-oduno/sanitize.d.ts +0 -17
- package/dist/enno-oduno/sanitize.d.ts.map +0 -1
- package/dist/enno-oduno/sanitize.js +0 -88
- package/dist/enno-oduno/sanitize.js.map +0 -1
- package/dist/enno-oduno/schemas.d.ts +0 -968
- package/dist/enno-oduno/schemas.d.ts.map +0 -1
- package/dist/enno-oduno/schemas.js +0 -622
- package/dist/enno-oduno/schemas.js.map +0 -1
- package/dist/enno-oduno/service.d.ts +0 -62
- package/dist/enno-oduno/service.d.ts.map +0 -1
- package/dist/enno-oduno/service.js +0 -1505
- package/dist/enno-oduno/service.js.map +0 -1
- package/dist/enno-oduno/skills.d.ts +0 -22
- package/dist/enno-oduno/skills.d.ts.map +0 -1
- package/dist/enno-oduno/skills.js +0 -127
- package/dist/enno-oduno/skills.js.map +0 -1
- package/dist/enno-oduno/store.d.ts +0 -109
- package/dist/enno-oduno/store.d.ts.map +0 -1
- package/dist/enno-oduno/store.js +0 -833
- package/dist/enno-oduno/store.js.map +0 -1
- package/dist/enno-oduno/types.d.ts +0 -457
- package/dist/enno-oduno/types.d.ts.map +0 -1
- package/dist/enno-oduno/types.js +0 -66
- package/dist/enno-oduno/types.js.map +0 -1
- package/dist/enno-oduno/validation-errors.d.ts +0 -93
- package/dist/enno-oduno/validation-errors.d.ts.map +0 -1
- package/dist/enno-oduno/validation-errors.js +0 -159
- package/dist/enno-oduno/validation-errors.js.map +0 -1
- package/dist/enno-oduno/verifier.d.ts +0 -16
- package/dist/enno-oduno/verifier.d.ts.map +0 -1
- package/dist/enno-oduno/verifier.js +0 -271
- package/dist/enno-oduno/verifier.js.map +0 -1
- package/docs/enno-memory-benchmark.json +0 -761
- package/docs/enno-memory-evaluation.md +0 -137
- package/docs/enno-oduno.ja.md +0 -68
- package/docs/enno-oduno.md +0 -94
- package/skills/kiokuko-enno-oduno/SKILL.md +0 -64
- package/skills/kiokuko-enno-oduno/enno-oduno.png +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mkdtemp, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { CompiledLispCache } from './compiled-cache.js';
|
|
4
|
+
import { LispError } from './contracts.js';
|
|
5
|
+
import { prepareLayout } from './sandbox.js';
|
|
6
|
+
import { LispWorker } from './worker.js';
|
|
7
|
+
/** One host owns admission, startup and confirmed release for every Lisp child.
|
|
8
|
+
* The operation journals remain in LispManager; this supervisor never replays work. */
|
|
9
|
+
export class LispSupervisor {
|
|
10
|
+
config;
|
|
11
|
+
dataRoot;
|
|
12
|
+
library;
|
|
13
|
+
#children = new Map();
|
|
14
|
+
#restarts = new WeakMap();
|
|
15
|
+
#compiled;
|
|
16
|
+
constructor(config, dataRoot, library) {
|
|
17
|
+
this.config = config;
|
|
18
|
+
this.dataRoot = dataRoot;
|
|
19
|
+
this.library = library;
|
|
20
|
+
this.#compiled = new CompiledLispCache(join(dataRoot, 'compiled'), library, config);
|
|
21
|
+
}
|
|
22
|
+
async start(owner, assignment) {
|
|
23
|
+
assignment.assertCurrent();
|
|
24
|
+
// Reserve synchronously, before compilation or filesystem awaits. A broken
|
|
25
|
+
// child retains its slot until the OS confirms it and its jobs have stopped.
|
|
26
|
+
for (const [key, child] of this.#children)
|
|
27
|
+
if (child?.stopped)
|
|
28
|
+
this.#children.delete(key);
|
|
29
|
+
if (this.#children.has(owner))
|
|
30
|
+
throw new LispError('BUSY', 'この所有者の Lisp は起動中または実行中です。');
|
|
31
|
+
if (this.#children.size >= this.config.maxWorkers)
|
|
32
|
+
throw new LispError('WORKER_LIMIT', 'Lisp の起動枠はすべて使用中です。既存の worker と状態は保持します。');
|
|
33
|
+
this.#children.set(owner, undefined);
|
|
34
|
+
let worker;
|
|
35
|
+
try {
|
|
36
|
+
const compiled = await this.#compiled.ensure(assignment.signal, status => assignment.compilation?.(status));
|
|
37
|
+
assignment.assertCurrent();
|
|
38
|
+
const base = await mkdtemp(join(this.dataRoot, 'w-'));
|
|
39
|
+
const layout = await prepareLayout(base, this.library);
|
|
40
|
+
layout.compiled = compiled.path;
|
|
41
|
+
if (assignment.workspace)
|
|
42
|
+
layout.workspace = assignment.workspace;
|
|
43
|
+
layout.protected = true;
|
|
44
|
+
assignment.assertCurrent();
|
|
45
|
+
worker = new LispWorker(layout, { ...this.config, executionMode: assignment.executionMode }, assignment.hostCall, assignment.rpcAllowed, assignment.beforeJob, assignment.auditJob, error => { if (worker)
|
|
46
|
+
assignment.failed?.(worker, error); });
|
|
47
|
+
assignment.assigned(worker);
|
|
48
|
+
await worker.start();
|
|
49
|
+
this.#children.set(owner, worker);
|
|
50
|
+
assignment.assertCurrent();
|
|
51
|
+
const canary = join(base, 'host-canary');
|
|
52
|
+
await writeFile(canary, 'protected', { mode: 0o600 });
|
|
53
|
+
const path = JSON.stringify(canary);
|
|
54
|
+
const probe = await assignment.inspect(worker, `(let ((read-denied (handler-case (progn (with-open-file (s ${path}) (read-char s)) nil) (file-error () t))) (delete-denied (handler-case (progn (delete-file ${path}) nil) (file-error () t)))) (unless (and read-denied delete-denied) (error "ISOLATION_FAILED")) (kioku.files:write-text (merge-pathnames "probe" (kioku.files:scratch)) "ok") :protected)`);
|
|
55
|
+
if (!probe.ok || await readFile(canary, 'utf8') !== 'protected')
|
|
56
|
+
throw new LispError('ISOLATION_FAILED', 'OS によるファイル保護を確認できません。');
|
|
57
|
+
assignment.assertCurrent();
|
|
58
|
+
return worker;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (worker) {
|
|
62
|
+
// Keep the exact child even when startup or termination is unconfirmed.
|
|
63
|
+
this.#children.set(owner, worker);
|
|
64
|
+
await this.stop(worker);
|
|
65
|
+
}
|
|
66
|
+
else
|
|
67
|
+
this.#children.delete(owner);
|
|
68
|
+
throw error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async stop(worker) {
|
|
72
|
+
if (!worker)
|
|
73
|
+
return;
|
|
74
|
+
await worker.stop();
|
|
75
|
+
for (const [owner, child] of this.#children)
|
|
76
|
+
if (child === worker)
|
|
77
|
+
this.#children.delete(owner);
|
|
78
|
+
}
|
|
79
|
+
/** Bound fault replacements, not ordinary idle/cold starts. No retry timer or queue. */
|
|
80
|
+
admitRestart(owner) {
|
|
81
|
+
const now = Date.now(), recent = (this.#restarts.get(owner) ?? []).filter(at => now - at < 60_000);
|
|
82
|
+
if (recent.length >= 2)
|
|
83
|
+
return false;
|
|
84
|
+
this.#restarts.set(owner, [...recent, now]);
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
assertCompilationStopped() { this.#compiled.assertStopped(); }
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=supervision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervision.js","sourceRoot":"","sources":["../../../src/dsh/lisp/supervision.ts"],"names":[],"mappings":"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"}
|
|
@@ -40,12 +40,12 @@ export declare const ToolInput: z.ZodObject<{
|
|
|
40
40
|
leftRef: z.ZodOptional<z.ZodString>;
|
|
41
41
|
rightRef: z.ZodOptional<z.ZodString>;
|
|
42
42
|
target: z.ZodOptional<z.ZodEnum<{
|
|
43
|
-
build: "build";
|
|
44
43
|
package: "package";
|
|
44
|
+
build: "build";
|
|
45
45
|
lisp: "lisp";
|
|
46
46
|
test: "test";
|
|
47
|
-
typecheck: "typecheck";
|
|
48
47
|
vendor: "vendor";
|
|
48
|
+
typecheck: "typecheck";
|
|
49
49
|
}>>;
|
|
50
50
|
script: z.ZodOptional<z.ZodString>;
|
|
51
51
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/dsh/lisp/surface.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAA;AAI1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAM1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../../src/dsh/lisp/surface.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAA;AAI1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAM1D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAoB1C,OAAO,EAAkE,KAAK,iBAAiB,EAAkB,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AA8DtJ,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAa8F,CAAA;AAEpH,uFAAuF;AACvF,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,eAAe,EAAE,kBAAkB,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC;IAAE,IAAI,IAAI,IAAI,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC,CAuuB/R;AAkBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAiCrD"}
|
package/dist/dsh/lisp/surface.js
CHANGED
|
@@ -6,7 +6,7 @@ import { nativeStopReceipt } from './native-stop-receipt.js';
|
|
|
6
6
|
import { canonicalContentHash } from '../../serialization/validate.js';
|
|
7
7
|
import { isCodingWorkflowTool } from '../coding-workflow/host.js';
|
|
8
8
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
9
|
-
import { rememberLispImplementation, isLispConversation, rootLispAdmission, withLispNativeCommand, isLispNativeCommand, isLispNativeCommandFence } from '../lisp-tool-identity.js';
|
|
9
|
+
import { rememberLispImplementation, isLispConversation, rootLispAdmission, withRootLispAdmission, withLispNativeCommand, isLispNativeCommand, isLispNativeCommandFence } from '../lisp-tool-identity.js';
|
|
10
10
|
import { assertProtocolRoute } from '../guardrail/service.js';
|
|
11
11
|
import { isOwnedExecutionCall } from '../owned-execution.js';
|
|
12
12
|
import { CodeIntelligenceAdapterV1 } from './code-intelligence.js';
|
|
@@ -34,6 +34,7 @@ import { mountLispHttp } from './http.js';
|
|
|
34
34
|
import { createLispCiAdapter } from './ci.js';
|
|
35
35
|
import { createLispPackageAdapter } from './packages.js';
|
|
36
36
|
import { withTaskAuthority } from '../task-authority-context.js';
|
|
37
|
+
import { isNativeSubagent } from '../native-subagent.js';
|
|
37
38
|
import { TASK_AUTHORITY } from '../task-state.js';
|
|
38
39
|
import { createLispMemoryVerification } from './memory-verification.js';
|
|
39
40
|
import { isSavedLispResultRead } from '../memory-application.js';
|
|
@@ -117,10 +118,11 @@ export const ToolInput = z.object({ operationId: identifier.optional(), code: z.
|
|
|
117
118
|
export async function mountLispSurface(ctx, runtime, config, skillPrompts, decisions, semanticCompaction) {
|
|
118
119
|
const root = (ctx.root ?? ctx);
|
|
119
120
|
const tools = root.get('tools', false);
|
|
121
|
+
const pluginTools = ctx.get('tools', false);
|
|
120
122
|
const agents = root.get('agents', false);
|
|
121
123
|
const sessions = root.get('sessions', false);
|
|
122
124
|
const commands = ctx.get('commands', false);
|
|
123
|
-
if (!tools || !agents || !sessions || !commands)
|
|
125
|
+
if (!tools || !pluginTools || !agents || !sessions || !commands)
|
|
124
126
|
fail('HOST_CAPABILITY_MISSING', 'Lisp には DSH のツール・セッション・コマンドサービスが必要です。');
|
|
125
127
|
const dispatchHostTool = await createLispHostDispatch(ctx, tools);
|
|
126
128
|
const questions = ctx.get('userQuestions', false);
|
|
@@ -377,6 +379,19 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
377
379
|
&& tools.get(active.name, active.agent)?.execute === active.pinned.execute && isOwnedExecutionCall(execution));
|
|
378
380
|
};
|
|
379
381
|
const disposers = [];
|
|
382
|
+
// Native children compose their preset, not the parent's agent-local tools.
|
|
383
|
+
// Publish restrictable descriptors before child creation. Only an admitted
|
|
384
|
+
// session's local implementations can execute; the persistent guard also
|
|
385
|
+
// rejects these unbound descriptors. Native allow/deny masks remain visible.
|
|
386
|
+
// Registrations belong to this activation, not the host root's lifetime.
|
|
387
|
+
// The independent host fence above still denies effects after plugin unload.
|
|
388
|
+
if (config.enabled)
|
|
389
|
+
for (const name of LISP_TOOLS)
|
|
390
|
+
disposers.push(pluginTools.register({
|
|
391
|
+
name, description: description(name), modelFacing: true, parameters: lispToolSchema(name),
|
|
392
|
+
output: { schema: {}, render: (_, result) => [{ type: 'text', text: renderResult(result) }] },
|
|
393
|
+
execute: async () => failure(new LispError('LISP_DISABLED', 'This session has no admitted Lisp worker.')),
|
|
394
|
+
}, { when: () => false }));
|
|
380
395
|
if (semanticCompaction)
|
|
381
396
|
for (const tool of ['lisp_eval', 'lisp_inspect'])
|
|
382
397
|
disposers.push(semanticCompaction.registerProjector(tool, renderHistoryResult));
|
|
@@ -456,6 +471,9 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
456
471
|
const local = [];
|
|
457
472
|
agentDisposers.set(agent.id, local);
|
|
458
473
|
const scopedTools = agent.ctx.get('tools');
|
|
474
|
+
// A child-local registration must not reintroduce capabilities hidden by
|
|
475
|
+
// its native inherited-tool filter. Metadata alone cannot widen its scope.
|
|
476
|
+
const inheritedLisp = isNativeSubagent(agent) ? new Set(tools.schemas(agent).map(tool => tool.name)) : undefined;
|
|
459
477
|
// Current hosts own native/PTC selection for the Agent's lifetime. Preserve
|
|
460
478
|
// that selection. Protected scopes retain their monotonic registry guards;
|
|
461
479
|
// reserved PTC transport is denied before its program can execute.
|
|
@@ -501,6 +519,8 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
501
519
|
// Lisp and owned/native tools coexist. A worker failure does not restrict
|
|
502
520
|
// the inherited development surface.
|
|
503
521
|
for (const name of LISP_TOOLS) {
|
|
522
|
+
if (inheritedLisp && !inheritedLisp.has(name))
|
|
523
|
+
continue;
|
|
504
524
|
const definition = { name, get description() { return `${description(name)} Current Lisp approval mode: ${approvalPolicy.mode()} (profile).`; }, modelFacing: true,
|
|
505
525
|
parameters: lispToolSchema(name), output: { schema: {}, render: (_, result) => [{ type: 'text', text: renderResult(result) }] },
|
|
506
526
|
execute: async (args, execution) => {
|
|
@@ -628,7 +648,8 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
628
648
|
registeredAgents.add(agent);
|
|
629
649
|
const prompt = agent.ctx.get('systemPrompt', false);
|
|
630
650
|
if (prompt) {
|
|
631
|
-
|
|
651
|
+
if (!policyPrompt)
|
|
652
|
+
local.push(prompt.section({ name: 'kiokuko:lisp', order: -90000, text: guide }));
|
|
632
653
|
if (!policyPrompt)
|
|
633
654
|
local.push(prompt.section({ name: 'kiokuko:lisp-approval', order: -89999, text: approvalText }));
|
|
634
655
|
}
|
|
@@ -774,6 +795,38 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
774
795
|
}), manualSelected: (agent) => manualMode(agent), manualOverride: (agent) => preparation.manualOverride(agent), selectTask: (input, choice, answerRef) => preparation.selectTask(input, choice, answerRef), prepareNative: (input) => preparation.prepare(input), choiceFor: (agent, task) => preparation.choiceFor(agent, task),
|
|
775
796
|
cancelled: (agent, task) => preparation.cancelled(agent, task),
|
|
776
797
|
answered: (agent, task, choice, answerRef) => preparation.answered(agent, task, choice, answerRef) }));
|
|
798
|
+
const workerRouter = (binding) => {
|
|
799
|
+
const parentId = binding.agent.session.header.parentSession, parent = parentId ? agents.get(parentId) : undefined;
|
|
800
|
+
return () => !!parent && agents.get(parent.id) === parent && sessions.get(parent.session.id) === parent.session
|
|
801
|
+
&& agents.isOwnedBy?.(binding.agent.id, parent) === true && manager.enabled.get(parent.session.id) === binding.owner.root;
|
|
802
|
+
};
|
|
803
|
+
const admitWorker = async (candidate, signal) => {
|
|
804
|
+
const binding = owner(candidate);
|
|
805
|
+
if (!config.enabled || !isNativeSubagent(binding.agent))
|
|
806
|
+
return;
|
|
807
|
+
const liveParent = workerRouter(binding);
|
|
808
|
+
if (!liveParent() || !tools.schemas(binding.agent).some(tool => LISP_TOOLS.includes(tool.name)))
|
|
809
|
+
return;
|
|
810
|
+
// The router shares the execution preference, never its process,
|
|
811
|
+
// heap or task lease. Each work session owns a persistent runtime.
|
|
812
|
+
hostFence?.protect(binding.owner.sessionId);
|
|
813
|
+
try {
|
|
814
|
+
const status = await manager.enableSessionWorker(binding.owner, binding.agent.status === 'running', signal ? AbortSignal.any([binding.signal, signal]) : binding.signal);
|
|
815
|
+
owner(candidate);
|
|
816
|
+
if (!liveParent()) {
|
|
817
|
+
await manager.disable(binding.owner);
|
|
818
|
+
fail('SESSION_MISMATCH', 'Worker router ownership changed during startup.');
|
|
819
|
+
}
|
|
820
|
+
if (!['READY', 'EVALUATING'].includes(status.state))
|
|
821
|
+
fail('RECOVERY_REQUIRED', 'The session Lisp worker must be recovered before continuing.');
|
|
822
|
+
}
|
|
823
|
+
finally {
|
|
824
|
+
if (!binding.signal.aborted && manager.enabled.has(binding.owner.sessionId))
|
|
825
|
+
register(binding.agent);
|
|
826
|
+
else if (!manager.enabled.has(binding.owner.sessionId))
|
|
827
|
+
hostFence?.release(binding.owner.sessionId);
|
|
828
|
+
}
|
|
829
|
+
};
|
|
777
830
|
const requestSurface = {
|
|
778
831
|
capabilities: LISP_TOOLS.map(name => ({ name, description: description(name) })),
|
|
779
832
|
inventory: candidate => inventoryReaders.get(candidate.id)?.() ?? tools.schemas(candidate),
|
|
@@ -816,21 +869,25 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
816
869
|
},
|
|
817
870
|
async project(candidate, assembly) {
|
|
818
871
|
const binding = owner(candidate);
|
|
872
|
+
await admitWorker(candidate);
|
|
819
873
|
const workflow = await runtime.withDatabase(db => sessionCodingWorkflow(db, binding.owner.sessionId));
|
|
820
874
|
if (workflow && (!development || workflow.protocol || !isLispConversation(candidate)) && (workflow.choice.state !== 'yes' || ['preparing', 'awaiting_lisp_choice', 'cancelled', 'superseded', 'completed'].includes(workflow.state))) {
|
|
821
875
|
unregister(binding.agent);
|
|
822
876
|
const surface = assembly;
|
|
823
877
|
return { ...assembly, tools: surface.tools?.filter(tool => !LISP_TOOLS.includes(tool.name)) ?? [] };
|
|
824
878
|
}
|
|
825
|
-
if (!manager.enabled.has(binding.owner.sessionId))
|
|
826
|
-
|
|
879
|
+
if (!manager.enabled.has(binding.owner.sessionId)) {
|
|
880
|
+
const surface = assembly;
|
|
881
|
+
return { ...assembly, sections: [...assembly.sections, { name: 'kiokuko:lisp-coding-preparation', text: JSON.stringify(preparation.status(binding.agent)) }],
|
|
882
|
+
...(surface.tools ? { tools: surface.tools.filter(tool => !LISP_TOOLS.includes(tool.name)) } : {}) };
|
|
883
|
+
}
|
|
827
884
|
register(binding.agent);
|
|
828
885
|
// Native DSH snapshots providers before its assembly waterfall. Admission
|
|
829
886
|
// can activate Lisp inside that waterfall: refresh this request, not only
|
|
830
887
|
// the next one. Use native visibility plus the exact guarded definitions.
|
|
831
888
|
const schemas = tools.schemas(binding.agent).filter(schema => development || fence.definitions.get(`${candidate.id}:${schema.name}`) === tools.get(schema.name, binding.agent));
|
|
832
|
-
|
|
833
|
-
|
|
889
|
+
// Native scopes may intentionally expose only a subset. Preserve their
|
|
890
|
+
// exact schemas instead of turning one denied capability into a turn gate.
|
|
834
891
|
const sections = assembly.sections.filter(section => section.name !== 'kiokuko:lisp');
|
|
835
892
|
sections.splice(Math.max(0, sections.findIndex(section => section.name === 'kiokuko:soul') + 1), 0, { name: 'kiokuko:lisp', text: '{{kiokuko_lisp}}' });
|
|
836
893
|
sections.push({ name: 'kiokuko:lisp-coding-preparation', text: JSON.stringify(preparation.status(binding.agent)) });
|
|
@@ -842,6 +899,43 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
842
899
|
},
|
|
843
900
|
};
|
|
844
901
|
disposers.push(ctx.provide(LISP_ASSEMBLY_SERVICE, requestSurface));
|
|
902
|
+
// Bind before DSH captures the first step's executable tool set. Prompt-only
|
|
903
|
+
// registration is too late: the model can see tools that cannot dispatch.
|
|
904
|
+
disposers.push(ctx.on('agent/created', async (event) => {
|
|
905
|
+
if (isNativeSubagent(event.agent))
|
|
906
|
+
await admitWorker(event.agent, event.signal);
|
|
907
|
+
}, { global: true }));
|
|
908
|
+
// Native children deliberately bypass parent intake. Give their exact root
|
|
909
|
+
// Lisp dispatch its own command capability after native guards/approvals;
|
|
910
|
+
// never lend the router's task lease or admit arbitrary nested tool calls.
|
|
911
|
+
disposers.push(ctx.on('tools/execute', async (execution, next) => {
|
|
912
|
+
if (!development || execution.parent !== undefined || !execution.agent || !isNativeSubagent(execution.agent)
|
|
913
|
+
|| !LISP_TOOLS.includes(execution.name))
|
|
914
|
+
return next();
|
|
915
|
+
const binding = owner(execution.agent), liveParent = workerRouter(binding);
|
|
916
|
+
const definition = fence.definitions.get(`${binding.agent.id}:${execution.name}`);
|
|
917
|
+
if (!definition || tools.get(execution.name, binding.agent) !== definition || !await manager.isSessionWorker(binding.owner))
|
|
918
|
+
return next();
|
|
919
|
+
const execute = definition.execute, argumentsDigest = canonicalContentHash(execution.arguments);
|
|
920
|
+
const name = execution.name, callId = execution.callId, rootCallId = execution.rootCallId;
|
|
921
|
+
const current = () => {
|
|
922
|
+
try {
|
|
923
|
+
const now = owner(execution.agent);
|
|
924
|
+
return execution.agent === binding.agent && execution.name === name && execution.callId === callId && execution.rootCallId === rootCallId
|
|
925
|
+
&& !execution.signal?.aborted && !binding.signal.aborted && now.signal === binding.signal
|
|
926
|
+
&& now.owner.root === binding.owner.root && liveParent() && execution.parent === undefined
|
|
927
|
+
&& manager.enabled.get(binding.owner.sessionId) === binding.owner.root
|
|
928
|
+
&& tools.get(execution.name, binding.agent) === definition && definition.execute === execute
|
|
929
|
+
&& canonicalContentHash(execution.arguments) === argumentsDigest;
|
|
930
|
+
}
|
|
931
|
+
catch {
|
|
932
|
+
return false;
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
if (!current())
|
|
936
|
+
fail('SESSION_MISMATCH', 'The worker Lisp dispatch is no longer current.');
|
|
937
|
+
return withRootLispAdmission(execution, current, next);
|
|
938
|
+
}, { global: true }));
|
|
845
939
|
disposers.push(mountLispHttp(ctx, manager, (sessionId, recover) => {
|
|
846
940
|
const agent = agents.get(sessionId);
|
|
847
941
|
const binding = owner(agent);
|
|
@@ -951,13 +1045,13 @@ export async function mountLispSurface(ctx, runtime, config, skillPrompts, decis
|
|
|
951
1045
|
}
|
|
952
1046
|
function description(name) {
|
|
953
1047
|
return ({ lisp_eval: 'Evaluate Common Lisp, the selected route for computation and command orchestration while Lisp is ON. Use kioku.process:run / start-job for external programs including git, gh, builds and tests; direct native shell calls are rejected. Ordinary development does not require a preliminary prototype. Explicitly protected coding workflows require prototype:true and saved-result inspection before implementation. In persistent mode, define and reuse cohesive functions in one worker generation; proposals use the current host approval policy. In enable-task mode, each evaluation is a disposable scratch experiment without workspace inputs or proposals. Exact operationId replay never re-evaluates.',
|
|
954
|
-
lisp_hot_contract: 'Authorize immutable schemas through the current host approval policy and finite input/expected cases for a project-shared function. Profile auto-approval or explicit human consent grants approval; model declarations do not.
|
|
955
|
-
lisp_hot_install: 'Validate a candidate against the current approved contract in
|
|
1048
|
+
lisp_hot_contract: 'Authorize immutable schemas through the current host approval policy and finite input/expected cases for a project-shared function. Profile auto-approval or explicit human consent grants approval; model declarations do not. No task-mode switch is needed; publishing still requires current task authority.',
|
|
1049
|
+
lisp_hot_install: 'Validate a candidate against the current approved contract in protected scratch, then atomically select it at expectedRevision. Dependency code is snapshotted. Failed checks preserve the active version.',
|
|
956
1050
|
lisp_hot_call: 'Call a project-shared function by name, pinning its active immutable version. Input/result refs remain private to this session and agent. Exact operationId replay never executes again.',
|
|
957
1051
|
lisp_hot_status: 'Read project-shared function names, revisions and contract refs; paginate with offset. Supply name to inspect approved checks; contractOffset pages their JSON in 2000 Unicode characters. No worker execution.',
|
|
958
1052
|
lisp_hot_deactivate: 'Use the current host approval policy to deactivate a project-shared function at expectedRevision. Existing calls and results remain available; new calls stop.',
|
|
959
|
-
lisp_define: 'Save a generated Lisp lambda and exact dependency refs as a reusable task tool.
|
|
960
|
-
lisp_call: 'Run a saved task tool with JSON input or a saved resultRef.
|
|
1053
|
+
lisp_define: 'Save a generated Lisp lambda and exact dependency refs as a reusable task tool. No enable-task switch or Working task is needed. Compile and check examples in protected scratch; schemas do not grant host effects.',
|
|
1054
|
+
lisp_call: 'Run a saved task tool with JSON input or a saved resultRef. Reuse only your own protected worker; otherwise use private protected scratch with no repository mount or host RPC. Exact retries return the journal result.',
|
|
961
1055
|
lisp_observe: 'Capture explicitly named workspace files as immutable task input, returning a resultRef without sending contents to the model.',
|
|
962
1056
|
lisp_stage: 'Turn a generated result into a guarded, immutable workspace change candidate bound to an observed baseRef. No workspace write.',
|
|
963
1057
|
lisp_verify: 'Materialize one candidate from frozen observed bytes in private scratch, then run an approved host verifier. The receipt remains bound to that candidate; unknown test reporting is not a pass.',
|