@hydra-acp/cli 0.1.23 → 0.1.25
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/dist/cli.js +1256 -128
- package/dist/index.d.ts +56 -1
- package/dist/index.js +478 -32
- 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;
|
|
@@ -1203,10 +1208,14 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1203
1208
|
extensions?: unknown[] | undefined;
|
|
1204
1209
|
}>;
|
|
1205
1210
|
type RegistryDocument = z.infer<typeof RegistryDocument>;
|
|
1211
|
+
interface RegistryOptions {
|
|
1212
|
+
onFetched?: (doc: RegistryDocument) => void | Promise<void>;
|
|
1213
|
+
}
|
|
1206
1214
|
declare class Registry {
|
|
1207
1215
|
private config;
|
|
1216
|
+
private options;
|
|
1208
1217
|
private cache;
|
|
1209
|
-
constructor(config: HydraConfig);
|
|
1218
|
+
constructor(config: HydraConfig, options?: RegistryOptions);
|
|
1210
1219
|
load(): Promise<RegistryDocument>;
|
|
1211
1220
|
refresh(): Promise<RegistryDocument>;
|
|
1212
1221
|
getAgent(id: string): Promise<RegistryAgent | undefined>;
|
|
@@ -1219,6 +1228,7 @@ interface SpawnPlan {
|
|
|
1219
1228
|
command: string;
|
|
1220
1229
|
args: string[];
|
|
1221
1230
|
env: Record<string, string>;
|
|
1231
|
+
version: string;
|
|
1222
1232
|
}
|
|
1223
1233
|
declare function planSpawn(agent: RegistryAgent, callerArgs?: string[], options?: {
|
|
1224
1234
|
npmRegistry?: string;
|
|
@@ -1529,6 +1539,40 @@ declare const UpdatePromptResult: z.ZodObject<{
|
|
|
1529
1539
|
updated: boolean;
|
|
1530
1540
|
}>;
|
|
1531
1541
|
type UpdatePromptResult = z.infer<typeof UpdatePromptResult>;
|
|
1542
|
+
declare const AmendPromptParams: z.ZodObject<{
|
|
1543
|
+
sessionId: z.ZodString;
|
|
1544
|
+
targetMessageId: z.ZodString;
|
|
1545
|
+
prompt: z.ZodArray<z.ZodUnknown, "many">;
|
|
1546
|
+
replaceQueue: z.ZodOptional<z.ZodBoolean>;
|
|
1547
|
+
onTargetCompleted: z.ZodOptional<z.ZodEnum<["reject", "send_anyway"]>>;
|
|
1548
|
+
}, "strip", z.ZodTypeAny, {
|
|
1549
|
+
sessionId: string;
|
|
1550
|
+
prompt: unknown[];
|
|
1551
|
+
targetMessageId: string;
|
|
1552
|
+
replaceQueue?: boolean | undefined;
|
|
1553
|
+
onTargetCompleted?: "reject" | "send_anyway" | undefined;
|
|
1554
|
+
}, {
|
|
1555
|
+
sessionId: string;
|
|
1556
|
+
prompt: unknown[];
|
|
1557
|
+
targetMessageId: string;
|
|
1558
|
+
replaceQueue?: boolean | undefined;
|
|
1559
|
+
onTargetCompleted?: "reject" | "send_anyway" | undefined;
|
|
1560
|
+
}>;
|
|
1561
|
+
type AmendPromptParams = z.infer<typeof AmendPromptParams>;
|
|
1562
|
+
declare const AmendPromptResult: z.ZodObject<{
|
|
1563
|
+
amended: z.ZodBoolean;
|
|
1564
|
+
reason: z.ZodEnum<["ok", "target_completed", "target_cancelled", "target_not_found"]>;
|
|
1565
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1566
|
+
}, "strip", z.ZodTypeAny, {
|
|
1567
|
+
reason: "ok" | "target_completed" | "target_cancelled" | "target_not_found";
|
|
1568
|
+
amended: boolean;
|
|
1569
|
+
messageId?: string | undefined;
|
|
1570
|
+
}, {
|
|
1571
|
+
reason: "ok" | "target_completed" | "target_cancelled" | "target_not_found";
|
|
1572
|
+
amended: boolean;
|
|
1573
|
+
messageId?: string | undefined;
|
|
1574
|
+
}>;
|
|
1575
|
+
type AmendPromptResult = z.infer<typeof AmendPromptResult>;
|
|
1532
1576
|
interface SessionCapabilities {
|
|
1533
1577
|
attach?: Record<string, never>;
|
|
1534
1578
|
list?: boolean;
|
|
@@ -1618,6 +1662,7 @@ interface AgentLogger {
|
|
|
1618
1662
|
}
|
|
1619
1663
|
declare class AgentInstance {
|
|
1620
1664
|
readonly agentId: string;
|
|
1665
|
+
readonly version: string;
|
|
1621
1666
|
readonly cwd: string;
|
|
1622
1667
|
readonly connection: JsonRpcConnection;
|
|
1623
1668
|
private child;
|
|
@@ -1777,6 +1822,8 @@ declare class Session {
|
|
|
1777
1822
|
private modelHandlers;
|
|
1778
1823
|
private modeHandlers;
|
|
1779
1824
|
private usageHandlers;
|
|
1825
|
+
private amendInProgress;
|
|
1826
|
+
private recentlyTerminal;
|
|
1780
1827
|
constructor(init: SessionInit);
|
|
1781
1828
|
private broadcastMergedCommands;
|
|
1782
1829
|
private broadcastAvailableModes;
|
|
@@ -1808,6 +1855,9 @@ declare class Session {
|
|
|
1808
1855
|
prompt(clientId: string, params: unknown): Promise<unknown>;
|
|
1809
1856
|
private broadcastPromptReceived;
|
|
1810
1857
|
private broadcastTurnComplete;
|
|
1858
|
+
private recordTerminal;
|
|
1859
|
+
private broadcastPromptAmended;
|
|
1860
|
+
private findUserEntry;
|
|
1811
1861
|
private visibleQueueDepth;
|
|
1812
1862
|
private broadcastQueueAdded;
|
|
1813
1863
|
private broadcastQueueUpdated;
|
|
@@ -1818,6 +1868,9 @@ declare class Session {
|
|
|
1818
1868
|
replayPersistedQueue(entries: PersistedQueueEntry[]): void;
|
|
1819
1869
|
cancelQueuedPrompt(messageId: string): CancelPromptResult;
|
|
1820
1870
|
updateQueuedPrompt(messageId: string, prompt: unknown[]): UpdatePromptResult;
|
|
1871
|
+
amendPrompt(clientId: string, params: AmendPromptParams): AmendPromptResult;
|
|
1872
|
+
private amendOnHead;
|
|
1873
|
+
private enqueueAmendmentAsFollowUp;
|
|
1821
1874
|
cancel(clientId: string): Promise<void>;
|
|
1822
1875
|
forwardRequest(method: string, params: unknown): Promise<unknown>;
|
|
1823
1876
|
private rewriteForAgent;
|
|
@@ -1866,6 +1919,7 @@ declare class Session {
|
|
|
1866
1919
|
private persistedFromEntry;
|
|
1867
1920
|
private drainQueue;
|
|
1868
1921
|
private runQueueEntry;
|
|
1922
|
+
private clearAmendIfMatches;
|
|
1869
1923
|
}
|
|
1870
1924
|
|
|
1871
1925
|
declare const SessionRecord: z.ZodObject<{
|
|
@@ -2263,6 +2317,7 @@ declare class SessionManager {
|
|
|
2263
2317
|
loadFromDisk(sessionId: string): Promise<ResurrectParams | undefined>;
|
|
2264
2318
|
private deriveTitleFromHistory;
|
|
2265
2319
|
get(sessionId: string): Session | undefined;
|
|
2320
|
+
activeAgentVersions(): Map<string, Set<string>>;
|
|
2266
2321
|
resolveCanonicalId(input: string): Promise<string | undefined>;
|
|
2267
2322
|
require(sessionId: string): Session;
|
|
2268
2323
|
list(filter?: {
|