@hydra-acp/cli 0.1.43 → 0.1.45
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 +57 -3
- package/dist/cli.js +4475 -1827
- package/dist/index.d.ts +220 -6
- package/dist/index.js +1936 -163
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,26 @@ type ExtensionBody = z.infer<typeof ExtensionBody>;
|
|
|
23
23
|
type ExtensionConfig = ExtensionBody & {
|
|
24
24
|
name: string;
|
|
25
25
|
};
|
|
26
|
+
declare const TransformerBody: z.ZodObject<{
|
|
27
|
+
command: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
30
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
command: string[];
|
|
33
|
+
args: string[];
|
|
34
|
+
env: Record<string, string>;
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
}, {
|
|
37
|
+
command?: string[] | undefined;
|
|
38
|
+
args?: string[] | undefined;
|
|
39
|
+
env?: Record<string, string> | undefined;
|
|
40
|
+
enabled?: boolean | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
type TransformerBody = z.infer<typeof TransformerBody>;
|
|
43
|
+
type TransformerConfig = TransformerBody & {
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
26
46
|
declare const HydraConfig: z.ZodObject<{
|
|
27
47
|
daemon: z.ZodDefault<z.ZodObject<{
|
|
28
48
|
host: z.ZodDefault<z.ZodString>;
|
|
@@ -97,6 +117,23 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
97
117
|
env?: Record<string, string> | undefined;
|
|
98
118
|
enabled?: boolean | undefined;
|
|
99
119
|
}>>>;
|
|
120
|
+
transformers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
121
|
+
command: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
122
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
123
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
125
|
+
}, "strip", z.ZodTypeAny, {
|
|
126
|
+
command: string[];
|
|
127
|
+
args: string[];
|
|
128
|
+
env: Record<string, string>;
|
|
129
|
+
enabled: boolean;
|
|
130
|
+
}, {
|
|
131
|
+
command?: string[] | undefined;
|
|
132
|
+
args?: string[] | undefined;
|
|
133
|
+
env?: Record<string, string> | undefined;
|
|
134
|
+
enabled?: boolean | undefined;
|
|
135
|
+
}>>>;
|
|
136
|
+
defaultTransformers: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
100
137
|
npmRegistry: z.ZodOptional<z.ZodString>;
|
|
101
138
|
tui: z.ZodDefault<z.ZodObject<{
|
|
102
139
|
repaintThrottleMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -156,6 +193,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
156
193
|
env: Record<string, string>;
|
|
157
194
|
enabled: boolean;
|
|
158
195
|
}>;
|
|
196
|
+
transformers: Record<string, {
|
|
197
|
+
command: string[];
|
|
198
|
+
args: string[];
|
|
199
|
+
env: Record<string, string>;
|
|
200
|
+
enabled: boolean;
|
|
201
|
+
}>;
|
|
159
202
|
registry: {
|
|
160
203
|
url: string;
|
|
161
204
|
ttlHours: number;
|
|
@@ -164,6 +207,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
164
207
|
defaultModels: Record<string, string>;
|
|
165
208
|
defaultCwd: string;
|
|
166
209
|
sessionListColdLimit: number;
|
|
210
|
+
defaultTransformers: string[];
|
|
167
211
|
npmRegistry?: string | undefined;
|
|
168
212
|
}, {
|
|
169
213
|
tui?: {
|
|
@@ -195,6 +239,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
195
239
|
env?: Record<string, string> | undefined;
|
|
196
240
|
enabled?: boolean | undefined;
|
|
197
241
|
}> | undefined;
|
|
242
|
+
transformers?: Record<string, {
|
|
243
|
+
command?: string[] | undefined;
|
|
244
|
+
args?: string[] | undefined;
|
|
245
|
+
env?: Record<string, string> | undefined;
|
|
246
|
+
enabled?: boolean | undefined;
|
|
247
|
+
}> | undefined;
|
|
198
248
|
registry?: {
|
|
199
249
|
url?: string | undefined;
|
|
200
250
|
ttlHours?: number | undefined;
|
|
@@ -203,6 +253,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
203
253
|
defaultModels?: Record<string, string> | undefined;
|
|
204
254
|
defaultCwd?: string | undefined;
|
|
205
255
|
sessionListColdLimit?: number | undefined;
|
|
256
|
+
defaultTransformers?: string[] | undefined;
|
|
206
257
|
npmRegistry?: string | undefined;
|
|
207
258
|
}>;
|
|
208
259
|
type HydraConfig = z.infer<typeof HydraConfig>;
|
|
@@ -1412,6 +1463,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1412
1463
|
}>>;
|
|
1413
1464
|
importedFromMachine: z.ZodOptional<z.ZodString>;
|
|
1414
1465
|
importedFromUpstreamSessionId: z.ZodOptional<z.ZodString>;
|
|
1466
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
1415
1467
|
updatedAt: z.ZodString;
|
|
1416
1468
|
attachedClients: z.ZodNumber;
|
|
1417
1469
|
status: z.ZodDefault<z.ZodEnum<["live", "cold"]>>;
|
|
@@ -1437,6 +1489,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1437
1489
|
} | undefined;
|
|
1438
1490
|
importedFromMachine?: string | undefined;
|
|
1439
1491
|
importedFromUpstreamSessionId?: string | undefined;
|
|
1492
|
+
parentSessionId?: string | undefined;
|
|
1440
1493
|
}, {
|
|
1441
1494
|
sessionId: string;
|
|
1442
1495
|
cwd: string;
|
|
@@ -1456,6 +1509,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1456
1509
|
} | undefined;
|
|
1457
1510
|
importedFromMachine?: string | undefined;
|
|
1458
1511
|
importedFromUpstreamSessionId?: string | undefined;
|
|
1512
|
+
parentSessionId?: string | undefined;
|
|
1459
1513
|
busy?: boolean | undefined;
|
|
1460
1514
|
}>;
|
|
1461
1515
|
type SessionListEntry = z.infer<typeof SessionListEntry>;
|
|
@@ -1663,6 +1717,83 @@ declare class AgentInstance {
|
|
|
1663
1717
|
kill(signal?: NodeJS.Signals): Promise<void>;
|
|
1664
1718
|
}
|
|
1665
1719
|
|
|
1720
|
+
interface TokenValidator {
|
|
1721
|
+
validate(token: string): Promise<string | undefined>;
|
|
1722
|
+
}
|
|
1723
|
+
declare module "fastify" {
|
|
1724
|
+
interface FastifyRequest {
|
|
1725
|
+
authIdentity?: string;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
interface ProcessIdentity {
|
|
1729
|
+
name: string;
|
|
1730
|
+
kind: "extension" | "transformer";
|
|
1731
|
+
}
|
|
1732
|
+
declare class ProcessTokenRegistry implements TokenValidator {
|
|
1733
|
+
private tokens;
|
|
1734
|
+
mint(name: string, kind: "extension" | "transformer"): string;
|
|
1735
|
+
revoke(name: string): void;
|
|
1736
|
+
resolve(token: string): ProcessIdentity | undefined;
|
|
1737
|
+
validate(token: string): Promise<string | undefined>;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
interface TransformerRef {
|
|
1741
|
+
name: string;
|
|
1742
|
+
intercepts: Set<string>;
|
|
1743
|
+
connection: JsonRpcConnection;
|
|
1744
|
+
}
|
|
1745
|
+
interface TransformerContext {
|
|
1746
|
+
daemonUrl: string;
|
|
1747
|
+
daemonHost: string;
|
|
1748
|
+
daemonPort: number;
|
|
1749
|
+
serviceToken: string;
|
|
1750
|
+
daemonWsUrl: string;
|
|
1751
|
+
hydraHome: string;
|
|
1752
|
+
}
|
|
1753
|
+
type TransformerStatus = "running" | "stopped" | "restarting" | "disabled";
|
|
1754
|
+
interface TransformerInfo {
|
|
1755
|
+
name: string;
|
|
1756
|
+
status: TransformerStatus;
|
|
1757
|
+
pid: number | undefined;
|
|
1758
|
+
enabled: boolean;
|
|
1759
|
+
restartCount: number;
|
|
1760
|
+
startedAt: number | undefined;
|
|
1761
|
+
lastExitCode: number | undefined;
|
|
1762
|
+
logPath: string;
|
|
1763
|
+
version: string | undefined;
|
|
1764
|
+
}
|
|
1765
|
+
declare class TransformerManager {
|
|
1766
|
+
private entries;
|
|
1767
|
+
private connected;
|
|
1768
|
+
private stopping;
|
|
1769
|
+
private context;
|
|
1770
|
+
private tokenRegistry;
|
|
1771
|
+
constructor(transformers: TransformerConfig[], context?: TransformerContext, options?: {
|
|
1772
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
1773
|
+
});
|
|
1774
|
+
setContext(context: TransformerContext): void;
|
|
1775
|
+
reportVersion(name: string, version: string): void;
|
|
1776
|
+
registerConnection(name: string, connection: JsonRpcConnection, intercepts: string[]): void;
|
|
1777
|
+
deregisterConnection(name: string): void;
|
|
1778
|
+
resolveChain(names: string[]): TransformerRef[];
|
|
1779
|
+
start(): Promise<void>;
|
|
1780
|
+
stop(): Promise<void>;
|
|
1781
|
+
list(): TransformerInfo[];
|
|
1782
|
+
get(name: string): TransformerInfo | undefined;
|
|
1783
|
+
has(name: string): boolean;
|
|
1784
|
+
startByName(name: string): Promise<TransformerInfo>;
|
|
1785
|
+
stopByName(name: string): Promise<TransformerInfo>;
|
|
1786
|
+
restartByName(name: string): Promise<TransformerInfo>;
|
|
1787
|
+
register(config: TransformerConfig): TransformerInfo;
|
|
1788
|
+
unregister(name: string): Promise<void>;
|
|
1789
|
+
private terminate;
|
|
1790
|
+
private infoFor;
|
|
1791
|
+
private makeEntry;
|
|
1792
|
+
private reapOrphans;
|
|
1793
|
+
private spawn;
|
|
1794
|
+
private scheduleRestart;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1666
1797
|
interface AdvertisedCommand {
|
|
1667
1798
|
name: string;
|
|
1668
1799
|
description?: string;
|
|
@@ -1729,6 +1860,7 @@ interface SpawnReplacementAgentResult {
|
|
|
1729
1860
|
agent: AgentInstance;
|
|
1730
1861
|
upstreamSessionId: string;
|
|
1731
1862
|
agentMeta?: Record<string, unknown>;
|
|
1863
|
+
agentCapabilities?: AgentCapabilities;
|
|
1732
1864
|
}
|
|
1733
1865
|
type SpawnReplacementAgent = (params: SpawnReplacementAgentParams) => Promise<SpawnReplacementAgentResult>;
|
|
1734
1866
|
interface UsageSnapshot {
|
|
@@ -1736,6 +1868,7 @@ interface UsageSnapshot {
|
|
|
1736
1868
|
size?: number;
|
|
1737
1869
|
costAmount?: number;
|
|
1738
1870
|
costCurrency?: string;
|
|
1871
|
+
cumulativeCost?: number;
|
|
1739
1872
|
}
|
|
1740
1873
|
interface SessionInit {
|
|
1741
1874
|
cwd: string;
|
|
@@ -1745,6 +1878,7 @@ interface SessionInit {
|
|
|
1745
1878
|
title?: string;
|
|
1746
1879
|
sessionId?: string;
|
|
1747
1880
|
agentMeta?: Record<string, unknown>;
|
|
1881
|
+
agentCapabilities?: AgentCapabilities;
|
|
1748
1882
|
agentArgs?: string[];
|
|
1749
1883
|
idleTimeoutMs?: number;
|
|
1750
1884
|
logger?: {
|
|
@@ -1762,6 +1896,9 @@ interface SessionInit {
|
|
|
1762
1896
|
agentModels?: AdvertisedModel[];
|
|
1763
1897
|
firstPromptSeeded?: boolean;
|
|
1764
1898
|
createdAt?: number;
|
|
1899
|
+
transformChain?: TransformerRef[];
|
|
1900
|
+
idleEventTimeoutMs?: number;
|
|
1901
|
+
parentSessionId?: string;
|
|
1765
1902
|
}
|
|
1766
1903
|
interface CloseOptions {
|
|
1767
1904
|
deleteRecord?: boolean;
|
|
@@ -1775,7 +1912,9 @@ declare class Session {
|
|
|
1775
1912
|
agent: AgentInstance;
|
|
1776
1913
|
upstreamSessionId: string;
|
|
1777
1914
|
agentMeta: Record<string, unknown> | undefined;
|
|
1915
|
+
agentCapabilities: AgentCapabilities | undefined;
|
|
1778
1916
|
readonly agentArgs: string[] | undefined;
|
|
1917
|
+
readonly parentSessionId: string | undefined;
|
|
1779
1918
|
title: string | undefined;
|
|
1780
1919
|
currentModel: string | undefined;
|
|
1781
1920
|
currentMode: string | undefined;
|
|
@@ -1801,9 +1940,13 @@ declare class Session {
|
|
|
1801
1940
|
private internalPromptCapture;
|
|
1802
1941
|
private idleTimeoutMs;
|
|
1803
1942
|
private idleTimer;
|
|
1943
|
+
private idleEventTimer;
|
|
1944
|
+
private idleEventTimeoutMs;
|
|
1804
1945
|
private lastRecordedAt;
|
|
1805
1946
|
private spawnReplacementAgent;
|
|
1806
1947
|
private logger;
|
|
1948
|
+
private transformChain;
|
|
1949
|
+
private pendingClaims;
|
|
1807
1950
|
private agentChangeHandlers;
|
|
1808
1951
|
private agentAdvertisedCommands;
|
|
1809
1952
|
private agentAdvertisedModes;
|
|
@@ -1814,13 +1957,17 @@ declare class Session {
|
|
|
1814
1957
|
private modelHandlers;
|
|
1815
1958
|
private modeHandlers;
|
|
1816
1959
|
private usageHandlers;
|
|
1960
|
+
private cumulativeCost;
|
|
1817
1961
|
private amendInProgress;
|
|
1818
1962
|
private recentlyTerminal;
|
|
1963
|
+
private streamBuffer;
|
|
1964
|
+
private streamFilePath;
|
|
1819
1965
|
constructor(init: SessionInit);
|
|
1820
1966
|
private broadcastMergedCommands;
|
|
1821
1967
|
private broadcastAvailableModes;
|
|
1822
1968
|
private broadcastAvailableModels;
|
|
1823
1969
|
private wireAgent;
|
|
1970
|
+
private runResponseChain;
|
|
1824
1971
|
onAgentChange(handler: (info: {
|
|
1825
1972
|
agentId: string;
|
|
1826
1973
|
upstreamSessionId: string;
|
|
@@ -1865,7 +2012,10 @@ declare class Session {
|
|
|
1865
2012
|
private amendOnHead;
|
|
1866
2013
|
private enqueueAmendmentAsFollowUp;
|
|
1867
2014
|
cancel(clientId: string): Promise<void>;
|
|
1868
|
-
forwardRequest(method: string, params: unknown): Promise<unknown>;
|
|
2015
|
+
forwardRequest(method: string, params: unknown, originatedBy?: Set<string>, startIdx?: number): Promise<unknown>;
|
|
2016
|
+
dischargeClaim(token: string, result: unknown): boolean;
|
|
2017
|
+
keepAliveClaim(token: string, estimatedRemainingMs?: number): boolean;
|
|
2018
|
+
emitToChain(emitterName: string, method: string, envelope: unknown): Promise<void>;
|
|
1869
2019
|
private rewriteForAgent;
|
|
1870
2020
|
close(opts?: CloseOptions): Promise<void>;
|
|
1871
2021
|
onClose(handler: (opts: {
|
|
@@ -1880,6 +2030,9 @@ declare class Session {
|
|
|
1880
2030
|
private maybeApplyAgentConfigOption;
|
|
1881
2031
|
private maybeApplyAgentMode;
|
|
1882
2032
|
private maybeApplyAgentUsage;
|
|
2033
|
+
private accumulateAndResetCost;
|
|
2034
|
+
private injectCumulativeCost;
|
|
2035
|
+
get totalUsage(): UsageSnapshot | undefined;
|
|
1883
2036
|
private setAgentAdvertisedCommands;
|
|
1884
2037
|
private setAgentAdvertisedModes;
|
|
1885
2038
|
private setAgentAdvertisedModels;
|
|
@@ -1903,12 +2056,37 @@ declare class Session {
|
|
|
1903
2056
|
private buildSwitchTranscript;
|
|
1904
2057
|
seedFromImport(): Promise<void>;
|
|
1905
2058
|
private broadcastAgentSwitch;
|
|
2059
|
+
hasStreamBuffer(): boolean;
|
|
2060
|
+
get streamPath(): string | undefined;
|
|
2061
|
+
openStream(opts: {
|
|
2062
|
+
mode?: "memory" | "file";
|
|
2063
|
+
capacityBytes?: number;
|
|
2064
|
+
fileCapBytes?: number;
|
|
2065
|
+
filePathFor?: (sessionId: string) => string;
|
|
2066
|
+
}): {
|
|
2067
|
+
filePath?: string;
|
|
2068
|
+
capacityBytes: number;
|
|
2069
|
+
fileCapBytes?: number;
|
|
2070
|
+
};
|
|
2071
|
+
streamWrite(chunkB64: string, eof?: boolean): {
|
|
2072
|
+
writeCursor: number;
|
|
2073
|
+
};
|
|
2074
|
+
streamRead(cursor: number, maxBytes: number | undefined, waitMs: number | undefined): Promise<{
|
|
2075
|
+
bytes: string;
|
|
2076
|
+
nextCursor: number;
|
|
2077
|
+
gap?: number;
|
|
2078
|
+
eof?: boolean;
|
|
2079
|
+
}>;
|
|
2080
|
+
private requireStreamBuffer;
|
|
1906
2081
|
private markClosed;
|
|
1907
2082
|
private get lastActivityAt();
|
|
1908
2083
|
private scheduleIdleCheck;
|
|
1909
2084
|
private armIdleTimer;
|
|
1910
2085
|
private checkIdle;
|
|
1911
2086
|
private cancelIdleTimer;
|
|
2087
|
+
private scheduleIdleEvent;
|
|
2088
|
+
private cancelIdleEventTimer;
|
|
2089
|
+
private notifyChain;
|
|
1912
2090
|
private rewriteForClient;
|
|
1913
2091
|
private recordAndBroadcast;
|
|
1914
2092
|
private handlePermissionRequest;
|
|
@@ -1940,16 +2118,19 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1940
2118
|
size: z.ZodOptional<z.ZodNumber>;
|
|
1941
2119
|
costAmount: z.ZodOptional<z.ZodNumber>;
|
|
1942
2120
|
costCurrency: z.ZodOptional<z.ZodString>;
|
|
2121
|
+
cumulativeCost: z.ZodOptional<z.ZodNumber>;
|
|
1943
2122
|
}, "strip", z.ZodTypeAny, {
|
|
1944
2123
|
used?: number | undefined;
|
|
1945
2124
|
size?: number | undefined;
|
|
1946
2125
|
costAmount?: number | undefined;
|
|
1947
2126
|
costCurrency?: string | undefined;
|
|
2127
|
+
cumulativeCost?: number | undefined;
|
|
1948
2128
|
}, {
|
|
1949
2129
|
used?: number | undefined;
|
|
1950
2130
|
size?: number | undefined;
|
|
1951
2131
|
costAmount?: number | undefined;
|
|
1952
2132
|
costCurrency?: string | undefined;
|
|
2133
|
+
cumulativeCost?: number | undefined;
|
|
1953
2134
|
}>>;
|
|
1954
2135
|
agentCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1955
2136
|
name: z.ZodString;
|
|
@@ -1988,6 +2169,7 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1988
2169
|
description?: string | undefined;
|
|
1989
2170
|
}>, "many">>;
|
|
1990
2171
|
pendingHistorySync: z.ZodOptional<z.ZodBoolean>;
|
|
2172
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
1991
2173
|
createdAt: z.ZodString;
|
|
1992
2174
|
updatedAt: z.ZodString;
|
|
1993
2175
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2007,9 +2189,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2007
2189
|
size?: number | undefined;
|
|
2008
2190
|
costAmount?: number | undefined;
|
|
2009
2191
|
costCurrency?: string | undefined;
|
|
2192
|
+
cumulativeCost?: number | undefined;
|
|
2010
2193
|
} | undefined;
|
|
2011
2194
|
importedFromMachine?: string | undefined;
|
|
2012
2195
|
importedFromUpstreamSessionId?: string | undefined;
|
|
2196
|
+
parentSessionId?: string | undefined;
|
|
2013
2197
|
lineageId?: string | undefined;
|
|
2014
2198
|
importedFromSessionId?: string | undefined;
|
|
2015
2199
|
agentCommands?: {
|
|
@@ -2044,9 +2228,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2044
2228
|
size?: number | undefined;
|
|
2045
2229
|
costAmount?: number | undefined;
|
|
2046
2230
|
costCurrency?: string | undefined;
|
|
2231
|
+
cumulativeCost?: number | undefined;
|
|
2047
2232
|
} | undefined;
|
|
2048
2233
|
importedFromMachine?: string | undefined;
|
|
2049
2234
|
importedFromUpstreamSessionId?: string | undefined;
|
|
2235
|
+
parentSessionId?: string | undefined;
|
|
2050
2236
|
lineageId?: string | undefined;
|
|
2051
2237
|
importedFromSessionId?: string | undefined;
|
|
2052
2238
|
agentCommands?: {
|
|
@@ -2080,12 +2266,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2080
2266
|
exportedFrom: z.ZodObject<{
|
|
2081
2267
|
hydraVersion: z.ZodString;
|
|
2082
2268
|
machine: z.ZodString;
|
|
2269
|
+
hydraHost: z.ZodOptional<z.ZodString>;
|
|
2083
2270
|
}, "strip", z.ZodTypeAny, {
|
|
2084
2271
|
hydraVersion: string;
|
|
2085
2272
|
machine: string;
|
|
2273
|
+
hydraHost?: string | undefined;
|
|
2086
2274
|
}, {
|
|
2087
2275
|
hydraVersion: string;
|
|
2088
2276
|
machine: string;
|
|
2277
|
+
hydraHost?: string | undefined;
|
|
2089
2278
|
}>;
|
|
2090
2279
|
session: z.ZodObject<{
|
|
2091
2280
|
sessionId: z.ZodString;
|
|
@@ -2101,16 +2290,19 @@ declare const Bundle: z.ZodObject<{
|
|
|
2101
2290
|
size: z.ZodOptional<z.ZodNumber>;
|
|
2102
2291
|
costAmount: z.ZodOptional<z.ZodNumber>;
|
|
2103
2292
|
costCurrency: z.ZodOptional<z.ZodString>;
|
|
2293
|
+
cumulativeCost: z.ZodOptional<z.ZodNumber>;
|
|
2104
2294
|
}, "strip", z.ZodTypeAny, {
|
|
2105
2295
|
used?: number | undefined;
|
|
2106
2296
|
size?: number | undefined;
|
|
2107
2297
|
costAmount?: number | undefined;
|
|
2108
2298
|
costCurrency?: string | undefined;
|
|
2299
|
+
cumulativeCost?: number | undefined;
|
|
2109
2300
|
}, {
|
|
2110
2301
|
used?: number | undefined;
|
|
2111
2302
|
size?: number | undefined;
|
|
2112
2303
|
costAmount?: number | undefined;
|
|
2113
2304
|
costCurrency?: string | undefined;
|
|
2305
|
+
cumulativeCost?: number | undefined;
|
|
2114
2306
|
}>>;
|
|
2115
2307
|
agentCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2116
2308
|
name: z.ZodString;
|
|
@@ -2142,8 +2334,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2142
2334
|
cwd: string;
|
|
2143
2335
|
agentId: string;
|
|
2144
2336
|
updatedAt: string;
|
|
2145
|
-
lineageId: string;
|
|
2146
2337
|
createdAt: string;
|
|
2338
|
+
lineageId: string;
|
|
2147
2339
|
upstreamSessionId?: string | undefined;
|
|
2148
2340
|
title?: string | undefined;
|
|
2149
2341
|
currentModel?: string | undefined;
|
|
@@ -2153,6 +2345,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2153
2345
|
size?: number | undefined;
|
|
2154
2346
|
costAmount?: number | undefined;
|
|
2155
2347
|
costCurrency?: string | undefined;
|
|
2348
|
+
cumulativeCost?: number | undefined;
|
|
2156
2349
|
} | undefined;
|
|
2157
2350
|
agentCommands?: {
|
|
2158
2351
|
name: string;
|
|
@@ -2168,8 +2361,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2168
2361
|
cwd: string;
|
|
2169
2362
|
agentId: string;
|
|
2170
2363
|
updatedAt: string;
|
|
2171
|
-
lineageId: string;
|
|
2172
2364
|
createdAt: string;
|
|
2365
|
+
lineageId: string;
|
|
2173
2366
|
upstreamSessionId?: string | undefined;
|
|
2174
2367
|
title?: string | undefined;
|
|
2175
2368
|
currentModel?: string | undefined;
|
|
@@ -2179,6 +2372,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2179
2372
|
size?: number | undefined;
|
|
2180
2373
|
costAmount?: number | undefined;
|
|
2181
2374
|
costCurrency?: string | undefined;
|
|
2375
|
+
cumulativeCost?: number | undefined;
|
|
2182
2376
|
} | undefined;
|
|
2183
2377
|
agentCommands?: {
|
|
2184
2378
|
name: string;
|
|
@@ -2211,8 +2405,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2211
2405
|
cwd: string;
|
|
2212
2406
|
agentId: string;
|
|
2213
2407
|
updatedAt: string;
|
|
2214
|
-
lineageId: string;
|
|
2215
2408
|
createdAt: string;
|
|
2409
|
+
lineageId: string;
|
|
2216
2410
|
upstreamSessionId?: string | undefined;
|
|
2217
2411
|
title?: string | undefined;
|
|
2218
2412
|
currentModel?: string | undefined;
|
|
@@ -2222,6 +2416,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2222
2416
|
size?: number | undefined;
|
|
2223
2417
|
costAmount?: number | undefined;
|
|
2224
2418
|
costCurrency?: string | undefined;
|
|
2419
|
+
cumulativeCost?: number | undefined;
|
|
2225
2420
|
} | undefined;
|
|
2226
2421
|
agentCommands?: {
|
|
2227
2422
|
name: string;
|
|
@@ -2237,6 +2432,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2237
2432
|
exportedFrom: {
|
|
2238
2433
|
hydraVersion: string;
|
|
2239
2434
|
machine: string;
|
|
2435
|
+
hydraHost?: string | undefined;
|
|
2240
2436
|
};
|
|
2241
2437
|
history: {
|
|
2242
2438
|
method: string;
|
|
@@ -2251,8 +2447,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2251
2447
|
cwd: string;
|
|
2252
2448
|
agentId: string;
|
|
2253
2449
|
updatedAt: string;
|
|
2254
|
-
lineageId: string;
|
|
2255
2450
|
createdAt: string;
|
|
2451
|
+
lineageId: string;
|
|
2256
2452
|
upstreamSessionId?: string | undefined;
|
|
2257
2453
|
title?: string | undefined;
|
|
2258
2454
|
currentModel?: string | undefined;
|
|
@@ -2262,6 +2458,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2262
2458
|
size?: number | undefined;
|
|
2263
2459
|
costAmount?: number | undefined;
|
|
2264
2460
|
costCurrency?: string | undefined;
|
|
2461
|
+
cumulativeCost?: number | undefined;
|
|
2265
2462
|
} | undefined;
|
|
2266
2463
|
agentCommands?: {
|
|
2267
2464
|
name: string;
|
|
@@ -2277,6 +2474,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2277
2474
|
exportedFrom: {
|
|
2278
2475
|
hydraVersion: string;
|
|
2279
2476
|
machine: string;
|
|
2477
|
+
hydraHost?: string | undefined;
|
|
2280
2478
|
};
|
|
2281
2479
|
history: {
|
|
2282
2480
|
method: string;
|
|
@@ -2295,6 +2493,8 @@ interface CreateSessionParams {
|
|
|
2295
2493
|
agentArgs?: string[];
|
|
2296
2494
|
model?: string;
|
|
2297
2495
|
onInstallProgress?: AgentInstallProgressCallback;
|
|
2496
|
+
transformChain?: TransformerRef[];
|
|
2497
|
+
parentSessionId?: string;
|
|
2298
2498
|
}
|
|
2299
2499
|
interface ResurrectParams {
|
|
2300
2500
|
hydraSessionId: string;
|
|
@@ -2318,6 +2518,8 @@ interface SessionManagerOptions {
|
|
|
2318
2518
|
idleTimeoutMs?: number;
|
|
2319
2519
|
defaultModels?: Record<string, string>;
|
|
2320
2520
|
sessionHistoryMaxEntries?: number;
|
|
2521
|
+
defaultTransformers?: string[];
|
|
2522
|
+
idleEventTimeoutMs?: number;
|
|
2321
2523
|
logger?: AgentLogger;
|
|
2322
2524
|
npmRegistry?: string;
|
|
2323
2525
|
}
|
|
@@ -2330,6 +2532,8 @@ declare class SessionManager {
|
|
|
2330
2532
|
private histories;
|
|
2331
2533
|
private idleTimeoutMs;
|
|
2332
2534
|
private defaultModels;
|
|
2535
|
+
readonly defaultTransformers: string[];
|
|
2536
|
+
private idleEventTimeoutMs;
|
|
2333
2537
|
private sessionHistoryMaxEntries;
|
|
2334
2538
|
private metaWriteQueues;
|
|
2335
2539
|
private logger?;
|
|
@@ -2405,13 +2609,18 @@ interface ExtensionInfo {
|
|
|
2405
2609
|
startedAt: number | undefined;
|
|
2406
2610
|
lastExitCode: number | undefined;
|
|
2407
2611
|
logPath: string;
|
|
2612
|
+
version: string | undefined;
|
|
2408
2613
|
}
|
|
2409
2614
|
declare class ExtensionManager {
|
|
2410
2615
|
private entries;
|
|
2411
2616
|
private stopping;
|
|
2412
2617
|
private context;
|
|
2413
|
-
|
|
2618
|
+
private tokenRegistry;
|
|
2619
|
+
constructor(extensions: ExtensionConfig[], context?: ExtensionContext, options?: {
|
|
2620
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
2621
|
+
});
|
|
2414
2622
|
setContext(context: ExtensionContext): void;
|
|
2623
|
+
reportVersion(name: string, version: string): void;
|
|
2415
2624
|
start(): Promise<void>;
|
|
2416
2625
|
stop(): Promise<void>;
|
|
2417
2626
|
list(): ExtensionInfo[];
|
|
@@ -2440,6 +2649,7 @@ interface DaemonHandle {
|
|
|
2440
2649
|
manager: SessionManager;
|
|
2441
2650
|
registry: Registry;
|
|
2442
2651
|
extensions: ExtensionManager;
|
|
2652
|
+
transformers: TransformerManager;
|
|
2443
2653
|
shutdown: () => Promise<void>;
|
|
2444
2654
|
}
|
|
2445
2655
|
declare function startDaemon(config: HydraConfig, serviceToken: string): Promise<DaemonHandle>;
|
|
@@ -2471,6 +2681,10 @@ declare const paths: {
|
|
|
2471
2681
|
extensionsDir: () => string;
|
|
2472
2682
|
extensionLogFile: (name: string) => string;
|
|
2473
2683
|
extensionPidFile: (name: string) => string;
|
|
2684
|
+
transformersDir: () => string;
|
|
2685
|
+
transformerLogFile: (name: string) => string;
|
|
2686
|
+
transformerPidFile: (name: string) => string;
|
|
2687
|
+
transformerState: (sessionId: string, transformerName: string) => string;
|
|
2474
2688
|
tuiHistoryFile: (id: string) => string;
|
|
2475
2689
|
globalTuiHistoryFile: () => string;
|
|
2476
2690
|
tuiLogFile: () => string;
|