@gajae-code/coding-agent 0.19.3-nightly.20261030094347.41301593972.gf536b1010d4e → 0.19.3

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 (273) hide show
  1. package/CHANGELOG.md +238 -0
  2. package/dist/types/async/job-manager.d.ts +56 -18
  3. package/dist/types/cli/auth-token-file.d.ts +9 -0
  4. package/dist/types/cli/doctor/install-repairs.d.ts +1 -0
  5. package/dist/types/cli/doctor/types.d.ts +1 -0
  6. package/dist/types/cli/install-activation.d.ts +10 -1
  7. package/dist/types/cli/malloc-env-guard.d.ts +8 -0
  8. package/dist/types/cli/update-cli.d.ts +4 -1
  9. package/dist/types/config/atomic-yaml-patch.d.ts +34 -1
  10. package/dist/types/config/model-profile-activation.d.ts +40 -13
  11. package/dist/types/config/model-registry.d.ts +3 -0
  12. package/dist/types/config/models-config-schema.d.ts +4 -0
  13. package/dist/types/config/settings-schema.d.ts +49 -8
  14. package/dist/types/config/settings.d.ts +39 -5
  15. package/dist/types/config/task-delegation.d.ts +2 -0
  16. package/dist/types/extensibility/extensions/runner.d.ts +2 -0
  17. package/dist/types/extensibility/slash-commands.d.ts +14 -1
  18. package/dist/types/gjc-runtime/managed-owner-admission.d.ts +4 -12
  19. package/dist/types/gjc-runtime/managed-owner-binding.d.ts +164 -0
  20. package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +26 -33
  21. package/dist/types/gjc-runtime/owner-lifecycle-path.d.ts +21 -0
  22. package/dist/types/gjc-runtime/owner-lifecycle-root.d.ts +7 -0
  23. package/dist/types/gjc-runtime/session-state-sidecar.d.ts +8 -1
  24. package/dist/types/gjc-runtime/tmux-common.d.ts +10 -0
  25. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +131 -5
  26. package/dist/types/gjc-runtime/tmux-sessions.d.ts +46 -0
  27. package/dist/types/gjc-runtime/ultragoal-owner-loss-recovery.d.ts +1 -1
  28. package/dist/types/harness-control-plane/session-lease.d.ts +29 -2
  29. package/dist/types/harness-control-plane/storage.d.ts +8 -0
  30. package/dist/types/main.d.ts +12 -0
  31. package/dist/types/memories/index.d.ts +7 -1
  32. package/dist/types/memories/storage.d.ts +1 -0
  33. package/dist/types/memory-backend/types.d.ts +6 -1
  34. package/dist/types/modes/components/model-selector.d.ts +11 -4
  35. package/dist/types/modes/components/notifications-settings-editor.d.ts +2 -166
  36. package/dist/types/modes/components/settings-defs.d.ts +2 -1
  37. package/dist/types/modes/components/settings-selector.d.ts +5 -2
  38. package/dist/types/modes/components/smart-routing-panel.d.ts +19 -14
  39. package/dist/types/modes/components/tool-execution.d.ts +6 -0
  40. package/dist/types/modes/controllers/goal-mode-controller.d.ts +5 -0
  41. package/dist/types/modes/controllers/selector-controller.d.ts +7 -59
  42. package/dist/types/plan-mode/state.d.ts +7 -0
  43. package/dist/types/runtime-mcp/config.d.ts +8 -0
  44. package/dist/types/runtime-mcp/manager.d.ts +43 -0
  45. package/dist/types/runtime-mcp/session-controls-grant.d.ts +7 -0
  46. package/dist/types/sdk/broker/broker.d.ts +33 -7
  47. package/dist/types/sdk/broker/lifecycle.d.ts +1 -0
  48. package/dist/types/sdk/broker/session-index.d.ts +2 -0
  49. package/dist/types/sdk/broker/session-scope.d.ts +31 -1
  50. package/dist/types/sdk/broker/spawn-authority.d.ts +19 -0
  51. package/dist/types/sdk/broker/spawn-substrate.d.ts +12 -1
  52. package/dist/types/sdk/bus/index.d.ts +5 -0
  53. package/dist/types/sdk/bus/notification-orchestration.d.ts +21 -3
  54. package/dist/types/sdk/bus/notification-service.d.ts +2 -1
  55. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
  56. package/dist/types/sdk/cli/rows.d.ts +7 -0
  57. package/dist/types/sdk/extension-interaction.d.ts +108 -0
  58. package/dist/types/sdk/host/control/btw-ask.d.ts +19 -0
  59. package/dist/types/sdk/host/control/dispatch.d.ts +2 -0
  60. package/dist/types/sdk/host/control/index.d.ts +1 -0
  61. package/dist/types/sdk/host/control/operations.d.ts +7 -0
  62. package/dist/types/sdk/host/external-permissions.d.ts +47 -0
  63. package/dist/types/sdk/host/host.d.ts +8 -2
  64. package/dist/types/sdk/host/query/handlers.d.ts +1 -0
  65. package/dist/types/sdk/host/session-runtime.d.ts +13 -1
  66. package/dist/types/sdk/host/surface-policy.d.ts +2 -1
  67. package/dist/types/sdk/index.d.ts +11 -0
  68. package/dist/types/sdk/job-observation.d.ts +51 -0
  69. package/dist/types/sdk/lifecycle/service.d.ts +6 -1
  70. package/dist/types/sdk/notification-setup-contract.d.ts +169 -0
  71. package/dist/types/sdk/notification-setup.d.ts +54 -0
  72. package/dist/types/sdk/protocol/adapter-validation.d.ts +2 -0
  73. package/dist/types/sdk/router/session-router.d.ts +5 -0
  74. package/dist/types/sdk/routing-settings.d.ts +57 -0
  75. package/dist/types/sdk/session-list.d.ts +5 -0
  76. package/dist/types/sdk/session-recap.d.ts +50 -0
  77. package/dist/types/sdk/session.d.ts +14 -0
  78. package/dist/types/sdk/settings-catalog.d.ts +52 -0
  79. package/dist/types/sdk/workflow-gates.d.ts +9 -0
  80. package/dist/types/session/agent-session.d.ts +129 -15
  81. package/dist/types/session/client-bridge.d.ts +1 -0
  82. package/dist/types/session/internal/managed-session-storage.d.ts +6 -0
  83. package/dist/types/session/recap.d.ts +104 -0
  84. package/dist/types/session/session-manager.d.ts +51 -1
  85. package/dist/types/session/streaming-output.d.ts +9 -1
  86. package/dist/types/session/workflow-recovery-field-fence.d.ts +4 -0
  87. package/dist/types/session/yield-queue.d.ts +16 -0
  88. package/dist/types/task/executor.d.ts +2 -0
  89. package/dist/types/tools/auto-generated-guard.d.ts +8 -1
  90. package/dist/types/tools/bash.d.ts +1 -1
  91. package/dist/types/tools/grouped-file-tree.d.ts +21 -0
  92. package/dist/types/tools/image-gen.d.ts +6 -1
  93. package/dist/types/tools/index.d.ts +7 -0
  94. package/dist/types/tui/file-list.d.ts +0 -3
  95. package/dist/types/utils/gh.d.ts +5 -0
  96. package/dist/types/utils/herdr-core-status.d.ts +31 -0
  97. package/dist/types/utils/herdr-pane.d.ts +7 -0
  98. package/dist/types/utils/recap-generator.d.ts +41 -0
  99. package/dist/types/web/hardened-http.d.ts +41 -0
  100. package/dist/types/web/insane/url-guard.d.ts +2 -0
  101. package/package.json +7 -7
  102. package/scripts/generate-sdk-operation-inventory.ts +28 -1
  103. package/src/async/job-manager.ts +381 -41
  104. package/src/cli/auth-broker-cli.ts +11 -53
  105. package/src/cli/auth-gateway-cli.ts +13 -56
  106. package/src/cli/auth-token-file.ts +56 -0
  107. package/src/cli/customize-doctor.ts +40 -27
  108. package/src/cli/doctor/install-repairs.ts +36 -2
  109. package/src/cli/doctor/repairs.ts +1 -0
  110. package/src/cli/doctor/report.ts +2 -0
  111. package/src/cli/doctor/types.ts +1 -0
  112. package/src/cli/install-activation.ts +58 -1
  113. package/src/cli/malloc-env-guard.ts +11 -0
  114. package/src/cli/session-picker.ts +8 -2
  115. package/src/cli/setup-cli.ts +2 -0
  116. package/src/cli/update-cli.ts +48 -3
  117. package/src/cli-main.ts +2 -2
  118. package/src/cli-ordinary.ts +2 -2
  119. package/src/commands/harness.ts +16 -3
  120. package/src/config/atomic-yaml-patch.ts +439 -141
  121. package/src/config/machine-identity.ts +6 -2
  122. package/src/config/mcp-schema.json +1 -1
  123. package/src/config/model-profile-activation.ts +505 -248
  124. package/src/config/model-registry.ts +54 -2
  125. package/src/config/models-config-schema.ts +2 -0
  126. package/src/config/settings-schema.ts +52 -8
  127. package/src/config/settings.ts +640 -237
  128. package/src/config/task-delegation.ts +4 -1
  129. package/src/coordinator-mcp/question-gate-codec.ts +17 -5
  130. package/src/coordinator-mcp/server.ts +2 -0
  131. package/src/extensibility/extensions/runner.ts +6 -0
  132. package/src/extensibility/gjc-plugins/installer.ts +2 -1
  133. package/src/extensibility/plugins/marketplace/fetcher.ts +28 -119
  134. package/src/extensibility/slash-commands.ts +90 -16
  135. package/src/gjc-runtime/launch-tmux.ts +79 -23
  136. package/src/gjc-runtime/launch-worktree.ts +15 -3
  137. package/src/gjc-runtime/managed-owner-admission.ts +298 -212
  138. package/src/gjc-runtime/managed-owner-binding.ts +410 -0
  139. package/src/gjc-runtime/managed-owner-supervisor.ts +265 -112
  140. package/src/gjc-runtime/owner-lifecycle-path.ts +82 -0
  141. package/src/gjc-runtime/owner-lifecycle-root.ts +26 -0
  142. package/src/gjc-runtime/ralplan-current-final.ts +35 -15
  143. package/src/gjc-runtime/ralplan-runtime.ts +3 -0
  144. package/src/gjc-runtime/session-state-sidecar.ts +61 -28
  145. package/src/gjc-runtime/tmux-common.ts +28 -0
  146. package/src/gjc-runtime/tmux-owner-isolation.ts +1100 -111
  147. package/src/gjc-runtime/tmux-sessions.ts +293 -58
  148. package/src/gjc-runtime/ultragoal-change-set.ts +8 -1
  149. package/src/gjc-runtime/ultragoal-owner-loss-recovery.ts +1 -1
  150. package/src/harness-control-plane/finalize.ts +2 -0
  151. package/src/harness-control-plane/owner.ts +23 -1
  152. package/src/harness-control-plane/preserve.ts +7 -1
  153. package/src/harness-control-plane/session-lease.ts +357 -3
  154. package/src/harness-control-plane/storage.ts +61 -10
  155. package/src/hashline/execute.ts +13 -1
  156. package/src/internal-urls/docs-index.generated.ts +12 -12
  157. package/src/lsp/lspmux.ts +4 -0
  158. package/src/main.ts +44 -3
  159. package/src/master-mode/snapshot.ts +13 -1
  160. package/src/memories/index.ts +8 -1
  161. package/src/memories/storage.ts +1 -0
  162. package/src/memory-backend/types.ts +6 -1
  163. package/src/modes/acp/acp-agent.ts +28 -4
  164. package/src/modes/components/gjc-bundle-settings.ts +56 -14
  165. package/src/modes/components/model-selector.ts +98 -18
  166. package/src/modes/components/notifications-settings-editor.ts +68 -188
  167. package/src/modes/components/session-selector.ts +27 -5
  168. package/src/modes/components/settings-defs.ts +4 -10
  169. package/src/modes/components/settings-selector.ts +93 -66
  170. package/src/modes/components/smart-routing-panel.ts +363 -48
  171. package/src/modes/components/tool-execution.ts +388 -9
  172. package/src/modes/controllers/event-controller.ts +2 -1
  173. package/src/modes/controllers/extension-ui-controller.ts +2 -1
  174. package/src/modes/controllers/goal-mode-controller.ts +24 -0
  175. package/src/modes/controllers/plan-mode-controller.ts +11 -3
  176. package/src/modes/controllers/selector-controller.ts +127 -1242
  177. package/src/modes/interactive-mode.ts +44 -3
  178. package/src/modes/runtime-init.ts +2 -1
  179. package/src/modes/shared/agent-wire/approval-gate.ts +13 -2
  180. package/src/modes/shared/agent-wire/deep-interview-gate.ts +2 -4
  181. package/src/plan-mode/state.ts +17 -0
  182. package/src/prompts/system/master-mode.md +2 -0
  183. package/src/prompts/system/recap-system.md +5 -0
  184. package/src/prompts/system/system-prompt.md +5 -1
  185. package/src/prompts/tools/ask.md +4 -3
  186. package/src/runtime-mcp/config.ts +20 -1
  187. package/src/runtime-mcp/manager.ts +588 -45
  188. package/src/runtime-mcp/session-controls-grant.ts +24 -0
  189. package/src/sdk/acp/adapter.ts +14 -3
  190. package/src/sdk/broker/broker.ts +237 -23
  191. package/src/sdk/broker/lifecycle.ts +2 -0
  192. package/src/sdk/broker/session-index.ts +93 -19
  193. package/src/sdk/broker/session-scope.ts +81 -2
  194. package/src/sdk/broker/spawn-authority.ts +34 -5
  195. package/src/sdk/broker/spawn-substrate.ts +117 -18
  196. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  197. package/src/sdk/bus/index.ts +77 -11
  198. package/src/sdk/bus/notification-orchestration.ts +141 -59
  199. package/src/sdk/bus/notification-service.ts +25 -23
  200. package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
  201. package/src/sdk/cli/master-cli.ts +2 -2
  202. package/src/sdk/cli/rows.ts +9 -0
  203. package/src/sdk/cli/session-cli.ts +29 -4
  204. package/src/sdk/extension-interaction.ts +533 -0
  205. package/src/sdk/host/control/btw-ask.ts +49 -0
  206. package/src/sdk/host/control/dispatch.ts +12 -0
  207. package/src/sdk/host/control/index.ts +1 -0
  208. package/src/sdk/host/control/operations.ts +7 -0
  209. package/src/sdk/host/external-permissions.ts +332 -0
  210. package/src/sdk/host/host.ts +8 -2
  211. package/src/sdk/host/query/handlers.ts +9 -0
  212. package/src/sdk/host/sdk-surface-parity.test.ts +55 -1
  213. package/src/sdk/host/session-runtime.test.ts +142 -1
  214. package/src/sdk/host/session-runtime.ts +108 -28
  215. package/src/sdk/host/surface-policy.ts +11 -0
  216. package/src/sdk/index.ts +15 -0
  217. package/src/sdk/job-observation.ts +157 -0
  218. package/src/sdk/lifecycle/service.ts +15 -2
  219. package/src/sdk/notification-setup-contract.ts +181 -0
  220. package/src/sdk/notification-setup.ts +1151 -0
  221. package/src/sdk/protocol/adapter-validation.ts +6 -1
  222. package/src/sdk/protocol/operation-inventory.generated.json +239 -6
  223. package/src/sdk/protocol/operation-registry.ts +21 -3
  224. package/src/sdk/router/session-router.ts +12 -1
  225. package/src/sdk/routing-settings.ts +395 -0
  226. package/src/sdk/session-list.ts +37 -0
  227. package/src/sdk/session-recap.ts +121 -0
  228. package/src/sdk/session.ts +335 -23
  229. package/src/sdk/settings-catalog.ts +119 -0
  230. package/src/sdk/workflow-gates.ts +30 -0
  231. package/src/session/agent-session.ts +1880 -238
  232. package/src/session/client-bridge.ts +1 -1
  233. package/src/session/contribution-prep.ts +8 -1
  234. package/src/session/internal/managed-session-storage.ts +17 -3
  235. package/src/session/recap.ts +298 -0
  236. package/src/session/session-manager.ts +776 -121
  237. package/src/session/streaming-output.ts +69 -9
  238. package/src/session/workflow-recovery-field-fence.ts +27 -0
  239. package/src/session/yield-queue.ts +52 -1
  240. package/src/setup/provider-presets.json +3 -1
  241. package/src/slash-commands/builtin-registry.ts +124 -4
  242. package/src/ssh/connection-manager.ts +3 -2
  243. package/src/ssh/ssh-executor.ts +3 -0
  244. package/src/ssh/sshfs-mount.ts +5 -4
  245. package/src/task/executor.ts +3 -0
  246. package/src/task/index.ts +48 -19
  247. package/src/tools/ast-edit.ts +10 -47
  248. package/src/tools/ast-grep.ts +10 -45
  249. package/src/tools/auto-generated-guard.ts +21 -1
  250. package/src/tools/bash-allowed-prefixes.ts +2 -0
  251. package/src/tools/bash.ts +10 -4
  252. package/src/tools/bisect.ts +5 -0
  253. package/src/tools/browser/launch.ts +7 -2
  254. package/src/tools/browser/registry.ts +5 -0
  255. package/src/tools/grouped-file-tree.ts +86 -0
  256. package/src/tools/image-gen.ts +180 -174
  257. package/src/tools/index.ts +7 -0
  258. package/src/tools/json-tree.ts +2 -2
  259. package/src/tools/recipe/runners/cargo.ts +3 -0
  260. package/src/tools/recipe/runners/just.ts +3 -0
  261. package/src/tools/recipe/runners/task.ts +3 -0
  262. package/src/tools/search.ts +9 -48
  263. package/src/tools/tool-catalog.generated.ts +1 -1
  264. package/src/tui/file-list.ts +14 -3
  265. package/src/utils/gh.ts +14 -1
  266. package/src/utils/git.ts +1 -8
  267. package/src/utils/herdr-core-status.ts +156 -0
  268. package/src/utils/herdr-pane.ts +38 -26
  269. package/src/utils/recap-generator.ts +191 -0
  270. package/src/web/hardened-http.ts +183 -0
  271. package/src/web/insane/bridge.ts +2 -1
  272. package/src/web/insane/url-guard.ts +7 -2
  273. package/src/web/scrapers/youtube.ts +3 -0
