@hydra-acp/cli 0.1.61 → 0.1.63

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 (5) hide show
  1. package/README.md +123 -107
  2. package/dist/cli.js +3634 -1107
  3. package/dist/index.d.ts +265 -25
  4. package/dist/index.js +2103 -641
  5. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -95,19 +95,49 @@ declare const HydraConfig: z.ZodObject<{
95
95
  registry: z.ZodDefault<z.ZodObject<{
96
96
  url: z.ZodDefault<z.ZodString>;
97
97
  ttlHours: z.ZodDefault<z.ZodNumber>;
98
+ pinned: z.ZodDefault<z.ZodBoolean>;
98
99
  }, "strip", z.ZodTypeAny, {
99
100
  url: string;
100
101
  ttlHours: number;
102
+ pinned: boolean;
101
103
  }, {
102
104
  url?: string | undefined;
103
105
  ttlHours?: number | undefined;
106
+ pinned?: boolean | undefined;
104
107
  }>>;
108
+ agents: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
109
+ name: z.ZodOptional<z.ZodString>;
110
+ description: z.ZodOptional<z.ZodString>;
111
+ command: z.ZodOptional<z.ZodString>;
112
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
113
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ name?: string | undefined;
116
+ args?: string[] | undefined;
117
+ command?: string | undefined;
118
+ env?: Record<string, string> | undefined;
119
+ description?: string | undefined;
120
+ }, {
121
+ name?: string | undefined;
122
+ args?: string[] | undefined;
123
+ command?: string | undefined;
124
+ env?: Record<string, string> | undefined;
125
+ description?: string | undefined;
126
+ }>>>;
127
+ agentOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
128
+ packageSpec: z.ZodOptional<z.ZodString>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ packageSpec?: string | undefined;
131
+ }, {
132
+ packageSpec?: string | undefined;
133
+ }>>>;
105
134
  defaultAgent: z.ZodDefault<z.ZodString>;
106
135
  defaultModels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
107
136
  synopsisAgent: z.ZodOptional<z.ZodString>;
108
137
  synopsisModel: z.ZodOptional<z.ZodString>;
109
138
  synopsisOnClose: z.ZodDefault<z.ZodBoolean>;
110
139
  defaultCwd: z.ZodDefault<z.ZodString>;
140
+ compressToolContent: z.ZodDefault<z.ZodBoolean>;
111
141
  sessionListColdLimit: z.ZodDefault<z.ZodNumber>;
112
142
  extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
