@hydra-acp/cli 0.1.51 → 0.1.53

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/dist/index.d.ts CHANGED
@@ -62,6 +62,7 @@ declare const HydraConfig: z.ZodObject<{
62
62
  sessionHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
63
63
  agentStderrTailBytes: z.ZodDefault<z.ZodNumber>;
64
64
  publicHost: z.ZodOptional<z.ZodString>;
65
+ agentSyncIntervalMinutes: z.ZodDefault<z.ZodNumber>;
65
66
  }, "strip", z.ZodTypeAny, {
66
67
  host: string;
67
68
  port: number;
@@ -69,6 +70,7 @@ declare const HydraConfig: z.ZodObject<{
69
70
  sessionIdleTimeoutSeconds: number;
70
71
  sessionHistoryMaxEntries: number;
71
72
  agentStderrTailBytes: number;
73
+ agentSyncIntervalMinutes: number;
72
74
  tls?: {
73
75
  cert: string;
74
76
  key: string;
@@ -86,6 +88,7 @@ declare const HydraConfig: z.ZodObject<{
86
88
  sessionHistoryMaxEntries?: number | undefined;
87
89
  agentStderrTailBytes?: number | undefined;
88
90
  publicHost?: string | undefined;
91
+ agentSyncIntervalMinutes?: number | undefined;
89
92
  }>>;
90
93
  registry: z.ZodDefault<z.ZodObject<{
91
94
  url: z.ZodDefault<z.ZodString>;
@@ -145,6 +148,7 @@ declare const HydraConfig: z.ZodObject<{
145
148
  defaultEnterAction: z.ZodDefault<z.ZodEnum<["enqueue", "amend"]>>;
146
149
  showThoughts: z.ZodDefault<z.ZodBoolean>;
147
150
  promptHistoryMaxEntries: z.ZodDefault<z.ZodNumber>;
151
+ showFileUpdates: z.ZodDefault<z.ZodEnum<["none", "edit", "diff"]>>;
148
152
  }, "strip", z.ZodTypeAny, {
149
153
  repaintThrottleMs: number;
150
154
  maxScrollbackLines: number;
@@ -155,6 +159,7 @@ declare const HydraConfig: z.ZodObject<{
155
159
  defaultEnterAction: "enqueue" | "amend";
156
160
  showThoughts: boolean;
157
161
  promptHistoryMaxEntries: number;
162
+ showFileUpdates: "none" | "edit" | "diff";
158
163
  }, {
159
164
  repaintThrottleMs?: number | undefined;
160
165
  maxScrollbackLines?: number | undefined;
@@ -165,6 +170,7 @@ declare const HydraConfig: z.ZodObject<{
165
170
  defaultEnterAction?: "enqueue" | "amend" | undefined;
166
171
  showThoughts?: boolean | undefined;
167
172
  promptHistoryMaxEntries?: number | undefined;
173
+ showFileUpdates?: "none" | "edit" | "diff" | undefined;
168
174
  }>>;
169
175
  }, "strip", z.ZodTypeAny, {
170
176
  tui: {
@@ -177,6 +183,7 @@ declare const HydraConfig: z.ZodObject<{
177
183
  defaultEnterAction: "enqueue" | "amend";
178
184
  showThoughts: boolean;
179
185
  promptHistoryMaxEntries: number;
186
+ showFileUpdates: "none" | "edit" | "diff";
180
187
  };
181
188
  daemon: {
182
189
  host: string;
@@ -185,6 +192,7 @@ declare const HydraConfig: z.ZodObject<{
185
192
  sessionIdleTimeoutSeconds: number;
186
193
  sessionHistoryMaxEntries: number;
187
194
  agentStderrTailBytes: number;
195
+ agentSyncIntervalMinutes: number;
188
196
  tls?: {
189
197
  cert: string;
190
198
  key: string;
@@ -224,6 +232,7 @@ declare const HydraConfig: z.ZodObject<{
224
232
  defaultEnterAction?: "enqueue" | "amend" | undefined;
225
233
  showThoughts?: boolean | undefined;
226
234
  promptHistoryMaxEntries?: number | undefined;
235
+ showFileUpdates?: "none" | "edit" | "diff" | undefined;
227
236
  } | undefined;
228
237
  daemon?: {
229
238
  host?: string | undefined;
@@ -237,6 +246,7 @@ declare const HydraConfig: z.ZodObject<{
237
246
  sessionHistoryMaxEntries?: number | undefined;
238
247
  agentStderrTailBytes?: number | undefined;
239
248
  publicHost?: string | undefined;
249
+ agentSyncIntervalMinutes?: number | undefined;
240
250
  } | undefined;
241
251
  extensions?: Record<string, {
242
252
  args?: string[] | undefined;
@@ -1328,6 +1338,7 @@ declare class Registry {
1328
1338
  constructor(config: HydraConfig, options?: RegistryOptions);
1329
1339
  load(): Promise<RegistryDocument>;
1330
1340
  refresh(): Promise<RegistryDocument>;
1341
+ lastFetchedAt(): number | undefined;
1331
1342
  getAgent(id: string): Promise<RegistryAgent | undefined>;
1332
1343
  private isFresh;
1333
1344
  private fetchFromNetwork;
@@ -1390,7 +1401,7 @@ declare const SessionAttachParams: z.ZodObject<{
1390
1401
  _meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1391
1402
  }, "strip", z.ZodTypeAny, {
1392
1403
  sessionId: string;
1393
- historyPolicy: "full" | "pending_only" | "none" | "after_message";
1404
+ historyPolicy: "none" | "full" | "pending_only" | "after_message";
1394
1405
  readonly?: boolean | undefined;
1395
1406
  clientInfo?: {
1396
1407
  name: string;
@@ -1406,7 +1417,7 @@ declare const SessionAttachParams: z.ZodObject<{
1406
1417
  name: string;
1407
1418
  version?: string | undefined;
1408
1419
  } | undefined;
1409
- historyPolicy?: "full" | "pending_only" | "none" | "after_message" | undefined;
1420
+ historyPolicy?: "none" | "full" | "pending_only" | "after_message" | undefined;
1410
1421
  afterMessageId?: string | undefined;
1411
1422
  clientId?: string | undefined;
1412
1423
  _meta?: Record<string, unknown> | undefined;
@@ -1469,6 +1480,8 @@ declare const SessionListEntry: z.ZodObject<{
1469
1480
  importedFromMachine: z.ZodOptional<z.ZodString>;
1470
1481
  importedFromUpstreamSessionId: z.ZodOptional<z.ZodString>;
1471
1482
  parentSessionId: z.ZodOptional<z.ZodString>;
1483
+ forkedFromSessionId: z.ZodOptional<z.ZodString>;
1484
+ forkedFromMessageId: z.ZodOptional<z.ZodString>;
1472
1485
  originatingClient: z.ZodOptional<z.ZodObject<{
1473
1486
  name: z.ZodString;
1474
1487
  version: z.ZodOptional<z.ZodString>;
@@ -1505,6 +1518,8 @@ declare const SessionListEntry: z.ZodObject<{
1505
1518
  importedFromMachine?: string | undefined;
1506
1519
  importedFromUpstreamSessionId?: string | undefined;
1507
1520
  parentSessionId?: string | undefined;
1521
+ forkedFromSessionId?: string | undefined;
1522
+ forkedFromMessageId?: string | undefined;
1508
1523
  originatingClient?: {
1509
1524
  name: string;
1510
1525
  version?: string | undefined;
@@ -1529,6 +1544,8 @@ declare const SessionListEntry: z.ZodObject<{
1529
1544
  importedFromMachine?: string | undefined;
1530
1545
  importedFromUpstreamSessionId?: string | undefined;
1531
1546
  parentSessionId?: string | undefined;
1547
+ forkedFromSessionId?: string | undefined;
1548
+ forkedFromMessageId?: string | undefined;
1532
1549
  originatingClient?: {
1533
1550
  name: string;
1534
1551
  version?: string | undefined;
@@ -1900,6 +1917,7 @@ declare class HistoryStore {
1900
1917
  rewrite(sessionId: string, entries: HistoryEntry[]): Promise<void>;
1901
1918
  compact(sessionId: string, maxEntries: number): Promise<void>;
1902
1919
  load(sessionId: string): Promise<HistoryEntry[]>;
1920
+ flushAll(): Promise<void>;
1903
1921
  delete(sessionId: string): Promise<void>;
1904
1922
  private enqueue;
1905
1923
  }
@@ -1974,6 +1992,8 @@ interface SessionInit {
1974
1992
  transformChain?: TransformerRef[];
1975
1993
  idleEventTimeoutMs?: number;
1976
1994
  parentSessionId?: string;
1995
+ forkedFromSessionId?: string;
1996
+ forkedFromMessageId?: string;
1977
1997
  originatingClient?: {
1978
1998
  name: string;
1979
1999
  version?: string;
@@ -2002,6 +2022,8 @@ declare class Session {
2002
2022
  agentCapabilities: AgentCapabilities | undefined;
2003
2023
  readonly agentArgs: string[] | undefined;
2004
2024
  readonly parentSessionId: string | undefined;
2025
+ readonly forkedFromSessionId: string | undefined;
2026
+ readonly forkedFromMessageId: string | undefined;
2005
2027
  readonly originatingClient: {
2006
2028
  name: string;
2007
2029
  version?: string;
@@ -2019,6 +2041,7 @@ declare class Session {
2019
2041
  private promptInFlight;
2020
2042
  private queueWriteChain;
2021
2043
  private closed;
2044
+ private closing;
2022
2045
  private closeHandlers;
2023
2046
  private titleHandlers;
2024
2047
  private broadcastHandlers;
@@ -2294,6 +2317,8 @@ declare const SessionRecord: z.ZodObject<{
2294
2317
  }>, "many">>;
2295
2318
  pendingHistorySync: z.ZodOptional<z.ZodBoolean>;
2296
2319
  parentSessionId: z.ZodOptional<z.ZodString>;
2320
+ forkedFromSessionId: z.ZodOptional<z.ZodString>;
2321
+ forkedFromMessageId: z.ZodOptional<z.ZodString>;
2297
2322
  originatingClient: z.ZodOptional<z.ZodObject<{
2298
2323
  name: z.ZodString;
2299
2324
  version: z.ZodOptional<z.ZodString>;
@@ -2328,6 +2353,8 @@ declare const SessionRecord: z.ZodObject<{
2328
2353
  importedFromMachine?: string | undefined;
2329
2354
  importedFromUpstreamSessionId?: string | undefined;
2330
2355
  parentSessionId?: string | undefined;
2356
+ forkedFromSessionId?: string | undefined;
2357
+ forkedFromMessageId?: string | undefined;
2331
2358
  originatingClient?: {
2332
2359
  name: string;
2333
2360
  version?: string | undefined;
@@ -2371,6 +2398,8 @@ declare const SessionRecord: z.ZodObject<{
2371
2398
  importedFromMachine?: string | undefined;
2372
2399
  importedFromUpstreamSessionId?: string | undefined;
2373
2400
  parentSessionId?: string | undefined;
2401
+ forkedFromSessionId?: string | undefined;
2402
+ forkedFromMessageId?: string | undefined;
2374
2403
  originatingClient?: {
2375
2404
  name: string;
2376
2405
  version?: string | undefined;
@@ -2662,6 +2691,8 @@ interface ResurrectParams {
2662
2691
  name: string;
2663
2692
  version?: string;
2664
2693
  };
2694
+ forkedFromSessionId?: string;
2695
+ forkedFromMessageId?: string;
2665
2696
  }
2666
2697
  type AgentSpawner = (opts: AgentInstanceOptions) => AgentInstance;
2667
2698
  interface SessionManagerOptions {
@@ -2731,6 +2762,15 @@ declare class SessionManager {
2731
2762
  importedFromSessionId: string;
2732
2763
  replaced: boolean;
2733
2764
  }>;
2765
+ forkSession(sourceSessionId: string, opts?: {
2766
+ forkAt?: string;
2767
+ cwd?: string;
2768
+ agentId?: string;
2769
+ }): Promise<{
2770
+ sessionId: string;
2771
+ forkedFromSessionId: string;
2772
+ forkedAt: string;
2773
+ }>;
2734
2774
  private writeImportedRecord;
2735
2775
  deleteRecord(sessionId: string): Promise<boolean>;
2736
2776
  hasRecord(sessionId: string): Promise<boolean>;
@@ -2741,6 +2781,7 @@ declare class SessionManager {
2741
2781
  private enqueueMetaWrite;
2742
2782
  closeAll(): Promise<void>;
2743
2783
  flushMetaWrites(): Promise<void>;
2784
+ flushHistoryWrites(): Promise<void>;
2744
2785
  resurrectPendingQueues(): Promise<void>;
2745
2786
  }
2746
2787
 
@@ -2792,6 +2833,48 @@ declare class ExtensionManager {
2792
2833
  private scheduleRestart;
2793
2834
  }
2794
2835
 
2836
+ interface TokenReservation {
2837
+ complete: (session: Session) => void;
2838
+ abandon: (reason?: Error) => void;
2839
+ }
2840
+ interface TokenEntry {
2841
+ session: Session | undefined;
2842
+ sessionReady: Promise<Session>;
2843
+ disposers: Array<() => Promise<void>>;
2844
+ }
2845
+ declare class McpTokenRegistry {
2846
+ private byToken;
2847
+ reserve(token: string): TokenReservation;
2848
+ bind(token: string, session: Session): void;
2849
+ lookup(token: string): TokenEntry | undefined;
2850
+ addDisposer(token: string, dispose: () => Promise<void>): void;
2851
+ unbind(token: string): Promise<void>;
2852
+ size(): number;
2853
+ }
2854
+
2855
+ interface ExtensionMcpToolSpec {
2856
+ name: string;
2857
+ description: string;
2858
+ inputSchema: object;
2859
+ outputSchema?: object;
2860
+ }
2861
+ interface ExtensionMcpEntry {
2862
+ connection: JsonRpcConnection;
2863
+ instructions?: string;
2864
+ tools: ExtensionMcpToolSpec[];
2865
+ }
2866
+ type ExtensionMcpChangeKind = "register" | "clear";
2867
+ declare class ExtensionMcpRegistry {
2868
+ private byName;
2869
+ private changeHandlers;
2870
+ register(extName: string, connection: JsonRpcConnection, instructions: string | undefined, tools: ExtensionMcpToolSpec[]): void;
2871
+ clear(extName: string): void;
2872
+ lookup(extName: string): ExtensionMcpEntry | undefined;
2873
+ list(): string[];
2874
+ onChange(handler: (extName: string, kind: ExtensionMcpChangeKind) => void): () => void;
2875
+ private fireChanged;
2876
+ }
2877
+
2795
2878
  declare module "fastify" {
2796
2879
  interface FastifyContextConfig {
2797
2880
  skipAuth?: boolean;
@@ -2803,6 +2886,9 @@ interface DaemonHandle {
2803
2886
  registry: Registry;
2804
2887
  extensions: ExtensionManager;
2805
2888
  transformers: TransformerManager;
2889
+ mcpTokenRegistry: McpTokenRegistry;
2890
+ extensionMcp: ExtensionMcpRegistry;
2891
+ processRegistry: ProcessTokenRegistry;
2806
2892
  shutdown: () => Promise<void>;
2807
2893
  }
2808
2894
  declare function startDaemon(config: HydraConfig, serviceToken: string): Promise<DaemonHandle>;