@@ -1,169 +1,5 @@
1
- import { type Component, type Focusable, type SecretValue } from "@gajae-code/tui";
2
- import type { CasReceipt } from "../../config/atomic-yaml-patch";
3
- import type { NotificationProvider, ProviderSecretDisposition } from "../../sdk/bus/config";
4
- import type { BlockedTelegramRestoreResult, ProposedTelegramIdentity, TelegramDaemonReconnectOutcome } from "../../sdk/bus/notification-orchestration";
5
- import type { NotificationHealthReport, NotificationRecoveryReport, NotificationStatusReport, NotificationTestResult } from "../../sdk/bus/notification-service";
6
- import type { NotificationSessionReconcileResult, NotificationSessionStatus } from "../../sdk/bus/session-control";
7
- /** Safe scalar notification preferences. Credentials and destination IDs are deliberately absent. */
8
- export interface NotificationsEditorPreferences {
9
- redact: boolean;
10
- verbosity: "lean" | "verbose";
11
- sessionScope: "all" | "primary";
12
- richEnabled: boolean;
13
- richDraftEnabled: boolean;
14
- toolActivityEnabled: boolean;
15
- streamingEnabled: boolean;
16
- sound: "all" | "important" | "none";
17
- }
18
- /** Secret-safe snapshot used to render the Notifications tab. */
19
- export interface NotificationsEditorState {
20
- status: NotificationStatusReport;
21
- session: NotificationSessionStatus;
22
- preferences: NotificationsEditorPreferences;
23
- health?: NotificationHealthReport;
24
- }
25
- /**
26
- * A one-way setup value accepted from the masked input. The operation adapter
27
- * consumes the secret and returns a safe-to-render prepared draft.
28
- */
29
- export interface NotificationsEditorSetupInput {
30
- token: SecretValue;
31
- /** Optional: omit to use daemon-aware private-chat discovery when polling is safe. */
32
- chatId?: string;
33
- richEnabled: boolean;
34
- richDraftEnabled: boolean;
35
- streamingEnabled: boolean;
36
- }
37
- /**
38
- * Secret-safe setup draft. The adapter may retain its private credential while
39
- * this object is live, but no raw token is exposed through this contract.
40
- */
41
- export interface PreparedTelegramConfiguration {
42
- chatId: string;
43
- tokenMask: string;
44
- tokenFingerprint?: string;
45
- richEnabled: boolean;
46
- richDraftEnabled: boolean;
47
- streamingEnabled: boolean;
48
- }
49
- export interface ProviderSecretActionInput {
50
- action: ProviderSecretDisposition;
51
- value?: SecretValue;
52
- }
53
- export interface NotificationsProviderSetupInput {
54
- provider: "discord" | "slack";
55
- botToken: ProviderSecretActionInput;
56
- appToken?: ProviderSecretActionInput;
57
- applicationId?: string;
58
- guildId?: string;
59
- parentChannelId?: string;
60
- workspaceId?: string;
61
- channelId?: string;
62
- authorizedUserId?: string;
63
- }
64
- export interface PreparedNotificationProviderConfiguration {
65
- provider: "discord" | "slack";
66
- botTokenDisposition: ProviderSecretDisposition;
67
- botTokenMask: string;
68
- appTokenDisposition?: ProviderSecretDisposition;
69
- appTokenMask?: string;
70
- applicationId?: string;
71
- guildId?: string;
72
- parentChannelId?: string;
73
- workspaceId?: string;
74
- channelId?: string;
75
- authorizedUserId?: string;
76
- applicationIdDisplay?: string;
77
- guildIdDisplay?: string;
78
- parentChannelIdDisplay?: string;
79
- workspaceIdDisplay?: string;
80
- channelIdDisplay?: string;
81
- authorizedUserIdDisplay?: string;
82
- }
83
- export interface NotificationsPreflightResult {
84
- status: "ready" | "aborted" | "cancelled" | "error";
85
- identity: ProposedTelegramIdentity;
86
- message: string;
87
- pairingSource?: "discovered" | "provided" | "reused";
88
- draft?: PreparedTelegramConfiguration;
89
- }
90
- /** A successful configuration save always carries an opaque CAS receipt. */
91
- export type NotificationsConfigureCommitResult = {
92
- status: "saved";
93
- receipt: CasReceipt;
94
- message: string;
95
- } | {
96
- status: "activation_failed" | "observer_failed";
97
- receipt: CasReceipt;
98
- message: string;
99
- } | {
100
- status: "blocked_identity";
101
- receipt: CasReceipt;
102
- message: string;
103
- restore(): Promise<BlockedTelegramRestoreResult>;
104
- retainCommitted(): void;
105
- };
106
- export interface NotificationsMutationResult {
107
- message: string;
108
- receipt?: CasReceipt;
109
- outcome?: "success" | "degraded" | "failed";
110
- }
111
- export type NotificationsSaveInactiveResult = {
112
- status: "saved_inactive";
113
- receipt: CasReceipt;
114
- message: string;
115
- } | {
116
- status: "observer_failed";
117
- receipt: CasReceipt;
118
- message: string;
119
- } | {
120
- status: "unavailable";
121
- guidance: string;
122
- };
123
- /**
124
- * Controller-injected boundary for the direct Notifications editor.
125
- *
126
- * The component only renders this contract and sends user intent through it:
127
- * it never reads Settings, starts a daemon, or calls notification services.
128
- */
129
- export interface NotificationsEditorOperations {
130
- /** Combines a buildNotificationStatusReport-shaped status snapshot with the current session-control query. */
131
- loadState(): Promise<NotificationsEditorState>;
132
- /** Performs offline or selected REST-only health refresh. */
133
- refreshHealth(input: {
134
- probe: boolean;
135
- provider?: NotificationProvider;
136
- signal?: AbortSignal;
137
- }): Promise<NotificationHealthReport>;
138
- sendTest(provider?: NotificationProvider): Promise<NotificationTestResult>;
139
- recover(): Promise<NotificationRecoveryReport>;
140
- reconnect(): Promise<TelegramDaemonReconnectOutcome>;
141
- /** Validates/discovers a Telegram destination and returns a secret-safe prepared draft. */
142
- preflightProposedIdentity(input: NotificationsEditorSetupInput, signal: AbortSignal): Promise<NotificationsPreflightResult>;
143
- /** Atomically persists a prepared Telegram configuration and returns its CAS-backed receipt. */
144
- commitConfigure(draft: PreparedTelegramConfiguration): Promise<NotificationsConfigureCommitResult>;
145
- /** Stores a prepared Telegram configuration inactive when the mixed-adapter rule permits it. */
146
- saveInactive(draft: PreparedTelegramConfiguration): Promise<NotificationsSaveInactiveResult>;
147
- /** Clears adapter-local ephemeral credential material for a prepared setup draft. Idempotent. */
148
- discardConfigureDraft(draft: PreparedTelegramConfiguration): void;
149
- prepareProviderConfiguration(input: NotificationsProviderSetupInput): Promise<PreparedNotificationProviderConfiguration>;
150
- commitProviderConfiguration(draft: PreparedNotificationProviderConfiguration): Promise<NotificationsMutationResult>;
151
- discardProviderConfiguration(draft: PreparedNotificationProviderConfiguration): void;
152
- setProviderDesired(provider: NotificationProvider, enabled: boolean): Promise<NotificationsMutationResult>;
153
- removeProvider(provider: NotificationProvider): Promise<NotificationsMutationResult>;
154
- /** Enables globally without requesting or exposing a credential. */
155
- enableGlobally(): Promise<NotificationsMutationResult>;
156
- disableGlobally(): Promise<NotificationsMutationResult>;
157
- /** Removes only Telegram configuration; the adapter preserves Discord/Slack when configured. */
158
- removeTelegram(): Promise<NotificationsMutationResult & {
159
- globallyDisabled?: boolean;
160
- }>;
161
- setSessionLocal(enabled: boolean): Promise<NotificationSessionReconcileResult>;
162
- /** Atomically persists the scalar preference draft. */
163
- commitPreferences(preferences: NotificationsEditorPreferences): Promise<NotificationsMutationResult>;
164
- /** Reconciles the current session after durable global configuration changes. */
165
- reconcileCurrentSession(): Promise<NotificationSessionReconcileResult>;
166
- }
1
+ import { type Component, type Focusable } from "@gajae-code/tui";
2
+ import type { NotificationsEditorOperations } from "../../sdk/notification-setup-contract";
167
3
  export interface NotificationsSettingsEditorCallbacks {
168
4
  onCancel?: () => void;
169
5
  }
