@hydra-acp/cli 0.1.44 → 0.1.46
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 +60 -6
- package/dist/cli.js +5726 -2916
- package/dist/index.d.ts +242 -7
- package/dist/index.js +2271 -182
- 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>;
|
|
@@ -107,6 +144,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
107
144
|
progressIndicator: z.ZodDefault<z.ZodBoolean>;
|
|
108
145
|
defaultEnterAction: z.ZodDefault<z.ZodEnum<["enqueue", "amend"]>>;
|
|
109
146
|
showThoughts: z.ZodDefault<z.ZodBoolean>;
|
|
147
|
+
promptHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
|
|
110
148
|
}, "strip", z.ZodTypeAny, {
|
|
111
149
|
repaintThrottleMs: number;
|
|
112
150
|
maxScrollbackLines: number;
|
|
@@ -116,6 +154,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
116
154
|
progressIndicator: boolean;
|
|
117
155
|
defaultEnterAction: "enqueue" | "amend";
|
|
118
156
|
showThoughts: boolean;
|
|
157
|
+
promptHistoryMaxEntries: number;
|
|
119
158
|
}, {
|
|
120
159
|
repaintThrottleMs?: number | undefined;
|
|
121
160
|
maxScrollbackLines?: number | undefined;
|
|
@@ -125,6 +164,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
125
164
|
progressIndicator?: boolean | undefined;
|
|
126
165
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
127
166
|
showThoughts?: boolean | undefined;
|
|
167
|
+
promptHistoryMaxEntries?: number | undefined;
|
|
128
168
|
}>>;
|
|
129
169
|
}, "strip", z.ZodTypeAny, {
|
|
130
170
|
tui: {
|
|
@@ -136,6 +176,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
136
176
|
progressIndicator: boolean;
|
|
137
177
|
defaultEnterAction: "enqueue" | "amend";
|
|
138
178
|
showThoughts: boolean;
|
|
179
|
+
promptHistoryMaxEntries: number;
|
|
139
180
|
};
|
|
140
181
|
daemon: {
|
|
141
182
|
host: string;
|
|
@@ -156,6 +197,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
156
197
|
env: Record<string, string>;
|
|
157
198
|
enabled: boolean;
|
|
158
199
|
}>;
|
|
200
|
+
transformers: Record<string, {
|
|
201
|
+
command: string[];
|
|
202
|
+
args: string[];
|
|
203
|
+
env: Record<string, string>;
|
|
204
|
+
enabled: boolean;
|
|
205
|
+
}>;
|
|
159
206
|
registry: {
|
|
160
207
|
url: string;
|
|
161
208
|
ttlHours: number;
|
|
@@ -164,6 +211,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
164
211
|
defaultModels: Record<string, string>;
|
|
165
212
|
defaultCwd: string;
|
|
166
213
|
sessionListColdLimit: number;
|
|
214
|
+
defaultTransformers: string[];
|
|
167
215
|
npmRegistry?: string | undefined;
|
|
168
216
|
}, {
|
|
169
217
|
tui?: {
|
|
@@ -175,6 +223,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
175
223
|
progressIndicator?: boolean | undefined;
|
|
176
224
|
defaultEnterAction?: "enqueue" | "amend" | undefined;
|
|
177
225
|
showThoughts?: boolean | undefined;
|
|
226
|
+
promptHistoryMaxEntries?: number | undefined;
|
|
178
227
|
} | undefined;
|
|
179
228
|
daemon?: {
|
|
180
229
|
host?: string | undefined;
|
|
@@ -195,6 +244,12 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
195
244
|
env?: Record<string, string> | undefined;
|
|
196
245
|
enabled?: boolean | undefined;
|
|
197
246
|
}> | undefined;
|
|
247
|
+
transformers?: Record<string, {
|
|
248
|
+
command?: string[] | undefined;
|
|
249
|
+
args?: string[] | undefined;
|
|
250
|
+
env?: Record<string, string> | undefined;
|
|
251
|
+
enabled?: boolean | undefined;
|
|
252
|
+
}> | undefined;
|
|
198
253
|
registry?: {
|
|
199
254
|
url?: string | undefined;
|
|
200
255
|
ttlHours?: number | undefined;
|
|
@@ -203,6 +258,7 @@ declare const HydraConfig: z.ZodObject<{
|
|
|
203
258
|
defaultModels?: Record<string, string> | undefined;
|
|
204
259
|
defaultCwd?: string | undefined;
|
|
205
260
|
sessionListColdLimit?: number | undefined;
|
|
261
|
+
defaultTransformers?: string[] | undefined;
|
|
206
262
|
npmRegistry?: string | undefined;
|
|
207
263
|
}>;
|
|
208
264
|
type HydraConfig = z.infer<typeof HydraConfig>;
|
|
@@ -1412,6 +1468,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1412
1468
|
}>>;
|
|
1413
1469
|
importedFromMachine: z.ZodOptional<z.ZodString>;
|
|
1414
1470
|
importedFromUpstreamSessionId: z.ZodOptional<z.ZodString>;
|
|
1471
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
1415
1472
|
updatedAt: z.ZodString;
|
|
1416
1473
|
attachedClients: z.ZodNumber;
|
|
1417
1474
|
status: z.ZodDefault<z.ZodEnum<["live", "cold"]>>;
|
|
@@ -1437,6 +1494,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1437
1494
|
} | undefined;
|
|
1438
1495
|
importedFromMachine?: string | undefined;
|
|
1439
1496
|
importedFromUpstreamSessionId?: string | undefined;
|
|
1497
|
+
parentSessionId?: string | undefined;
|
|
1440
1498
|
}, {
|
|
1441
1499
|
sessionId: string;
|
|
1442
1500
|
cwd: string;
|
|
@@ -1456,6 +1514,7 @@ declare const SessionListEntry: z.ZodObject<{
|
|
|
1456
1514
|
} | undefined;
|
|
1457
1515
|
importedFromMachine?: string | undefined;
|
|
1458
1516
|
importedFromUpstreamSessionId?: string | undefined;
|
|
1517
|
+
parentSessionId?: string | undefined;
|
|
1459
1518
|
busy?: boolean | undefined;
|
|
1460
1519
|
}>;
|
|
1461
1520
|
type SessionListEntry = z.infer<typeof SessionListEntry>;
|
|
@@ -1663,6 +1722,83 @@ declare class AgentInstance {
|
|
|
1663
1722
|
kill(signal?: NodeJS.Signals): Promise<void>;
|
|
1664
1723
|
}
|
|
1665
1724
|
|
|
1725
|
+
interface TokenValidator {
|
|
1726
|
+
validate(token: string): Promise<string | undefined>;
|
|
1727
|
+
}
|
|
1728
|
+
declare module "fastify" {
|
|
1729
|
+
interface FastifyRequest {
|
|
1730
|
+
authIdentity?: string;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
interface ProcessIdentity {
|
|
1734
|
+
name: string;
|
|
1735
|
+
kind: "extension" | "transformer";
|
|
1736
|
+
}
|
|
1737
|
+
declare class ProcessTokenRegistry implements TokenValidator {
|
|
1738
|
+
private tokens;
|
|
1739
|
+
mint(name: string, kind: "extension" | "transformer"): string;
|
|
1740
|
+
revoke(name: string): void;
|
|
1741
|
+
resolve(token: string): ProcessIdentity | undefined;
|
|
1742
|
+
validate(token: string): Promise<string | undefined>;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
interface TransformerRef {
|
|
1746
|
+
name: string;
|
|
1747
|
+
intercepts: Set<string>;
|
|
1748
|
+
connection: JsonRpcConnection;
|
|
1749
|
+
}
|
|
1750
|
+
interface TransformerContext {
|
|
1751
|
+
daemonUrl: string;
|
|
1752
|
+
daemonHost: string;
|
|
1753
|
+
daemonPort: number;
|
|
1754
|
+
serviceToken: string;
|
|
1755
|
+
daemonWsUrl: string;
|
|
1756
|
+
hydraHome: string;
|
|
1757
|
+
}
|
|
1758
|
+
type TransformerStatus = "running" | "stopped" | "restarting" | "disabled";
|
|
1759
|
+
interface TransformerInfo {
|
|
1760
|
+
name: string;
|
|
1761
|
+
status: TransformerStatus;
|
|
1762
|
+
pid: number | undefined;
|
|
1763
|
+
enabled: boolean;
|
|
1764
|
+
restartCount: number;
|
|
1765
|
+
startedAt: number | undefined;
|
|
1766
|
+
lastExitCode: number | undefined;
|
|
1767
|
+
logPath: string;
|
|
1768
|
+
version: string | undefined;
|
|
1769
|
+
}
|
|
1770
|
+
declare class TransformerManager {
|
|
1771
|
+
private entries;
|
|
1772
|
+
private connected;
|
|
1773
|
+
private stopping;
|
|
1774
|
+
private context;
|
|
1775
|
+
private tokenRegistry;
|
|
1776
|
+
constructor(transformers: TransformerConfig[], context?: TransformerContext, options?: {
|
|
1777
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
1778
|
+
});
|
|
1779
|
+
setContext(context: TransformerContext): void;
|
|
1780
|
+
reportVersion(name: string, version: string): void;
|
|
1781
|
+
registerConnection(name: string, connection: JsonRpcConnection, intercepts: string[]): void;
|
|
1782
|
+
deregisterConnection(name: string): void;
|
|
1783
|
+
resolveChain(names: string[]): TransformerRef[];
|
|
1784
|
+
start(): Promise<void>;
|
|
1785
|
+
stop(): Promise<void>;
|
|
1786
|
+
list(): TransformerInfo[];
|
|
1787
|
+
get(name: string): TransformerInfo | undefined;
|
|
1788
|
+
has(name: string): boolean;
|
|
1789
|
+
startByName(name: string): Promise<TransformerInfo>;
|
|
1790
|
+
stopByName(name: string): Promise<TransformerInfo>;
|
|
1791
|
+
restartByName(name: string): Promise<TransformerInfo>;
|
|
1792
|
+
register(config: TransformerConfig): TransformerInfo;
|
|
1793
|
+
unregister(name: string): Promise<void>;
|
|
1794
|
+
private terminate;
|
|
1795
|
+
private infoFor;
|
|
1796
|
+
private makeEntry;
|
|
1797
|
+
private reapOrphans;
|
|
1798
|
+
private spawn;
|
|
1799
|
+
private scheduleRestart;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1666
1802
|
interface AdvertisedCommand {
|
|
1667
1803
|
name: string;
|
|
1668
1804
|
description?: string;
|
|
@@ -1729,6 +1865,7 @@ interface SpawnReplacementAgentResult {
|
|
|
1729
1865
|
agent: AgentInstance;
|
|
1730
1866
|
upstreamSessionId: string;
|
|
1731
1867
|
agentMeta?: Record<string, unknown>;
|
|
1868
|
+
agentCapabilities?: AgentCapabilities;
|
|
1732
1869
|
}
|
|
1733
1870
|
type SpawnReplacementAgent = (params: SpawnReplacementAgentParams) => Promise<SpawnReplacementAgentResult>;
|
|
1734
1871
|
interface UsageSnapshot {
|
|
@@ -1736,6 +1873,7 @@ interface UsageSnapshot {
|
|
|
1736
1873
|
size?: number;
|
|
1737
1874
|
costAmount?: number;
|
|
1738
1875
|
costCurrency?: string;
|
|
1876
|
+
cumulativeCost?: number;
|
|
1739
1877
|
}
|
|
1740
1878
|
interface SessionInit {
|
|
1741
1879
|
cwd: string;
|
|
@@ -1745,6 +1883,7 @@ interface SessionInit {
|
|
|
1745
1883
|
title?: string;
|
|
1746
1884
|
sessionId?: string;
|
|
1747
1885
|
agentMeta?: Record<string, unknown>;
|
|
1886
|
+
agentCapabilities?: AgentCapabilities;
|
|
1748
1887
|
agentArgs?: string[];
|
|
1749
1888
|
idleTimeoutMs?: number;
|
|
1750
1889
|
logger?: {
|
|
@@ -1762,6 +1901,16 @@ interface SessionInit {
|
|
|
1762
1901
|
agentModels?: AdvertisedModel[];
|
|
1763
1902
|
firstPromptSeeded?: boolean;
|
|
1764
1903
|
createdAt?: number;
|
|
1904
|
+
transformChain?: TransformerRef[];
|
|
1905
|
+
idleEventTimeoutMs?: number;
|
|
1906
|
+
parentSessionId?: string;
|
|
1907
|
+
listSessions?: () => Promise<{
|
|
1908
|
+
sessionId: string;
|
|
1909
|
+
title?: string;
|
|
1910
|
+
cwd: string;
|
|
1911
|
+
agentId?: string;
|
|
1912
|
+
currentModel?: string;
|
|
1913
|
+
}[]>;
|
|
1765
1914
|
}
|
|
1766
1915
|
interface CloseOptions {
|
|
1767
1916
|
deleteRecord?: boolean;
|
|
@@ -1775,11 +1924,13 @@ declare class Session {
|
|
|
1775
1924
|
agent: AgentInstance;
|
|
1776
1925
|
upstreamSessionId: string;
|
|
1777
1926
|
agentMeta: Record<string, unknown> | undefined;
|
|
1927
|
+
agentCapabilities: AgentCapabilities | undefined;
|
|
1778
1928
|
readonly agentArgs: string[] | undefined;
|
|
1929
|
+
readonly parentSessionId: string | undefined;
|
|
1779
1930
|
title: string | undefined;
|
|
1780
1931
|
currentModel: string | undefined;
|
|
1781
1932
|
currentMode: string | undefined;
|
|
1782
|
-
|
|
1933
|
+
private _currentUsage;
|
|
1783
1934
|
updatedAt: number;
|
|
1784
1935
|
readonly createdAt: number;
|
|
1785
1936
|
private clients;
|
|
@@ -1801,9 +1952,14 @@ declare class Session {
|
|
|
1801
1952
|
private internalPromptCapture;
|
|
1802
1953
|
private idleTimeoutMs;
|
|
1803
1954
|
private idleTimer;
|
|
1955
|
+
private idleEventTimer;
|
|
1956
|
+
private idleEventTimeoutMs;
|
|
1804
1957
|
private lastRecordedAt;
|
|
1805
1958
|
private spawnReplacementAgent;
|
|
1959
|
+
private listSessions;
|
|
1806
1960
|
private logger;
|
|
1961
|
+
private transformChain;
|
|
1962
|
+
private pendingClaims;
|
|
1807
1963
|
private agentChangeHandlers;
|
|
1808
1964
|
private agentAdvertisedCommands;
|
|
1809
1965
|
private agentAdvertisedModes;
|
|
@@ -1814,13 +1970,18 @@ declare class Session {
|
|
|
1814
1970
|
private modelHandlers;
|
|
1815
1971
|
private modeHandlers;
|
|
1816
1972
|
private usageHandlers;
|
|
1973
|
+
private cumulativeCost;
|
|
1974
|
+
get currentUsage(): UsageSnapshot | undefined;
|
|
1817
1975
|
private amendInProgress;
|
|
1818
1976
|
private recentlyTerminal;
|
|
1977
|
+
private streamBuffer;
|
|
1978
|
+
private streamFilePath;
|
|
1819
1979
|
constructor(init: SessionInit);
|
|
1820
1980
|
private broadcastMergedCommands;
|
|
1821
1981
|
private broadcastAvailableModes;
|
|
1822
1982
|
private broadcastAvailableModels;
|
|
1823
1983
|
private wireAgent;
|
|
1984
|
+
private runResponseChain;
|
|
1824
1985
|
onAgentChange(handler: (info: {
|
|
1825
1986
|
agentId: string;
|
|
1826
1987
|
upstreamSessionId: string;
|
|
@@ -1865,7 +2026,11 @@ declare class Session {
|
|
|
1865
2026
|
private amendOnHead;
|
|
1866
2027
|
private enqueueAmendmentAsFollowUp;
|
|
1867
2028
|
cancel(clientId: string): Promise<void>;
|
|
1868
|
-
|
|
2029
|
+
addTransformer(ref: TransformerRef): void;
|
|
2030
|
+
forwardRequest(method: string, params: unknown, originatedBy?: Set<string>, startIdx?: number): Promise<unknown>;
|
|
2031
|
+
dischargeClaim(token: string, result: unknown): boolean;
|
|
2032
|
+
keepAliveClaim(token: string, estimatedRemainingMs?: number): boolean;
|
|
2033
|
+
emitToChain(emitterName: string, method: string, envelope: unknown): Promise<void>;
|
|
1869
2034
|
private rewriteForAgent;
|
|
1870
2035
|
close(opts?: CloseOptions): Promise<void>;
|
|
1871
2036
|
onClose(handler: (opts: {
|
|
@@ -1880,6 +2045,9 @@ declare class Session {
|
|
|
1880
2045
|
private maybeApplyAgentConfigOption;
|
|
1881
2046
|
private maybeApplyAgentMode;
|
|
1882
2047
|
private maybeApplyAgentUsage;
|
|
2048
|
+
private accumulateAndResetCost;
|
|
2049
|
+
private injectCumulativeCost;
|
|
2050
|
+
get totalUsage(): UsageSnapshot | undefined;
|
|
1883
2051
|
private setAgentAdvertisedCommands;
|
|
1884
2052
|
private setAgentAdvertisedModes;
|
|
1885
2053
|
private setAgentAdvertisedModels;
|
|
@@ -1888,6 +2056,7 @@ declare class Session {
|
|
|
1888
2056
|
onAgentModelsChange(handler: (models: AdvertisedModel[]) => void): void;
|
|
1889
2057
|
onModelChange(handler: (model: string) => void): void;
|
|
1890
2058
|
onModeChange(handler: (mode: string) => void): void;
|
|
2059
|
+
applyModeChange(modeId: string): void;
|
|
1891
2060
|
onUsageChange(handler: (usage: UsageSnapshot) => void): void;
|
|
1892
2061
|
mergedAvailableCommands(): AdvertisedCommand[];
|
|
1893
2062
|
agentOnlyAdvertisedCommands(): AdvertisedCommand[];
|
|
@@ -1895,20 +2064,49 @@ declare class Session {
|
|
|
1895
2064
|
availableModels(): AdvertisedModel[];
|
|
1896
2065
|
private maybeApplyAgentSessionInfo;
|
|
1897
2066
|
private handleSlashCommand;
|
|
2067
|
+
private handleSessionsCommand;
|
|
2068
|
+
private handleHelpCommand;
|
|
2069
|
+
private handleModelCommand;
|
|
1898
2070
|
private runTitleCommand;
|
|
1899
2071
|
private runTitleRegen;
|
|
1900
2072
|
private runInternalPrompt;
|
|
1901
2073
|
private runAgentCommand;
|
|
1902
2074
|
private runKillCommand;
|
|
2075
|
+
private runRestartCommand;
|
|
1903
2076
|
private buildSwitchTranscript;
|
|
1904
2077
|
seedFromImport(): Promise<void>;
|
|
1905
2078
|
private broadcastAgentSwitch;
|
|
2079
|
+
hasStreamBuffer(): boolean;
|
|
2080
|
+
get streamPath(): string | undefined;
|
|
2081
|
+
openStream(opts: {
|
|
2082
|
+
mode?: "memory" | "file";
|
|
2083
|
+
capacityBytes?: number;
|
|
2084
|
+
fileCapBytes?: number;
|
|
2085
|
+
filePathFor?: (sessionId: string) => string;
|
|
2086
|
+
}): {
|
|
2087
|
+
filePath?: string;
|
|
2088
|
+
capacityBytes: number;
|
|
2089
|
+
fileCapBytes?: number;
|
|
2090
|
+
};
|
|
2091
|
+
streamWrite(chunkB64: string, eof?: boolean): {
|
|
2092
|
+
writeCursor: number;
|
|
2093
|
+
};
|
|
2094
|
+
streamRead(cursor: number, maxBytes: number | undefined, waitMs: number | undefined): Promise<{
|
|
2095
|
+
bytes: string;
|
|
2096
|
+
nextCursor: number;
|
|
2097
|
+
gap?: number;
|
|
2098
|
+
eof?: boolean;
|
|
2099
|
+
}>;
|
|
2100
|
+
private requireStreamBuffer;
|
|
1906
2101
|
private markClosed;
|
|
1907
2102
|
private get lastActivityAt();
|
|
1908
2103
|
private scheduleIdleCheck;
|
|
1909
2104
|
private armIdleTimer;
|
|
1910
2105
|
private checkIdle;
|
|
1911
2106
|
private cancelIdleTimer;
|
|
2107
|
+
private scheduleIdleEvent;
|
|
2108
|
+
private cancelIdleEventTimer;
|
|
2109
|
+
private notifyChain;
|
|
1912
2110
|
private rewriteForClient;
|
|
1913
2111
|
private recordAndBroadcast;
|
|
1914
2112
|
private handlePermissionRequest;
|
|
@@ -1940,16 +2138,19 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1940
2138
|
size: z.ZodOptional<z.ZodNumber>;
|
|
1941
2139
|
costAmount: z.ZodOptional<z.ZodNumber>;
|
|
1942
2140
|
costCurrency: z.ZodOptional<z.ZodString>;
|
|
2141
|
+
cumulativeCost: z.ZodOptional<z.ZodNumber>;
|
|
1943
2142
|
}, "strip", z.ZodTypeAny, {
|
|
1944
2143
|
used?: number | undefined;
|
|
1945
2144
|
size?: number | undefined;
|
|
1946
2145
|
costAmount?: number | undefined;
|
|
1947
2146
|
costCurrency?: string | undefined;
|
|
2147
|
+
cumulativeCost?: number | undefined;
|
|
1948
2148
|
}, {
|
|
1949
2149
|
used?: number | undefined;
|
|
1950
2150
|
size?: number | undefined;
|
|
1951
2151
|
costAmount?: number | undefined;
|
|
1952
2152
|
costCurrency?: string | undefined;
|
|
2153
|
+
cumulativeCost?: number | undefined;
|
|
1953
2154
|
}>>;
|
|
1954
2155
|
agentCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1955
2156
|
name: z.ZodString;
|
|
@@ -1988,6 +2189,7 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
1988
2189
|
description?: string | undefined;
|
|
1989
2190
|
}>, "many">>;
|
|
1990
2191
|
pendingHistorySync: z.ZodOptional<z.ZodBoolean>;
|
|
2192
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
1991
2193
|
createdAt: z.ZodString;
|
|
1992
2194
|
updatedAt: z.ZodString;
|
|
1993
2195
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -2007,9 +2209,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2007
2209
|
size?: number | undefined;
|
|
2008
2210
|
costAmount?: number | undefined;
|
|
2009
2211
|
costCurrency?: string | undefined;
|
|
2212
|
+
cumulativeCost?: number | undefined;
|
|
2010
2213
|
} | undefined;
|
|
2011
2214
|
importedFromMachine?: string | undefined;
|
|
2012
2215
|
importedFromUpstreamSessionId?: string | undefined;
|
|
2216
|
+
parentSessionId?: string | undefined;
|
|
2013
2217
|
lineageId?: string | undefined;
|
|
2014
2218
|
importedFromSessionId?: string | undefined;
|
|
2015
2219
|
agentCommands?: {
|
|
@@ -2044,9 +2248,11 @@ declare const SessionRecord: z.ZodObject<{
|
|
|
2044
2248
|
size?: number | undefined;
|
|
2045
2249
|
costAmount?: number | undefined;
|
|
2046
2250
|
costCurrency?: string | undefined;
|
|
2251
|
+
cumulativeCost?: number | undefined;
|
|
2047
2252
|
} | undefined;
|
|
2048
2253
|
importedFromMachine?: string | undefined;
|
|
2049
2254
|
importedFromUpstreamSessionId?: string | undefined;
|
|
2255
|
+
parentSessionId?: string | undefined;
|
|
2050
2256
|
lineageId?: string | undefined;
|
|
2051
2257
|
importedFromSessionId?: string | undefined;
|
|
2052
2258
|
agentCommands?: {
|
|
@@ -2080,12 +2286,15 @@ declare const Bundle: z.ZodObject<{
|
|
|
2080
2286
|
exportedFrom: z.ZodObject<{
|
|
2081
2287
|
hydraVersion: z.ZodString;
|
|
2082
2288
|
machine: z.ZodString;
|
|
2289
|
+
hydraHost: z.ZodOptional<z.ZodString>;
|
|
2083
2290
|
}, "strip", z.ZodTypeAny, {
|
|
2084
2291
|
hydraVersion: string;
|
|
2085
2292
|
machine: string;
|
|
2293
|
+
hydraHost?: string | undefined;
|
|
2086
2294
|
}, {
|
|
2087
2295
|
hydraVersion: string;
|
|
2088
2296
|
machine: string;
|
|
2297
|
+
hydraHost?: string | undefined;
|
|
2089
2298
|
}>;
|
|
2090
2299
|
session: z.ZodObject<{
|
|
2091
2300
|
sessionId: z.ZodString;
|
|
@@ -2101,16 +2310,19 @@ declare const Bundle: z.ZodObject<{
|
|
|
2101
2310
|
size: z.ZodOptional<z.ZodNumber>;
|
|
2102
2311
|
costAmount: z.ZodOptional<z.ZodNumber>;
|
|
2103
2312
|
costCurrency: z.ZodOptional<z.ZodString>;
|
|
2313
|
+
cumulativeCost: z.ZodOptional<z.ZodNumber>;
|
|
2104
2314
|
}, "strip", z.ZodTypeAny, {
|
|
2105
2315
|
used?: number | undefined;
|
|
2106
2316
|
size?: number | undefined;
|
|
2107
2317
|
costAmount?: number | undefined;
|
|
2108
2318
|
costCurrency?: string | undefined;
|
|
2319
|
+
cumulativeCost?: number | undefined;
|
|
2109
2320
|
}, {
|
|
2110
2321
|
used?: number | undefined;
|
|
2111
2322
|
size?: number | undefined;
|
|
2112
2323
|
costAmount?: number | undefined;
|
|
2113
2324
|
costCurrency?: string | undefined;
|
|
2325
|
+
cumulativeCost?: number | undefined;
|
|
2114
2326
|
}>>;
|
|
2115
2327
|
agentCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2116
2328
|
name: z.ZodString;
|
|
@@ -2142,8 +2354,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2142
2354
|
cwd: string;
|
|
2143
2355
|
agentId: string;
|
|
2144
2356
|
updatedAt: string;
|
|
2145
|
-
lineageId: string;
|
|
2146
2357
|
createdAt: string;
|
|
2358
|
+
lineageId: string;
|
|
2147
2359
|
upstreamSessionId?: string | undefined;
|
|
2148
2360
|
title?: string | undefined;
|
|
2149
2361
|
currentModel?: string | undefined;
|
|
@@ -2153,6 +2365,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2153
2365
|
size?: number | undefined;
|
|
2154
2366
|
costAmount?: number | undefined;
|
|
2155
2367
|
costCurrency?: string | undefined;
|
|
2368
|
+
cumulativeCost?: number | undefined;
|
|
2156
2369
|
} | undefined;
|
|
2157
2370
|
agentCommands?: {
|
|
2158
2371
|
name: string;
|
|
@@ -2168,8 +2381,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2168
2381
|
cwd: string;
|
|
2169
2382
|
agentId: string;
|
|
2170
2383
|
updatedAt: string;
|
|
2171
|
-
lineageId: string;
|
|
2172
2384
|
createdAt: string;
|
|
2385
|
+
lineageId: string;
|
|
2173
2386
|
upstreamSessionId?: string | undefined;
|
|
2174
2387
|
title?: string | undefined;
|
|
2175
2388
|
currentModel?: string | undefined;
|
|
@@ -2179,6 +2392,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2179
2392
|
size?: number | undefined;
|
|
2180
2393
|
costAmount?: number | undefined;
|
|
2181
2394
|
costCurrency?: string | undefined;
|
|
2395
|
+
cumulativeCost?: number | undefined;
|
|
2182
2396
|
} | undefined;
|
|
2183
2397
|
agentCommands?: {
|
|
2184
2398
|
name: string;
|
|
@@ -2211,8 +2425,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2211
2425
|
cwd: string;
|
|
2212
2426
|
agentId: string;
|
|
2213
2427
|
updatedAt: string;
|
|
2214
|
-
lineageId: string;
|
|
2215
2428
|
createdAt: string;
|
|
2429
|
+
lineageId: string;
|
|
2216
2430
|
upstreamSessionId?: string | undefined;
|
|
2217
2431
|
title?: string | undefined;
|
|
2218
2432
|
currentModel?: string | undefined;
|
|
@@ -2222,6 +2436,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2222
2436
|
size?: number | undefined;
|
|
2223
2437
|
costAmount?: number | undefined;
|
|
2224
2438
|
costCurrency?: string | undefined;
|
|
2439
|
+
cumulativeCost?: number | undefined;
|
|
2225
2440
|
} | undefined;
|
|
2226
2441
|
agentCommands?: {
|
|
2227
2442
|
name: string;
|
|
@@ -2237,6 +2452,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2237
2452
|
exportedFrom: {
|
|
2238
2453
|
hydraVersion: string;
|
|
2239
2454
|
machine: string;
|
|
2455
|
+
hydraHost?: string | undefined;
|
|
2240
2456
|
};
|
|
2241
2457
|
history: {
|
|
2242
2458
|
method: string;
|
|
@@ -2251,8 +2467,8 @@ declare const Bundle: z.ZodObject<{
|
|
|
2251
2467
|
cwd: string;
|
|
2252
2468
|
agentId: string;
|
|
2253
2469
|
updatedAt: string;
|
|
2254
|
-
lineageId: string;
|
|
2255
2470
|
createdAt: string;
|
|
2471
|
+
lineageId: string;
|
|
2256
2472
|
upstreamSessionId?: string | undefined;
|
|
2257
2473
|
title?: string | undefined;
|
|
2258
2474
|
currentModel?: string | undefined;
|
|
@@ -2262,6 +2478,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2262
2478
|
size?: number | undefined;
|
|
2263
2479
|
costAmount?: number | undefined;
|
|
2264
2480
|
costCurrency?: string | undefined;
|
|
2481
|
+
cumulativeCost?: number | undefined;
|
|
2265
2482
|
} | undefined;
|
|
2266
2483
|
agentCommands?: {
|
|
2267
2484
|
name: string;
|
|
@@ -2277,6 +2494,7 @@ declare const Bundle: z.ZodObject<{
|
|
|
2277
2494
|
exportedFrom: {
|
|
2278
2495
|
hydraVersion: string;
|
|
2279
2496
|
machine: string;
|
|
2497
|
+
hydraHost?: string | undefined;
|
|
2280
2498
|
};
|
|
2281
2499
|
history: {
|
|
2282
2500
|
method: string;
|
|
@@ -2295,6 +2513,8 @@ interface CreateSessionParams {
|
|
|
2295
2513
|
agentArgs?: string[];
|
|
2296
2514
|
model?: string;
|
|
2297
2515
|
onInstallProgress?: AgentInstallProgressCallback;
|
|
2516
|
+
transformChain?: TransformerRef[];
|
|
2517
|
+
parentSessionId?: string;
|
|
2298
2518
|
}
|
|
2299
2519
|
interface ResurrectParams {
|
|
2300
2520
|
hydraSessionId: string;
|
|
@@ -2318,6 +2538,8 @@ interface SessionManagerOptions {
|
|
|
2318
2538
|
idleTimeoutMs?: number;
|
|
2319
2539
|
defaultModels?: Record<string, string>;
|
|
2320
2540
|
sessionHistoryMaxEntries?: number;
|
|
2541
|
+
defaultTransformers?: string[];
|
|
2542
|
+
idleEventTimeoutMs?: number;
|
|
2321
2543
|
logger?: AgentLogger;
|
|
2322
2544
|
npmRegistry?: string;
|
|
2323
2545
|
}
|
|
@@ -2330,6 +2552,8 @@ declare class SessionManager {
|
|
|
2330
2552
|
private histories;
|
|
2331
2553
|
private idleTimeoutMs;
|
|
2332
2554
|
private defaultModels;
|
|
2555
|
+
readonly defaultTransformers: string[];
|
|
2556
|
+
private idleEventTimeoutMs;
|
|
2333
2557
|
private sessionHistoryMaxEntries;
|
|
2334
2558
|
private metaWriteQueues;
|
|
2335
2559
|
private logger?;
|
|
@@ -2353,6 +2577,7 @@ declare class SessionManager {
|
|
|
2353
2577
|
private clearPendingHistorySync;
|
|
2354
2578
|
private deriveTitleFromHistory;
|
|
2355
2579
|
get(sessionId: string): Session | undefined;
|
|
2580
|
+
liveSessions(): IterableIterator<Session>;
|
|
2356
2581
|
activeAgentVersions(): Map<string, Set<string>>;
|
|
2357
2582
|
resolveCanonicalId(input: string): Promise<string | undefined>;
|
|
2358
2583
|
require(sessionId: string): Session;
|
|
@@ -2405,13 +2630,18 @@ interface ExtensionInfo {
|
|
|
2405
2630
|
startedAt: number | undefined;
|
|
2406
2631
|
lastExitCode: number | undefined;
|
|
2407
2632
|
logPath: string;
|
|
2633
|
+
version: string | undefined;
|
|
2408
2634
|
}
|
|
2409
2635
|
declare class ExtensionManager {
|
|
2410
2636
|
private entries;
|
|
2411
2637
|
private stopping;
|
|
2412
2638
|
private context;
|
|
2413
|
-
|
|
2639
|
+
private tokenRegistry;
|
|
2640
|
+
constructor(extensions: ExtensionConfig[], context?: ExtensionContext, options?: {
|
|
2641
|
+
tokenRegistry?: ProcessTokenRegistry;
|
|
2642
|
+
});
|
|
2414
2643
|
setContext(context: ExtensionContext): void;
|
|
2644
|
+
reportVersion(name: string, version: string): void;
|
|
2415
2645
|
start(): Promise<void>;
|
|
2416
2646
|
stop(): Promise<void>;
|
|
2417
2647
|
list(): ExtensionInfo[];
|
|
@@ -2440,6 +2670,7 @@ interface DaemonHandle {
|
|
|
2440
2670
|
manager: SessionManager;
|
|
2441
2671
|
registry: Registry;
|
|
2442
2672
|
extensions: ExtensionManager;
|
|
2673
|
+
transformers: TransformerManager;
|
|
2443
2674
|
shutdown: () => Promise<void>;
|
|
2444
2675
|
}
|
|
2445
2676
|
declare function startDaemon(config: HydraConfig, serviceToken: string): Promise<DaemonHandle>;
|
|
@@ -2471,6 +2702,10 @@ declare const paths: {
|
|
|
2471
2702
|
extensionsDir: () => string;
|
|
2472
2703
|
extensionLogFile: (name: string) => string;
|
|
2473
2704
|
extensionPidFile: (name: string) => string;
|
|
2705
|
+
transformersDir: () => string;
|
|
2706
|
+
transformerLogFile: (name: string) => string;
|
|
2707
|
+
transformerPidFile: (name: string) => string;
|
|
2708
|
+
transformerState: (sessionId: string, transformerName: string) => string;
|
|
2474
2709
|
tuiHistoryFile: (id: string) => string;
|
|
2475
2710
|
globalTuiHistoryFile: () => string;
|
|
2476
2711
|
tuiLogFile: () => string;
|