@gajae-code/coding-agent 0.18.1 → 0.18.6
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 +161 -0
- package/dist/types/cli/stats-cli.d.ts +0 -5
- package/dist/types/cli-commands.d.ts +10 -0
- package/dist/types/cli-ordinary.d.ts +13 -0
- package/dist/types/cli.d.ts +12 -3
- package/dist/types/commands/contribution-prep.d.ts +0 -3
- package/dist/types/commands/sdk.d.ts +3 -0
- package/dist/types/commands/update.d.ts +1 -0
- package/dist/types/config/autorouting-tier-map.d.ts +29 -2
- package/dist/types/config/model-profile-activation.d.ts +19 -0
- package/dist/types/config/model-registry.d.ts +16 -1
- package/dist/types/coordinator-mcp/session-reaper.d.ts +5 -0
- package/dist/types/edit/modes/replace.d.ts +3 -3
- package/dist/types/edit/streaming.d.ts +2 -2
- package/dist/types/exa/mcp-client.d.ts +1 -5
- package/dist/types/exec/bash-shell-guardian.d.ts +26 -0
- package/dist/types/exec/bash-shell-supervisor.d.ts +12 -0
- package/dist/types/hashline/parser.d.ts +28 -5
- package/dist/types/modes/acp/acp-agent.d.ts +6 -1
- package/dist/types/sdk/broker/discovery.d.ts +8 -0
- package/dist/types/sdk/broker/ensure.d.ts +1 -0
- package/dist/types/sdk/broker/lifecycle-ledger.d.ts +4 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +6 -1
- package/dist/types/sdk/broker/recovery-backoff.d.ts +62 -0
- package/dist/types/sdk/broker/runtime.d.ts +21 -1
- package/dist/types/sdk/broker/startup-budget.d.ts +5 -1
- package/dist/types/sdk/bus/index.d.ts +1 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +1 -0
- package/dist/types/sdk/cli/diagnostics-cli.d.ts +18 -0
- package/dist/types/sdk/diagnostics/observe-broker.d.ts +185 -0
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/session-runtime.d.ts +7 -0
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/prompt-watchdog.d.ts +1 -1
- package/dist/types/sdk/router/session-router.d.ts +2 -0
- package/dist/types/sdk/session.d.ts +13 -0
- package/dist/types/session/agent-session.d.ts +5 -1
- package/dist/types/tools/ask-contract.d.ts +75 -254
- package/dist/types/tools/bash.d.ts +1 -0
- package/package.json +7 -7
- package/scripts/build-sdk-package-smoke.ts +5 -0
- package/src/cli/public-command-entry.ts +5 -0
- package/src/cli/ssh-cli.ts +6 -3
- package/src/cli/stats-cli.ts +4 -36
- package/src/cli/web-search-cli.ts +9 -3
- package/src/cli-commands.ts +14 -0
- package/src/cli-main.ts +4 -8
- package/src/cli-ordinary.ts +197 -0
- package/src/cli.ts +25 -186
- package/src/commands/commit.ts +2 -2
- package/src/commands/contribution-prep.ts +1 -3
- package/src/commands/sdk.ts +60 -2
- package/src/commands/update.ts +15 -1
- package/src/config/autorouting-tier-map.ts +20 -2
- package/src/config/file-lock.ts +91 -2
- package/src/config/model-preset-registry.ts +17 -2
- package/src/config/model-profile-activation.ts +73 -5
- package/src/config/model-profile-contract.ts +4 -1
- package/src/config/model-profiles.ts +29 -29
- package/src/config/model-registry.ts +45 -17
- package/src/config/model-resolver.ts +9 -1
- package/src/coordinator-mcp/event-webhook.ts +19 -14
- package/src/coordinator-mcp/policy.ts +14 -4
- package/src/coordinator-mcp/server.ts +142 -7
- package/src/coordinator-mcp/session-reaper.ts +9 -1
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
- package/src/edit/modes/replace.ts +6 -6
- package/src/edit/streaming.ts +15 -15
- package/src/exa/mcp-client.ts +41 -8
- package/src/exec/bash-shell-guardian.ts +184 -34
- package/src/exec/bash-shell-supervisor.ts +60 -3
- package/src/hashline/execute.ts +51 -3
- package/src/hashline/parser.ts +63 -16
- package/src/internal-urls/docs-index.generated.ts +29 -28
- package/src/memories/index.ts +8 -2
- package/src/modes/acp/acp-agent.ts +688 -371
- package/src/modes/components/tool-execution.ts +1 -1
- package/src/modes/controllers/ssh-command-controller.ts +3 -1
- package/src/prompts/tools/ask.md +2 -0
- package/src/sdk/broker/broker.ts +46 -0
- package/src/sdk/broker/daemon-entry.ts +67 -6
- package/src/sdk/broker/discovery.ts +8 -0
- package/src/sdk/broker/ensure.ts +156 -20
- package/src/sdk/broker/lifecycle-ledger.ts +110 -12
- package/src/sdk/broker/lifecycle.ts +108 -34
- package/src/sdk/broker/recovery-backoff.ts +135 -0
- package/src/sdk/broker/runtime.ts +88 -1
- package/src/sdk/broker/startup-budget.ts +6 -1
- package/src/sdk/broker/transport.ts +5 -1
- package/src/sdk/bus/chat-daemon-control.ts +2 -2
- package/src/sdk/bus/index.ts +305 -19
- package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
- package/src/sdk/bus/telegram-daemon-control.ts +15 -12
- package/src/sdk/bus/telegram-daemon.ts +34 -1
- package/src/sdk/cli/diagnostics-cli.ts +247 -0
- package/src/sdk/diagnostics/observe-broker.ts +654 -0
- package/src/sdk/host/control/dispatch.ts +52 -4
- package/src/sdk/host/control/operations.ts +1 -1
- package/src/sdk/host/session-runtime.test.ts +40 -2
- package/src/sdk/host/session-runtime.ts +112 -8
- package/src/sdk/index.ts +1 -0
- package/src/sdk/lifecycle-session.ts +1 -0
- package/src/sdk/prompt-watchdog.ts +17 -4
- package/src/sdk/protocol/operation-registry.ts +1 -1
- package/src/sdk/router/session-router.ts +7 -1
- package/src/sdk/session.ts +37 -8
- package/src/session/agent-session.ts +128 -41
- package/src/session/blob-store.ts +78 -33
- package/src/session/internal/managed-session-storage.ts +119 -3
- package/src/setup/hermes/templates/operator-instructions.v1.md +19 -1
- package/src/setup/hermes-setup.ts +4 -1
- package/src/slash-commands/builtin-registry.ts +8 -5
- package/src/tools/ask-contract.test.ts +76 -1
- package/src/tools/ask-contract.ts +57 -6
- package/src/tools/ask.ts +16 -7
- package/src/tools/bash.ts +77 -29
- package/src/tools/descriptors.test.ts +29 -0
- package/src/tools/tool-catalog.generated.ts +7 -4
- package/src/web/search/index.ts +2 -2
- package/dist/types/cli/grep-cli.d.ts +0 -17
- package/dist/types/cli/shell-cli.d.ts +0 -8
- package/dist/types/commands/grep.d.ts +0 -42
- package/dist/types/commands/shell.d.ts +0 -21
- package/src/cli/grep-cli.ts +0 -160
- package/src/cli/shell-cli.ts +0 -176
- package/src/commands/grep.ts +0 -48
- package/src/commands/shell.ts +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,167 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.18.6] - 2026-10-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Explicit correlated active-turn steering through coordinator send_prompt, with operator guidance separating requested evidence, queued tasks, and verified consumption. Retargeting feedback to a new active turn requires a new idempotency key; admission still does not prove consumption.
|
|
10
|
+
|
|
11
|
+
- `gjc sdk diagnostics broker` and the exported `observeExistingBroker` facade now report a real running broker: the broker publishes a startup-fixed diagnostic generation, build snapshot and protocol, and the observation reads the publication only through the approved read-only native lease, opens exactly one client connection with no reconnect attempts, and returns a frozen snapshot with no token, endpoint, path, pid or environment value. An observed result exits 0 and a typed unavailability exits 1.
|
|
12
|
+
|
|
13
|
+
- `gjc sdk diagnostics broker`: a read-only broker observation route that can never start, ensure, retire, restart or recover a broker. This entry ships the inert public entry, grammar and bounded observation document; the observation reader is wired in the accompanying fragment.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Built-in Codex profiles no longer use GPT-6 Sol or GPT-5.6 Terra. Every role that used `openai-codex/gpt-6-sol` or `openai-codex/gpt-5.6-terra` now uses `openai-codex/gpt-6.1-sol` at the same reasoning effort, so `codex-medium` and `codex-pro` are GPT-6.1 Sol in every role. Affected profiles: `codex-medium`, `codex-pro`, `astra-lite`, `astra-default`, `astra-heavy`, `opus-codex`, `codex-opencodego`, and `fable-opus-codex`. Moving Terra roles onto Sol is an intentional tier change; the catalog price of GPT-6.1 Sol is equal to or below Terra's. The `gpt-6-sol` and `gpt-5.6-terra` catalog entries are unchanged for explicit selection (#6163).
|
|
18
|
+
- `codex-eco` is now `codex-medium` with Sol lowered to `openai-codex/gpt-6-luna` at the same effort, so it uses GPT-6 Luna in every role. Its default, critic, and architect move from GPT-5.6 Terra to GPT-6 Luna (#6163).
|
|
19
|
+
- Roles that moved off GPT-5.6 Terra now compact earlier. GJC forces the Codex GPT-5.6 family to a 372K context window, while GPT-6.1 Sol and GPT-6 Luna use 272K, the window the Codex backend reports for both families (#6163).
|
|
20
|
+
- Installs that load a signed preset registry revision defining these profiles keep that registry binding (built-in, then registry, then user `models.yml`) until a registry revision carries this change (#6163).
|
|
21
|
+
|
|
22
|
+
- The `gjc` entry module is now inert on import: entry metadata moved to the pure `@gajae-code/utils/cli-metadata` leaf (re-exported from `dirs`), and the effectful bootstrap (startup timing, stderr drainer, malloc re-exec, managed-owner admission, public dispatch, registry) moved to `cli-ordinary` which loads lazily for every non-diagnostics command with unchanged ordering.
|
|
23
|
+
|
|
24
|
+
### Removed
|
|
25
|
+
|
|
26
|
+
- Removed the `codex-sol61` built-in profile added in 0.18.2. A saved or requested `codex-sol61` now resolves to `codex-pro`, which differs in two roles: critic is `openai-codex/gpt-6.1-sol:max` instead of `:xhigh`, and architect is `openai-codex/gpt-6.1-sol:xhigh` instead of `openai-codex/gpt-6-astra:xhigh`. Define a custom `codex-sol61` profile in `models.yml` to keep the previous mapping; a user-defined profile takes precedence over the alias (#6163).
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- The isolated bash shell supervisor no longer busy-spins while its shell is idle. It reaped adopted zombies by sweeping all of `/proc` every 25 ms without waiting for the previous sweep to finish, which kept each supervisor at about 160% CPU and tens of thousands of context switches per second even during `sleep`. Sweeps now run only on `SIGCHLD`, one at a time, so an idle supervisor stays near 0% CPU (#5972).
|
|
31
|
+
|
|
32
|
+
- Run compound pipeline stages concurrently to prevent pipe-buffer deadlocks.
|
|
33
|
+
- Join remaining pipeline stages when a stage wait returns an error.
|
|
34
|
+
|
|
35
|
+
- ACP `session/new` now waits for the model to settle before building the response when `modelRoles.default` is configured but no `--model` is passed. This ensures the `model` config option is always present in the response, preventing ACP clients (like Paseo) from failing with `model_not_selected` on the first prompt when the session uses a configured default model.
|
|
36
|
+
|
|
37
|
+
- Resuming a session with an unavailable pinned credential no longer aborts when the startup model profile probes that provider; credential failure is reported so the user can re-pin or select AUTO.
|
|
38
|
+
- Resuming a session with an unavailable pinned credential now honors an explicit `--api-key` or a literal `models.yml` `apiKey` when restoring the saved model, the settings default, and extension-registered models, instead of reporting the pin unavailable. An `apiKeyEnv` key does not unblock the pin, because another stored api_key account could take precedence over it; without an explicit key the provider stays blocked until the user re-pins or selects AUTO.
|
|
39
|
+
|
|
40
|
+
- Windows Telegram daemon stop and reload now wait for the owner-fenced cooperative control request before force escalation, and post-update recovery failures exit cleanly with actionable guidance instead of an uncaught exception (#6138).
|
|
41
|
+
- Added an owner-fenced control wakeup for blocked Telegram polls and extended hard-termination cooperative grace before escalation (#6138).
|
|
42
|
+
|
|
43
|
+
- A process dying between the POSIX lock-removal detach and payload scrub no longer wedges every subsequent launch with `FileLockAcquireError` ("blocked by abandoned removal transition"): the dead owner's `.lock.removing` transition is reclaimed through the identity-bound guarded removal, and a refused reclamation keeps contending and still reports the abandoned transition at exhaustion (#6253).
|
|
44
|
+
|
|
45
|
+
- Allow a fresh ACP prompt to wait for a previously failed or cancelled turn to finish winding down before reporting a busy conflict.
|
|
46
|
+
- Admit the next ACP prompt immediately after cancellation settles instead of requiring a retry.
|
|
47
|
+
|
|
48
|
+
- Scope ACP SDK session-router attachments to sessions owned or being attached by that ACP connection, preventing foreign session hosts from being kept alive.
|
|
49
|
+
|
|
50
|
+
- Sessions without explicit `retry.*` settings now auto-retry a content-free OpenAI Codex `server_error` / `internal_error` error event, the same way a content-free `server_is_overloaded` event is already retried. Attempts that produced visible output or tool content are still never retried.
|
|
51
|
+
|
|
52
|
+
- Coordinator MCP: `GJC_COORDINATOR_MCP_ARTIFACT_BYTE_CAP`, `GJC_COORDINATOR_MCP_SESSION_IDLE_TTL_MS` and `GJC_COORDINATOR_MCP_SESSION_SWEEP_INTERVAL_MS` accept only plain decimal digits; values such as `64KB`, `1e6` or `1.5` now fall back to the default instead of being read as their leading digits (`64KB` used to set a 64-byte artifact cap).
|
|
53
|
+
- `gjc setup hermes --artifact-byte-cap` rejects integers above `Number.MAX_SAFE_INTEGER` (for example `9007199254740992` or `1e21`), which it used to write in a form the coordinator then ignored, silently leaving the 64 KiB default in place.
|
|
54
|
+
|
|
55
|
+
- Report out-of-scope Coordinator evidence paths as invalid input instead of service unavailability, without exposing denied paths. Clarify evidence-root restrictions in the Hermes operator guide.
|
|
56
|
+
|
|
57
|
+
- Coordinator MCP tool arguments `timeout_ms`, `poll_interval_ms`, `limit` and `lines`, and the `GJC_COORDINATOR_MCP_PROMPT_ACK_TIMEOUT_MS` env value, no longer read a leading digit prefix. A string such as `1e4` or `5s` became a 1 ms or 5 ms wait, and a one-element array such as `[50]` was accepted as `50`; strings must now be plain decimal digits and non-numeric types fall back to the defaults.
|
|
58
|
+
|
|
59
|
+
- `GJC_COORDINATOR_MCP_EVENT_WEBHOOK_TIMEOUT_MS` and `GJC_COORDINATOR_MCP_EVENT_WEBHOOK_MAX_ATTEMPTS` now accept only plain decimal digits. Values such as `1.5`, `1e4` or `10s` were read as their leading digits, shrinking the per-attempt timeout to 1 ms or the retry budget to a single attempt; they now fall back to the defaults.
|
|
60
|
+
|
|
61
|
+
- Reject active deep-interview questions missing structured round metadata instead of accepting answers that cannot be recorded, and reject extra interview questions before prompting.
|
|
62
|
+
- Reject empty and whitespace-only ask question bodies, including metadata-free extra questions, in deferred, loaded, and direct execution paths while preserving ordinary multi-question and free-text asks, including next-workflow choices after final-spec handoff.
|
|
63
|
+
|
|
64
|
+
- Restore cache prefix extension across LLM requests by keeping volatile project context and untrusted MCP server instructions in `agent.state.messages` after they are sent, rather than removing them after each turn. This allows subsequent requests to properly reuse the cache prefix from previous requests, improving cache hit rates and reducing unnecessary re-computation. Volatile ephemeral messages are still excluded from persistent storage as intended. Fixes #6167.
|
|
65
|
+
|
|
66
|
+
- Gate the statusless typed overload check on `managedOutcome` in `#handleRetryableError` to prevent hanging when a managed fallback chain encounters a transport 503 error followed by a typed Responses overload error. The fix ensures that on the agent_end path, the statusless overload check returns false to allow proper session termination handling instead of deadlocking. Fixes #6180.
|
|
67
|
+
|
|
68
|
+
- `AgentSession.messages` no longer exposes request-scoped ephemeral messages (`volatile-project-context`, `untrusted-mcp-server-instructions`) that #6167 retains in `agent.state.messages` for prompt-cache prefix reuse. The cache prefix behavior is unchanged; the public view and everything built on it match the pre-#6167 transcript again, which fixes the red `dev` CI in the managed fallback attempt transaction test (#6191).
|
|
69
|
+
|
|
70
|
+
- Bash commands with auto-background disabled no longer leave the foreground via the timeout fold timer after timing out.
|
|
71
|
+
|
|
72
|
+
- Lifecycle ledger compaction now evicts only safe settled identities while retaining unbound close replay fences and retirement-source dependencies.
|
|
73
|
+
|
|
74
|
+
- Context-usage and compaction token estimates count the request-scoped ephemeral messages (`volatile-project-context`, `untrusted-mcp-server-instructions`) that are retained in `agent.state.messages` for prompt-cache reuse. They are hidden from `AgentSession.messages`, so estimating over that public view undercounted the real provider request and could delay auto-compaction until the context window overflowed.
|
|
75
|
+
|
|
76
|
+
- Recover abandoned parseable lock removal transitions when their owner is proven dead.
|
|
77
|
+
|
|
78
|
+
- Let SDK steering reach the active worker despite an earlier ordinary ordered control, while waiting behind abort-and-prompt replacements and fencing to the exact runtime command/turn identity so stale feedback is rejected instead of delivered to a successor.
|
|
79
|
+
|
|
80
|
+
- Return an empty observation for missing assistant text instead of a resource-loss error, including compatibility with older running SDK hosts.
|
|
81
|
+
|
|
82
|
+
- Stubbed credential-pin methods in the login preset recommendation test mock (follow-up to #6025).
|
|
83
|
+
|
|
84
|
+
- Keep managed replacement receipts owned by their exact publishing attempt until it settles, preventing concurrent sessions in one workspace from stealing active receipts and failing transcript persistence with `identity_mismatch`. Peer recovery of publisher-bound receipts requires positive owner-exit or PID-reuse evidence; orphan receipt identity checks and external transcript replacement guards remain intact.
|
|
85
|
+
|
|
86
|
+
- Fixed the resident-cache GC reaping a *running* session's cache on Linux hosts with a slewed wall clock (WSL2 in particular), which replaced tool results with `[Session resident text blob missing: …]` placeholders and logged `Resident cache trust rejection … blob_create_failed ENOENT`. The owner lease recorded the process start from `ps -o lstart`, which procps renders as `btime + ticks` where `btime` is re-derived from the current wall clock minus uptime, so the same live process reported a start time that drifted (observed: 15 minutes over 11 hours) and the sweep read the drift as PID reuse. On Linux the lease now records the `/proc/<pid>/stat` start tick count scoped by the kernel `boot_id` (basis `linux-proc-ticks:<boot_id>`), which never moves for a live process; reuse is only proven when the basis matches, so leases written by older builds or another boot are never reaped while their PID is alive.
|
|
87
|
+
|
|
88
|
+
- Broker observation refuses everything it cannot prove: a publication without the diagnostic capability is `unsupported` (never `absent` or malformed), only the canonical loopback endpoint with an in-range port is accepted, the broker answers only from an already-owned healthy publication, one monotonic budget covers the whole observation so an expired budget never opens a socket and a late answer is discarded, and malformed arguments raise a typed argument error instead of a fabricated observation.
|
|
89
|
+
|
|
90
|
+
- The read-only diagnostic addon's trusted digest now travels with the addon through the release path: each build emits a provenance sidecar, consuming jobs rebuild the record from those sidecars against the version actually being shipped, and embedding plus platform-package staging refuse bytes that do not match it.
|
|
91
|
+
|
|
92
|
+
- Reverted the 0.18.2 readiness-cutoff reaping (#6126) because it left hosts in `terminal_uncertain` under concurrent recovery (#6143); unregistered hosts terminated by a signal at readiness cutoff again report `terminal_uncertain` until the fix re-lands.
|
|
93
|
+
|
|
94
|
+
- Coordinator MCP: a `GJC_COORDINATOR_MCP_SESSION_SWEEP_INTERVAL_MS` above `2147483647` (about 24.9 days) no longer makes the idle-session reaper sweep continuously. The interval was passed straight to `setTimeout`, which treats longer delays as 1 ms; it is now capped at the timer maximum.
|
|
95
|
+
|
|
96
|
+
- `gjc ssh add --port` now rejects ports that are not plain digits (`"22oops"`, `"2222.5"`, `"+22"`, `"1e3"`) instead of silently saving the leading digits to `ssh.json`.
|
|
97
|
+
|
|
98
|
+
- `gjc web-search --limit` now rejects `0` and negative values with an error instead of passing them to providers, where a negative limit silently dropped results from the end of the source list.
|
|
99
|
+
|
|
100
|
+
- The `web_search` tool schema now declares `limit` and `num_search_results` as positive integers, so a model-supplied `0`, negative or fractional count is rejected at validation instead of reaching providers, where a negative count silently dropped sources from the end of the list.
|
|
101
|
+
|
|
102
|
+
### Tests
|
|
103
|
+
|
|
104
|
+
- Add regression test for issue #6004: Verify that after overflow auto-compaction without a continuation scheduled, the session remains usable for subsequent prompts. The test exercises the overflow path to ensure pending agent_end events do not block future prompt submissions (related to #6004).
|
|
105
|
+
|
|
106
|
+
## [0.18.5] - 2026-09-30
|
|
107
|
+
|
|
108
|
+
## [0.18.4] - 2026-09-30
|
|
109
|
+
|
|
110
|
+
## [0.18.3] - 2026-09-30
|
|
111
|
+
|
|
112
|
+
## [0.18.2] - 2026-09-30
|
|
113
|
+
|
|
114
|
+
### Added
|
|
115
|
+
|
|
116
|
+
- Added the additive `codex-sol61` built-in model profile for GPT-6.1 Sol.
|
|
117
|
+
|
|
118
|
+
### Changed
|
|
119
|
+
|
|
120
|
+
- Built-in `claude-opus` and `claude-fable` executor roles and the `opus-codex` planner role now use `anthropic/claude-sonnet-5-5` instead of `anthropic/claude-sonnet-5` (#6111).
|
|
121
|
+
|
|
122
|
+
### Fixed
|
|
123
|
+
|
|
124
|
+
- Bare line-number and hash-only hashline anchors now fail with actionable, copy-ready full-anchor suggestions; edits remain unapplied until a full anchor is supplied.
|
|
125
|
+
|
|
126
|
+
- On macOS, the shell runtime no longer exits with code 70 when spawning fast-exiting child processes or entitled/setuid children (like `/bin/ps`, `/usr/bin/top`, `sudo`) that cannot be queried for unique identity. When a child is confirmed absent or terminated before observation, the process identity is recorded like on Linux. Only genuine integrity failures (ledger write failures, HMAC errors) trigger exit 70 on a live child (#6085).
|
|
127
|
+
|
|
128
|
+
- Exa MCP tool-call responses are formatted in bounded time. `formatGenericResponse` re-indents the entire formatted subtree at every object level, so cost grew super-linearly with nesting depth: 500/1000/2000/4000/8000 levels cost 60ms/227ms/730ms/5.9s/94s, and 20000 levels exhausted the call stack. The payload is whatever the remote MCP server returned, and the 16 MiB content cap does not bound depth — 8000 levels of `{"a":` is under 47 KB. Depth is now limited to 64, matching the session-import walker, and output for payloads within that limit is unchanged.
|
|
129
|
+
|
|
130
|
+
- Preserve the one-line hashline retry hint when copied text contains literal `..`, while keeping ambiguous range edits rejected without modifying the file (#6112).
|
|
131
|
+
|
|
132
|
+
- Nested `gjc` commands run through the Bash tool inside a managed-owner (tmux-supervised) session no longer fail with `managed_owner_admission_metadata_invalid`: the Bash boundary now scrubs the whole managed-owner env family, including the tmux owner server key and `GJC_TMUX_LAUNCHED`, instead of leaving a partial owner context behind (#6140).
|
|
133
|
+
|
|
134
|
+
- Keep the ACP prompt watchdog on its awaiting-model bound until a streamed tool call actually begins executing.
|
|
135
|
+
|
|
136
|
+
- Sessions without explicit `retry.*` settings now retry a content-free "socket connection was closed unexpectedly" (`ECONNRESET`) failure when the attempt is replay-safe, bounded by `retry.maxRetries`. Previously the bare-default gate only admitted stream-timeout watchdog errors, so a transient connection reset before any response ended the turn even though it was classified as transient.
|
|
137
|
+
|
|
138
|
+
- Fixed sessions intermittently hanging after a tool call on long contexts (seen with OpenGateway `-ultrafast` models). The CLI no longer routes `fetch()` through Bun's HTTP/2 client, which could stall a pooled connection on large request bodies until the process restarted.
|
|
139
|
+
|
|
140
|
+
- A long-running session whose `gjc` binary was replaced on disk no longer respawns the shared SDK broker over and over. Broker recovery now stops and asks for a session restart when this process's runtime image was replaced (same path, new file identity) or removed, and repeated recovery failures back off exponentially up to a cap instead of retrying every 30–60 seconds. Other clients sharing the broker are no longer disrupted by the churn (#6040).
|
|
141
|
+
|
|
142
|
+
- Model registry refreshes no longer rescan and re-lowercase the whole model catalog for every registry-profile selector; selector matching uses a prebuilt index.
|
|
143
|
+
|
|
144
|
+
- Validating cached model-preset registry documents is about a third faster: canonical JSON serialization no longer calls `JSON.stringify` for strings that need no escaping and checks surrogates with the native well-formedness test.
|
|
145
|
+
|
|
146
|
+
- A session sharing its managed scope with another `gjc` process (for example a master session and the SDK session it spawned) no longer stops persisting with `managed_replace_receipt_cleanup_pending:quarantine_collision` when both processes try to retire the same replacement cleanup receipt at the same time. The process that loses the race to claim the retirement slot now leaves the receipt for a later reconciliation, and its own session write continues.
|
|
147
|
+
|
|
148
|
+
- Keep SDK prompts alive when transient directed delivery back-pressure (`writer_backlog_full`) drops a correlated progress frame. Previously the prompt was abandoned while the run kept executing, so the final `agent_end` was dropped and ACP clients only settled the prompt when the prompt watchdog expired. Terminal frames now retry briefly under back-pressure so the prompt settles normally.
|
|
149
|
+
- Release the prompt submission and work lease when terminal delivery still fails after the retry window, while preserving the `delivery_failed` terminal outcome.
|
|
150
|
+
|
|
151
|
+
- Keep SDK and ACP prompts alive when a streaming message snapshot exceeds the directed frame limit, and report a correlated delivery failure to the requester only when the undeliverable frame is the run's own terminal, so a prompt is never reported failed while its execution is still running.
|
|
152
|
+
- Preserve assistant text shape and terminal truncation metadata when bounding oversized correlated frames.
|
|
153
|
+
- Preserve as much aggregate assistant message_end text as fits, including ordered text blocks.
|
|
154
|
+
|
|
155
|
+
- Give broker-admitted lifecycle launches without a worktree a fresh child readiness budget after bounded pre-spawn bookkeeping, while preserving caller-supplied exact deadlines.
|
|
156
|
+
- Bound broker-derived non-worktree pre-spawn preparation by the unused admission window (10s without queueing at default readiness), so fresh readiness still finishes inside the unchanged caller deadline.
|
|
157
|
+
|
|
158
|
+
- Exit lifecycle session hosts cleanly after publishing a complete rollback receipt at the readiness cutoff.
|
|
159
|
+
|
|
160
|
+
- Prove broker-owned session hosts have exited at readiness cutoff before returning retryable startup failures, including hosts blocked during extension initialization.
|
|
161
|
+
|
|
162
|
+
- `gjc stats --json` now writes only the JSON document to stdout, so `gjc stats --json | jq ...` works. The `Synced N new entries ...` summary goes to stderr in JSON mode, alongside the sync progress. The dashboard and `--summary` output are unchanged.
|
|
163
|
+
|
|
164
|
+
- Interactive `/ssh add ... --port` rejects a port with trailing or non-digit characters (for example `22oops` or `2222.5`) instead of saving the digits before them, matching the ACP `/ssh add` parser.
|
|
165
|
+
|
|
5
166
|
## [0.18.1] - 2026-09-29
|
|
6
167
|
|
|
7
168
|
### Fixed
|
|
@@ -8,10 +8,5 @@ export interface StatsCommandArgs {
|
|
|
8
8
|
json: boolean;
|
|
9
9
|
summary: boolean;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Parse stats subcommand arguments.
|
|
13
|
-
* Returns undefined if not a stats command.
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseStatsArgs(args: string[]): StatsCommandArgs | undefined;
|
|
16
11
|
export declare function runStatsCommand(cmd: StatsCommandArgs): Promise<void>;
|
|
17
12
|
export declare function printStatsHelp(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandEntry } from "@gajae-code/utils/cli";
|
|
2
|
+
/**
|
|
3
|
+
* Public-family hooks kept available for private-worker tests without loading the
|
|
4
|
+
* full registry.
|
|
5
|
+
*
|
|
6
|
+
* This is the single shared array: the inert entry (`cli.ts`) and the ordinary
|
|
7
|
+
* dispatcher (`cli-ordinary.ts`) both re-export THIS object, so a test that
|
|
8
|
+
* mutates or injects an entry keeps affecting the dispatcher.
|
|
9
|
+
*/
|
|
10
|
+
export declare const commands: CommandEntry[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Ordinary CLI graph: everything the inert entry must not load eagerly.
|
|
2
|
+
*
|
|
3
|
+
* This module owns the effectful bootstrap (startup timing, stderr drainer,
|
|
4
|
+
* bash-shell worker protocol) plus the unchanged ordinary routing order:
|
|
5
|
+
* bash-shell workers -> darwin malloc re-exec -> internal smoke -> tmux owner
|
|
6
|
+
* isolation -> managed-owner supervisor/admission/recovery -> private sdk
|
|
7
|
+
* stderr drainer -> public family dispatch -> community app -> doctor worker /
|
|
8
|
+
* probe / cli -> full registry. `cli.ts` imports it lazily, only after argv has
|
|
9
|
+
* been proven not to be a `sdk diagnostics` observation. */
|
|
10
|
+
import { commands } from "./cli-commands";
|
|
11
|
+
export { commands };
|
|
12
|
+
/** Run every non-diagnostics command with the original admission order. */
|
|
13
|
+
export declare function runOrdinaryCli(argv: string[]): Promise<void>;
|
package/dist/types/cli.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/** Inert CLI entry.
|
|
3
|
+
*
|
|
4
|
+
* `bin/gjc.js` imports THIS module, so anything statically imported here runs
|
|
5
|
+
* before argv is inspected. Keep it to pure metadata: the read-only
|
|
6
|
+
* `sdk diagnostics` observation route must not be able to resolve directories,
|
|
7
|
+
* consult NSS for a missing/ambiguous HOME, load the native addon, install
|
|
8
|
+
* runtime globals, re-exec for malloc env vars, run managed-owner admission or
|
|
9
|
+
* recovery, or touch the error-evidence store. Everything effectful lives in
|
|
10
|
+
* `./cli-ordinary`, which is imported lazily for every other command with its
|
|
11
|
+
* original ordering and admission semantics. */
|
|
12
|
+
import { commands } from "./cli-commands";
|
|
13
|
+
export { commands };
|
|
5
14
|
/** Run the CLI with argv excluding process.argv prefix. */
|
|
6
15
|
export declare function runCli(argv: string[]): Promise<void>;
|
|
@@ -3,9 +3,6 @@ export default class ContributionPrep extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static strict: boolean;
|
|
5
5
|
static flags: {
|
|
6
|
-
"no-spawn": import("@gajae-code/utils/cli").FlagDescriptor<"boolean"> & {
|
|
7
|
-
description: string;
|
|
8
|
-
};
|
|
9
6
|
"source-session-id": import("@gajae-code/utils/cli").FlagDescriptor<"string"> & {
|
|
10
7
|
description: string;
|
|
11
8
|
};
|
|
@@ -132,6 +132,9 @@ export declare function runSessionHost(timing?: {
|
|
|
132
132
|
export type SdkInternalArgv = {
|
|
133
133
|
action: "broker-internal";
|
|
134
134
|
agentDir: string;
|
|
135
|
+
} | {
|
|
136
|
+
action: "broker-trampoline-internal";
|
|
137
|
+
agentDir: string;
|
|
135
138
|
} | {
|
|
136
139
|
action: "session-host-internal";
|
|
137
140
|
} | {
|
|
@@ -33,14 +33,18 @@ export declare const CURATED_TIER_LABELS: {
|
|
|
33
33
|
readonly tier: "fast";
|
|
34
34
|
readonly rank: 1;
|
|
35
35
|
}];
|
|
36
|
-
readonly "anthropic/claude-sonnet-5": readonly [{
|
|
36
|
+
readonly "anthropic/claude-sonnet-5-5": readonly [{
|
|
37
37
|
readonly tier: "balanced";
|
|
38
38
|
readonly rank: 1;
|
|
39
39
|
}];
|
|
40
|
-
readonly "anthropic/claude-sonnet-
|
|
40
|
+
readonly "anthropic/claude-sonnet-5": readonly [{
|
|
41
41
|
readonly tier: "balanced";
|
|
42
42
|
readonly rank: 2;
|
|
43
43
|
}];
|
|
44
|
+
readonly "anthropic/claude-sonnet-4-6": readonly [{
|
|
45
|
+
readonly tier: "balanced";
|
|
46
|
+
readonly rank: 3;
|
|
47
|
+
}];
|
|
44
48
|
readonly "anthropic/claude-opus-5-5": readonly [{
|
|
45
49
|
readonly tier: "strong";
|
|
46
50
|
readonly effort: "high";
|
|
@@ -70,6 +74,11 @@ export declare const CURATED_TIER_LABELS: {
|
|
|
70
74
|
readonly effort: "high";
|
|
71
75
|
readonly rank: 1;
|
|
72
76
|
}];
|
|
77
|
+
readonly "openai-codex/gpt-6.1-sol": readonly [{
|
|
78
|
+
readonly tier: "strong";
|
|
79
|
+
readonly effort: "high";
|
|
80
|
+
readonly rank: 2;
|
|
81
|
+
}];
|
|
73
82
|
readonly "google/gemini-3.5-flash-lite": readonly [{
|
|
74
83
|
readonly tier: "fast";
|
|
75
84
|
readonly rank: 1;
|
|
@@ -123,6 +132,24 @@ export declare const CURATED_TIER_LABELS: {
|
|
|
123
132
|
};
|
|
124
133
|
/** Generated from packages/ai/src/models.json at feature land: 3936 in-scope baseline skips. */
|
|
125
134
|
export declare const TIER_MAP_SKIP_LIST: {
|
|
135
|
+
readonly "amazon-bedrock/anthropic.claude-sonnet-5-5": {
|
|
136
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
137
|
+
};
|
|
138
|
+
readonly "amazon-bedrock/au.anthropic.claude-sonnet-5-5": {
|
|
139
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
140
|
+
};
|
|
141
|
+
readonly "amazon-bedrock/eu.anthropic.claude-sonnet-5-5": {
|
|
142
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
143
|
+
};
|
|
144
|
+
readonly "amazon-bedrock/global.anthropic.claude-sonnet-5-5": {
|
|
145
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
146
|
+
};
|
|
147
|
+
readonly "amazon-bedrock/jp.anthropic.claude-sonnet-5-5": {
|
|
148
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
149
|
+
};
|
|
150
|
+
readonly "amazon-bedrock/us.anthropic.claude-sonnet-5-5": {
|
|
151
|
+
readonly rationale: "Sonnet 5.5 catalog addition (#6111); not yet curated";
|
|
152
|
+
};
|
|
126
153
|
readonly "kiro/claude-opus-5-5": {
|
|
127
154
|
readonly rationale: "post-rebase catalog addition from dev; not yet curated";
|
|
128
155
|
};
|
|
@@ -44,6 +44,7 @@ export interface PrepareModelProfileActivationOptions {
|
|
|
44
44
|
session: ModelProfileActivationSession;
|
|
45
45
|
modelRegistry: Pick<ModelRegistry, "getModelProfile" | "getModelProfiles" | "getAvailableModelProfileNames" | "getApiKeyForProvider" | "getAll" | "resolveCanonicalModel" | "getCanonicalVariants" | "getCanonicalId" | "isSelectorCircuitOpen"> & Partial<Pick<ModelRegistry, "getAvailable" | "getAvailableForProfileActivation" | "resolveModelByLookupAlias" | "lookupAliasExists" | "clearCanonicalVariant" | "seedCanonicalVariant" | "getSessionCanonicalVariant" | "restoreSessionCanonicalVariant" | "getConfiguredProviderIds" | "isKnownProvider">> & {
|
|
46
46
|
getError?: ModelRegistry["getError"];
|
|
47
|
+
authStorage?: ModelRegistry["authStorage"];
|
|
47
48
|
};
|
|
48
49
|
settings: Pick<Settings, "get" | "getGlobal" | "getOverride">;
|
|
49
50
|
profileName: string;
|
|
@@ -129,6 +130,24 @@ export declare class ModelProfileCredentialError extends Error {
|
|
|
129
130
|
readonly role: string | undefined;
|
|
130
131
|
constructor(profileLabel: string, providers: readonly string[], role?: string);
|
|
131
132
|
}
|
|
133
|
+
interface SessionPinRegistry {
|
|
134
|
+
authStorage?: {
|
|
135
|
+
hasRuntimeApiKey(provider: string): boolean;
|
|
136
|
+
hasLiteralConfigApiKey(provider: string, owner?: object): boolean;
|
|
137
|
+
hasSessionCredentialUnavailable(provider: string, scopeId?: string): boolean;
|
|
138
|
+
};
|
|
139
|
+
getAuthStorageOwner?(): object;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Whether an unavailable session credential pin blocks `provider`.
|
|
143
|
+
*
|
|
144
|
+
* Mirrors `AuthStorage.getApiKey` precedence: a runtime `--api-key` override or a literal
|
|
145
|
+
* `models.yml` `apiKey` registered for this registry's owner is resolved before the
|
|
146
|
+
* unavailable-pin marker, so either one keeps the provider usable. An `apiKeyEnv` key does
|
|
147
|
+
* not: `getApiKey` prefers another stored api_key account over it, which would silently
|
|
148
|
+
* retarget the unavailable pin.
|
|
149
|
+
*/
|
|
150
|
+
export declare function isSessionCredentialPinBlocking(registry: SessionPinRegistry, provider: string, sessionId: string | undefined): boolean;
|
|
132
151
|
export declare function formatModelProfileCredentialError(profileLabel: string, providers: readonly string[]): string;
|
|
133
152
|
export declare function formatModelProfileUnknownProviderError(profileLabel: string, providers: readonly string[]): string;
|
|
134
153
|
/**
|
|
@@ -327,7 +327,22 @@ interface ProviderOverride {
|
|
|
327
327
|
cacheRetention?: CacheRetention;
|
|
328
328
|
isOAuth?: boolean;
|
|
329
329
|
}
|
|
330
|
-
|
|
330
|
+
/**
|
|
331
|
+
* Lowercased lookup keys for a model catalog, so selector resolution is a set
|
|
332
|
+
* lookup instead of a scan that re-lowercases every model id per selector.
|
|
333
|
+
*/
|
|
334
|
+
export interface RegistrySelectorIndex {
|
|
335
|
+
/** `id` and `provider/id`. */
|
|
336
|
+
exact: ReadonlySet<string>;
|
|
337
|
+
/** `id` alone. */
|
|
338
|
+
ids: ReadonlySet<string>;
|
|
339
|
+
/** Model ids per provider, for parsed `provider/id` selectors (nested, so no delimiter can collide). */
|
|
340
|
+
providerIds: ReadonlyMap<string, ReadonlySet<string>>;
|
|
341
|
+
/** Every `/`-delimited suffix of each id (`a/b/c` → `b/c`, `c`). */
|
|
342
|
+
idSuffixes: ReadonlySet<string>;
|
|
343
|
+
}
|
|
344
|
+
export declare function createRegistrySelectorIndex(models: readonly Model<Api>[]): RegistrySelectorIndex;
|
|
345
|
+
export declare function registrySelectorResolvesToModel(selector: string, index: RegistrySelectorIndex): boolean;
|
|
331
346
|
/**
|
|
332
347
|
* Merge a freshly discovered model with the matching bundled/configured entry
|
|
333
348
|
* (or a runtime provider override when no bundled entry exists).
|
|
@@ -19,6 +19,11 @@ export declare const DEFAULT_SESSION_IDLE_TTL_MS: number;
|
|
|
19
19
|
export declare const DEFAULT_SESSION_SWEEP_INTERVAL_MS: number;
|
|
20
20
|
export declare const MIN_SESSION_IDLE_TTL_MS = 60000;
|
|
21
21
|
export declare const MIN_SESSION_SWEEP_INTERVAL_MS = 30000;
|
|
22
|
+
/**
|
|
23
|
+
* Longest delay setTimeout honors. Bun, like Node, treats any larger delay as 1 ms,
|
|
24
|
+
* so an operator's very long sweep interval would otherwise re-sweep back to back.
|
|
25
|
+
*/
|
|
26
|
+
export declare const MAX_SESSION_SWEEP_INTERVAL_MS: number;
|
|
22
27
|
/** After this many consecutive reap failures the session is force-evicted from the index. */
|
|
23
28
|
export declare const MAX_REAP_FAILURES = 3;
|
|
24
29
|
/** Minimal projection of a coordinator session the reaper needs to decide. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fuzzy matching utilities for the edit tool.
|
|
3
3
|
*
|
|
4
|
-
* Provides both character-level and line-level fuzzy matching with
|
|
5
|
-
*
|
|
4
|
+
* Provides both character-level and line-level fuzzy matching with staged
|
|
5
|
+
* strategies for finding text in files.
|
|
6
6
|
*/
|
|
7
7
|
import type { AgentToolResult } from "@gajae-code/agent-core";
|
|
8
8
|
import * as z from "zod/v4";
|
|
@@ -92,7 +92,7 @@ export declare function findClosestSequenceMatch(lines: string[], pattern: strin
|
|
|
92
92
|
*/
|
|
93
93
|
export declare function findContextLine(lines: string[], context: string, startFrom: number, options?: {
|
|
94
94
|
allowFuzzy?: boolean;
|
|
95
|
-
|
|
95
|
+
skipParenRetry?: boolean;
|
|
96
96
|
}): ContextLineResult;
|
|
97
97
|
export declare const replaceEditEntrySchema: z.ZodObject<{
|
|
98
98
|
old_text: z.ZodString;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - compute unified diff previews for the in-flight args
|
|
8
8
|
* (`computeDiffPreview`), and
|
|
9
9
|
* - render a text placeholder while no diff exists yet
|
|
10
|
-
* (`
|
|
10
|
+
* (`renderStreamingPlaceholder`).
|
|
11
11
|
*
|
|
12
12
|
* The shared renderer / `ToolExecutionComponent` consult the strategy via
|
|
13
13
|
* the injected `editMode` rather than probing argument shape.
|
|
@@ -51,7 +51,7 @@ export interface EditStreamingStrategy<Args = unknown> {
|
|
|
51
51
|
* Rendered inline while the diff hasn't been computed yet (or when the
|
|
52
52
|
* compute returned `null` because args are still too partial).
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
renderStreamingPlaceholder(args: Args, uiTheme: Theme): string;
|
|
55
55
|
}
|
|
56
56
|
export interface EditRequestTargetInventory {
|
|
57
57
|
paths: string[];
|
|
@@ -22,11 +22,7 @@ export declare function callExaTool(toolName: string, args: Record<string, unkno
|
|
|
22
22
|
export declare function callWebsetsTool(apiKey: string, toolName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
23
23
|
/** Format search results for LLM */
|
|
24
24
|
export declare function formatSearchResults(data: ExaSearchResponse): string;
|
|
25
|
-
|
|
26
|
-
* Format a non-search MCP response as human-readable text.
|
|
27
|
-
* Handles objects, arrays, primitives, and common MCP response shapes.
|
|
28
|
-
*/
|
|
29
|
-
export declare function formatGenericResponse(data: unknown): string;
|
|
25
|
+
export declare function formatGenericResponse(data: unknown, depth?: number): string;
|
|
30
26
|
/** Check if result is a search response */
|
|
31
27
|
export declare function isSearchResponse(data: unknown): data is ExaSearchResponse;
|
|
32
28
|
/** Fetch and cache MCP tool schema */
|
|
@@ -11,5 +11,31 @@ export declare function extendOwnedDarwinAncestry<T extends {
|
|
|
11
11
|
uniqueId: bigint;
|
|
12
12
|
parentUniqueId: bigint;
|
|
13
13
|
}>(knownUniqueIds: Set<bigint>, candidates: ReadonlyMap<number, T>): number[];
|
|
14
|
+
export declare function authenticateOwnershipRecord(line: string, ledgerToken: string): {
|
|
15
|
+
processRef?: NativeProcess;
|
|
16
|
+
darwinUniqueId?: bigint;
|
|
17
|
+
pending?: true;
|
|
18
|
+
} | undefined;
|
|
19
|
+
export type DarwinAncestryTracker = {
|
|
20
|
+
seed(uniqueId: bigint): void;
|
|
21
|
+
track(processRef: NativeProcess, uniqueId?: bigint): boolean;
|
|
22
|
+
trackGuardian(processRef: NativeProcess, uniqueId?: bigint): boolean;
|
|
23
|
+
poll(): boolean;
|
|
24
|
+
close(): void;
|
|
25
|
+
};
|
|
26
|
+
export type DarwinIdentity = {
|
|
27
|
+
uniqueId: bigint;
|
|
28
|
+
parentUniqueId: bigint;
|
|
29
|
+
};
|
|
30
|
+
/** Test seams for the Darwin tracker; production uses libproc and the natives binding. */
|
|
31
|
+
export type DarwinAncestryTrackerDeps = {
|
|
32
|
+
uniqueIdentity?: (pid: number) => DarwinIdentity | undefined;
|
|
33
|
+
fromPid?: (pid: number) => NativeProcess | null | undefined;
|
|
34
|
+
observe?: (pid: number) => {
|
|
35
|
+
status: "present" | "absent" | "unknown";
|
|
36
|
+
incarnation?: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare function createDarwinAncestryTracker(owned: Map<string, NativeProcess>, deps?: DarwinAncestryTrackerDeps): DarwinAncestryTracker | undefined;
|
|
14
40
|
export declare function runBashShellGuardian(): Promise<void>;
|
|
15
41
|
export {};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import type { EventEmitter } from "node:events";
|
|
1
2
|
import { type BashShellWorkerResponse } from "./bash-shell-worker-protocol";
|
|
3
|
+
/**
|
|
4
|
+
* Reap adopted zombies only when the kernel reports a child state change.
|
|
5
|
+
*
|
|
6
|
+
* As the Linux child subreaper, the supervisor inherits orphaned descendants
|
|
7
|
+
* and must reap them, but a full `/proc` sweep is expensive. Polling it on a
|
|
8
|
+
* short interval kept every idle supervisor busy (issue #5972), so sweeps are
|
|
9
|
+
* driven by SIGCHLD instead. At most one sweep runs at a time, and a SIGCHLD that
|
|
10
|
+
* arrives mid-sweep schedules exactly one follow-up so a zombie created after
|
|
11
|
+
* its `/proc` entry was passed is never missed. Returns the unsubscribe hook.
|
|
12
|
+
*/
|
|
13
|
+
export declare function startLinuxAdoptedZombieReaper(excludedPid: number | undefined, reap?: (excludedPid: number | undefined) => Promise<void>, signals?: Pick<EventEmitter, "on" | "off">): () => void;
|
|
2
14
|
export declare function createUtf8LineDecoder(onLine: (line: string) => void, options?: {
|
|
3
15
|
maxBufferedBytes?: number;
|
|
4
16
|
onOverflow?: () => void;
|
|
@@ -1,19 +1,41 @@
|
|
|
1
|
+
import { HL_OP_INSERT_AFTER, HL_OP_INSERT_BEFORE, HL_OP_REPLACE } from "./hash";
|
|
1
2
|
import type { HashlineCursor, HashlineEdit } from "./types";
|
|
3
|
+
type HashlineOpSigil = typeof HL_OP_INSERT_BEFORE | typeof HL_OP_INSERT_AFTER | typeof HL_OP_REPLACE;
|
|
2
4
|
/**
|
|
3
|
-
* An op referenced lines by number alone
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* extra read.
|
|
5
|
+
* An op referenced lines by number alone. The edit is never applied on a line
|
|
6
|
+
* number alone; the executor answers with the current full anchors so the model
|
|
7
|
+
* can retry without another read.
|
|
7
8
|
*/
|
|
8
9
|
export declare class HashlineMissingHashError extends Error {
|
|
9
10
|
readonly lines: {
|
|
10
11
|
start: number;
|
|
11
12
|
end: number;
|
|
12
13
|
};
|
|
14
|
+
readonly opSigil: HashlineOpSigil;
|
|
15
|
+
readonly rangeRaw?: {
|
|
16
|
+
start: string;
|
|
17
|
+
end: string;
|
|
18
|
+
} | undefined;
|
|
13
19
|
constructor(message: string, lines: {
|
|
14
20
|
start: number;
|
|
15
21
|
end: number;
|
|
16
|
-
}
|
|
22
|
+
}, opSigil: HashlineOpSigil, rangeRaw?: {
|
|
23
|
+
start: string;
|
|
24
|
+
end: string;
|
|
25
|
+
} | undefined);
|
|
26
|
+
}
|
|
27
|
+
export declare class HashlineMissingLineError extends Error {
|
|
28
|
+
readonly hash: string;
|
|
29
|
+
readonly lineNum: number | undefined;
|
|
30
|
+
readonly opSigil: HashlineOpSigil;
|
|
31
|
+
readonly rangeRaw?: {
|
|
32
|
+
start: string;
|
|
33
|
+
end: string;
|
|
34
|
+
} | undefined;
|
|
35
|
+
constructor(hash: string, lineNum: number | undefined, opSigil: HashlineOpSigil, rangeRaw?: {
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
38
|
+
} | undefined);
|
|
17
39
|
}
|
|
18
40
|
export declare function cloneCursor(cursor: HashlineCursor): HashlineCursor;
|
|
19
41
|
export declare function parseHashline(diff: string): HashlineEdit[];
|
|
@@ -21,3 +43,4 @@ export declare function parseHashlineWithWarnings(diff: string): {
|
|
|
21
43
|
edits: HashlineEdit[];
|
|
22
44
|
warnings: string[];
|
|
23
45
|
};
|
|
46
|
+
export {};
|
|
@@ -46,7 +46,12 @@ export declare function paginateAcpSessions(listed: unknown[], cwd: string | und
|
|
|
46
46
|
export declare function acpAvailableCommandsFromSkills(query: unknown): AvailableCommand[];
|
|
47
47
|
type SdkPromptFailedOutcome = Extract<SdkPromptTerminalOutcome, {
|
|
48
48
|
kind: "failed";
|
|
49
|
-
}
|
|
49
|
+
}> & {
|
|
50
|
+
deliveryFailure?: {
|
|
51
|
+
cause: string;
|
|
52
|
+
frameBytes: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
50
55
|
/**
|
|
51
56
|
* A prompt rejection that still carries the terminal's structured failure classification.
|
|
52
57
|
* The ACP client sees only the code and message, but the first-turn retry gate must decide on
|
|
@@ -36,6 +36,14 @@ export interface BrokerDiscovery {
|
|
|
36
36
|
ownerId: string;
|
|
37
37
|
pid: number;
|
|
38
38
|
incarnation: string;
|
|
39
|
+
/**
|
|
40
|
+
* Public publication-incarnation id for diagnostic observation, fixed at startup.
|
|
41
|
+
* Absent on publications written before the capability existed; an observer then
|
|
42
|
+
* reports `unsupported` instead of synthesizing compatibility.
|
|
43
|
+
*/
|
|
44
|
+
diagnosticGeneration?: string;
|
|
45
|
+
/** Diagnostic protocol the publisher answers; absent means no capability. */
|
|
46
|
+
diagnosticProtocol?: number;
|
|
39
47
|
host: "127.0.0.1";
|
|
40
48
|
port: number;
|
|
41
49
|
url: string;
|
|
@@ -139,6 +139,7 @@ interface BrokerOwner {
|
|
|
139
139
|
stop(): Promise<void>;
|
|
140
140
|
canReuse(discovery: BrokerDiscovery | null): boolean;
|
|
141
141
|
markReady(discovery: BrokerDiscovery): boolean;
|
|
142
|
+
setTarget(pid: number, incarnation: string): void;
|
|
142
143
|
}
|
|
143
144
|
interface ReapTiming {
|
|
144
145
|
gracefulMs: number;
|
|
@@ -61,6 +61,8 @@ export interface LifecycleDurableEffectsReceipt {
|
|
|
61
61
|
export interface LifecycleLedgerEntry {
|
|
62
62
|
operationKey?: string;
|
|
63
63
|
fingerprint?: string;
|
|
64
|
+
/** True only when a session.close request supplied immutable generation authority. */
|
|
65
|
+
closeAuthorityBound?: boolean;
|
|
64
66
|
version: typeof SDK_STATE_VERSION;
|
|
65
67
|
identity: string;
|
|
66
68
|
requestHash: string;
|
|
@@ -158,12 +160,14 @@ export declare class LifecycleLedger {
|
|
|
158
160
|
migrateIdentity(from: string, to: string, metadata: {
|
|
159
161
|
operationKey: string;
|
|
160
162
|
fingerprint: string;
|
|
163
|
+
closeAuthorityBound?: boolean;
|
|
161
164
|
}): Promise<LifecycleLedgerEntry | undefined>;
|
|
162
165
|
get warnings(): readonly string[];
|
|
163
166
|
begin(identity: string, requestHash: string, metadata?: {
|
|
164
167
|
operationKey?: string;
|
|
165
168
|
fingerprint?: string;
|
|
166
169
|
intendedSessionId?: string;
|
|
170
|
+
closeAuthorityBound?: boolean;
|
|
167
171
|
}): Promise<BeginResult>;
|
|
168
172
|
transition(identity: string, state: LifecycleState, fields?: Omit<Partial<LifecycleLedgerEntry>, "identity" | "requestHash" | "state" | "ts">): Promise<LifecycleLedgerEntry>;
|
|
169
173
|
assertSupportedStateVersions(): Promise<void>;
|