@gajae-code/coding-agent 0.11.10 → 0.12.0

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 (249) hide show
  1. package/CHANGELOG.md +86 -2
  2. package/dist/types/cli/read-cli.d.ts +1 -0
  3. package/dist/types/cli.d.ts +8 -1
  4. package/dist/types/commands/deep-interview.d.ts +9 -0
  5. package/dist/types/commands/harness.d.ts +22 -0
  6. package/dist/types/commands/read.d.ts +6 -0
  7. package/dist/types/config/model-profile-activation.d.ts +1 -0
  8. package/dist/types/config/model-profile-contract.d.ts +2 -0
  9. package/dist/types/config/model-registry.d.ts +4 -0
  10. package/dist/types/config/provider-auth-health.d.ts +14 -0
  11. package/dist/types/config/provider-ranking.d.ts +59 -0
  12. package/dist/types/config/settings-schema.d.ts +86 -3
  13. package/dist/types/config/settings.d.ts +3 -0
  14. package/dist/types/extensibility/extensions/types.d.ts +43 -2
  15. package/dist/types/extensibility/shared-events.d.ts +6 -0
  16. package/dist/types/gjc-runtime/deep-interview-ambiguity.d.ts +5 -12
  17. package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +17 -32
  18. package/dist/types/gjc-runtime/deep-interview-stage.d.ts +37 -0
  19. package/dist/types/gjc-runtime/deep-interview-state.d.ts +4 -135
  20. package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
  21. package/dist/types/gjc-runtime/linux-proc.d.ts +22 -14
  22. package/dist/types/gjc-runtime/memory-guard-owner-claims.d.ts +47 -0
  23. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +112 -1
  24. package/dist/types/gjc-runtime/state-runtime.d.ts +3 -1
  25. package/dist/types/gjc-runtime/state-writer.d.ts +5 -46
  26. package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
  27. package/dist/types/gjc-runtime/team-runtime.d.ts +2 -1
  28. package/dist/types/gjc-runtime/team-store.d.ts +12 -0
  29. package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +92 -0
  30. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +7 -0
  31. package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +8 -0
  32. package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -5
  33. package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
  34. package/dist/types/main.d.ts +1 -1
  35. package/dist/types/memories/index.d.ts +2 -0
  36. package/dist/types/modes/acp/acp-agent.d.ts +22 -9
  37. package/dist/types/modes/components/assistant-message.d.ts +3 -1
  38. package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
  39. package/dist/types/modes/components/queue-pane.d.ts +8 -0
  40. package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
  41. package/dist/types/modes/components/read-tool-group.d.ts +4 -4
  42. package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
  43. package/dist/types/modes/components/settings-selector.d.ts +2 -0
  44. package/dist/types/modes/components/tool-execution.d.ts +8 -0
  45. package/dist/types/modes/components/welcome.d.ts +1 -0
  46. package/dist/types/modes/controllers/event-controller.d.ts +3 -0
  47. package/dist/types/modes/interactive-mode.d.ts +7 -1
  48. package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
  49. package/dist/types/modes/types.d.ts +2 -0
  50. package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
  51. package/dist/types/runtime/memory-domain.d.ts +9 -0
  52. package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
  53. package/dist/types/runtime/memory-guard.d.ts +39 -0
  54. package/dist/types/runtime/memory-limit.d.ts +11 -0
  55. package/dist/types/runtime-mcp/manager.d.ts +8 -0
  56. package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
  57. package/dist/types/sdk/acp/final-text.d.ts +19 -0
  58. package/dist/types/sdk/acp/mcp.d.ts +23 -0
  59. package/dist/types/sdk/broker/lifecycle.d.ts +7 -0
  60. package/dist/types/sdk/bus/chat-daemon-control.d.ts +2 -1
  61. package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
  62. package/dist/types/sdk/bus/index.d.ts +18 -2
  63. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
  64. package/dist/types/sdk/bus/prompt-reconciliation.d.ts +2 -1
  65. package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
  66. package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
  67. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +6 -4
  68. package/dist/types/sdk/bus/telegram-daemon.d.ts +23 -3
  69. package/dist/types/sdk/host/control/operations.d.ts +2 -1
  70. package/dist/types/sdk/host/host.d.ts +2 -0
  71. package/dist/types/sdk/host/query/handlers.d.ts +5 -0
  72. package/dist/types/sdk/lifecycle-session.d.ts +10 -1
  73. package/dist/types/sdk/startup-capability.d.ts +6 -0
  74. package/dist/types/session/agent-session.d.ts +51 -19
  75. package/dist/types/session/fallback-chain-controller.d.ts +18 -2
  76. package/dist/types/session/internal/managed-session-scope.d.ts +27 -0
  77. package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
  78. package/dist/types/session/session-manager.d.ts +59 -13
  79. package/dist/types/session/streaming-output.d.ts +60 -5
  80. package/dist/types/skill-state/active-state.d.ts +0 -4
  81. package/dist/types/skill-state/workflow-hud.d.ts +3 -0
  82. package/dist/types/task/executor.d.ts +6 -0
  83. package/dist/types/task/types.d.ts +36 -0
  84. package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
  85. package/dist/types/tools/browser/launch.d.ts +7 -0
  86. package/dist/types/tools/fetch.d.ts +17 -1
  87. package/dist/types/tools/output-meta.d.ts +21 -1
  88. package/dist/types/tools/read-internals.d.ts +12 -0
  89. package/dist/types/tools/read.d.ts +45 -1
  90. package/dist/types/tools/resource-gc.d.ts +23 -0
  91. package/dist/types/tools/tool-result.d.ts +7 -1
  92. package/package.json +9 -13
  93. package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
  94. package/scripts/capture-sticky-viewport-showcase.ts +292 -0
  95. package/scripts/generate-sdk-operation-inventory.ts +4 -0
  96. package/scripts/run-test-manifest.ts +6 -4
  97. package/scripts/verify-gjc-sdk-canonicalization.ts +122 -18
  98. package/scripts/verify-sticky-viewport-showcase.ts +611 -0
  99. package/src/capability/index.ts +8 -0
  100. package/src/cli/args.ts +14 -8
  101. package/src/cli/fast-help.ts +1 -1
  102. package/src/cli/read-cli.ts +2 -1
  103. package/src/cli.ts +49 -2
  104. package/src/commands/deep-interview.ts +29 -9
  105. package/src/commands/harness.ts +35 -12
  106. package/src/commands/read.ts +11 -2
  107. package/src/commands/sdk.ts +91 -7
  108. package/src/commands/team.ts +1 -1
  109. package/src/config/model-profile-activation.ts +1 -0
  110. package/src/config/model-profile-contract.ts +13 -0
  111. package/src/config/model-profiles.ts +24 -0
  112. package/src/config/model-registry.ts +21 -2
  113. package/src/config/provider-auth-health.ts +42 -0
  114. package/src/config/provider-ranking.ts +119 -0
  115. package/src/config/settings-schema.ts +84 -3
  116. package/src/config/settings.ts +254 -108
  117. package/src/defaults/gjc/skills/deep-interview/SKILL.md +229 -82
  118. package/src/defaults/gjc/skills/ralplan/SKILL.md +78 -26
  119. package/src/defaults/gjc/skills/team/SKILL.md +1 -1
  120. package/src/defaults/gjc/skills/ultragoal/SKILL.md +26 -16
  121. package/src/eval/py/executor.ts +7 -2
  122. package/src/extensibility/extensions/runner.ts +4 -0
  123. package/src/extensibility/extensions/types.ts +42 -4
  124. package/src/extensibility/shared-events.ts +5 -0
  125. package/src/gjc-runtime/deep-interview-ambiguity.ts +47 -68
  126. package/src/gjc-runtime/deep-interview-recorder.ts +227 -310
  127. package/src/gjc-runtime/deep-interview-runtime.ts +109 -270
  128. package/src/gjc-runtime/deep-interview-stage.ts +1016 -0
  129. package/src/gjc-runtime/deep-interview-state.ts +12 -921
  130. package/src/gjc-runtime/gc-render.ts +1 -0
  131. package/src/gjc-runtime/gc-runtime.ts +11 -1
  132. package/src/gjc-runtime/linux-proc.ts +70 -36
  133. package/src/gjc-runtime/memory-guard-owner-claims.ts +389 -0
  134. package/src/gjc-runtime/ralplan-runtime.ts +979 -71
  135. package/src/gjc-runtime/state-runtime.ts +50 -12
  136. package/src/gjc-runtime/state-writer.ts +70 -222
  137. package/src/gjc-runtime/team-launch.ts +34 -5
  138. package/src/gjc-runtime/team-runtime.ts +970 -33
  139. package/src/gjc-runtime/team-store.ts +32 -0
  140. package/src/gjc-runtime/team-worker-memory-guard.ts +363 -0
  141. package/src/gjc-runtime/team-workers.ts +1 -0
  142. package/src/gjc-runtime/tmux-owner-isolation.ts +18 -0
  143. package/src/gjc-runtime/ultragoal-receipt-freshness.ts +20 -0
  144. package/src/gjc-runtime/ultragoal-runtime.ts +13 -7
  145. package/src/gjc-runtime/workflow-manifest.generated.json +97 -350
  146. package/src/gjc-runtime/workflow-manifest.ts +34 -179
  147. package/src/hooks/native-skill-hook.ts +17 -4
  148. package/src/hooks/skill-state.ts +1 -23
  149. package/src/internal-urls/docs-index.generated.ts +10 -11
  150. package/src/internal-urls/local-protocol.ts +23 -4
  151. package/src/internal-urls/local-root-gc.ts +127 -0
  152. package/src/main.ts +9 -5
  153. package/src/memories/index.ts +10 -0
  154. package/src/modes/DESIGN.md +47 -0
  155. package/src/modes/acp/acp-agent.ts +597 -67
  156. package/src/modes/acp/acp-event-mapper.ts +106 -12
  157. package/src/modes/acp/acp-mode.ts +39 -3
  158. package/src/modes/components/assistant-message.ts +123 -22
  159. package/src/modes/components/irc-sidebar.ts +176 -62
  160. package/src/modes/components/model-selector.ts +76 -5
  161. package/src/modes/components/notifications-settings-editor.ts +1 -1
  162. package/src/modes/components/oauth-selector.ts +42 -12
  163. package/src/modes/components/queue-pane.ts +55 -9
  164. package/src/modes/components/queued-message-selector.ts +53 -10
  165. package/src/modes/components/read-tool-group.ts +82 -14
  166. package/src/modes/components/session-observer-overlay.ts +187 -32
  167. package/src/modes/components/settings-selector.ts +60 -18
  168. package/src/modes/components/tool-execution.ts +138 -27
  169. package/src/modes/components/tool-status-header.ts +1 -4
  170. package/src/modes/components/welcome.ts +18 -3
  171. package/src/modes/controllers/command-controller.ts +4 -0
  172. package/src/modes/controllers/event-controller.ts +109 -27
  173. package/src/modes/controllers/extension-ui-controller.ts +23 -12
  174. package/src/modes/controllers/input-controller.ts +62 -6
  175. package/src/modes/controllers/selector-controller.ts +83 -37
  176. package/src/modes/interactive-mode.ts +127 -29
  177. package/src/modes/irc-observation-ledger.ts +71 -15
  178. package/src/modes/runtime-init.ts +20 -2
  179. package/src/modes/types.ts +2 -0
  180. package/src/modes/utils/ui-helpers.ts +94 -1
  181. package/src/prompts/agents/architect.md +9 -1
  182. package/src/prompts/agents/critic.md +9 -0
  183. package/src/prompts/agents/executor.md +1 -1
  184. package/src/prompts/system/system-prompt.md +0 -1
  185. package/src/prompts/tools/read.md +4 -2
  186. package/src/runtime/memory-domain.ts +66 -0
  187. package/src/runtime/memory-guard-contract.ts +73 -0
  188. package/src/runtime/memory-guard.ts +292 -0
  189. package/src/runtime/memory-limit.ts +50 -0
  190. package/src/runtime-mcp/manager.ts +26 -6
  191. package/src/runtime-mcp/smithery-auth.ts +17 -2
  192. package/src/runtime-mcp/smithery-connect.ts +11 -1
  193. package/src/sdk/acp/adapter.ts +8 -1
  194. package/src/sdk/acp/final-text.ts +40 -0
  195. package/src/sdk/acp/mcp.ts +26 -0
  196. package/src/sdk/broker/lifecycle.ts +107 -7
  197. package/src/sdk/bus/chat-daemon-cli.ts +2 -2
  198. package/src/sdk/bus/chat-daemon-control.ts +4 -3
  199. package/src/sdk/bus/config.ts +1 -1
  200. package/src/sdk/bus/control-drain-lease.ts +104 -0
  201. package/src/sdk/bus/index.ts +503 -60
  202. package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
  203. package/src/sdk/bus/prompt-reconciliation.ts +2 -1
  204. package/src/sdk/bus/rate-limit-pool.ts +8 -0
  205. package/src/sdk/bus/reconciliation-store.ts +224 -0
  206. package/src/sdk/bus/telegram-daemon-contract.ts +6 -4
  207. package/src/sdk/bus/telegram-daemon.ts +531 -53
  208. package/src/sdk/host/control/dispatch.ts +7 -1
  209. package/src/sdk/host/control/operations.ts +2 -1
  210. package/src/sdk/host/host.ts +25 -3
  211. package/src/sdk/host/query/handlers.ts +55 -0
  212. package/src/sdk/lifecycle-session.ts +19 -3
  213. package/src/sdk/mcp/server.ts +46 -18
  214. package/src/sdk/protocol/operation-inventory.generated.json +76 -0
  215. package/src/sdk/protocol/operation-registry.ts +8 -2
  216. package/src/sdk/session.ts +25 -2
  217. package/src/sdk/startup-capability.ts +6 -0
  218. package/src/session/agent-session.ts +720 -190
  219. package/src/session/fallback-chain-controller.ts +47 -8
  220. package/src/session/internal/managed-session-scope.ts +40 -10
  221. package/src/session/internal/native-publish-outcome.ts +8 -3
  222. package/src/session/memory-guard-checkpoint-participant.ts +131 -0
  223. package/src/session/session-manager.ts +1372 -42
  224. package/src/session/streaming-output.ts +262 -43
  225. package/src/setup/provider-onboarding.ts +19 -4
  226. package/src/skill-state/active-state.ts +0 -10
  227. package/src/skill-state/workflow-hud.ts +25 -2
  228. package/src/skill-state/workflow-mutation-guard.ts +65 -7
  229. package/src/task/executor.ts +11 -3
  230. package/src/task/index.ts +2 -0
  231. package/src/task/types.ts +22 -11
  232. package/src/task/ultragoal-redteam-activation.ts +75 -0
  233. package/src/tools/ask.ts +89 -69
  234. package/src/tools/browser/launch.ts +41 -6
  235. package/src/tools/fetch.ts +114 -23
  236. package/src/tools/output-meta.ts +176 -9
  237. package/src/tools/path-utils.ts +5 -1
  238. package/src/tools/read-internals.ts +44 -0
  239. package/src/tools/read.ts +1542 -310
  240. package/src/tools/resource-gc.ts +665 -125
  241. package/src/tools/tool-result.ts +14 -1
  242. package/src/web/search/providers/codex.ts +1 -1
  243. package/src/workflow/workflow-intent-diff.ts +4 -1
  244. package/dist/types/gjc-runtime/deep-interview-draft.d.ts +0 -8
  245. package/dist/types/gjc-runtime/deep-interview-payload.d.ts +0 -41
  246. package/dist/types/gjc-runtime/deep-interview-repair.d.ts +0 -17
  247. package/src/gjc-runtime/deep-interview-draft.ts +0 -843
  248. package/src/gjc-runtime/deep-interview-payload.ts +0 -262
  249. package/src/gjc-runtime/deep-interview-repair.ts +0 -1674
