@gajae-code/coding-agent 0.18.7 → 0.18.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +377 -1
- package/dist/types/async/endpoint-id.d.ts +16 -0
- package/dist/types/async/job-manager.d.ts +1 -1
- package/dist/types/async/support.d.ts +0 -14
- package/dist/types/capability/mcp.d.ts +2 -0
- package/dist/types/capability/skill.d.ts +2 -0
- package/dist/types/capability/types.d.ts +2 -0
- package/dist/types/cli/public-command-errors.d.ts +3 -1
- package/dist/types/cli/setup-cli.d.ts +1 -1
- package/dist/types/commands/deep-interview.d.ts +3 -0
- package/dist/types/commands/mcp-serve.d.ts +4 -0
- package/dist/types/config/autorouting-tier-map.d.ts +348 -9
- package/dist/types/config/file-lock.d.ts +1 -0
- package/dist/types/config/model-bindings-applier.d.ts +2 -0
- package/dist/types/config/model-profile-activation.d.ts +11 -3
- package/dist/types/config/model-registry.d.ts +4 -9
- package/dist/types/config/skill-settings-defaults.d.ts +2 -0
- package/dist/types/cursor-delete-path.d.ts +1 -0
- package/dist/types/cursor-mcp-name.d.ts +8 -0
- package/dist/types/customization/inventory.d.ts +2 -0
- package/dist/types/debug/report-bundle-parent.d.ts +2 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.d.ts +1 -0
- package/dist/types/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.d.ts +31 -0
- package/dist/types/defaults/gjc-skills.generated.d.ts +5 -6
- package/dist/types/discovery/helpers.d.ts +6 -1
- package/dist/types/discovery/mcp-json.d.ts +1 -0
- package/dist/types/eval/py/kernel.d.ts +18 -0
- package/dist/types/export/html/css-color.d.ts +2 -0
- package/dist/types/export/html/html-export-destination.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/extensions/function-hooks-internal.d.ts +5 -0
- package/dist/types/extensibility/extensions/types.d.ts +7 -0
- package/dist/types/extensibility/gjc-plugins/runtime-adapters.d.ts +14 -1
- package/dist/types/extensibility/plugins/marketplace/cache.d.ts +2 -0
- package/dist/types/extensibility/plugins/plugin-link-path.d.ts +2 -0
- package/dist/types/extensibility/runtime-skill-discovery.d.ts +3 -1
- package/dist/types/extensibility/skill-management.d.ts +4 -1
- package/dist/types/extensibility/skills.d.ts +2 -0
- package/dist/types/gjc-runtime/deep-interview-crystallize.d.ts +74 -0
- package/dist/types/gjc-runtime/deep-interview-runtime.d.ts +11 -0
- package/dist/types/gjc-runtime/gc-runtime.d.ts +5 -0
- package/dist/types/gjc-runtime/psmux-detect.d.ts +3 -3
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +0 -5
- package/dist/types/gjc-runtime/sidecar-bootstrap-env.d.ts +6 -0
- package/dist/types/gjc-runtime/state-argv.d.ts +1 -1
- package/dist/types/gjc-runtime/state-migrations.d.ts +8 -0
- package/dist/types/gjc-runtime/state-runtime.d.ts +95 -0
- package/dist/types/gjc-runtime/state-writer.d.ts +14 -1
- package/dist/types/gjc-runtime/tmux-common.d.ts +8 -5
- package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +8 -0
- package/dist/types/internal-urls/skill-path.d.ts +1 -0
- package/dist/types/lsp/config.d.ts +8 -5
- package/dist/types/lsp/workspace-path.d.ts +1 -0
- package/dist/types/modes/acp/acp-agent.d.ts +7 -0
- package/dist/types/modes/components/custom-editor.d.ts +6 -0
- package/dist/types/modes/components/customization/customization-dashboard.d.ts +1 -0
- package/dist/types/modes/components/extensions/state-manager.d.ts +4 -3
- package/dist/types/modes/controllers/input-controller.d.ts +9 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/utils/interrupt-ownership.d.ts +3 -0
- package/dist/types/modes/utils/keybinding-matchers.d.ts +1 -0
- package/dist/types/modes/utils/macos-option-forwarding.d.ts +17 -0
- package/dist/types/progress/collect-project-progress.d.ts +38 -0
- package/dist/types/progress/progress-contract.d.ts +154 -0
- package/dist/types/progress/progress-snapshot.d.ts +11 -0
- package/dist/types/progress/project-progress.d.ts +141 -0
- package/dist/types/progress/render-progress.d.ts +28 -0
- package/dist/types/runtime-mcp/manager.d.ts +2 -1
- package/dist/types/runtime-mcp/mcp-redirect.d.ts +9 -0
- package/dist/types/runtime-mcp/oauth-public-url.d.ts +3 -0
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +1 -0
- package/dist/types/runtime-mcp/project-host-values.d.ts +27 -0
- package/dist/types/runtime-mcp/smithery-registry.d.ts +24 -0
- package/dist/types/runtime-mcp/types.d.ts +6 -0
- package/dist/types/sdk/acp/adapter.d.ts +1 -1
- package/dist/types/sdk/broker/broker-exit.d.ts +6 -2
- package/dist/types/sdk/broker/broker.d.ts +24 -2
- package/dist/types/sdk/broker/doctor-restart.d.ts +5 -0
- package/dist/types/sdk/broker/ensure.d.ts +14 -1
- package/dist/types/sdk/broker/session-index.d.ts +12 -6
- package/dist/types/sdk/bus/index.d.ts +12 -1
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -1
- package/dist/types/sdk/client/client.d.ts +2 -0
- package/dist/types/sdk/host/query/handlers.d.ts +3 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session-list.d.ts +1 -1
- package/dist/types/sdk/session.d.ts +8 -0
- package/dist/types/session/agent-session.d.ts +38 -9
- package/dist/types/session/artifacts.d.ts +2 -2
- package/dist/types/session/internal/managed-gc-retirement-codec.d.ts +32 -0
- package/dist/types/session/internal/managed-session-scope.d.ts +79 -2
- package/dist/types/session/internal/managed-session-storage.d.ts +26 -1
- package/dist/types/session/internal/managed-task-owner-cleanup.d.ts +62 -0
- package/dist/types/session/internal/task-artifact-owner-access.d.ts +2 -0
- package/dist/types/session/internal/task-artifact-owner-transcript.d.ts +9 -1
- package/dist/types/session/session-manager.d.ts +31 -5
- package/dist/types/session/session-retirement.d.ts +31 -7
- package/dist/types/session/session-storage.d.ts +69 -2
- package/dist/types/session/task-artifact-owner-codec.d.ts +2 -0
- package/dist/types/setup/credential-auto-import.d.ts +1 -1
- package/dist/types/setup/credential-import.d.ts +6 -4
- package/dist/types/skill-state/active-state.d.ts +38 -0
- package/dist/types/skill-state/workflow-mutation-guard.d.ts +3 -0
- package/dist/types/slash-commands/helpers/progress-report.d.ts +8 -0
- package/dist/types/task/executor.d.ts +3 -0
- package/dist/types/task/isolation-dir.d.ts +26 -0
- package/dist/types/tools/ast-edit-write-path.d.ts +13 -0
- package/dist/types/tools/bash-skill-urls.d.ts +1 -1
- package/dist/types/tools/browser/cdp-url.d.ts +2 -0
- package/dist/types/tools/github-side-effect.d.ts +22 -0
- package/dist/types/tools/index.d.ts +3 -0
- package/dist/types/tools/monitor-mutation.d.ts +9 -0
- package/dist/types/tools/python.d.ts +9 -1
- package/dist/types/tools/recipe/recipe-guard.d.ts +7 -0
- package/dist/types/tools/restricted-cwd.d.ts +1 -0
- package/dist/types/tools/todo-write.d.ts +6 -0
- package/dist/types/utils/tools-checksum.d.ts +7 -0
- package/package.json +7 -7
- package/scripts/generate-sdk-operation-inventory.ts +21 -0
- package/scripts/verify-managed-empty-stop.ts +28 -0
- package/src/async/endpoint-id.ts +26 -0
- package/src/async/job-manager.ts +247 -132
- package/src/async/support.ts +0 -25
- package/src/capability/index.ts +15 -0
- package/src/capability/mcp.ts +2 -0
- package/src/capability/skill.ts +2 -0
- package/src/capability/types.ts +2 -0
- package/src/cli/auth-broker-cli.ts +1 -1
- package/src/cli/customize-doctor.ts +15 -2
- package/src/cli/doctor/repairs.ts +4 -1
- package/src/cli/doctor-supervisor.ts +3 -0
- package/src/cli/public-command-errors.ts +21 -1
- package/src/cli/public-command-registry.ts +28 -6
- package/src/cli/setup-cli.ts +4 -4
- package/src/cli/skills-cli.ts +5 -0
- package/src/commands/deep-interview.ts +47 -8
- package/src/commands/mcp-serve.ts +7 -0
- package/src/commands/sdk.ts +455 -397
- package/src/config/autorouting-tier-map.ts +117 -7
- package/src/config/file-lock.ts +316 -79
- package/src/config/mcp-schema.json +4 -0
- package/src/config/model-bindings-applier.ts +20 -0
- package/src/config/model-profile-activation.ts +240 -46
- package/src/config/model-registry.ts +47 -153
- package/src/config/skill-settings-defaults.ts +7 -0
- package/src/coordinator-mcp/policy.ts +3 -2
- package/src/coordinator-mcp/server.ts +2 -0
- package/src/cursor-delete-path.ts +10 -0
- package/src/cursor-mcp-name.ts +15 -0
- package/src/cursor.ts +13 -2
- package/src/customization/inventory.ts +4 -13
- package/src/dap/config.ts +2 -2
- package/src/debug/report-bundle-parent.ts +22 -0
- package/src/debug/report-bundle.ts +3 -0
- package/src/debug/system-info.ts +13 -1
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/register.ts +10 -6
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/stream.ts +67 -4
- package/src/defaults/gjc/extensions/grok-cli-vendor/src/provider/version-manager.ts +80 -0
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +105 -10
- package/src/defaults/gjc/skills/ralplan/SKILL.md +6 -4
- package/src/defaults/gjc-defaults.test.ts +18 -1
- package/src/defaults/gjc-defaults.ts +3 -0
- package/src/defaults/gjc-skills.generated.ts +58 -36
- package/src/discovery/agents.ts +6 -1
- package/src/discovery/builtin.ts +13 -1
- package/src/discovery/helpers.ts +171 -29
- package/src/discovery/mcp-json.ts +26 -12
- package/src/discovery/ssh.ts +1 -1
- package/src/discovery/substitute-plugin-root.ts +3 -1
- package/src/edit/file-read-cache.ts +1 -1
- package/src/eval/py/executor.ts +796 -154
- package/src/eval/py/kernel.ts +79 -13
- package/src/eval/py/tool-bridge.ts +4 -0
- package/src/export/html/css-color.ts +9 -0
- package/src/export/html/html-export-destination.ts +16 -0
- package/src/export/html/index.ts +7 -10
- package/src/export/html/template.generated.ts +1 -1
- package/src/extensibility/extensions/function-hooks-internal.ts +27 -0
- package/src/extensibility/extensions/runner.ts +15 -1
- package/src/extensibility/extensions/types.ts +7 -0
- package/src/extensibility/gjc-plugins/mcp-policy.ts +2 -1
- package/src/extensibility/gjc-plugins/runtime-adapters.ts +85 -8
- package/src/extensibility/plugins/manager.ts +3 -2
- package/src/extensibility/plugins/marketplace/cache.ts +15 -0
- package/src/extensibility/plugins/marketplace/manager.ts +11 -3
- package/src/extensibility/plugins/plugin-link-path.ts +12 -0
- package/src/extensibility/runtime-skill-discovery.ts +20 -2
- package/src/extensibility/skill-management.ts +9 -2
- package/src/extensibility/skills.ts +6 -1
- package/src/gjc-runtime/deep-interview-crystallize.ts +1814 -0
- package/src/gjc-runtime/deep-interview-recorder.ts +20 -2
- package/src/gjc-runtime/deep-interview-runtime.ts +1415 -13
- package/src/gjc-runtime/deep-interview-stage.ts +98 -21
- package/src/gjc-runtime/gc-runtime.ts +206 -9
- package/src/gjc-runtime/launch-worktree.ts +70 -9
- package/src/gjc-runtime/psmux-detect.ts +28 -4
- package/src/gjc-runtime/ralplan-runtime.ts +447 -52
- package/src/gjc-runtime/session-state-sidecar.ts +3 -2
- package/src/gjc-runtime/sidecar-bootstrap-env.ts +19 -0
- package/src/gjc-runtime/state-argv.ts +2 -0
- package/src/gjc-runtime/state-migrations.ts +91 -29
- package/src/gjc-runtime/state-runtime.ts +3716 -135
- package/src/gjc-runtime/state-writer.ts +105 -16
- package/src/gjc-runtime/tmux-common.ts +8 -5
- package/src/gjc-runtime/ultragoal-runtime.ts +16 -4
- package/src/gjc-runtime/workflow-manifest.generated.json +70 -42
- package/src/gjc-runtime/workflow-manifest.ts +54 -21
- package/src/harness-control-plane/operate.ts +12 -4
- package/src/harness-control-plane/owner.ts +5 -1
- package/src/hashline/parser.ts +48 -9
- package/src/hashline/recovery.ts +13 -4
- package/src/internal-urls/docs-index.generated.ts +20 -19
- package/src/internal-urls/skill-path.ts +19 -0
- package/src/internal-urls/skill-protocol.ts +2 -0
- package/src/lsp/config.ts +12 -63
- package/src/lsp/edits.ts +6 -0
- package/src/lsp/workspace-path.ts +51 -0
- package/src/main.ts +195 -31
- package/src/memories/index.ts +88 -7
- package/src/modes/acp/acp-agent.ts +88 -4
- package/src/modes/components/custom-editor.ts +14 -0
- package/src/modes/components/customization/customization-dashboard.ts +12 -0
- package/src/modes/components/extensions/extension-dashboard.ts +2 -2
- package/src/modes/components/extensions/state-manager.ts +15 -5
- package/src/modes/components/hook-editor.ts +1 -1
- package/src/modes/components/hook-selector.ts +1 -1
- package/src/modes/components/model-selector.ts +1 -4
- package/src/modes/components/provider-onboarding-selector.ts +1 -1
- package/src/modes/components/status-line/segments.ts +4 -0
- package/src/modes/controllers/event-controller.ts +11 -4
- package/src/modes/controllers/input-controller.ts +76 -31
- package/src/modes/controllers/runtime-mcp-command-controller.ts +29 -16
- package/src/modes/controllers/selector-controller.ts +24 -15
- package/src/modes/controllers/todo-command-controller.ts +1 -1
- package/src/modes/interactive-mode.ts +5 -1
- package/src/modes/runtime-init.ts +4 -0
- package/src/modes/utils/abort-message.ts +3 -1
- package/src/modes/utils/interrupt-ownership.ts +12 -0
- package/src/modes/utils/keybinding-matchers.ts +4 -0
- package/src/modes/utils/macos-option-forwarding.ts +80 -0
- package/src/progress/collect-project-progress.ts +153 -0
- package/src/progress/progress-contract.ts +172 -0
- package/src/progress/progress-snapshot.ts +140 -0
- package/src/progress/project-progress.ts +446 -0
- package/src/progress/render-progress.ts +209 -0
- package/src/prompts/system/master-mode.md +1 -0
- package/src/prompts/tools/skill-discovery.md +1 -1
- package/src/runtime-mcp/client.ts +4 -2
- package/src/runtime-mcp/config-writer.ts +10 -6
- package/src/runtime-mcp/config.ts +1 -0
- package/src/runtime-mcp/json-rpc.ts +2 -1
- package/src/runtime-mcp/manager.ts +29 -11
- package/src/runtime-mcp/mcp-redirect.ts +73 -0
- package/src/runtime-mcp/oauth-flow.ts +14 -2
- package/src/runtime-mcp/oauth-public-url.ts +14 -0
- package/src/runtime-mcp/plugin-network-boundary.ts +4 -0
- package/src/runtime-mcp/pool.ts +6 -0
- package/src/runtime-mcp/project-host-values.ts +46 -0
- package/src/runtime-mcp/smithery-registry.ts +22 -3
- package/src/runtime-mcp/transports/http.ts +4 -3
- package/src/runtime-mcp/types.ts +6 -0
- package/src/sdk/acp/adapter.ts +95 -8
- package/src/sdk/broker/broker-exit.ts +52 -23
- package/src/sdk/broker/broker.ts +81 -6
- package/src/sdk/broker/doctor-restart.ts +4 -0
- package/src/sdk/broker/ensure.ts +31 -2
- package/src/sdk/broker/lifecycle.ts +711 -66
- package/src/sdk/broker/session-index.ts +191 -81
- package/src/sdk/bus/chat-daemon-cli.ts +38 -1
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +238 -43
- package/src/sdk/bus/telegram-daemon-contract.ts +6 -1
- package/src/sdk/cli/session-cli.ts +17 -3
- package/src/sdk/client/client.ts +28 -8
- package/src/sdk/host/query/handlers.ts +9 -1
- package/src/sdk/host/session-runtime.test.ts +2705 -303
- package/src/sdk/host/session-runtime.ts +490 -143
- package/src/sdk/host/surface-policy.ts +1 -0
- package/src/sdk/index.ts +8 -0
- package/src/sdk/lifecycle-session.ts +3 -1
- package/src/sdk/prompt-deadline-manager.ts +15 -0
- package/src/sdk/protocol/operation-inventory.generated.json +146 -0
- package/src/sdk/protocol/operation-registry.ts +9 -2
- package/src/sdk/router/session-router.ts +82 -18
- package/src/sdk/session-list.ts +1 -0
- package/src/sdk/session.ts +69 -45
- package/src/session/agent-session.ts +679 -238
- package/src/session/artifacts.ts +176 -71
- package/src/session/internal/managed-gc-retirement-codec.ts +319 -0
- package/src/session/internal/managed-session-scope.ts +3779 -462
- package/src/session/internal/managed-session-storage.ts +501 -78
- package/src/session/internal/managed-task-owner-cleanup.ts +473 -0
- package/src/session/internal/task-artifact-owner-access.ts +19 -3
- package/src/session/internal/task-artifact-owner-transcript.ts +547 -1
- package/src/session/session-manager.ts +951 -133
- package/src/session/session-retirement.ts +573 -14
- package/src/session/session-storage.ts +447 -15
- package/src/session/task-artifact-owner-codec.ts +71 -8
- package/src/session/task-artifact-owner-retirement.ts +21 -19
- package/src/setup/credential-auto-import.ts +12 -3
- package/src/setup/credential-import.ts +176 -5
- package/src/setup/paseo/announce.ts +6 -1
- package/src/skill-state/active-state.ts +145 -2
- package/src/skill-state/workflow-mutation-guard.ts +102 -10
- package/src/slash-commands/builtin-registry.ts +39 -9
- package/src/slash-commands/helpers/mcp.ts +8 -4
- package/src/slash-commands/helpers/progress-report.ts +23 -0
- package/src/stt/setup.ts +3 -5
- package/src/task/commands.ts +3 -1
- package/src/task/executor.ts +4 -0
- package/src/task/index.ts +6 -0
- package/src/task/isolation-dir.ts +143 -0
- package/src/task/worktree.ts +16 -7
- package/src/tools/ask.ts +205 -6
- package/src/tools/ast-edit-write-path.ts +68 -0
- package/src/tools/ast-edit.ts +10 -1
- package/src/tools/bash-allowed-prefixes.ts +15 -0
- package/src/tools/bash-skill-urls.ts +56 -3
- package/src/tools/bash.ts +48 -79
- package/src/tools/browser/cdp-url.ts +18 -0
- package/src/tools/browser.ts +8 -1
- package/src/tools/descriptors.ts +5 -1
- package/src/tools/eval.ts +56 -36
- package/src/tools/gh.ts +10 -0
- package/src/tools/github-side-effect.ts +112 -0
- package/src/tools/image-gen.ts +1 -1
- package/src/tools/index.ts +3 -0
- package/src/tools/monitor-mutation.ts +27 -0
- package/src/tools/monitor.ts +7 -0
- package/src/tools/python.ts +188 -66
- package/src/tools/recipe/index.ts +9 -0
- package/src/tools/recipe/recipe-guard.ts +19 -0
- package/src/tools/restricted-cwd.ts +10 -0
- package/src/tools/skill-discovery.ts +5 -0
- package/src/tools/skill.ts +28 -1
- package/src/tools/todo-write.ts +10 -1
- package/src/tools/tool-catalog.generated.ts +1 -1
- package/src/tools/write.ts +1 -0
- package/src/utils/external-editor.ts +3 -2
- package/src/utils/tools-checksum.ts +34 -0
- package/src/utils/tools-manager.ts +24 -6
- package/src/web/insane/url-guard.ts +2 -1
- package/src/web/search/providers/codex.ts +3 -2
|
@@ -69,6 +69,7 @@ const QUERY_BINDINGS: Readonly<Record<string, string | undefined>> = {
|
|
|
69
69
|
"config.list/get": "getConfigItems",
|
|
70
70
|
"session.branch_candidates": "getBranchCandidates",
|
|
71
71
|
"extensions.list": "getExtensions",
|
|
72
|
+
"session.progress": "getProjectProgress",
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
export interface SdkSurfacePolicy {
|
package/src/sdk/index.ts
CHANGED
|
@@ -9,6 +9,14 @@ export {
|
|
|
9
9
|
type UnknownModelProfileDetails,
|
|
10
10
|
UnknownModelProfileError,
|
|
11
11
|
} from "../config/model-profile-contract";
|
|
12
|
+
export {
|
|
13
|
+
PROJECT_PROGRESS_SNAPSHOT_SCHEMA,
|
|
14
|
+
type ProgressSnapshotAttention,
|
|
15
|
+
type ProgressSnapshotStory,
|
|
16
|
+
type ProgressSnapshotTodo,
|
|
17
|
+
type ProgressSnapshotWorkflow,
|
|
18
|
+
type ProjectProgressSnapshot,
|
|
19
|
+
} from "../progress/progress-contract";
|
|
12
20
|
export type {
|
|
13
21
|
QueuedInputAdmission,
|
|
14
22
|
QueuedInputDelivery,
|
|
@@ -117,7 +117,9 @@ export async function createLifecycleAgentSession(
|
|
|
117
117
|
// Explicit model pin (#4707): resolve through the staged selector
|
|
118
118
|
// resolver after extension providers register (modelPattern), so the
|
|
119
119
|
// pin matches CLI `--model` semantics instead of bypassing them.
|
|
120
|
-
|
|
120
|
+
// Defer startup profile activation so pin validation happens first,
|
|
121
|
+
// before the default profile could be activated in place of the pin.
|
|
122
|
+
...(modelId !== undefined ? { modelPattern: modelId, deferModelProfileActivation: true } : {}),
|
|
121
123
|
// Memory startup (rollout summarisation) issues one LLM request per
|
|
122
124
|
// claimed rollout, so its duration scales with the backlog. Keeping it
|
|
123
125
|
// inside the broker's readiness window is what kills the child at the
|
|
@@ -347,6 +347,21 @@ export class PromptDeadlineManager {
|
|
|
347
347
|
} catch {
|
|
348
348
|
// claim may fail if already claimed (e.g., cancellation won); ignore.
|
|
349
349
|
}
|
|
350
|
+
// The claim and the first lookup are separated by an await. A real
|
|
351
|
+
// agent_end can therefore commit terminal_ok while the deadline path is
|
|
352
|
+
// still preparing its synthetic failure. Re-read the durable state before
|
|
353
|
+
// invoking terminalization so a completed turn cannot be reported later as
|
|
354
|
+
// prompt_deadline_exceeded.
|
|
355
|
+
try {
|
|
356
|
+
const settled = this.#reconciliation.lookup("prompt", correlation) as { status: string };
|
|
357
|
+
if (settled.status === "terminal_ok" || settled.status === "failed") {
|
|
358
|
+
this.clear(correlation);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
} catch {
|
|
362
|
+
// Keep the existing uncertainty recovery path below when the durable
|
|
363
|
+
// read is unavailable.
|
|
364
|
+
}
|
|
350
365
|
// A real terminal may win between lookup and this claim. A diagnostic-only
|
|
351
366
|
// failure is not terminal evidence; preserve it privately until the host hook
|
|
352
367
|
// proves the exact run/tool settlement and captures its correlated agent_end.
|
|
@@ -1673,6 +1673,24 @@
|
|
|
1673
1673
|
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
1674
1674
|
]
|
|
1675
1675
|
},
|
|
1676
|
+
{
|
|
1677
|
+
"sourceId": "registry:Q32",
|
|
1678
|
+
"sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
|
|
1679
|
+
"sourceKind": "registry",
|
|
1680
|
+
"decision": "include",
|
|
1681
|
+
"sdkId": "session.progress",
|
|
1682
|
+
"adapterMappings": {
|
|
1683
|
+
"telegram": "prohibited",
|
|
1684
|
+
"discord": "prohibited",
|
|
1685
|
+
"slack": "prohibited",
|
|
1686
|
+
"mcp": "generic_safe",
|
|
1687
|
+
"acp": "generic_safe",
|
|
1688
|
+
"daemonCli": "generic_safe"
|
|
1689
|
+
},
|
|
1690
|
+
"testIds": [
|
|
1691
|
+
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
1692
|
+
]
|
|
1693
|
+
},
|
|
1676
1694
|
{
|
|
1677
1695
|
"sourceId": "registry:R01",
|
|
1678
1696
|
"sourceFile": "packages/coding-agent/src/sdk/protocol/operation-registry.ts",
|
|
@@ -2053,6 +2071,24 @@
|
|
|
2053
2071
|
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
2054
2072
|
]
|
|
2055
2073
|
},
|
|
2074
|
+
{
|
|
2075
|
+
"sourceId": "slash_command:progress",
|
|
2076
|
+
"sourceFile": "packages/coding-agent/src/slash-commands/builtin-registry.ts",
|
|
2077
|
+
"sourceKind": "slash_command",
|
|
2078
|
+
"decision": "include",
|
|
2079
|
+
"sdkId": "session.progress",
|
|
2080
|
+
"adapterMappings": {
|
|
2081
|
+
"telegram": "prohibited",
|
|
2082
|
+
"discord": "prohibited",
|
|
2083
|
+
"slack": "prohibited",
|
|
2084
|
+
"mcp": "generic_safe",
|
|
2085
|
+
"acp": "generic_safe",
|
|
2086
|
+
"daemonCli": "generic_safe"
|
|
2087
|
+
},
|
|
2088
|
+
"testIds": [
|
|
2089
|
+
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
2090
|
+
]
|
|
2091
|
+
},
|
|
2056
2092
|
{
|
|
2057
2093
|
"sourceId": "slash_command:usage",
|
|
2058
2094
|
"sourceFile": "packages/coding-agent/src/slash-commands/builtin-registry.ts",
|
|
@@ -2844,6 +2880,17 @@
|
|
|
2844
2880
|
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
2845
2881
|
]
|
|
2846
2882
|
},
|
|
2883
|
+
{
|
|
2884
|
+
"sourceId": "agent_session:getSubagentLifecycleStatuses",
|
|
2885
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
2886
|
+
"sourceKind": "agent_session",
|
|
2887
|
+
"decision": "exclude",
|
|
2888
|
+
"rationale": "internal read-only subagent status projection consumed through session.progress (Q32), not a separate SDK seam",
|
|
2889
|
+
"exclusionMetadata": {
|
|
2890
|
+
"adapterMappings": "not_applicable",
|
|
2891
|
+
"testIds": "not_applicable"
|
|
2892
|
+
}
|
|
2893
|
+
},
|
|
2847
2894
|
{
|
|
2848
2895
|
"sourceId": "agent_session:emitNotice",
|
|
2849
2896
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -3844,6 +3891,28 @@
|
|
|
3844
3891
|
"packages/coding-agent/test/sdk-operation-inventory.test.ts"
|
|
3845
3892
|
]
|
|
3846
3893
|
},
|
|
3894
|
+
{
|
|
3895
|
+
"sourceId": "agent_session:resolvePromptSkillInvocation",
|
|
3896
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
3897
|
+
"sourceKind": "agent_session",
|
|
3898
|
+
"decision": "exclude",
|
|
3899
|
+
"rationale": "internal prompt-dispatch classifier shared with interactive title seeding, not a user-facing control seam",
|
|
3900
|
+
"exclusionMetadata": {
|
|
3901
|
+
"adapterMappings": "not_applicable",
|
|
3902
|
+
"testIds": "not_applicable"
|
|
3903
|
+
}
|
|
3904
|
+
},
|
|
3905
|
+
{
|
|
3906
|
+
"sourceId": "agent_session:isLocallyHandledSlashCommand",
|
|
3907
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
3908
|
+
"sourceKind": "agent_session",
|
|
3909
|
+
"decision": "exclude",
|
|
3910
|
+
"rationale": "internal slash-command classifier that keeps command text out of title seeding, not a user-facing control seam",
|
|
3911
|
+
"exclusionMetadata": {
|
|
3912
|
+
"adapterMappings": "not_applicable",
|
|
3913
|
+
"testIds": "not_applicable"
|
|
3914
|
+
}
|
|
3915
|
+
},
|
|
3847
3916
|
{
|
|
3848
3917
|
"sourceId": "agent_session:promptCustomMessage",
|
|
3849
3918
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -4277,6 +4346,28 @@
|
|
|
4277
4346
|
"testIds": "not_applicable"
|
|
4278
4347
|
}
|
|
4279
4348
|
},
|
|
4349
|
+
{
|
|
4350
|
+
"sourceId": "agent_session:getTerminalRunOwnerForEvent",
|
|
4351
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4352
|
+
"sourceKind": "agent_session",
|
|
4353
|
+
"decision": "exclude",
|
|
4354
|
+
"rationale": "internal Agent-claimed event ownership proof, read only through the terminalAbortSeams bus capability; not a public SDK operation",
|
|
4355
|
+
"exclusionMetadata": {
|
|
4356
|
+
"adapterMappings": "not_applicable",
|
|
4357
|
+
"testIds": "not_applicable"
|
|
4358
|
+
}
|
|
4359
|
+
},
|
|
4360
|
+
{
|
|
4361
|
+
"sourceId": "agent_session:getRunOwnerDomain",
|
|
4362
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4363
|
+
"sourceKind": "agent_session",
|
|
4364
|
+
"decision": "exclude",
|
|
4365
|
+
"rationale": "internal run-resource ledger domain lookup for exact consuming-run ownership; not a public SDK operation",
|
|
4366
|
+
"exclusionMetadata": {
|
|
4367
|
+
"adapterMappings": "not_applicable",
|
|
4368
|
+
"testIds": "not_applicable"
|
|
4369
|
+
}
|
|
4370
|
+
},
|
|
4280
4371
|
{
|
|
4281
4372
|
"sourceId": "agent_session:pendingToolExecutions",
|
|
4282
4373
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -4422,6 +4513,61 @@
|
|
|
4422
4513
|
"testIds": "not_applicable"
|
|
4423
4514
|
}
|
|
4424
4515
|
},
|
|
4516
|
+
{
|
|
4517
|
+
"sourceId": "agent_session:setUnavailableModelProfile",
|
|
4518
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4519
|
+
"sourceKind": "agent_session",
|
|
4520
|
+
"decision": "exclude",
|
|
4521
|
+
"rationale": "internal session-scoped unavailable profile tracking; mutated by the session lifecycle on model-load failure, not a public SDK control seam",
|
|
4522
|
+
"exclusionMetadata": {
|
|
4523
|
+
"adapterMappings": "not_applicable",
|
|
4524
|
+
"testIds": "not_applicable"
|
|
4525
|
+
}
|
|
4526
|
+
},
|
|
4527
|
+
{
|
|
4528
|
+
"sourceId": "agent_session:getUnavailableModelProfile",
|
|
4529
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4530
|
+
"sourceKind": "agent_session",
|
|
4531
|
+
"decision": "exclude",
|
|
4532
|
+
"rationale": "internal session-scoped unavailable profile query for UI status rendering; not a public SDK operation",
|
|
4533
|
+
"exclusionMetadata": {
|
|
4534
|
+
"adapterMappings": "not_applicable",
|
|
4535
|
+
"testIds": "not_applicable"
|
|
4536
|
+
}
|
|
4537
|
+
},
|
|
4538
|
+
{
|
|
4539
|
+
"sourceId": "agent_session:getUserModelSelectionRevision",
|
|
4540
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4541
|
+
"sourceKind": "agent_session",
|
|
4542
|
+
"decision": "exclude",
|
|
4543
|
+
"rationale": "internal session-scoped model selection revision tracking behind the reviewed model.set seam, not an independent public SDK operation",
|
|
4544
|
+
"exclusionMetadata": {
|
|
4545
|
+
"adapterMappings": "not_applicable",
|
|
4546
|
+
"testIds": "not_applicable"
|
|
4547
|
+
}
|
|
4548
|
+
},
|
|
4549
|
+
{
|
|
4550
|
+
"sourceId": "agent_session:getUserCanonicalVariantSelection",
|
|
4551
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4552
|
+
"sourceKind": "agent_session",
|
|
4553
|
+
"decision": "exclude",
|
|
4554
|
+
"rationale": "internal session-scoped model variant selection state behind the reviewed model.set seam, not an independent public SDK operation",
|
|
4555
|
+
"exclusionMetadata": {
|
|
4556
|
+
"adapterMappings": "not_applicable",
|
|
4557
|
+
"testIds": "not_applicable"
|
|
4558
|
+
}
|
|
4559
|
+
},
|
|
4560
|
+
{
|
|
4561
|
+
"sourceId": "agent_session:markUserModelSelection",
|
|
4562
|
+
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
4563
|
+
"sourceKind": "agent_session",
|
|
4564
|
+
"decision": "exclude",
|
|
4565
|
+
"rationale": "internal session-scoped model selection revision marker behind the reviewed model.set seam, not an independent public SDK operation",
|
|
4566
|
+
"exclusionMetadata": {
|
|
4567
|
+
"adapterMappings": "not_applicable",
|
|
4568
|
+
"testIds": "not_applicable"
|
|
4569
|
+
}
|
|
4570
|
+
},
|
|
4425
4571
|
{
|
|
4426
4572
|
"sourceId": "agent_session:syncEagerDelegation",
|
|
4427
4573
|
"sourceFile": "packages/coding-agent/src/session/agent-session.ts",
|
|
@@ -174,6 +174,10 @@ const queries = [
|
|
|
174
174
|
["providers.list/active", "List active providers."],
|
|
175
175
|
["session.checkpoint", "Resolve a durable transcript checkpoint into a connection-owned replay cursor."],
|
|
176
176
|
["turn.steer_status", "Read the durable acknowledgement status of a correlated steer by clientRef."],
|
|
177
|
+
[
|
|
178
|
+
"session.progress",
|
|
179
|
+
"Read the read-only project progress snapshot (gjc.project_progress.v1) derived from durable session state.",
|
|
180
|
+
],
|
|
177
181
|
] as const;
|
|
178
182
|
|
|
179
183
|
// Q28 was folded into Q26; preserve the independent Q29/Q30 query identities.
|
|
@@ -208,6 +212,7 @@ const queryIds = [
|
|
|
208
212
|
"Q29",
|
|
209
213
|
"Q30",
|
|
210
214
|
"Q31",
|
|
215
|
+
"Q32",
|
|
211
216
|
] as const;
|
|
212
217
|
|
|
213
218
|
function queryId(index: number): string {
|
|
@@ -311,7 +316,7 @@ function queryContinuityClass(id: string): QueryContinuityClass {
|
|
|
311
316
|
}
|
|
312
317
|
|
|
313
318
|
function queryDisposition(id: string): Record<Adapter, AdapterDisposition> {
|
|
314
|
-
if (["Q23", "Q24", "Q25", "Q26", "Q27", "Q29", "Q30", "Q31"].includes(id))
|
|
319
|
+
if (["Q23", "Q24", "Q25", "Q26", "Q27", "Q29", "Q30", "Q31", "Q32"].includes(id))
|
|
315
320
|
return dispositions({ telegram: "prohibited", discord: "prohibited", slack: "prohibited" });
|
|
316
321
|
return dispositions();
|
|
317
322
|
}
|
|
@@ -398,7 +403,9 @@ export const OPERATIONS: readonly Operation[] = [
|
|
|
398
403
|
? ["invalid_request", "resource_gone", "internal"]
|
|
399
404
|
: id === "Q27"
|
|
400
405
|
? ["invalid_request", "resource_gone", "model_profile_registry_error"]
|
|
401
|
-
:
|
|
406
|
+
: id === "Q32"
|
|
407
|
+
? ["invalid_request", "resource_gone", "unavailable"]
|
|
408
|
+
: ["invalid_request", "resource_gone"],
|
|
402
409
|
continuityClass: queryContinuityClass(id),
|
|
403
410
|
...(queryAliases[id] === undefined ? {} : { aliases: queryAliases[id] }),
|
|
404
411
|
adapterDispositions: queryDisposition(id),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as crypto from "node:crypto";
|
|
2
2
|
import * as fs from "node:fs/promises";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import { logger,
|
|
4
|
+
import { logger, pathIdentityKey } from "@gajae-code/utils";
|
|
5
5
|
import { endpointIncarnation, matchesIndexedEndpointFile } from "../broker/endpoint-authority";
|
|
6
6
|
import {
|
|
7
7
|
canonicalSessionCwd,
|
|
@@ -203,6 +203,7 @@ export interface SessionRouterClient {
|
|
|
203
203
|
frame: Record<string, unknown>,
|
|
204
204
|
options?: {
|
|
205
205
|
timeoutMs?: number;
|
|
206
|
+
deadline?: number;
|
|
206
207
|
connectedOnly?: boolean;
|
|
207
208
|
/** Synchronous pre-send observer; a throw aborts the dispatch before the wire. */
|
|
208
209
|
beforeDispatch?: (context: SdkDispatchContext) => void;
|
|
@@ -853,7 +854,7 @@ export class SessionRouter {
|
|
|
853
854
|
const capability = current?.capability;
|
|
854
855
|
if (!attached || !current || !capability)
|
|
855
856
|
throw new SessionRouterError("pre_send", "Broker session endpoint could not be attached.");
|
|
856
|
-
const listing = this.#index.listSessions();
|
|
857
|
+
const listing = this.#index.listSessions(undefined, new Set([sessionId]));
|
|
857
858
|
const indexedCurrent = listing.warnings.some(warning => warningAffectsSession(warning, sessionId))
|
|
858
859
|
? undefined
|
|
859
860
|
: listing.sessions.find(item => item.sessionId === sessionId);
|
|
@@ -954,18 +955,47 @@ export class SessionRouter {
|
|
|
954
955
|
expectedAttachment?: SessionAttachment,
|
|
955
956
|
options?: {
|
|
956
957
|
timeoutMs?: number;
|
|
958
|
+
deadline?: number;
|
|
957
959
|
beforeDispatch?: (context: SdkDispatchContext) => void;
|
|
958
960
|
onDispatch?: SdkDispatchHandler;
|
|
959
961
|
dispatchFence?: (dispatch: () => Promise<Record<string, unknown>>) => Promise<Record<string, unknown>>;
|
|
960
962
|
},
|
|
961
963
|
): Promise<Record<string, unknown>> {
|
|
964
|
+
const { deadline, beforeDispatch, onDispatch, dispatchFence, ...requestOptions } = options ?? {};
|
|
965
|
+
const remainingDeadlineMs = (): number =>
|
|
966
|
+
deadline === undefined ? Number.POSITIVE_INFINITY : Math.max(0, deadline - Date.now());
|
|
967
|
+
const reconcileWithinDeadline = async (): Promise<void> => {
|
|
968
|
+
if (deadline === undefined) {
|
|
969
|
+
await this.#serialReconcile(this.#runEpoch, true, true);
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
const remaining = remainingDeadlineMs();
|
|
973
|
+
if (remaining <= 0)
|
|
974
|
+
throw new SessionRouterError("pre_send", "SDK session request deadline elapsed during router preparation.");
|
|
975
|
+
const reconciliation = this.#serialReconcile(this.#runEpoch, true, true);
|
|
976
|
+
const expired = Promise.withResolvers<never>();
|
|
977
|
+
const timer = setTimeout(
|
|
978
|
+
() =>
|
|
979
|
+
expired.reject(
|
|
980
|
+
new SessionRouterError("pre_send", "SDK session request deadline elapsed during router preparation."),
|
|
981
|
+
),
|
|
982
|
+
remaining,
|
|
983
|
+
);
|
|
984
|
+
try {
|
|
985
|
+
await Promise.race([reconciliation, expired.promise]);
|
|
986
|
+
} finally {
|
|
987
|
+
clearTimeout(timer);
|
|
988
|
+
}
|
|
989
|
+
};
|
|
962
990
|
const matchesExpectedAuthority = (attachment: SessionAttachment): boolean =>
|
|
963
991
|
expectedAttachment === undefined ||
|
|
964
992
|
attachment === expectedAttachment ||
|
|
965
993
|
(expectedAttachment.authorityId !== undefined && attachment.authorityId === expectedAttachment.authorityId);
|
|
966
994
|
const publishing = this.#sessions.get(sessionId);
|
|
967
995
|
if (!publishing || !matchesExpectedAuthority(publishing.capability) || !publishing.initializingPublication)
|
|
968
|
-
await
|
|
996
|
+
await reconcileWithinDeadline();
|
|
997
|
+
if (remainingDeadlineMs() <= 0)
|
|
998
|
+
throw new SessionRouterError("pre_send", "SDK session request deadline elapsed during router preparation.");
|
|
969
999
|
const attached = this.#sessions.get(sessionId);
|
|
970
1000
|
if (!attached || !this.#attachmentPublished(attached))
|
|
971
1001
|
throw new SessionRouterError("pre_send", "SDK session attachment is unavailable: session not published.");
|
|
@@ -994,20 +1024,44 @@ export class SessionRouter {
|
|
|
994
1024
|
// token: the wire frame alone carries credentials, and the observer
|
|
995
1025
|
// context is a deep-frozen, token-redacted copy (#4640 review).
|
|
996
1026
|
const wireFrame = this.#prepareFrame(attached, frame);
|
|
997
|
-
|
|
1027
|
+
if (remainingDeadlineMs() <= 0) throw new SessionRouterError("pre_send", "SDK session request deadline elapsed.");
|
|
998
1028
|
try {
|
|
999
|
-
|
|
1029
|
+
const connecting = attached.client.connect?.();
|
|
1030
|
+
if (connecting) {
|
|
1031
|
+
if (deadline === undefined) await connecting;
|
|
1032
|
+
else {
|
|
1033
|
+
const expired = Promise.withResolvers<never>();
|
|
1034
|
+
const timer = setTimeout(
|
|
1035
|
+
() =>
|
|
1036
|
+
expired.reject(
|
|
1037
|
+
new SessionRouterError(
|
|
1038
|
+
"pre_send",
|
|
1039
|
+
"SDK session request deadline elapsed during transport preparation.",
|
|
1040
|
+
),
|
|
1041
|
+
),
|
|
1042
|
+
remainingDeadlineMs(),
|
|
1043
|
+
);
|
|
1044
|
+
try {
|
|
1045
|
+
await Promise.race([connecting, expired.promise]);
|
|
1046
|
+
} finally {
|
|
1047
|
+
clearTimeout(timer);
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1000
1051
|
} catch (error) {
|
|
1001
1052
|
if (error instanceof SdkClientError) throw new SdkPreparedDispatchError(error);
|
|
1002
1053
|
throw error;
|
|
1003
1054
|
}
|
|
1004
1055
|
if (!this.#attachmentPublished(attached))
|
|
1005
1056
|
throw new SessionRouterError("pre_send", "SDK session attachment changed during transport preparation.");
|
|
1006
|
-
const dispatch = () =>
|
|
1007
|
-
|
|
1057
|
+
const dispatch = () => {
|
|
1058
|
+
const dispatchRemaining = remainingDeadlineMs();
|
|
1059
|
+
if (dispatchRemaining <= 0)
|
|
1060
|
+
throw new SessionRouterError("pre_send", "SDK session request deadline elapsed before dispatch.");
|
|
1061
|
+
return attached.client.request(wireFrame, {
|
|
1008
1062
|
...requestOptions,
|
|
1009
1063
|
connectedOnly: true,
|
|
1010
|
-
timeoutMs: requestOptions.timeoutMs ?? SESSION_REQUEST_TIMEOUT_MS,
|
|
1064
|
+
timeoutMs: Math.min(requestOptions.timeoutMs ?? SESSION_REQUEST_TIMEOUT_MS, dispatchRemaining),
|
|
1011
1065
|
...(beforeDispatch
|
|
1012
1066
|
? {
|
|
1013
1067
|
beforeDispatch: (context: SdkDispatchContext) =>
|
|
@@ -1021,7 +1075,16 @@ export class SessionRouter {
|
|
|
1021
1075
|
}
|
|
1022
1076
|
: {}),
|
|
1023
1077
|
});
|
|
1078
|
+
};
|
|
1024
1079
|
const response = await (dispatchFence ? dispatchFence(dispatch) : dispatch());
|
|
1080
|
+
// A late acknowledgement cannot activate a provider after the caller's budget.
|
|
1081
|
+
// Keep the sent identity for reconciliation: expiry does not undo registration.
|
|
1082
|
+
if (remainingDeadlineMs() <= 0)
|
|
1083
|
+
throw new SdkClientError("uncertain_after_send", "SDK session request deadline elapsed after dispatch.", {
|
|
1084
|
+
id: wireFrame.id,
|
|
1085
|
+
operation: wireFrame.operation ?? wireFrame.type,
|
|
1086
|
+
idempotencyKey: wireFrame.idempotencyKey,
|
|
1087
|
+
});
|
|
1025
1088
|
const settled = this.#sessions.get(sessionId);
|
|
1026
1089
|
if (
|
|
1027
1090
|
!settled ||
|
|
@@ -1040,7 +1103,7 @@ export class SessionRouter {
|
|
|
1040
1103
|
let indexed: IndexedSession | undefined;
|
|
1041
1104
|
try {
|
|
1042
1105
|
await this.#index.refresh();
|
|
1043
|
-
const listing = this.#index.listSessions();
|
|
1106
|
+
const listing = this.#index.listSessions(undefined, new Set([sessionId]));
|
|
1044
1107
|
if (listing.warnings.some(warning => warningAffectsSession(warning, sessionId))) return undefined;
|
|
1045
1108
|
indexed = listing.sessions.find(candidate => candidate.sessionId === sessionId);
|
|
1046
1109
|
} catch {
|
|
@@ -1114,7 +1177,7 @@ export class SessionRouter {
|
|
|
1114
1177
|
try {
|
|
1115
1178
|
await this.#index.open();
|
|
1116
1179
|
await this.#index.refresh();
|
|
1117
|
-
const listing = this.#index.listSessions();
|
|
1180
|
+
const listing = this.#index.listSessions(undefined, new Set([sessionId]));
|
|
1118
1181
|
if (listing.warnings.some(warning => warningAffectsSession(warning, sessionId)))
|
|
1119
1182
|
throw new SessionActivationError(
|
|
1120
1183
|
"session_not_live",
|
|
@@ -1305,7 +1368,7 @@ export class SessionRouter {
|
|
|
1305
1368
|
for (const attached of this.#sessions.values()) this.#reviveTransport(attached);
|
|
1306
1369
|
return;
|
|
1307
1370
|
}
|
|
1308
|
-
const indexed = this.#index.listSessions();
|
|
1371
|
+
const indexed = this.#index.listSessions(undefined, this.#sessionIds);
|
|
1309
1372
|
const live = indexed.sessions.filter(
|
|
1310
1373
|
session =>
|
|
1311
1374
|
!indexed.warnings.some(warning => warningAffectsSession(warning, session.sessionId)) &&
|
|
@@ -1469,13 +1532,14 @@ export class SessionRouter {
|
|
|
1469
1532
|
const cwd = indexed.locator.cwd;
|
|
1470
1533
|
const defaultStateRoot = path.join(cwd, ".gjc", "state");
|
|
1471
1534
|
// Locator cwd is already canonical. `stateRoot` remains the host-provided
|
|
1472
|
-
// authority path, so
|
|
1473
|
-
//
|
|
1474
|
-
|
|
1535
|
+
// authority path, so compare filesystem identity here: case-insensitive
|
|
1536
|
+
// Windows aliases match without rewriting I/O paths, while case-sensitive
|
|
1537
|
+
// directories remain distinct.
|
|
1538
|
+
const indexedStateRoot = pathIdentityKey(indexed.locator.stateRoot);
|
|
1475
1539
|
const scope =
|
|
1476
|
-
indexedStateRoot ===
|
|
1540
|
+
indexedStateRoot === pathIdentityKey(defaultStateRoot)
|
|
1477
1541
|
? "default"
|
|
1478
|
-
: indexedStateRoot ===
|
|
1542
|
+
: indexedStateRoot === pathIdentityKey(path.join(defaultStateRoot, "chat"))
|
|
1479
1543
|
? "chat"
|
|
1480
1544
|
: undefined;
|
|
1481
1545
|
if (!scope || indexed.endpointMtimeMs === undefined || !Number.isFinite(indexed.endpointMtimeMs)) return null;
|
|
@@ -1513,7 +1577,7 @@ export class SessionRouter {
|
|
|
1513
1577
|
)
|
|
1514
1578
|
return null;
|
|
1515
1579
|
await this.#index.refresh();
|
|
1516
|
-
const listing = this.#index.listSessions();
|
|
1580
|
+
const listing = this.#index.listSessions(undefined, new Set([indexed.sessionId]));
|
|
1517
1581
|
if (listing.warnings.some(warning => warningAffectsSession(warning, indexed.sessionId))) return null;
|
|
1518
1582
|
const current = listing.sessions.find(session => session.sessionId === indexed.sessionId);
|
|
1519
1583
|
if (!current || !sameIndexedAuthority(indexed, current)) return null;
|
|
@@ -2204,7 +2268,7 @@ export class SessionRouter {
|
|
|
2204
2268
|
try {
|
|
2205
2269
|
await this.#index.refresh();
|
|
2206
2270
|
const current = this.#index
|
|
2207
|
-
.listSessions()
|
|
2271
|
+
.listSessions(undefined, new Set([attached.sessionId]))
|
|
2208
2272
|
.sessions.find(session => session.sessionId === attached.sessionId);
|
|
2209
2273
|
if (
|
|
2210
2274
|
current?.live &&
|
package/src/sdk/session-list.ts
CHANGED