@gajae-code/coding-agent 0.11.0 → 0.11.2
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/CHANGELOG.md +63 -1
- package/dist/types/async/job-manager.d.ts +46 -7
- package/dist/types/cli/config-cli.d.ts +11 -1
- package/dist/types/cli/notify-cli.d.ts +1 -0
- package/dist/types/cli/session-picker.d.ts +2 -1
- package/dist/types/cli/setup-cli.d.ts +1 -1
- package/dist/types/commands/mcp-serve.d.ts +33 -0
- package/dist/types/commands/mcp.d.ts +1 -1
- package/dist/types/commands/notify.d.ts +0 -2
- package/dist/types/commands/sdk.d.ts +1 -1
- package/dist/types/config/atomic-yaml-patch.d.ts +18 -0
- package/dist/types/config/file-lock.d.ts +14 -4
- package/dist/types/config/keybindings.d.ts +42 -1
- package/dist/types/config/model-auth.d.ts +3 -0
- package/dist/types/config/model-bindings-applier.d.ts +13 -0
- package/dist/types/config/model-discovery-manager.d.ts +49 -0
- package/dist/types/config/model-equivalence.d.ts +20 -0
- package/dist/types/config/model-registry.d.ts +16 -15
- package/dist/types/config/model-resolver.d.ts +28 -18
- package/dist/types/config/models-config-schema.d.ts +11 -0
- package/dist/types/config/settings-schema.d.ts +56 -1
- package/dist/types/config/settings.d.ts +14 -11
- package/dist/types/coordinator-mcp/policy.d.ts +5 -0
- package/dist/types/coordinator-mcp/question-gate-codec.d.ts +129 -0
- package/dist/types/coordinator-mcp/question-state.d.ts +356 -0
- package/dist/types/coordinator-mcp/server.d.ts +4 -0
- package/dist/types/discovery/helpers.d.ts +0 -6
- package/dist/types/edit/index.d.ts +3 -0
- package/dist/types/eval/py/env.d.ts +9 -0
- package/dist/types/extensibility/extensions/loader.d.ts +2 -1
- package/dist/types/extensibility/extensions/runner.d.ts +2 -2
- package/dist/types/extensibility/extensions/types.d.ts +34 -3
- package/dist/types/extensibility/hooks/runner.d.ts +1 -1
- package/dist/types/extensibility/shared-events.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +10 -1
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +44 -0
- package/dist/types/gjc-runtime/goal-mode-request.d.ts +11 -1
- package/dist/types/gjc-runtime/launch-worktree.d.ts +4 -2
- package/dist/types/gjc-runtime/linux-proc.d.ts +29 -0
- package/dist/types/gjc-runtime/session-resolution.d.ts +2 -2
- package/dist/types/gjc-runtime/state-migrations.d.ts +1 -1
- package/dist/types/gjc-runtime/state-writer.d.ts +2 -1
- package/dist/types/gjc-runtime/team-launch.d.ts +59 -0
- package/dist/types/gjc-runtime/team-notify.d.ts +45 -0
- package/dist/types/gjc-runtime/team-runtime.d.ts +29 -121
- package/dist/types/gjc-runtime/team-store.d.ts +160 -0
- package/dist/types/gjc-runtime/team-workers.d.ts +78 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +8 -0
- package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +13 -0
- package/dist/types/gjc-runtime/ultragoal-evidence.d.ts +38 -0
- package/dist/types/gjc-runtime/ultragoal-guard.d.ts +7 -0
- package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +23 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +11 -0
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +55 -33
- package/dist/types/gjc-runtime/workflow-cli-common.d.ts +8 -0
- package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -0
- package/dist/types/goals/continuation-timeout-guard.d.ts +22 -0
- package/dist/types/goals/runtime.d.ts +1 -0
- package/dist/types/goals/state.d.ts +8 -0
- package/dist/types/harness-control-plane/lifecycle-reconciliation.d.ts +17 -0
- package/dist/types/harness-control-plane/phase-rollup.d.ts +4 -7
- package/dist/types/harness-control-plane/receipt-ingest.d.ts +5 -0
- package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
- package/dist/types/hindsight/state.d.ts +11 -4
- package/dist/types/lsp/lspmux.d.ts +5 -3
- package/dist/types/lsp/path-trust.d.ts +1 -0
- package/dist/types/main.d.ts +3 -2
- package/dist/types/memories/storage.d.ts +1 -0
- package/dist/types/modes/action-registry.d.ts +29 -0
- package/dist/types/modes/components/chrome.d.ts +14 -0
- package/dist/types/modes/components/command-palette.d.ts +27 -0
- package/dist/types/modes/components/custom-provider-wizard.d.ts +1 -0
- package/dist/types/modes/components/index.d.ts +2 -1
- package/dist/types/modes/components/pet-selector.d.ts +1 -1
- package/dist/types/modes/components/plan-preview-overlay.d.ts +43 -0
- package/dist/types/modes/components/queue-mode-selector.d.ts +1 -1
- package/dist/types/modes/components/queue-pane.d.ts +12 -0
- package/dist/types/modes/components/read-tool-group.d.ts +6 -0
- package/dist/types/modes/components/session-observer-overlay.d.ts +3 -4
- package/dist/types/modes/components/sessions-dashboard.d.ts +32 -0
- package/dist/types/modes/components/settings-selector.d.ts +1 -1
- package/dist/types/modes/components/show-images-selector.d.ts +1 -1
- package/dist/types/modes/components/status-line/types.d.ts +1 -1
- package/dist/types/modes/components/status-line.d.ts +1 -94
- package/dist/types/modes/components/tasks-pane.d.ts +15 -0
- package/dist/types/modes/components/theme-selector.d.ts +1 -1
- package/dist/types/modes/components/tool-execution.d.ts +15 -0
- package/dist/types/modes/components/tool-status-header.d.ts +111 -0
- package/dist/types/modes/components/transcript-viewer-overlay.d.ts +42 -0
- package/dist/types/modes/controllers/command-controller.d.ts +2 -2
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +1 -0
- package/dist/types/modes/controllers/goal-mode-controller.d.ts +62 -0
- package/dist/types/modes/controllers/input-controller.d.ts +8 -1
- package/dist/types/modes/controllers/mode-gate.d.ts +8 -0
- package/dist/types/modes/controllers/plan-mode-controller.d.ts +65 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +15 -3
- package/dist/types/modes/controllers/stt-controller.d.ts +26 -0
- package/dist/types/modes/interactive-mode.d.ts +21 -19
- package/dist/types/modes/jobs-observer.d.ts +2 -0
- package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +4 -11
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +21 -2
- package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +31 -0
- package/dist/types/modes/tasks-aggregator.d.ts +39 -0
- package/dist/types/modes/transcript-item-registry.d.ts +60 -0
- package/dist/types/modes/types.d.ts +22 -15
- package/dist/types/modes/utils/ui-helpers.d.ts +2 -2
- package/dist/types/runtime-mcp/manager.d.ts +1 -1
- package/dist/types/sdk/broker/broker.d.ts +78 -12
- package/dist/types/sdk/broker/ensure.d.ts +9 -0
- package/dist/types/sdk/broker/lifecycle-codec.d.ts +4 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +15 -1
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -2
- package/dist/types/sdk/broker/process-incarnation.d.ts +2 -0
- package/dist/types/sdk/broker/session-index.d.ts +0 -1
- package/dist/types/sdk/broker/state-version.d.ts +2 -0
- package/dist/types/sdk/bus/chat-effect-journal.d.ts +1 -0
- package/dist/types/sdk/bus/config-commands.d.ts +1 -1
- package/dist/types/sdk/bus/config.d.ts +11 -0
- package/dist/types/sdk/bus/daemon-paths.d.ts +1 -0
- package/dist/types/sdk/bus/discord-daemon.d.ts +5 -0
- package/dist/types/sdk/bus/html-format.d.ts +3 -2
- package/dist/types/sdk/bus/index.d.ts +27 -0
- package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
- package/dist/types/sdk/bus/notification-service.d.ts +20 -0
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +13 -2
- package/dist/types/sdk/bus/recent-activity.d.ts +21 -12
- package/dist/types/sdk/bus/rich-document.d.ts +7 -0
- package/dist/types/sdk/bus/rich-render.d.ts +18 -41
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +9 -4
- package/dist/types/sdk/bus/telegram-daemon.d.ts +69 -3
- package/dist/types/sdk/bus/threaded-inbound.d.ts +1 -1
- package/dist/types/sdk/bus/threaded-render.d.ts +13 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +24 -2
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/host.d.ts +2 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/session-directory.d.ts +56 -0
- package/dist/types/session/agent-session.d.ts +82 -47
- package/dist/types/session/agent-storage.d.ts +7 -0
- package/dist/types/session/fallback-chain-controller.d.ts +10 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +102 -0
- package/dist/types/session/internal/managed-session-storage.d.ts +38 -0
- package/dist/types/session/messages.d.ts +16 -0
- package/dist/types/session/session-manager-internal.d.ts +14 -0
- package/dist/types/session/session-manager.d.ts +82 -12
- package/dist/types/session/session-storage.d.ts +43 -3
- package/dist/types/session/volatile-context-pruning.d.ts +15 -0
- package/dist/types/skill-state/{deep-interview-mutation-guard.d.ts → workflow-mutation-guard.d.ts} +24 -8
- package/dist/types/skill-state/workflow-state-contract.d.ts +1 -3
- package/dist/types/slash-commands/builtin-registry.d.ts +4 -1
- package/dist/types/system-prompt.d.ts +2 -11
- package/dist/types/task/executor.d.ts +3 -1
- package/dist/types/thinking.d.ts +7 -0
- package/dist/types/tool-discovery/tool-index.d.ts +1 -50
- package/dist/types/tools/ask.d.ts +64 -2
- package/dist/types/tools/bash.d.ts +3 -0
- package/dist/types/tools/browser/dead-tab-recovery.d.ts +24 -0
- package/dist/types/tools/browser/tab-supervisor.d.ts +21 -0
- package/dist/types/tools/cron.d.ts +2 -0
- package/dist/types/tools/fetch.d.ts +1 -0
- package/dist/types/tools/index.d.ts +30 -15
- package/dist/types/tools/output-meta.d.ts +1 -0
- package/dist/types/tools/read.d.ts +3 -0
- package/dist/types/tools/search-tool-bm25.d.ts +3 -4
- package/dist/types/tools/subagent-render.d.ts +1 -0
- package/dist/types/tools/subagent.d.ts +6 -1
- package/dist/types/utils/event-bus.d.ts +1 -1
- package/dist/types/web/search/index.d.ts +3 -1
- package/package.json +21 -9
- package/scripts/build-sdk-package-smoke.ts +39 -1
- package/scripts/generate-hotkeys-docs.ts +74 -0
- package/scripts/generate-sdk-operation-inventory.ts +64 -20
- package/scripts/verify-gjc-sdk-canonicalization.ts +182 -2
- package/src/async/job-manager.ts +455 -69
- package/src/cli/config-cli.ts +75 -2
- package/src/cli/notify-cli.ts +92 -26
- package/src/cli/session-picker.ts +20 -3
- package/src/cli/setup-cli.ts +1 -1
- package/src/cli.ts +1 -1
- package/src/commands/config.ts +1 -1
- package/src/commands/harness.ts +34 -106
- package/src/commands/launch.ts +6 -4
- package/src/commands/mcp-serve.ts +85 -8
- package/src/commands/mcp.ts +2 -2
- package/src/commands/notify.ts +8 -4
- package/src/commands/sdk.ts +61 -40
- package/src/commands/ultragoal.ts +4 -1
- package/src/config/atomic-yaml-patch.ts +80 -13
- package/src/config/file-lock.ts +105 -43
- package/src/config/keybindings.ts +64 -20
- package/src/config/model-auth.ts +9 -0
- package/src/config/model-bindings-applier.ts +139 -0
- package/src/config/model-discovery-manager.ts +224 -0
- package/src/config/model-equivalence.ts +66 -0
- package/src/config/model-registry.ts +169 -302
- package/src/config/model-resolver.ts +361 -369
- package/src/config/models-config-schema.ts +5 -4
- package/src/config/settings-schema.ts +159 -2
- package/src/config/settings.ts +458 -482
- package/src/coordinator-mcp/policy.ts +76 -11
- package/src/coordinator-mcp/question-gate-codec.ts +274 -0
- package/src/coordinator-mcp/question-state.ts +778 -0
- package/src/coordinator-mcp/server.ts +1702 -238
- package/src/debug/index.ts +1 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +13 -1
- package/src/defaults/gjc/skills/team/SKILL.md +16 -0
- package/src/discovery/helpers.ts +1 -50
- package/src/edit/index.ts +64 -0
- package/src/eval/py/env.ts +26 -0
- package/src/eval/py/kernel.ts +5 -3
- package/src/extensibility/extensions/loader.ts +9 -1
- package/src/extensibility/extensions/runner.ts +12 -3
- package/src/extensibility/extensions/types.ts +39 -1
- package/src/extensibility/gjc-plugins/installer.ts +16 -16
- package/src/extensibility/hooks/runner.ts +2 -2
- package/src/extensibility/runtime-skill-discovery.ts +33 -13
- package/src/extensibility/shared-events.ts +2 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +63 -3
- package/src/gjc-runtime/deep-interview-runtime.ts +76 -27
- package/src/gjc-runtime/deep-interview-state.ts +317 -5
- package/src/gjc-runtime/goal-mode-request.ts +55 -8
- package/src/gjc-runtime/launch-tmux.ts +2 -5
- package/src/gjc-runtime/launch-worktree.ts +5 -5
- package/src/gjc-runtime/linux-proc.ts +71 -0
- package/src/gjc-runtime/ralplan-runtime.ts +74 -90
- package/src/gjc-runtime/session-resolution.ts +18 -3
- package/src/gjc-runtime/session-state-sidecar.ts +6 -107
- package/src/gjc-runtime/state-migrations.ts +1 -1
- package/src/gjc-runtime/state-runtime.ts +320 -249
- package/src/gjc-runtime/state-writer.ts +36 -40
- package/src/gjc-runtime/team-launch.ts +319 -0
- package/src/gjc-runtime/team-notify.ts +326 -0
- package/src/gjc-runtime/team-runtime.ts +1099 -1482
- package/src/gjc-runtime/team-store.ts +828 -0
- package/src/gjc-runtime/team-workers.ts +962 -0
- package/src/gjc-runtime/tmux-owner-isolation-cli.ts +2 -11
- package/src/gjc-runtime/tmux-owner-isolation.ts +14 -9
- package/src/gjc-runtime/tmux-sessions.ts +4 -21
- package/src/gjc-runtime/ultragoal-change-set.ts +172 -0
- package/src/gjc-runtime/ultragoal-evidence.ts +874 -0
- package/src/gjc-runtime/ultragoal-guard.ts +83 -12
- package/src/gjc-runtime/ultragoal-pipeline.ts +306 -0
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +102 -1
- package/src/gjc-runtime/ultragoal-runtime.ts +156 -1319
- package/src/gjc-runtime/workflow-cli-common.ts +30 -0
- package/src/gjc-runtime/workflow-manifest.generated.json +58 -0
- package/src/gjc-runtime/workflow-manifest.ts +18 -0
- package/src/goals/continuation-timeout-guard.ts +79 -0
- package/src/goals/runtime.ts +7 -5
- package/src/goals/state.ts +18 -0
- package/src/harness-control-plane/lifecycle-reconciliation.ts +64 -0
- package/src/harness-control-plane/phase-rollup.ts +4 -7
- package/src/harness-control-plane/receipt-ingest.ts +5 -0
- package/src/harness-control-plane/receipt-spool.ts +51 -7
- package/src/harness-control-plane/session-lease.ts +12 -130
- package/src/hindsight/backend.ts +26 -27
- package/src/hindsight/state.ts +101 -32
- package/src/hooks/skill-state.ts +17 -11
- package/src/internal-urls/docs-index.generated.ts +21 -18
- package/src/lsp/client.ts +1 -1
- package/src/lsp/config.ts +145 -26
- package/src/lsp/index.ts +1 -1
- package/src/lsp/lspmux.ts +39 -10
- package/src/lsp/path-trust.ts +81 -0
- package/src/main.ts +28 -8
- package/src/memories/index.ts +1 -0
- package/src/memories/storage.ts +6 -2
- package/src/modes/action-registry.ts +165 -0
- package/src/modes/components/chrome.ts +40 -0
- package/src/modes/components/command-palette.ts +168 -0
- package/src/modes/components/custom-editor.ts +1 -1
- package/src/modes/components/custom-provider-wizard.ts +51 -14
- package/src/modes/components/index.ts +2 -1
- package/src/modes/components/pet-selector.ts +11 -17
- package/src/modes/components/plan-preview-overlay.ts +295 -0
- package/src/modes/components/queue-mode-selector.ts +10 -27
- package/src/modes/components/queue-pane.ts +79 -0
- package/src/modes/components/read-tool-group.ts +13 -0
- package/src/modes/components/session-observer-overlay.ts +207 -772
- package/src/modes/components/sessions-dashboard.ts +181 -0
- package/src/modes/components/settings-selector.ts +1 -1
- package/src/modes/components/show-images-selector.ts +10 -24
- package/src/modes/components/status-line/types.ts +1 -1
- package/src/modes/components/status-line.ts +1 -969
- package/src/modes/components/tasks-pane.ts +73 -0
- package/src/modes/components/theme-selector.ts +11 -31
- package/src/modes/components/tool-execution.ts +22 -0
- package/src/modes/components/tool-status-header.ts +1056 -0
- package/src/modes/components/transcript-viewer-overlay.ts +384 -0
- package/src/modes/controllers/btw-controller.ts +1 -0
- package/src/modes/controllers/command-controller.ts +9 -15
- package/src/modes/controllers/event-controller.ts +3 -2
- package/src/modes/controllers/extension-ui-controller.ts +72 -25
- package/src/modes/controllers/goal-mode-controller.ts +474 -0
- package/src/modes/controllers/input-controller.ts +764 -229
- package/src/modes/controllers/mode-gate.ts +24 -0
- package/src/modes/controllers/plan-mode-controller.ts +517 -0
- package/src/modes/controllers/selector-controller.ts +225 -10
- package/src/modes/controllers/stt-controller.ts +125 -0
- package/src/modes/interactive-mode.ts +302 -1151
- package/src/modes/jobs-observer.ts +3 -0
- package/src/modes/runtime-init.ts +8 -0
- package/src/modes/shared/agent-wire/deep-interview-gate.ts +31 -106
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +78 -19
- package/src/modes/shared/agent-wire/workflow-gate-types.ts +177 -0
- package/src/modes/tasks-aggregator.ts +199 -0
- package/src/modes/transcript-item-registry.ts +229 -0
- package/src/modes/types.ts +47 -20
- package/src/modes/utils/ui-helpers.ts +17 -9
- package/src/prompts/agent-fragments/ralplan-persistence.md +6 -0
- package/src/prompts/agent-fragments/restricted-bash.md +1 -0
- package/src/prompts/agents/architect.md +2 -8
- package/src/prompts/agents/critic.md +2 -8
- package/src/prompts/agents/executor.md +3 -0
- package/src/prompts/agents/planner.md +4 -12
- package/src/prompts/system/custom-system-prompt.md +1 -23
- package/src/prompts/system/plan-mode-approved.md +8 -0
- package/src/prompts/system/system-prompt.md +17 -96
- package/src/prompts/tools/bash.md +4 -4
- package/src/prompts/tools/browser.md +15 -52
- package/src/prompts/tools/find.md +2 -2
- package/src/prompts/tools/hashline.md +13 -55
- package/src/prompts/tools/read.md +3 -6
- package/src/prompts/tools/search-tool-bm25.md +0 -2
- package/src/prompts/tools/search.md +2 -4
- package/src/prompts/tools/skill-discovery.md +1 -2
- package/src/prompts/tools/task.md +1 -1
- package/src/runtime-mcp/manager.ts +1 -1
- package/src/sdk/broker/broker.ts +206 -78
- package/src/sdk/broker/discovery.ts +21 -2
- package/src/sdk/broker/ensure.ts +85 -25
- package/src/sdk/broker/lifecycle-codec.ts +11 -0
- package/src/sdk/broker/lifecycle-ledger.ts +371 -74
- package/src/sdk/broker/lifecycle.ts +1399 -142
- package/src/sdk/broker/process-incarnation.ts +5 -13
- package/src/sdk/broker/session-index.ts +145 -56
- package/src/sdk/broker/state-version.ts +21 -0
- package/src/sdk/broker/transport.ts +1 -1
- package/src/sdk/bus/chat-daemon-cli.ts +2 -0
- package/src/sdk/bus/chat-daemon-control.ts +8 -28
- package/src/sdk/bus/chat-effect-journal.ts +14 -4
- package/src/sdk/bus/config-commands.ts +5 -4
- package/src/sdk/bus/config.ts +98 -0
- package/src/sdk/bus/conversation-store.ts +5 -29
- package/src/sdk/bus/daemon-paths.ts +2 -0
- package/src/sdk/bus/discord-daemon.ts +25 -8
- package/src/sdk/bus/html-format.ts +20 -3
- package/src/sdk/bus/index.ts +834 -113
- package/src/sdk/bus/lifecycle-control-runtime.ts +91 -33
- package/src/sdk/bus/native-runtime-compatibility.ts +1 -1
- package/src/sdk/bus/natives-augment.d.ts +26 -1
- package/src/sdk/bus/notification-service.ts +168 -20
- package/src/sdk/bus/rate-limit-pool.ts +58 -14
- package/src/sdk/bus/recent-activity.ts +188 -74
- package/src/sdk/bus/rich-document.ts +258 -0
- package/src/sdk/bus/rich-render.ts +62 -70
- package/src/sdk/bus/telegram-daemon-cli.ts +15 -59
- package/src/sdk/bus/telegram-daemon-contract.ts +9 -4
- package/src/sdk/bus/telegram-daemon.ts +1491 -247
- package/src/sdk/bus/threaded-inbound.ts +8 -3
- package/src/sdk/bus/threaded-render.ts +57 -1
- package/src/sdk/bus/topic-registry.ts +120 -13
- package/src/sdk/host/control/dispatch.ts +14 -2
- package/src/sdk/host/control/operations.ts +6 -1
- package/src/sdk/host/host.ts +31 -1
- package/src/sdk/host/query/handlers.ts +20 -22
- package/src/sdk/host/query/revision-store.ts +80 -57
- package/src/sdk/index.ts +1 -0
- package/src/sdk/protocol/operation-inventory.generated.json +943 -1907
- package/src/sdk/session-directory.ts +141 -0
- package/src/sdk/session.ts +458 -479
- package/src/session/agent-session.ts +1901 -637
- package/src/session/agent-storage.ts +18 -0
- package/src/session/cache-economics.ts +25 -8
- package/src/session/fallback-chain-controller.ts +53 -3
- package/src/session/internal/managed-session-scope.ts +2226 -0
- package/src/session/internal/managed-session-storage.ts +453 -0
- package/src/session/messages.ts +91 -2
- package/src/session/session-manager-internal.ts +33 -0
- package/src/session/session-manager.ts +1112 -333
- package/src/session/session-storage.ts +444 -39
- package/src/session/volatile-context-pruning.ts +78 -0
- package/src/setup/credential-auto-import.ts +2 -1
- package/src/setup/hermes/templates/operator-instructions.v1.md +1 -1
- package/src/setup/provider-onboarding.ts +36 -61
- package/src/setup/provider-presets.json +5 -0
- package/src/skill-state/active-state.ts +3 -13
- package/src/skill-state/{deep-interview-mutation-guard.ts → workflow-mutation-guard.ts} +47 -29
- package/src/skill-state/workflow-state-contract.ts +6 -41
- package/src/slash-commands/builtin-registry.ts +46 -11
- package/src/system-prompt.ts +37 -44
- package/src/task/agents.ts +19 -1
- package/src/task/executor.ts +90 -6
- package/src/task/index.ts +62 -37
- package/src/thinking.ts +21 -6
- package/src/tool-discovery/tool-index.ts +2 -134
- package/src/tools/ask.ts +157 -21
- package/src/tools/ast-edit.ts +1 -1
- package/src/tools/bash.ts +38 -0
- package/src/tools/browser/dead-tab-recovery.ts +78 -0
- package/src/tools/browser/tab-supervisor.ts +282 -36
- package/src/tools/computer.ts +10 -3
- package/src/tools/cron.ts +30 -16
- package/src/tools/eval.ts +1 -2
- package/src/tools/fetch.ts +11 -4
- package/src/tools/index.ts +76 -24
- package/src/tools/output-meta.ts +13 -5
- package/src/tools/read.ts +37 -1
- package/src/tools/resource-gc.ts +2 -2
- package/src/tools/search-tool-bm25.ts +11 -74
- package/src/tools/subagent-render.ts +19 -8
- package/src/tools/subagent.ts +84 -32
- package/src/utils/event-bus.ts +9 -4
- package/src/web/search/index.ts +3 -3
- package/dist/types/discovery/plugin-dir-roots.d.ts +0 -15
- package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +0 -7
- package/src/discovery/plugin-dir-roots.ts +0 -28
- package/src/runtime-mcp/discoverable-tool-metadata.ts +0 -25
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import type { PrivateAskGateCodecV1, PublicReason } from "./question-gate-codec";
|
|
2
|
+
export type CoordinatorSessionState = "booting" | "ready_for_input" | "running" | "needs_user_input" | "completed" | "errored" | "stale" | "unknown";
|
|
3
|
+
export interface CanonicalSessionSnapshotV1 {
|
|
4
|
+
schema_version: 1;
|
|
5
|
+
namespace_id: string;
|
|
6
|
+
session_id: string;
|
|
7
|
+
cwd: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
updated_at: string;
|
|
10
|
+
mpreset: string | null;
|
|
11
|
+
source: string | null;
|
|
12
|
+
model: string | null;
|
|
13
|
+
tmux: {
|
|
14
|
+
session: string | null;
|
|
15
|
+
window: string | null;
|
|
16
|
+
pane: string | null;
|
|
17
|
+
};
|
|
18
|
+
broker: {
|
|
19
|
+
workspace: string | null;
|
|
20
|
+
endpoint_url: string;
|
|
21
|
+
endpoint_generation: number;
|
|
22
|
+
endpoint_incarnation: string;
|
|
23
|
+
};
|
|
24
|
+
ephemeral: boolean;
|
|
25
|
+
visible: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CanonicalTurnSnapshotV1 {
|
|
28
|
+
schema_version: 1;
|
|
29
|
+
turn_id: string;
|
|
30
|
+
session_id: string;
|
|
31
|
+
namespace_id: string;
|
|
32
|
+
status: string;
|
|
33
|
+
prompt: {
|
|
34
|
+
text: string;
|
|
35
|
+
created_at: string;
|
|
36
|
+
source: string;
|
|
37
|
+
};
|
|
38
|
+
delivery: Record<string, unknown>;
|
|
39
|
+
question_ids: string[];
|
|
40
|
+
final_response: Record<string, unknown>;
|
|
41
|
+
evidence: Record<string, unknown>[];
|
|
42
|
+
error: Record<string, unknown> | null;
|
|
43
|
+
liveness: Record<string, unknown>;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
started_at: string | null;
|
|
47
|
+
completed_at: string | null;
|
|
48
|
+
terminal_fence: {
|
|
49
|
+
epoch: number;
|
|
50
|
+
status: string;
|
|
51
|
+
reason: PublicReason | null;
|
|
52
|
+
at: string;
|
|
53
|
+
} | null;
|
|
54
|
+
}
|
|
55
|
+
export interface CanonicalReportSnapshotV1 {
|
|
56
|
+
schema_version: 1;
|
|
57
|
+
report_id: string;
|
|
58
|
+
operation_id: string;
|
|
59
|
+
session_id: string;
|
|
60
|
+
turn_id: string;
|
|
61
|
+
status: string;
|
|
62
|
+
summary: string;
|
|
63
|
+
blocker: string | null;
|
|
64
|
+
pr_url: string | null;
|
|
65
|
+
evidence_paths: string[];
|
|
66
|
+
created_at: string;
|
|
67
|
+
}
|
|
68
|
+
export type GateAuthorityEntryV1 = {
|
|
69
|
+
authority: {
|
|
70
|
+
namespace_id: string;
|
|
71
|
+
session_id: string;
|
|
72
|
+
endpoint_incarnation: string;
|
|
73
|
+
gate_id: string;
|
|
74
|
+
};
|
|
75
|
+
observation: {
|
|
76
|
+
kind: "valid";
|
|
77
|
+
first_provenance: {
|
|
78
|
+
runtime_turn_id: string;
|
|
79
|
+
gate_created_at: string;
|
|
80
|
+
schema_hash: string;
|
|
81
|
+
stage: string;
|
|
82
|
+
kind: string;
|
|
83
|
+
};
|
|
84
|
+
} | {
|
|
85
|
+
kind: "malformed";
|
|
86
|
+
immutable_observation_digest: string;
|
|
87
|
+
malformed: "missing_runtime_turn" | "invalid_runtime_turn" | "invalid_gate_row" | "wrong_session";
|
|
88
|
+
};
|
|
89
|
+
outcome: {
|
|
90
|
+
state: "deferred_link";
|
|
91
|
+
first_seen_at: string;
|
|
92
|
+
} | {
|
|
93
|
+
state: "pending" | "answered";
|
|
94
|
+
turn_id: string;
|
|
95
|
+
question_id: string;
|
|
96
|
+
} | {
|
|
97
|
+
state: "stale" | "uncertain";
|
|
98
|
+
reason: PublicReason;
|
|
99
|
+
turn_id?: string;
|
|
100
|
+
question_id?: string;
|
|
101
|
+
} | {
|
|
102
|
+
state: "ownership_unavailable";
|
|
103
|
+
reason: "ownership_unavailable";
|
|
104
|
+
} | {
|
|
105
|
+
state: "ownership_conflict";
|
|
106
|
+
reason: "ownership_conflict";
|
|
107
|
+
};
|
|
108
|
+
first_seen_at: string;
|
|
109
|
+
updated_at: string;
|
|
110
|
+
};
|
|
111
|
+
export interface PrivateQuestionV1 {
|
|
112
|
+
question_id: string;
|
|
113
|
+
authority_id: string;
|
|
114
|
+
session_id: string;
|
|
115
|
+
turn_id: string;
|
|
116
|
+
endpoint_incarnation: string;
|
|
117
|
+
stage: string;
|
|
118
|
+
kind: string;
|
|
119
|
+
prompt: string;
|
|
120
|
+
status: "pending" | "resolving" | "answered" | "stale" | "uncertain";
|
|
121
|
+
binding_plaintext: string;
|
|
122
|
+
binding_sha256: string;
|
|
123
|
+
codec: PrivateAskGateCodecV1;
|
|
124
|
+
claim_fence_epoch: number | null;
|
|
125
|
+
answer_request_id: string | null;
|
|
126
|
+
created_at: string;
|
|
127
|
+
updated_at: string;
|
|
128
|
+
answered_at: string | null;
|
|
129
|
+
history: Array<{
|
|
130
|
+
at: string;
|
|
131
|
+
status: "pending" | "resolving" | "answered" | "stale" | "uncertain";
|
|
132
|
+
reason: PublicReason | null;
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
export interface AnswerRequestV1 {
|
|
136
|
+
request_id: string;
|
|
137
|
+
key_digest: string;
|
|
138
|
+
request_digest: string;
|
|
139
|
+
answer_hash: string;
|
|
140
|
+
answer_binding_sha256: string;
|
|
141
|
+
authority_id: string;
|
|
142
|
+
question_id: string;
|
|
143
|
+
turn_id: string;
|
|
144
|
+
endpoint_incarnation: string;
|
|
145
|
+
sdk_idempotency_key: string;
|
|
146
|
+
claim_fence_epoch: number;
|
|
147
|
+
phase: "claimed" | "remote_started" | "accepted" | "rejected" | "completed" | "uncertain";
|
|
148
|
+
safe_receipt?: {
|
|
149
|
+
status: "accepted" | "rejected";
|
|
150
|
+
answer_hash: string;
|
|
151
|
+
answer_binding_sha256: string;
|
|
152
|
+
authority_id: string;
|
|
153
|
+
turn_id: string;
|
|
154
|
+
endpoint_incarnation: string;
|
|
155
|
+
claim_fence_epoch: number;
|
|
156
|
+
resolved_at: string;
|
|
157
|
+
};
|
|
158
|
+
error_code?: PublicReason | "idempotency_conflict";
|
|
159
|
+
created_at: string;
|
|
160
|
+
updated_at: string;
|
|
161
|
+
}
|
|
162
|
+
export interface PromptRequestV1 {
|
|
163
|
+
request_id: string;
|
|
164
|
+
key_digest: string;
|
|
165
|
+
request_digest: string;
|
|
166
|
+
operation: "turn.prompt" | "turn.follow_up" | "turn.abort_and_prompt";
|
|
167
|
+
canonical_prompt: {
|
|
168
|
+
text: string;
|
|
169
|
+
};
|
|
170
|
+
sdk_idempotency_key: string;
|
|
171
|
+
phase: "claimed" | "remote_started" | "accepted" | "linked" | "terminal" | "completed" | "uncertain";
|
|
172
|
+
runtime_receipt?: {
|
|
173
|
+
accepted: true;
|
|
174
|
+
command_id: string;
|
|
175
|
+
turn_id: string;
|
|
176
|
+
};
|
|
177
|
+
coordinator_turn_id?: string;
|
|
178
|
+
safe_response?: Record<string, unknown>;
|
|
179
|
+
error_code?: PublicReason | "idempotency_conflict";
|
|
180
|
+
created_at: string;
|
|
181
|
+
updated_at: string;
|
|
182
|
+
}
|
|
183
|
+
export interface OperationRequestV1 {
|
|
184
|
+
operation_id: string;
|
|
185
|
+
tool: string;
|
|
186
|
+
key_digest: string;
|
|
187
|
+
request_digest: string;
|
|
188
|
+
local_id: string;
|
|
189
|
+
remote_id?: string;
|
|
190
|
+
phase: "claimed" | "remote_started" | "completed" | "uncertain";
|
|
191
|
+
intent: Record<string, unknown>;
|
|
192
|
+
safe_response?: Record<string, unknown>;
|
|
193
|
+
error_code?: PublicReason | "idempotency_conflict";
|
|
194
|
+
created_at: string;
|
|
195
|
+
updated_at: string;
|
|
196
|
+
}
|
|
197
|
+
export interface OutboxEventV1 {
|
|
198
|
+
id: string;
|
|
199
|
+
transaction_revision: number;
|
|
200
|
+
kind: string;
|
|
201
|
+
entity: "turn" | "question" | "report" | "session" | "deletion";
|
|
202
|
+
entity_id: string;
|
|
203
|
+
payload: Record<string, string | number | boolean | null>;
|
|
204
|
+
emitted: boolean;
|
|
205
|
+
}
|
|
206
|
+
export interface CoordinatorSessionTransactionV1 {
|
|
207
|
+
schema_version: 1;
|
|
208
|
+
namespace_id: string;
|
|
209
|
+
session_id: string;
|
|
210
|
+
revision: number;
|
|
211
|
+
endpoint: {
|
|
212
|
+
incarnation: string;
|
|
213
|
+
observed_at: string;
|
|
214
|
+
} | null;
|
|
215
|
+
canonical: {
|
|
216
|
+
session: CanonicalSessionSnapshotV1;
|
|
217
|
+
turns: Record<string, CanonicalTurnSnapshotV1>;
|
|
218
|
+
queue: {
|
|
219
|
+
ordered_turn_ids: string[];
|
|
220
|
+
active_turn_id: string | null;
|
|
221
|
+
selected_promotion: {
|
|
222
|
+
from_turn_id: string;
|
|
223
|
+
to_turn_id: string;
|
|
224
|
+
revision: number;
|
|
225
|
+
} | null;
|
|
226
|
+
};
|
|
227
|
+
desired_session_state: CoordinatorSessionState;
|
|
228
|
+
reports: Record<string, CanonicalReportSnapshotV1>;
|
|
229
|
+
gate_authorities: Record<string, GateAuthorityEntryV1>;
|
|
230
|
+
questions: Record<string, PrivateQuestionV1>;
|
|
231
|
+
};
|
|
232
|
+
requests: {
|
|
233
|
+
prompts: Record<string, PromptRequestV1>;
|
|
234
|
+
answers: Record<string, AnswerRequestV1>;
|
|
235
|
+
operations: Record<string, OperationRequestV1>;
|
|
236
|
+
};
|
|
237
|
+
outbox: Record<string, OutboxEventV1>;
|
|
238
|
+
projection: {
|
|
239
|
+
applied_turns_revision: number;
|
|
240
|
+
applied_reports_revision: number;
|
|
241
|
+
applied_session_revision: number;
|
|
242
|
+
applied_active_revision: number;
|
|
243
|
+
applied_events_revision: number;
|
|
244
|
+
};
|
|
245
|
+
recovery: {
|
|
246
|
+
prompt_watermark_at: string | null;
|
|
247
|
+
last_repaired_at: string | null;
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
export type CanonicalCreateIntentV1 = {
|
|
251
|
+
kind: "register";
|
|
252
|
+
session: CanonicalSessionSnapshotV1;
|
|
253
|
+
initial_state: CoordinatorSessionState;
|
|
254
|
+
initial_events: Record<string, string | number | boolean | null>[];
|
|
255
|
+
} | {
|
|
256
|
+
kind: "start";
|
|
257
|
+
session: CanonicalSessionSnapshotV1;
|
|
258
|
+
remote_create_key: string;
|
|
259
|
+
initial_state: CoordinatorSessionState;
|
|
260
|
+
initial_prompt: {
|
|
261
|
+
text: string;
|
|
262
|
+
caller_key_digest: string;
|
|
263
|
+
} | null;
|
|
264
|
+
initial_events: Record<string, string | number | boolean | null>[];
|
|
265
|
+
} | {
|
|
266
|
+
kind: "delegate";
|
|
267
|
+
workflow: "plan" | "execute" | "team";
|
|
268
|
+
session: CanonicalSessionSnapshotV1;
|
|
269
|
+
remote_create_key: string;
|
|
270
|
+
initial_state: CoordinatorSessionState;
|
|
271
|
+
initial_prompt: {
|
|
272
|
+
text: string;
|
|
273
|
+
caller_key_digest: string;
|
|
274
|
+
};
|
|
275
|
+
initial_events: Record<string, string | number | boolean | null>[];
|
|
276
|
+
};
|
|
277
|
+
export interface CreationRequestV1 {
|
|
278
|
+
key_digest: string;
|
|
279
|
+
request_digest: string;
|
|
280
|
+
tool: string;
|
|
281
|
+
phase: "claimed" | "remote_started" | "wal_committed" | "projected" | "completed" | "uncertain";
|
|
282
|
+
canonical_create_intent: CanonicalCreateIntentV1 | null;
|
|
283
|
+
remote_create_key: string;
|
|
284
|
+
session_id: string | null;
|
|
285
|
+
endpoint_incarnation: string | null;
|
|
286
|
+
wal_revision?: number;
|
|
287
|
+
wal_digest?: string;
|
|
288
|
+
safe_response?: Record<string, unknown>;
|
|
289
|
+
created_at: string;
|
|
290
|
+
updated_at: string;
|
|
291
|
+
}
|
|
292
|
+
export interface NamespaceDeletionEntryV1 {
|
|
293
|
+
deletion_id: string;
|
|
294
|
+
session_id: string;
|
|
295
|
+
endpoint_incarnation: string;
|
|
296
|
+
operation_id: string;
|
|
297
|
+
key_digest: string;
|
|
298
|
+
request_digest: string;
|
|
299
|
+
close_key: string;
|
|
300
|
+
phase: "intent" | "broker_closed" | "cleanup_pending" | "completed" | "uncertain";
|
|
301
|
+
safe_response?: Record<string, unknown>;
|
|
302
|
+
cleanup: {
|
|
303
|
+
wal: boolean;
|
|
304
|
+
turns: boolean;
|
|
305
|
+
reports: boolean;
|
|
306
|
+
session: boolean;
|
|
307
|
+
events: boolean;
|
|
308
|
+
};
|
|
309
|
+
authority_digest: string;
|
|
310
|
+
created_at: string;
|
|
311
|
+
updated_at: string;
|
|
312
|
+
}
|
|
313
|
+
export interface NamespaceRegistryV1 {
|
|
314
|
+
schema_version: 1;
|
|
315
|
+
namespace_id: string;
|
|
316
|
+
creations: Record<string, CreationRequestV1>;
|
|
317
|
+
deletions: Record<string, NamespaceDeletionEntryV1>;
|
|
318
|
+
}
|
|
319
|
+
export interface CoordinatorStatePaths {
|
|
320
|
+
root: string;
|
|
321
|
+
registry: string;
|
|
322
|
+
registryLock: string;
|
|
323
|
+
journal: string;
|
|
324
|
+
journalLock: string;
|
|
325
|
+
sessions: string;
|
|
326
|
+
}
|
|
327
|
+
export declare function coordinatorStatePaths(stateRoot: string, namespaceId: string): CoordinatorStatePaths;
|
|
328
|
+
export declare function transactionPath(paths: CoordinatorStatePaths, sessionId: string): string;
|
|
329
|
+
export declare function transactionLockPath(paths: CoordinatorStatePaths, sessionId: string): string;
|
|
330
|
+
export declare function initializeCoordinatorNamespace(paths: CoordinatorStatePaths): Promise<void>;
|
|
331
|
+
export declare function withNamespaceRegistry<T>(paths: CoordinatorStatePaths, operation: (registry: NamespaceRegistryV1) => Promise<T>): Promise<T>;
|
|
332
|
+
export declare function withSessionTransaction<T>(paths: CoordinatorStatePaths, sessionId: string, operation: (transaction: CoordinatorSessionTransactionV1) => Promise<T>): Promise<T>;
|
|
333
|
+
/** Serializes a session mutation with namespace close admission. */
|
|
334
|
+
export declare function withAdmittedSessionTransaction<T>(paths: CoordinatorStatePaths, sessionId: string, operation: (transaction: CoordinatorSessionTransactionV1) => Promise<T>): Promise<T>;
|
|
335
|
+
/** Claims a caller-visible creation request before any remote work or projection. */
|
|
336
|
+
export declare function claimCreationRequest(paths: CoordinatorStatePaths, input: {
|
|
337
|
+
key_digest: string;
|
|
338
|
+
request_digest: string;
|
|
339
|
+
tool: string;
|
|
340
|
+
}): Promise<CreationRequestV1>;
|
|
341
|
+
/** Persists the remote result needed to resume a creation after a crash. */
|
|
342
|
+
export declare function bindCreationRequest(paths: CoordinatorStatePaths, keyDigest: string, intent: CanonicalCreateIntentV1): Promise<CreationRequestV1>;
|
|
343
|
+
/** Creates the durable session WAL for an already claimed creation request. */
|
|
344
|
+
export declare function commitCreationWal(paths: CoordinatorStatePaths, keyDigest: string, intent: CanonicalCreateIntentV1): Promise<CoordinatorSessionTransactionV1>;
|
|
345
|
+
export declare function createSessionTransaction(paths: CoordinatorStatePaths, intent: CanonicalCreateIntentV1): Promise<CoordinatorSessionTransactionV1>;
|
|
346
|
+
export declare function assertCloseAdmission(registry: NamespaceRegistryV1, transaction: CoordinatorSessionTransactionV1): void;
|
|
347
|
+
export declare function deterministicOutboxId(sessionId: string, revision: number, kind: string, entity: OutboxEventV1["entity"], entityId: string): string;
|
|
348
|
+
export declare function appendOutboxEvents(paths: CoordinatorStatePaths, transaction: CoordinatorSessionTransactionV1): Promise<void>;
|
|
349
|
+
export declare function compactTransaction(transaction: CoordinatorSessionTransactionV1, now?: number): void;
|
|
350
|
+
/** Records projection repair after projecting complete canonical snapshots. */
|
|
351
|
+
export declare function repairProjections(paths: CoordinatorStatePaths, sessionId: string, project: (canonical: CoordinatorSessionTransactionV1["canonical"]) => Promise<void>): Promise<void>;
|
|
352
|
+
/** Advances a creation receipt only after its WAL or projection authority exists. */
|
|
353
|
+
export declare function advanceCreationReceipt(paths: CoordinatorStatePaths, keyDigest: string, phase: "projected" | "completed" | "uncertain", safeResponse?: Record<string, unknown>): Promise<void>;
|
|
354
|
+
export declare function hasEmergencyCapacity(transaction: CoordinatorSessionTransactionV1, incomingBytes: number, essential: boolean): boolean;
|
|
355
|
+
export declare function recordDeletionIntent(paths: CoordinatorStatePaths, entry: NamespaceDeletionEntryV1): Promise<void>;
|
|
356
|
+
export declare function advanceDeletion(paths: CoordinatorStatePaths, deletionId: string, phase: NamespaceDeletionEntryV1["phase"], cleanup?: Partial<NamespaceDeletionEntryV1["cleanup"]>, safeResponse?: Record<string, unknown>): Promise<void>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { COORDINATOR_MCP_PROTOCOL_VERSION, COORDINATOR_MCP_SERVER_NAME, COORDINATOR_MCP_TOOL_NAMES, type CoordinatorToolName } from "../coordinator/contract";
|
|
2
|
+
import type { BrokerDiscovery } from "../sdk/broker/discovery";
|
|
3
|
+
import { type EnsureBrokerSettings } from "../sdk/broker/ensure";
|
|
2
4
|
import { SdkClient } from "../sdk/client/client";
|
|
3
5
|
import { type CoordinatorModelProfileLoader } from "./model-preset";
|
|
4
6
|
import { type CoordinatorMcpConfig } from "./policy";
|
|
@@ -24,6 +26,8 @@ interface JsonRpcResponse {
|
|
|
24
26
|
}
|
|
25
27
|
interface CoordinatorServices {
|
|
26
28
|
connectSdk?: (url: string, token: string) => Promise<SdkClient>;
|
|
29
|
+
ensureBroker?: (settings: EnsureBrokerSettings) => Promise<BrokerDiscovery>;
|
|
30
|
+
readSdkBrokerDiscovery?: (agentDir: string) => Promise<BrokerDiscovery | null>;
|
|
27
31
|
getAgentDir?: () => string;
|
|
28
32
|
resolveModelProfiles?: CoordinatorModelProfileLoader;
|
|
29
33
|
canonicalizePath?: (value: string) => Promise<string>;
|
|
@@ -263,9 +263,3 @@ export declare function preloadPluginRoots(home: string, cwd?: string): Promise<
|
|
|
263
263
|
* Returns empty array if preloadPluginRoots() hasn't been called.
|
|
264
264
|
*/
|
|
265
265
|
export declare function getPreloadedPluginRoots(): readonly ClaudePluginRoot[];
|
|
266
|
-
/**
|
|
267
|
-
* Inject synthetic plugin roots from --plugin-dir paths.
|
|
268
|
-
* These are prepended to the cache with highest precedence (before GJC/Anthropic model entries).
|
|
269
|
-
* Must be called before any listAnthropic modelPluginRoots() access.
|
|
270
|
-
*/
|
|
271
|
-
export declare function injectPluginDirRoots(home: string, dirs: string[], cwd?: string): Promise<void>;
|
|
@@ -24,6 +24,8 @@ type TInput = typeof replaceEditSchema | typeof patchEditSchema | typeof hashlin
|
|
|
24
24
|
type VimParams = z.infer<typeof vimSchema>;
|
|
25
25
|
type EditParams = ReplaceParams | PatchParams | HashlineParams | VimParams | ApplyPatchParams;
|
|
26
26
|
type EditToolResultDetails = EditToolDetails | VimToolDetails;
|
|
27
|
+
/** Project edit targets and operation counts without exposing patches, diffs, or file contents. */
|
|
28
|
+
export declare function summarizeEditToolActivity(kind: "args" | "result", value: unknown): string | undefined;
|
|
27
29
|
export declare class EditTool implements AgentTool<TInput> {
|
|
28
30
|
#private;
|
|
29
31
|
private readonly session;
|
|
@@ -33,6 +35,7 @@ export declare class EditTool implements AgentTool<TInput> {
|
|
|
33
35
|
readonly nonAbortable = true;
|
|
34
36
|
readonly concurrency = "exclusive";
|
|
35
37
|
readonly strict = true;
|
|
38
|
+
readonly safeSummary: typeof summarizeEditToolActivity;
|
|
36
39
|
constructor(session: ToolSession);
|
|
37
40
|
get mode(): EditMode;
|
|
38
41
|
get description(): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Environment values consulted by the Python subprocess integration. */
|
|
2
|
+
export type PythonEnv = Record<string, string | undefined>;
|
|
3
|
+
/** True when `value` is a non-empty string matching a truthy boolean token. */
|
|
4
|
+
export declare function isTruthyPythonFlag(value: string | undefined): boolean;
|
|
5
|
+
/** Resolve paired GJC/legacy PI flags using OR semantics. */
|
|
6
|
+
export declare function resolvePythonFlag(env: PythonEnv, gjcName: string, piName: string): boolean;
|
|
7
|
+
export declare function resolvePythonSkipCheck(env: PythonEnv): boolean;
|
|
8
|
+
export declare function resolvePythonIpcTrace(env: PythonEnv): boolean;
|
|
9
|
+
export declare function resolvePythonIntegrationGate(env: PythonEnv): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@gajae-code/agent-core";
|
|
2
|
-
import type { UsageReport } from "@gajae-code/ai";
|
|
2
|
+
import type { Tool, UsageReport } from "@gajae-code/ai";
|
|
3
3
|
import { EventBus } from "../../utils/event-bus";
|
|
4
4
|
import type { Extension, ExtensionFactory, ExtensionRuntime as IExtensionRuntime, LoadExtensionsResult } from "./types";
|
|
5
5
|
export declare class ExtensionRuntimeNotInitializedError extends Error {
|
|
@@ -22,6 +22,7 @@ export declare class ExtensionRuntime implements IExtensionRuntime {
|
|
|
22
22
|
setLabel(): void;
|
|
23
23
|
getActiveTools(): string[];
|
|
24
24
|
getAllTools(): string[];
|
|
25
|
+
resolveTool(): Pick<Tool, "safeSummary" | "safeSummaryFields"> | undefined;
|
|
25
26
|
setActiveTools(): Promise<void>;
|
|
26
27
|
getCommands(): never;
|
|
27
28
|
setModel(): Promise<boolean>;
|
|
@@ -5,7 +5,7 @@ import type { AgentMessage } from "@gajae-code/agent-core";
|
|
|
5
5
|
import type { CredentialDisabledEvent, ImageContent, Model, ProviderResponseMetadata } from "@gajae-code/ai";
|
|
6
6
|
import type { KeyId } from "@gajae-code/tui";
|
|
7
7
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
8
|
-
import type
|
|
8
|
+
import { type SessionManager } from "../../session/session-manager";
|
|
9
9
|
import type { AfterProviderResponseEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types";
|
|
10
10
|
/** Combined result from all before_agent_start handlers */
|
|
11
11
|
interface BeforeAgentStartCombinedResult {
|
|
@@ -105,7 +105,7 @@ export declare class ExtensionRunner {
|
|
|
105
105
|
*/
|
|
106
106
|
shutdown(): void;
|
|
107
107
|
createCommandContext(): ExtensionCommandContext;
|
|
108
|
-
emit<TEvent extends RunnerEmitEvent>(event: TEvent): Promise<RunnerEmitResult<TEvent>>;
|
|
108
|
+
emit<TEvent extends RunnerEmitEvent>(event: TEvent, continueWhile?: () => boolean): Promise<RunnerEmitResult<TEvent>>;
|
|
109
109
|
emitToolResult(event: ToolResultEvent): Promise<ToolResultEventResult | undefined>;
|
|
110
110
|
emitToolCall(event: ToolCallEvent): Promise<ToolCallEventResult | undefined>;
|
|
111
111
|
emitUserBash(event: UserBashEvent): Promise<UserBashEventResult | undefined>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { AgentMessage, AgentToolResult, AgentToolUpdateCallback, ThinkingLevel } from "@gajae-code/agent-core";
|
|
11
11
|
import type { CompactionResult } from "@gajae-code/agent-core/compaction";
|
|
12
|
-
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, ProviderResponseMetadata, SimpleStreamOptions, Static, TextContent, TSchema, UsageReport } from "@gajae-code/ai";
|
|
12
|
+
import type { Api, AssistantMessageEvent, AssistantMessageEventStream, Context, ImageContent, Model, ProviderResponseMetadata, SimpleStreamOptions, Static, TextContent, Tool, TSchema, UsageReport } from "@gajae-code/ai";
|
|
13
13
|
import type { OAuthCredentials, OAuthLoginCallbacks } from "@gajae-code/ai/utils/oauth/types";
|
|
14
14
|
import type * as piCodingAgent from "@gajae-code/coding-agent";
|
|
15
15
|
import type { AutocompleteItem, Component, EditorTheme, KeyId, TUI } from "@gajae-code/tui";
|
|
@@ -173,7 +173,11 @@ export interface ExtensionUIContext {
|
|
|
173
173
|
}>;
|
|
174
174
|
/** Get current tool output expansion state. */
|
|
175
175
|
getToolsExpanded(): boolean;
|
|
176
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Set tool output expansion state. This is an explicit fold choice, pinning
|
|
178
|
+
* existing tool and read components for their renderer instance lifetime,
|
|
179
|
+
* the same as the user shortcut.
|
|
180
|
+
*/
|
|
177
181
|
setToolsExpanded(expanded: boolean): void;
|
|
178
182
|
}
|
|
179
183
|
export interface ExtensionTranscriptEntry {
|
|
@@ -244,6 +248,8 @@ export interface ExtensionContext {
|
|
|
244
248
|
getQueuedMessages(): unknown[];
|
|
245
249
|
getActiveTools(): string[];
|
|
246
250
|
getAllTools(): string[];
|
|
251
|
+
/** Resolve display-safe metadata for a configured tool without exposing its implementation. */
|
|
252
|
+
resolveTool(name: string): Pick<Tool, "safeSummary" | "safeSummaryFields"> | undefined;
|
|
247
253
|
/** Session control seams used by the SDK host. */
|
|
248
254
|
cycleModel(): Promise<{
|
|
249
255
|
model: Model;
|
|
@@ -412,6 +418,23 @@ export interface MessageUpdateEvent {
|
|
|
412
418
|
message: AgentMessage;
|
|
413
419
|
assistantMessageEvent: AssistantMessageEvent;
|
|
414
420
|
}
|
|
421
|
+
export interface ReasoningSummaryStartEvent {
|
|
422
|
+
type: "reasoning_summary_start";
|
|
423
|
+
message: AgentMessage;
|
|
424
|
+
contentIndex: number;
|
|
425
|
+
}
|
|
426
|
+
export interface ReasoningSummaryDeltaEvent {
|
|
427
|
+
type: "reasoning_summary_delta";
|
|
428
|
+
message: AgentMessage;
|
|
429
|
+
contentIndex: number;
|
|
430
|
+
delta: string;
|
|
431
|
+
}
|
|
432
|
+
export interface ReasoningSummaryEndEvent {
|
|
433
|
+
type: "reasoning_summary_end";
|
|
434
|
+
message: AgentMessage;
|
|
435
|
+
contentIndex: number;
|
|
436
|
+
content: string;
|
|
437
|
+
}
|
|
415
438
|
/** Fired when a message ends */
|
|
416
439
|
export interface MessageEndEvent {
|
|
417
440
|
type: "message_end";
|
|
@@ -579,7 +602,7 @@ export declare function isToolCallEventType<TName extends string, TInput extends
|
|
|
579
602
|
input: TInput;
|
|
580
603
|
};
|
|
581
604
|
/** Union of all event types */
|
|
582
|
-
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent;
|
|
605
|
+
export type ExtensionEvent = ResourcesDiscoverEvent | SessionEvent | ContextEvent | BeforeProviderRequestEvent | AfterProviderResponseEvent | BeforeAgentStartEvent | AgentStartEvent | AgentEndEvent | TurnStartEvent | TurnEndEvent | MessageStartEvent | MessageUpdateEvent | MessageEndEvent | ReasoningSummaryStartEvent | ReasoningSummaryDeltaEvent | ReasoningSummaryEndEvent | ToolExecutionStartEvent | ToolExecutionUpdateEvent | ToolExecutionEndEvent | AutoCompactionStartEvent | AutoCompactionEndEvent | AutoRetryStartEvent | AutoRetryEndEvent | TtsrTriggeredEvent | TodoReminderEvent | GoalUpdatedEvent | CredentialDisabledEvent | UserBashEvent | UserPythonEvent | InputEvent | ToolCallEvent | ToolResultEvent;
|
|
583
606
|
export interface ContextEventResult {
|
|
584
607
|
messages?: AgentMessage[];
|
|
585
608
|
}
|
|
@@ -657,6 +680,9 @@ export interface ExtensionAPI {
|
|
|
657
680
|
on(event: "turn_end", handler: ExtensionHandler<TurnEndEvent>): void;
|
|
658
681
|
on(event: "message_start", handler: ExtensionHandler<MessageStartEvent>): void;
|
|
659
682
|
on(event: "message_update", handler: ExtensionHandler<MessageUpdateEvent>): void;
|
|
683
|
+
on(event: "reasoning_summary_start", handler: ExtensionHandler<ReasoningSummaryStartEvent>): void;
|
|
684
|
+
on(event: "reasoning_summary_delta", handler: ExtensionHandler<ReasoningSummaryDeltaEvent>): void;
|
|
685
|
+
on(event: "reasoning_summary_end", handler: ExtensionHandler<ReasoningSummaryEndEvent>): void;
|
|
660
686
|
on(event: "message_end", handler: ExtensionHandler<MessageEndEvent>): void;
|
|
661
687
|
on(event: "tool_execution_start", handler: ExtensionHandler<ToolExecutionStartEvent>): void;
|
|
662
688
|
on(event: "tool_execution_update", handler: ExtensionHandler<ToolExecutionUpdateEvent>): void;
|
|
@@ -723,6 +749,8 @@ export interface ExtensionAPI {
|
|
|
723
749
|
getActiveTools(): string[];
|
|
724
750
|
/** Get all configured tools (built-in + extension tools). */
|
|
725
751
|
getAllTools(): string[];
|
|
752
|
+
/** Resolve display-safe metadata for a configured tool without exposing its implementation. */
|
|
753
|
+
resolveTool(name: string): Pick<Tool, "safeSummary" | "safeSummaryFields"> | undefined;
|
|
726
754
|
/** Set the active tools by name. */
|
|
727
755
|
setActiveTools(toolNames: string[]): Promise<void>;
|
|
728
756
|
/** Get available slash commands in the current session. */
|
|
@@ -889,6 +917,7 @@ export type SendUserMessageHandler = (content: string | (TextContent | ImageCont
|
|
|
889
917
|
export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
|
|
890
918
|
export type GetActiveToolsHandler = () => string[];
|
|
891
919
|
export type GetAllToolsHandler = () => string[];
|
|
920
|
+
export type ResolveToolHandler = (name: string) => Pick<Tool, "safeSummary" | "safeSummaryFields"> | undefined;
|
|
892
921
|
export type GetCommandsHandler = () => SlashCommandInfo[];
|
|
893
922
|
export type SetActiveToolsHandler = (toolNames: string[]) => Promise<void>;
|
|
894
923
|
export type SetModelHandler = (model: Model) => Promise<boolean>;
|
|
@@ -920,6 +949,7 @@ export interface ExtensionActions {
|
|
|
920
949
|
setLabel: (targetId: string, label: string | undefined) => void;
|
|
921
950
|
getActiveTools: GetActiveToolsHandler;
|
|
922
951
|
getAllTools: GetAllToolsHandler;
|
|
952
|
+
resolveTool: ResolveToolHandler;
|
|
923
953
|
setActiveTools: SetActiveToolsHandler;
|
|
924
954
|
getCommands: GetCommandsHandler;
|
|
925
955
|
setModel: SetModelHandler;
|
|
@@ -955,6 +985,7 @@ export interface ExtensionContextActions {
|
|
|
955
985
|
getQueuedMessages?: () => unknown[];
|
|
956
986
|
getActiveTools?: () => string[];
|
|
957
987
|
getAllTools?: () => string[];
|
|
988
|
+
resolveTool?: (name: string) => Pick<Tool, "safeSummary" | "safeSummaryFields"> | undefined;
|
|
958
989
|
shutdown: () => void;
|
|
959
990
|
getContextUsage: () => ContextUsage | undefined;
|
|
960
991
|
compact: (instructionsOrOptions?: string | CompactOptions) => Promise<void>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { AgentMessage } from "@gajae-code/agent-core";
|
|
5
5
|
import type { Model } from "@gajae-code/ai";
|
|
6
6
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
7
|
-
import type
|
|
7
|
+
import { type SessionManager } from "../../session/session-manager";
|
|
8
8
|
import type { AppendEntryHandler, BranchHandler, LoadedHook, NavigateTreeHandler, NewSessionHandler, SendMessageHandler } from "./loader";
|
|
9
9
|
import type { BeforeAgentStartEventResult, HookCommandContext, HookError, HookEvent, HookMessageRenderer, HookUIContext, RegisteredCommand, SessionBeforeCompactResult, SessionBeforeTreeResult, SessionCompactingResult, ToolCallEvent, ToolCallEventResult, ToolResultEventResult } from "./types";
|
|
10
10
|
/**
|
|
@@ -142,6 +142,8 @@ export interface AgentStartEvent {
|
|
|
142
142
|
export interface AgentEndEvent {
|
|
143
143
|
type: "agent_end";
|
|
144
144
|
messages: AgentMessage[];
|
|
145
|
+
/** Indicates whether the loop ended normally, suspended, cancelled, or entered maintenance. */
|
|
146
|
+
stopReason?: "completed" | "paused" | "cancelled" | "maintenance";
|
|
145
147
|
}
|
|
146
148
|
/** Fired at the start of each turn */
|
|
147
149
|
export interface TurnStartEvent {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeepInterviewEstablishedFact, type DeepInterviewRoundRecord, type DeepInterviewStateEnvelope, type DeepInterviewTriggerMetadata } from "./deep-interview-state";
|
|
1
|
+
import { type DeepInterviewEstablishedFact, type DeepInterviewIntentItem, type DeepInterviewIntentSubstitution, type DeepInterviewRoundRecord, type DeepInterviewStateEnvelope, type DeepInterviewTriggerMetadata } from "./deep-interview-state";
|
|
2
2
|
export * from "./deep-interview-ambiguity";
|
|
3
3
|
export * from "./deep-interview-state";
|
|
4
4
|
/**
|
|
@@ -22,6 +22,15 @@ export interface DeepInterviewAnswerInput {
|
|
|
22
22
|
ambiguity?: number;
|
|
23
23
|
selectedOptions?: string[];
|
|
24
24
|
customInput?: string;
|
|
25
|
+
intent_contract?: {
|
|
26
|
+
items: DeepInterviewIntentItem[];
|
|
27
|
+
confirmation_options: string[];
|
|
28
|
+
};
|
|
29
|
+
intent_review?: {
|
|
30
|
+
observed_items: DeepInterviewIntentItem[];
|
|
31
|
+
supporting_substitutions: DeepInterviewIntentSubstitution[];
|
|
32
|
+
approval_options: string[];
|
|
33
|
+
};
|
|
25
34
|
}
|
|
26
35
|
export interface DeepInterviewScoringInput {
|
|
27
36
|
interviewId?: string;
|
|
@@ -125,3 +125,47 @@ export declare function mergeDeepInterviewRounds(existing: readonly Record<strin
|
|
|
125
125
|
export declare function mergeDeepInterviewEnvelope(existing: unknown, incoming: unknown, options?: {
|
|
126
126
|
replace?: boolean;
|
|
127
127
|
}): DeepInterviewStateEnvelope;
|
|
128
|
+
export declare const DEEP_INTERVIEW_INTENT_CATEGORIES: readonly ["artifact", "surface", "integration", "constraint"];
|
|
129
|
+
export type DeepInterviewIntentCategory = (typeof DEEP_INTERVIEW_INTENT_CATEGORIES)[number];
|
|
130
|
+
export interface DeepInterviewIntentItem {
|
|
131
|
+
id: string;
|
|
132
|
+
category: DeepInterviewIntentCategory;
|
|
133
|
+
statement: string;
|
|
134
|
+
}
|
|
135
|
+
export interface DeepInterviewIntentManifest {
|
|
136
|
+
version: 1;
|
|
137
|
+
items: DeepInterviewIntentItem[];
|
|
138
|
+
digest: string;
|
|
139
|
+
confirmation_round: 0;
|
|
140
|
+
confirmation_answer_hash: string;
|
|
141
|
+
confirmation_evidence: string;
|
|
142
|
+
}
|
|
143
|
+
export interface DeepInterviewIntentSubstitution {
|
|
144
|
+
removed_id: string;
|
|
145
|
+
replacement_ids: string[];
|
|
146
|
+
rationale: string;
|
|
147
|
+
}
|
|
148
|
+
export interface DeepInterviewIntentReview {
|
|
149
|
+
version: 1;
|
|
150
|
+
status: "not_required" | "pending" | "approved";
|
|
151
|
+
locked_digest: string;
|
|
152
|
+
observed_digest: string;
|
|
153
|
+
removed_locked_ids: string[];
|
|
154
|
+
supporting_substitutions: DeepInterviewIntentSubstitution[];
|
|
155
|
+
approval_round?: number;
|
|
156
|
+
answer_hash?: string;
|
|
157
|
+
user_answer_evidence?: string;
|
|
158
|
+
}
|
|
159
|
+
export declare function isCanonicalDeepInterviewAnswerHash(value: unknown): value is string;
|
|
160
|
+
export declare function deepInterviewIntentManifestDigest(items: readonly DeepInterviewIntentItem[]): string;
|
|
161
|
+
export declare function deepInterviewObservedIntentDigest(ids: readonly string[]): string;
|
|
162
|
+
export declare function createDeepInterviewIntentManifest(items: readonly DeepInterviewIntentItem[], confirmation: {
|
|
163
|
+
round: 0;
|
|
164
|
+
answer_hash: string;
|
|
165
|
+
}): DeepInterviewIntentManifest;
|
|
166
|
+
export declare function assertDeepInterviewIntentManifest(value: unknown): asserts value is DeepInterviewIntentManifest;
|
|
167
|
+
export declare function reviewDeepInterviewIntent(locked: DeepInterviewIntentManifest, observedItems: readonly DeepInterviewIntentItem[], input: Omit<DeepInterviewIntentReview, "version" | "locked_digest" | "observed_digest" | "removed_locked_ids">): DeepInterviewIntentReview;
|
|
168
|
+
export declare function assertDeepInterviewIntentReview(value: unknown, locked: DeepInterviewIntentManifest, observedIds: readonly string[], recordedAnswers: readonly {
|
|
169
|
+
round: unknown;
|
|
170
|
+
answer_hash: unknown;
|
|
171
|
+
}[]): asserts value is DeepInterviewIntentReview;
|