@hydra-acp/cli 0.1.7 → 0.1.8
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 +1 -1
- package/dist/cli.js +1701 -483
- package/dist/index.d.ts +59 -4
- package/dist/index.js +347 -75
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,12 +40,16 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
40
40
|
key: string;
|
|
41
41
|
}>>;
|
|
42
42
|
sessionIdleTimeoutSeconds: z.ZodDefault<z.ZodNumber>;
|
|
43
|
+
sessionHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
agentStderrTailBytes: z.ZodDefault<z.ZodNumber>;
|
|
43
45
|
}, "strip", z.ZodTypeAny, {
|
|
44
46
|
host: string;
|
|
45
47
|
port: number;
|
|
46
48
|
authToken: string;
|
|
47
|
-
logLevel: "
|
|
49
|
+
logLevel: "info" | "debug" | "warn" | "error";
|
|
48
50
|
sessionIdleTimeoutSeconds: number;
|
|
51
|
+
sessionHistoryMaxEntries: number;
|
|
52
|
+
agentStderrTailBytes: number;
|
|
49
53
|
tls?: {
|
|
50
54
|
cert: string;
|
|
51
55
|
key: string;
|
|
@@ -54,12 +58,14 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
54
58
|
authToken: string;
|
|
55
59
|
host?: string | undefined;
|
|
56
60
|
port?: number | undefined;
|
|
57
|
-
logLevel?: "
|
|
61
|
+
logLevel?: "info" | "debug" | "warn" | "error" | undefined;
|
|
58
62
|
tls?: {
|
|
59
63
|
cert: string;
|
|
60
64
|
key: string;
|
|
61
65
|
} | undefined;
|
|
62
66
|
sessionIdleTimeoutSeconds?: number | undefined;
|
|
67
|
+
sessionHistoryMaxEntries?: number | undefined;
|
|
68
|
+
agentStderrTailBytes?: number | undefined;
|
|
63
69
|
}>;
|
|
64
70
|
registry: z.ZodDefault<z.ZodObject<{
|
|
65
71
|
url: z.ZodDefault<z.ZodString>;
|
|
@@ -95,22 +101,30 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
95
101
|
repaintThrottleMs: z.ZodDefault<z.ZodNumber>;
|
|
96
102
|
maxScrollbackLines: z.ZodDefault<z.ZodNumber>;
|
|
97
103
|
mouse: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
+
logMaxBytes: z.ZodDefault<z.ZodNumber>;
|
|
105
|
+
cwdColumnMaxWidth: z.ZodDefault<z.ZodNumber>;
|
|
98
106
|
}, "strip", z.ZodTypeAny, {
|
|
99
107
|
repaintThrottleMs: number;
|
|
100
108
|
maxScrollbackLines: number;
|
|
101
109
|
mouse: boolean;
|
|
110
|
+
logMaxBytes: number;
|
|
111
|
+
cwdColumnMaxWidth: number;
|
|
102
112
|
}, {
|
|
103
113
|
repaintThrottleMs?: number | undefined;
|
|
104
114
|
maxScrollbackLines?: number | undefined;
|
|
105
115
|
mouse?: boolean | undefined;
|
|
116
|
+
logMaxBytes?: number | undefined;
|
|
117
|
+
cwdColumnMaxWidth?: number | undefined;
|
|
106
118
|
}>>;
|
|
107
119
|
}, "strip", z.ZodTypeAny, {
|
|
108
120
|
daemon: {
|
|
109
121
|
host: string;
|
|
110
122
|
port: number;
|
|
111
123
|
authToken: string;
|
|
112
|
-
logLevel: "
|
|
124
|
+
logLevel: "info" | "debug" | "warn" | "error";
|
|
113
125
|
sessionIdleTimeoutSeconds: number;
|
|
126
|
+
sessionHistoryMaxEntries: number;
|
|
127
|
+
agentStderrTailBytes: number;
|
|
114
128
|
tls?: {
|
|
115
129
|
cert: string;
|
|
116
130
|
key: string;
|
|
@@ -126,6 +140,8 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
126
140
|
repaintThrottleMs: number;
|
|
127
141
|
maxScrollbackLines: number;
|
|
128
142
|
mouse: boolean;
|
|
143
|
+
logMaxBytes: number;
|
|
144
|
+
cwdColumnMaxWidth: number;
|
|
129
145
|
};
|
|
130
146
|
registry: {
|
|
131
147
|
url: string;
|
|
@@ -140,12 +156,14 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
140
156
|
authToken: string;
|
|
141
157
|
host?: string | undefined;
|
|
142
158
|
port?: number | undefined;
|
|
143
|
-
logLevel?: "
|
|
159
|
+
logLevel?: "info" | "debug" | "warn" | "error" | undefined;
|
|
144
160
|
tls?: {
|
|
145
161
|
cert: string;
|
|
146
162
|
key: string;
|
|
147
163
|
} | undefined;
|
|
148
164
|
sessionIdleTimeoutSeconds?: number | undefined;
|
|
165
|
+
sessionHistoryMaxEntries?: number | undefined;
|
|
166
|
+
agentStderrTailBytes?: number | undefined;
|
|
149
167
|
};
|
|
150
168
|
extensions?: Record<string, {
|
|
151
169
|
command?: string[] | undefined;
|
|
@@ -157,6 +175,8 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
157
175
|
repaintThrottleMs?: number | undefined;
|
|
158
176
|
maxScrollbackLines?: number | undefined;
|
|
159
177
|
mouse?: boolean | undefined;
|
|
178
|
+
logMaxBytes?: number | undefined;
|
|
179
|
+
cwdColumnMaxWidth?: number | undefined;
|
|
160
180
|
} | undefined;
|
|
161
181
|
registry?: {
|
|
162
182
|
url?: string | undefined;
|
|
@@ -187,16 +207,19 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
187
207
|
distribution: z.ZodObject<{
|
|
188
208
|
npx: z.ZodOptional<z.ZodObject<{
|
|
189
209
|
package: z.ZodString;
|
|
210
|
+
bin: z.ZodOptional<z.ZodString>;
|
|
190
211
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
191
212
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
192
213
|
}, "strip", z.ZodTypeAny, {
|
|
193
214
|
package: string;
|
|
194
215
|
args?: string[] | undefined;
|
|
195
216
|
env?: Record<string, string> | undefined;
|
|
217
|
+
bin?: string | undefined;
|
|
196
218
|
}, {
|
|
197
219
|
package: string;
|
|
198
220
|
args?: string[] | undefined;
|
|
199
221
|
env?: Record<string, string> | undefined;
|
|
222
|
+
bin?: string | undefined;
|
|
200
223
|
}>>;
|
|
201
224
|
binary: z.ZodOptional<z.ZodObject<{
|
|
202
225
|
"darwin-aarch64": z.ZodOptional<z.ZodObject<{
|
|
@@ -426,6 +449,7 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
426
449
|
package: string;
|
|
427
450
|
args?: string[] | undefined;
|
|
428
451
|
env?: Record<string, string> | undefined;
|
|
452
|
+
bin?: string | undefined;
|
|
429
453
|
} | undefined;
|
|
430
454
|
uvx?: {
|
|
431
455
|
package: string;
|
|
@@ -475,6 +499,7 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
475
499
|
package: string;
|
|
476
500
|
args?: string[] | undefined;
|
|
477
501
|
env?: Record<string, string> | undefined;
|
|
502
|
+
bin?: string | undefined;
|
|
478
503
|
} | undefined;
|
|
479
504
|
uvx?: {
|
|
480
505
|
package: string;
|
|
@@ -528,6 +553,7 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
528
553
|
package: string;
|
|
529
554
|
args?: string[] | undefined;
|
|
530
555
|
env?: Record<string, string> | undefined;
|
|
556
|
+
bin?: string | undefined;
|
|
531
557
|
} | undefined;
|
|
532
558
|
uvx?: {
|
|
533
559
|
package: string;
|
|
@@ -588,6 +614,7 @@ declare const RegistryAgent: z.ZodObject<{
|
|
|
588
614
|
package: string;
|
|
589
615
|
args?: string[] | undefined;
|
|
590
616
|
env?: Record<string, string> | undefined;
|
|
617
|
+
bin?: string | undefined;
|
|
591
618
|
} | undefined;
|
|
592
619
|
uvx?: {
|
|
593
620
|
package: string;
|
|
@@ -619,16 +646,19 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
619
646
|
distribution: z.ZodObject<{
|
|
620
647
|
npx: z.ZodOptional<z.ZodObject<{
|
|
621
648
|
package: z.ZodString;
|
|
649
|
+
bin: z.ZodOptional<z.ZodString>;
|
|
622
650
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
623
651
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
624
652
|
}, "strip", z.ZodTypeAny, {
|
|
625
653
|
package: string;
|
|
626
654
|
args?: string[] | undefined;
|
|
627
655
|
env?: Record<string, string> | undefined;
|
|
656
|
+
bin?: string | undefined;
|
|
628
657
|
}, {
|
|
629
658
|
package: string;
|
|
630
659
|
args?: string[] | undefined;
|
|
631
660
|
env?: Record<string, string> | undefined;
|
|
661
|
+
bin?: string | undefined;
|
|
632
662
|
}>>;
|
|
633
663
|
binary: z.ZodOptional<z.ZodObject<{
|
|
634
664
|
"darwin-aarch64": z.ZodOptional<z.ZodObject<{
|
|
@@ -858,6 +888,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
858
888
|
package: string;
|
|
859
889
|
args?: string[] | undefined;
|
|
860
890
|
env?: Record<string, string> | undefined;
|
|
891
|
+
bin?: string | undefined;
|
|
861
892
|
} | undefined;
|
|
862
893
|
uvx?: {
|
|
863
894
|
package: string;
|
|
@@ -907,6 +938,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
907
938
|
package: string;
|
|
908
939
|
args?: string[] | undefined;
|
|
909
940
|
env?: Record<string, string> | undefined;
|
|
941
|
+
bin?: string | undefined;
|
|
910
942
|
} | undefined;
|
|
911
943
|
uvx?: {
|
|
912
944
|
package: string;
|
|
@@ -960,6 +992,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
960
992
|
package: string;
|
|
961
993
|
args?: string[] | undefined;
|
|
962
994
|
env?: Record<string, string> | undefined;
|
|
995
|
+
bin?: string | undefined;
|
|
963
996
|
} | undefined;
|
|
964
997
|
uvx?: {
|
|
965
998
|
package: string;
|
|
@@ -1020,6 +1053,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1020
1053
|
package: string;
|
|
1021
1054
|
args?: string[] | undefined;
|
|
1022
1055
|
env?: Record<string, string> | undefined;
|
|
1056
|
+
bin?: string | undefined;
|
|
1023
1057
|
} | undefined;
|
|
1024
1058
|
uvx?: {
|
|
1025
1059
|
package: string;
|
|
@@ -1084,6 +1118,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1084
1118
|
package: string;
|
|
1085
1119
|
args?: string[] | undefined;
|
|
1086
1120
|
env?: Record<string, string> | undefined;
|
|
1121
|
+
bin?: string | undefined;
|
|
1087
1122
|
} | undefined;
|
|
1088
1123
|
uvx?: {
|
|
1089
1124
|
package: string;
|
|
@@ -1148,6 +1183,7 @@ declare const RegistryDocument: z.ZodObject<{
|
|
|
1148
1183
|
package: string;
|
|
1149
1184
|
args?: string[] | undefined;
|
|
1150
1185
|
env?: Record<string, string> | undefined;
|
|
1186
|
+
bin?: string | undefined;
|
|
1151
1187
|
} | undefined;
|
|
1152
1188
|
uvx?: {
|
|
1153
1189
|
package: string;
|
|
@@ -1498,6 +1534,7 @@ declare class JsonRpcConnection {
|
|
|
1498
1534
|
};
|
|
1499
1535
|
notify(method: string, params?: unknown): Promise<void>;
|
|
1500
1536
|
close(): Promise<void>;
|
|
1537
|
+
fail(err: Error): void;
|
|
1501
1538
|
private handleIncoming;
|
|
1502
1539
|
private handleRequest;
|
|
1503
1540
|
private handleNotification;
|
|
@@ -1511,6 +1548,7 @@ interface AgentInstanceOptions {
|
|
|
1511
1548
|
cwd: string;
|
|
1512
1549
|
plan: SpawnPlan;
|
|
1513
1550
|
extraEnv?: Record<string, string>;
|
|
1551
|
+
stderrTailBytes?: number;
|
|
1514
1552
|
}
|
|
1515
1553
|
declare class AgentInstance {
|
|
1516
1554
|
readonly agentId: string;
|
|
@@ -1518,8 +1556,12 @@ declare class AgentInstance {
|
|
|
1518
1556
|
readonly connection: JsonRpcConnection;
|
|
1519
1557
|
private child;
|
|
1520
1558
|
private exited;
|
|
1559
|
+
private killed;
|
|
1560
|
+
private stderrTail;
|
|
1561
|
+
private stderrTailBytes;
|
|
1521
1562
|
private exitHandlers;
|
|
1522
1563
|
private constructor();
|
|
1564
|
+
private formatFailure;
|
|
1523
1565
|
static spawn(opts: AgentInstanceOptions): AgentInstance;
|
|
1524
1566
|
onExit(handler: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
1525
1567
|
isAlive(): boolean;
|
|
@@ -1536,8 +1578,13 @@ interface HistoryEntry {
|
|
|
1536
1578
|
params: unknown;
|
|
1537
1579
|
recordedAt: number;
|
|
1538
1580
|
}
|
|
1581
|
+
interface HistoryStoreOptions {
|
|
1582
|
+
maxEntries?: number;
|
|
1583
|
+
}
|
|
1539
1584
|
declare class HistoryStore {
|
|
1540
1585
|
private writeQueues;
|
|
1586
|
+
private maxEntries;
|
|
1587
|
+
constructor(options?: HistoryStoreOptions);
|
|
1541
1588
|
append(sessionId: string, entry: HistoryEntry): Promise<void>;
|
|
1542
1589
|
rewrite(sessionId: string, entries: HistoryEntry[]): Promise<void>;
|
|
1543
1590
|
compact(sessionId: string, maxEntries: number): Promise<void>;
|
|
@@ -1584,6 +1631,7 @@ interface SessionInit {
|
|
|
1584
1631
|
idleTimeoutMs?: number;
|
|
1585
1632
|
spawnReplacementAgent?: SpawnReplacementAgent;
|
|
1586
1633
|
historyStore?: HistoryStore;
|
|
1634
|
+
historyMaxEntries?: number;
|
|
1587
1635
|
currentModel?: string;
|
|
1588
1636
|
currentMode?: string;
|
|
1589
1637
|
currentUsage?: UsageSnapshot;
|
|
@@ -1621,6 +1669,8 @@ declare class Session {
|
|
|
1621
1669
|
private firstPromptSeeded;
|
|
1622
1670
|
private promptStartedAt;
|
|
1623
1671
|
private appendCount;
|
|
1672
|
+
private historyMaxEntries;
|
|
1673
|
+
private compactEvery;
|
|
1624
1674
|
private inFlightPermissions;
|
|
1625
1675
|
private internalPromptCapture;
|
|
1626
1676
|
private idleTimeoutMs;
|
|
@@ -1990,6 +2040,7 @@ type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
|
|
|
1990
2040
|
interface SessionManagerOptions {
|
|
1991
2041
|
idleTimeoutMs?: number;
|
|
1992
2042
|
defaultModels?: Record<string, string>;
|
|
2043
|
+
sessionHistoryMaxEntries?: number;
|
|
1993
2044
|
}
|
|
1994
2045
|
declare class SessionManager {
|
|
1995
2046
|
private registry;
|
|
@@ -2000,12 +2051,14 @@ declare class SessionManager {
|
|
|
2000
2051
|
private histories;
|
|
2001
2052
|
private idleTimeoutMs;
|
|
2002
2053
|
private defaultModels;
|
|
2054
|
+
private sessionHistoryMaxEntries;
|
|
2003
2055
|
private metaWriteQueues;
|
|
2004
2056
|
constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
|
|
2005
2057
|
create(params: CreateSessionParams): Promise<Session>;
|
|
2006
2058
|
resurrect(params: ResurrectParams): Promise<Session>;
|
|
2007
2059
|
private doResurrect;
|
|
2008
2060
|
private doResurrectFromImport;
|
|
2061
|
+
private resolveImportCwd;
|
|
2009
2062
|
private bootstrapAgent;
|
|
2010
2063
|
private attachManagerHooks;
|
|
2011
2064
|
getHistory(sessionId: string): Promise<HistoryEntry[] | undefined>;
|
|
@@ -2026,6 +2079,7 @@ declare class SessionManager {
|
|
|
2026
2079
|
} | undefined>;
|
|
2027
2080
|
importBundle(bundle: Bundle, opts?: {
|
|
2028
2081
|
replace?: boolean;
|
|
2082
|
+
cwd?: string;
|
|
2029
2083
|
}): Promise<{
|
|
2030
2084
|
sessionId: string;
|
|
2031
2085
|
importedFromSessionId: string;
|
|
@@ -2112,6 +2166,7 @@ declare const paths: {
|
|
|
2112
2166
|
registryCache: () => string;
|
|
2113
2167
|
agentsDir: () => string;
|
|
2114
2168
|
agentInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2169
|
+
agentNpmInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2115
2170
|
sessionsDir: () => string;
|
|
2116
2171
|
sessionDir: (id: string) => string;
|
|
2117
2172
|
sessionFile: (id: string) => string;
|