@hydra-acp/cli 0.1.60 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -107
- package/dist/cli.js +2324 -764
- package/dist/index.d.ts +231 -22
- package/dist/index.js +1372 -541
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -95,13 +95,42 @@ 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>;
|
|
@@ -228,10 +257,21 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
228
257
|
env: Record<string, string>;
|
|
229
258
|
enabled: boolean;
|
|
230
259
|
}>;
|
|
260
|
+
agents: Record<string, {
|
|
261
|
+
name?: string | undefined;
|
|
262
|
+
args?: string[] | undefined;
|
|
263
|
+
command?: string | undefined;
|
|
264
|
+
env?: Record<string, string> | undefined;
|
|
265
|
+
description?: string | undefined;
|
|
266
|
+
}>;
|
|
231
267
|
registry: {
|
|
232
268
|
url: string;
|
|
233
269
|
ttlHours: number;
|
|
270
|
+
pinned: boolean;
|
|
234
271
|
};
|
|
272
|
+
agentOverrides: Record<string, {
|
|
273
|
+
packageSpec?: string | undefined;
|
|
274
|
+
}>;
|
|
235
275
|
defaultAgent: string;
|
|
236
276
|
defaultModels: Record<string, string>;
|
|
237
277
|
synopsisOnClose: boolean;
|
|
@@ -283,10 +323,21 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
283
323
|
env?: Record<string, string> | undefined;
|
|
284
324
|
enabled?: boolean | undefined;
|
|
285
325
|
}> | undefined;
|
|
326
|
+
agents?: Record<string, {
|
|
327
|
+
name?: string | undefined;
|
|
328
|
+
args?: string[] | undefined;
|
|
329
|
+
command?: string | undefined;
|
|
330
|
+
env?: Record<string, string> | undefined;
|
|
331
|
+
description?: string | undefined;
|
|
332
|
+
}> | undefined;
|
|
286
333
|
registry?: {
|
|
287
334
|
url?: string | undefined;
|
|
288
335
|
ttlHours?: number | undefined;
|
|
336
|
+
pinned?: boolean | undefined;
|
|
289
337
|
} | undefined;
|
|
338
|
+
agentOverrides?: Record<string, {
|
|
339
|
+
packageSpec?: string | undefined;
|
|
340
|
+
}> | undefined;
|
|
290
341
|
defaultAgent?: string | undefined;
|
|
291
342
|
defaultModels?: Record<string, string> | undefined;
|
|
292
343
|
synopsisAgent?: string | undefined;
|
|
@@ -558,6 +609,19 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
558
609
|
args?: string[] | undefined;
|
|
559
610
|
env?: Record<string, string> | undefined;
|
|
560
611
|
}>>;
|
|
612
|
+
exec: z.ZodOptional<z.ZodObject<{
|
|
613
|
+
command: z.ZodString;
|
|
614
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
615
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
616
|
+
}, "strip", z.ZodTypeAny, {
|
|
617
|
+
command: string;
|
|
618
|
+
args?: string[] | undefined;
|
|
619
|
+
env?: Record<string, string> | undefined;
|
|
620
|
+
}, {
|
|
621
|
+
command: string;
|
|
622
|
+
args?: string[] | undefined;
|
|
623
|
+
env?: Record<string, string> | undefined;
|
|
624
|
+
}>>;
|
|
561
625
|
}, "strip", z.ZodTypeAny, {
|
|
562
626
|
binary?: {
|
|
563
627
|
"darwin-aarch64"?: {
|
|
@@ -608,6 +672,11 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
608
672
|
args?: string[] | undefined;
|
|
609
673
|
env?: Record<string, string> | undefined;
|
|
610
674
|
} | undefined;
|
|
675
|
+
exec?: {
|
|
676
|
+
command: string;
|
|
677
|
+
args?: string[] | undefined;
|
|
678
|
+
env?: Record<string, string> | undefined;
|
|
679
|
+
} | undefined;
|
|
611
680
|
}, {
|
|
612
681
|
binary?: {
|
|
613
682
|
"darwin-aarch64"?: {
|
|
@@ -658,6 +727,11 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
658
727
|
args?: string[] | undefined;
|
|
659
728
|
env?: Record<string, string> | undefined;
|
|
660
729
|
} | undefined;
|
|
730
|
+
exec?: {
|
|
731
|
+
command: string;
|
|
732
|
+
args?: string[] | undefined;
|
|
733
|
+
env?: Record<string, string> | undefined;
|
|
734
|
+
} | undefined;
|
|
661
735
|
}>;
|
|
662
736
|
}, "strip", z.ZodTypeAny, {
|
|
663
737
|
name: string;
|
|
@@ -712,6 +786,11 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
712
786
|
args?: string[] | undefined;
|
|
713
787
|
env?: Record<string, string> | undefined;
|
|
714
788
|
} | undefined;
|
|
789
|
+
exec?: {
|
|
790
|
+
command: string;
|
|
791
|
+
args?: string[] | undefined;
|
|
792
|
+
env?: Record<string, string> | undefined;
|
|
793
|
+
} | undefined;
|
|
715
794
|
};
|
|
716
795
|
version?: string | undefined;
|
|
717
796
|
description?: string | undefined;
|
|
@@ -773,6 +852,11 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
773
852
|
args?: string[] | undefined;
|
|
774
853
|
env?: Record<string, string> | undefined;
|
|
775
854
|
} | undefined;
|
|
855
|
+
exec?: {
|
|
856
|
+
command: string;
|
|
857
|
+
args?: string[] | undefined;
|
|
858
|
+
env?: Record<string, string> | undefined;
|
|
859
|
+
} | undefined;
|
|
776
860
|
};
|
|
777
861
|
version?: string | undefined;
|
|
778
862
|
description?: string | undefined;
|
|
@@ -997,6 +1081,19 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
997
1081
|
args?: string[] | undefined;
|
|
998
1082
|
env?: Record<string, string> | undefined;
|
|
999
1083
|
}>>;
|
|
1084
|
+
exec: z.ZodOptional<z.ZodObject<{
|
|
1085
|
+
command: z.ZodString;
|
|
1086
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1087
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1088
|
+
}, "strip", z.ZodTypeAny, {
|
|
1089
|
+
command: string;
|
|
1090
|
+
args?: string[] | undefined;
|
|
1091
|
+
env?: Record<string, string> | undefined;
|
|
1092
|
+
}, {
|
|
1093
|
+
command: string;
|
|
1094
|
+
args?: string[] | undefined;
|
|
1095
|
+
env?: Record<string, string> | undefined;
|
|
1096
|
+
}>>;
|
|
1000
1097
|
}, "strip", z.ZodTypeAny, {
|
|
1001
1098
|
binary?: {
|
|
1002
1099
|
"darwin-aarch64"?: {
|
|
@@ -1047,6 +1144,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1047
1144
|
args?: string[] | undefined;
|
|
1048
1145
|
env?: Record<string, string> | undefined;
|
|
1049
1146
|
} | undefined;
|
|
1147
|
+
exec?: {
|
|
1148
|
+
command: string;
|
|
1149
|
+
args?: string[] | undefined;
|
|
1150
|
+
env?: Record<string, string> | undefined;
|
|
1151
|
+
} | undefined;
|
|
1050
1152
|
}, {
|
|
1051
1153
|
binary?: {
|
|
1052
1154
|
"darwin-aarch64"?: {
|
|
@@ -1097,6 +1199,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1097
1199
|
args?: string[] | undefined;
|
|
1098
1200
|
env?: Record<string, string> | undefined;
|
|
1099
1201
|
} | undefined;
|
|
1202
|
+
exec?: {
|
|
1203
|
+
command: string;
|
|
1204
|
+
args?: string[] | undefined;
|
|
1205
|
+
env?: Record<string, string> | undefined;
|
|
1206
|
+
} | undefined;
|
|
1100
1207
|
}>;
|
|
1101
1208
|
}, "strip", z.ZodTypeAny, {
|
|
1102
1209
|
name: string;
|
|
@@ -1151,6 +1258,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1151
1258
|
args?: string[] | undefined;
|
|
1152
1259
|
env?: Record<string, string> | undefined;
|
|
1153
1260
|
} | undefined;
|
|
1261
|
+
exec?: {
|
|
1262
|
+
command: string;
|
|
1263
|
+
args?: string[] | undefined;
|
|
1264
|
+
env?: Record<string, string> | undefined;
|
|
1265
|
+
} | undefined;
|
|
1154
1266
|
};
|
|
1155
1267
|
version?: string | undefined;
|
|
1156
1268
|
description?: string | undefined;
|
|
@@ -1212,6 +1324,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1212
1324
|
args?: string[] | undefined;
|
|
1213
1325
|
env?: Record<string, string> | undefined;
|
|
1214
1326
|
} | undefined;
|
|
1327
|
+
exec?: {
|
|
1328
|
+
command: string;
|
|
1329
|
+
args?: string[] | undefined;
|
|
1330
|
+
env?: Record<string, string> | undefined;
|
|
1331
|
+
} | undefined;
|
|
1215
1332
|
};
|
|
1216
1333
|
version?: string | undefined;
|
|
1217
1334
|
description?: string | undefined;
|
|
@@ -1277,6 +1394,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1277
1394
|
args?: string[] | undefined;
|
|
1278
1395
|
env?: Record<string, string> | undefined;
|
|
1279
1396
|
} | undefined;
|
|
1397
|
+
exec?: {
|
|
1398
|
+
command: string;
|
|
1399
|
+
args?: string[] | undefined;
|
|
1400
|
+
env?: Record<string, string> | undefined;
|
|
1401
|
+
} | undefined;
|
|
1280
1402
|
};
|
|
1281
1403
|
version?: string | undefined;
|
|
1282
1404
|
description?: string | undefined;
|
|
@@ -1342,6 +1464,11 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1342
1464
|
args?: string[] | undefined;
|
|
1343
1465
|
env?: Record<string, string> | undefined;
|
|
1344
1466
|
} | undefined;
|
|
1467
|
+
exec?: {
|
|
1468
|
+
command: string;
|
|
1469
|
+
args?: string[] | undefined;
|
|
1470
|
+
env?: Record<string, string> | undefined;
|
|
1471
|
+
} | undefined;
|
|
1345
1472
|
};
|
|
1346
1473
|
version?: string | undefined;
|
|
1347
1474
|
description?: string | undefined;
|
|
@@ -1366,6 +1493,9 @@ declare class Registry {
|
|
|
1366
1493
|
refresh(): Promise<RegistryDocument>;
|
|
1367
1494
|
lastFetchedAt(): number | undefined;
|
|
1368
1495
|
getAgent(id: string): Promise<RegistryAgent | undefined>;
|
|
1496
|
+
localAgents(): RegistryAgent[];
|
|
1497
|
+
private applyOverride;
|
|
1498
|
+
private isPinned;
|
|
1369
1499
|
private isFresh;
|
|
1370
1500
|
private fetchFromNetwork;
|
|
1371
1501
|
private readDiskCache;
|
|
@@ -1423,36 +1553,27 @@ declare const SessionAttachParams: z.ZodObject<{
|
|
|
1423
1553
|
name: string;
|
|
1424
1554
|
version?: string | undefined;
|
|
1425
1555
|
}>>;
|
|
1426
|
-
readonly: z.ZodOptional<z.ZodBoolean>;
|
|
1427
|
-
replayMode: z.ZodOptional<z.ZodEnum<["instant", "drip"]>>;
|
|
1428
|
-
dripSpeed: z.ZodOptional<z.ZodNumber>;
|
|
1429
1556
|
_meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1430
1557
|
}, "strip", z.ZodTypeAny, {
|
|
1431
1558
|
sessionId: string;
|
|
1432
1559
|
historyPolicy: "none" | "full" | "pending_only" | "after_message";
|
|
1433
|
-
readonly?: boolean | undefined;
|
|
1434
1560
|
clientInfo?: {
|
|
1435
1561
|
name: string;
|
|
1436
1562
|
version?: string | undefined;
|
|
1437
1563
|
} | undefined;
|
|
1564
|
+
_meta?: Record<string, unknown> | undefined;
|
|
1438
1565
|
afterMessageId?: string | undefined;
|
|
1439
1566
|
clientId?: string | undefined;
|
|
1440
|
-
replayMode?: "drip" | "instant" | undefined;
|
|
1441
|
-
dripSpeed?: number | undefined;
|
|
1442
|
-
_meta?: Record<string, unknown> | undefined;
|
|
1443
1567
|
}, {
|
|
1444
1568
|
sessionId: string;
|
|
1445
|
-
readonly?: boolean | undefined;
|
|
1446
1569
|
clientInfo?: {
|
|
1447
1570
|
name: string;
|
|
1448
1571
|
version?: string | undefined;
|
|
1449
1572
|
} | undefined;
|
|
1573
|
+
_meta?: Record<string, unknown> | undefined;
|
|
1450
1574
|
historyPolicy?: "none" | "full" | "pending_only" | "after_message" | undefined;
|
|
1451
1575
|
afterMessageId?: string | undefined;
|
|
1452
1576
|
clientId?: string | undefined;
|
|
1453
|
-
replayMode?: "drip" | "instant" | undefined;
|
|
1454
|
-
dripSpeed?: number | undefined;
|
|
1455
|
-
_meta?: Record<string, unknown> | undefined;
|
|
1456
1577
|
}>;
|
|
1457
1578
|
type SessionAttachParams = z.infer<typeof SessionAttachParams>;
|
|
1458
1579
|
interface PromptOriginator {
|
|
@@ -1535,14 +1656,14 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1535
1656
|
sessionId: string;
|
|
1536
1657
|
cwd: string;
|
|
1537
1658
|
status: "live" | "cold";
|
|
1538
|
-
updatedAt: string;
|
|
1539
|
-
attachedClients: number;
|
|
1540
1659
|
busy: boolean;
|
|
1541
1660
|
awaitingInput: boolean;
|
|
1661
|
+
attachedClients: number;
|
|
1662
|
+
updatedAt: string;
|
|
1542
1663
|
title?: string | undefined;
|
|
1543
|
-
agentId?: string | undefined;
|
|
1544
|
-
upstreamSessionId?: string | undefined;
|
|
1545
1664
|
_meta?: Record<string, unknown> | undefined;
|
|
1665
|
+
upstreamSessionId?: string | undefined;
|
|
1666
|
+
agentId?: string | undefined;
|
|
1546
1667
|
currentModel?: string | undefined;
|
|
1547
1668
|
currentUsage?: {
|
|
1548
1669
|
used?: number | undefined;
|
|
@@ -1563,13 +1684,13 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1563
1684
|
}, {
|
|
1564
1685
|
sessionId: string;
|
|
1565
1686
|
cwd: string;
|
|
1566
|
-
updatedAt: string;
|
|
1567
1687
|
attachedClients: number;
|
|
1688
|
+
updatedAt: string;
|
|
1568
1689
|
status?: "live" | "cold" | undefined;
|
|
1569
1690
|
title?: string | undefined;
|
|
1570
|
-
agentId?: string | undefined;
|
|
1571
|
-
upstreamSessionId?: string | undefined;
|
|
1572
1691
|
_meta?: Record<string, unknown> | undefined;
|
|
1692
|
+
upstreamSessionId?: string | undefined;
|
|
1693
|
+
agentId?: string | undefined;
|
|
1573
1694
|
currentModel?: string | undefined;
|
|
1574
1695
|
currentUsage?: {
|
|
1575
1696
|
used?: number | undefined;
|
|
@@ -1578,6 +1699,8 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1578
1699
|
costCurrency?: string | undefined;
|
|
1579
1700
|
} | undefined;
|
|
1580
1701
|
interactive?: boolean | undefined;
|
|
1702
|
+
busy?: boolean | undefined;
|
|
1703
|
+
awaitingInput?: boolean | undefined;
|
|
1581
1704
|
importedFromMachine?: string | undefined;
|
|
1582
1705
|
importedFromUpstreamSessionId?: string | undefined;
|
|
1583
1706
|
parentSessionId?: string | undefined;
|
|
@@ -1587,8 +1710,6 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1587
1710
|
name: string;
|
|
1588
1711
|
version?: string | undefined;
|
|
1589
1712
|
} | undefined;
|
|
1590
|
-
busy?: boolean | undefined;
|
|
1591
|
-
awaitingInput?: boolean | undefined;
|
|
1592
1713
|
}>;
|
|
1593
1714
|
type SessionListEntry = z.infer<typeof SessionListEntry>;
|
|
1594
1715
|
declare const SessionListResult: z.ZodObject<{
|
|
@@ -1741,12 +1862,18 @@ declare class JsonRpcConnection {
|
|
|
1741
1862
|
private pending;
|
|
1742
1863
|
private closed;
|
|
1743
1864
|
private closeHandlers;
|
|
1865
|
+
private orphanErrorHandlers;
|
|
1744
1866
|
constructor(stream: MessageStream);
|
|
1745
1867
|
onRequest(method: string, handler: RequestHandler): void;
|
|
1746
1868
|
setDefaultHandler(handler: RequestHandler): void;
|
|
1747
1869
|
onNotification(method: string, handler: NotificationHandler): void;
|
|
1748
1870
|
drainBuffered(method: string): number;
|
|
1749
1871
|
onClose(handler: (err?: Error) => void): void;
|
|
1872
|
+
onOrphanError(handler: (error: {
|
|
1873
|
+
code?: number;
|
|
1874
|
+
message: string;
|
|
1875
|
+
data?: unknown;
|
|
1876
|
+
}) => void): void;
|
|
1750
1877
|
request<T = unknown>(method: string, params?: unknown): Promise<T>;
|
|
1751
1878
|
requestWithId<T = unknown>(method: string, params?: unknown): {
|
|
1752
1879
|
id: JsonRpcId;
|
|
@@ -1984,6 +2111,20 @@ interface AdvertisedModel {
|
|
|
1984
2111
|
name?: string;
|
|
1985
2112
|
description?: string;
|
|
1986
2113
|
}
|
|
2114
|
+
interface ConfigOptionValue {
|
|
2115
|
+
value: string;
|
|
2116
|
+
name: string;
|
|
2117
|
+
description?: string;
|
|
2118
|
+
}
|
|
2119
|
+
interface ConfigOption {
|
|
2120
|
+
id: string;
|
|
2121
|
+
name: string;
|
|
2122
|
+
description?: string;
|
|
2123
|
+
category?: string;
|
|
2124
|
+
type: "select";
|
|
2125
|
+
currentValue: string;
|
|
2126
|
+
options: ConfigOptionValue[];
|
|
2127
|
+
}
|
|
1987
2128
|
|
|
1988
2129
|
interface ExtensionCommandSpec {
|
|
1989
2130
|
verb: string;
|
|
@@ -2062,6 +2203,10 @@ interface SpawnReplacementAgentResult {
|
|
|
2062
2203
|
upstreamSessionId: string;
|
|
2063
2204
|
agentMeta?: Record<string, unknown>;
|
|
2064
2205
|
agentCapabilities?: AgentCapabilities;
|
|
2206
|
+
initialModel?: string;
|
|
2207
|
+
initialModels?: AdvertisedModel[];
|
|
2208
|
+
initialMode?: string;
|
|
2209
|
+
initialModes?: AdvertisedMode[];
|
|
2065
2210
|
}
|
|
2066
2211
|
type SpawnReplacementAgent = (params: SpawnReplacementAgentParams) => Promise<SpawnReplacementAgentResult>;
|
|
2067
2212
|
interface UsageSnapshot {
|
|
@@ -2116,6 +2261,11 @@ interface SessionInit {
|
|
|
2116
2261
|
currentModel?: string;
|
|
2117
2262
|
}[]>;
|
|
2118
2263
|
extensionCommands?: ExtensionCommandRegistry;
|
|
2264
|
+
availableAgents?: () => Array<{
|
|
2265
|
+
id: string;
|
|
2266
|
+
name?: string;
|
|
2267
|
+
description?: string;
|
|
2268
|
+
}>;
|
|
2119
2269
|
}
|
|
2120
2270
|
interface CloseOptions {
|
|
2121
2271
|
deleteRecord?: boolean;
|
|
@@ -2157,6 +2307,9 @@ declare class Session {
|
|
|
2157
2307
|
private titleHandlers;
|
|
2158
2308
|
private scheduleSynopsisHook?;
|
|
2159
2309
|
private broadcastHandlers;
|
|
2310
|
+
private lastCancelAt;
|
|
2311
|
+
private static readonly CANCEL_ERROR_WINDOW_MS;
|
|
2312
|
+
private forceCancelling;
|
|
2160
2313
|
private _firstPromptSeeded;
|
|
2161
2314
|
get firstPromptSeeded(): boolean;
|
|
2162
2315
|
private promptStartedAt;
|
|
@@ -2184,6 +2337,7 @@ declare class Session {
|
|
|
2184
2337
|
private agentCommandsHandlers;
|
|
2185
2338
|
private agentModesHandlers;
|
|
2186
2339
|
private agentModelsHandlers;
|
|
2340
|
+
private availableAgentsFn?;
|
|
2187
2341
|
private modelHandlers;
|
|
2188
2342
|
private modeHandlers;
|
|
2189
2343
|
private interactiveHandlers;
|
|
@@ -2199,6 +2353,7 @@ declare class Session {
|
|
|
2199
2353
|
private broadcastAvailableModes;
|
|
2200
2354
|
private broadcastAvailableModels;
|
|
2201
2355
|
private wireAgent;
|
|
2356
|
+
private handleOrphanError;
|
|
2202
2357
|
private runResponseChain;
|
|
2203
2358
|
onAgentChange(handler: (info: {
|
|
2204
2359
|
agentId: string;
|
|
@@ -2280,6 +2435,9 @@ declare class Session {
|
|
|
2280
2435
|
onInteractiveChange(handler: (interactive: boolean) => void): void;
|
|
2281
2436
|
applyModelChange(modelId: string): void;
|
|
2282
2437
|
applyModeChange(modeId: string): void;
|
|
2438
|
+
buildConfigOptions(): ConfigOption[];
|
|
2439
|
+
private broadcastConfigOptions;
|
|
2440
|
+
private mergeAgentOptionIntoEnvelope;
|
|
2283
2441
|
onUsageChange(handler: (usage: UsageSnapshot) => void): void;
|
|
2284
2442
|
mergedAvailableCommands(): AdvertisedCommand[];
|
|
2285
2443
|
agentOnlyAdvertisedCommands(): AdvertisedCommand[];
|
|
@@ -2295,9 +2453,14 @@ declare class Session {
|
|
|
2295
2453
|
private handleModeCommand;
|
|
2296
2454
|
private runTitleCommand;
|
|
2297
2455
|
private runInternalPrompt;
|
|
2456
|
+
setAgent(newAgentId: string): Promise<unknown>;
|
|
2298
2457
|
private runAgentCommand;
|
|
2299
2458
|
private runKillCommand;
|
|
2300
2459
|
private runRestartCommand;
|
|
2460
|
+
forceCancel(): Promise<{
|
|
2461
|
+
stopReason: string;
|
|
2462
|
+
}>;
|
|
2463
|
+
private respawnAgent;
|
|
2301
2464
|
private buildSwitchTranscript;
|
|
2302
2465
|
seedFromImport(): Promise<void>;
|
|
2303
2466
|
private broadcastAgentSwitch;
|
|
@@ -2501,8 +2664,8 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2501
2664
|
sessionId: string;
|
|
2502
2665
|
version: 1;
|
|
2503
2666
|
cwd: string;
|
|
2504
|
-
agentId: string;
|
|
2505
2667
|
upstreamSessionId: string;
|
|
2668
|
+
agentId: string;
|
|
2506
2669
|
updatedAt: string;
|
|
2507
2670
|
createdAt: string;
|
|
2508
2671
|
title?: string | undefined;
|
|
@@ -2556,8 +2719,8 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2556
2719
|
sessionId: string;
|
|
2557
2720
|
version: 1;
|
|
2558
2721
|
cwd: string;
|
|
2559
|
-
agentId: string;
|
|
2560
2722
|
upstreamSessionId: string;
|
|
2723
|
+
agentId: string;
|
|
2561
2724
|
updatedAt: string;
|
|
2562
2725
|
createdAt: string;
|
|
2563
2726
|
title?: string | undefined;
|
|
@@ -2617,6 +2780,44 @@ declare class SessionStore {
|
|
|
2617
2780
|
list(): Promise<SessionRecord[]>;
|
|
2618
2781
|
}
|
|
2619
2782
|
|
|
2783
|
+
declare const Tombstone: z.ZodObject<{
|
|
2784
|
+
version: z.ZodLiteral<1>;
|
|
2785
|
+
agentId: z.ZodString;
|
|
2786
|
+
upstreamSessionId: z.ZodString;
|
|
2787
|
+
deletedAt: z.ZodString;
|
|
2788
|
+
upstreamUpdatedAt: z.ZodOptional<z.ZodString>;
|
|
2789
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
2790
|
+
title: z.ZodOptional<z.ZodString>;
|
|
2791
|
+
reason: z.ZodOptional<z.ZodEnum<["user", "expired"]>>;
|
|
2792
|
+
}, "strip", z.ZodTypeAny, {
|
|
2793
|
+
version: 1;
|
|
2794
|
+
upstreamSessionId: string;
|
|
2795
|
+
agentId: string;
|
|
2796
|
+
deletedAt: string;
|
|
2797
|
+
cwd?: string | undefined;
|
|
2798
|
+
title?: string | undefined;
|
|
2799
|
+
reason?: "user" | "expired" | undefined;
|
|
2800
|
+
upstreamUpdatedAt?: string | undefined;
|
|
2801
|
+
}, {
|
|
2802
|
+
version: 1;
|
|
2803
|
+
upstreamSessionId: string;
|
|
2804
|
+
agentId: string;
|
|
2805
|
+
deletedAt: string;
|
|
2806
|
+
cwd?: string | undefined;
|
|
2807
|
+
title?: string | undefined;
|
|
2808
|
+
reason?: "user" | "expired" | undefined;
|
|
2809
|
+
upstreamUpdatedAt?: string | undefined;
|
|
2810
|
+
}>;
|
|
2811
|
+
type Tombstone = z.infer<typeof Tombstone>;
|
|
2812
|
+
declare class TombstoneStore {
|
|
2813
|
+
add(t: Omit<Tombstone, "version">): Promise<void>;
|
|
2814
|
+
has(agentId: string, upstreamSessionId: string): Promise<boolean>;
|
|
2815
|
+
read(agentId: string, upstreamSessionId: string): Promise<Tombstone | undefined>;
|
|
2816
|
+
remove(agentId: string, upstreamSessionId: string): Promise<void>;
|
|
2817
|
+
list(agentId?: string): Promise<Tombstone[]>;
|
|
2818
|
+
private listForAgent;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2620
2821
|
declare const Bundle: z.ZodObject<{
|
|
2621
2822
|
version: z.ZodLiteral<1>;
|
|
2622
2823
|
exportedAt: z.ZodString;
|
|
@@ -2988,6 +3189,7 @@ interface SessionManagerOptions {
|
|
|
2988
3189
|
npmRegistry?: string;
|
|
2989
3190
|
extensionCommands?: ExtensionCommandRegistry;
|
|
2990
3191
|
defaultCwd?: string;
|
|
3192
|
+
tombstones?: TombstoneStore;
|
|
2991
3193
|
}
|
|
2992
3194
|
declare class SessionManager {
|
|
2993
3195
|
private registry;
|
|
@@ -2995,6 +3197,7 @@ declare class SessionManager {
|
|
|
2995
3197
|
private resurrectionInflight;
|
|
2996
3198
|
private spawner;
|
|
2997
3199
|
private store;
|
|
3200
|
+
private tombstones;
|
|
2998
3201
|
private histories;
|
|
2999
3202
|
private idleTimeoutMs;
|
|
3000
3203
|
private defaultModels;
|
|
@@ -3010,7 +3213,9 @@ declare class SessionManager {
|
|
|
3010
3213
|
private extensionCommands?;
|
|
3011
3214
|
private defaultCwd;
|
|
3012
3215
|
private synopsisCoordinator;
|
|
3216
|
+
private agentCatalog;
|
|
3013
3217
|
constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
|
|
3218
|
+
private refreshAgentCatalog;
|
|
3014
3219
|
create(params: CreateSessionParams): Promise<Session>;
|
|
3015
3220
|
resurrect(params: ResurrectParams): Promise<Session>;
|
|
3016
3221
|
private doResurrect;
|
|
@@ -3035,6 +3240,7 @@ declare class SessionManager {
|
|
|
3035
3240
|
activeAgentVersions(): Map<string, Set<string>>;
|
|
3036
3241
|
resolveCanonicalId(input: string): Promise<string | undefined>;
|
|
3037
3242
|
require(sessionId: string): Session;
|
|
3243
|
+
liveListEntry(session: Session): SessionListEntry;
|
|
3038
3244
|
list(filter?: {
|
|
3039
3245
|
cwd?: string;
|
|
3040
3246
|
includeNonInteractive?: boolean;
|
|
@@ -3171,6 +3377,9 @@ declare const paths: {
|
|
|
3171
3377
|
sessionFile: (id: string) => string;
|
|
3172
3378
|
historyFile: (id: string) => string;
|
|
3173
3379
|
queueFile: (id: string) => string;
|
|
3380
|
+
tombstonesDir: () => string;
|
|
3381
|
+
tombstoneAgentDir: (agentId: string) => string;
|
|
3382
|
+
tombstoneFile: (agentId: string, upstreamSessionId: string) => string;
|
|
3174
3383
|
extensionsDir: () => string;
|
|
3175
3384
|
extensionLogFile: (name: string) => string;
|
|
3176
3385
|
extensionPidFile: (name: string) => string;
|