@gajae-code/coding-agent 0.18.5 → 0.18.7

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.
Files changed (133) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/dist/types/capability/types.d.ts +4 -0
  3. package/dist/types/cli-commands.d.ts +10 -0
  4. package/dist/types/cli-ordinary.d.ts +13 -0
  5. package/dist/types/cli.d.ts +12 -3
  6. package/dist/types/commands/contribution-prep.d.ts +0 -3
  7. package/dist/types/commands/sdk.d.ts +3 -0
  8. package/dist/types/commands/update.d.ts +1 -0
  9. package/dist/types/config/model-profile-activation.d.ts +19 -0
  10. package/dist/types/config/settings.d.ts +4 -0
  11. package/dist/types/coordinator-mcp/session-reaper.d.ts +5 -0
  12. package/dist/types/discovery/helpers.d.ts +2 -2
  13. package/dist/types/edit/modes/replace.d.ts +3 -3
  14. package/dist/types/edit/streaming.d.ts +2 -2
  15. package/dist/types/exec/bash-shell-supervisor.d.ts +12 -0
  16. package/dist/types/runtime-mcp/elicitation.d.ts +12 -0
  17. package/dist/types/sdk/broker/discovery.d.ts +8 -0
  18. package/dist/types/sdk/broker/ensure.d.ts +1 -0
  19. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +4 -0
  20. package/dist/types/sdk/broker/lifecycle.d.ts +9 -0
  21. package/dist/types/sdk/broker/runtime.d.ts +1 -1
  22. package/dist/types/sdk/broker/task-artifact-owner-validation.d.ts +55 -0
  23. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
  24. package/dist/types/sdk/bus/telegram-daemon.d.ts +4 -2
  25. package/dist/types/sdk/cli/diagnostics-cli.d.ts +18 -0
  26. package/dist/types/sdk/diagnostics/observe-broker.d.ts +185 -0
  27. package/dist/types/sdk/host/control/operations.d.ts +1 -1
  28. package/dist/types/sdk/host/host.d.ts +6 -0
  29. package/dist/types/sdk/index.d.ts +1 -0
  30. package/dist/types/sdk/router/session-router.d.ts +9 -0
  31. package/dist/types/sdk/session.d.ts +13 -0
  32. package/dist/types/session/agent-session.d.ts +5 -1
  33. package/dist/types/session/internal/managed-session-storage.d.ts +11 -1
  34. package/dist/types/session/internal/task-artifact-owner-access.d.ts +17 -0
  35. package/dist/types/session/internal/task-artifact-owner-transcript.d.ts +3 -0
  36. package/dist/types/session/session-retirement.d.ts +47 -0
  37. package/dist/types/session/session-storage.d.ts +0 -46
  38. package/dist/types/session/session-transcript-header.d.ts +2 -0
  39. package/dist/types/session/task-artifact-owner-codec.d.ts +107 -0
  40. package/dist/types/session/task-artifact-owner-retirement.d.ts +7 -0
  41. package/dist/types/session/task-artifact-owner.d.ts +10 -0
  42. package/dist/types/tools/ask-contract.d.ts +75 -254
  43. package/dist/types/tools/bash.d.ts +1 -1
  44. package/package.json +7 -7
  45. package/scripts/build-sdk-package-smoke.ts +5 -0
  46. package/scripts/resident-memory-bench.ts +174 -20
  47. package/src/capability/index.ts +1 -0
  48. package/src/capability/types.ts +4 -0
  49. package/src/cli/config-cli.ts +8 -18
  50. package/src/cli/public-command-entry.ts +5 -0
  51. package/src/cli/ssh-cli.ts +6 -3
  52. package/src/cli/web-search-cli.ts +9 -3
  53. package/src/cli-commands.ts +14 -0
  54. package/src/cli-main.ts +7 -8
  55. package/src/cli-ordinary.ts +197 -0
  56. package/src/cli.ts +25 -182
  57. package/src/commands/contribution-prep.ts +1 -3
  58. package/src/commands/sdk.ts +171 -21
  59. package/src/commands/update.ts +15 -1
  60. package/src/config/file-lock.ts +91 -2
  61. package/src/config/model-profile-activation.ts +70 -4
  62. package/src/config/model-profile-contract.ts +4 -1
  63. package/src/config/model-profiles.ts +23 -31
  64. package/src/config/model-resolver.ts +9 -1
  65. package/src/config/settings.ts +44 -4
  66. package/src/coordinator-mcp/event-webhook.ts +19 -14
  67. package/src/coordinator-mcp/policy.ts +14 -4
  68. package/src/coordinator-mcp/server.ts +142 -7
  69. package/src/coordinator-mcp/session-reaper.ts +9 -1
  70. package/src/defaults/gjc/skills/deep-interview/SKILL.md +1 -1
  71. package/src/discovery/helpers.ts +9 -3
  72. package/src/discovery/ssh.ts +8 -3
  73. package/src/edit/modes/replace.ts +6 -6
  74. package/src/edit/streaming.ts +15 -15
  75. package/src/exec/bash-shell-supervisor.ts +60 -3
  76. package/src/gjc-runtime/gc-runtime.ts +2 -1
  77. package/src/hindsight/config.ts +9 -3
  78. package/src/internal-urls/docs-index.generated.ts +11 -10
  79. package/src/memories/index.ts +8 -2
  80. package/src/modes/acp/acp-agent.ts +724 -370
  81. package/src/modes/components/tool-execution.ts +1 -1
  82. package/src/prompts/tools/ask.md +2 -0
  83. package/src/runtime-mcp/client.ts +13 -4
  84. package/src/runtime-mcp/elicitation.ts +142 -0
  85. package/src/sdk/broker/broker.ts +54 -1
  86. package/src/sdk/broker/daemon-entry.ts +67 -6
  87. package/src/sdk/broker/discovery.ts +8 -0
  88. package/src/sdk/broker/ensure.ts +156 -20
  89. package/src/sdk/broker/lifecycle-ledger.ts +110 -12
  90. package/src/sdk/broker/lifecycle.ts +334 -348
  91. package/src/sdk/broker/runtime.ts +5 -1
  92. package/src/sdk/broker/task-artifact-owner-validation.ts +259 -0
  93. package/src/sdk/broker/transport.ts +5 -1
  94. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  95. package/src/sdk/bus/chat-daemon-runtime.ts +3 -0
  96. package/src/sdk/bus/index.ts +3 -3
  97. package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
  98. package/src/sdk/bus/telegram-daemon-control.ts +15 -12
  99. package/src/sdk/bus/telegram-daemon.ts +38 -3
  100. package/src/sdk/cli/diagnostics-cli.ts +247 -0
  101. package/src/sdk/diagnostics/observe-broker.ts +654 -0
  102. package/src/sdk/host/control/dispatch.ts +52 -4
  103. package/src/sdk/host/control/operations.ts +1 -1
  104. package/src/sdk/host/host.ts +6 -0
  105. package/src/sdk/host/session-runtime.test.ts +83 -4
  106. package/src/sdk/host/session-runtime.ts +15 -7
  107. package/src/sdk/index.ts +1 -0
  108. package/src/sdk/lifecycle-session.ts +1 -0
  109. package/src/sdk/mcp/server.ts +15 -3
  110. package/src/sdk/protocol/operation-registry.ts +1 -1
  111. package/src/sdk/router/session-router.ts +26 -3
  112. package/src/sdk/session.ts +51 -8
  113. package/src/session/agent-session.ts +169 -43
  114. package/src/session/blob-store.ts +78 -33
  115. package/src/session/internal/managed-session-storage.ts +203 -4
  116. package/src/session/internal/task-artifact-owner-access.ts +229 -0
  117. package/src/session/internal/task-artifact-owner-transcript.ts +68 -0
  118. package/src/session/session-retirement.ts +155 -0
  119. package/src/session/session-storage.ts +1 -160
  120. package/src/session/session-transcript-header.ts +17 -0
  121. package/src/session/task-artifact-owner-codec.ts +578 -0
  122. package/src/session/task-artifact-owner-retirement.ts +475 -0
  123. package/src/session/task-artifact-owner.ts +289 -0
  124. package/src/setup/hermes/templates/operator-instructions.v1.md +19 -1
  125. package/src/setup/hermes-setup.ts +4 -1
  126. package/src/slash-commands/builtin-registry.ts +8 -5
  127. package/src/tools/ask-contract.test.ts +76 -1
  128. package/src/tools/ask-contract.ts +57 -6
  129. package/src/tools/ask.ts +16 -7
  130. package/src/tools/bash.ts +38 -29
  131. package/src/tools/descriptors.test.ts +29 -0
  132. package/src/tools/tool-catalog.generated.ts +7 -4
  133. package/src/web/search/index.ts +2 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,146 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.18.7] - 2026-10-04
