@knpkv/herdr-connect 0.2.0

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.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/dist/activity-store.d.ts +11 -0
  4. package/dist/activity-store.d.ts.map +1 -0
  5. package/dist/activity-store.js +76 -0
  6. package/dist/activity-store.js.map +1 -0
  7. package/dist/client-entry.d.ts +2 -0
  8. package/dist/client-entry.d.ts.map +1 -0
  9. package/dist/client-entry.js +11 -0
  10. package/dist/client-entry.js.map +1 -0
  11. package/dist/client.d.ts +86 -0
  12. package/dist/client.d.ts.map +1 -0
  13. package/dist/client.js +453 -0
  14. package/dist/client.js.map +1 -0
  15. package/dist/directory.d.ts +159 -0
  16. package/dist/directory.d.ts.map +1 -0
  17. package/dist/directory.js +186 -0
  18. package/dist/directory.js.map +1 -0
  19. package/dist/errors.d.ts +62 -0
  20. package/dist/errors.d.ts.map +1 -0
  21. package/dist/errors.js +36 -0
  22. package/dist/errors.js.map +1 -0
  23. package/dist/forest.d.ts +61 -0
  24. package/dist/forest.d.ts.map +1 -0
  25. package/dist/forest.js +90 -0
  26. package/dist/forest.js.map +1 -0
  27. package/dist/id.d.ts +4 -0
  28. package/dist/id.d.ts.map +1 -0
  29. package/dist/id.js +10 -0
  30. package/dist/id.js.map +1 -0
  31. package/dist/index.d.ts +13 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +13 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/internal/terminal-release.d.ts +6 -0
  36. package/dist/internal/terminal-release.d.ts.map +1 -0
  37. package/dist/internal/terminal-release.js +13 -0
  38. package/dist/internal/terminal-release.js.map +1 -0
  39. package/dist/keyboard.d.ts +2 -0
  40. package/dist/keyboard.d.ts.map +1 -0
  41. package/dist/keyboard.js +19 -0
  42. package/dist/keyboard.js.map +1 -0
  43. package/dist/model.d.ts +144 -0
  44. package/dist/model.d.ts.map +1 -0
  45. package/dist/model.js +104 -0
  46. package/dist/model.js.map +1 -0
  47. package/dist/relationship-store.d.ts +66 -0
  48. package/dist/relationship-store.d.ts.map +1 -0
  49. package/dist/relationship-store.js +246 -0
  50. package/dist/relationship-store.js.map +1 -0
  51. package/dist/target.d.ts +83 -0
  52. package/dist/target.d.ts.map +1 -0
  53. package/dist/target.js +56 -0
  54. package/dist/target.js.map +1 -0
  55. package/dist/terminal-input.d.ts +30 -0
  56. package/dist/terminal-input.d.ts.map +1 -0
  57. package/dist/terminal-input.js +95 -0
  58. package/dist/terminal-input.js.map +1 -0
  59. package/dist/terminal-setup.d.ts +10 -0
  60. package/dist/terminal-setup.d.ts.map +1 -0
  61. package/dist/terminal-setup.js +11 -0
  62. package/dist/terminal-setup.js.map +1 -0
  63. package/dist/terminal-theme.d.ts +3 -0
  64. package/dist/terminal-theme.d.ts.map +1 -0
  65. package/dist/terminal-theme.js +3 -0
  66. package/dist/terminal-theme.js.map +1 -0
  67. package/dist/terminal-viewport.d.ts +12 -0
  68. package/dist/terminal-viewport.d.ts.map +1 -0
  69. package/dist/terminal-viewport.js +21 -0
  70. package/dist/terminal-viewport.js.map +1 -0
  71. package/dist/terminal.d.ts +794 -0
  72. package/dist/terminal.d.ts.map +1 -0
  73. package/dist/terminal.js +166 -0
  74. package/dist/terminal.js.map +1 -0
  75. package/dist/view.d.ts +51 -0
  76. package/dist/view.d.ts.map +1 -0
  77. package/dist/view.js +210 -0
  78. package/dist/view.js.map +1 -0
  79. package/package.json +84 -0
  80. package/src/styles.css +527 -0