113
143
  command: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -152,6 +182,9 @@ declare const HydraConfig: z.ZodObject<{
152
182
  progressIndicator: z.ZodDefault<z.ZodBoolean>;
153
183
  defaultEnterAction: z.ZodDefault<z.ZodEnum<["enqueue", "amend"]>>;
154
184
  showThoughts: z.ZodDefault<z.ZodBoolean>;
185
+ ambiguousWidth: z.ZodDefault<z.ZodEnum<["narrow", "wide"]>>;
186
+ toolContent: z.ZodDefault<z.ZodEnum<["inline", "references"]>>;
187
+ diffContextLines: z.ZodDefault<z.ZodNumber>;
155
188
  promptHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
156
189
  maxToolItems: z.ZodDefault<z.ZodNumber>;
157
190
  maxPlanItems: z.ZodDefault<z.ZodNumber>;
@@ -166,6 +199,9 @@ declare const HydraConfig: z.ZodObject<{
166
199
  progressIndicator: boolean;
167
200
  defaultEnterAction: "enqueue" | "amend";
168
201
  showThoughts: boolean;
202
+ ambiguousWidth: "narrow" | "wide";
203
+ toolContent: "inline" | "references";
204
+ diffContextLines: number;
169
205
  promptHistoryMaxEntries: number;
170
206
  maxToolItems: number;
171
207
  maxPlanItems: number;
@@ -180,6 +216,9 @@ declare const HydraConfig: z.ZodObject<{
180
216
  progressIndicator?: boolean | undefined;
181
217
  defaultEnterAction?: "enqueue" | "amend" | undefined;
182
218
  showThoughts?: boolean | undefined;
219
+ ambiguousWidth?: "narrow" | "wide" | undefined;
220
+ toolContent?: "inline" | "references" | undefined;
221
+ diffContextLines?: number | undefined;
183
222
  promptHistoryMaxEntries?: number | undefined;
184
223
  maxToolItems?: number | undefined;
185
224
  maxPlanItems?: number | undefined;
@@ -196,6 +235,9 @@ declare const HydraConfig: z.ZodObject<{
196
235
  progressIndicator: boolean;
197
236
  defaultEnterAction: "enqueue" | "amend";
198
237
  showThoughts: boolean;
238
+ ambiguousWidth: "narrow" | "wide";
239
+ toolContent: "inline" | "references";
240
+ diffContextLines: number;
199
241
  promptHistoryMaxEntries: number;
200
242
  maxToolItems: number;
201
243
  maxPlanItems: number;
@@ -228,14 +270,26 @@ declare const HydraConfig: z.ZodObject<{
228
270
  env: Record<string, string>;
229
271
  enabled: boolean;
230
272
  }>;
273
+ agents: Record<string, {
274
+ name?: string | undefined;
275
+ args?: string[] | undefined;
276
+ command?: string | undefined;
277
+ env?: Record<string, string> | undefined;
278
+ description?: string | undefined;
279
+ }>;
231
280
  registry: {
232
281
  url: string;
233
282
  ttlHours: number;
283
+ pinned: boolean;
234
284
  };
285
+ agentOverrides: Record<string, {
286
+ packageSpec?: string | undefined;
287
+ }>;
235
288
  defaultAgent: string;
236
289
  defaultModels: Record<string, string>;
237
290
  synopsisOnClose: boolean;
238
291
  defaultCwd: string;
292
+ compressToolContent: boolean;
239
293
  sessionListColdLimit: number;
240
294
  defaultTransformers: string[];
241
295
  synopsisAgent?: string | undefined;
@@ -251,6 +305,9 @@ declare const HydraConfig: z.ZodObject<{
251
305
  progressIndicator?: boolean | undefined;
252
306
  defaultEnterAction?: "enqueue" | "amend" | undefined;
253
307
  showThoughts?: boolean | undefined;
308
+ ambiguousWidth?: "narrow" | "wide" | undefined;
309
+ toolContent?: "inline" | "references" | undefined;
310
+ diffContextLines?: number | undefined;
254
311
  promptHistoryMaxEntries?: number | undefined;
255
312
  maxToolItems?: number | undefined;
256
313
  maxPlanItems?: number | undefined;
@@ -283,16 +340,28 @@ declare const HydraConfig: z.ZodObject<{
283
340
  env?: Record<string, string> | undefined;
284
341
  enabled?: boolean | undefined;
285
342
  }> | undefined;
343
+ agents?: Record<string, {
344
+ name?: string | undefined;
345
+ args?: string[] | undefined;
346
+ command?: string | undefined;
347
+ env?: Record<string, string> | undefined;
348
+ description?: string | undefined;
349
+ }> | undefined;
286
350
  registry?: {
287
351
  url?: string | undefined;
288
352
  ttlHours?: number | undefined;
353
+ pinned?: boolean | undefined;
289
354
  } | undefined;
355
+ agentOverrides?: Record<string, {
356
+ packageSpec?: string | undefined;
357
+ }> | undefined;
290
358
  defaultAgent?: string | undefined;
291
359
  defaultModels?: Record<string, string> | undefined;
292
360
  synopsisAgent?: string | undefined;
293
361
  synopsisModel?: string | undefined;
294
362
  synopsisOnClose?: boolean | undefined;
295
363
  defaultCwd?: string | undefined;
364
+ compressToolContent?: boolean | undefined;
296
365
  sessionListColdLimit?: number | undefined;
297
366
  defaultTransformers?: string[] | undefined;
298
367
  npmRegistry?: string | undefined;
@@ -558,6 +627,19 @@ declare const RegistryAgent: z.ZodObject<{
558
627
  args?: string[] | undefined;
559
628
  env?: Record<string, string> | undefined;
560
629
  }>>;
630
+ exec: z.ZodOptional<z.ZodObject<{
631
+ command: z.ZodString;
632
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
633
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
634
+ }, "strip", z.ZodTypeAny, {
635
+ command: string;
636
+ args?: string[] | undefined;
637
+ env?: Record<string, string> | undefined;
638
+ }, {
639
+ command: string;
640
+ args?: string[] | undefined;
641
+ env?: Record<string, string> | undefined;
642
+ }>>;
561
643
  }, "strip", z.ZodTypeAny, {
562
644
  binary?: {
563
645
  "darwin-aarch64"?: {
@@ -608,6 +690,11 @@ declare const RegistryAgent: z.ZodObject<{
608
690
  args?: string[] | undefined;
609
691
  env?: Record<string, string> | undefined;
610
692
  } | undefined;
693
+ exec?: {
694
+ command: string;
695
+ args?: string[] | undefined;
696
+ env?: Record<string, string> | undefined;
697
+ } | undefined;
611
698
  }, {
612
699
  binary?: {
613
700
  "darwin-aarch64"?: {
@@ -658,6 +745,11 @@ declare const RegistryAgent: z.ZodObject<{
658
745
  args?: string[] | undefined;
659
746
  env?: Record<string, string> | undefined;
660
747
  } | undefined;
748
+ exec?: {
749
+ command: string;
750
+ args?: string[] | undefined;
751
+ env?: Record<string, string> | undefined;
752
+ } | undefined;
661
753
  }>;
662
754
  }, "strip", z.ZodTypeAny, {
663
755
  name: string;
@@ -712,6 +804,11 @@ declare const RegistryAgent: z.ZodObject<{
712
804
  args?: string[] | undefined;
713
805
  env?: Record<string, string> | undefined;
714
806
  } | undefined;
807
+ exec?: {
808
+ command: string;
809
+ args?: string[] | undefined;
810
+ env?: Record<string, string> | undefined;
811
+ } | undefined;
715
812
  };
716
813
  version?: string | undefined;
717
814
  description?: string | undefined;
@@ -773,6 +870,11 @@ declare const RegistryAgent: z.ZodObject<{
773
870
  args?: string[] | undefined;
774
871
  env?: Record<string, string> | undefined;
775
872
  } | undefined;
873
+ exec?: {
874
+ command: string;
875
+ args?: string[] | undefined;
876
+ env?: Record<string, string> | undefined;
877
+ } | undefined;
776
878
  };
777
879
  version?: string | undefined;
778
880
  description?: string | undefined;
@@ -997,6 +1099,19 @@ declare const RegistryDocument: z.ZodObject<{
997
1099
  args?: string[] | undefined;
998
1100
  env?: Record<string, string> | undefined;
999
1101
  }>>;
1102
+ exec: z.ZodOptional<z.ZodObject<{
1103
+ command: z.ZodString;
1104
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1105
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1106
+ }, "strip", z.ZodTypeAny, {
1107
+ command: string;
1108
+ args?: string[] | undefined;
1109
+ env?: Record<string, string> | undefined;
1110
+ }, {
1111
+ command: string;
1112
+ args?: string[] | undefined;
1113
+ env?: Record<string, string> | undefined;
1114
+ }>>;
1000
1115
  }, "strip", z.ZodTypeAny, {
1001
1116
  binary?: {
1002
1117
  "darwin-aarch64"?: {
@@ -1047,6 +1162,11 @@ declare const RegistryDocument: z.ZodObject<{
1047
1162
  args?: string[] | undefined;
1048
1163
  env?: Record<string, string> | undefined;
1049
1164
  } | undefined;
1165
+ exec?: {
1166
+ command: string;
1167
+ args?: string[] | undefined;
1168
+ env?: Record<string, string> | undefined;
1169
+ } | undefined;
1050
1170
  }, {
1051
1171
  binary?: {
1052
1172
  "darwin-aarch64"?: {
@@ -1097,6 +1217,11 @@ declare const RegistryDocument: z.ZodObject<{
1097
1217
  args?: string[] | undefined;
1098
1218
  env?: Record<string, string> | undefined;
1099
1219
  } | undefined;
1220
+ exec?: {
1221
+ command: string;
1222
+ args?: string[] | undefined;
1223
+ env?: Record<string, string> | undefined;
1224
+ } | undefined;
1100
1225
  }>;
1101
1226
  }, "strip", z.ZodTypeAny, {
1102
1227
  name: string;
@@ -1151,6 +1276,11 @@ declare const RegistryDocument: z.ZodObject<{
1151
1276
  args?: string[] | undefined;
1152
1277
  env?: Record<string, string> | undefined;
1153
1278
  } | undefined;
1279
+ exec?: {
1280
+ command: string;
1281
+ args?: string[] | undefined;
1282
+ env?: Record<string, string> | undefined;
1283
+ } | undefined;
1154
1284
  };
1155
1285
  version?: string | undefined;
1156
1286
  description?: string | undefined;
@@ -1212,6 +1342,11 @@ declare const RegistryDocument: z.ZodObject<{
1212
1342
  args?: string[] | undefined;
1213
1343
  env?: Record<string, string> | undefined;
1214
1344
  } | undefined;
1345
+ exec?: {
1346
+ command: string;
1347
+ args?: string[] | undefined;
1348
+ env?: Record<string, string> | undefined;
1349
+ } | undefined;
1215
1350
  };
1216
1351
  version?: string | undefined;
1217
1352
  description?: string | undefined;
@@ -1277,6 +1412,11 @@ declare const RegistryDocument: z.ZodObject<{
1277
1412
  args?: string[] | undefined;
1278
1413
  env?: Record<string, string> | undefined;
1279
1414
  } | undefined;
1415
+ exec?: {
1416
+ command: string;
1417
+ args?: string[] | undefined;
1418
+ env?: Record<string, string> | undefined;
1419
+ } | undefined;
1280
1420
  };
1281
1421
  version?: string | undefined;
1282
1422
  description?: string | undefined;
@@ -1342,6 +1482,11 @@ declare const RegistryDocument: z.ZodObject<{
1342
1482
  args?: string[] | undefined;
1343
1483
  env?: Record<string, string> | undefined;
1344
1484
  } | undefined;
1485
+ exec?: {
1486
+ command: string;
1487
+ args?: string[] | undefined;
1488
+ env?: Record<string, string> | undefined;
1489
+ } | undefined;
1345
1490
  };
1346
1491
  version?: string | undefined;
1347
1492
  description?: string | undefined;
@@ -1366,6 +1511,9 @@ declare class Registry {
1366
1511
  refresh(): Promise<RegistryDocument>;
1367
1512
  lastFetchedAt(): number | undefined;
1368
1513
  getAgent(id: string): Promise<RegistryAgent | undefined>;
1514
+ localAgents(): RegistryAgent[];
1515
+ private applyOverride;
1516
+ private isPinned;
1369
1517
  private isFresh;
1370
1518
  private fetchFromNetwork;
1371
1519
  private readDiskCache;
@@ -1423,36 +1571,27 @@ declare const SessionAttachParams: z.ZodObject<{
1423
1571
  name: string;
1424
1572
  version?: string | undefined;
1425
1573
  }>>;
1426
- readonly: z.ZodOptional<z.ZodBoolean>;
1427
- replayMode: z.ZodOptional<z.ZodEnum<["instant", "drip"]>>;
1428
- dripSpeed: z.ZodOptional<z.ZodNumber>;
1429
1574
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1430
1575
  }, "strip", z.ZodTypeAny, {
1431
1576
  sessionId: string;
1432
1577
  historyPolicy: "none" | "full" | "pending_only" | "after_message";
1433
- readonly?: boolean | undefined;
1434
1578
  clientInfo?: {
1435
1579
  name: string;
1436
1580
  version?: string | undefined;
1437
1581
  } | undefined;
1582
+ _meta?: Record<string, unknown> | undefined;
1438
1583
  afterMessageId?: string | undefined;
1439
1584
  clientId?: string | undefined;
1440
- replayMode?: "drip" | "instant" | undefined;
1441
- dripSpeed?: number | undefined;
1442
- _meta?: Record<string, unknown> | undefined;
1443
1585
  }, {
1444
1586
  sessionId: string;
1445
- readonly?: boolean | undefined;
1446
1587
  clientInfo?: {
1447
1588
  name: string;
1448
1589
  version?: string | undefined;
1449
1590
  } | undefined;
1591
+ _meta?: Record<string, unknown> | undefined;
1450
1592
  historyPolicy?: "none" | "full" | "pending_only" | "after_message" | undefined;
1451
1593
  afterMessageId?: string | undefined;
1452
1594
  clientId?: string | undefined;
1453
- replayMode?: "drip" | "instant" | undefined;
1454
- dripSpeed?: number | undefined;
1455
- _meta?: Record<string, unknown> | undefined;
1456
1595
  }>;
1457
1596
  type SessionAttachParams = z.infer<typeof SessionAttachParams>;
1458
1597
  interface PromptOriginator {
@@ -1535,14 +1674,14 @@ declare const SessionListEntry: z.ZodObject<{
1535
1674
  sessionId: string;
1536
1675
  cwd: string;
1537
1676
  status: "live" | "cold";
1538
- updatedAt: string;
1539
- attachedClients: number;
1540
1677
  busy: boolean;
1541
1678
  awaitingInput: boolean;
1679
+ attachedClients: number;
1680
+ updatedAt: string;
1542
1681
  title?: string | undefined;
1543
- agentId?: string | undefined;
1544
- upstreamSessionId?: string | undefined;
1545
1682
  _meta?: Record<string, unknown> | undefined;
1683
+ upstreamSessionId?: string | undefined;
1684
+ agentId?: string | undefined;
1546
1685
  currentModel?: string | undefined;
1547
1686
  currentUsage?: {
1548
1687
  used?: number | undefined;
@@ -1563,13 +1702,13 @@ declare const SessionListEntry: z.ZodObject<{
1563
1702
  }, {
1564
1703
  sessionId: string;
1565
1704
  cwd: string;
1566
- updatedAt: string;
1567
1705
  attachedClients: number;
1706
+ updatedAt: string;
1568
1707
  status?: "live" | "cold" | undefined;
1569
1708
  title?: string | undefined;
1570
- agentId?: string | undefined;
1571
- upstreamSessionId?: string | undefined;
1572
1709
  _meta?: Record<string, unknown> | undefined;
1710
+ upstreamSessionId?: string | undefined;
1711
+ agentId?: string | undefined;
1573
1712
  currentModel?: string | undefined;
1574
1713
  currentUsage?: {
1575
1714
  used?: number | undefined;
@@ -1578,6 +1717,8 @@ declare const SessionListEntry: z.ZodObject<{
1578
1717
  costCurrency?: string | undefined;
1579
1718
  } | undefined;
1580
1719
  interactive?: boolean | undefined;
1720
+ busy?: boolean | undefined;
1721
+ awaitingInput?: boolean | undefined;
1581
1722
  importedFromMachine?: string | undefined;
1582
1723
  importedFromUpstreamSessionId?: string | undefined;
1583
1724
  parentSessionId?: string | undefined;
@@ -1587,8 +1728,6 @@ declare const SessionListEntry: z.ZodObject<{
1587
1728
  name: string;
1588
1729
  version?: string | undefined;
1589
1730
  } | undefined;
1590
- busy?: boolean | undefined;
1591
- awaitingInput?: boolean | undefined;
1592
1731
  }>;
1593
1732
  type SessionListEntry = z.infer<typeof SessionListEntry>;
1594
1733
  declare const SessionListResult: z.ZodObject<{
@@ -1741,12 +1880,18 @@ declare class JsonRpcConnection {
1741
1880
  private pending;
1742
1881
  private closed;
1743
1882
  private closeHandlers;
1883
+ private orphanErrorHandlers;
1744
1884
  constructor(stream: MessageStream);
1745
1885
  onRequest(method: string, handler: RequestHandler): void;
1746
1886
  setDefaultHandler(handler: RequestHandler): void;
1747
1887
  onNotification(method: string, handler: NotificationHandler): void;
1748
1888
  drainBuffered(method: string): number;
1749
1889
  onClose(handler: (err?: Error) => void): void;
1890
+ onOrphanError(handler: (error: {
1891
+ code?: number;
1892
+ message: string;
1893
+ data?: unknown;
1894
+ }) => void): void;
1750
1895
  request<T = unknown>(method: string, params?: unknown): Promise<T>;
1751
1896
  requestWithId<T = unknown>(method: string, params?: unknown): {
1752
1897
  id: JsonRpcId;
@@ -1984,6 +2129,20 @@ interface AdvertisedModel {
1984
2129
  name?: string;
1985
2130
  description?: string;
1986
2131
  }
2132
+ interface ConfigOptionValue {
2133
+ value: string;
2134
+ name: string;
2135
+ description?: string;
2136
+ }
2137
+ interface ConfigOption {
2138
+ id: string;
2139
+ name: string;
2140
+ description?: string;
2141
+ category?: string;
2142
+ type: "select";
2143
+ currentValue: string;
2144
+ options: ConfigOptionValue[];
2145
+ }
1987
2146
 
1988
2147
  interface ExtensionCommandSpec {
1989
2148
  verb: string;
@@ -2024,7 +2183,9 @@ declare class HistoryStore {
2024
2183
  append(sessionId: string, entry: HistoryEntry): Promise<void>;
2025
2184
  rewrite(sessionId: string, entries: HistoryEntry[]): Promise<void>;
2026
2185
  compact(sessionId: string, maxEntries: number): Promise<void>;
2027
- load(sessionId: string): Promise<HistoryEntry[]>;
2186
+ load(sessionId: string, opts?: {
2187
+ tools?: "inline" | "references";
2188
+ }): Promise<HistoryEntry[]>;
2028
2189
  flushAll(): Promise<void>;
2029
2190
  delete(sessionId: string): Promise<void>;
2030
2191
  private enqueue;
@@ -2062,6 +2223,10 @@ interface SpawnReplacementAgentResult {
2062
2223
  upstreamSessionId: string;
2063
2224
  agentMeta?: Record<string, unknown>;
2064
2225
  agentCapabilities?: AgentCapabilities;
2226
+ initialModel?: string;
2227
+ initialModels?: AdvertisedModel[];
2228
+ initialMode?: string;
2229
+ initialModes?: AdvertisedMode[];
2065
2230
  }
2066
2231
  type SpawnReplacementAgent = (params: SpawnReplacementAgentParams) => Promise<SpawnReplacementAgentResult>;
2067
2232
  interface UsageSnapshot {
@@ -2116,6 +2281,11 @@ interface SessionInit {
2116
2281
  currentModel?: string;
2117
2282
  }[]>;
2118
2283
  extensionCommands?: ExtensionCommandRegistry;
2284
+ availableAgents?: () => Array<{
2285
+ id: string;
2286
+ name?: string;
2287
+ description?: string;
2288
+ }>;
2119
2289
  }
2120
2290
  interface CloseOptions {
2121
2291
  deleteRecord?: boolean;
@@ -2157,6 +2327,9 @@ declare class Session {
2157
2327
  private titleHandlers;
2158
2328
  private scheduleSynopsisHook?;
2159
2329
  private broadcastHandlers;
2330
+ private lastCancelAt;
2331
+ private static readonly CANCEL_ERROR_WINDOW_MS;
2332
+ private forceCancelling;
2160
2333
  private _firstPromptSeeded;
2161
2334
  get firstPromptSeeded(): boolean;
2162
2335
  private promptStartedAt;
@@ -2184,6 +2357,7 @@ declare class Session {
2184
2357
  private agentCommandsHandlers;
2185
2358
  private agentModesHandlers;
2186
2359
  private agentModelsHandlers;
2360
+ private availableAgentsFn?;
2187
2361
  private modelHandlers;
2188
2362
  private modeHandlers;
2189
2363
  private interactiveHandlers;
@@ -2199,6 +2373,7 @@ declare class Session {
2199
2373
  private broadcastAvailableModes;
2200
2374
  private broadcastAvailableModels;
2201
2375
  private wireAgent;
2376
+ private handleOrphanError;
2202
2377
  private runResponseChain;
2203
2378
  onAgentChange(handler: (info: {
2204
2379
  agentId: string;
@@ -2212,11 +2387,12 @@ declare class Session {
2212
2387
  }>;
2213
2388
  get turnStartedAt(): number | undefined;
2214
2389
  get awaitingInput(): boolean;
2215
- getHistorySnapshot(): Promise<CachedNotification[]>;
2390
+ getHistorySnapshot(tools?: "inline" | "references"): Promise<CachedNotification[]>;
2216
2391
  onBroadcast(handler: (entry: CachedNotification) => void): () => void;
2217
2392
  attach(client: AttachedClient, historyPolicy: HistoryPolicy, opts?: {
2218
2393
  afterMessageId?: string;
2219
2394
  raw?: boolean;
2395
+ toolContent?: "inline" | "references";
2220
2396
  }): Promise<{
2221
2397
  entries: CachedNotification[];
2222
2398
  appliedPolicy: HistoryPolicy;
@@ -2280,6 +2456,9 @@ declare class Session {
2280
2456
  onInteractiveChange(handler: (interactive: boolean) => void): void;
2281
2457
  applyModelChange(modelId: string): void;
2282
2458
  applyModeChange(modeId: string): void;
2459
+ buildConfigOptions(): ConfigOption[];
2460
+ private broadcastConfigOptions;
2461
+ private mergeAgentOptionIntoEnvelope;
2283
2462
  onUsageChange(handler: (usage: UsageSnapshot) => void): void;
2284
2463
  mergedAvailableCommands(): AdvertisedCommand[];
2285
2464
  agentOnlyAdvertisedCommands(): AdvertisedCommand[];
@@ -2295,9 +2474,14 @@ declare class Session {
2295
2474
  private handleModeCommand;
2296
2475
  private runTitleCommand;
2297
2476
  private runInternalPrompt;
2477
+ setAgent(newAgentId: string): Promise<unknown>;
2298
2478
  private runAgentCommand;
2299
2479
  private runKillCommand;
2300
2480
  private runRestartCommand;
2481
+ forceCancel(): Promise<{
2482
+ stopReason: string;
2483
+ }>;
2484
+ private respawnAgent;
2301
2485
  private buildSwitchTranscript;
2302
2486
  seedFromImport(): Promise<void>;
2303
2487
  private broadcastAgentSwitch;
@@ -2501,8 +2685,8 @@ declare const SessionRecord: z.ZodObject<{
2501
2685
  sessionId: string;
2502
2686
  version: 1;
2503
2687
  cwd: string;
2504
- agentId: string;
2505
2688
  upstreamSessionId: string;
2689
+ agentId: string;
2506
2690
  updatedAt: string;
2507
2691
  createdAt: string;
2508
2692
  title?: string | undefined;
@@ -2556,8 +2740,8 @@ declare const SessionRecord: z.ZodObject<{
2556
2740
  sessionId: string;
2557
2741
  version: 1;
2558
2742
  cwd: string;
2559
- agentId: string;
2560
2743
  upstreamSessionId: string;
2744
+ agentId: string;
2561
2745
  updatedAt: string;
2562
2746
  createdAt: string;
2563
2747
  title?: string | undefined;
@@ -2617,6 +2801,44 @@ declare class SessionStore {
2617
2801
  list(): Promise<SessionRecord[]>;
2618
2802
  }
2619
2803
 
2804
+ declare const Tombstone: z.ZodObject<{
2805
+ version: z.ZodLiteral<1>;
2806
+ agentId: z.ZodString;
2807
+ upstreamSessionId: z.ZodString;
2808
+ deletedAt: z.ZodString;
2809
+ upstreamUpdatedAt: z.ZodOptional<z.ZodString>;
2810
+ cwd: z.ZodOptional<z.ZodString>;
2811
+ title: z.ZodOptional<z.ZodString>;
2812
+ reason: z.ZodOptional<z.ZodEnum<["user", "expired"]>>;
2813
+ }, "strip", z.ZodTypeAny, {
2814
+ version: 1;
2815
+ upstreamSessionId: string;
2816
+ agentId: string;
2817
+ deletedAt: string;
2818
+ cwd?: string | undefined;
2819
+ title?: string | undefined;
2820
+ reason?: "user" | "expired" | undefined;
2821
+ upstreamUpdatedAt?: string | undefined;
2822
+ }, {
2823
+ version: 1;
2824
+ upstreamSessionId: string;
2825
+ agentId: string;
2826
+ deletedAt: string;
2827
+ cwd?: string | undefined;
2828
+ title?: string | undefined;
2829
+ reason?: "user" | "expired" | undefined;
2830
+ upstreamUpdatedAt?: string | undefined;
2831
+ }>;
2832
+ type Tombstone = z.infer<typeof Tombstone>;
2833
+ declare class TombstoneStore {
2834
+ add(t: Omit<Tombstone, "version">): Promise<void>;
2835
+ has(agentId: string, upstreamSessionId: string): Promise<boolean>;
2836
+ read(agentId: string, upstreamSessionId: string): Promise<Tombstone | undefined>;
2837
+ remove(agentId: string, upstreamSessionId: string): Promise<void>;
2838
+ list(agentId?: string): Promise<Tombstone[]>;
2839
+ private listForAgent;
2840
+ }
2841
+
2620
2842
  declare const Bundle: z.ZodObject<{
2621
2843
  version: z.ZodLiteral<1>;
2622
2844
  exportedAt: z.ZodString;
@@ -2817,6 +3039,7 @@ declare const Bundle: z.ZodObject<{
2817
3039
  params?: unknown;
2818
3040
  }>, "many">;
2819
3041
  promptHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3042
+ toolBlobs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2820
3043
  }, "strip", z.ZodTypeAny, {
2821
3044
  version: 1;
2822
3045
  session: {
@@ -2873,6 +3096,7 @@ declare const Bundle: z.ZodObject<{
2873
3096
  params?: unknown;
2874
3097
  }[];
2875
3098
  promptHistory?: string[] | undefined;
3099
+ toolBlobs?: Record<string, string> | undefined;
2876
3100
  }, {
2877
3101
  version: 1;
2878
3102
  session: {
@@ -2929,6 +3153,7 @@ declare const Bundle: z.ZodObject<{
2929
3153
  params?: unknown;
2930
3154
  }[];
2931
3155
  promptHistory?: string[] | undefined;
3156
+ toolBlobs?: Record<string, string> | undefined;
2932
3157
  }>;
2933
3158
  type Bundle = z.infer<typeof Bundle>;
2934
3159
 
@@ -2988,6 +3213,7 @@ interface SessionManagerOptions {
2988
3213
  npmRegistry?: string;
2989
3214
  extensionCommands?: ExtensionCommandRegistry;
2990
3215
  defaultCwd?: string;
3216
+ tombstones?: TombstoneStore;
2991
3217
  }
2992
3218
  declare class SessionManager {
2993
3219
  private registry;
@@ -2995,6 +3221,7 @@ declare class SessionManager {
2995
3221
  private resurrectionInflight;
2996
3222
  private spawner;
2997
3223
  private store;
3224
+ private tombstones;
2998
3225
  private histories;
2999
3226
  private idleTimeoutMs;
3000
3227
  private defaultModels;
@@ -3010,7 +3237,9 @@ declare class SessionManager {
3010
3237
  private extensionCommands?;
3011
3238
  private defaultCwd;
3012
3239
  private synopsisCoordinator;
3240
+ private agentCatalog;
3013
3241
  constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
3242
+ private refreshAgentCatalog;
3014
3243
  create(params: CreateSessionParams): Promise<Session>;
3015
3244
  resurrect(params: ResurrectParams): Promise<Session>;
3016
3245
  private doResurrect;
@@ -3023,10 +3252,12 @@ declare class SessionManager {
3023
3252
  skipped: number;
3024
3253
  }>;
3025
3254
  private collectAgentSessions;
3255
+ private applySeedModel;
3026
3256
  private bootstrapAgent;
3027
3257
  private attachManagerHooks;
3028
3258
  getHistory(sessionId: string): Promise<HistoryEntry[] | undefined>;
3029
3259
  loadHistory(sessionId: string): Promise<HistoryEntry[]>;
3260
+ loadToolBlob(sessionId: string, hash: string): Promise<string | null>;
3030
3261
  loadFromDisk(sessionId: string): Promise<ResurrectParams | undefined>;
3031
3262
  private clearPendingHistorySync;
3032
3263
  private deriveTitleFromHistory;
@@ -3035,16 +3266,20 @@ declare class SessionManager {
3035
3266
  activeAgentVersions(): Map<string, Set<string>>;
3036
3267
  resolveCanonicalId(input: string): Promise<string | undefined>;
3037
3268
  require(sessionId: string): Session;
3269
+ liveListEntry(session: Session): SessionListEntry;
3038
3270
  list(filter?: {
3039
3271
  cwd?: string;
3040
3272
  includeNonInteractive?: boolean;
3041
3273
  }): Promise<SessionListEntry[]>;
3042
- exportBundle(sessionId: string): Promise<{
3274
+ exportBundle(sessionId: string, opts?: {
3275
+ tools?: "inline" | "references";
3276
+ }): Promise<{
3043
3277
  record: SessionRecord & {
3044
3278
  lineageId: string;
3045
3279
  };
3046
3280
  history: HistoryEntry[];
3047
3281
  promptHistory: string[];
3282
+ toolBlobs?: Record<string, string>;
3048
3283
  } | undefined>;
3049
3284
  importBundle(bundle: Bundle, opts?: {
3050
3285
  replace?: boolean;
@@ -3170,7 +3405,12 @@ declare const paths: {
3170
3405
  sessionDir: (id: string) => string;
3171
3406
  sessionFile: (id: string) => string;
3172
3407
  historyFile: (id: string) => string;
3408
+ toolsDir: (id: string) => string;
3409
+ toolBlobFile: (id: string, hash: string) => string;
3173
3410
  queueFile: (id: string) => string;
3411
+ tombstonesDir: () => string;
3412
+ tombstoneAgentDir: (agentId: string) => string;
3413
+ tombstoneFile: (agentId: string, upstreamSessionId: string) => string;
3174
3414
  extensionsDir: () => string;
3175
3415
  extensionLogFile: (name: string) => string;
3176
3416
  extensionPidFile: (name: string) => string;