6
+
7
+ ### Added
8
+
9
+ - Resolve readonly target-directory settings snapshots with normalized values and fresh operation-local metadata reads, without changing parent settings or publishing global hooks.
10
+
11
+ ### Changed
12
+
13
+ - Cut startup memory for the light CLI invocations by deferring the per-path modules out of the eager root command graph: peak RSS dropped from 32.4 MB to 27.7 MB for `--version` and from 32.7 MB to 28.0 MB for `--help`. The quick lane, the bash-shell guardian/supervisor/worker executors, the isolated shell, the tab-worker smoke probe and the fixture report now load only when their own path actually runs, so their behaviour, output and exit codes are unchanged.
14
+
15
+ ### Fixed
16
+
17
+ - `session.resume` of a session whose detached-idle host already exited no longer fails with `EEXIST` on `<id>.lifecycle.ready.json`: the host revokes its own ready marker on graceful exit, and a launch retires the same id's leftover ready/marker pair when the recorded owner is proven exited (a live or unknown owner still wins) (#6261).
18
+
19
+ - Settle active ACP prompts immediately when their SDK session host retires, while preserving prompts across same-generation attachment replacement instead of waiting for the inactivity watchdog.
20
+
21
+ - Apply ACP thinking-level changes through the session control setter so reasoning effort updates the live session state and session config readback reflects the requested level.
22
+
23
+ - ACP now rejects unsupported or unapplied thinking levels instead of reporting them as successful changes.
24
+
25
+ - Session heartbeat checkpoints no longer starve the SDK broker discovery heartbeat while waiting on the session-index lock.
26
+
27
+ - SDK broker readiness polling now uses the session-index change stamp instead of checkpointing live heartbeats and replaying the full index on every poll.
28
+
29
+ - `gjc config set|get|list` (text and `--json`) no longer print the Slack app-level token `notifications.slack.appToken` verbatim. Secret detection for setting keys now treats any key segment ending in a secret word (`token`, `secret`, `password`, `passwd`, `pwd`, `credential(s)`) as secret instead of relying on a fixed list of camelCase prefixes, so it shows `<redacted>` like every other token setting. Token-budget settings such as `compaction.reserveTokens` stay visible.
30
+
31
+ - Retry bare-default Codex overloads when the failed attempt contains only an empty unsigned thinking block.
32
+
33
+ - `HINDSIGHT_RETAIN_EVERY_N_TURNS`, `HINDSIGHT_RECALL_MAX_TOKENS`, `HINDSIGHT_RECALL_CONTEXT_TURNS` and `HINDSIGHT_RECALL_MAX_QUERY_CHARS` now accept only plain non-negative digits. Malformed values such as `5turns`, `1e3`, `1.5` or `-3` fall back to the matching `hindsight.*` setting instead of being read by `parseInt` as 5, 1, 1 or -3. A negative `HINDSIGHT_RETAIN_EVERY_N_TURNS` previously made chunked retention send nothing.
34
+
35
+ - Slack and Discord chat daemons no longer post every lean final answer twice. The host sends each turn frame on a positioned leg and a raw leg and drops the raw copy only for connections that negotiate `positioned_notification_effects_v1`; the chat daemons' session connections never did, and a lean final carries no `messageRef` to collapse the two copies onto one publication. Chat daemon session connections now negotiate positioned-only notification effects, while plain SDK observers such as `gjc sdk session tail` keep both surfaces.
36
+
37
+ - Answer modern MCP roots requests without requiring an interactive input handler, while keeping actual elicitation fail-closed when user input is unavailable.
38
+ - Connect supported MCP form requests to the session's user-input surface instead of failing before users can answer.
39
+
40
+ - SDK MCP initialize now negotiates supported protocol versions and includes the coding-agent package version in `serverInfo`.
41
+
42
+ - SSH hosts loaded from `ssh.json` no longer accept a malformed `port`. A string port must be plain digits and every port must be an integer from 1 to 65535, so `"22oops"`, `"+22"`, `2222.5`, `0` and `70000` are now dropped with an `Invalid port` warning (the host falls back to the default port) instead of being used as 22, 22, 2222.5, 0 and 70000.
43
+
44
+ ## [0.18.6] - 2026-10-03
45
+
46
+ ### Added
47
+
48
+ - 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.
49
+
50
+ - `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.
51
+
52
+ - `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.
53
+
54
+ ### Changed
55
+
56
+ - 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).
57
+ - `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).
58
+ - 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).
59
+ - 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).
60
+
61
+ - 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.
62
+
63
+ ### Removed
64
+
65
+ - 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).
66
+
67
+ ### Fixed
68
+
69
+ - 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).
70
+
71
+ - Run compound pipeline stages concurrently to prevent pipe-buffer deadlocks.
72
+ - Join remaining pipeline stages when a stage wait returns an error.
73
+
74
+ - 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.
75
+
76
+ - 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.
77
+ - 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.
78
+
79
+ - 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).
80
+ - Added an owner-fenced control wakeup for blocked Telegram polls and extended hard-termination cooperative grace before escalation (#6138).
81
+
82
+ - 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).
83
+
84
+ - Allow a fresh ACP prompt to wait for a previously failed or cancelled turn to finish winding down before reporting a busy conflict.
85
+ - Admit the next ACP prompt immediately after cancellation settles instead of requiring a retry.
86
+
87
+ - Scope ACP SDK session-router attachments to sessions owned or being attached by that ACP connection, preventing foreign session hosts from being kept alive.
88
+
89
+ - 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.
90
+
91
+ - 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).
92
+ - `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.
93
+
94
+ - 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.
95
+
96
+ - 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.
97
+
98
+ - `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.
99
+
100
+ - Reject active deep-interview questions missing structured round metadata instead of accepting answers that cannot be recorded, and reject extra interview questions before prompting.
101
+ - 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.
102
+
103
+ - 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.
104
+
105
+ - 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.
106
+
107
+ - `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).
108
+
109
+ - Bash commands with auto-background disabled no longer leave the foreground via the timeout fold timer after timing out.
110
+
111
+ - Lifecycle ledger compaction now evicts only safe settled identities while retaining unbound close replay fences and retirement-source dependencies.
112
+
113
+ - 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.
114
+
115
+ - Recover abandoned parseable lock removal transitions when their owner is proven dead.
116
+
117
+ - 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.
118
+
119
+ - Return an empty observation for missing assistant text instead of a resource-loss error, including compatibility with older running SDK hosts.
120
+
121
+ - Stubbed credential-pin methods in the login preset recommendation test mock (follow-up to #6025).
122
+
123
+ - 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.
124
+
125
+ - 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.
126
+
127
+ - 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.
128
+
129
+ - 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.
130
+
131
+ - 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.
132
+
133
+ - 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.
134
+
135
+ - `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`.
136
+
137
+ - `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.
138
+
139
+ - 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.
140
+
141
+ ### Tests
142
+
143
+ - 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).
144
+
5
145
  ## [0.18.5] - 2026-09-30
6
146
 
7
147
  ## [0.18.4] - 2026-09-30
@@ -39,6 +39,8 @@ export interface LoadContext {
39
39
  repoRoot: string | null;
40
40
  /** Whether discovery must remain isolated to the supplied home boundary. */
41
41
  isolatedHome?: boolean;
42
+ /** Bypass lexical filesystem caches for this discovery operation. */
43
+ bypassCache?: boolean;
42
44
  /** Owning session settings for provider policy decisions. */
43
45
  settings?: Settings;
44
46
  }
@@ -104,6 +106,8 @@ export interface LoadOptions {
104
106
  includeDisabledProviders?: boolean;
105
107
  /** Explicit disabled extension IDs to apply instead of settings. */
106
108
  disabledExtensions?: string[];
109
+ /** Bypass lexical filesystem caches for this discovery operation. */
110
+ bypassCache?: boolean;
107
111
  /** Session settings whose provider policy applies to this load. */
108
112
  settings?: Settings;
109
113
  /** Internal: prevent explicit-home loads from consulting process-global policy. */
@@ -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>;
@@ -1,6 +1,15 @@
1
1
  #!/usr/bin/env bun
2
- import type { CommandEntry } from "@gajae-code/utils/cli";
3
- /** Public-family hooks kept available for private-worker tests without loading the full registry. */
4
- export declare const commands: CommandEntry[];
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
  } | {
@@ -1,4 +1,5 @@
1
1
  import { Command } from "@gajae-code/utils/cli";
2
+ export declare function runUpdateRecoveryCommand(recover?: () => Promise<void>): Promise<void>;
2
3
  export default class Update extends Command {
3
4
  static description: string;
4
5
  static flags: {
@@ -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
  /**
@@ -179,6 +179,10 @@ export declare class Settings implements NotificationSettingsReader {
179
179
  flush(): Promise<void>;
180
180
  /** Like {@link flush}, but reports a durable save failure to the caller. */
181
181
  flushOrThrow(): Promise<void>;
182
+ /** Copy execution settings without reloading, persisting, or sharing mutable layers. */
183
+ snapshot(): Settings;
184
+ /** Resolve a retained execution's project layer without persistence or global hooks. */
185
+ snapshotForCwd(cwd: string): Promise<Settings>;
182
186
  cloneForCwd(cwd: string): Promise<Settings>;
183
187
  getStorage(): AgentStorage | null;
184
188
  /** Flush and close storage owned by an isolated settings scope. */
@@ -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. */
@@ -93,8 +93,8 @@ export declare function getUserSkillScanDirs(home: string, userAgentDir?: string
93
93
  */
94
94
  export declare function getProjectPath(ctx: LoadContext, source: SourceId, subpath: string): string | null;
95
95
  /** Build the filesystem authority for a provider read. */
96
- export declare function getReadOptions(ctx: Pick<LoadContext, "home" | "isolatedHome" | "userAgentDir" | "homeIdentity" | "userAgentIdentity">, scope: ReadScope): ReadFileOptions | undefined;
97
- export declare function getReadOptionsForContainment(ctx: Pick<LoadContext, "home" | "isolatedHome" | "userAgentDir" | "homeIdentity" | "userAgentIdentity">, scope: ReadScope, containmentRoot?: string): Promise<ReadFileOptions | undefined>;
96
+ export declare function getReadOptions(ctx: Pick<LoadContext, "home" | "isolatedHome" | "userAgentDir" | "homeIdentity" | "userAgentIdentity" | "bypassCache">, scope: ReadScope): ReadFileOptions | undefined;
97
+ export declare function getReadOptionsForContainment(ctx: Pick<LoadContext, "home" | "isolatedHome" | "userAgentDir" | "homeIdentity" | "userAgentIdentity" | "bypassCache">, scope: ReadScope, containmentRoot?: string): Promise<ReadFileOptions | undefined>;
98
98
  /**
99
99
  * Create source metadata for an item.
100
100
  */
@@ -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 progressive
5
- * fallback strategies for finding text in files.
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
- skipFunctionFallback?: boolean;
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
- * (`renderStreamingFallback`).
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
- renderStreamingFallback(args: Args, uiTheme: Theme): string;
54
+ renderStreamingPlaceholder(args: Args, uiTheme: Theme): string;
55
55
  }
56
56
  export interface EditRequestTargetInventory {
57
57
  paths: string[];
@@ -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;
@@ -0,0 +1,12 @@
1
+ import type { ExtensionUIContext } from "../extensibility/extensions/types";
2
+ import type { AskAnswerSource } from "../tools";
3
+ import type { MCPInputRequestHandler } from "./types";
4
+ export interface MCPFormInputDependencies {
5
+ getUi(): {
6
+ ui?: Pick<ExtensionUIContext, "select" | "input">;
7
+ hasUI: boolean;
8
+ };
9
+ getAskAnswerSource(): AskAnswerSource | undefined;
10
+ }
11
+ /** Register on an owned manager; dependencies are resolved per call for late UI registration. */
12
+ export declare function createMCPFormInputHandler(deps: MCPFormInputDependencies): MCPInputRequestHandler;
@@ -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>;
@@ -181,6 +181,15 @@ export declare function observeProcessForTest(pid: number, expectedIncarnation:
181
181
  * deliberately left untouched.
182
182
  */
183
183
  export declare function reapDeadLifecycleMarkers(root: string, limit?: number): Promise<number>;
184
+ /**
185
+ * Retires one launch id's lifecycle marker pair after its recorded owner has
186
+ * exited. Unlike the bounded background sweep, this launch-local repair is
187
+ * not age-gated and does not require the ready sibling to contain the same
188
+ * effect marker: the primary marker is the owner authority for this id.
189
+ */
190
+ type RetireExitedLifecycleMarkerPairHook = () => void | Promise<void>;
191
+ export declare function retireExitedLifecycleMarkerPair(root: string, id: string): Promise<boolean>;
192
+ export declare function retireExitedLifecycleMarkerPairForTest(root: string, id: string, afterObservation: RetireExitedLifecycleMarkerPairHook): Promise<boolean>;
184
193
  export declare function writeEffectMarker(root: string, id: string, marker: EffectMarker): Promise<void>;
185
194
  export declare class LifecycleReadinessCleanupError extends Error {
186
195
  constructor(cause: unknown);
@@ -1,4 +1,4 @@
1
- export type SdkInternalAction = "broker-internal" | "session-host-internal" | "stderr-drain-internal";
1
+ export type SdkInternalAction = "broker-internal" | "broker-trampoline-internal" | "session-host-internal" | "stderr-drain-internal";
2
2
  export type SdkInternalSpawnCommand = {
3
3
  kind: "bun-source";
4
4
  file: string;
@@ -0,0 +1,55 @@
1
+ import type { NativeExactUnlinkResult } from "@gajae-code/natives";
2
+ import { type TaskArtifactOwnerDeletionEvidence, type TaskArtifactOwnerRetirementContinuation, type TaskArtifactOwnerRetirementOutcome, type TaskArtifactOwnerStorageContext } from "../../session/task-artifact-owner-codec";
3
+ export type BrokerCleanupPhase = "artifacts" | "transcript" | "metadata" | "lifecycle";
4
+ /** Exact owner-disposition wire shape. Evidence and continuation are supplied separately by cleanup replay. */
5
+ export type BrokerTaskArtifactOwnerRetirementDisposition = {
6
+ readonly kind: "completed";
7
+ readonly nativeOutcome?: NativeExactUnlinkResult;
8
+ } | {
9
+ readonly kind: "payload_retired";
10
+ readonly namespace: "retained";
11
+ readonly nativeOutcome: NativeExactUnlinkResult;
12
+ } | {
13
+ readonly kind: "cleanup_pending";
14
+ readonly nativeOutcome?: NativeExactUnlinkResult;
15
+ } | {
16
+ readonly kind: "uncertain";
17
+ readonly reason: string;
18
+ readonly nativeOutcome?: NativeExactUnlinkResult;
19
+ };
20
+ /** Owner-only projection of durable cleanup state accepted by the pure validator. */
21
+ export interface BrokerTaskArtifactOwnerCleanupFields {
22
+ readonly taskArtifactOwnerDeletionEvidence?: unknown;
23
+ readonly taskArtifactOwnerRetirementContinuation?: unknown;
24
+ readonly taskArtifactOwnerRetirementOutcome?: unknown;
25
+ readonly taskArtifactOwnerPayloadRetired?: unknown;
26
+ readonly taskArtifactOwnerNamespaceRetained?: unknown;
27
+ readonly taskArtifactOwnerRetired?: unknown;
28
+ readonly taskArtifactOwnerTranscriptDeleted?: unknown;
29
+ readonly taskArtifactOwnerCleanupError?: unknown;
30
+ }
31
+ /** Fully decoded owner-only cleanup state for an authorized session and phase. */
32
+ export interface BrokerTaskArtifactOwnerCleanupValidation {
33
+ readonly deletionEvidence?: TaskArtifactOwnerDeletionEvidence;
34
+ readonly retirementContinuation?: TaskArtifactOwnerRetirementContinuation;
35
+ readonly retirementOutcome?: TaskArtifactOwnerRetirementOutcome;
36
+ readonly payloadRetired?: true;
37
+ readonly namespaceRetained?: true;
38
+ readonly retired?: true;
39
+ readonly transcriptDeleted?: true;
40
+ readonly cleanupDiagnostic?: string;
41
+ }
42
+ /**
43
+ * Decode the owner-only wire disposition using its exact trusted evidence and continuation.
44
+ * A decoded `completed` value is historical DTO data, not proof of physical retirement or writer closure.
45
+ */
46
+ export declare function parseBrokerTaskArtifactOwnerRetirementDisposition(value: unknown, context: TaskArtifactOwnerStorageContext, evidence: TaskArtifactOwnerDeletionEvidence, continuation: TaskArtifactOwnerRetirementContinuation | undefined): TaskArtifactOwnerRetirementOutcome;
47
+ /** Project an already validated internal outcome to the exact broker wire disposition. */
48
+ export declare function serializeBrokerTaskArtifactOwnerRetirementDisposition(outcome: TaskArtifactOwnerRetirementOutcome): BrokerTaskArtifactOwnerRetirementDisposition;
49
+ /**
50
+ * Strictly decode the owner-field projection of cleanup state against trusted session, scope context, phase,
51
+ * and artifact-removal state. Empty/legacy owner fields decode to an empty result. A decoded completion
52
+ * remains historical data: any later effect must separately verify current physical absence, fresh scrub
53
+ * proof, native success and current owner-parent/side-path authority before it mutates storage or transcripts.
54
+ */
55
+ export declare function decodeBrokerTaskArtifactOwnerCleanupFields(value: unknown, context: TaskArtifactOwnerStorageContext, expectedSessionId: string, phase: BrokerCleanupPhase, artifactsRemoved: boolean | undefined): BrokerTaskArtifactOwnerCleanupValidation;
@@ -292,7 +292,7 @@ export declare const SDK_LIFECYCLE_ROUTER_PROTOCOL_VERSION = 1;
292
292
  * Generation 193 gates streamed content on negotiated observer capabilities,
293
293
  * so existing owners are replaced before exposing the new observer path.
294
294
  */
295
- export declare const DAEMON_GENERATION = 199;
295
+ export declare const DAEMON_GENERATION = 200;
296
296
  /**
297
297
  * Serving-compatibility boundary for daemon lifecycle requests. Epoch 7
298
298
  * requires durable publication receipts and acknowledged attachment dispatch,
@@ -9,6 +9,7 @@ import { type DaemonProcessReference } from "./telegram-daemon-control";
9
9
  import { type TelegramSetupPreflight } from "./telegram-setup";
10
10
  export { loadInstallationHostId, loadLegacyInstallationHostId, type MachineIdentityDeps, parseMacPlatformUuid, parseWindowsMachineGuid, } from "../../config/machine-identity";
11
11
  export { DAEMON_GENERATION, NOTIFICATION_EVENT_SCHEMA_VERSION, NOTIFICATION_PROTOCOL_VERSION, SDK_LIFECYCLE_ROUTER_PROTOCOL_VERSION, SERVING_EPOCH, TELEGRAM_TRANSPORT_GENERATION, } from "./telegram-daemon-contract";
12
+ import { POSITIONED_NOTIFICATION_EFFECTS_CAPABILITY } from "../host/host";
12
13
  import { type AgentDirSessionLifecycleService } from "../lifecycle/client";
13
14
  import { type NotificationSubscription, type SessionRouterProviderDeps } from "../router/session-router";
14
15
  import { NotificationOperatorRuntime } from "./operator-runtime";
@@ -136,8 +137,8 @@ export declare const ASK_CONTROLS_CAPABILITY = "ask_controls_v1";
136
137
  export declare const TOOL_ACTIVITY_CAPABILITY = "tool_activity_v2";
137
138
  /** Receive-only compatibility capability for pre-v2 hosts. */
138
139
  export declare const LEGACY_TOOL_ACTIVITY_CAPABILITY = "tool_activity_v1";
139
- /** Opts notification adapters into positioned-only delivery for matching live effects. */
140
- export declare const POSITIONED_NOTIFICATION_EFFECTS_CAPABILITY = "positioned_notification_effects_v1";
140
+ /** Public `sdk/bus/telegram-daemon` path for the canonical `sdk/host` capability token. */
141
+ export { POSITIONED_NOTIFICATION_EFFECTS_CAPABILITY };
141
142
  /**
142
143
  * File-lock options whose acquisition budget covers the full reload-reservation
143
144
  * critical section: the in-lock freshness poll plus the controller's
@@ -1181,4 +1182,5 @@ export declare class TelegramNotificationDaemon {
1181
1182
  run(): Promise<void>;
1182
1183
  /** True when a signal-driven stop or an owner-scoped control request asks the loop to exit. */
1183
1184
  private controlStopRequested;
1185
+ private checkControlStopRequested;
1184
1186
  }
@@ -0,0 +1,18 @@
1
+ /** Isolated `gjc sdk diagnostics` parser and renderer.
2
+ *
3
+ * Reached from the inert entry before any effectful branch, so this module must
4
+ * stay a pure leaf: no command registry, session CLI, runtime globals, managed
5
+ * owner admission, malloc guard, evidence publisher, broker client, directory
6
+ * resolver or logger import. Help and usage never resolve a root or open a file,
7
+ * and every outcome is a fixed bounded string with a fixed exit code.
8
+ *
9
+ * Observation itself must never start, ensure, retire, restart or recover a
10
+ * broker. The read-only observation facade (DESIGN §B3) is wired: `observe()`
11
+ * below routes to it and to nothing else, so this command can report only what a
12
+ * supporting broker publishes to the read-only reader. An unsupported runtime
13
+ * tuple, a missing or mismatched native artifact and an old broker without a
14
+ * published generation all still fail closed with the fixed `unsupported`
15
+ * outcome.
16
+ */
17
+ /** Run `gjc sdk diagnostics <argv…>`; argv excludes the `sdk diagnostics` prefix. */
18
+ export declare function runDiagnosticsCli(argv: readonly string[]): Promise<void>;