@hydra-acp/cli 0.1.22 → 0.1.24
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 +49 -47
- package/dist/cli.js +2622 -433
- package/dist/index.d.ts +171 -26
- package/dist/index.js +1605 -206
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -24,10 +24,9 @@ type ExtensionConfig = ExtensionBody & {
|
|
|
24
24
|
name: string;
|
|
25
25
|
};
|
|
26
26
|
declare const HydraConfig: z.ZodObject<{
|
|
27
|
-
daemon: z.ZodObject<{
|
|
27
|
+
daemon: z.ZodDefault<z.ZodObject<{
|
|
28
28
|
host: z.ZodDefault<z.ZodString>;
|
|
29
29
|
port: z.ZodDefault<z.ZodNumber>;
|
|
30
|
-
authToken: z.ZodString;
|
|
31
30
|
logLevel: z.ZodDefault<z.ZodEnum<["debug", "info", "warn", "error"]>>;
|
|
32
31
|
tls: z.ZodOptional<z.ZodObject<{
|
|
33
32
|
cert: z.ZodString;
|
|
@@ -45,7 +44,6 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
45
44
|
}, "strip", z.ZodTypeAny, {
|
|
46
45
|
host: string;
|
|
47
46
|
port: number;
|
|
48
|
-
authToken: string;
|
|
49
47
|
logLevel: "info" | "debug" | "warn" | "error";
|
|
50
48
|
sessionIdleTimeoutSeconds: number;
|
|
51
49
|
sessionHistoryMaxEntries: number;
|
|
@@ -55,7 +53,6 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
55
53
|
key: string;
|
|
56
54
|
} | undefined;
|
|
57
55
|
}, {
|
|
58
|
-
authToken: string;
|
|
59
56
|
host?: string | undefined;
|
|
60
57
|
port?: number | undefined;
|
|
61
58
|
logLevel?: "info" | "debug" | "warn" | "error" | undefined;
|
|
@@ -66,7 +63,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
66
63
|
sessionIdleTimeoutSeconds?: number | undefined;
|
|
67
64
|
sessionHistoryMaxEntries?: number | undefined;
|
|
68
65
|
agentStderrTailBytes?: number | undefined;
|
|
69
|
-
}
|
|
66
|
+
}>>;
|
|
70
67
|
registry: z.ZodDefault<z.ZodObject<{
|
|
71
68
|
url: z.ZodDefault<z.ZodString>;
|
|
72
69
|
ttlHours: z.ZodDefault<z.ZodNumber>;
|
|
@@ -97,6 +94,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
97
94
|
env?: Record<string, string> | undefined;
|
|
98
95
|
enabled?: boolean | undefined;
|
|
99
96
|
}>>>;
|
|
97
|
+
npmRegistry: z.ZodOptional<z.ZodString>;
|
|
100
98
|
tui: z.ZodDefault<z.ZodObject<{
|
|
101
99
|
repaintThrottleMs: z.ZodDefault<z.ZodNumber>;
|
|
102
100
|
maxScrollbackLines: z.ZodDefault<z.ZodNumber>;
|
|
@@ -123,7 +121,6 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
123
121
|
daemon: {
|
|
124
122
|
host: string;
|
|
125
123
|
port: number;
|
|
126
|
-
authToken: string;
|
|
127
124
|
logLevel: "info" | "debug" | "warn" | "error";
|
|
128
125
|
sessionIdleTimeoutSeconds: number;
|
|
129
126
|
sessionHistoryMaxEntries: number;
|
|
@@ -155,9 +152,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
155
152
|
defaultModels: Record<string, string>;
|
|
156
153
|
defaultCwd: string;
|
|
157
154
|
sessionListColdLimit: number;
|
|
155
|
+
npmRegistry?: string | undefined;
|
|
158
156
|
}, {
|
|
159
|
-
daemon
|
|
160
|
-
authToken: string;
|
|
157
|
+
daemon?: {
|
|
161
158
|
host?: string | undefined;
|
|
162
159
|
port?: number | undefined;
|
|
163
160
|
logLevel?: "info" | "debug" | "warn" | "error" | undefined;
|
|
@@ -168,7 +165,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
168
165
|
sessionIdleTimeoutSeconds?: number | undefined;
|
|
169
166
|
sessionHistoryMaxEntries?: number | undefined;
|
|
170
167
|
agentStderrTailBytes?: number | undefined;
|
|
171
|
-
};
|
|
168
|
+
} | undefined;
|
|
172
169
|
extensions?: Record<string, {
|
|
173
170
|
command?: string[] | undefined;
|
|
174
171
|
args?: string[] | undefined;
|
|
@@ -191,12 +188,11 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
191
188
|
defaultModels?: Record<string, string> | undefined;
|
|
192
189
|
defaultCwd?: string | undefined;
|
|
193
190
|
sessionListColdLimit?: number | undefined;
|
|
191
|
+
npmRegistry?: string | undefined;
|
|
194
192
|
}>;
|
|
195
193
|
type HydraConfig = z.infer<typeof HydraConfig>;
|
|
196
194
|
declare function loadConfig(): Promise<HydraConfig>;
|
|
197
|
-
declare function ensureConfig(): Promise<HydraConfig>;
|
|
198
195
|
declare function writeConfig(config: HydraConfig): Promise<void>;
|
|
199
|
-
declare function generateAuthToken(): string;
|
|
200
196
|
declare function defaultConfig(): HydraConfig;
|
|
201
197
|
|
|
202
198
|
declare const RegistryAgent: z.ZodObject<{
|
|
@@ -1207,10 +1203,14 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1207
1203
|
extensions?: unknown[] | undefined;
|
|
1208
1204
|
}>;
|
|
1209
1205
|
type RegistryDocument = z.infer<typeof RegistryDocument>;
|
|
1206
|
+
interface RegistryOptions {
|
|
1207
|
+
onFetched?: (doc: RegistryDocument) => void | Promise<void>;
|
|
1208
|
+
}
|
|
1210
1209
|
declare class Registry {
|
|
1211
1210
|
private config;
|
|
1211
|
+
private options;
|
|
1212
1212
|
private cache;
|
|
1213
|
-
constructor(config: HydraConfig);
|
|
1213
|
+
constructor(config: HydraConfig, options?: RegistryOptions);
|
|
1214
1214
|
load(): Promise<RegistryDocument>;
|
|
1215
1215
|
refresh(): Promise<RegistryDocument>;
|
|
1216
1216
|
getAgent(id: string): Promise<RegistryAgent | undefined>;
|
|
@@ -1223,8 +1223,11 @@ interface SpawnPlan {
|
|
|
1223
1223
|
command: string;
|
|
1224
1224
|
args: string[];
|
|
1225
1225
|
env: Record<string, string>;
|
|
1226
|
+
version: string;
|
|
1226
1227
|
}
|
|
1227
|
-
declare function planSpawn(agent: RegistryAgent, callerArgs?: string[]
|
|
1228
|
+
declare function planSpawn(agent: RegistryAgent, callerArgs?: string[], options?: {
|
|
1229
|
+
npmRegistry?: string;
|
|
1230
|
+
}): Promise<SpawnPlan>;
|
|
1228
1231
|
|
|
1229
1232
|
type JsonRpcId = string | number;
|
|
1230
1233
|
interface JsonRpcRequest {
|
|
@@ -1290,6 +1293,18 @@ declare const SessionAttachParams: z.ZodObject<{
|
|
|
1290
1293
|
_meta?: Record<string, unknown> | undefined;
|
|
1291
1294
|
}>;
|
|
1292
1295
|
type SessionAttachParams = z.infer<typeof SessionAttachParams>;
|
|
1296
|
+
interface PromptOriginator {
|
|
1297
|
+
clientId: string;
|
|
1298
|
+
name?: string;
|
|
1299
|
+
version?: string;
|
|
1300
|
+
}
|
|
1301
|
+
interface PromptQueueEntry {
|
|
1302
|
+
messageId: string;
|
|
1303
|
+
originator: PromptOriginator;
|
|
1304
|
+
prompt: unknown[];
|
|
1305
|
+
position: number;
|
|
1306
|
+
enqueuedAt: number;
|
|
1307
|
+
}
|
|
1293
1308
|
declare const SessionDetachParams: z.ZodObject<{
|
|
1294
1309
|
sessionId: z.ZodString;
|
|
1295
1310
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1497,6 +1512,28 @@ declare const SessionListResult: z.ZodObject<{
|
|
|
1497
1512
|
nextCursor?: string | undefined;
|
|
1498
1513
|
}>;
|
|
1499
1514
|
type SessionListResult = z.infer<typeof SessionListResult>;
|
|
1515
|
+
declare const CancelPromptResult: z.ZodObject<{
|
|
1516
|
+
cancelled: z.ZodBoolean;
|
|
1517
|
+
reason: z.ZodEnum<["ok", "not_found", "already_running"]>;
|
|
1518
|
+
}, "strip", z.ZodTypeAny, {
|
|
1519
|
+
reason: "ok" | "not_found" | "already_running";
|
|
1520
|
+
cancelled: boolean;
|
|
1521
|
+
}, {
|
|
1522
|
+
reason: "ok" | "not_found" | "already_running";
|
|
1523
|
+
cancelled: boolean;
|
|
1524
|
+
}>;
|
|
1525
|
+
type CancelPromptResult = z.infer<typeof CancelPromptResult>;
|
|
1526
|
+
declare const UpdatePromptResult: z.ZodObject<{
|
|
1527
|
+
updated: z.ZodBoolean;
|
|
1528
|
+
reason: z.ZodEnum<["ok", "not_found", "already_running"]>;
|
|
1529
|
+
}, "strip", z.ZodTypeAny, {
|
|
1530
|
+
reason: "ok" | "not_found" | "already_running";
|
|
1531
|
+
updated: boolean;
|
|
1532
|
+
}, {
|
|
1533
|
+
reason: "ok" | "not_found" | "already_running";
|
|
1534
|
+
updated: boolean;
|
|
1535
|
+
}>;
|
|
1536
|
+
type UpdatePromptResult = z.infer<typeof UpdatePromptResult>;
|
|
1500
1537
|
interface SessionCapabilities {
|
|
1501
1538
|
attach?: Record<string, never>;
|
|
1502
1539
|
list?: boolean;
|
|
@@ -1527,6 +1564,7 @@ interface InitializeResult {
|
|
|
1527
1564
|
id: string;
|
|
1528
1565
|
description: string;
|
|
1529
1566
|
}>;
|
|
1567
|
+
_meta?: Record<string, unknown>;
|
|
1530
1568
|
}
|
|
1531
1569
|
|
|
1532
1570
|
interface MessageStream {
|
|
@@ -1585,6 +1623,7 @@ interface AgentLogger {
|
|
|
1585
1623
|
}
|
|
1586
1624
|
declare class AgentInstance {
|
|
1587
1625
|
readonly agentId: string;
|
|
1626
|
+
readonly version: string;
|
|
1588
1627
|
readonly cwd: string;
|
|
1589
1628
|
readonly connection: JsonRpcConnection;
|
|
1590
1629
|
private child;
|
|
@@ -1606,6 +1645,11 @@ interface AdvertisedCommand {
|
|
|
1606
1645
|
name: string;
|
|
1607
1646
|
description?: string;
|
|
1608
1647
|
}
|
|
1648
|
+
interface AdvertisedMode {
|
|
1649
|
+
id: string;
|
|
1650
|
+
name?: string;
|
|
1651
|
+
description?: string;
|
|
1652
|
+
}
|
|
1609
1653
|
|
|
1610
1654
|
interface HistoryEntry {
|
|
1611
1655
|
method: string;
|
|
@@ -1627,6 +1671,18 @@ declare class HistoryStore {
|
|
|
1627
1671
|
private enqueue;
|
|
1628
1672
|
}
|
|
1629
1673
|
|
|
1674
|
+
interface PersistedQueueEntry {
|
|
1675
|
+
messageId: string;
|
|
1676
|
+
originator: {
|
|
1677
|
+
clientInfo: {
|
|
1678
|
+
name?: string;
|
|
1679
|
+
version?: string;
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
prompt: unknown[];
|
|
1683
|
+
enqueuedAt: number;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1630
1686
|
interface AttachedClient {
|
|
1631
1687
|
clientId: string;
|
|
1632
1688
|
connection: JsonRpcConnection;
|
|
@@ -1674,6 +1730,7 @@ interface SessionInit {
|
|
|
1674
1730
|
currentMode?: string;
|
|
1675
1731
|
currentUsage?: UsageSnapshot;
|
|
1676
1732
|
agentCommands?: AdvertisedCommand[];
|
|
1733
|
+
agentModes?: AdvertisedMode[];
|
|
1677
1734
|
firstPromptSeeded?: boolean;
|
|
1678
1735
|
createdAt?: number;
|
|
1679
1736
|
}
|
|
@@ -1699,7 +1756,9 @@ declare class Session {
|
|
|
1699
1756
|
private clients;
|
|
1700
1757
|
private historyStore;
|
|
1701
1758
|
private promptQueue;
|
|
1759
|
+
private currentEntry;
|
|
1702
1760
|
private promptInFlight;
|
|
1761
|
+
private queueWriteChain;
|
|
1703
1762
|
private closed;
|
|
1704
1763
|
private closeHandlers;
|
|
1705
1764
|
private titleHandlers;
|
|
@@ -1718,12 +1777,15 @@ declare class Session {
|
|
|
1718
1777
|
private logger;
|
|
1719
1778
|
private agentChangeHandlers;
|
|
1720
1779
|
private agentAdvertisedCommands;
|
|
1780
|
+
private agentAdvertisedModes;
|
|
1721
1781
|
private agentCommandsHandlers;
|
|
1782
|
+
private agentModesHandlers;
|
|
1722
1783
|
private modelHandlers;
|
|
1723
1784
|
private modeHandlers;
|
|
1724
1785
|
private usageHandlers;
|
|
1725
1786
|
constructor(init: SessionInit);
|
|
1726
1787
|
private broadcastMergedCommands;
|
|
1788
|
+
private broadcastAvailableModes;
|
|
1727
1789
|
private wireAgent;
|
|
1728
1790
|
onAgentChange(handler: (info: {
|
|
1729
1791
|
agentId: string;
|
|
@@ -1752,6 +1814,16 @@ declare class Session {
|
|
|
1752
1814
|
prompt(clientId: string, params: unknown): Promise<unknown>;
|
|
1753
1815
|
private broadcastPromptReceived;
|
|
1754
1816
|
private broadcastTurnComplete;
|
|
1817
|
+
private visibleQueueDepth;
|
|
1818
|
+
private broadcastQueueAdded;
|
|
1819
|
+
private broadcastQueueUpdated;
|
|
1820
|
+
private broadcastQueueRemoved;
|
|
1821
|
+
private broadcastQueueNotification;
|
|
1822
|
+
queueSnapshot(): PromptQueueEntry[];
|
|
1823
|
+
flushPersistWrites(): Promise<void>;
|
|
1824
|
+
replayPersistedQueue(entries: PersistedQueueEntry[]): void;
|
|
1825
|
+
cancelQueuedPrompt(messageId: string): CancelPromptResult;
|
|
1826
|
+
updateQueuedPrompt(messageId: string, prompt: unknown[]): UpdatePromptResult;
|
|
1755
1827
|
cancel(clientId: string): Promise<void>;
|
|
1756
1828
|
forwardRequest(method: string, params: unknown): Promise<unknown>;
|
|
1757
1829
|
private rewriteForAgent;
|
|
@@ -1766,12 +1838,15 @@ declare class Session {
|
|
|
1766
1838
|
private maybeApplyAgentMode;
|
|
1767
1839
|
private maybeApplyAgentUsage;
|
|
1768
1840
|
private setAgentAdvertisedCommands;
|
|
1841
|
+
private setAgentAdvertisedModes;
|
|
1769
1842
|
onAgentCommandsChange(handler: (commands: AdvertisedCommand[]) => void): void;
|
|
1843
|
+
onAgentModesChange(handler: (modes: AdvertisedMode[]) => void): void;
|
|
1770
1844
|
onModelChange(handler: (model: string) => void): void;
|
|
1771
1845
|
onModeChange(handler: (mode: string) => void): void;
|
|
1772
1846
|
onUsageChange(handler: (usage: UsageSnapshot) => void): void;
|
|
1773
1847
|
mergedAvailableCommands(): AdvertisedCommand[];
|
|
1774
1848
|
agentOnlyAdvertisedCommands(): AdvertisedCommand[];
|
|
1849
|
+
availableModes(): AdvertisedMode[];
|
|
1775
1850
|
private maybeApplyAgentSessionInfo;
|
|
1776
1851
|
private handleSlashCommand;
|
|
1777
1852
|
private runTitleCommand;
|
|
@@ -1792,7 +1867,11 @@ declare class Session {
|
|
|
1792
1867
|
private recordAndBroadcast;
|
|
1793
1868
|
private handlePermissionRequest;
|
|
1794
1869
|
private enqueuePrompt;
|
|
1870
|
+
private enqueueUserPrompt;
|
|
1871
|
+
private persistRewrite;
|
|
1872
|
+
private persistedFromEntry;
|
|
1795
1873
|
private drainQueue;
|
|
1874
|
+
private runQueueEntry;
|
|
1796
1875
|
}
|
|
1797
1876
|
|
|
1798
1877
|
declare const SessionRecord: z.ZodObject<{
|
|
@@ -1835,6 +1914,19 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1835
1914
|
name: string;
|
|
1836
1915
|
description?: string | undefined;
|
|
1837
1916
|
}>, "many">>;
|
|
1917
|
+
agentModes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1918
|
+
id: z.ZodString;
|
|
1919
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1920
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1921
|
+
}, "strip", z.ZodTypeAny, {
|
|
1922
|
+
id: string;
|
|
1923
|
+
name?: string | undefined;
|
|
1924
|
+
description?: string | undefined;
|
|
1925
|
+
}, {
|
|
1926
|
+
id: string;
|
|
1927
|
+
name?: string | undefined;
|
|
1928
|
+
description?: string | undefined;
|
|
1929
|
+
}>, "many">>;
|
|
1838
1930
|
createdAt: z.ZodString;
|
|
1839
1931
|
updatedAt: z.ZodString;
|
|
1840
1932
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1863,6 +1955,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1863
1955
|
name: string;
|
|
1864
1956
|
description?: string | undefined;
|
|
1865
1957
|
}[] | undefined;
|
|
1958
|
+
agentModes?: {
|
|
1959
|
+
id: string;
|
|
1960
|
+
name?: string | undefined;
|
|
1961
|
+
description?: string | undefined;
|
|
1962
|
+
}[] | undefined;
|
|
1866
1963
|
}, {
|
|
1867
1964
|
version: 1;
|
|
1868
1965
|
cwd: string;
|
|
@@ -1889,6 +1986,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1889
1986
|
name: string;
|
|
1890
1987
|
description?: string | undefined;
|
|
1891
1988
|
}[] | undefined;
|
|
1989
|
+
agentModes?: {
|
|
1990
|
+
id: string;
|
|
1991
|
+
name?: string | undefined;
|
|
1992
|
+
description?: string | undefined;
|
|
1993
|
+
}[] | undefined;
|
|
1892
1994
|
}>;
|
|
1893
1995
|
type SessionRecord = z.infer<typeof SessionRecord>;
|
|
1894
1996
|
declare class SessionStore {
|
|
@@ -1947,6 +2049,19 @@ declare const Bundle: z.ZodObject<{
|
|
|
1947
2049
|
name: string;
|
|
1948
2050
|
description?: string | undefined;
|
|
1949
2051
|
}>, "many">>;
|
|
2052
|
+
agentModes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2053
|
+
id: z.ZodString;
|
|
2054
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2055
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2056
|
+
}, "strip", z.ZodTypeAny, {
|
|
2057
|
+
id: string;
|
|
2058
|
+
name?: string | undefined;
|
|
2059
|
+
description?: string | undefined;
|
|
2060
|
+
}, {
|
|
2061
|
+
id: string;
|
|
2062
|
+
name?: string | undefined;
|
|
2063
|
+
description?: string | undefined;
|
|
2064
|
+
}>, "many">>;
|
|
1950
2065
|
createdAt: z.ZodString;
|
|
1951
2066
|
updatedAt: z.ZodString;
|
|
1952
2067
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1970,6 +2085,11 @@ declare const Bundle: z.ZodObject<{
|
|
|
1970
2085
|
name: string;
|
|
1971
2086
|
description?: string | undefined;
|
|
1972
2087
|
}[] | undefined;
|
|
2088
|
+
agentModes?: {
|
|
2089
|
+
id: string;
|
|
2090
|
+
name?: string | undefined;
|
|
2091
|
+
description?: string | undefined;
|
|
2092
|
+
}[] | undefined;
|
|
1973
2093
|
}, {
|
|
1974
2094
|
cwd: string;
|
|
1975
2095
|
agentId: string;
|
|
@@ -1991,6 +2111,11 @@ declare const Bundle: z.ZodObject<{
|
|
|
1991
2111
|
name: string;
|
|
1992
2112
|
description?: string | undefined;
|
|
1993
2113
|
}[] | undefined;
|
|
2114
|
+
agentModes?: {
|
|
2115
|
+
id: string;
|
|
2116
|
+
name?: string | undefined;
|
|
2117
|
+
description?: string | undefined;
|
|
2118
|
+
}[] | undefined;
|
|
1994
2119
|
}>;
|
|
1995
2120
|
history: z.ZodArray<z.ZodObject<{
|
|
1996
2121
|
method: z.ZodString;
|
|
@@ -2008,11 +2133,6 @@ declare const Bundle: z.ZodObject<{
|
|
|
2008
2133
|
promptHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2009
2134
|
}, "strip", z.ZodTypeAny, {
|
|
2010
2135
|
version: 1;
|
|
2011
|
-
exportedAt: string;
|
|
2012
|
-
exportedFrom: {
|
|
2013
|
-
hydraVersion: string;
|
|
2014
|
-
machine: string;
|
|
2015
|
-
};
|
|
2016
2136
|
session: {
|
|
2017
2137
|
cwd: string;
|
|
2018
2138
|
agentId: string;
|
|
@@ -2034,6 +2154,16 @@ declare const Bundle: z.ZodObject<{
|
|
|
2034
2154
|
name: string;
|
|
2035
2155
|
description?: string | undefined;
|
|
2036
2156
|
}[] | undefined;
|
|
2157
|
+
agentModes?: {
|
|
2158
|
+
id: string;
|
|
2159
|
+
name?: string | undefined;
|
|
2160
|
+
description?: string | undefined;
|
|
2161
|
+
}[] | undefined;
|
|
2162
|
+
};
|
|
2163
|
+
exportedAt: string;
|
|
2164
|
+
exportedFrom: {
|
|
2165
|
+
hydraVersion: string;
|
|
2166
|
+
machine: string;
|
|
2037
2167
|
};
|
|
2038
2168
|
history: {
|
|
2039
2169
|
method: string;
|
|
@@ -2043,11 +2173,6 @@ declare const Bundle: z.ZodObject<{
|
|
|
2043
2173
|
promptHistory?: string[] | undefined;
|
|
2044
2174
|
}, {
|
|
2045
2175
|
version: 1;
|
|
2046
|
-
exportedAt: string;
|
|
2047
|
-
exportedFrom: {
|
|
2048
|
-
hydraVersion: string;
|
|
2049
|
-
machine: string;
|
|
2050
|
-
};
|
|
2051
2176
|
session: {
|
|
2052
2177
|
cwd: string;
|
|
2053
2178
|
agentId: string;
|
|
@@ -2069,6 +2194,16 @@ declare const Bundle: z.ZodObject<{
|
|
|
2069
2194
|
name: string;
|
|
2070
2195
|
description?: string | undefined;
|
|
2071
2196
|
}[] | undefined;
|
|
2197
|
+
agentModes?: {
|
|
2198
|
+
id: string;
|
|
2199
|
+
name?: string | undefined;
|
|
2200
|
+
description?: string | undefined;
|
|
2201
|
+
}[] | undefined;
|
|
2202
|
+
};
|
|
2203
|
+
exportedAt: string;
|
|
2204
|
+
exportedFrom: {
|
|
2205
|
+
hydraVersion: string;
|
|
2206
|
+
machine: string;
|
|
2072
2207
|
};
|
|
2073
2208
|
history: {
|
|
2074
2209
|
method: string;
|
|
@@ -2098,6 +2233,7 @@ interface ResurrectParams {
|
|
|
2098
2233
|
currentMode?: string;
|
|
2099
2234
|
currentUsage?: UsageSnapshot;
|
|
2100
2235
|
agentCommands?: AdvertisedCommand[];
|
|
2236
|
+
agentModes?: AdvertisedMode[];
|
|
2101
2237
|
createdAt?: string;
|
|
2102
2238
|
}
|
|
2103
2239
|
type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
|
|
@@ -2106,6 +2242,7 @@ interface SessionManagerOptions {
|
|
|
2106
2242
|
defaultModels?: Record<string, string>;
|
|
2107
2243
|
sessionHistoryMaxEntries?: number;
|
|
2108
2244
|
logger?: AgentLogger;
|
|
2245
|
+
npmRegistry?: string;
|
|
2109
2246
|
}
|
|
2110
2247
|
declare class SessionManager {
|
|
2111
2248
|
private registry;
|
|
@@ -2119,6 +2256,7 @@ declare class SessionManager {
|
|
|
2119
2256
|
private sessionHistoryMaxEntries;
|
|
2120
2257
|
private metaWriteQueues;
|
|
2121
2258
|
private logger?;
|
|
2259
|
+
private npmRegistry?;
|
|
2122
2260
|
constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
|
|
2123
2261
|
create(params: CreateSessionParams): Promise<Session>;
|
|
2124
2262
|
resurrect(params: ResurrectParams): Promise<Session>;
|
|
@@ -2131,6 +2269,7 @@ declare class SessionManager {
|
|
|
2131
2269
|
loadFromDisk(sessionId: string): Promise<ResurrectParams | undefined>;
|
|
2132
2270
|
private deriveTitleFromHistory;
|
|
2133
2271
|
get(sessionId: string): Session | undefined;
|
|
2272
|
+
activeAgentVersions(): Map<string, Set<string>>;
|
|
2134
2273
|
resolveCanonicalId(input: string): Promise<string | undefined>;
|
|
2135
2274
|
require(sessionId: string): Session;
|
|
2136
2275
|
list(filter?: {
|
|
@@ -2160,13 +2299,14 @@ declare class SessionManager {
|
|
|
2160
2299
|
private enqueueMetaWrite;
|
|
2161
2300
|
closeAll(): Promise<void>;
|
|
2162
2301
|
flushMetaWrites(): Promise<void>;
|
|
2302
|
+
resurrectPendingQueues(): Promise<void>;
|
|
2163
2303
|
}
|
|
2164
2304
|
|
|
2165
2305
|
interface ExtensionContext {
|
|
2166
2306
|
daemonUrl: string;
|
|
2167
2307
|
daemonHost: string;
|
|
2168
2308
|
daemonPort: number;
|
|
2169
|
-
|
|
2309
|
+
serviceToken: string;
|
|
2170
2310
|
daemonWsUrl: string;
|
|
2171
2311
|
hydraHome: string;
|
|
2172
2312
|
}
|
|
@@ -2217,10 +2357,14 @@ interface DaemonHandle {
|
|
|
2217
2357
|
extensions: ExtensionManager;
|
|
2218
2358
|
shutdown: () => Promise<void>;
|
|
2219
2359
|
}
|
|
2220
|
-
declare function startDaemon(config: HydraConfig): Promise<DaemonHandle>;
|
|
2360
|
+
declare function startDaemon(config: HydraConfig, serviceToken: string): Promise<DaemonHandle>;
|
|
2221
2361
|
|
|
2222
2362
|
declare function wsToMessageStream(ws: WebSocket): MessageStream;
|
|
2223
2363
|
|
|
2364
|
+
declare function generateServiceToken(): string;
|
|
2365
|
+
declare function loadServiceToken(): Promise<string>;
|
|
2366
|
+
declare function ensureServiceToken(): Promise<string>;
|
|
2367
|
+
|
|
2224
2368
|
declare function hydraHome(): string;
|
|
2225
2369
|
declare const paths: {
|
|
2226
2370
|
home: typeof hydraHome;
|
|
@@ -2237,6 +2381,7 @@ declare const paths: {
|
|
|
2237
2381
|
sessionDir: (id: string) => string;
|
|
2238
2382
|
sessionFile: (id: string) => string;
|
|
2239
2383
|
historyFile: (id: string) => string;
|
|
2384
|
+
queueFile: (id: string) => string;
|
|
2240
2385
|
extensionsDir: () => string;
|
|
2241
2386
|
extensionLogFile: (name: string) => string;
|
|
2242
2387
|
extensionPidFile: (name: string) => string;
|
|
@@ -2244,4 +2389,4 @@ declare const paths: {
|
|
|
2244
2389
|
tuiLogFile: () => string;
|
|
2245
2390
|
};
|
|
2246
2391
|
|
|
2247
|
-
export { type AgentCapabilities, AgentInstance, HistoryPolicy, HydraConfig, type InitializeResult, JsonRpcConnection, type MessageStream, Registry, Session, SessionAttachParams, type SessionCapabilities, SessionDetachParams, SessionListEntry, SessionListParams, SessionListResult, SessionManager, defaultConfig,
|
|
2392
|
+
export { type AgentCapabilities, AgentInstance, HistoryPolicy, HydraConfig, type InitializeResult, JsonRpcConnection, type MessageStream, Registry, Session, SessionAttachParams, type SessionCapabilities, SessionDetachParams, SessionListEntry, SessionListParams, SessionListResult, SessionManager, defaultConfig, ensureServiceToken, generateServiceToken, loadConfig, loadServiceToken, ndjsonStreamFromStdio, paths, planSpawn, startDaemon, writeConfig, wsToMessageStream };
|