@hydra-acp/cli 0.1.24 → 0.1.26
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 +9 -9
- package/dist/cli.js +1882 -171
- package/dist/index.d.ts +135 -0
- package/dist/index.js +1065 -79
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
102
102
|
logMaxBytes: z.ZodDefault<z.ZodNumber>;
|
|
103
103
|
cwdColumnMaxWidth: z.ZodDefault<z.ZodNumber>;
|
|
104
104
|
progressIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
+
defaultEnterAction: z.ZodDefault<z.ZodEnum<["enqueue", "amend"]>>;
|
|
105
106
|
}, "strip", z.ZodTypeAny, {
|
|
106
107
|
repaintThrottleMs: number;
|
|
107
108
|
maxScrollbackLines: number;
|
|
@@ -109,6 +110,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
109
110
|
logMaxBytes: number;
|
|
110
111
|
cwdColumnMaxWidth: number;
|
|
111
112
|
progressIndicator: boolean;
|
|
113
|
+
defaultEnterAction: "enqueue" | "amend";
|
|
112
114
|
}, {
|
|
113
115
|
repaintThrottleMs?: number | undefined;
|
|
114
116
|
maxScrollbackLines?: number | undefined;
|
|
@@ -116,6 +118,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
116
118
|
logMaxBytes?: number | undefined;
|
|
117
119
|
cwdColumnMaxWidth?: number | undefined;
|
|
118
120
|
progressIndicator?: boolean | undefined;
|
|
121
|
+
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
119
122
|
}>>;
|
|
120
123
|
}, "strip", z.ZodTypeAny, {
|
|
121
124
|
daemon: {
|
|
@@ -143,6 +146,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
143
146
|
logMaxBytes: number;
|
|
144
147
|
cwdColumnMaxWidth: number;
|
|
145
148
|
progressIndicator: boolean;
|
|
149
|
+
defaultEnterAction: "enqueue" | "amend";
|
|
146
150
|
};
|
|
147
151
|
registry: {
|
|
148
152
|
url: string;
|
|
@@ -179,6 +183,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
179
183
|
logMaxBytes?: number | undefined;
|
|
180
184
|
cwdColumnMaxWidth?: number | undefined;
|
|
181
185
|
progressIndicator?: boolean | undefined;
|
|
186
|
+
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
182
187
|
} | undefined;
|
|
183
188
|
registry?: {
|
|
184
189
|
url?: string | undefined;
|
|
@@ -195,6 +200,50 @@ declare function loadConfig(): Promise<HydraConfig>;
|
|
|
195
200
|
declare function writeConfig(config: HydraConfig): Promise<void>;
|
|
196
201
|
declare function defaultConfig(): HydraConfig;
|
|
197
202
|
|
|
203
|
+
type BinaryInstallProgress = {
|
|
204
|
+
phase: "download_start";
|
|
205
|
+
agentId: string;
|
|
206
|
+
version: string;
|
|
207
|
+
totalBytes: number;
|
|
208
|
+
} | {
|
|
209
|
+
phase: "download_progress";
|
|
210
|
+
agentId: string;
|
|
211
|
+
version: string;
|
|
212
|
+
receivedBytes: number;
|
|
213
|
+
totalBytes: number;
|
|
214
|
+
} | {
|
|
215
|
+
phase: "download_done";
|
|
216
|
+
agentId: string;
|
|
217
|
+
version: string;
|
|
218
|
+
receivedBytes: number;
|
|
219
|
+
totalBytes: number;
|
|
220
|
+
} | {
|
|
221
|
+
phase: "extract";
|
|
222
|
+
agentId: string;
|
|
223
|
+
version: string;
|
|
224
|
+
} | {
|
|
225
|
+
phase: "installed";
|
|
226
|
+
agentId: string;
|
|
227
|
+
version: string;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
type NpmInstallProgress = {
|
|
231
|
+
phase: "install_start";
|
|
232
|
+
agentId: string;
|
|
233
|
+
version: string;
|
|
234
|
+
packageSpec: string;
|
|
235
|
+
} | {
|
|
236
|
+
phase: "installed";
|
|
237
|
+
agentId: string;
|
|
238
|
+
version: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
type AgentInstallProgress = ({
|
|
242
|
+
source: "binary";
|
|
243
|
+
} & BinaryInstallProgress) | ({
|
|
244
|
+
source: "npm";
|
|
245
|
+
} & NpmInstallProgress);
|
|
246
|
+
type AgentInstallProgressCallback = (event: AgentInstallProgress) => void;
|
|
198
247
|
declare const RegistryAgent: z.ZodObject<{
|
|
199
248
|
id: z.ZodString;
|
|
200
249
|
name: z.ZodString;
|
|
@@ -1227,6 +1276,7 @@ interface SpawnPlan {
|
|
|
1227
1276
|
}
|
|
1228
1277
|
declare function planSpawn(agent: RegistryAgent, callerArgs?: string[], options?: {
|
|
1229
1278
|
npmRegistry?: string;
|
|
1279
|
+
onInstallProgress?: AgentInstallProgressCallback;
|
|
1230
1280
|
}): Promise<SpawnPlan>;
|
|
1231
1281
|
|
|
1232
1282
|
type JsonRpcId = string | number;
|
|
@@ -1534,6 +1584,40 @@ declare const UpdatePromptResult: z.ZodObject<{
|
|
|
1534
1584
|
updated: boolean;
|
|
1535
1585
|
}>;
|
|
1536
1586
|
type UpdatePromptResult = z.infer<typeof UpdatePromptResult>;
|
|
1587
|
+
declare const AmendPromptParams: z.ZodObject<{
|
|
1588
|
+
sessionId: z.ZodString;
|
|
1589
|
+
targetMessageId: z.ZodString;
|
|
1590
|
+
prompt: z.ZodArray<z.ZodUnknown, "many">;
|
|
1591
|
+
replaceQueue: z.ZodOptional<z.ZodBoolean>;
|
|
1592
|
+
onTargetCompleted: z.ZodOptional<z.ZodEnum<["reject", "send_anyway"]>>;
|
|
1593
|
+
}, "strip", z.ZodTypeAny, {
|
|
1594
|
+
sessionId: string;
|
|
1595
|
+
prompt: unknown[];
|
|
1596
|
+
targetMessageId: string;
|
|
1597
|
+
replaceQueue?: boolean | undefined;
|
|
1598
|
+
onTargetCompleted?: "reject" | "send_anyway" | undefined;
|
|
1599
|
+
}, {
|
|
1600
|
+
sessionId: string;
|
|
1601
|
+
prompt: unknown[];
|
|
1602
|
+
targetMessageId: string;
|
|
1603
|
+
replaceQueue?: boolean | undefined;
|
|
1604
|
+
onTargetCompleted?: "reject" | "send_anyway" | undefined;
|
|
1605
|
+
}>;
|
|
1606
|
+
type AmendPromptParams = z.infer<typeof AmendPromptParams>;
|
|
1607
|
+
declare const AmendPromptResult: z.ZodObject<{
|
|
1608
|
+
amended: z.ZodBoolean;
|
|
1609
|
+
reason: z.ZodEnum<["ok", "target_completed", "target_cancelled", "target_not_found"]>;
|
|
1610
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1611
|
+
}, "strip", z.ZodTypeAny, {
|
|
1612
|
+
reason: "ok" | "target_completed" | "target_cancelled" | "target_not_found";
|
|
1613
|
+
amended: boolean;
|
|
1614
|
+
messageId?: string | undefined;
|
|
1615
|
+
}, {
|
|
1616
|
+
reason: "ok" | "target_completed" | "target_cancelled" | "target_not_found";
|
|
1617
|
+
amended: boolean;
|
|
1618
|
+
messageId?: string | undefined;
|
|
1619
|
+
}>;
|
|
1620
|
+
type AmendPromptResult = z.infer<typeof AmendPromptResult>;
|
|
1537
1621
|
interface SessionCapabilities {
|
|
1538
1622
|
attach?: Record<string, never>;
|
|
1539
1623
|
list?: boolean;
|
|
@@ -1650,6 +1734,11 @@ interface AdvertisedMode {
|
|
|
1650
1734
|
name?: string;
|
|
1651
1735
|
description?: string;
|
|
1652
1736
|
}
|
|
1737
|
+
interface AdvertisedModel {
|
|
1738
|
+
modelId: string;
|
|
1739
|
+
name?: string;
|
|
1740
|
+
description?: string;
|
|
1741
|
+
}
|
|
1653
1742
|
|
|
1654
1743
|
interface HistoryEntry {
|
|
1655
1744
|
method: string;
|
|
@@ -1731,6 +1820,7 @@ interface SessionInit {
|
|
|
1731
1820
|
currentUsage?: UsageSnapshot;
|
|
1732
1821
|
agentCommands?: AdvertisedCommand[];
|
|
1733
1822
|
agentModes?: AdvertisedMode[];
|
|
1823
|
+
agentModels?: AdvertisedModel[];
|
|
1734
1824
|
firstPromptSeeded?: boolean;
|
|
1735
1825
|
createdAt?: number;
|
|
1736
1826
|
}
|
|
@@ -1778,14 +1868,19 @@ declare class Session {
|
|
|
1778
1868
|
private agentChangeHandlers;
|
|
1779
1869
|
private agentAdvertisedCommands;
|
|
1780
1870
|
private agentAdvertisedModes;
|
|
1871
|
+
private agentAdvertisedModels;
|
|
1781
1872
|
private agentCommandsHandlers;
|
|
1782
1873
|
private agentModesHandlers;
|
|
1874
|
+
private agentModelsHandlers;
|
|
1783
1875
|
private modelHandlers;
|
|
1784
1876
|
private modeHandlers;
|
|
1785
1877
|
private usageHandlers;
|
|
1878
|
+
private amendInProgress;
|
|
1879
|
+
private recentlyTerminal;
|
|
1786
1880
|
constructor(init: SessionInit);
|
|
1787
1881
|
private broadcastMergedCommands;
|
|
1788
1882
|
private broadcastAvailableModes;
|
|
1883
|
+
private broadcastAvailableModels;
|
|
1789
1884
|
private wireAgent;
|
|
1790
1885
|
onAgentChange(handler: (info: {
|
|
1791
1886
|
agentId: string;
|
|
@@ -1814,6 +1909,9 @@ declare class Session {
|
|
|
1814
1909
|
prompt(clientId: string, params: unknown): Promise<unknown>;
|
|
1815
1910
|
private broadcastPromptReceived;
|
|
1816
1911
|
private broadcastTurnComplete;
|
|
1912
|
+
private recordTerminal;
|
|
1913
|
+
private broadcastPromptAmended;
|
|
1914
|
+
private findUserEntry;
|
|
1817
1915
|
private visibleQueueDepth;
|
|
1818
1916
|
private broadcastQueueAdded;
|
|
1819
1917
|
private broadcastQueueUpdated;
|
|
@@ -1824,6 +1922,9 @@ declare class Session {
|
|
|
1824
1922
|
replayPersistedQueue(entries: PersistedQueueEntry[]): void;
|
|
1825
1923
|
cancelQueuedPrompt(messageId: string): CancelPromptResult;
|
|
1826
1924
|
updateQueuedPrompt(messageId: string, prompt: unknown[]): UpdatePromptResult;
|
|
1925
|
+
amendPrompt(clientId: string, params: AmendPromptParams): AmendPromptResult;
|
|
1926
|
+
private amendOnHead;
|
|
1927
|
+
private enqueueAmendmentAsFollowUp;
|
|
1827
1928
|
cancel(clientId: string): Promise<void>;
|
|
1828
1929
|
forwardRequest(method: string, params: unknown): Promise<unknown>;
|
|
1829
1930
|
private rewriteForAgent;
|
|
@@ -1832,21 +1933,27 @@ declare class Session {
|
|
|
1832
1933
|
deleteRecord: boolean;
|
|
1833
1934
|
}) => void): void;
|
|
1834
1935
|
onTitleChange(handler: (title: string) => void): void;
|
|
1936
|
+
retitle(title: string): Promise<unknown>;
|
|
1937
|
+
retitleFromAgent(): Promise<unknown>;
|
|
1835
1938
|
private setTitle;
|
|
1836
1939
|
private maybeSeedTitleFromPrompt;
|
|
1837
1940
|
private maybeApplyAgentModel;
|
|
1941
|
+
private maybeApplyAgentConfigOption;
|
|
1838
1942
|
private maybeApplyAgentMode;
|
|
1839
1943
|
private maybeApplyAgentUsage;
|
|
1840
1944
|
private setAgentAdvertisedCommands;
|
|
1841
1945
|
private setAgentAdvertisedModes;
|
|
1946
|
+
private setAgentAdvertisedModels;
|
|
1842
1947
|
onAgentCommandsChange(handler: (commands: AdvertisedCommand[]) => void): void;
|
|
1843
1948
|
onAgentModesChange(handler: (modes: AdvertisedMode[]) => void): void;
|
|
1949
|
+
onAgentModelsChange(handler: (models: AdvertisedModel[]) => void): void;
|
|
1844
1950
|
onModelChange(handler: (model: string) => void): void;
|
|
1845
1951
|
onModeChange(handler: (mode: string) => void): void;
|
|
1846
1952
|
onUsageChange(handler: (usage: UsageSnapshot) => void): void;
|
|
1847
1953
|
mergedAvailableCommands(): AdvertisedCommand[];
|
|
1848
1954
|
agentOnlyAdvertisedCommands(): AdvertisedCommand[];
|
|
1849
1955
|
availableModes(): AdvertisedMode[];
|
|
1956
|
+
availableModels(): AdvertisedModel[];
|
|
1850
1957
|
private maybeApplyAgentSessionInfo;
|
|
1851
1958
|
private handleSlashCommand;
|
|
1852
1959
|
private runTitleCommand;
|
|
@@ -1872,6 +1979,7 @@ declare class Session {
|
|
|
1872
1979
|
private persistedFromEntry;
|
|
1873
1980
|
private drainQueue;
|
|
1874
1981
|
private runQueueEntry;
|
|
1982
|
+
private clearAmendIfMatches;
|
|
1875
1983
|
}
|
|
1876
1984
|
|
|
1877
1985
|
declare const SessionRecord: z.ZodObject<{
|
|
@@ -1927,6 +2035,19 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1927
2035
|
name?: string | undefined;
|
|
1928
2036
|
description?: string | undefined;
|
|
1929
2037
|
}>, "many">>;
|
|
2038
|
+
agentModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2039
|
+
modelId: z.ZodString;
|
|
2040
|
+
name: z.ZodOptional<z.ZodString>;
|
|
2041
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2042
|
+
}, "strip", z.ZodTypeAny, {
|
|
2043
|
+
modelId: string;
|
|
2044
|
+
name?: string | undefined;
|
|
2045
|
+
description?: string | undefined;
|
|
2046
|
+
}, {
|
|
2047
|
+
modelId: string;
|
|
2048
|
+
name?: string | undefined;
|
|
2049
|
+
description?: string | undefined;
|
|
2050
|
+
}>, "many">>;
|
|
1930
2051
|
createdAt: z.ZodString;
|
|
1931
2052
|
updatedAt: z.ZodString;
|
|
1932
2053
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1960,6 +2081,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1960
2081
|
name?: string | undefined;
|
|
1961
2082
|
description?: string | undefined;
|
|
1962
2083
|
}[] | undefined;
|
|
2084
|
+
agentModels?: {
|
|
2085
|
+
modelId: string;
|
|
2086
|
+
name?: string | undefined;
|
|
2087
|
+
description?: string | undefined;
|
|
2088
|
+
}[] | undefined;
|
|
1963
2089
|
}, {
|
|
1964
2090
|
version: 1;
|
|
1965
2091
|
cwd: string;
|
|
@@ -1991,6 +2117,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1991
2117
|
name?: string | undefined;
|
|
1992
2118
|
description?: string | undefined;
|
|
1993
2119
|
}[] | undefined;
|
|
2120
|
+
agentModels?: {
|
|
2121
|
+
modelId: string;
|
|
2122
|
+
name?: string | undefined;
|
|
2123
|
+
description?: string | undefined;
|
|
2124
|
+
}[] | undefined;
|
|
1994
2125
|
}>;
|
|
1995
2126
|
type SessionRecord = z.infer<typeof SessionRecord>;
|
|
1996
2127
|
declare class SessionStore {
|
|
@@ -2221,6 +2352,7 @@ interface CreateSessionParams {
|
|
|
2221
2352
|
title?: string;
|
|
2222
2353
|
agentArgs?: string[];
|
|
2223
2354
|
model?: string;
|
|
2355
|
+
onInstallProgress?: AgentInstallProgressCallback;
|
|
2224
2356
|
}
|
|
2225
2357
|
interface ResurrectParams {
|
|
2226
2358
|
hydraSessionId: string;
|
|
@@ -2229,11 +2361,13 @@ interface ResurrectParams {
|
|
|
2229
2361
|
cwd: string;
|
|
2230
2362
|
title?: string;
|
|
2231
2363
|
agentArgs?: string[];
|
|
2364
|
+
onInstallProgress?: AgentInstallProgressCallback;
|
|
2232
2365
|
currentModel?: string;
|
|
2233
2366
|
currentMode?: string;
|
|
2234
2367
|
currentUsage?: UsageSnapshot;
|
|
2235
2368
|
agentCommands?: AdvertisedCommand[];
|
|
2236
2369
|
agentModes?: AdvertisedMode[];
|
|
2370
|
+
agentModels?: AdvertisedModel[];
|
|
2237
2371
|
createdAt?: string;
|
|
2238
2372
|
}
|
|
2239
2373
|
type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
|
|
@@ -2293,6 +2427,7 @@ declare class SessionManager {
|
|
|
2293
2427
|
private writeImportedRecord;
|
|
2294
2428
|
deleteRecord(sessionId: string): Promise<boolean>;
|
|
2295
2429
|
hasRecord(sessionId: string): Promise<boolean>;
|
|
2430
|
+
setTitle(sessionId: string, title: string): Promise<boolean>;
|
|
2296
2431
|
private persistTitle;
|
|
2297
2432
|
private persistAgentChange;
|
|
2298
2433
|
private persistSnapshot;
|