@@ -0,0 +1,71 @@
1
+ export interface MemoryGuardPolicy {
2
+ enabled: boolean;
3
+ checkIntervalMs: number;
4
+ gcThresholdRatio: number;
5
+ restartThresholdRatio: number;
6
+ restartThresholdWindowMs: number;
7
+ cooldownMs: number;
8
+ parentReserveBytes: number;
9
+ policyLimitBytes: number | null;
10
+ }
11
+ export interface MemoryGuardWorkerSample {
12
+ workerId: string;
13
+ bytes: number;
14
+ accepted?: boolean;
15
+ }
16
+ export interface MemoryGuardWorkerAccounting {
17
+ workerId: string;
18
+ bytes: number;
19
+ accepted: boolean;
20
+ allowanceBytes: number;
21
+ excessBytes: number;
22
+ }
23
+ export interface MemoryGuardDomainSnapshot {
24
+ effectiveLimitBytes: number;
25
+ totalUsageBytes: number;
26
+ parentBytes: number;
27
+ parentReserveBytes: number;
28
+ totalWorkerBytes: number;
29
+ acceptedWorkerCount: number;
30
+ unmanagedBytes: number;
31
+ headroomBytes: number;
32
+ workerBudgetBytes: number;
33
+ perWorkerAllowanceBytes: number;
34
+ hostExcessBytes: number;
35
+ workers: MemoryGuardWorkerAccounting[];
36
+ }
37
+ export interface MemoryGuardHostTarget {
38
+ kind: "host";
39
+ excessBytes: number;
40
+ }
41
+ export interface MemoryGuardWorkerTarget {
42
+ kind: "worker";
43
+ workerId: string;
44
+ excessBytes: number;
45
+ }
46
+ export type MemoryGuardActionTarget = MemoryGuardHostTarget | MemoryGuardWorkerTarget;
47
+ export type MemoryGuardNoopReason = "memory_guard_action_noop_unmanaged_or_within_allowance" | "memory_guard_action_noop_unsupported";
48
+ export type MemoryGuardDecision = {
49
+ kind: "execute";
50
+ target: MemoryGuardActionTarget;
51
+ } | {
52
+ kind: "noop";
53
+ reason: MemoryGuardNoopReason;
54
+ } | {
55
+ kind: "revalidated_out";
56
+ reason: "memory_guard_action_revalidated_out";
57
+ };
58
+ export interface MemoryGuardSchedulerState {
59
+ timerActive: boolean;
60
+ registrationCount: number;
61
+ inProgress: boolean;
62
+ generation: number;
63
+ pendingDeadline: number | null;
64
+ pendingOwner: {
65
+ generation: number;
66
+ token: number;
67
+ } | null;
68
+ deferredDeadline: number | null;
69
+ deferredGeneration: number | null;
70
+ activeGeneration: number | null;
71
+ }
@@ -0,0 +1,39 @@
1
+ import type { Settings } from "../config/settings";
2
+ import type { MemoryGuardDecision, MemoryGuardDomainSnapshot, MemoryGuardPolicy, MemoryGuardSchedulerState } from "./memory-guard-contract";
3
+ type WorkOwner = {
4
+ generation: number;
5
+ source: "timer" | "external";
6
+ };
7
+ export interface MemoryGuardHostRegistration {
8
+ ownerId: string;
9
+ intervalMs: number;
10
+ }
11
+ export interface MemoryGuardHostOptions {
12
+ run: () => Promise<void>;
13
+ logDebug?: (message: string, meta?: Record<string, unknown>) => void;
14
+ schedulerNow?: () => number;
15
+ }
16
+ export declare function resolveMemoryGuardPolicy(settings: Settings): MemoryGuardPolicy;
17
+ export declare function chooseMemoryGuardAction(input: {
18
+ domain: MemoryGuardDomainSnapshot;
19
+ hostSupported: boolean;
20
+ workerSupported: (workerId: string) => boolean;
21
+ }): MemoryGuardDecision;
22
+ export declare function revalidateMemoryGuardAction(previous: Extract<MemoryGuardDecision, {
23
+ kind: "execute";
24
+ }>, revalidated: MemoryGuardDecision): MemoryGuardDecision;
25
+ export declare class MemoryGuardHost {
26
+ #private;
27
+ constructor(options: MemoryGuardHostOptions);
28
+ register(registration: MemoryGuardHostRegistration): () => void;
29
+ updateInterval(ownerId: string, intervalMs: number): void;
30
+ runTick(generation?: number, source?: WorkOwner["source"]): Promise<void>;
31
+ runTimerCallbackForTest(owner: {
32
+ generation: number;
33
+ token: number;
34
+ }, deadline: number): Promise<void>;
35
+ setSchedulerNowForTest(now: () => number): void;
36
+ getStateForTest(): MemoryGuardSchedulerState;
37
+ resetForTest(): void;
38
+ }
39
+ export {};
@@ -0,0 +1,11 @@
1
+ export interface EffectiveMemoryLimitInput {
2
+ hardCapBytes?: number | null;
3
+ policyLimitBytes?: number | null;
4
+ }
5
+ export interface EffectiveMemoryLimit {
6
+ hardCapBytes: number | null;
7
+ policyLimitBytes: number | null;
8
+ effectiveBytes: number | null;
9
+ source: "none" | "hard_cap" | "policy_limit" | "hard_cap_and_policy_limit";
10
+ }
11
+ export declare function resolveEffectiveMemoryLimit(input: EffectiveMemoryLimitInput): EffectiveMemoryLimit;
@@ -5,6 +5,7 @@ import type { AuthStorage } from "../session/auth-storage";
5
5
  import type { MCPToolDetails } from "./tool-bridge";
