@hydra-acp/cli 0.1.53 → 0.1.55
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 +8271 -6666
- package/dist/index.d.ts +266 -78
- package/dist/index.js +3123 -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<{
|
|
@@ -148,6 +153,8 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
148
153
|
defaultEnterAction: z.ZodDefault<z.ZodEnum<["enqueue", "amend"]>>;
|
|
149
154
|
showThoughts: z.ZodDefault<z.ZodBoolean>;
|
|
150
155
|
promptHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
|
|
156
|
+
maxToolItems: z.ZodDefault<z.ZodNumber>;
|
|
157
|
+
maxPlanItems: z.ZodDefault<z.ZodNumber>;
|
|
151
158
|
showFileUpdates: z.ZodDefault<z.ZodEnum<["none", "edit", "diff"]>>;
|
|
152
159
|
}, "strip", z.ZodTypeAny, {
|
|
153
160
|
repaintThrottleMs: number;
|
|
@@ -159,7 +166,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
159
166
|
defaultEnterAction: "enqueue" | "amend";
|
|
160
167
|
showThoughts: boolean;
|
|
161
168
|
promptHistoryMaxEntries: number;
|
|
162
|
-
|
|
169
|
+
maxToolItems: number;
|
|
170
|
+
maxPlanItems: number;
|
|
171
|
+
showFileUpdates: "diff" | "none" | "edit";
|
|
163
172
|
}, {
|
|
164
173
|
repaintThrottleMs?: number | undefined;
|
|
165
174
|
maxScrollbackLines?: number | undefined;
|
|
@@ -170,7 +179,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
170
179
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
171
180
|
showThoughts?: boolean | undefined;
|
|
172
181
|
promptHistoryMaxEntries?: number | undefined;
|
|
173
|
-
|
|
182
|
+
maxToolItems?: number | undefined;
|
|
183
|
+
maxPlanItems?: number | undefined;
|
|
184
|
+
showFileUpdates?: "diff" | "none" | "edit" | undefined;
|
|
174
185
|
}>>;
|
|
175
186
|
}, "strip", z.ZodTypeAny, {
|
|
176
187
|
tui: {
|
|
@@ -183,7 +194,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
183
194
|
defaultEnterAction: "enqueue" | "amend";
|
|
184
195
|
showThoughts: boolean;
|
|
185
196
|
promptHistoryMaxEntries: number;
|
|
186
|
-
|
|
197
|
+
maxToolItems: number;
|
|
198
|
+
maxPlanItems: number;
|
|
199
|
+
showFileUpdates: "diff" | "none" | "edit";
|
|
187
200
|
};
|
|
188
201
|
daemon: {
|
|
189
202
|
host: string;
|
|
@@ -217,9 +230,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
217
230
|
};
|
|
218
231
|
defaultAgent: string;
|
|
219
232
|
defaultModels: Record<string, string>;
|
|
233
|
+
synopsisOnClose: boolean;
|
|
220
234
|
defaultCwd: string;
|
|
221
235
|
sessionListColdLimit: number;
|
|
222
236
|
defaultTransformers: string[];
|
|
237
|
+
synopsisAgent?: string | undefined;
|
|
238
|
+
synopsisModel?: string | undefined;
|
|
223
239
|
npmRegistry?: string | undefined;
|
|
224
240
|
}, {
|
|
225
241
|
tui?: {
|
|
@@ -232,7 +248,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
232
248
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
233
249
|
showThoughts?: boolean | undefined;
|
|
234
250
|
promptHistoryMaxEntries?: number | undefined;
|
|
235
|
-
|
|
251
|
+
maxToolItems?: number | undefined;
|
|
252
|
+
maxPlanItems?: number | undefined;
|
|
253
|
+
showFileUpdates?: "diff" | "none" | "edit" | undefined;
|
|
236
254
|
} | undefined;
|
|
237
255
|
daemon?: {
|
|
238
256
|
host?: string | undefined;
|
|
@@ -266,6 +284,9 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
266
284
|
} | undefined;
|
|
267
285
|
defaultAgent?: string | undefined;
|
|
268
286
|
defaultModels?: Record<string, string> | undefined;
|
|
287
|
+
synopsisAgent?: string | undefined;
|
|
288
|
+
synopsisModel?: string | undefined;
|
|
289
|
+
synopsisOnClose?: boolean | undefined;
|
|
269
290
|
defaultCwd?: string | undefined;
|
|
270
291
|
sessionListColdLimit?: number | undefined;
|
|
271
292
|
defaultTransformers?: string[] | undefined;
|
|
@@ -1748,8 +1769,10 @@ declare class AgentInstance {
|
|
|
1748
1769
|
private stderrTail;
|
|
1749
1770
|
private stderrTailBytes;
|
|
1750
1771
|
private logger?;
|
|
1772
|
+
private fileLog?;
|
|
1751
1773
|
private exitHandlers;
|
|
1752
1774
|
private constructor();
|
|
1775
|
+
private writeLog;
|
|
1753
1776
|
private formatFailure;
|
|
1754
1777
|
static spawn(opts: AgentInstanceOptions): AgentInstance;
|
|
1755
1778
|
onExit(handler: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
@@ -1777,12 +1800,34 @@ declare class ProcessTokenRegistry implements TokenValidator {
|
|
|
1777
1800
|
validate(token: string): Promise<string | undefined>;
|
|
1778
1801
|
}
|
|
1779
1802
|
|
|
1780
|
-
interface
|
|
1803
|
+
interface BreakerOptions {
|
|
1804
|
+
windowMs?: number;
|
|
1805
|
+
maxFailuresInWindow?: number;
|
|
1806
|
+
now?: () => number;
|
|
1807
|
+
}
|
|
1808
|
+
type BreakerDecision = "restart" | {
|
|
1809
|
+
tripped: string;
|
|
1810
|
+
};
|
|
1811
|
+
declare class RestartBreaker {
|
|
1812
|
+
private readonly windowMs;
|
|
1813
|
+
private readonly maxFailures;
|
|
1814
|
+
private readonly now;
|
|
1815
|
+
private recentExits;
|
|
1816
|
+
private tripped_;
|
|
1817
|
+
constructor(opts?: BreakerOptions);
|
|
1818
|
+
recordExit(code: number | null, name: string, kind: string): BreakerDecision;
|
|
1819
|
+
reset(): void;
|
|
1820
|
+
get tripped(): string | undefined;
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
interface BaseChildConfig {
|
|
1781
1824
|
name: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1825
|
+
command: string[];
|
|
1826
|
+
args: string[];
|
|
1827
|
+
env: Record<string, string>;
|
|
1828
|
+
enabled: boolean;
|
|
1784
1829
|
}
|
|
1785
|
-
interface
|
|
1830
|
+
interface BaseChildContext {
|
|
1786
1831
|
daemonUrl: string;
|
|
1787
1832
|
daemonHost: string;
|
|
1788
1833
|
daemonPort: number;
|
|
@@ -1790,10 +1835,10 @@ interface TransformerContext {
|
|
|
1790
1835
|
daemonWsUrl: string;
|
|
1791
1836
|
hydraHome: string;
|
|
1792
1837
|
}
|
|
1793
|
-
type
|
|
1794
|
-
interface
|
|
1838
|
+
type BaseChildStatus = "running" | "stopped" | "restarting" | "disabled" | "failed";
|
|
1839
|
+
interface BaseChildInfo {
|
|
1795
1840
|
name: string;
|
|
1796
|
-
status:
|
|
1841
|
+
status: BaseChildStatus;
|
|
1797
1842
|
pid: number | undefined;
|
|
1798
1843
|
enabled: boolean;
|
|
1799
1844
|
restartCount: number;
|
|
@@ -1801,37 +1846,83 @@ interface TransformerInfo {
|
|
|
1801
1846
|
lastExitCode: number | undefined;
|
|
1802
1847
|
logPath: string;
|
|
1803
1848
|
version: string | undefined;
|
|
1849
|
+
failureReason: string | undefined;
|
|
1804
1850
|
}
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1851
|
+
interface SupervisorAdapter {
|
|
1852
|
+
kind: "extension" | "transformer";
|
|
1853
|
+
nameEnvVar: string;
|
|
1854
|
+
tokenRole: "extension" | "transformer";
|
|
1855
|
+
paths: {
|
|
1856
|
+
dir: () => string;
|
|
1857
|
+
logFile: (name: string) => string;
|
|
1858
|
+
pidFile: (name: string) => string;
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
interface ChildEntry<TConfig extends BaseChildConfig> {
|
|
1862
|
+
config: TConfig;
|
|
1863
|
+
child: ChildProcess | undefined;
|
|
1864
|
+
logStream: fs.WriteStream | undefined;
|
|
1865
|
+
restartTimer: NodeJS.Timeout | undefined;
|
|
1866
|
+
pid: number | undefined;
|
|
1867
|
+
startedAt: number | undefined;
|
|
1868
|
+
restartCount: number;
|
|
1869
|
+
lastExitCode: number | undefined;
|
|
1870
|
+
manuallyStopped: boolean;
|
|
1871
|
+
exitWaiters: Array<() => void>;
|
|
1872
|
+
version: string | undefined;
|
|
1873
|
+
processToken: string | undefined;
|
|
1874
|
+
breaker: RestartBreaker;
|
|
1875
|
+
failureReason: string | undefined;
|
|
1876
|
+
}
|
|
1877
|
+
interface ChildSupervisorOptions {
|
|
1878
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
1879
|
+
breakerOptions?: BreakerOptions;
|
|
1880
|
+
restartBaseMs?: number;
|
|
1881
|
+
restartCapMs?: number;
|
|
1882
|
+
}
|
|
1883
|
+
declare class ChildSupervisor<TConfig extends BaseChildConfig> {
|
|
1884
|
+
protected entries: Map<string, ChildEntry<TConfig>>;
|
|
1808
1885
|
private stopping;
|
|
1809
1886
|
private context;
|
|
1810
1887
|
private tokenRegistry;
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1888
|
+
private breakerOptions;
|
|
1889
|
+
private restartBaseMs;
|
|
1890
|
+
private restartCapMs;
|
|
1891
|
+
private adapter;
|
|
1892
|
+
constructor(configs: TConfig[], adapter: SupervisorAdapter, context?: BaseChildContext, options?: ChildSupervisorOptions);
|
|
1893
|
+
setContext(context: BaseChildContext): void;
|
|
1815
1894
|
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
1895
|
start(): Promise<void>;
|
|
1820
1896
|
stop(): Promise<void>;
|
|
1821
|
-
list():
|
|
1822
|
-
get(name: string):
|
|
1897
|
+
list(): BaseChildInfo[];
|
|
1898
|
+
get(name: string): BaseChildInfo | undefined;
|
|
1823
1899
|
has(name: string): boolean;
|
|
1824
|
-
startByName(name: string): Promise<
|
|
1825
|
-
stopByName(name: string): Promise<
|
|
1826
|
-
restartByName(name: string): Promise<
|
|
1827
|
-
register(config:
|
|
1900
|
+
startByName(name: string): Promise<BaseChildInfo>;
|
|
1901
|
+
stopByName(name: string): Promise<BaseChildInfo>;
|
|
1902
|
+
restartByName(name: string): Promise<BaseChildInfo>;
|
|
1903
|
+
register(config: TConfig): BaseChildInfo;
|
|
1828
1904
|
unregister(name: string): Promise<void>;
|
|
1829
1905
|
private terminate;
|
|
1830
|
-
|
|
1906
|
+
protected infoFor(entry: ChildEntry<TConfig>): BaseChildInfo;
|
|
1831
1907
|
private makeEntry;
|
|
1832
1908
|
private reapOrphans;
|
|
1833
1909
|
private spawn;
|
|
1834
1910
|
private scheduleRestart;
|
|
1911
|
+
private managerName;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
type TransformerContext = BaseChildContext;
|
|
1915
|
+
interface TransformerRef {
|
|
1916
|
+
name: string;
|
|
1917
|
+
intercepts: Set<string>;
|
|
1918
|
+
connection: JsonRpcConnection;
|
|
1919
|
+
}
|
|
1920
|
+
declare class TransformerManager extends ChildSupervisor<TransformerConfig> {
|
|
1921
|
+
private connected;
|
|
1922
|
+
constructor(transformers: TransformerConfig[], context?: TransformerContext, options?: ChildSupervisorOptions);
|
|
1923
|
+
registerConnection(name: string, connection: JsonRpcConnection, intercepts: string[]): void;
|
|
1924
|
+
deregisterConnection(name: string): void;
|
|
1925
|
+
resolveChain(names: string[]): TransformerRef[];
|
|
1835
1926
|
}
|
|
1836
1927
|
|
|
1837
1928
|
interface StreamGrepLine {
|
|
@@ -1988,6 +2079,7 @@ interface SessionInit {
|
|
|
1988
2079
|
agentModes?: AdvertisedMode[];
|
|
1989
2080
|
agentModels?: AdvertisedModel[];
|
|
1990
2081
|
firstPromptSeeded?: boolean;
|
|
2082
|
+
scheduleSynopsis?: () => void;
|
|
1991
2083
|
createdAt?: number;
|
|
1992
2084
|
transformChain?: TransformerRef[];
|
|
1993
2085
|
idleEventTimeoutMs?: number;
|
|
@@ -2009,8 +2101,6 @@ interface SessionInit {
|
|
|
2009
2101
|
}
|
|
2010
2102
|
interface CloseOptions {
|
|
2011
2103
|
deleteRecord?: boolean;
|
|
2012
|
-
regenTitle?: boolean;
|
|
2013
|
-
regenTitleTimeoutMs?: number;
|
|
2014
2104
|
}
|
|
2015
2105
|
declare class Session {
|
|
2016
2106
|
readonly sessionId: string;
|
|
@@ -2042,10 +2132,13 @@ declare class Session {
|
|
|
2042
2132
|
private queueWriteChain;
|
|
2043
2133
|
private closed;
|
|
2044
2134
|
private closing;
|
|
2135
|
+
private closeInFlight;
|
|
2045
2136
|
private closeHandlers;
|
|
2046
2137
|
private titleHandlers;
|
|
2138
|
+
private scheduleSynopsisHook?;
|
|
2047
2139
|
private broadcastHandlers;
|
|
2048
|
-
private
|
|
2140
|
+
private _firstPromptSeeded;
|
|
2141
|
+
get firstPromptSeeded(): boolean;
|
|
2049
2142
|
private promptStartedAt;
|
|
2050
2143
|
private appendCount;
|
|
2051
2144
|
private historyMaxEntries;
|
|
@@ -2137,6 +2230,7 @@ declare class Session {
|
|
|
2137
2230
|
emitToChain(emitterName: string, method: string, envelope: unknown): Promise<void>;
|
|
2138
2231
|
private rewriteForAgent;
|
|
2139
2232
|
close(opts?: CloseOptions): Promise<void>;
|
|
2233
|
+
private doClose;
|
|
2140
2234
|
onClose(handler: (opts: {
|
|
2141
2235
|
deleteRecord: boolean;
|
|
2142
2236
|
}) => void): void;
|
|
@@ -2175,7 +2269,6 @@ declare class Session {
|
|
|
2175
2269
|
private handleHelpCommand;
|
|
2176
2270
|
private handleModelCommand;
|
|
2177
2271
|
private runTitleCommand;
|
|
2178
|
-
private runTitleRegen;
|
|
2179
2272
|
private runInternalPrompt;
|
|
2180
2273
|
private runAgentCommand;
|
|
2181
2274
|
private runKillCommand;
|
|
@@ -2246,6 +2339,30 @@ declare class Session {
|
|
|
2246
2339
|
private clearAmendIfMatches;
|
|
2247
2340
|
}
|
|
2248
2341
|
|
|
2342
|
+
declare const SessionSynopsis: z.ZodObject<{
|
|
2343
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2344
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2345
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2346
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2347
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2348
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2349
|
+
}, "strip", z.ZodTypeAny, {
|
|
2350
|
+
outcome?: string | undefined;
|
|
2351
|
+
goal?: string | undefined;
|
|
2352
|
+
files_touched?: string[] | undefined;
|
|
2353
|
+
tools_used?: string[] | undefined;
|
|
2354
|
+
rejected_approaches?: string[] | undefined;
|
|
2355
|
+
open_threads?: string[] | undefined;
|
|
2356
|
+
}, {
|
|
2357
|
+
outcome?: string | undefined;
|
|
2358
|
+
goal?: string | undefined;
|
|
2359
|
+
files_touched?: string[] | undefined;
|
|
2360
|
+
tools_used?: string[] | undefined;
|
|
2361
|
+
rejected_approaches?: string[] | undefined;
|
|
2362
|
+
open_threads?: string[] | undefined;
|
|
2363
|
+
}>;
|
|
2364
|
+
type SessionSynopsis = z.infer<typeof SessionSynopsis>;
|
|
2365
|
+
|
|
2249
2366
|
declare const SessionRecord: z.ZodObject<{
|
|
2250
2367
|
version: z.ZodLiteral<1>;
|
|
2251
2368
|
sessionId: z.ZodString;
|
|
@@ -2257,6 +2374,29 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2257
2374
|
agentId: z.ZodString;
|
|
2258
2375
|
cwd: z.ZodString;
|
|
2259
2376
|
title: z.ZodOptional<z.ZodString>;
|
|
2377
|
+
synopsis: z.ZodOptional<z.ZodObject<{
|
|
2378
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2379
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2380
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2381
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2382
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2383
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2384
|
+
}, "strip", z.ZodTypeAny, {
|
|
2385
|
+
outcome?: string | undefined;
|
|
2386
|
+
goal?: string | undefined;
|
|
2387
|
+
files_touched?: string[] | undefined;
|
|
2388
|
+
tools_used?: string[] | undefined;
|
|
2389
|
+
rejected_approaches?: string[] | undefined;
|
|
2390
|
+
open_threads?: string[] | undefined;
|
|
2391
|
+
}, {
|
|
2392
|
+
outcome?: string | undefined;
|
|
2393
|
+
goal?: string | undefined;
|
|
2394
|
+
files_touched?: string[] | undefined;
|
|
2395
|
+
tools_used?: string[] | undefined;
|
|
2396
|
+
rejected_approaches?: string[] | undefined;
|
|
2397
|
+
open_threads?: string[] | undefined;
|
|
2398
|
+
}>>;
|
|
2399
|
+
summarizedThroughEntry: z.ZodOptional<z.ZodNumber>;
|
|
2260
2400
|
agentArgs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2261
2401
|
currentModel: z.ZodOptional<z.ZodString>;
|
|
2262
2402
|
currentMode: z.ZodOptional<z.ZodString>;
|
|
@@ -2359,8 +2499,17 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2359
2499
|
name: string;
|
|
2360
2500
|
version?: string | undefined;
|
|
2361
2501
|
} | undefined;
|
|
2502
|
+
synopsis?: {
|
|
2503
|
+
outcome?: string | undefined;
|
|
2504
|
+
goal?: string | undefined;
|
|
2505
|
+
files_touched?: string[] | undefined;
|
|
2506
|
+
tools_used?: string[] | undefined;
|
|
2507
|
+
rejected_approaches?: string[] | undefined;
|
|
2508
|
+
open_threads?: string[] | undefined;
|
|
2509
|
+
} | undefined;
|
|
2362
2510
|
lineageId?: string | undefined;
|
|
2363
2511
|
importedFromSessionId?: string | undefined;
|
|
2512
|
+
summarizedThroughEntry?: number | undefined;
|
|
2364
2513
|
agentCommands?: {
|
|
2365
2514
|
name: string;
|
|
2366
2515
|
description?: string | undefined;
|
|
@@ -2404,8 +2553,17 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2404
2553
|
name: string;
|
|
2405
2554
|
version?: string | undefined;
|
|
2406
2555
|
} | undefined;
|
|
2556
|
+
synopsis?: {
|
|
2557
|
+
outcome?: string | undefined;
|
|
2558
|
+
goal?: string | undefined;
|
|
2559
|
+
files_touched?: string[] | undefined;
|
|
2560
|
+
tools_used?: string[] | undefined;
|
|
2561
|
+
rejected_approaches?: string[] | undefined;
|
|
2562
|
+
open_threads?: string[] | undefined;
|
|
2563
|
+
} | undefined;
|
|
2407
2564
|
lineageId?: string | undefined;
|
|
2408
2565
|
importedFromSessionId?: string | undefined;
|
|
2566
|
+
summarizedThroughEntry?: number | undefined;
|
|
2409
2567
|
agentCommands?: {
|
|
2410
2568
|
name: string;
|
|
2411
2569
|
description?: string | undefined;
|
|
@@ -2454,6 +2612,29 @@ declare const Bundle: z.ZodObject<{
|
|
|
2454
2612
|
agentId: z.ZodString;
|
|
2455
2613
|
cwd: z.ZodString;
|
|
2456
2614
|
title: z.ZodOptional<z.ZodString>;
|
|
2615
|
+
synopsis: z.ZodOptional<z.ZodObject<{
|
|
2616
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
2617
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
2618
|
+
files_touched: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2619
|
+
tools_used: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2620
|
+
rejected_approaches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2621
|
+
open_threads: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2622
|
+
}, "strip", z.ZodTypeAny, {
|
|
2623
|
+
outcome?: string | undefined;
|
|
2624
|
+
goal?: string | undefined;
|
|
2625
|
+
files_touched?: string[] | undefined;
|
|
2626
|
+
tools_used?: string[] | undefined;
|
|
2627
|
+
rejected_approaches?: string[] | undefined;
|
|
2628
|
+
open_threads?: string[] | undefined;
|
|
2629
|
+
}, {
|
|
2630
|
+
outcome?: string | undefined;
|
|
2631
|
+
goal?: string | undefined;
|
|
2632
|
+
files_touched?: string[] | undefined;
|
|
2633
|
+
tools_used?: string[] | undefined;
|
|
2634
|
+
rejected_approaches?: string[] | undefined;
|
|
2635
|
+
open_threads?: string[] | undefined;
|
|
2636
|
+
}>>;
|
|
2637
|
+
summarizedThroughEntry: z.ZodOptional<z.ZodNumber>;
|
|
2457
2638
|
currentModel: z.ZodOptional<z.ZodString>;
|
|
2458
2639
|
currentMode: z.ZodOptional<z.ZodString>;
|
|
2459
2640
|
currentUsage: z.ZodOptional<z.ZodObject<{
|
|
@@ -2518,6 +2699,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2518
2699
|
costCurrency?: string | undefined;
|
|
2519
2700
|
cumulativeCost?: number | undefined;
|
|
2520
2701
|
} | undefined;
|
|
2702
|
+
synopsis?: {
|
|
2703
|
+
outcome?: string | undefined;
|
|
2704
|
+
goal?: string | undefined;
|
|
2705
|
+
files_touched?: string[] | undefined;
|
|
2706
|
+
tools_used?: string[] | undefined;
|
|
2707
|
+
rejected_approaches?: string[] | undefined;
|
|
2708
|
+
open_threads?: string[] | undefined;
|
|
2709
|
+
} | undefined;
|
|
2710
|
+
summarizedThroughEntry?: number | undefined;
|
|
2521
2711
|
agentCommands?: {
|
|
2522
2712
|
name: string;
|
|
2523
2713
|
description?: string | undefined;
|
|
@@ -2545,6 +2735,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2545
2735
|
costCurrency?: string | undefined;
|
|
2546
2736
|
cumulativeCost?: number | undefined;
|
|
2547
2737
|
} | undefined;
|
|
2738
|
+
synopsis?: {
|
|
2739
|
+
outcome?: string | undefined;
|
|
2740
|
+
goal?: string | undefined;
|
|
2741
|
+
files_touched?: string[] | undefined;
|
|
2742
|
+
tools_used?: string[] | undefined;
|
|
2743
|
+
rejected_approaches?: string[] | undefined;
|
|
2744
|
+
open_threads?: string[] | undefined;
|
|
2745
|
+
} | undefined;
|
|
2746
|
+
summarizedThroughEntry?: number | undefined;
|
|
2548
2747
|
agentCommands?: {
|
|
2549
2748
|
name: string;
|
|
2550
2749
|
description?: string | undefined;
|
|
@@ -2589,6 +2788,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2589
2788
|
costCurrency?: string | undefined;
|
|
2590
2789
|
cumulativeCost?: number | undefined;
|
|
2591
2790
|
} | undefined;
|
|
2791
|
+
synopsis?: {
|
|
2792
|
+
outcome?: string | undefined;
|
|
2793
|
+
goal?: string | undefined;
|
|
2794
|
+
files_touched?: string[] | undefined;
|
|
2795
|
+
tools_used?: string[] | undefined;
|
|
2796
|
+
rejected_approaches?: string[] | undefined;
|
|
2797
|
+
open_threads?: string[] | undefined;
|
|
2798
|
+
} | undefined;
|
|
2799
|
+
summarizedThroughEntry?: number | undefined;
|
|
2592
2800
|
agentCommands?: {
|
|
2593
2801
|
name: string;
|
|
2594
2802
|
description?: string | undefined;
|
|
@@ -2631,6 +2839,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2631
2839
|
costCurrency?: string | undefined;
|
|
2632
2840
|
cumulativeCost?: number | undefined;
|
|
2633
2841
|
} | undefined;
|
|
2842
|
+
synopsis?: {
|
|
2843
|
+
outcome?: string | undefined;
|
|
2844
|
+
goal?: string | undefined;
|
|
2845
|
+
files_touched?: string[] | undefined;
|
|
2846
|
+
tools_used?: string[] | undefined;
|
|
2847
|
+
rejected_approaches?: string[] | undefined;
|
|
2848
|
+
open_threads?: string[] | undefined;
|
|
2849
|
+
} | undefined;
|
|
2850
|
+
summarizedThroughEntry?: number | undefined;
|
|
2634
2851
|
agentCommands?: {
|
|
2635
2852
|
name: string;
|
|
2636
2853
|
description?: string | undefined;
|
|
@@ -2677,6 +2894,8 @@ interface ResurrectParams {
|
|
|
2677
2894
|
agentId: string;
|
|
2678
2895
|
cwd: string;
|
|
2679
2896
|
title?: string;
|
|
2897
|
+
synopsis?: SessionSynopsis;
|
|
2898
|
+
summarizedThroughEntry?: number;
|
|
2680
2899
|
agentArgs?: string[];
|
|
2681
2900
|
onInstallProgress?: AgentInstallProgressCallback;
|
|
2682
2901
|
currentModel?: string;
|
|
@@ -2698,6 +2917,9 @@ type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
|
|
|
2698
2917
|
interface SessionManagerOptions {
|
|
2699
2918
|
idleTimeoutMs?: number;
|
|
2700
2919
|
defaultModels?: Record<string, string>;
|
|
2920
|
+
synopsisAgent?: string;
|
|
2921
|
+
synopsisModel?: string;
|
|
2922
|
+
synopsisOnClose?: boolean;
|
|
2701
2923
|
sessionHistoryMaxEntries?: number;
|
|
2702
2924
|
defaultTransformers?: string[];
|
|
2703
2925
|
idleEventTimeoutMs?: number;
|
|
@@ -2714,6 +2936,9 @@ declare class SessionManager {
|
|
|
2714
2936
|
private histories;
|
|
2715
2937
|
private idleTimeoutMs;
|
|
2716
2938
|
private defaultModels;
|
|
2939
|
+
private synopsisAgent?;
|
|
2940
|
+
private synopsisModel?;
|
|
2941
|
+
private synopsisOnClose;
|
|
2717
2942
|
readonly defaultTransformers: string[];
|
|
2718
2943
|
private idleEventTimeoutMs;
|
|
2719
2944
|
private sessionHistoryMaxEntries;
|
|
@@ -2721,6 +2946,7 @@ declare class SessionManager {
|
|
|
2721
2946
|
private logger?;
|
|
2722
2947
|
private npmRegistry?;
|
|
2723
2948
|
private extensionCommands?;
|
|
2949
|
+
private synopsisCoordinator;
|
|
2724
2950
|
constructor(registry: Registry, spawner?: AgentSpawner, store?: SessionStore, options?: SessionManagerOptions);
|
|
2725
2951
|
create(params: CreateSessionParams): Promise<Session>;
|
|
2726
2952
|
resurrect(params: ResurrectParams): Promise<Session>;
|
|
@@ -2776,61 +3002,22 @@ declare class SessionManager {
|
|
|
2776
3002
|
hasRecord(sessionId: string): Promise<boolean>;
|
|
2777
3003
|
setTitle(sessionId: string, title: string): Promise<boolean>;
|
|
2778
3004
|
private persistTitle;
|
|
3005
|
+
private persistSynopsis;
|
|
2779
3006
|
private persistAgentChange;
|
|
2780
3007
|
private persistSnapshot;
|
|
2781
3008
|
private enqueueMetaWrite;
|
|
2782
3009
|
closeAll(): Promise<void>;
|
|
3010
|
+
flushSynopsis(timeoutMs: number): Promise<void>;
|
|
3011
|
+
shutdownSynopsis(): Promise<void>;
|
|
3012
|
+
scheduleSynopsis(sessionId: string): void;
|
|
2783
3013
|
flushMetaWrites(): Promise<void>;
|
|
2784
3014
|
flushHistoryWrites(): Promise<void>;
|
|
2785
3015
|
resurrectPendingQueues(): Promise<void>;
|
|
2786
3016
|
}
|
|
2787
3017
|
|
|
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;
|
|
3018
|
+
type ExtensionContext = BaseChildContext;
|
|
3019
|
+
declare class ExtensionManager extends ChildSupervisor<ExtensionConfig> {
|
|
3020
|
+
constructor(extensions: ExtensionConfig[], context?: ExtensionContext, options?: ChildSupervisorOptions);
|
|
2834
3021
|
}
|
|
2835
3022
|
|
|
2836
3023
|
interface TokenReservation {
|
|
@@ -2910,6 +3097,7 @@ declare const paths: {
|
|
|
2910
3097
|
currentLogFile: () => string;
|
|
2911
3098
|
registryCache: () => string;
|
|
2912
3099
|
agentsDir: () => string;
|
|
3100
|
+
agentLogFile: (id: string) => string;
|
|
2913
3101
|
agentInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2914
3102
|
agentNpmInstallDir: (id: string, platformKey: string, version: string) => string;
|
|
2915
3103
|
sessionsDir: () => string;
|