@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
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { AgentMessage } from "@gajae-code/agent-core";
|
|
2
2
|
import type { CompactionOutcome } from "@gajae-code/agent-core/compaction";
|
|
3
3
|
import type { AssistantMessage, ImageContent, Message, UsageReport } from "@gajae-code/ai";
|
|
4
|
-
import type { Component, Container, EditorTheme, Loader, Spacer, Text, TUI } from "@gajae-code/tui";
|
|
4
|
+
import type { Component, Container, EditorTheme, Loader, SlashCommand, Spacer, Text, TUI } from "@gajae-code/tui";
|
|
5
5
|
import type { KeybindingsManager } from "../config/keybindings";
|
|
6
6
|
import type { Settings } from "../config/settings";
|
|
7
7
|
import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetContent, ExtensionWidgetOptions } from "../extensibility/extensions";
|
|
8
8
|
import type { CompactOptions } from "../extensibility/extensions/types";
|
|
9
9
|
import type { Skill } from "../extensibility/skills";
|
|
10
|
-
import type { PlanApprovalDetails } from "../plan-mode/approved-plan";
|
|
11
10
|
import type { MCPManager } from "../runtime-mcp";
|
|
12
11
|
import type { NotificationSessionReconcileResult, NotificationSessionStatus } from "../sdk/bus/session-control";
|
|
13
12
|
import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
|
|
@@ -17,14 +16,15 @@ import type { CredentialAutoImportOptions } from "../setup/credential-auto-impor
|
|
|
17
16
|
import type { LspStartupServerInfo } from "../tools";
|
|
18
17
|
import type { AssistantMessageComponent } from "./components/assistant-message";
|
|
19
18
|
import type { BashExecutionComponent } from "./components/bash-execution";
|
|
19
|
+
import type { CommandPaletteAction } from "./components/command-palette";
|
|
20
20
|
import type { CustomEditor } from "./components/custom-editor";
|
|
21
21
|
import type { EvalExecutionComponent } from "./components/eval-execution";
|
|
22
22
|
import type { PetMode } from "./components/gajae-pet-widget";
|
|
23
23
|
import type { HookEditorComponent } from "./components/hook-editor";
|
|
24
24
|
import type { HookInputComponent } from "./components/hook-input";
|
|
25
25
|
import type { HookSelectorComponent } from "./components/hook-selector";
|
|
26
|
-
import type { StatusLineComponent } from "./components/status-line";
|
|
27
26
|
import type { ToolExecutionHandle } from "./components/tool-execution";
|
|
27
|
+
import type { StatusLineComponent } from "./components/tool-status-header";
|
|
28
28
|
import type { IrcObservationLedger } from "./irc-observation-ledger";
|
|
29
29
|
import type { OAuthManualInputManager } from "./oauth-manual-input";
|
|
30
30
|
import type { Theme } from "./theme/theme";
|
|
@@ -43,6 +43,11 @@ export type SubmittedUserInput = {
|
|
|
43
43
|
cancelled: boolean;
|
|
44
44
|
started: boolean;
|
|
45
45
|
};
|
|
46
|
+
export type ComposerSubmissionOptions = Readonly<{
|
|
47
|
+
ownsComposer: boolean;
|
|
48
|
+
editor: CustomEditor;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function canApplyComposerSubmission(options: ComposerSubmissionOptions | undefined, editor: CustomEditor): boolean;
|
|
46
51
|
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned";
|
|
47
52
|
export type TodoItem = {
|
|
48
53
|
content: string;
|
|
@@ -92,10 +97,6 @@ export interface InteractiveModeContext {
|
|
|
92
97
|
isBashNoContext: boolean;
|
|
93
98
|
toolOutputExpanded: boolean;
|
|
94
99
|
todoExpanded: boolean;
|
|
95
|
-
planModeEnabled: boolean;
|
|
96
|
-
goalModeEnabled: boolean;
|
|
97
|
-
goalModePaused: boolean;
|
|
98
|
-
planModePlanFilePath?: string;
|
|
99
100
|
hideThinkingBlock: boolean;
|
|
100
101
|
pendingImages: ImageContent[];
|
|
101
102
|
compactionQueuedMessages: CompactionQueuedMessage[];
|
|
@@ -149,12 +150,11 @@ export interface InteractiveModeContext {
|
|
|
149
150
|
showNewVersionNotification(newVersion: string): void;
|
|
150
151
|
clearEditor(): void;
|
|
151
152
|
updatePendingMessagesDisplay(): void;
|
|
152
|
-
queueCompactionMessage(text: string, mode: "steer" | "followUp"): void;
|
|
153
|
+
queueCompactionMessage(text: string, mode: "steer" | "followUp", options?: ComposerSubmissionOptions): void;
|
|
153
154
|
flushCompactionQueue(options?: {
|
|
154
155
|
willRetry?: boolean;
|
|
155
156
|
}): Promise<void>;
|
|
156
157
|
flushPendingBashComponents(): void;
|
|
157
|
-
flushPendingModelSwitch(): Promise<void>;
|
|
158
158
|
setWorkingMessage(message?: string): void;
|
|
159
159
|
applyPendingWorkingMessage(): void;
|
|
160
160
|
ensureLoadingAnimation(): void;
|
|
@@ -178,7 +178,7 @@ export interface InteractiveModeContext {
|
|
|
178
178
|
images?: ImageContent[];
|
|
179
179
|
customType?: string;
|
|
180
180
|
display?: boolean;
|
|
181
|
-
}): SubmittedUserInput;
|
|
181
|
+
}, options?: ComposerSubmissionOptions): SubmittedUserInput;
|
|
182
182
|
cancelPendingSubmission(): boolean;
|
|
183
183
|
markPendingSubmissionStarted(input: SubmittedUserInput): boolean;
|
|
184
184
|
finishPendingSubmission(input: SubmittedUserInput): void;
|
|
@@ -239,9 +239,9 @@ export interface InteractiveModeContext {
|
|
|
239
239
|
handleContextCommand(): void;
|
|
240
240
|
handleDumpCommand(): void;
|
|
241
241
|
handleDebugTranscriptCommand(): Promise<void>;
|
|
242
|
-
handleClearCommand(): Promise<
|
|
242
|
+
handleClearCommand(): Promise<boolean>;
|
|
243
243
|
handleContextClearCommand(): Promise<void>;
|
|
244
|
-
handleDropCommand(): Promise<
|
|
244
|
+
handleDropCommand(): Promise<boolean>;
|
|
245
245
|
handleForkCommand(): Promise<void>;
|
|
246
246
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
247
247
|
handlePythonCommand(code: string, excludeFromContext?: boolean): Promise<void>;
|
|
@@ -256,7 +256,10 @@ export interface InteractiveModeContext {
|
|
|
256
256
|
handleSTTToggle(): Promise<void>;
|
|
257
257
|
executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<CompactionOutcome>;
|
|
258
258
|
openInBrowser(urlOrPath: string): void;
|
|
259
|
+
/** Resolved source of truth for slash autocomplete and command palette entries. */
|
|
260
|
+
getSlashCommands?(): readonly SlashCommand[];
|
|
259
261
|
refreshSlashCommandState(cwd?: string): Promise<void>;
|
|
262
|
+
showCommandPalette(commands: SlashCommand[], actions: CommandPaletteAction[], executeSlashCommand: (name: string) => Promise<void>): void;
|
|
260
263
|
showSettingsSelector(): void;
|
|
261
264
|
showThemeSelector(): void;
|
|
262
265
|
showPetSelector(): void;
|
|
@@ -272,6 +275,7 @@ export interface InteractiveModeContext {
|
|
|
272
275
|
showUserMessageSelector(): void;
|
|
273
276
|
showTreeSelector(): void;
|
|
274
277
|
showSessionSelector(): void;
|
|
278
|
+
showSessionsDashboard(): void;
|
|
275
279
|
handleResumeSession(sessionPath: string): Promise<void>;
|
|
276
280
|
handleSessionDeleteCommand(): Promise<void>;
|
|
277
281
|
showOAuthSelector(mode: "login" | "logout", providerId?: string, options?: OAuthSelectorOptions): Promise<void>;
|
|
@@ -279,6 +283,10 @@ export interface InteractiveModeContext {
|
|
|
279
283
|
showDebugSelector(): void;
|
|
280
284
|
showSessionObserver(): void;
|
|
281
285
|
showJobsOverlay(): void;
|
|
286
|
+
showTasksPane(): void;
|
|
287
|
+
showTranscriptViewer(): void;
|
|
288
|
+
isTranscriptViewerOpen(): boolean;
|
|
289
|
+
refreshTranscriptViewer(): void;
|
|
282
290
|
resetObserverRegistry(): void;
|
|
283
291
|
handleCtrlC(): void;
|
|
284
292
|
handleCtrlD(): void;
|
|
@@ -298,11 +306,10 @@ export interface InteractiveModeContext {
|
|
|
298
306
|
toggleThinkingBlockVisibility(): void;
|
|
299
307
|
openExternalEditor(): void;
|
|
300
308
|
registerExtensionShortcuts(): void;
|
|
301
|
-
handlePlanModeCommand(initialPrompt?: string): Promise<void>;
|
|
302
|
-
handleGoalModeCommand(rest?: string): Promise<void>;
|
|
303
|
-
handlePlanApproval(details: PlanApprovalDetails): Promise<void>;
|
|
304
309
|
initHooksAndCustomTools(): Promise<void>;
|
|
305
310
|
emitCustomToolSessionEvent(reason: "start" | "switch" | "branch" | "tree" | "shutdown", previousSessionFile?: string): Promise<void>;
|
|
311
|
+
planModeController: Pick<import("./controllers/plan-mode-controller").PlanModeController, "enabled" | "paused" | "planFilePath" | "handleCommand" | "handleApproval" | "flushPendingModelSwitch">;
|
|
312
|
+
goalModeController: Pick<import("./controllers/goal-mode-controller").GoalModeController, "enabled" | "paused" | "handleCommand">;
|
|
306
313
|
setHookWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void;
|
|
307
314
|
setHookStatus(key: string, text: string | undefined): void;
|
|
308
315
|
showHookSelector(title: string, options: string[], dialogOptions?: ExtensionUIDialogOptions): Promise<string | undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentMessage } from "@gajae-code/agent-core";
|
|
2
2
|
import type { AssistantMessage, Message } from "@gajae-code/ai";
|
|
3
3
|
import { type Component, type TUI } from "@gajae-code/tui";
|
|
4
|
-
import type
|
|
4
|
+
import { type ComposerSubmissionOptions, type InteractiveModeContext, type IrcArrivalSnapshot, type TranscriptRebuildPolicy } from "../../modes/types";
|
|
5
5
|
import { type SessionContext } from "../../session/session-manager";
|
|
6
6
|
import { type ParsedIrcMessage } from "./irc-message";
|
|
7
7
|
export type { TranscriptRebuildPolicy } from "../../modes/types";
|
|
@@ -63,7 +63,7 @@ export declare class UiHelpers {
|
|
|
63
63
|
showWarning(warningMessage: string): void;
|
|
64
64
|
showNewVersionNotification(newVersion: string): void;
|
|
65
65
|
updatePendingMessagesDisplay(): void;
|
|
66
|
-
queueCompactionMessage(text: string, mode: "steer" | "followUp"): void;
|
|
66
|
+
queueCompactionMessage(text: string, mode: "steer" | "followUp", options?: ComposerSubmissionOptions): void;
|
|
67
67
|
isKnownSlashCommand(text: string): boolean;
|
|
68
68
|
flushCompactionQueue(options?: {
|
|
69
69
|
willRetry?: boolean;
|
|
@@ -181,7 +181,7 @@ export declare class MCPManager {
|
|
|
181
181
|
*/
|
|
182
182
|
executePrompt(name: string, promptName: string, args?: Record<string, string>, options?: MCPRequestOptions): Promise<MCPGetPromptResult | undefined>;
|
|
183
183
|
/**
|
|
184
|
-
* Get
|
|
184
|
+
* Get connected-server instructions for request-scoped untrusted user-role context.
|
|
185
185
|
*/
|
|
186
186
|
getServerInstructions(): Map<string, string>;
|
|
187
187
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { NativeDirectoryTreeSnapshot } from "@gajae-code/natives";
|
|
2
|
+
import { type DirectoryMigrationPolicy } from "../session-directory";
|
|
3
|
+
import { type BrokerDiscovery, type RedactedBrokerDiscovery } from "./discovery";
|
|
2
4
|
import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
3
5
|
import { SessionIndex } from "./session-index";
|
|
4
6
|
export interface BrokerSettings {
|
|
@@ -6,18 +8,81 @@ export interface BrokerSettings {
|
|
|
6
8
|
packageGeneration?: string;
|
|
7
9
|
port?: number;
|
|
8
10
|
heartbeatTtlMs?: number;
|
|
11
|
+
/** Broker-owned migration policy. Client lifecycle frames cannot select it. */
|
|
12
|
+
resolveDirectoryMigration?: (_cwd: string) => Promise<DirectoryMigrationPolicy>;
|
|
9
13
|
}
|
|
14
|
+
type ResolvedBrokerSettings = {
|
|
15
|
+
agentDir: string;
|
|
16
|
+
packageGeneration: string;
|
|
17
|
+
port: number;
|
|
18
|
+
heartbeatTtlMs: number;
|
|
19
|
+
resolveDirectoryMigration: (_cwd: string) => Promise<DirectoryMigrationPolicy>;
|
|
20
|
+
};
|
|
10
21
|
export type BrokerErrorCode = "idempotency_conflict" | "terminal_uncertain" | "broker_restarting" | "unavailable" | "endpoint_stale" | "resource_gone" | "invalid_input" | "spawn_failed" | "readiness_timeout" | "close_refused" | "not_found" | "live_session" | "cleanup_pending" | (string & {});
|
|
22
|
+
export type BrokerCleanupIdentity = {
|
|
23
|
+
dev: string;
|
|
24
|
+
ino: string;
|
|
25
|
+
size: number;
|
|
26
|
+
mtimeNs: string;
|
|
27
|
+
sha256: string;
|
|
28
|
+
};
|
|
29
|
+
/** Exact retry evidence; detached paths are managed-receipt references, never caller authority. */
|
|
30
|
+
export type BrokerLifecycleCleanupFile = {
|
|
31
|
+
/** Original lifecycle-owned path, retained only for exact identity validation. */
|
|
32
|
+
path: string;
|
|
33
|
+
identity: BrokerCleanupIdentity;
|
|
34
|
+
/** Monotonic append-only cleanup attempt. */
|
|
35
|
+
attempt?: number;
|
|
36
|
+
/** Immutable no-replace quarantine destination persisted before native detach. */
|
|
37
|
+
plannedPath: string;
|
|
38
|
+
/** Native-returned detached path, persisted after a failed post-detach cleanup. */
|
|
39
|
+
detachedPath?: string;
|
|
40
|
+
/** Append-only terminal proof for this exact artifact; completed entries are never retried. */
|
|
41
|
+
completed?: true;
|
|
42
|
+
};
|
|
43
|
+
/** Durable root-tree authority for broker artifact cleanup. */
|
|
44
|
+
export type BrokerArtifactTree = {
|
|
45
|
+
identity: BrokerCleanupIdentity;
|
|
46
|
+
snapshot: NativeDirectoryTreeSnapshot;
|
|
47
|
+
plannedPath: string;
|
|
48
|
+
detachedPath?: string;
|
|
49
|
+
completed?: true;
|
|
50
|
+
};
|
|
11
51
|
export type BrokerCleanupEvidence = {
|
|
12
|
-
phase: "artifacts" | "transcript" | "metadata";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
52
|
+
phase: "artifacts" | "transcript" | "metadata" | "lifecycle";
|
|
53
|
+
/** Ledger-bound deletion target; never reconstructed from a retry request. */
|
|
54
|
+
sessionsRoot?: string;
|
|
55
|
+
transcriptPath?: string;
|
|
56
|
+
cwd?: string;
|
|
57
|
+
metadataRoot?: string;
|
|
58
|
+
sessionId?: string;
|
|
59
|
+
artifactsIdentity?: BrokerCleanupIdentity;
|
|
60
|
+
transcriptIdentity?: BrokerCleanupIdentity;
|
|
61
|
+
/** Identity-bound lifecycle metadata marker retained when exact cleanup is deferred. */
|
|
62
|
+
metadataIdentity?: BrokerCleanupIdentity;
|
|
63
|
+
metadataPath?: string;
|
|
64
|
+
/** Monotonic append-only cleanup attempt. */
|
|
65
|
+
metadataAttempt?: number;
|
|
66
|
+
/** No-replace quarantine destination persisted before lifecycle metadata detach. */
|
|
67
|
+
plannedMetadataPath?: string;
|
|
68
|
+
/** Native-returned metadata quarantine path retained until identity-bound reconciliation succeeds. */
|
|
69
|
+
detachedMetadataPath?: string;
|
|
70
|
+
/** Append-only terminal proof for lifecycle metadata cleanup. */
|
|
71
|
+
metadataCompleted?: true;
|
|
72
|
+
detachedArtifactsPath?: string;
|
|
73
|
+
detachedTranscriptPath?: string;
|
|
74
|
+
/** Durable proof that artifact cleanup completed before transcript mutation. */
|
|
75
|
+
artifactsRemoved?: boolean;
|
|
76
|
+
/** Preauthorized no-replace artifact quarantine path persisted before detach. */
|
|
77
|
+
plannedArtifactsPath?: string;
|
|
78
|
+
/** Identity-bound artifact tree authority persisted before broker detach and replayed exactly. */
|
|
79
|
+
artifactTree?: BrokerArtifactTree;
|
|
80
|
+
/** Preauthorized no-replace transcript quarantine path persisted before detach. */
|
|
81
|
+
plannedTranscriptPath?: string;
|
|
82
|
+
/** Fully identity-bound startup-failure cleanup plan, persisted before any detach. */
|
|
83
|
+
lifecycleFiles?: BrokerLifecycleCleanupFile[];
|
|
84
|
+
/** Delete metadata receipts authorize only the canonical marker/ready sibling pair. */
|
|
85
|
+
lifecycleDeleteMetadata?: true;
|
|
21
86
|
};
|
|
22
87
|
export type BrokerResponse = {
|
|
23
88
|
ok: true;
|
|
@@ -37,17 +102,18 @@ export type BrokerResponse = {
|
|
|
37
102
|
};
|
|
38
103
|
export declare class Broker {
|
|
39
104
|
#private;
|
|
40
|
-
readonly settings:
|
|
105
|
+
readonly settings: ResolvedBrokerSettings;
|
|
41
106
|
readonly index: SessionIndex;
|
|
42
107
|
readonly ledger: LifecycleLedger;
|
|
43
108
|
discovery: BrokerDiscovery | null;
|
|
44
109
|
constructor(settings: BrokerSettings);
|
|
45
110
|
start(): Promise<BrokerDiscovery>;
|
|
46
111
|
get ownsDiscovery(): boolean;
|
|
47
|
-
status():
|
|
112
|
+
status(): RedactedBrokerDiscovery | null;
|
|
48
113
|
heartbeat(): Promise<void>;
|
|
49
114
|
stop(): Promise<void>;
|
|
50
115
|
handleRequest(operation: string, input: Record<string, unknown>, idempotencyKey?: string): Promise<BrokerResponse>;
|
|
51
116
|
}
|
|
52
117
|
/** Test-only hook for simulating a process crash after terminal persistence verification. */
|
|
53
118
|
export declare function setTerminalPersistenceHookForTest(broker: Broker, hook: (() => void) | undefined): void;
|
|
119
|
+
export {};
|
|
@@ -11,6 +11,13 @@ export interface EnsureBrokerSettings {
|
|
|
11
11
|
*/
|
|
12
12
|
env?: NodeJS.ProcessEnv;
|
|
13
13
|
}
|
|
14
|
+
export interface FixtureBrokerLease {
|
|
15
|
+
close(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface StartedFixtureBroker {
|
|
18
|
+
discovery: BrokerDiscovery;
|
|
19
|
+
lease: FixtureBrokerLease;
|
|
20
|
+
}
|
|
14
21
|
interface BrokerOwner {
|
|
15
22
|
stop(): Promise<void>;
|
|
16
23
|
canReuse(discovery: BrokerDiscovery | null): boolean;
|
|
@@ -22,6 +29,8 @@ interface ReapTiming {
|
|
|
22
29
|
}
|
|
23
30
|
/** Starts the detached broker entrypoint when discovery has no live owner. */
|
|
24
31
|
export declare function ensureBroker(settings: EnsureBrokerSettings): Promise<BrokerDiscovery>;
|
|
32
|
+
/** Starts one fresh fixture broker and returns its sole exact-child close lease. */
|
|
33
|
+
export declare function startFixtureBrokerWithLeaseForTest(settings: EnsureBrokerSettings): Promise<StartedFixtureBroker>;
|
|
25
34
|
/** Test hook: returns a stop handle for the detached broker this process spawned. */
|
|
26
35
|
export declare function brokerOwnerForTest(agentDir: string): BrokerOwner | undefined;
|
|
27
36
|
/** Test hook: drives the detached-broker reap on a controllable child surface. */
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Decodes persisted lifecycle bytes without replacement characters before JSON parsing. */
|
|
2
|
+
export declare function decodeLifecycleUtf8(bytes: Uint8Array): string;
|
|
3
|
+
/** Parses persisted lifecycle JSON only after fatal UTF-8 decoding. */
|
|
4
|
+
export declare function parseLifecycleJson(bytes: Uint8Array): unknown;
|
|
@@ -83,10 +83,24 @@ export type BeginResult = {
|
|
|
83
83
|
kind: "in_progress";
|
|
84
84
|
entry: LifecycleLedgerEntry;
|
|
85
85
|
};
|
|
86
|
+
export interface LifecycleLedgerLimits {
|
|
87
|
+
maxBytes?: number;
|
|
88
|
+
maxLineBytes?: number;
|
|
89
|
+
maxRows?: number;
|
|
90
|
+
}
|
|
86
91
|
export declare class LifecycleLedger {
|
|
87
92
|
#private;
|
|
88
|
-
constructor(agentDir: string);
|
|
93
|
+
constructor(agentDir: string, limits?: LifecycleLedgerLimits);
|
|
89
94
|
open(): Promise<this>;
|
|
95
|
+
/**
|
|
96
|
+
* Reads terminal proof for one request without recovering or changing the ledger.
|
|
97
|
+
*
|
|
98
|
+
* This intentionally accepts an unrelated unterminated final write: concurrent
|
|
99
|
+
* appenders may have started a different row after this request's synced terminal
|
|
100
|
+
* row. Complete rows are still decoded and validated strictly, and any incomplete
|
|
101
|
+
* tail that identifies this request withholds proof.
|
|
102
|
+
*/
|
|
103
|
+
readTerminal(identity: string, requestHash: string): Promise<LifecycleLedgerEntry | undefined>;
|
|
90
104
|
get warnings(): readonly string[];
|
|
91
105
|
begin(identity: string, requestHash: string): Promise<BeginResult>;
|
|
92
106
|
transition(identity: string, state: LifecycleState, fields?: Omit<Partial<LifecycleLedgerEntry>, "identity" | "requestHash" | "state" | "ts">): Promise<LifecycleLedgerEntry>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SdkStartupFailure, SdkStartupRollbackResult } from "../startup-capability";
|
|
2
|
-
import type { Broker, BrokerResponse } from "./broker";
|
|
2
|
+
import type { Broker, BrokerCleanupEvidence, BrokerResponse } from "./broker";
|
|
3
3
|
import type { LifecycleDurableEffectsReceipt, LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
|
|
4
4
|
import { type ProcessIncarnationCommandRunner, type ProcessIncarnationOptions, parseDarwinProcessIncarnation, processIncarnation } from "./process-incarnation";
|
|
5
5
|
import { type SdkInternalSpawnCommand } from "./runtime";
|
|
@@ -21,6 +21,8 @@ type LifecycleCommand = SdkInternalSpawnCommand | {
|
|
|
21
21
|
args: string[];
|
|
22
22
|
};
|
|
23
23
|
type LifecycleCommandResolver = () => LifecycleCommand;
|
|
24
|
+
/** Test-only hook for simulating a crash immediately after one exact lifecycle detach. */
|
|
25
|
+
export declare function setLifecycleCleanupHookForTest(broker: Broker, hook: (() => void) | undefined): void;
|
|
24
26
|
export declare function setLifecycleCommandResolverForTest(broker: Broker, resolver: LifecycleCommandResolver | undefined): void;
|
|
25
27
|
export declare function setLifecycleTimingForTest(broker: Broker, timing: LifecycleTiming | undefined): void;
|
|
26
28
|
export declare function hasValidLifecycleDeadlines(value: LifecycleDeadlines, now?: number): boolean;
|
|
@@ -43,6 +45,7 @@ export interface SessionLifecycleTranscriptIdentity {
|
|
|
43
45
|
size: number;
|
|
44
46
|
mtimeMs: number;
|
|
45
47
|
mtimeNs: string;
|
|
48
|
+
sha256: string;
|
|
46
49
|
}
|
|
47
50
|
export interface SessionLifecycleLaunchRequest {
|
|
48
51
|
operation: "session.create" | "session.fork" | "session.resume";
|
|
@@ -66,6 +69,7 @@ export interface SessionLifecycleLaunchRequest {
|
|
|
66
69
|
lifecycleCleanupDeadlineAt: number;
|
|
67
70
|
}
|
|
68
71
|
export declare function readSessionLifecycleLaunchRequest(value: string | undefined, now?: number): SessionLifecycleLaunchRequest;
|
|
72
|
+
type CleanupEvidence = BrokerCleanupEvidence;
|
|
69
73
|
export declare function setProcessIncarnationForTest(broker: Broker, value: ((pid: number) => string | undefined) | undefined): void;
|
|
70
74
|
/** The child writes this only after its endpoint and semantic ready event are both live. */
|
|
71
75
|
export declare function writeSessionLifecycleReady(root: string, id: string, effectMarker: string): Promise<void>;
|
|
@@ -82,4 +86,4 @@ export interface LifecycleExecutionOutcome {
|
|
|
82
86
|
deferredArtifactCleanup?: () => Promise<void>;
|
|
83
87
|
}
|
|
84
88
|
/** Returns the response together with every durable lifecycle fact needed for truthful replay. */
|
|
85
|
-
export declare function executeLifecycle(broker: Broker, operation: string, input: Input, identity: string): Promise<LifecycleExecutionOutcome>;
|
|
89
|
+
export declare function executeLifecycle(broker: Broker, operation: string, input: Input, identity: string, cleanup?: CleanupEvidence): Promise<LifecycleExecutionOutcome>;
|
|
@@ -9,6 +9,8 @@ export interface ProcessIncarnationOptions {
|
|
|
9
9
|
}
|
|
10
10
|
/** Parse the microsecond-resolution start timestamp returned by Darwin proc_pidinfo. */
|
|
11
11
|
export declare function parseDarwinProcessIncarnation(info: Uint8Array): string | undefined;
|
|
12
|
+
/** Whether `value` is a canonical process-incarnation string (`linux:`/`darwin:`/`windows:`). */
|
|
13
|
+
export declare function isProcessIncarnation(value: unknown): value is string;
|
|
12
14
|
/** A PID is reusable; bind it to the strongest OS-provided process start incarnation available. */
|
|
13
15
|
export declare function processIncarnation(pid: number, options?: ProcessIncarnationOptions): string | undefined;
|
|
14
16
|
export {};
|
|
@@ -46,7 +46,6 @@ export declare class SessionIndex {
|
|
|
46
46
|
get indexSeq(): number;
|
|
47
47
|
append(input: Omit<SessionIndexEvent, "version" | "indexSeq" | "checksum" | "ts"> & Partial<Pick<SessionIndexEvent, "ts">>): Promise<SessionIndexEvent>;
|
|
48
48
|
snapshot(): Promise<void>;
|
|
49
|
-
assertSupportedStateVersions(): Promise<void>;
|
|
50
49
|
listSessions(): SessionList;
|
|
51
50
|
hostUnregisteredAfter(registration: Pick<IndexedSession, "sessionId" | "endpointGeneration" | "pid" | "indexSeq" | "lifecycleRequestId">): {
|
|
52
51
|
indexSeq: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const SDK_STATE_VERSION = 1;
|
|
2
|
+
export declare const SESSION_INDEX_SNAPSHOT_VERSION = 2;
|
|
2
3
|
export declare class UnsupportedStateVersionError extends Error {
|
|
3
4
|
readonly file: string;
|
|
4
5
|
readonly version: number;
|
|
@@ -6,3 +7,4 @@ export declare class UnsupportedStateVersionError extends Error {
|
|
|
6
7
|
constructor(file: string, version: number);
|
|
7
8
|
}
|
|
8
9
|
export declare function assertSupportedStateVersion(file: string, value: unknown): void;
|
|
10
|
+
export declare function assertSupportedSnapshotVersion(file: string, value: unknown): void;
|
|
@@ -62,6 +62,7 @@ export declare class ChatEffectJournal {
|
|
|
62
62
|
pidIncarnation?: (pid: number) => string | undefined;
|
|
63
63
|
sleep?: (ms: number) => Promise<void>;
|
|
64
64
|
lockTimeoutMs?: number;
|
|
65
|
+
maxTerminalEffects?: number;
|
|
65
66
|
});
|
|
66
67
|
get filePath(): string;
|
|
67
68
|
read<TPayload = unknown>(id: string): Promise<ChatEffect<TPayload> | undefined>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* removed), but the user can still adjust per-surface behaviour from inside a
|
|
6
6
|
* session thread with small slash commands:
|
|
7
7
|
*
|
|
8
|
-
* - `/verbose` switch the mirror to
|
|
8
|
+
* - `/verbose` switch the mirror to bounded tool-owned summaries + provider-displayable reasoning summaries
|
|
9
9
|
* - `/lean` switch back to lean (assistant text + tool names)
|
|
10
10
|
* - `/verbosity lean|verbose`
|
|
11
11
|
* - `/redact on|off` toggle redaction of streamed content
|
|
@@ -28,6 +28,9 @@ export interface NotificationSettingsSnapshot {
|
|
|
28
28
|
botToken?: string;
|
|
29
29
|
chatId?: string;
|
|
30
30
|
activation?: Record<string, unknown>;
|
|
31
|
+
btw: {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
};
|
|
31
34
|
rich: {
|
|
32
35
|
enabled: boolean;
|
|
33
36
|
};
|
|
@@ -65,6 +68,11 @@ export interface NotificationSettingsReader {
|
|
|
65
68
|
getNotificationSettingsSnapshot(): NotificationSettingsSnapshot;
|
|
66
69
|
getAgentDir(): string;
|
|
67
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Validate and snapshot the raw global notification configuration used by both
|
|
73
|
+
* the interactive host and the lightweight daemon process.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseNotificationSettingsSnapshot(rawConfig?: unknown): NotificationSettingsSnapshot;
|
|
68
76
|
export interface NotificationConfig {
|
|
69
77
|
enabled: boolean;
|
|
70
78
|
botToken?: string;
|
|
@@ -92,6 +100,9 @@ export interface NotificationConfig {
|
|
|
92
100
|
*/
|
|
93
101
|
sessionScope: "all" | "primary";
|
|
94
102
|
idleTimeoutMs: number;
|
|
103
|
+
btw: {
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
};
|
|
95
106
|
rich: {
|
|
96
107
|
enabled: boolean;
|
|
97
108
|
};
|
|
@@ -9,6 +9,10 @@ export interface DiscordEndpointBinding {
|
|
|
9
9
|
isCurrent(): boolean;
|
|
10
10
|
send(frame: Record<string, unknown>): void | Promise<void>;
|
|
11
11
|
}
|
|
12
|
+
export interface DiscordLeaseRecoveryScheduler {
|
|
13
|
+
setTimeout(callback: () => void | Promise<void>, delayMs: number): unknown;
|
|
14
|
+
clearTimeout(handle: unknown): void;
|
|
15
|
+
}
|
|
12
16
|
export interface DiscordNotificationDaemonOptions {
|
|
13
17
|
agentDir: string;
|
|
14
18
|
repo: string;
|
|
@@ -16,6 +20,7 @@ export interface DiscordNotificationDaemonOptions {
|
|
|
16
20
|
parentChannelId: string;
|
|
17
21
|
provider: DiscordProvider;
|
|
18
22
|
now?: () => number;
|
|
23
|
+
leaseRecoveryScheduler?: DiscordLeaseRecoveryScheduler;
|
|
19
24
|
resolveEndpoint: (sessionId: string, expectedGeneration?: number) => Promise<DiscordEndpointBinding | null>;
|
|
20
25
|
onCommand?: (sessionId: string, content: string, endpoint: DiscordEndpointBinding, idempotencyKey: string) => Promise<boolean>;
|
|
21
26
|
}
|
|
@@ -26,8 +26,9 @@ export declare function code(raw: string): string;
|
|
|
26
26
|
export declare function pre(raw: string): string;
|
|
27
27
|
/**
|
|
28
28
|
* Convert a bounded markdown subset into Telegram HTML. Supported: fenced code,
|
|
29
|
-
* inline code, `**bold**`, `*italic*`, `[text](url)`
|
|
30
|
-
* `#` headers, `>` blockquotes, and GFM tables (rendered
|
|
29
|
+
* inline code, `**bold**`, `*italic*`, `~~strikethrough~~`, `[text](url)`
|
|
30
|
+
* (safe schemes only), `#` headers, `>` blockquotes, and GFM tables (rendered
|
|
31
|
+
* as a monospace block).
|
|
31
32
|
* Unsupported or malformed markdown is left as escaped literal text — never
|
|
32
33
|
* emitted as unbalanced tags.
|
|
33
34
|
*/
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* Enable with Settings notifications config, `GJC_NOTIFICATIONS=1` (a token is
|
|
18
18
|
* generated), or `GJC_NOTIFICATIONS_TOKEN`.
|
|
19
19
|
*/
|
|
20
|
+
import type { Tool } from "@gajae-code/ai";
|
|
20
21
|
import { NotificationServer } from "@gajae-code/natives";
|
|
21
22
|
import { Settings } from "../../config/settings";
|
|
22
23
|
import type { ExtensionAPI, ExtensionContext } from "../../extensibility/extensions";
|
|
@@ -259,6 +260,9 @@ export declare class PresentationArbiter {
|
|
|
259
260
|
cancel(gateId: string, reason: string): void;
|
|
260
261
|
dispose(): void;
|
|
261
262
|
}
|
|
263
|
+
/** Stable projection of the tool-owned safe-display seam (never the full Tool surface). */
|
|
264
|
+
type SafeSummaryTool = Pick<Tool, "safeSummary" | "safeSummaryFields">;
|
|
265
|
+
export declare function projectToolSummary(tool: SafeSummaryTool | undefined, kind: "args" | "result", value: unknown): string | undefined;
|
|
262
266
|
export declare function notificationsEnabled(): boolean;
|
|
263
267
|
/** Workflow-gate answer shape. */
|
|
264
268
|
interface GateAnswer {
|
|
@@ -304,6 +308,26 @@ export interface NotificationControlCommandResult {
|
|
|
304
308
|
}>;
|
|
305
309
|
}
|
|
306
310
|
export declare function executeNotificationControlCommand(command: NotificationControlCommandPayload | undefined, ctx: ExtensionContext, api: ExtensionAPI, expectedSessionId?: string): Promise<NotificationControlCommandResult>;
|
|
311
|
+
interface EphemeralTurnAuthority {
|
|
312
|
+
sessionId: string;
|
|
313
|
+
endpointDigest: string;
|
|
314
|
+
eventGeneration: number;
|
|
315
|
+
}
|
|
316
|
+
/** Host-owned, bounded idempotency and cancellation lifecycle for v3 side turns. */
|
|
317
|
+
export declare class EphemeralTurnHost {
|
|
318
|
+
#private;
|
|
319
|
+
constructor(sendTo: (connectionId: string, frame: Record<string, unknown>) => void, execute: (question: string, signal: AbortSignal) => Promise<{
|
|
320
|
+
replyText: string;
|
|
321
|
+
}>, now?: () => number);
|
|
322
|
+
configureAuthority(authority: EphemeralTurnAuthority): void;
|
|
323
|
+
disable(): void;
|
|
324
|
+
enable(): void;
|
|
325
|
+
dispose(): void;
|
|
326
|
+
handle(connectionId: string, frame: Record<string, unknown>): boolean;
|
|
327
|
+
sessionUnavailable(sessionId: string): void;
|
|
328
|
+
/** Testable event-ring eviction boundary; tombstones remain idempotency authority. */
|
|
329
|
+
evictTerminalEvents(): void;
|
|
330
|
+
}
|
|
307
331
|
export declare function createNotificationsExtension(api: ExtensionAPI, options?: {
|
|
308
332
|
settings?: Settings;
|
|
309
333
|
ensureTelegramDaemon?: (input: {
|
|
@@ -315,5 +339,8 @@ export declare function createNotificationsExtension(api: ExtensionAPI, options?
|
|
|
315
339
|
spawnedByGjc?: boolean;
|
|
316
340
|
controller?: NotificationSessionController;
|
|
317
341
|
onSdkRequest?: (kind: "control" | "query", connectionId: string, frame: Record<string, unknown>) => void;
|
|
342
|
+
runEphemeralTurn?: (promptText: string, signal: AbortSignal) => Promise<{
|
|
343
|
+
replyText: string;
|
|
344
|
+
}>;
|
|
318
345
|
}): void;
|
|
319
346
|
export {};
|
|
@@ -68,6 +68,8 @@ export declare function daemonCloseSession(env?: NodeJS.ProcessEnv, deps?: {
|
|
|
68
68
|
* prefix against saved history and fail closed (`ambiguous`/`notFound`) before
|
|
69
69
|
* cold-restarting exactly one resolved session via the daemon-safe launcher. */
|
|
70
70
|
export declare function daemonResumeSession(env?: NodeJS.ProcessEnv, opts?: {
|
|
71
|
+
agentDir?: string;
|
|
72
|
+
/** Explicit managed root for isolated tests. */
|
|
71
73
|
sessionsRoot?: string;
|
|
72
74
|
listSessions?: (env: NodeJS.ProcessEnv) => GjcTmuxSessionStatus[];
|
|
73
75
|
ownerIsolationProbe?: OwnerIsolationProbe;
|
|
@@ -100,6 +102,8 @@ export declare function buildOrchestratorDeps(input: {
|
|
|
100
102
|
auditRedactionKey: Uint8Array;
|
|
101
103
|
/** Root of saved session histories (`<agentDir>/sessions`), for resume resolution. */
|
|
102
104
|
sessionsRoot?: string;
|
|
105
|
+
/** Agent directory used for readonly managed-session resume resolution. */
|
|
106
|
+
agentDir?: string;
|
|
103
107
|
env?: NodeJS.ProcessEnv;
|
|
104
108
|
}): OrchestratorDeps;
|
|
105
109
|
/**
|
|
@@ -5,10 +5,29 @@ import type { Settings } from "../../config/settings";
|
|
|
5
5
|
* can never leak a credential regardless of where the string originated.
|
|
6
6
|
*/
|
|
7
7
|
export declare function sanitizeDiagnostic(text: string, token?: string): string;
|
|
8
|
+
/** Identity evidence required to remove precisely the endpoint that was inspected. */
|
|
9
|
+
export interface NotificationEndpointFileIdentity {
|
|
10
|
+
dev: bigint;
|
|
11
|
+
ino: bigint;
|
|
12
|
+
size: bigint;
|
|
13
|
+
mtimeNs: bigint;
|
|
14
|
+
sha256: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NotificationEndpointFile {
|
|
17
|
+
bytes: Buffer;
|
|
18
|
+
identity: NotificationEndpointFileIdentity;
|
|
19
|
+
}
|
|
20
|
+
export interface NotificationExactUnlinkResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
code?: string;
|
|
23
|
+
detachedPath?: string;
|
|
24
|
+
}
|
|
8
25
|
/** Minimal filesystem surface the service needs; injectable for tests. */
|
|
9
26
|
export interface NotificationServiceFs {
|
|
10
27
|
readdir(dir: string): Promise<string[]>;
|
|
11
28
|
readFile(file: string, encoding: "utf8"): Promise<string>;
|
|
29
|
+
readEndpointFile(file: string): Promise<NotificationEndpointFile>;
|
|
30
|
+
exactUnlink(file: string, identity: NotificationEndpointFileIdentity): Promise<NotificationExactUnlinkResult>;
|
|
12
31
|
unlink(file: string): Promise<void>;
|
|
13
32
|
/**
|
|
14
33
|
* Atomically create `file` with O_EXCL semantics: resolves `true` when this
|
|
@@ -123,6 +142,7 @@ export interface NotificationRecoveryReport {
|
|
|
123
142
|
endpointsRemoved: RecoveredEndpoint[];
|
|
124
143
|
endpointsKept: number;
|
|
125
144
|
endpointsUnreadable: number;
|
|
145
|
+
endpointsDetached?: string[];
|
|
126
146
|
daemon: {
|
|
127
147
|
action: DaemonRecoveryAction;
|
|
128
148
|
detail: string;
|