@@ -7,6 +7,7 @@
7
7
  * with a `ui` block. If it needs a submenu, include `options: [...]`
8
8
  * (or `options: "runtime"` for runtime-injected lists like themes).
9
9
  */
10
+ import type { Settings } from "../../config/settings";
10
11
  import { type SettingPath, type SettingTab, type SubmenuOption } from "../../config/settings-schema";
11
12
  export type SettingValue = boolean | string;
12
13
  interface BaseSettingDef {
@@ -19,7 +20,7 @@ interface BaseSettingDef {
19
20
  * setting is hidden from the UI. Applies to every variant — booleans,
20
21
  * enums, submenus, and text inputs.
21
22
  */
22
- condition?: () => boolean;
23
+ condition?: (settings: Settings) => boolean;
23
24
  }
24
25
  export interface BooleanSettingDef extends BaseSettingDef {
25
26
  type: "boolean";
@@ -1,16 +1,18 @@
1
1
  import { type ThinkingLevel as ThinkingLevelValue } from "@gajae-code/agent-core";
2
2
  import type { Effort } from "@gajae-code/ai/core";
3
3
  import { type Component, Container } from "@gajae-code/tui";
4
- import { type SettingPath } from "../../config/settings";
4
+ import type { SettingPath, Settings } from "../../config/settings";
5
5
  import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../config/settings-schema";
6
6
  import type { GjcRuntimeSnapshotProvider } from "../../extensibility/gjc-plugins/runtime-quarantine";
7
- import { type NotificationsEditorOperations } from "./notifications-settings-editor";
7
+ import type { NotificationsEditorOperations } from "../../sdk/notification-setup-contract";
8
8
  import type { StatusLinePreviewParts, StatusLineSegmentOptions } from "./tool-status-header";
9
9
  /**
10
10
  * Dynamic context for settings that need runtime data.
11
11
  * Some settings (like thinking level) are managed by the session, not Settings.
12
12
  */
13
13
  export interface SettingsRuntimeContext {
14
+ /** Settings owned by the active session. */
15
+ settings: Settings;
14
16
  /** Available thinking levels (from session) */
15
17
  availableThinkingLevels: Effort[];
16
18
  /** Current thinking level (from session) */
@@ -99,6 +101,7 @@ export declare class SettingsSelectorComponent extends Container {
99
101
  private readonly context;
100
102
  private readonly callbacks;
101
103
  private readonly notificationsOperations?;
104
+ get settings(): Settings;
102
105
  constructor(context: SettingsRuntimeContext, callbacks: SettingsCallbacks, notificationsOperations?: NotificationsEditorOperations | undefined);
103
106
  getFocusComponent(): Component;
104
107
  /** Refresh saved rows and model-profile choices without replacing active editors. */
@@ -1,21 +1,16 @@
1
1
  import { Container } from "@gajae-code/tui";
2
2
  import type { AutoroutingProvenance, AutoroutingProviderOrderHint, AutoroutingSetup, TierMap } from "../../config/autorouting-contract";
3
- import type { AutoroutingSourceIdentity } from "../../config/autorouting-generator";
3
+ import { type RoutingSettingsPreview } from "../../sdk/routing-settings";
4
4
  /** Longest rendered panel line before truncation. */
5
5
  export declare const MAX_PANEL_LINE_WIDTH = 200;
6
- export type SmartRoutingPreview = {
7
- readonly setup: AutoroutingSetup;
8
- readonly tiers: TierMap;
9
- readonly provenance: AutoroutingProvenance;
10
- readonly sourceIdentity: AutoroutingSourceIdentity;
11
- };
12
6
  export type SmartRoutingIntent = {
13
7
  kind: "apply";
14
8
  draft: AutoroutingSetup;
15
- preview: SmartRoutingPreview;
9
+ preview: RoutingSettingsPreview;
16
10
  confirmHandEdit?: boolean;
17
11
  } | {
18
12
  kind: "refresh";
13
+ preview?: RoutingSettingsPreview;
19
14
  confirmHandEdit?: boolean;
20
15
  } | {
21
16
  kind: "clear";
@@ -32,11 +27,15 @@ export interface SmartRoutingPanelOptions {
32
27
  /** Advisory drift between the recorded declaration and current provider priority. */
33
28
  providerOrderHint?: AutoroutingProviderOrderHint;
34
29
  enabled: boolean;
30
+ effectiveGeneratedSetup?: boolean;
35
31
  readOnly: boolean;
32
+ isStateUnknown?: () => boolean;
36
33
  stale: boolean;
37
- preview: SmartRoutingPreview;
38
- generatePreview: (draft: AutoroutingSetup) => SmartRoutingPreview;
39
- onSelect: (intent: SmartRoutingIntent) => undefined | Promise<SmartRoutingPreview | undefined>;
34
+ preview: RoutingSettingsPreview;
35
+ generatePreview: (draft: AutoroutingSetup) => RoutingSettingsPreview;
36
+ discardPreview?: (preview: RoutingSettingsPreview) => void;
37
+ effectiveDiffersFromSaved?: boolean;
38
+ onSelect: (intent: SmartRoutingIntent) => undefined | Promise<RoutingSettingsPreview | undefined>;
40
39
  onCancel: () => void;
41
40
  }
42
41
  /**
@@ -49,7 +48,8 @@ export declare class SmartRoutingPanelComponent extends Container {
49
48
  get mode(): SmartRoutingPanelMode;
50
49
  get confirmation(): SmartRoutingConfirmation;
51
50
  getDraft(): AutoroutingSetup;
52
- getPreviewPayload(): SmartRoutingPreview;
51
+ /** Detached display data only; apply intents retain the service-issued identity internally. */
52
+ getPreviewPayload(): RoutingSettingsPreview;
53
53
  getProviderOrder(): readonly string[];
54
54
  /**
55
55
  * Advisory-only, non-destructive hint update.
@@ -61,21 +61,26 @@ export declare class SmartRoutingPanelComponent extends Container {
61
61
  * else.
62
62
  */
63
63
  updateProviderOrderHint(hint: AutoroutingProviderOrderHint | undefined): void;
64
+ /** Forget effective indicators when a committed result cannot be presented reliably. */
65
+ markEffectiveStateUnknown(): void;
66
+ render(width: number): string[];
64
67
  /** Replace the panel's persisted snapshot after a controller mutation. */
65
68
  refreshState(options: {
66
69
  setup: AutoroutingSetup;
67
70
  tiers?: TierMap;
68
71
  provenance?: AutoroutingProvenance;
69
72
  enabled: boolean;
73
+ effectiveGeneratedSetup: boolean;
70
74
  providerOrderHint?: AutoroutingProviderOrderHint;
71
75
  stale: boolean;
72
- preview: SmartRoutingPreview;
76
+ preview?: RoutingSettingsPreview;
77
+ effectiveDiffersFromSaved?: boolean;
73
78
  }): void;
74
79
  handleInput(data: string): void;
75
80
  __testApply(): Promise<void>;
76
81
  /** Test hook mirroring an in-panel provider reorder/edit: mutates the draft and re-previews. */
77
82
  __testSetProviders(providers: string[]): void;
78
- __testRefresh(confirmHandEdit?: boolean): Promise<void>;
83
+ __testRefresh(): Promise<void>;
79
84
  __testToggle(enabled?: boolean): Promise<void>;
80
85
  __testClear(): Promise<void>;
81
86
  __testConfirm(): Promise<void>;
@@ -1,5 +1,11 @@
1
1
  import { type AgentTool } from "@gajae-code/agent-core";
2
2
  import { Container, type TUI } from "@gajae-code/tui";
3
+ /**
4
+ * Drop terminal controls from one painted tool line.
5
+ * SGR color and a renderer file hyperlink stay. The child render already
6
+ * chose the edit operation from the original path.
7
+ */
8
+ export declare function sanitizePaintedToolLine(line: string): string;
3
9
  export interface ToolExecutionOptions {
4
10
  showImages?: boolean;
5
11
  editFuzzyThreshold?: number;
@@ -39,6 +39,11 @@ export declare class GoalModeController {
39
39
  get paused(): boolean;
40
40
  setEnabledForCompatibility(enabled: boolean): void;
41
41
  setPausedForCompatibility(paused: boolean): void;
42
+ /**
43
+ * Drop the predecessor goal binding after a committed switch to a different
44
+ * session file. No mode entry is written: the predecessor file keeps its goal.
45
+ */
46
+ detachForSessionSwitch(): Promise<void>;
42
47
  beforeGetUserInput(): Promise<void>;
43
48
  scheduleContinuation(): void;
44
49
  cancelContinuation(): void;
@@ -1,18 +1,12 @@
1
1
  import type { Component, SlashCommand } from "@gajae-code/tui";
2
- import { type AutoroutingSetup } from "../../config/autorouting-contract";
2
+ import type { AutoroutingSetup } from "../../config/autorouting-contract";
3
3
  import type { ModelProfileConfig } from "../../config/models-config-schema";
4
4
  import { type Settings } from "../../config/settings";
5
5
  import { type InteractiveModeContext, type OAuthSelectorOptions } from "../../modes/types";
6
- import { getCurrentTelegramActivationMarker, getNotificationConfig, maskToken } from "../../sdk/bus/config";
7
- import { type NotificationProviderRuntimeAuthority, proposedTelegramIdentity, reconcileCommittedTelegramConfiguration, removeTelegramConfiguration, saveTelegramInactive } from "../../sdk/bus/notification-orchestration";
8
- import { buildNotificationStatusReport, checkNotificationHealth, recoverNotifications, sanitizeDiagnostic, sendNotificationTest } from "../../sdk/bus/notification-service";
9
- import { ensureTelegramDaemonRunningDetailed, resolveTelegramSetupPreflight } from "../../sdk/bus/telegram-daemon";
10
- import { runTelegramSetup } from "../../sdk/bus/telegram-setup";
6
+ import { type RoutingSettingsPreview } from "../../sdk/routing-settings";
11
7
  import { type CredentialAutoImportStateStore } from "../../setup/credential-auto-import";
12
8
  import { type CommandPaletteAction } from "../components/command-palette";
13
- import type { NotificationsEditorOperations } from "../components/notifications-settings-editor";
14
9
  import { type PlanPreviewOptions, type PlanPreviewResult } from "../components/plan-preview-overlay";
15
- import type { SmartRoutingPreview } from "../components/smart-routing-panel";
16
10
  import type { StatusLineSettings } from "../components/tool-status-header";
17
11
  import type { JobsObserver } from "../jobs-observer";
18
12
  import type { SessionObserverRegistry } from "../session-observer-registry";
@@ -24,51 +18,6 @@ import type { TranscriptItemRegistry } from "../transcript-item-registry";
24
18
  * previewed row count (and every other field) can never drift out of sync.
25
19
  */
26
20
  export declare function buildStatusLineSettings(settingsInstance: Settings): StatusLineSettings;
27
- export interface NotificationsEditorAdapterContext {
28
- settings: Settings;
29
- session: Pick<InteractiveModeContext["session"], "notificationSessionController">;
30
- sessionManager: Pick<InteractiveModeContext["sessionManager"], "getCwd" | "getSessionId">;
31
- notifyConfigChanged?: () => Promise<void> | void;
32
- }
33
- type TelegramDaemonStopResult = {
34
- ok: boolean;
35
- message: string;
36
- before?: {
37
- health?: string;
38
- };
39
- };
40
- export interface NotificationsEditorOperationDependencies {
41
- getNotificationConfig: typeof getNotificationConfig;
42
- getCurrentTelegramActivationMarker: typeof getCurrentTelegramActivationMarker;
43
- maskToken: typeof maskToken;
44
- buildNotificationStatusReport: typeof buildNotificationStatusReport;
45
- checkNotificationHealth: typeof checkNotificationHealth;
46
- sendNotificationTest: typeof sendNotificationTest;
47
- recoverNotifications: typeof recoverNotifications;
48
- sanitizeDiagnostic: typeof sanitizeDiagnostic;
49
- ensureTelegramDaemonRunningDetailed: typeof ensureTelegramDaemonRunningDetailed;
50
- runTelegramSetup: typeof runTelegramSetup;
51
- resolveTelegramSetupPreflight: typeof resolveTelegramSetupPreflight;
52
- proposedTelegramIdentity: typeof proposedTelegramIdentity;
53
- reconcileCommittedTelegramConfiguration: typeof reconcileCommittedTelegramConfiguration;
54
- saveTelegramInactive: typeof saveTelegramInactive;
55
- removeTelegramConfiguration: typeof removeTelegramConfiguration;
56
- reloadTelegramDaemon(settings: Settings): Promise<{
57
- ok: boolean;
58
- message: string;
59
- }>;
60
- restartTelegramDaemon(settings: Settings): Promise<{
61
- ok: boolean;
62
- message: string;
63
- }>;
64
- stopTelegramDaemon(settings: Settings): Promise<TelegramDaemonStopResult>;
65
- providerRuntime?: NotificationProviderRuntimeAuthority;
66
- }
67
- /**
68
- * Concrete service adapter for the direct Notifications settings tab. Secrets remain in this closure's
69
- * WeakMap and are never exposed through the editor's safe draft contract.
70
- */
71
- export declare function createNotificationsEditorOperations(ctx: NotificationsEditorAdapterContext, overrides?: Partial<NotificationsEditorOperationDependencies>): NotificationsEditorOperations;
72
21
  export declare class SelectorController {
73
22
  #private;
74
23
  private ctx;
@@ -117,15 +66,15 @@ export declare class SelectorController {
117
66
  * This handles side effects and session-specific settings.
118
67
  */
119
68
  handleSettingChange(id: string, value: unknown): void;
120
- /** Generate the immutable preview used by the smart-routing panel. */
121
- previewSmartRouting(draft: AutoroutingSetup): SmartRoutingPreview;
69
+ previewSmartRouting(draft: AutoroutingSetup): RoutingSettingsPreview;
122
70
  applySmartRouting(draft: AutoroutingSetup, options?: {
123
- preview?: SmartRoutingPreview;
71
+ preview?: RoutingSettingsPreview;
124
72
  confirmHandEdit?: boolean;
125
- }): Promise<SmartRoutingPreview>;
73
+ }): Promise<RoutingSettingsPreview>;
126
74
  refreshSmartRouting(options?: {
75
+ preview?: RoutingSettingsPreview;
127
76
  confirmHandEdit?: boolean;
128
- }): Promise<SmartRoutingPreview>;
77
+ }): Promise<RoutingSettingsPreview>;
129
78
  clearGeneratedSetup(): Promise<void>;
130
79
  setAutoroutingEnabled(enabled: boolean): Promise<void>;
131
80
  showModelSelector(options?: {
@@ -153,4 +102,3 @@ export declare class SelectorController {
153
102
  showJobsOverlay(observer: JobsObserver): void;
154
103
  showTasksPane(aggregator: TasksAggregator): void;
155
104
  }
156
- export {};
@@ -4,3 +4,10 @@ export interface PlanModeState {
4
4
  workflow?: "parallel" | "iterative";
5
5
  reentry?: boolean;
6
6
  }
7
+ export declare const DEFAULT_PLAN_FILE_PATH = "local://PLAN.md";
8
+ /**
9
+ * A persisted plan path becomes the plan-mode write target. Accept only a
10
+ * relative path under the session `local:` root; any other saved value,
11
+ * including an absolute or `..` path, falls back to the default plan file.
12
+ */
13
+ export declare function restoredPlanFilePath(value: unknown): string;
@@ -18,6 +18,8 @@ export interface LoadMCPConfigsOptions {
18
18
  filterBrowser?: boolean;
19
19
  /** Only include startup-eligible servers; exact-config sessions always enforce autoload !== false. */
20
20
  autoloadOnly?: boolean;
21
+ /** Include disabled native declarations for session-local status and controls. */
22
+ includeDisabled?: boolean;
21
23
  /**
22
24
  * Restrict discovery to GJC's own native config (`.gjc/` project and
23
25
  * `~/.gjc/agent/` user scopes). Conventional standalone sessions use this
@@ -48,6 +50,12 @@ export interface LoadMCPConfigsResult {
48
50
  configurationWarning: boolean;
49
51
  /** Provider warnings surfaced during discovery (parse/skip diagnostics). */
50
52
  warnings: string[];
53
+ /** Native declarations skipped because they cannot be connected. */
54
+ disabled?: Record<string, {
55
+ source: SourceMeta;
56
+ reason: "enabled-false" | "disabled-servers";
57
+ autoload: boolean;
58
+ }>;
51
59
  }
52
60
  /**
53
61
  * Load all MCP server configs from standard locations.
@@ -126,6 +126,33 @@ export interface MCPManagerOptions {
126
126
  /** Test seam for fencing the acquisition-to-registration replacement race. */
127
127
  afterLeaseAcquiredForTests?: (name: string, lease: MCPPoolLease) => void | Promise<void>;
128
128
  }
129
+ /** Manager-issued CAS identity. Binding is SDK authority, not browser data. */
130
+ export interface MCPServerControlTarget {
131
+ readonly name: string;
132
+ readonly generation: number;
133
+ readonly binding: string;
134
+ }
135
+ export type MCPServerControlAction = "suspend" | "resume" | "reconnect";
136
+ export type MCPServerControlErrorCode = "invalid_target" | "stale_target" | "busy" | "unsupported" | "unavailable" | "unknown_effect";
137
+ export declare class MCPServerControlError extends Error {
138
+ readonly code: MCPServerControlErrorCode;
139
+ constructor(code: MCPServerControlErrorCode);
140
+ }
141
+ export interface MCPServerControlSnapshot {
142
+ readonly target: MCPServerControlTarget;
143
+ readonly state: "connected" | "connecting" | "disconnected" | "suspended" | "unknown";
144
+ readonly transport: "stdio" | "http" | "sse" | "unknown";
145
+ readonly scope: "manager";
146
+ readonly sharing: "shared" | "per-session" | "unknown";
147
+ readonly toolCount: number;
148
+ readonly controls: readonly MCPServerControlAction[];
149
+ }
150
+ export interface MCPServerControlResult {
151
+ /** Completion of the manager's connection/catalog operation, not remote termination or session-registry publication. */
152
+ readonly status: "suspended" | "resumed" | "reconnected";
153
+ readonly cleanup: "not_certified";
154
+ readonly target: MCPServerControlTarget;
155
+ }
129
156
  export type ExactMcpServerControlStatus = "suspended" | "already-suspended" | "resumed" | "not-suspended" | "reconnected" | "unavailable" | "unknown-server";
130
157
  export interface ExactMcpServerControlResult {
131
158
  readonly name: string;
@@ -236,6 +263,18 @@ export declare class MCPManager {
236
263
  prepareExactServerControl(action: "suspend" | "resume" | "reconnect", name: string): Promise<PreparedExactMcpServerControl>;
237
264
  /** Clear all session-local suppression before this owner adopts a new identity. */
238
265
  prepareExactServerControlReset(): Promise<PreparedExactMcpCatalog>;
266
+ /** Payload-free wakeups. Consumers must read a fresh snapshot. */
267
+ subscribeToServerControlsChanged(listener: () => void): () => void;
268
+ /** Read-only, including while session prompt admission is occupied. No resolved config is returned. */
269
+ getServerControlSnapshot(): readonly MCPServerControlSnapshot[];
270
+ /**
271
+ * Atomic target validation and reservation, before the first await. Existing
272
+ * disconnect/reconnect/pool machinery remains the only physical mutation path.
273
+ * Failure is not rollback proof; read the resulting state before retrying.
274
+ */
275
+ controlServer(expected: MCPServerControlTarget, action: MCPServerControlAction, options?: {
276
+ signal?: AbortSignal;
277
+ }): Promise<MCPServerControlResult>;
239
278
  /**
240
279
  * Get a specific connection.
241
280
  */
@@ -305,6 +344,10 @@ export declare class MCPManager {
305
344
  * Throws a retryable cleanup failure while the previous transport owner remains incomplete.
306
345
  */
307
346
  reconnectServer(name: string): Promise<MCPServerConnection | null>;
347
+ /** Connect one ordinary session server without the startup cache fallback. */
348
+ connectSessionServer(name: string, config: MCPServerConfig, source: SourceMeta, options?: {
349
+ restart?: boolean;
350
+ }): Promise<MCPServerConnection>;
308
351
  /**
309
352
  * Refresh tools from a specific server.
310
353
  */
@@ -0,0 +1,7 @@
1
+ export interface SessionMcpControlGrant {
2
+ readonly grantSource: "root-interactive-cli";
3
+ }
4
+ /** Mint a grant. Only the root interactive CLI entry point calls this. */
5
+ export declare function issueSessionMcpControlGrant(): SessionMcpControlGrant;
6
+ /** True only for a token minted by {@link issueSessionMcpControlGrant}. */
7
+ export declare function isIssuedSessionMcpControlGrant(value: unknown): value is SessionMcpControlGrant;
@@ -7,7 +7,7 @@ import { type BrokerExitMode, type BrokerExitReason, type BrokerStopRequest } fr
7
7
  import { type BrokerDiscovery, type BrokerPublicationObservation, type RedactedBrokerDiscovery } from "./discovery";
8
8
  import { type LifecycleDurableEffectsReceipt, LifecycleLedger, type LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
9
9
  import { type IndexedSession, SessionIndex } from "./session-index";
10
- import { type MasterCapabilityVerifier, type SpawnSubstrateFailure, type SpawnSubstrateProvider } from "./spawn-authority";
10
+ import { type MasterCapabilityVerifier, type SpawnLifecycleOwner, type SpawnSubstrateFailure, type SpawnSubstrateProvider } from "./spawn-authority";
11
11
  import type { BrokerTaskArtifactOwnerRetirementDisposition } from "./task-artifact-owner-validation";
12
12
  export interface BrokerSettings {
13
13
  agentDir: string;
@@ -26,6 +26,12 @@ export interface BrokerSettings {
26
26
  masterCapabilityVerifier?: MasterCapabilityVerifier;
27
27
  /** Grace before an orphaned spawn child closes; schema-bounded in production. */
28
28
  masterOrphanGraceMs?: number;
29
+ /**
30
+ * How long a headless spawn host that acknowledged an endpoint `session.close`
31
+ * may take to exit before the substrate close escalates. Defaults to the host's
32
+ * own postmortem cleanup deadline.
33
+ */
34
+ spawnHostCloseGraceMs?: number;
29
35
  /**
30
36
  * Grace before a broker nobody is left to use exits on its own. The clock only
31
37
  * runs while the index proves no live session host and no open spawn authority,
@@ -77,6 +83,7 @@ type ResolvedBrokerSettings = {
77
83
  spawnSubstrateProvider?: SpawnSubstrateProvider;
78
84
  spawnPromptLayer?: SpawnPromptLayer;
79
85
  masterOrphanGraceMs: number;
86
+ spawnHostCloseGraceMs: number;
80
87
  abandonedGraceMs: number;
81
88
  reapWhenAbandoned: boolean;
82
89
  restartRequestId?: string;
@@ -226,15 +233,23 @@ export type SpawnQ26Reconciliation = {
226
233
  turnId?: string;
227
234
  acceptedAt?: number;
228
235
  };
236
+ /** Exact registration a spawn waits for, bounded by the original readiness deadline. */
237
+ export interface SpawnRegistrationRequest {
238
+ childId: string;
239
+ cwd: string;
240
+ stateRoot: string;
241
+ /** Resolved SDK host (not the managed supervisor); registration must match it exactly. */
242
+ owner: SpawnLifecycleOwner;
243
+ effectMarker: string;
244
+ deadlineAt: number;
245
+ }
229
246
  /** Q26-only host control seam. It never receives or returns durable request material. */
230
247
  export interface SpawnPromptLayer {
231
- awaitRegistration(input: {
232
- childId: string;
233
- cwd: string;
234
- stateRoot: string;
235
- }): Promise<{
248
+ awaitRegistration(input: SpawnRegistrationRequest): Promise<{
236
249
  ok: true;
237
- registration: SpawnHostRegistration;
250
+ registration: SpawnHostRegistration & {
251
+ lifecycleRequestId: string;
252
+ };
238
253
  } | {
239
254
  ok: false;
240
255
  }>;
@@ -250,12 +265,23 @@ export interface SpawnPromptLayer {
250
265
  clientRef: string;
251
266
  pinned: SpawnHostRegistration;
252
267
  }): Promise<SpawnQ26Reconciliation>;
268
+ /**
269
+ * Ask the exact pinned host to close itself through its authenticated endpoint.
270
+ * `accepted` means the host acknowledged `session.close`; anything else leaves the
271
+ * close to the substrate provider. Production uses the endpoint attachment.
272
+ */
273
+ close?(input: {
274
+ sessionId: string;
275
+ pinned: SpawnHostRegistration;
276
+ }): Promise<"accepted" | "unavailable">;
253
277
  }
254
278
  /** Exact admission predicate for the child host row published after launch. */
255
279
  export declare function spawnRegistrationMatches(candidate: IndexedSession, expected: {
256
280
  childId: string;
257
281
  cwd: string;
258
282
  stateRoot: string;
283
+ owner: SpawnLifecycleOwner;
284
+ effectMarker: string;
259
285
  }): boolean;
260
286
  export declare function normalizeBrokerInput(operation: string, input: Record<string, unknown>): InputNormalization;
261
287
  /** Test seam for lifecycle serialization identity. */
@@ -177,6 +177,7 @@ export type SpawnChildHostLaunch = {
177
177
  inheritedEnv: Readonly<Record<string, string>>;
178
178
  env: Readonly<Record<string, string>>;
179
179
  effectMarker: string;
180
+ semanticReadyDeadlineAt: number;
180
181
  };
181
182
  export declare function prepareSpawnChildHostLaunch(broker: Broker, input: {
182
183
  cwd: string;
@@ -22,6 +22,8 @@ export interface RetentionPolicy {
22
22
  maxAgeMs?: number;
23
23
  maxRows?: number;
24
24
  tombstoneRule?: SessionTombstoneRule;
25
+ /** Rejection-audit size past which the next write rotates it to `index-audit.jsonl.1`. */
26
+ auditRotateBytes?: number;
25
27
  }
26
28
  export interface SessionIndexObservationDeps {
27
29
  /** Test seam for an exact retained process-identity observation. */