6
6
  import type { MCPToolCache } from "./tool-cache";
7
7
  import type { MCPGetPromptResult, MCPPrompt, MCPRequestOptions, MCPResource, MCPResourceReadResult, MCPResourceTemplate, MCPServerConfig, MCPServerConnection } from "./types";
8
+ export declare function resolveStartupTimeoutMs(configs: MCPServerConfig[], maxStartupTimeoutMs?: number): number;
8
9
  /**
9
10
  * Stable, total ordering on MCP tools by name.
10
11
  *
@@ -48,6 +49,13 @@ export interface MCPDiscoverOptions {
48
49
  export interface MCPManagerOptions {
49
50
  /** Restrict this instance to tools from an explicit MCP config. */
50
51
  toolsOnly?: boolean;
52
+ /**
53
+ * Ceiling for the startup wait, in milliseconds. Only ACP lifecycle launches
54
+ * set this, so a slow ACP MCP handshake gets the readiness budget while every
55
+ * other consumer keeps the short default. Non-positive or non-finite values
56
+ * are ignored and the default applies.
57
+ */
58
+ maxStartupTimeoutMs?: number;
51
59
  }
52
60
  /**
53
61
  * MCP Server Manager.
@@ -7,6 +7,11 @@ type SmitheryCliPollResponse = {
7
7
  apiKey?: string;
8
8
  message?: string;
9
9
  };
10
+ /** Test seam: the Smithery origin and env API key as resolved from trusted env. */
11
+ export declare function resolveSmitheryEnvForTest(): {
12
+ url: string;
13
+ apiKey: string | undefined;
14
+ };
10
15
  export declare function getSmitheryLoginUrl(): string;