@@ -0,0 +1,794 @@
1
+ import type { Scope } from "effect";
2
+ import { Crypto, Effect, Stream } from "effect";
3
+ import { ChildProcessSpawner } from "effect/unstable/process";
4
+ import { TerminalAgentNotFoundError, TerminalProtocolError, TerminalTransportError } from "./errors.js";
5
+ import { HerdrTerminalEvent, type TerminalClientCommand, type TerminalSelection } from "./model.js";
6
+ export type TerminalError = TerminalAgentNotFoundError | TerminalProtocolError | TerminalTransportError;
7
+ export interface TerminalSession {
8
+ readonly events: Stream.Stream<HerdrTerminalEvent, TerminalError>;
9
+ readonly send: (command: TerminalClientCommand) => Effect.Effect<void, TerminalTransportError>;
10
+ }
11
+ export interface TerminalConnector {
12
+ readonly open: (selection: TerminalSelection) => Effect.Effect<TerminalSession, TerminalError, Scope.Scope>;
13
+ }
14
+ export declare const terminalStderrMaxBytes: number;
15
+ export declare const terminalEventMaxLineBytes: number;
16
+ /** @internal Exposes copied-byte accounting only for the deterministic complexity regression. */
17
+ export declare const boundedTerminalLines: <E, R>(stream: Stream.Stream<Uint8Array, E, R>, onBufferCopy?: (bytes: number) => void) => Stream.Stream<string, E | TerminalProtocolError, R>;
18
+ export declare const makeHerdrTerminalConnector: (config: {
19
+ readonly host: string;
20
+ readonly repository: string;
21
+ readonly stateDirectory: string;
22
+ readonly crossHost: boolean;
23
+ readonly port: number;
24
+ readonly localPort: number;
25
+ readonly approvalPort: number;
26
+ readonly allowedUsers: readonly string[];
27
+ readonly approvalNodes: readonly string[];
28
+ readonly machines: readonly {
29
+ readonly host: string;
30
+ readonly nodeId: string;
31
+ }[];
32
+ readonly applyMachines: readonly string[];
33
+ readonly checkCommand: readonly string[];
34
+ readonly applyCommand: readonly string[] | null;
35
+ readonly browserMcpRecoverCommand: readonly string[] | null;
36
+ readonly coordinatorCommand: readonly string[];
37
+ readonly herdrCommand: string;
38
+ readonly tailscaleCommand: string;
39
+ readonly approvalTls: {
40
+ readonly certificatePath: string;
41
+ readonly privateKeyPath: string;
42
+ } | null;
43
+ readonly approvalHub: {
44
+ readonly host: string;
45
+ readonly nodeId: string;
46
+ readonly url: string;
47
+ };
48
+ readonly pushAllowedOrigins: readonly string[];
49
+ readonly pushSubject: string;
50
+ }, service: {
51
+ submit: (request: {
52
+ readonly payload: {
53
+ readonly kind: "nix.check";
54
+ } | {
55
+ readonly kind: "nix.apply";
56
+ readonly ref: string;
57
+ } | {
58
+ readonly kind: "agent.delegate";
59
+ readonly repository: string;
60
+ readonly prompt: string;
61
+ readonly mode: "consult" | "review" | "work";
62
+ readonly channel?: "coordinator_chat";
63
+ } | {
64
+ readonly kind: "agent.message";
65
+ readonly session: string;
66
+ readonly message: string;
67
+ } | {
68
+ readonly kind: "browser.mcp.recover";
69
+ };
70
+ }, actor: string) => Effect.Effect<{
71
+ readonly id: string;
72
+ readonly createdAt: number;
73
+ readonly updatedAt: number;
74
+ readonly actor: string;
75
+ readonly hash: string;
76
+ readonly approvalNonce: string | null;
77
+ readonly approvalExpiresAt?: number | null;
78
+ readonly approvedBy: string | null;
79
+ readonly approvedAt?: number | null;
80
+ readonly rejectedBy?: string | null;
81
+ readonly rejectedAt?: number | null;
82
+ readonly expiredAt?: number | null;
83
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
84
+ readonly payload: {
85
+ readonly kind: "nix.check";
86
+ } | {
87
+ readonly kind: "nix.apply";
88
+ readonly ref: string;
89
+ } | {
90
+ readonly kind: "agent.delegate";
91
+ readonly repository: string;
92
+ readonly prompt: string;
93
+ readonly mode: "consult" | "review" | "work";
94
+ readonly channel?: "coordinator_chat";
95
+ } | {
96
+ readonly kind: "agent.message";
97
+ readonly session: string;
98
+ readonly message: string;
99
+ } | {
100
+ readonly kind: "browser.mcp.recover";
101
+ };
102
+ readonly result: string | null;
103
+ readonly error: string | null;
104
+ readonly worker?: {
105
+ readonly host: string;
106
+ readonly agentId: string;
107
+ readonly name: string;
108
+ readonly paneId: string;
109
+ readonly relationship?: {
110
+ readonly parentAgentId: string;
111
+ readonly relation: "delegated" | "pair" | "review";
112
+ };
113
+ };
114
+ readonly connectTarget?: {
115
+ readonly host: string;
116
+ readonly agentId: string;
117
+ readonly url: string;
118
+ };
119
+ readonly workerTerminalObservedAt?: number | null;
120
+ }, import("@knpkv/herdr-fleet").FleetJobConflictError | import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
121
+ approve: (jobId: string, approval: import("@knpkv/herdr-fleet").Approval, actor: string) => Effect.Effect<{
122
+ readonly id: string;
123
+ readonly createdAt: number;
124
+ readonly updatedAt: number;
125
+ readonly actor: string;
126
+ readonly hash: string;
127
+ readonly approvalNonce: string | null;
128
+ readonly approvalExpiresAt?: number | null;
129
+ readonly approvedBy: string | null;
130
+ readonly approvedAt?: number | null;
131
+ readonly rejectedBy?: string | null;
132
+ readonly rejectedAt?: number | null;
133
+ readonly expiredAt?: number | null;
134
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
135
+ readonly payload: {
136
+ readonly kind: "nix.check";
137
+ } | {
138
+ readonly kind: "nix.apply";
139
+ readonly ref: string;
140
+ } | {
141
+ readonly kind: "agent.delegate";
142
+ readonly repository: string;
143
+ readonly prompt: string;
144
+ readonly mode: "consult" | "review" | "work";
145
+ readonly channel?: "coordinator_chat";
146
+ } | {
147
+ readonly kind: "agent.message";
148
+ readonly session: string;
149
+ readonly message: string;
150
+ } | {
151
+ readonly kind: "browser.mcp.recover";
152
+ };
153
+ readonly result: string | null;
154
+ readonly error: string | null;
155
+ readonly worker?: {
156
+ readonly host: string;
157
+ readonly agentId: string;
158
+ readonly name: string;
159
+ readonly paneId: string;
160
+ readonly relationship?: {
161
+ readonly parentAgentId: string;
162
+ readonly relation: "delegated" | "pair" | "review";
163
+ };
164
+ };
165
+ readonly connectTarget?: {
166
+ readonly host: string;
167
+ readonly agentId: string;
168
+ readonly url: string;
169
+ };
170
+ readonly workerTerminalObservedAt?: number | null;
171
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
172
+ reject: (jobId: string, approval: import("@knpkv/herdr-fleet").Approval, actor: string) => Effect.Effect<{
173
+ readonly id: string;
174
+ readonly createdAt: number;
175
+ readonly updatedAt: number;
176
+ readonly actor: string;
177
+ readonly hash: string;
178
+ readonly approvalNonce: string | null;
179
+ readonly approvalExpiresAt?: number | null;
180
+ readonly approvedBy: string | null;
181
+ readonly approvedAt?: number | null;
182
+ readonly rejectedBy?: string | null;
183
+ readonly rejectedAt?: number | null;
184
+ readonly expiredAt?: number | null;
185
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
186
+ readonly payload: {
187
+ readonly kind: "nix.check";
188
+ } | {
189
+ readonly kind: "nix.apply";
190
+ readonly ref: string;
191
+ } | {
192
+ readonly kind: "agent.delegate";
193
+ readonly repository: string;
194
+ readonly prompt: string;
195
+ readonly mode: "consult" | "review" | "work";
196
+ readonly channel?: "coordinator_chat";
197
+ } | {
198
+ readonly kind: "agent.message";
199
+ readonly session: string;
200
+ readonly message: string;
201
+ } | {
202
+ readonly kind: "browser.mcp.recover";
203
+ };
204
+ readonly result: string | null;
205
+ readonly error: string | null;
206
+ readonly worker?: {
207
+ readonly host: string;
208
+ readonly agentId: string;
209
+ readonly name: string;
210
+ readonly paneId: string;
211
+ readonly relationship?: {
212
+ readonly parentAgentId: string;
213
+ readonly relation: "delegated" | "pair" | "review";
214
+ };
215
+ };
216
+ readonly connectTarget?: {
217
+ readonly host: string;
218
+ readonly agentId: string;
219
+ readonly url: string;
220
+ };
221
+ readonly workerTerminalObservedAt?: number | null;
222
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
223
+ run: (jobId: string) => Effect.Effect<{
224
+ readonly id: string;
225
+ readonly createdAt: number;
226
+ readonly updatedAt: number;
227
+ readonly actor: string;
228
+ readonly hash: string;
229
+ readonly approvalNonce: string | null;
230
+ readonly approvalExpiresAt?: number | null;
231
+ readonly approvedBy: string | null;
232
+ readonly approvedAt?: number | null;
233
+ readonly rejectedBy?: string | null;
234
+ readonly rejectedAt?: number | null;
235
+ readonly expiredAt?: number | null;
236
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
237
+ readonly payload: {
238
+ readonly kind: "nix.check";
239
+ } | {
240
+ readonly kind: "nix.apply";
241
+ readonly ref: string;
242
+ } | {
243
+ readonly kind: "agent.delegate";
244
+ readonly repository: string;
245
+ readonly prompt: string;
246
+ readonly mode: "consult" | "review" | "work";
247
+ readonly channel?: "coordinator_chat";
248
+ } | {
249
+ readonly kind: "agent.message";
250
+ readonly session: string;
251
+ readonly message: string;
252
+ } | {
253
+ readonly kind: "browser.mcp.recover";
254
+ };
255
+ readonly result: string | null;
256
+ readonly error: string | null;
257
+ readonly worker?: {
258
+ readonly host: string;
259
+ readonly agentId: string;
260
+ readonly name: string;
261
+ readonly paneId: string;
262
+ readonly relationship?: {
263
+ readonly parentAgentId: string;
264
+ readonly relation: "delegated" | "pair" | "review";
265
+ };
266
+ };
267
+ readonly connectTarget?: {
268
+ readonly host: string;
269
+ readonly agentId: string;
270
+ readonly url: string;
271
+ };
272
+ readonly workerTerminalObservedAt?: number | null;
273
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
274
+ runCoordinatorChat: (jobId: string) => Effect.Effect<{
275
+ readonly id: string;
276
+ readonly createdAt: number;
277
+ readonly updatedAt: number;
278
+ readonly actor: string;
279
+ readonly hash: string;
280
+ readonly approvalNonce: string | null;
281
+ readonly approvalExpiresAt?: number | null;
282
+ readonly approvedBy: string | null;
283
+ readonly approvedAt?: number | null;
284
+ readonly rejectedBy?: string | null;
285
+ readonly rejectedAt?: number | null;
286
+ readonly expiredAt?: number | null;
287
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
288
+ readonly payload: {
289
+ readonly kind: "nix.check";
290
+ } | {
291
+ readonly kind: "nix.apply";
292
+ readonly ref: string;
293
+ } | {
294
+ readonly kind: "agent.delegate";
295
+ readonly repository: string;
296
+ readonly prompt: string;
297
+ readonly mode: "consult" | "review" | "work";
298
+ readonly channel?: "coordinator_chat";
299
+ } | {
300
+ readonly kind: "agent.message";
301
+ readonly session: string;
302
+ readonly message: string;
303
+ } | {
304
+ readonly kind: "browser.mcp.recover";
305
+ };
306
+ readonly result: string | null;
307
+ readonly error: string | null;
308
+ readonly worker?: {
309
+ readonly host: string;
310
+ readonly agentId: string;
311
+ readonly name: string;
312
+ readonly paneId: string;
313
+ readonly relationship?: {
314
+ readonly parentAgentId: string;
315
+ readonly relation: "delegated" | "pair" | "review";
316
+ };
317
+ };
318
+ readonly connectTarget?: {
319
+ readonly host: string;
320
+ readonly agentId: string;
321
+ readonly url: string;
322
+ };
323
+ readonly workerTerminalObservedAt?: number | null;
324
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
325
+ get: (jobId: string) => Effect.Effect<{
326
+ readonly id: string;
327
+ readonly createdAt: number;
328
+ readonly updatedAt: number;
329
+ readonly actor: string;
330
+ readonly hash: string;
331
+ readonly approvalNonce: string | null;
332
+ readonly approvalExpiresAt?: number | null;
333
+ readonly approvedBy: string | null;
334
+ readonly approvedAt?: number | null;
335
+ readonly rejectedBy?: string | null;
336
+ readonly rejectedAt?: number | null;
337
+ readonly expiredAt?: number | null;
338
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
339
+ readonly payload: {
340
+ readonly kind: "nix.check";
341
+ } | {
342
+ readonly kind: "nix.apply";
343
+ readonly ref: string;
344
+ } | {
345
+ readonly kind: "agent.delegate";
346
+ readonly repository: string;
347
+ readonly prompt: string;
348
+ readonly mode: "consult" | "review" | "work";
349
+ readonly channel?: "coordinator_chat";
350
+ } | {
351
+ readonly kind: "agent.message";
352
+ readonly session: string;
353
+ readonly message: string;
354
+ } | {
355
+ readonly kind: "browser.mcp.recover";
356
+ };
357
+ readonly result: string | null;
358
+ readonly error: string | null;
359
+ readonly worker?: {
360
+ readonly host: string;
361
+ readonly agentId: string;
362
+ readonly name: string;
363
+ readonly paneId: string;
364
+ readonly relationship?: {
365
+ readonly parentAgentId: string;
366
+ readonly relation: "delegated" | "pair" | "review";
367
+ };
368
+ };
369
+ readonly connectTarget?: {
370
+ readonly host: string;
371
+ readonly agentId: string;
372
+ readonly url: string;
373
+ };
374
+ readonly workerTerminalObservedAt?: number | null;
375
+ }, import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError, never>;
376
+ history: (limit: number) => Effect.Effect<{
377
+ readonly id: string;
378
+ readonly createdAt: number;
379
+ readonly updatedAt: number;
380
+ readonly actor: string;
381
+ readonly hash: string;
382
+ readonly approvalNonce: string | null;
383
+ readonly approvalExpiresAt?: number | null;
384
+ readonly approvedBy: string | null;
385
+ readonly approvedAt?: number | null;
386
+ readonly rejectedBy?: string | null;
387
+ readonly rejectedAt?: number | null;
388
+ readonly expiredAt?: number | null;
389
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
390
+ readonly payload: {
391
+ readonly kind: "nix.check";
392
+ } | {
393
+ readonly kind: "nix.apply";
394
+ readonly ref: string;
395
+ } | {
396
+ readonly kind: "agent.delegate";
397
+ readonly repository: string;
398
+ readonly prompt: string;
399
+ readonly mode: "consult" | "review" | "work";
400
+ readonly channel?: "coordinator_chat";
401
+ } | {
402
+ readonly kind: "agent.message";
403
+ readonly session: string;
404
+ readonly message: string;
405
+ } | {
406
+ readonly kind: "browser.mcp.recover";
407
+ };
408
+ readonly result: string | null;
409
+ readonly error: string | null;
410
+ readonly worker?: {
411
+ readonly host: string;
412
+ readonly agentId: string;
413
+ readonly name: string;
414
+ readonly paneId: string;
415
+ readonly relationship?: {
416
+ readonly parentAgentId: string;
417
+ readonly relation: "delegated" | "pair" | "review";
418
+ };
419
+ };
420
+ readonly connectTarget?: {
421
+ readonly host: string;
422
+ readonly agentId: string;
423
+ readonly url: string;
424
+ };
425
+ readonly workerTerminalObservedAt?: number | null;
426
+ }[], import("@knpkv/herdr-fleet").FleetStoreError, never>;
427
+ historyAfter: (cursor: {
428
+ readonly createdAt: number;
429
+ readonly id: string;
430
+ } | null, limit: number) => Effect.Effect<{
431
+ readonly id: string;
432
+ readonly createdAt: number;
433
+ readonly updatedAt: number;
434
+ readonly actor: string;
435
+ readonly hash: string;
436
+ readonly approvalNonce: string | null;
437
+ readonly approvalExpiresAt?: number | null;
438
+ readonly approvedBy: string | null;
439
+ readonly approvedAt?: number | null;
440
+ readonly rejectedBy?: string | null;
441
+ readonly rejectedAt?: number | null;
442
+ readonly expiredAt?: number | null;
443
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
444
+ readonly payload: {
445
+ readonly kind: "nix.check";
446
+ } | {
447
+ readonly kind: "nix.apply";
448
+ readonly ref: string;
449
+ } | {
450
+ readonly kind: "agent.delegate";
451
+ readonly repository: string;
452
+ readonly prompt: string;
453
+ readonly mode: "consult" | "review" | "work";
454
+ readonly channel?: "coordinator_chat";
455
+ } | {
456
+ readonly kind: "agent.message";
457
+ readonly session: string;
458
+ readonly message: string;
459
+ } | {
460
+ readonly kind: "browser.mcp.recover";
461
+ };
462
+ readonly result: string | null;
463
+ readonly error: string | null;
464
+ readonly worker?: {
465
+ readonly host: string;
466
+ readonly agentId: string;
467
+ readonly name: string;
468
+ readonly paneId: string;
469
+ readonly relationship?: {
470
+ readonly parentAgentId: string;
471
+ readonly relation: "delegated" | "pair" | "review";
472
+ };
473
+ };
474
+ readonly connectTarget?: {
475
+ readonly host: string;
476
+ readonly agentId: string;
477
+ readonly url: string;
478
+ };
479
+ readonly workerTerminalObservedAt?: number | null;
480
+ }[], import("@knpkv/herdr-fleet").FleetStoreError, never>;
481
+ historyPage: (cursor: {
482
+ readonly createdAt: number;
483
+ readonly id: string;
484
+ } | null, limit: number) => Effect.Effect<{
485
+ records: {
486
+ readonly id: string;
487
+ readonly createdAt: number;
488
+ readonly updatedAt: number;
489
+ readonly actor: string;
490
+ readonly hash: string;
491
+ readonly approvalNonce: string | null;
492
+ readonly approvalExpiresAt?: number | null;
493
+ readonly approvedBy: string | null;
494
+ readonly approvedAt?: number | null;
495
+ readonly rejectedBy?: string | null;
496
+ readonly rejectedAt?: number | null;
497
+ readonly expiredAt?: number | null;
498
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
499
+ readonly payload: {
500
+ readonly kind: "nix.check";
501
+ } | {
502
+ readonly kind: "nix.apply";
503
+ readonly ref: string;
504
+ } | {
505
+ readonly kind: "agent.delegate";
506
+ readonly repository: string;
507
+ readonly prompt: string;
508
+ readonly mode: "consult" | "review" | "work";
509
+ readonly channel?: "coordinator_chat";
510
+ } | {
511
+ readonly kind: "agent.message";
512
+ readonly session: string;
513
+ readonly message: string;
514
+ } | {
515
+ readonly kind: "browser.mcp.recover";
516
+ };
517
+ readonly result: string | null;
518
+ readonly error: string | null;
519
+ readonly worker?: {
520
+ readonly host: string;
521
+ readonly agentId: string;
522
+ readonly name: string;
523
+ readonly paneId: string;
524
+ readonly relationship?: {
525
+ readonly parentAgentId: string;
526
+ readonly relation: "delegated" | "pair" | "review";
527
+ };
528
+ };
529
+ readonly connectTarget?: {
530
+ readonly host: string;
531
+ readonly agentId: string;
532
+ readonly url: string;
533
+ };
534
+ readonly workerTerminalObservedAt?: number | null;
535
+ }[];
536
+ nextCursor: {
537
+ readonly createdAt: number;
538
+ readonly id: string;
539
+ } | null;
540
+ }, import("@knpkv/herdr-fleet").FleetStoreError, never>;
541
+ pendingApprovalPage: (cursor: {
542
+ readonly createdAt: number;
543
+ readonly id: string;
544
+ } | null) => Effect.Effect<{
545
+ records: {
546
+ readonly id: string;
547
+ readonly createdAt: number;
548
+ readonly updatedAt: number;
549
+ readonly actor: string;
550
+ readonly hash: string;
551
+ readonly approvalNonce: string | null;
552
+ readonly approvalExpiresAt?: number | null;
553
+ readonly approvedBy: string | null;
554
+ readonly approvedAt?: number | null;
555
+ readonly rejectedBy?: string | null;
556
+ readonly rejectedAt?: number | null;
557
+ readonly expiredAt?: number | null;
558
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
559
+ readonly payload: {
560
+ readonly kind: "nix.check";
561
+ } | {
562
+ readonly kind: "nix.apply";
563
+ readonly ref: string;
564
+ } | {
565
+ readonly kind: "agent.delegate";
566
+ readonly repository: string;
567
+ readonly prompt: string;
568
+ readonly mode: "consult" | "review" | "work";
569
+ readonly channel?: "coordinator_chat";
570
+ } | {
571
+ readonly kind: "agent.message";
572
+ readonly session: string;
573
+ readonly message: string;
574
+ } | {
575
+ readonly kind: "browser.mcp.recover";
576
+ };
577
+ readonly result: string | null;
578
+ readonly error: string | null;
579
+ readonly worker?: {
580
+ readonly host: string;
581
+ readonly agentId: string;
582
+ readonly name: string;
583
+ readonly paneId: string;
584
+ readonly relationship?: {
585
+ readonly parentAgentId: string;
586
+ readonly relation: "delegated" | "pair" | "review";
587
+ };
588
+ };
589
+ readonly connectTarget?: {
590
+ readonly host: string;
591
+ readonly agentId: string;
592
+ readonly url: string;
593
+ };
594
+ readonly workerTerminalObservedAt?: number | null;
595
+ }[];
596
+ nextCursor: {
597
+ createdAt: number;
598
+ id: string;
599
+ } | null;
600
+ }, import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError, never>;
601
+ pendingApprovals: () => Effect.Effect<{
602
+ readonly id: string;
603
+ readonly createdAt: number;
604
+ readonly updatedAt: number;
605
+ readonly actor: string;
606
+ readonly hash: string;
607
+ readonly approvalNonce: string | null;
608
+ readonly approvalExpiresAt?: number | null;
609
+ readonly approvedBy: string | null;
610
+ readonly approvedAt?: number | null;
611
+ readonly rejectedBy?: string | null;
612
+ readonly rejectedAt?: number | null;
613
+ readonly expiredAt?: number | null;
614
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
615
+ readonly payload: {
616
+ readonly kind: "nix.check";
617
+ } | {
618
+ readonly kind: "nix.apply";
619
+ readonly ref: string;
620
+ } | {
621
+ readonly kind: "agent.delegate";
622
+ readonly repository: string;
623
+ readonly prompt: string;
624
+ readonly mode: "consult" | "review" | "work";
625
+ readonly channel?: "coordinator_chat";
626
+ } | {
627
+ readonly kind: "agent.message";
628
+ readonly session: string;
629
+ readonly message: string;
630
+ } | {
631
+ readonly kind: "browser.mcp.recover";
632
+ };
633
+ readonly result: string | null;
634
+ readonly error: string | null;
635
+ readonly worker?: {
636
+ readonly host: string;
637
+ readonly agentId: string;
638
+ readonly name: string;
639
+ readonly paneId: string;
640
+ readonly relationship?: {
641
+ readonly parentAgentId: string;
642
+ readonly relation: "delegated" | "pair" | "review";
643
+ };
644
+ };
645
+ readonly connectTarget?: {
646
+ readonly host: string;
647
+ readonly agentId: string;
648
+ readonly url: string;
649
+ };
650
+ readonly workerTerminalObservedAt?: number | null;
651
+ }[], import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError, never>;
652
+ agents: () => Effect.Effect<{
653
+ readonly agents: readonly {
654
+ readonly agentId: string | null;
655
+ readonly activityRevision: number;
656
+ readonly kind: string;
657
+ readonly name: string;
658
+ readonly paneId: string;
659
+ readonly parentAgentId: string | null;
660
+ readonly relation: "delegated" | "pair" | "review" | null;
661
+ readonly status: string;
662
+ readonly work: string;
663
+ }[];
664
+ readonly available: boolean;
665
+ readonly error: string | null;
666
+ }, import("@knpkv/herdr-fleet").FleetOperationError, never>;
667
+ workers: () => Effect.Effect<readonly {
668
+ readonly host: string;
669
+ readonly agentId: string;
670
+ readonly name: string;
671
+ readonly paneId: string;
672
+ readonly relationship?: {
673
+ readonly parentAgentId: string;
674
+ readonly relation: "delegated" | "pair" | "review";
675
+ };
676
+ readonly jobId: string;
677
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
678
+ readonly terminalObservedAt: number | null;
679
+ }[], import("@knpkv/herdr-fleet").FleetStoreError, never>;
680
+ status: () => Effect.Effect<{
681
+ applyConfigured: boolean;
682
+ branch: string;
683
+ dirty: boolean;
684
+ repository: string;
685
+ revision: string;
686
+ host: string;
687
+ herdr: {
688
+ readonly agents: readonly {
689
+ readonly agentId: string | null;
690
+ readonly activityRevision: number;
691
+ readonly kind: string;
692
+ readonly name: string;
693
+ readonly paneId: string;
694
+ readonly parentAgentId: string | null;
695
+ readonly relation: "delegated" | "pair" | "review" | null;
696
+ readonly status: string;
697
+ readonly work: string;
698
+ }[];
699
+ readonly available: boolean;
700
+ readonly error: string | null;
701
+ };
702
+ }, import("@knpkv/herdr-fleet").FleetOperationError, never>;
703
+ recover: () => Effect.Effect<string[], import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
704
+ abortSubmission: (jobId: string, detail: string) => Effect.Effect<{
705
+ readonly id: string;
706
+ readonly createdAt: number;
707
+ readonly updatedAt: number;
708
+ readonly actor: string;
709
+ readonly hash: string;
710
+ readonly approvalNonce: string | null;
711
+ readonly approvalExpiresAt?: number | null;
712
+ readonly approvedBy: string | null;
713
+ readonly approvedAt?: number | null;
714
+ readonly rejectedBy?: string | null;
715
+ readonly rejectedAt?: number | null;
716
+ readonly expiredAt?: number | null;
717
+ readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
718
+ readonly payload: {
719
+ readonly kind: "nix.check";
720
+ } | {
721
+ readonly kind: "nix.apply";
722
+ readonly ref: string;
723
+ } | {
724
+ readonly kind: "agent.delegate";
725
+ readonly repository: string;
726
+ readonly prompt: string;
727
+ readonly mode: "consult" | "review" | "work";
728
+ readonly channel?: "coordinator_chat";
729
+ } | {
730
+ readonly kind: "agent.message";
731
+ readonly session: string;
732
+ readonly message: string;
733
+ } | {
734
+ readonly kind: "browser.mcp.recover";
735
+ };
736
+ readonly result: string | null;
737
+ readonly error: string | null;
738
+ readonly worker?: {
739
+ readonly host: string;
740
+ readonly agentId: string;
741
+ readonly name: string;
742
+ readonly paneId: string;
743
+ readonly relationship?: {
744
+ readonly parentAgentId: string;
745
+ readonly relation: "delegated" | "pair" | "review";
746
+ };
747
+ };
748
+ readonly connectTarget?: {
749
+ readonly host: string;
750
+ readonly agentId: string;
751
+ readonly url: string;
752
+ };
753
+ readonly workerTerminalObservedAt?: number | null;
754
+ }, import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
755
+ }) => Effect.Effect<{
756
+ open: (selection: {
757
+ readonly host: string;
758
+ readonly agentId: string;
759
+ readonly cols: number;
760
+ readonly rows: number;
761
+ }) => Effect.Effect<{
762
+ events: Stream.Stream<{
763
+ readonly type: "terminal.frame";
764
+ readonly seq: number;
765
+ readonly encoding: "ansi";
766
+ readonly width: number;
767
+ readonly height: number;
768
+ readonly full: boolean;
769
+ readonly bytes: string;
770
+ } | {
771
+ readonly type: "terminal.closed";
772
+ readonly reason: string;
773
+ }, TerminalProtocolError | TerminalTransportError, never>;
774
+ send: (command: {
775
+ readonly type: "terminal.input";
776
+ readonly text: string;
777
+ } | {
778
+ readonly type: "terminal.resize";
779
+ readonly cols: number;
780
+ readonly rows: number;
781
+ readonly cell_width_px: number;
782
+ readonly cell_height_px: number;
783
+ } | {
784
+ readonly type: "terminal.release";
785
+ } | {
786
+ readonly type: "terminal.scroll";
787
+ readonly direction: "down" | "up";
788
+ readonly lines: number;
789
+ readonly source: "page_key" | "wheel";
790
+ readonly modifiers: number;
791
+ }) => Effect.Effect<void, TerminalTransportError, never>;
792
+ }, TerminalAgentNotFoundError | TerminalTransportError, Scope.Scope>;
793
+ }, never, ChildProcessSpawner.ChildProcessSpawner | Crypto.Crypto>;
794
+ //# sourceMappingURL=terminal.d.ts.map