@hydra-acp/cli 0.1.53 → 0.1.54
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 +12 -0
- package/dist/cli.js +10486 -9030
- package/dist/index.d.ts +256 -78
- package/dist/index.js +3110 -2370
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FastifyInstance } from 'fastify';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Readable, Writable } from 'node:stream';
|
|
4
|
+
import { ChildProcess } from 'node:child_process';
|
|
5
|
+
import * as fs from 'node:fs';
|
|
4
6
|
import { WebSocket } from 'ws';
|
|
5
7
|
|
|
6
8
|
declare const ExtensionBody: z.ZodObject<{
|
|
@@ -102,6 +104,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
102
104
|
}>>;
|
|
103
105
|
defaultAgent: z.ZodDefault<z.ZodString>;
|
|
104
106
|
defaultModels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
107
|
+
synopsisAgent: z.ZodOptional<z.ZodString>;
|
|
108
|
+
synopsisModel: z.ZodOptional<z.ZodString>;
|
|
109
|
+
synopsisOnClose: z.ZodDefault<z.ZodBoolean>;
|
|
105
110
|
defaultCwd: z.ZodDefault<z.ZodString>;
|
|
106
111
|
sessionListColdLimit: z.ZodDefault<z.ZodNumber>;
|
|
107
112
|
extensions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -159,7 +164,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
159
164
|
defaultEnterAction: "enqueue" | "amend";
|
|
160
165
|
showThoughts: boolean;
|
|
161
166
|
promptHistoryMaxEntries: number;
|
|
162
|
-
showFileUpdates: "
|
|
167
|
+
showFileUpdates: "diff" | "none" | "edit";
|
|
163
168
|
}, {
|
|
164
169
|
repaintThrottleMs?: number | undefined;
|
|
165
170
|
maxScrollbackLines?: number | undefined;
|
|
@@ -170,7 +175,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
170
175
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
171
176
|
showThoughts?: boolean | undefined;
|
|
172
177
|
promptHistoryMaxEntries?: number | undefined;
|
|
173
|
-
showFileUpdates?: "
|
|
178
|
+
showFileUpdates?: "diff" | "none" | "edit" | undefined;
|
|
174
179
|
}>>;
|
|
175
180
|
}, "strip", z.ZodTypeAny, {
|
|
176
181
|
tui: {
|
|
@@ -183,7 +188,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
183
188
|
defaultEnterAction: "enqueue" | "amend";
|
|
184
189
|
showThoughts: boolean;
|
|
185
190
|
promptHistoryMaxEntries: number;
|
|
186
|
-
showFileUpdates: "
|
|
191
|
+
showFileUpdates: "diff" | "none" | "edit";
|
|
187
192
|
};
|
|
188
193
|
daemon: {
|
|
189
194
|
host: string;
|
|
@@ -217,9 +222,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
217
222
|
};
|
|
218
223
|
defaultAgent: string;
|
|
219
224
|
defaultModels: Record<string, string>;
|
|
225
|
+
synopsisOnClose: boolean;
|
|
220
226
|
defaultCwd: string;
|
|
221
227
|
sessionListColdLimit: number;
|
|
222
228
|
defaultTransformers: string[];
|
|
229
|
+
synopsisAgent?: string | undefined;
|
|
230
|
+
synopsisModel?: string | undefined;
|
|
223
231
|
npmRegistry?: string | undefined;
|
|
224
232
|
}, {
|
|
225
233
|
tui?: {
|
|
@@ -232,7 +240,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
232
240
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
233
241
|
showThoughts?: boolean | undefined;
|
|
234
242
|
promptHistoryMaxEntries?: number | undefined;
|
|
235
|
-
showFileUpdates?: "
|
|
243
|
+
showFileUpdates?: "diff" | "none" | "edit" | undefined;
|
|
236
244
|
} | undefined;
|
|
237
245
|
daemon?: {
|
|
238
246
|
host?: string | undefined;
|
|
@@ -266,6 +274,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
266
274
|
} | undefined;
|
|
267
275
|
defaultAgent?: string | undefined;
|
|
268
276
|
defaultModels?: Record<string, string> | undefined;
|
|
277
|
+
synopsisAgent?: string | undefined;
|
|
278
|
+
synopsisModel?: string | undefined;
|
|
279
|
+
synopsisOnClose?: boolean | undefined;
|
|
269
280
|
defaultCwd?: string | undefined;
|
|
270
281
|
sessionListColdLimit?: number | undefined;
|
|
271
282
|
defaultTransformers?: string[] | undefined;
|
|
@@ -1748,8 +1759,10 @@ declare class AgentInstance {
|
|
|
1748
1759
|
private stderrTail;
|
|
1749
1760
|
private stderrTailBytes;
|
|
1750
1761
|
private logger?;
|
|
1762
|
+
private fileLog?;
|
|
1751
1763
|
private exitHandlers;
|
|
1752
1764
|
private constructor();
|
|
1765
|
+
private writeLog;
|
|
1753
1766
|
private formatFailure;
|
|
1754
1767
|
static spawn(opts: AgentInstanceOptions): AgentInstance;
|
|
1755
1768
|
onExit(handler: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
@@ -1777,12 +1790,34 @@ declare class ProcessTokenRegistry implements TokenValidator {
|
|
|
1777
1790
|
validate(token: string): Promise<string | undefined>;
|
|
1778
1791
|
}
|
|
1779
1792
|
|
|
1780
|
-
interface
|
|
1793
|
+
interface BreakerOptions {
|
|
1794
|
+
windowMs?: number;
|
|
1795
|
+
maxFailuresInWindow?: number;
|
|
1796
|
+
now?: () => number;
|
|
1797
|
+
}
|
|
1798
|
+
type BreakerDecision = "restart" | {
|
|
1799
|
+
tripped: string;
|
|
1800
|
+
};
|
|
1801
|
+
declare class RestartBreaker {
|
|
1802
|
+
private readonly windowMs;
|
|
1803
|
+
private readonly maxFailures;
|
|
1804
|
+
private readonly now;
|
|
1805
|
+
private recentExits;
|
|
1806
|
+
private tripped_;
|
|
1807
|
+
constructor(opts?: BreakerOptions);
|
|
1808
|
+
recordExit(code: number | null, name: string, kind: string): BreakerDecision;
|
|
1809
|
+
reset(): void;
|
|
1810
|
+
get tripped(): string | undefined;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
interface BaseChildConfig {
|
|
1781
1814
|
name: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1815
|
+
command: string[];
|
|
1816
|
+
args: string[];
|
|
1817
|
+
env: Record<string, string>;
|
|
1818
|
+
enabled: boolean;
|
|
1784
1819
|
}
|
|
1785
|
-
interface
|
|
1820
|
+
interface BaseChildContext {
|
|
1786
1821
|
daemonUrl: string;
|
|
1787
1822
|
daemonHost: string;
|
|
1788
1823
|
daemonPort: number;
|
|
@@ -1790,10 +1825,10 @@ interface TransformerContext {
|
|
|
1790
1825
|
daemonWsUrl: string;
|
|
1791
1826
|
hydraHome: string;
|
|
1792
1827
|
}
|
|
1793
|
-
type
|
|
1794
|
-
interface
|
|
1828
|
+
type BaseChildStatus = "running" | "stopped" | "restarting" | "disabled" | "failed";
|
|
1829
|
+
interface BaseChildInfo {
|
|
1795
1830
|
name: string;
|
|
1796
|
-
status:
|
|
1831
|
+
status: BaseChildStatus;
|
|
1797
1832
|
pid: number | undefined;
|
|
1798
1833
|
enabled: boolean;
|
|
1799
1834
|
restartCount: number;
|
|
@@ -1801,37 +1836,83 @@ interface TransformerInfo {
|
|
|
1801
1836
|
lastExitCode: number | undefined;
|
|
1802
1837
|
logPath: string;
|
|
1803
1838
|
version: string | undefined;
|
|
1839
|
+
failureReason: string | undefined;
|
|
1804
1840
|
}
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1841
|
+
interface SupervisorAdapter {
|
|
1842
|
+
kind: "extension" | "transformer";
|
|
1843
|
+
nameEnvVar: string;
|
|
1844
|
+
tokenRole: "extension" | "transformer";
|
|
1845
|
+
paths: {
|
|
1846
|
+
dir: () => string;
|
|
1847
|
+
logFile: (name: string) => string;
|
|
1848
|
+
pidFile: (name: string) => string;
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1851
|
+
interface ChildEntry<TConfig extends BaseChildConfig> {
|
|
1852
|
+
config: TConfig;
|
|
1853
|
+
child: ChildProcess | undefined;
|
|
1854
|
+
logStream: fs.WriteStream | undefined;
|
|
1855
|
+
restartTimer: NodeJS.Timeout | undefined;
|
|
1856
|
+
pid: number | undefined;
|
|
1857
|
+
startedAt: number | undefined;
|
|
1858
|
+
restartCount: number;
|
|
1859
|
+
lastExitCode: number | undefined;
|
|
1860
|
+
manuallyStopped: boolean;
|
|
1861
|
+
exitWaiters: Array<() => void>;
|
|
1862
|
+
version: string | undefined;
|
|
1863
|
+
processToken: string | undefined;
|
|
1864
|
+
breaker: RestartBreaker;
|
|
1865
|
+
failureReason: string | undefined;
|
|
1866
|
+
}
|
|
1867
|
+
interface ChildSupervisorOptions {
|
|
1868
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
1869
|
+
breakerOptions?: BreakerOptions;
|
|
1870
|
+
restartBaseMs?: number;
|
|
1871
|
+
restartCapMs?: number;
|
|
1872
|
+
}
|
|
1873
|
+
declare class ChildSupervisor<TConfig extends BaseChildConfig> {
|
|
1874
|
+
protected entries: Map<string, ChildEntry<TConfig>>;
|
|
1808
1875
|
private stopping;
|
|
1809
1876
|
private context;
|
|
1810
1877
|
private tokenRegistry;
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1878
|
+
private breakerOptions;
|
|
1879
|
+
private restartBaseMs;
|
|
1880
|
+
private restartCapMs;
|
|
1881
|
+
private adapter;
|
|
1882
|
+
constructor(configs: TConfig[], adapter: SupervisorAdapter, context?: BaseChildContext, options?: ChildSupervisorOptions);
|
|
1883
|
+
setContext(context: BaseChildContext): void;
|
|
1815
1884
|
reportVersion(name: string, version: string): void;
|
|
1816
|
-
registerConnection(name: string, connection: JsonRpcConnection, intercepts: string[]): void;
|
|
1817
|
-
deregisterConnection(name: string): void;
|
|
1818
|
-
resolveChain(names: string[]): TransformerRef[];
|
|
1819
1885
|
start(): Promise<void>;
|
|
1820
1886
|
stop(): Promise<void>;
|
|
1821
|
-
list():
|
|
1822
|
-
get(name: string):
|
|
1887
|
+
list(): BaseChildInfo[];
|
|
1888
|
+
get(name: string): BaseChildInfo | undefined;
|
|
1823
1889
|
has(name: string): boolean;
|
|
1824
|
-
startByName(name: string): Promise<
|
|
1825
|
-
stopByName(name: string): Promise<
|
|
1826
|
-
restartByName(name: string): Promise<
|
|
1827
|
-
register(config:
|
|
1890
|
+
startByName(name: string): Promise<BaseChildInfo>;
|
|
1891
|
+
stopByName(name: string): Promise<BaseChildInfo>;
|
|
1892
|
+
restartByName(name: string): Promise<BaseChildInfo>;
|
|
1893
|
+
register(config: TConfig): BaseChildInfo;
|
|
1828
1894
|
unregister(name: string): Promise<void>;
|
|
1829
1895
|
private terminate;
|
|
1830
|
-
|
|
1896
|
+
protected infoFor(entry: ChildEntry<TConfig>): BaseChildInfo;
|
|
1831
1897
|
private makeEntry;
|
|
1832
1898
|
private reapOrphans;
|
|
1833
1899
|
private spawn;
|
|
1834
1900
|
private scheduleRestart;
|
|
1901
|
+
private managerName;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
type TransformerContext = BaseChildContext;
|
|
1905
|
+
interface TransformerRef {
|
|
1906
|
+
name: string;
|
|
1907
|
+
intercepts: Set<string>;
|
|
1908
|
+
connection: JsonRpcConnection;
|
|
1909
|
+
}
|
|
1910
|
+
declare class TransformerManager extends ChildSupervisor<TransformerConfig> {
|
|
1911
|
+
private connected;
|
|
1912
|
+
constructor(transformers: TransformerConfig[], context?: TransformerContext, options?: ChildSupervisorOptions);
|
|
1913
|
+
registerConnection(name: string, connection: JsonRpcConnection, intercepts: string[]): void;
|
|
1914
|
+
deregisterConnection(name: string): void;
|
|
1915
|
+
resolveChain(names: string[]): TransformerRef[];
|
|
1835
1916
|
}
|
|
1836
1917
|
|
|
1837
1918
|
interface StreamGrepLine {
|
|
@@ -1988,6 +2069,7 @@ interface SessionInit {
|
|
|
1988
2069
|
agentModes?: AdvertisedMode[];
|
|
1989
2070
|
agentModels?: AdvertisedModel[];
|
|
1990
2071
|
firstPromptSeeded?: boolean;
|
|
2072
|
+
scheduleSynopsis?: () => void;
|
|
1991
2073
|
createdAt?: number;
|
|
1992
2074
|
transformChain?: TransformerRef[];
|
|
1993
2075
|
idleEventTimeoutMs?: number;
|
|
@@ -2009,8 +2091,6 @@ interface SessionInit {
|
|
|
2009
2091
|
}
|
|
2010
2092
|
interface CloseOptions {
|
|
2011
2093
|
deleteRecord?: boolean;
|
|
2012
|
-
regenTitle?: boolean;
|
|
2013
|
-
regenTitleTimeoutMs?: number;
|
|
2014
2094
|
}
|
|
2015
2095
|
declare class Session {
|
|
2016
2096
|
readonly sessionId: string;
|
|
@@ -2042,10 +2122,13 @@ declare class Session {
|
|
|
2042
2122
|
private queueWriteChain;
|
|
2043
2123
|
private closed;
|
|
2044
2124
|
private closing;
|
|
2125
|
+
private closeInFlight;
|
|
2045
2126
|
private closeHandlers;
|
|
2046
2127
|
private titleHandlers;
|
|
2128
|
+
private scheduleSynopsisHook?;
|
|
2047
2129
|
private broadcastHandlers;
|
|
2048
|
-
private
|
|
2130
|
+
private _firstPromptSeeded;
|
|
2131
|
+
get firstPromptSeeded(): boolean;
|
|
2049
2132
|
private promptStartedAt;
|
|
2050
2133
|
private appendCount;
|
|
2051
2134
|
private historyMaxEntries;
|
|
@@ -2137,6 +2220,7 @@ declare class Session {
|
|
|
2137
2220
|
emitToChain(emitterName: string, method: string, envelope: unknown): Promise<void>;
|
|
2138
2221
|
private rewriteForAgent;
|
|
2139
2222
|
close(opts?: CloseOptions): Promise<void>;
|
|
2223
|
+
private doClose;
|
|
2140
2224
|
onClose(handler: (opts: {
|
|
2141
2225
|
deleteRecord: boolean;
|
|
2142
2226
|
}) => void): void;
|
|
@@ -2175,7 +2259,6 @@ declare class Session {
|
|
|
2175
2259
|
private handleHelpCommand;
|
|
2176
2260
|
private handleModelCommand;
|
|
2177
2261
|
private runTitleCommand;
|
|
2178
|
-
private runTitleRegen;
|
|
2179
2262
|
private runInternalPrompt;
|
|
2180
2263
|
private runAgentCommand;
|
|
2181
2264
|
private runKillCommand;
|
|
@@ -2246,6 +2329,30 @@ declare class Session {
|
|
|
2246
2329
|
private clearAmendIfMatches;
|
|
2247
2330
|
}
|
|
2248
2331
|
|
|
2332
|
+
declare const SessionSynopsis: z.ZodObject<{
|
|
2333
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2334
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2335
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2336
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2337
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2338
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2339
|
+
}, "strip", z.ZodTypeAny, {
|
|
2340
|
+
outcome?: string | undefined;
|
|
2341
|
+
goal?: string | undefined;
|
|
2342
|
+
files_touched?: string[] | undefined;
|
|
2343
|
+
tools_used?: string[] | undefined;
|
|
2344
|
+
rejected_approaches?: string[] | undefined;
|
|
2345
|
+
open_threads?: string[] | undefined;
|
|
2346
|
+
}, {
|
|
2347
|
+
outcome?: string | undefined;
|
|
2348
|
+
goal?: string | undefined;
|
|
2349
|
+
files_touched?: string[] | undefined;
|
|
2350
|
+
tools_used?: string[] | undefined;
|
|
2351
|
+
rejected_approaches?: string[] | undefined;
|
|
2352
|
+
open_threads?: string[] | undefined;
|
|
2353
|
+
}>;
|
|
2354
|
+
type SessionSynopsis = z.infer<typeof SessionSynopsis>;
|
|
2355
|
+
|
|
2249
2356
|
declare const SessionRecord: z.ZodObject<{
|
|
2250
2357
|
version: z.ZodLiteral<1>;
|
|
2251
2358
|
sessionId: z.ZodString;
|
|
@@ -2257,6 +2364,29 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2257
2364
|
agentId: z.ZodString;
|
|
2258
2365
|
cwd: z.ZodString;
|
|
2259
2366
|
title: z.ZodOptional<z.ZodString>;
|
|
2367
|
+
synopsis: z.ZodOptional<z.ZodObject<{
|
|
2368
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2369
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2370
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2371
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2372
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2373
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2374
|
+
}, "strip", z.ZodTypeAny, {
|
|
2375
|
+
outcome?: string | undefined;
|
|
2376
|
+
goal?: string | undefined;
|
|
2377
|
+
files_touched?: string[] | undefined;
|
|
2378
|
+
tools_used?: string[] | undefined;
|
|
2379
|
+
rejected_approaches?: string[] | undefined;
|
|
2380
|
+
open_threads?: string[] | undefined;
|
|
2381
|
+
}, {
|
|
2382
|
+
outcome?: string | undefined;
|
|
2383
|
+
goal?: string | undefined;
|
|
2384
|
+
files_touched?: string[] | undefined;
|
|
2385
|
+
tools_used?: string[] | undefined;
|
|
2386
|
+
rejected_approaches?: string[] | undefined;
|
|
2387
|
+
open_threads?: string[] | undefined;
|
|
2388
|
+
}>>;
|
|
2389
|
+
summarizedThroughEntry: z.ZodOptional<z.ZodNumber>;
|
|
2260
2390
|
agentArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2261
2391
|
currentModel: z.ZodOptional<z.ZodString>;
|
|
2262
2392
|
currentMode: z.ZodOptional<z.ZodString>;
|
|
@@ -2359,8 +2489,17 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2359
2489
|
name: string;
|
|
2360
2490
|
version?: string | undefined;
|
|
2361
2491
|
} | undefined;
|
|
2492
|
+
synopsis?: {
|
|
2493
|
+
outcome?: string | undefined;
|
|
2494
|
+
goal?: string | undefined;
|
|
2495
|
+
files_touched?: string[] | undefined;
|
|
2496
|
+
tools_used?: string[] | undefined;
|
|
2497
|
+
rejected_approaches?: string[] | undefined;
|
|
2498
|
+
open_threads?: string[] | undefined;
|
|
2499
|
+
} | undefined;
|
|
2362
2500
|
lineageId?: string | undefined;
|
|
2363
2501
|
importedFromSessionId?: string | undefined;
|
|
2502
|
+
summarizedThroughEntry?: number | undefined;
|
|
2364
2503
|
agentCommands?: {
|
|
2365
2504
|
name: string;
|
|
2366
2505
|
description?: string | undefined;
|
|
@@ -2404,8 +2543,17 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2404
2543
|
name: string;
|
|
2405
2544
|
version?: string | undefined;
|
|
2406
2545
|
} | undefined;
|
|
2546
|
+
synopsis?: {
|
|
2547
|
+
outcome?: string | undefined;
|
|
2548
|
+
goal?: string | undefined;
|
|
2549
|
+
files_touched?: string[] | undefined;
|
|
2550
|
+
tools_used?: string[] | undefined;
|
|
2551
|
+
rejected_approaches?: string[] | undefined;
|
|
2552
|
+
open_threads?: string[] | undefined;
|
|
2553
|
+
} | undefined;
|
|
2407
2554
|
lineageId?: string | undefined;
|
|
2408
2555
|
importedFromSessionId?: string | undefined;
|
|
2556
|
+
summarizedThroughEntry?: number | undefined;
|
|
2409
2557
|
agentCommands?: {
|
|
2410
2558
|
name: string;
|
|
2411
2559
|
description?: string | undefined;
|
|
@@ -2454,6 +2602,29 @@ declare const Bundle: z.ZodObject<{
|
|
|
2454
2602
|
agentId: z.ZodString;
|
|
2455
2603
|
cwd: z.ZodString;
|
|
2456
2604
|
title: z.ZodOptional<z.ZodString>;
|
|
2605
|
+
synopsis: z.ZodOptional<z.ZodObject<{
|
|
2606
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2607
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2608
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2609
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2610
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2611
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2612
|
+
}, "strip", z.ZodTypeAny, {
|
|
2613
|
+
outcome?: string | undefined;
|
|
2614
|
+
goal?: string | undefined;
|
|
2615
|
+
files_touched?: string[] | undefined;
|
|
2616
|
+
tools_used?: string[] | undefined;
|
|
2617
|
+
rejected_approaches?: string[] | undefined;
|
|
2618
|
+
open_threads?: string[] | undefined;
|
|
2619
|
+
}, {
|
|
2620
|
+
outcome?: string | undefined;
|
|
2621
|
+
goal?: string | undefined;
|
|
2622
|
+
files_touched?: string[] | undefined;
|
|
2623
|
+
tools_used?: string[] | undefined;
|
|
2624
|
+
rejected_approaches?: string[] | undefined;
|
|
2625
|
+
open_threads?: string[] | undefined;
|
|
2626
|
+
}>>;
|
|
2627
|
+
summarizedThroughEntry: z.ZodOptional<z.ZodNumber>;
|
|
2457
2628
|
currentModel: z.ZodOptional<z.ZodString>;
|
|
2458
2629
|
currentMode: z.ZodOptional<z.ZodString>;
|
|
2459
2630
|
currentUsage: z.ZodOptional<z.ZodObject<{
|
|
@@ -2518,6 +2689,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2518
2689
|
costCurrency?: string | undefined;
|
|
2519
2690
|
cumulativeCost?: number | undefined;
|
|
2520
2691
|
} | undefined;
|
|
2692
|
+
synopsis?: {
|
|
2693
|
+
outcome?: string | undefined;
|
|
2694
|
+
goal?: string | undefined;
|
|
2695
|
+
files_touched?: string[] | undefined;
|
|
2696
|
+
tools_used?: string[] | undefined;
|
|
2697
|
+
rejected_approaches?: string[] | undefined;
|
|
2698
|
+
open_threads?: string[] | undefined;
|
|
2699
|
+
} | undefined;
|
|
2700
|
+
summarizedThroughEntry?: number | undefined;
|
|
2521
2701
|
agentCommands?: {
|
|
2522
2702
|
name: string;
|
|
2523
2703
|
description?: string | undefined;
|
|
@@ -2545,6 +2725,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2545
2725
|
costCurrency?: string | undefined;
|
|
2546
2726
|
cumulativeCost?: number | undefined;
|
|
2547
2727
|
} | undefined;
|
|
2728
|
+
synopsis?: {
|
|
2729
|
+
outcome?: string | undefined;
|
|
2730
|
+
goal?: string | undefined;
|
|
2731
|
+
files_touched?: string[] | undefined;
|
|
2732
|
+
tools_used?: string[] | undefined;
|
|
2733
|
+
rejected_approaches?: string[] | undefined;
|
|
2734
|
+
open_threads?: string[] | undefined;
|
|
2735
|
+
} | undefined;
|
|
2736
|
+
summarizedThroughEntry?: number | undefined;
|
|
2548
2737
|
agentCommands?: {
|
|
2549
2738
|
name: string;
|
|
2550
2739
|
description?: string | undefined;
|
|
@@ -2589,6 +2778,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2589
2778
|
costCurrency?: string | undefined;
|
|
2590
2779
|
cumulativeCost?: number | undefined;
|
|
2591
2780
|
} | undefined;
|
|
2781
|
+
synopsis?: {
|
|
2782
|
+
outcome?: string | undefined;
|
|
2783
|
+
goal?: string | undefined;
|
|
2784
|
+
files_touched?: string[] | undefined;
|
|
2785
|
+
tools_used?: string[] | undefined;
|
|
2786
|
+
rejected_approaches?: string[] | undefined;
|
|
2787
|
+
open_threads?: string[] | undefined;
|
|
2788
|
+
} | undefined;
|
|
2789
|
+
summarizedThroughEntry?: number | undefined;
|
|
2592
2790
|
agentCommands?: {
|
|
2593
2791
|
name: string;
|
|
2594
2792
|
description?: string | undefined;
|
|
@@ -2631,6 +2829,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2631
2829
|
costCurrency?: string | undefined;
|
|
2632
2830
|
cumulativeCost?: number | undefined;
|
|
2633
2831
|
} | undefined;
|
|
2832
|
+
synopsis?: {
|
|
2833
|
+
outcome?: string | undefined;
|
|
2834
|
+
goal?: string | undefined;
|
|
2835
|
+
files_touched?: string[] | undefined;
|
|
2836
|
+
tools_used?: string[] | undefined;
|
|
2837
|
+
rejected_approaches?: string[] | undefined;
|
|
2838
|
+
open_threads?: string[] | undefined;
|
|
2839
|
+
} | undefined;
|
|
2840
|
+
summarizedThroughEntry?: number | undefined;
|
|
2634
2841
|
agentCommands?: {
|
|
2635
2842
|
name: string;
|
|
2636
2843
|
description?: string | undefined;
|
|
@@ -2677,6 +2884,8 @@ interface ResurrectParams {
|
|
|
2677
2884
|
agentId: string;
|
|
2678
2885
|
cwd: string;
|
|
2679
2886
|
title?: string;
|
|
2887
|
+
synopsis?: SessionSynopsis;
|
|
2888
|
+
summarizedThroughEntry?: number;
|
|
2680
2889
|
agentArgs?: string[];
|
|
2681
2890
|
onInstallProgress?: AgentInstallProgressCallback;
|
|
2682
2891
|
currentModel?: string;
|
|
@@ -2698,6 +2907,9 @@ type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
|
|
|
2698
2907
|
interface SessionManagerOptions {
|
|
2699
2908
|
idleTimeoutMs?: number;
|
|
2700
2909
|
defaultModels?: Record<string, string>;
|
|
2910
|
+
synopsisAgent?: string;
|
|
2911
|
+
synopsisModel?: string;
|
|
2912
|
+
synopsisOnClose?: boolean;
|
|
2701
2913
|
sessionHistoryMaxEntries?: number;
|
|
2702
2914
|
defaultTransformers?: string[];
|
|
2703
2915
|
idleEventTimeoutMs?: number;
|
|
@@ -2714,6 +2926,9 @@ declare class SessionManager {
|
|
|
2714
2926
|
private histories;
|
|
2715
2927
|
private idleTimeoutMs;
|
|
2716
2928
|
private defaultModels;
|
|
2929
|
+
private synopsisAgent?;
|
|
2930
|
+
private synopsisModel?;
|
|
2931
|
+
private synopsisOnClose;
|
|
2717
2932
|
readonly defaultTransformers: string[];
|
|
2718
2933
|
private idleEventTimeoutMs;
|
|
2719
2934
|
private sessionHistoryMaxEntries;
|
|
@@ -2721,6 +2936,7 @@ declare class SessionManager {
|
|
|
2721
2936
|
private logger?;
|
|
2722
2937
|
private npmRegistry?;
|
|
2723
2938
|
private extensionCommands?;
|
|
2939
|
+
private synopsisCoordinator;
|
|
2724
2940
|
constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
|
|
2725
2941
|
create(params: CreateSessionParams): Promise<Session>;
|
|
2726
2942
|
resurrect(params: ResurrectParams): Promise<Session>;
|
|
@@ -2776,61 +2992,22 @@ declare class SessionManager {
|
|
|
2776
2992
|
hasRecord(sessionId: string): Promise<boolean>;
|
|
2777
2993
|
setTitle(sessionId: string, title: string): Promise<boolean>;
|
|
2778
2994
|
private persistTitle;
|
|
2995
|
+
private persistSynopsis;
|
|
2779
2996
|
private persistAgentChange;
|
|
2780
2997
|
private persistSnapshot;
|
|
2781
2998
|
private enqueueMetaWrite;
|
|
2782
2999
|
closeAll(): Promise<void>;
|
|
3000
|
+
flushSynopsis(timeoutMs: number): Promise<void>;
|
|
3001
|
+
shutdownSynopsis(): Promise<void>;
|
|
3002
|
+
scheduleSynopsis(sessionId: string): void;
|
|
2783
3003
|
flushMetaWrites(): Promise<void>;
|
|
2784
3004
|
flushHistoryWrites(): Promise<void>;
|
|
2785
3005
|
resurrectPendingQueues(): Promise<void>;
|
|
2786
3006
|
}
|
|
2787
3007
|
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
daemonPort: number;
|
|
2792
|
-
serviceToken: string;
|
|
2793
|
-
daemonWsUrl: string;
|
|
2794
|
-
hydraHome: string;
|
|
2795
|
-
}
|
|
2796
|
-
type ExtensionStatus = "running" | "stopped" | "restarting" | "disabled";
|
|
2797
|
-
interface ExtensionInfo {
|
|
2798
|
-
name: string;
|
|
2799
|
-
status: ExtensionStatus;
|
|
2800
|
-
pid: number | undefined;
|
|
2801
|
-
enabled: boolean;
|
|
2802
|
-
restartCount: number;
|
|
2803
|
-
startedAt: number | undefined;
|
|
2804
|
-
lastExitCode: number | undefined;
|
|
2805
|
-
logPath: string;
|
|
2806
|
-
version: string | undefined;
|
|
2807
|
-
}
|
|
2808
|
-
declare class ExtensionManager {
|
|
2809
|
-
private entries;
|
|
2810
|
-
private stopping;
|
|
2811
|
-
private context;
|
|
2812
|
-
private tokenRegistry;
|
|
2813
|
-
constructor(extensions: ExtensionConfig[], context?: ExtensionContext, options?: {
|
|
2814
|
-
tokenRegistry?: ProcessTokenRegistry;
|
|
2815
|
-
});
|
|
2816
|
-
setContext(context: ExtensionContext): void;
|
|
2817
|
-
reportVersion(name: string, version: string): void;
|
|
2818
|
-
start(): Promise<void>;
|
|
2819
|
-
stop(): Promise<void>;
|
|
2820
|
-
list(): ExtensionInfo[];
|
|
2821
|
-
get(name: string): ExtensionInfo | undefined;
|
|
2822
|
-
has(name: string): boolean;
|
|
2823
|
-
startByName(name: string): Promise<ExtensionInfo>;
|
|
2824
|
-
stopByName(name: string): Promise<ExtensionInfo>;
|
|
2825
|
-
restartByName(name: string): Promise<ExtensionInfo>;
|
|
2826
|
-
register(config: ExtensionConfig): ExtensionInfo;
|
|
2827
|
-
unregister(name: string): Promise<void>;
|
|
2828
|
-
private terminate;
|
|
2829
|
-
private infoFor;
|
|
2830
|
-
private makeEntry;
|
|
2831
|
-
private reapOrphans;
|
|
2832
|
-
private spawn;
|
|
2833
|
-
private scheduleRestart;
|
|
3008
|
+
type ExtensionContext = BaseChildContext;
|
|
3009
|
+
declare class ExtensionManager extends ChildSupervisor<ExtensionConfig> {
|
|
3010
|
+
constructor(extensions: ExtensionConfig[], context?: ExtensionContext, options?: ChildSupervisorOptions);
|
|
2834
3011
|
}
|
|
2835
3012
|
|
|
2836
3013
|
interface TokenReservation {
|
|
@@ -2910,6 +3087,7 @@ declare const paths: {
|
|
|
2910
3087
|
currentLogFile: () => string;
|
|
2911
3088
|
registryCache: () => string;
|
|
2912
3089
|
agentsDir: () => string;
|
|
3090
|
+
agentLogFile: (id: string) => string;
|
|
2913
3091
|
agentInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2914
3092
|
agentNpmInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2915
3093
|
sessionsDir: () => string;
|