11
16
  export declare function createSmitheryCliAuthSession(): Promise<SmitheryCliAuthSession>;
12
17
  export declare function pollSmitheryCliAuthSession(sessionId: string, signal?: AbortSignal): Promise<SmitheryCliPollResponse>;
@@ -0,0 +1,19 @@
1
+ export declare const ACP_FINAL_TEXT_LIMIT = 100000;
2
+ export interface BoundedAcpFinalText {
3
+ text: string;
4
+ truncated: boolean;
5
+ }
6
+ export type AcpFinalTextResolution = {
7
+ kind: "none";
8
+ final: BoundedAcpFinalText;
9
+ } | {
10
+ kind: "emit";
11
+ final: BoundedAcpFinalText;
12
+ text: string;
13
+ } | {
14
+ kind: "divergent";
15
+ final: BoundedAcpFinalText;
16
+ };
17
+ export declare function boundAcpFinalText(value: string): BoundedAcpFinalText;
18
+ export declare function acpFinalTextFromMessage(message: unknown): BoundedAcpFinalText;
19
+ export declare function resolveAcpFinalText(streamed: string, finalText: string): AcpFinalTextResolution;
@@ -0,0 +1,23 @@
1
+ export declare const ACP_MCP_REQUEST_TIMEOUT_MS = 30000;
2
+ export declare const ACP_MCP_LIFECYCLE_TIMEOUT_MS: number;
3
+ /**
4
+ * Slice of the readiness budget reserved for the work that follows MCP startup
5
+ * (session wiring, marker publication). The ACP MCP startup ceiling is the
6
+ * remaining time to `semanticReadyDeadlineAt` minus this headroom, so a slow
7
+ * MCP handshake cannot consume the whole readiness window.
8
+ */
9
+ export declare const ACP_MCP_STARTUP_HEADROOM_MS = 250;
10
+ export interface SessionLifecycleMcpStdioServer {
11
+ type?: "stdio";
12
+ name: string;
13
+ command: string;
14
+ args: string[];
15
+ env?: Record<string, string>;
16
+ }
17
+ export interface SessionLifecycleMcpRemoteServer {
18
+ type: "http" | "sse";
19
+ name: string;
20
+ url: string;
21
+ headers?: Record<string, string>;
22
+ }
23
+ export type SessionLifecycleMcpServer = SessionLifecycleMcpStdioServer | SessionLifecycleMcpRemoteServer;
@@ -1,3 +1,4 @@
1
+ import type { SessionLifecycleMcpServer } from "../acp/mcp";
1
2
  import type { SdkStartupFailure, SdkStartupRollbackResult } from "../startup-capability";
2
3
  import type { Broker, BrokerCleanupEvidence, BrokerResponse } from "./broker";
3
4
  import type { LifecycleDurableEffectsReceipt, LifecycleStartupFailureReceipt } from "./lifecycle-ledger";
@@ -61,6 +62,7 @@ export interface SessionLifecycleLaunchRequest {
61
62
  /** Broker-issued effect marker which the child echoes only after host readiness. */
62
63
  effectMarker?: string;
63
64
  modelPreset?: string;
65
+ mcpServers?: SessionLifecycleMcpServer[];
64
66
  worktree?: SessionLifecycleWorktreeTarget;
65
67
  receivedAt: number;
66
68
  requestedReadinessTimeoutMs: number;
@@ -71,6 +73,11 @@ export interface SessionLifecycleLaunchRequest {
71
73
  export declare function readSessionLifecycleLaunchRequest(value: string | undefined, now?: number): SessionLifecycleLaunchRequest;
72
74
  type CleanupEvidence = BrokerCleanupEvidence;
73
75
  export declare function validateBrokerModelPresetForTest(agentDir: string, requestedProfile: string): string | BrokerResponse;
76
+ /** Test seam: the session-host command override as resolved from trusted env. */
77
+ export declare function sdkSessionCommandOverrideForTest(): {
78
+ file: string;
79
+ args: string[];
80
+ } | undefined;
74
81
  export declare function setProcessIncarnationForTest(broker: Broker, value: ((pid: number) => string | undefined) | undefined): void;
75
82
  /** The child writes this only after its endpoint and semantic ready event are both live. */
76
83
  export declare function writeSessionLifecycleReady(root: string, id: string, effectMarker: string): Promise<void>;
@@ -15,7 +15,8 @@ export type ChatDaemonAction = "stop" | "reload";
15
15
  * concrete detached quarantine plus a proven-absent canonical lock pathname —
16
16
  * when deleting an observed owner-lock lease. Generation 12 refreshes retained
17
17
  * native path and process authority semantics. Generation 13 rejects special
18
- * files before retained native authority opens.
18
+ * files before retained native authority opens. Generation 14 reloads shared
19
+ * chat daemons after notification configuration parsing changes.
19
20
  */
20
21
  export declare const CHAT_DAEMON_GENERATIONS: Readonly<Record<ChatDaemonKind, number>>;
21
22
  export declare function chatDaemonGeneration(kind: ChatDaemonKind): number;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Ordering seam for an in-band SDK identity transition.
3
+ *
4
+ * A request arrives through predecessor A, so a successful terminal response cannot
5
+ * be published until successor B is ready. Native builds may provide a true
6
+ * send-only connection lease; source/dev builds use the conservative fallback in
7
+ * which the predecessor server remains alive until the terminal write completes.
8
+ */
9
+ export type TerminalSendOutcome = "written" | "disconnected" | "write_failed";
10
+ /** Fence/capability hooks may return false to reject; undefined means ok. */
11
+ export type IdentityControlGateResult = boolean | undefined;
12
+ export type IdentityControlGate = () => IdentityControlGateResult | Promise<IdentityControlGateResult>;
13
+ export interface IdentityControlSuccessPathInput {
14
+ /** Fence predecessor inbound work. The fence must not close its response writer. */
15
+ fence: IdentityControlGate;
16
+ /** Optional explicit proof that the predecessor writer is still usable. */
17
+ ensurePredecessorSendCapable?: IdentityControlGate;
18
+ /** Start successor B and resolve only after its public endpoint is ready. */
19
+ startSuccessor: () => Promise<void>;
20
+ /** Write and flush either the success or non-success terminal response. */
21
+ sendTerminal: () => Promise<TerminalSendOutcome>;
22
+ /** Release predecessor A after the terminal response has settled. */
23
+ stopPredecessor: () => Promise<void>;
24
+ /** Set only when a caller cannot use the retained-writer fallback. */
25
+ requireNativeControlDrain?: boolean;
26
+ }
27
+ export interface IdentityControlTerminalPathInput {
28
+ fenceInbound: IdentityControlGate;
29
+ ensurePredecessorSendCapable?: IdentityControlGate;
30
+ startSuccessorReady: () => Promise<void>;
31
+ sendTerminal: () => Promise<TerminalSendOutcome>;
32
+ stopPredecessor: () => Promise<void>;
33
+ requireNativeControlDrain?: boolean;
34
+ }
35
+ /**
36
+ * Probe the loaded native addon, never an environment flag or a TypeScript shim.
37
+ * Older/source installs intentionally report false so callers can select the
38
+ * retained-writer fallback or fail closed when detach is mandatory.
39
+ */
40
+ export declare function isNativeControlDrainAvailable(): boolean;
41
+ /**
42
+ * Run the only safe ordering for a successful identity-control response.
43
+ *
44
+ * The `finally` is deliberately around both successor startup and terminal
45
+ * delivery: a failed startup must not leave the fenced predecessor alive, and a
46
+ * failed/disconnected terminal write must still release it. When native detach
47
+ * is unavailable the caller is expected to keep A's server up (not call
48
+ * `stopAndWait`) until `sendTerminal` settles.
49
+ */
50
+ export declare function runIdentityControlSuccessPath(input: IdentityControlSuccessPathInput): Promise<TerminalSendOutcome>;
51
+ /** Compatibility spelling used by the host wiring design notes. */
52
+ export declare function runIdentityControlTerminalPath(input: IdentityControlTerminalPathInput): Promise<TerminalSendOutcome>;
@@ -30,6 +30,8 @@ import { type SdkStartupFailure } from "../startup-capability";
30
30
  import { type NotificationConfig } from "./config";
31
31
  import { NotificationSessionController } from "./session-control";
32
32
  import { type EnsureDaemonResult, type RegisterNotificationRootResult } from "./telegram-daemon";
33
+ export type { IdentityControlSuccessPathInput, IdentityControlTerminalPathInput, TerminalSendOutcome, } from "./control-drain-lease";
34
+ export { isNativeControlDrainAvailable, runIdentityControlSuccessPath, runIdentityControlTerminalPath, } from "./control-drain-lease";
33
35
  /** Where a `session_create` should run. Discriminated by `kind`. */
34
36
  export type SessionCreateTarget = {
35
37
  kind: "existing_path";
@@ -297,6 +299,8 @@ interface SessionRuntime {
297
299
  disposeGateListener: () => void;
298
300
  /** Whether notification-only delivery and answer resources are active. */
299
301
  notificationsActive: boolean;
302
+ /** Rejects new SDK frames while a leased terminal response drains. */
303
+ inboundFenced: boolean;
300
304
  /** Set as soon as terminal teardown is requested, before startup settles. */
301
305
  stopping: boolean;
302
306
  /** Recreates notification-only resources after `/notify on`. */
@@ -374,6 +378,7 @@ interface SessionRuntime {
374
378
  sessionId: string;
375
379
  commandId?: string;
376
380
  turnId?: string;
381
+ finalText?: string;
377
382
  } | {
378
383
  type: "agent_failed";
379
384
  sessionId: string;
@@ -423,7 +428,8 @@ interface SessionRuntime {
423
428
  /** Started tool calls awaiting a terminal activity frame, keyed by tool call id. */
424
429
  inFlightTools: Map<string, {
425
430
  toolName: string;
426
- args: unknown;
431
+ args?: unknown;
432
+ pendingPhase?: "completed" | "failed" | "cancelled";
427
433
  }>;
428
434
  /** Cancels the postmortem cleanup that emits `session_closed` on process teardown. */
429
435
  cancelPostmortemCleanup: () => void;
@@ -511,6 +517,17 @@ export declare class EphemeralTurnHost {
511
517
  * an identity for a transport that never became available is false success.
512
518
  */
513
519
  export declare function ensureConfiguredProviderDaemons(settings: Settings, cfg: NotificationConfig, ensureProviderDaemon?: (provider: "discord" | "slack", settings: Settings) => Promise<unknown>): Promise<void>;
520
+ /**
521
+ * Classify whether a session identity event must await notification endpoint startup.
522
+ * Only an interactive selector resume may defer this ancillary startup; all other
523
+ * events, including branches and unknown origins, fail closed to awaiting it.
524
+ */
525
+ export declare function shouldAwaitNotificationStartup(event: {
526
+ type: "session_switch" | "session_branch";
527
+ transition?: {
528
+ origin: string;
529
+ };
530
+ }): boolean;
514
531
  export declare function createNotificationsExtension(api: ExtensionAPI, options?: {
515
532
  settings?: Settings;
516
533
  ensureTelegramDaemon?: (input: {
@@ -537,4 +554,3 @@ export declare function createNotificationsExtension(api: ExtensionAPI, options?
537
554
  readNotificationFile?: (path: string) => Promise<Buffer>;
538
555
  readNotificationDiffStat?: (cwd: string) => Promise<string | undefined>;
539
556
  }): void;
540
- export {};
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Kind-aware invocation reconciliation (prompt | skill) with optional durable store.
3
+ * Preserves Q26 admit/first-terminal/capacity/TTL semantics; indexes and caps are per-kind.
4
+ */
5
+ import { type PromptCorrelation, type PromptReconciliationStatus, type TurnPromptReconciliation } from "./prompt-reconciliation";
6
+ import type { ReconciliationKind, ReconciliationStore } from "./reconciliation-store";
7
+ export type { ReconciliationKind };
8
+ export interface KindCorrelation extends PromptCorrelation {
9
+ kind: ReconciliationKind;
10
+ }
11
+ export interface KindAwareReconciliation {
12
+ admit(kind: ReconciliationKind, clientRef?: string): void;
13
+ releaseAdmission(kind: ReconciliationKind, clientRef?: string): void;
14
+ noteAccepted(kind: ReconciliationKind, correlation: PromptCorrelation, clientRef?: string, extra?: {
15
+ skillName?: string;
16
+ }): Promise<void>;
17
+ noteTransition(kind: ReconciliationKind, correlation: PromptCorrelation | undefined, frame: {
18
+ type: "agent_start" | "agent_end";
19
+ } | {
20
+ type: "agent_failed";
21
+ error: unknown;
22
+ }): Promise<void>;
23
+ lookup(kind: ReconciliationKind, selector: {
24
+ commandId?: string;
25
+ turnId?: string;
26
+ clientRef?: string;
27
+ }): TurnPromptReconciliation;
28
+ cleanup(): void;
29
+ activeCount(kind: ReconciliationKind): number;
30
+ /** Hydrate from durable store (call once at session host start). */
31
+ hydrateFromStore(): Promise<void>;
32
+ }
33
+ export declare function createKindAwareReconciliation(options?: {
34
+ now?: () => number;
35
+ store?: ReconciliationStore | null;
36
+ }): KindAwareReconciliation;
37
+ export type { PromptReconciliationStatus };
@@ -12,7 +12,8 @@
12
12
  * - Terminal records are retained for TERMINAL_TTL_MS and bounded to
13
13
  * TERMINAL_CAPACITY, evicted oldest-terminal-first by terminalAt; only then
14
14
  * does a lookup honestly report `unknown`.
15
- * - The durability floor is the live session process: restart means `unknown`.
15
+ * - Process-local durability floor is the live session process: restart means `unknown`.
16
+ * Session-scoped durable retention (kind-aware store) is provided by reconciliation-store.ts (#3032).
16
17
  * - The clientRef index is session-runtime scoped; a ref conflicts only while
17
18
  * retained and must never be reused as a retry mechanism.
18
19
  * - Terminal transitions settle once: the first terminal outcome wins.
@@ -84,6 +84,8 @@ export declare class RateLimitPool<T = unknown> {
84
84
  constructor(options?: RateLimitPoolOptions);
85
85
  /** Number of items currently queued across all lanes. */
86
86
  get pending(): number;
87
+ /** Whether any queued item currently matches the predicate. */
88
+ someQueued(predicate: (item: RateLimitItem<T>) => boolean): boolean;
87
89
  /** Current available token count (after refill at `now`). */
88
90
  availableTokens(nowMs?: number): number;
89
91
  /**
@@ -0,0 +1,65 @@
1
+ import type { PromptCorrelation, PromptReconciliationStatus } from "./prompt-reconciliation";
2
+ export declare const RECONCILIATION_STORE_VERSION = 1;
3
+ export declare const RECONCILIATION_SESSION_ID_PATTERN: RegExp;
4
+ export declare const RECONCILIATION_DIR_NAME = ".sdk-reconciliation";
5
+ export type ReconciliationKind = "prompt" | "skill";
6
+ export interface DurableReconciliationRecord extends PromptCorrelation {
7
+ kind: ReconciliationKind;
8
+ clientRef?: string;
9
+ status: PromptReconciliationStatus;
10
+ error?: {
11
+ code: string;
12
+ message: string;
13
+ };
14
+ acceptedAt: number;
15
+ startedAt?: number;
16
+ terminalAt?: number;
17
+ /** Skill-only safe token; never skill args bodies. */
18
+ skillName?: string;
19
+ }
20
+ export interface ReconciliationStoreDocument {
21
+ version: typeof RECONCILIATION_STORE_VERSION;
22
+ sessionId: string;
23
+ records: DurableReconciliationRecord[];
24
+ }
25
+ export interface ReconciliationStoreFs {
26
+ mkdir(directory: string, options: {
27
+ recursive: true;
28
+ mode: number;
29
+ }): Promise<unknown>;
30
+ readFile(file: string, encoding: "utf8"): Promise<string>;
31
+ writeFile(file: string, data: string, options: {
32
+ mode: number;
33
+ }): Promise<void>;
34
+ rename(from: string, to: string): Promise<void>;
35
+ unlink(file: string): Promise<void>;
36
+ open(file: string, flags: string): Promise<{
37
+ sync(): Promise<void>;
38
+ close(): Promise<void>;
39
+ writeFile(data: string, encoding: "utf8"): Promise<void>;
40
+ }>;
41
+ }
42
+ export declare function isSafeReconciliationSessionId(sessionId: string): boolean;
43
+ /** Derive private store path; throws if sessionId is unsafe (path escape). */
44
+ export declare function reconciliationStorePath(sessionFile: string, sessionId: string): string;
45
+ /**
46
+ * Settle non-terminal durable records after process death: failed/process_restart.
47
+ * Meaning: reconciliation incomplete — not proof of agent failure.
48
+ */
49
+ export declare function settleProcessRestart(records: DurableReconciliationRecord[], now: number): DurableReconciliationRecord[];
50
+ export interface ReconciliationStore {
51
+ readonly path: string | null;
52
+ readonly sessionId: string;
53
+ /** Serialize mutations; reload not required for single-process host (in-memory + write). */
54
+ transact(mutator: (records: DurableReconciliationRecord[]) => DurableReconciliationRecord[]): Promise<void>;
55
+ load(): Promise<DurableReconciliationRecord[]>;
56
+ /** Snapshot currently held in memory after last load/transact. */
57
+ snapshot(): DurableReconciliationRecord[];
58
+ delete(): Promise<void>;
59
+ }
60
+ export declare function createReconciliationStore(options: {
61
+ sessionFile: string | null | undefined;
62
+ sessionId: string;
63
+ fs?: ReconciliationStoreFs;
64
+ now?: () => number;
65
+ }): ReconciliationStore;
@@ -37,11 +37,13 @@ export declare const NOTIFICATION_PROTOCOL_VERSION = 3;
37
37
  * Generation 28 rejects special files before retained native authority opens.
38
38
  * Generation 29 adds serving-epoch compatibility, sidecar heartbeat, root GC,
39
39
  * and Bot API cooldown structural fixes (#2956, #2960, #3048).
40
+ * Generation 30 adds opt-in tool activity delivery, closed lifecycle phases,
41
+ * and capability-versioned mixed-host compatibility.
40
42
  */
41
- export declare const DAEMON_GENERATION = 29;
43
+ export declare const DAEMON_GENERATION = 30;
42
44
  /**
43
45
  * Serving-compatibility boundary for daemon lifecycle requests. Epoch 1 covers
44
- * all builds published before this field existed; bump this to force serving
45
- * convergence and reload of compatible live predecessors.
46
+ * all builds published before this field existed; epoch 2 covered generation 29;
47
+ * bump this to force serving convergence and reload of compatible live predecessors.
46
48
  */
47
- export declare const SERVING_EPOCH = 2;
49
+ export declare const SERVING_EPOCH = 3;
@@ -107,8 +107,10 @@ export declare const CLIENT_PING_PONG_CAPABILITY = "client_ping_pong";
107
107
  /** Capability required for typed controls and semantic Selected acknowledgement frames. */
108
108
  export declare const ASK_SELECTED_ACK_CAPABILITY = "ask_selected_ack_v1";
109
109
  export declare const ASK_CONTROLS_CAPABILITY = "ask_controls_v1";
110
- /** Capability required for tool lifecycle and reasoning-summary frames. */
111
- export declare const TOOL_ACTIVITY_CAPABILITY = "tool_activity_v1";
110
+ /** Capability for the closed tool phase set: started, completed, failed, and cancelled. */
111
+ export declare const TOOL_ACTIVITY_CAPABILITY = "tool_activity_v2";
112
+ /** Receive-only compatibility capability for pre-v2 hosts. */
113
+ export declare const LEGACY_TOOL_ACTIVITY_CAPABILITY = "tool_activity_v1";
112
114
  /**
113
115
  * File-lock options whose acquisition budget covers the full reload-reservation
114
116
  * critical section: the in-lock freshness poll plus the controller's
@@ -752,7 +754,7 @@ export interface TelegramDaemonOptions {
752
754
  richDraft?: {
753
755
  enabled: boolean;
754
756
  };
755
- /** Tool start/completion messages (enabled by default). */
757
+ /** Tool start/completion messages (off by default; explicit opt-in only). */
756
758
  toolActivity?: {
757
759
  enabled: boolean;
758
760
  };
@@ -786,6 +788,8 @@ interface SessionSocket {
786
788
  /** True once the server advertised the `client_ping_pong` capability. */
787
789
  capable: boolean;
788
790
  ephemeralCapable: boolean;
791
+ /** Tool activity contract advertised by the connected host. */
792
+ toolActivityCapability?: "v1" | "v2";
789
793
  /** Timestamp (via opts.now) of the last received pong; seeds the TTL window. */
790
794
  lastPongAt: number;
791
795
  /** Nonce of the most recent in-flight ping, if any. */
@@ -815,6 +819,9 @@ export declare class TelegramNotificationDaemon {
815
819
  /** Endpoint-bound ownership for visible or dispatching tool bubbles. */
816
820
  private readonly toolActivityOwners;
817
821
  private readonly revokedToolEndpoints;
822
+ /** Exact settlement of each admitted legacy-v1 start; retained only while visible. */
823
+ private readonly legacyToolStarts;
824
+ private nextLegacyToolStartId;
818
825
  private readonly unresolvedToolTerminalizations;
819
826
  private toolTerminalizationChain;
820
827
  private toolActivityPolicyEpoch;
@@ -986,8 +993,21 @@ export declare class TelegramNotificationDaemon {
986
993
  private topicIdentityKey;
987
994
  private topicIdentityBase;
988
995
  private topicOwnerForIdentity;
996
+ private admitLegacyToolStart;
997
+ private legacyToolStartForTerminal;
998
+ private settleLegacyToolStart;
999
+ private cancelUnsentLegacyToolStart;
1000
+ private failLegacyToolStart;
1001
+ private settleRejectedLegacyToolSubmission;
1002
+ private cancelLegacyToolStartsForSession;
1003
+ private cleanLegacyToolStartsForCapabilityUpgrade;
1004
+ private cancelLegacyToolStartsForPolicyTransition;
989
1005
  private toolActivityOwner;
1006
+ private renderThreadedFrame;
1007
+ private toolActivityFrameWithoutSummaries;
1008
+ private toolActivitySummariesAreCurrent;
990
1009
  private toolActivityAuthorityIsCurrent;
1010
+ private toolActivityDeliveryIsCurrent;
991
1011
  private submitThreadedFrame;
992
1012
  private existingTopicForPrivateChat;
993
1013
  private topicAuthorityLease;
@@ -13,11 +13,12 @@ export interface ControlSurface {
13
13
  answerAsk(id: string, answer: ControlValue): Promise<ControlValue> | ControlValue;
14
14
  answerGate(id: string, response: ControlValue, expectedSessionId?: string, idempotencyKey?: string): Promise<ControlValue> | ControlValue;
15
15
  approvePlan(id: string, choice: ControlValue, expectedSessionId?: string): Promise<ControlValue> | ControlValue;
16
- invokeSkill(name: string, args: ControlValue): Promise<ControlValue> | ControlValue;
16
+ invokeSkill(name: string, args: ControlValue, clientRef?: string): Promise<ControlValue> | ControlValue;
17
17
  setPlanMode(on: boolean): Promise<ControlValue> | ControlValue;
18
18
  operateGoal(op: string, objective?: string): Promise<ControlValue> | ControlValue;
19
19
  replaceTodo(items: ControlValue): Promise<ControlValue> | ControlValue;
20
20
  setModel(id: string, thinkingLevel?: ControlValue): Promise<ControlValue> | ControlValue;
21
+ setModelProfile(id: string): Promise<ControlValue> | ControlValue;
21
22
  cycleModel(): Promise<ControlValue> | ControlValue;
22
23
  setThinking(level: ControlValue): Promise<ControlValue> | ControlValue;
23
24
  cycleThinking(): Promise<ControlValue> | ControlValue;
@@ -7,6 +7,8 @@ export interface SessionSdkHostOptions extends HostEndpointAdapters {
7
7
  query?: (connectionId: string, frame: SdkFrame) => unknown | Promise<unknown>;
8
8
  /** Best-effort diagnostic observation of accepted control/query frames. */
9
9
  onRequest?: SdkRequestObserver;
10
+ /** Runs before a control response is sent; identity transitions use sendTerminal. */
11
+ beforeControlResponse?: (connectionId: string, request: SdkFrame, response: SdkFrame, sendTerminal: () => Promise<void>) => void | Promise<void>;
10
12
  /** Runs only after a successful control response has been sent to the client. */
11
13
  afterControlResponse?: (connectionId: string, request: SdkFrame, response: SdkFrame) => void | Promise<void>;
12
14
  installProviderDefinitions?: (capability: string, definitions: unknown) => void;
@@ -37,6 +37,11 @@ export interface SessionSurface {
37
37
  turnId?: string;
38
38
  clientRef?: string;
39
39
  }): unknown | Promise<unknown>;
40
+ getSkillInvokeStatus?(selector: {
41
+ commandId?: string;
42
+ turnId?: string;
43
+ clientRef?: string;
44
+ }): unknown | Promise<unknown>;
40
45
  /** Q27 effective model-profile catalog from the live session registry. */
41
46
  getModelProfiles?(): unknown[] | Promise<unknown[]>;
42
47
  /** Query rows backed by the session's installed binding map. */
@@ -10,5 +10,14 @@ export type CreateLifecycleAgentSessionResult = {
10
10
  rollback: SdkStartupRollbackTracker;
11
11
  failure: SdkStartupFailure;
12
12
  };
13
+ /** Options accepted by lifecycle-only session construction. */
14
+ export type CreateLifecycleAgentSessionOptions = CreateAgentSessionOptions & {
15
+ /**
16
+ * Startup budget for ACP lifecycle MCP launches, in milliseconds. Set only
17
+ * when the lifecycle request supplies `mcpServers`; ordinary consumers keep
18
+ * the manager's short default ceiling.
19
+ */
20
+ mcpStartupTimeoutMs?: number;
21
+ };
13
22
  /** Internal lifecycle-only session construction with an owner-bound SDK startup result. */
14
- export declare function createLifecycleAgentSession(options?: CreateAgentSessionOptions): Promise<CreateLifecycleAgentSessionResult>;
23
+ export declare function createLifecycleAgentSession(options?: CreateLifecycleAgentSessionOptions): Promise<CreateLifecycleAgentSessionResult>;
@@ -16,6 +16,12 @@ export type SdkStartupResult = {
16
16
  };
17
17
  /** Internal symbols for lifecycle-only SDK startup construction and bus wiring. */
18
18
  export declare const lifecycleStartupCapabilityOption: unique symbol;
19
+ /**
20
+ * Internal option carrying the startup budget for ACP lifecycle MCP launches.
21
+ * Only set when the lifecycle request actually supplies `mcpServers`, so the
22
+ * longer ceiling never leaks to ordinary CLI/SDK `mcpConfigPath` consumers.
23
+ */
24
+ export declare const lifecycleMcpStartupTimeoutOption: unique symbol;
19
25
  export declare function attachLifecycleStartupCapability(api: object, capability: SdkStartupCapability): void;
20
26
  export declare function lifecycleStartupCapabilityForApi(api: object): SdkStartupCapability | undefined;
21
27
  export interface SdkStartupRollbackResult {