@knpkv/herdr-connect 0.3.1 → 0.4.1

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/README.md +2 -0
  2. package/dist/activity-store.d.ts +2 -2
  3. package/dist/activity-store.d.ts.map +1 -1
  4. package/dist/activity-store.js +20 -26
  5. package/dist/activity-store.js.map +1 -1
  6. package/dist/client.d.ts +986 -2
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/client.js +353 -54
  9. package/dist/client.js.map +1 -1
  10. package/dist/directory.d.ts +1 -1
  11. package/dist/directory.d.ts.map +1 -1
  12. package/dist/directory.js +1 -1
  13. package/dist/directory.js.map +1 -1
  14. package/dist/id.d.ts.map +1 -1
  15. package/dist/id.js +3 -2
  16. package/dist/id.js.map +1 -1
  17. package/dist/index.d.ts +4 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +4 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/internal/terminal-release.d.ts.map +1 -1
  22. package/dist/internal/terminal-release.js +3 -1
  23. package/dist/internal/terminal-release.js.map +1 -1
  24. package/dist/model.d.ts.map +1 -1
  25. package/dist/model.js +3 -2
  26. package/dist/model.js.map +1 -1
  27. package/dist/relationship-store.d.ts +2 -2
  28. package/dist/relationship-store.d.ts.map +1 -1
  29. package/dist/relationship-store.js +23 -32
  30. package/dist/relationship-store.js.map +1 -1
  31. package/dist/terminal-dimensions.d.ts +25 -0
  32. package/dist/terminal-dimensions.d.ts.map +1 -0
  33. package/dist/terminal-dimensions.js +19 -0
  34. package/dist/terminal-dimensions.js.map +1 -0
  35. package/dist/terminal-keyboard.d.ts +52 -0
  36. package/dist/terminal-keyboard.d.ts.map +1 -0
  37. package/dist/terminal-keyboard.js +141 -0
  38. package/dist/terminal-keyboard.js.map +1 -0
  39. package/dist/terminal-output.d.ts +30 -0
  40. package/dist/terminal-output.d.ts.map +1 -0
  41. package/dist/terminal-output.js +54 -0
  42. package/dist/terminal-output.js.map +1 -0
  43. package/dist/terminal-rail-navigation.d.ts +4 -0
  44. package/dist/terminal-rail-navigation.d.ts.map +1 -0
  45. package/dist/terminal-rail-navigation.js +13 -0
  46. package/dist/terminal-rail-navigation.js.map +1 -0
  47. package/dist/terminal-viewport.d.ts +32 -2
  48. package/dist/terminal-viewport.d.ts.map +1 -1
  49. package/dist/terminal-viewport.js +131 -12
  50. package/dist/terminal-viewport.js.map +1 -1
  51. package/dist/terminal-worker-guard.d.ts +7 -0
  52. package/dist/terminal-worker-guard.d.ts.map +1 -0
  53. package/dist/terminal-worker-guard.js +11 -0
  54. package/dist/terminal-worker-guard.js.map +1 -0
  55. package/dist/terminal.d.ts +1746 -110
  56. package/dist/terminal.d.ts.map +1 -1
  57. package/dist/terminal.js +1 -1
  58. package/dist/terminal.js.map +1 -1
  59. package/dist/view.d.ts +15 -2
  60. package/dist/view.d.ts.map +1 -1
  61. package/dist/view.js +46 -2
  62. package/dist/view.js.map +1 -1
  63. package/dist/work-goal-link-view.d.ts +8 -0
  64. package/dist/work-goal-link-view.d.ts.map +1 -0
  65. package/dist/work-goal-link-view.js +3 -0
  66. package/dist/work-goal-link-view.js.map +1 -0
  67. package/dist/work-goal-link.d.ts +24 -0
  68. package/dist/work-goal-link.d.ts.map +1 -0
  69. package/dist/work-goal-link.js +34 -0
  70. package/dist/work-goal-link.js.map +1 -0
  71. package/dist/work-poll.d.ts +6 -0
  72. package/dist/work-poll.d.ts.map +1 -0
  73. package/dist/work-poll.js +7 -0
  74. package/dist/work-poll.js.map +1 -0
  75. package/dist/workspace-focus.d.ts +23 -0
  76. package/dist/workspace-focus.d.ts.map +1 -0
  77. package/dist/workspace-focus.js +69 -0
  78. package/dist/workspace-focus.js.map +1 -0
  79. package/package.json +17 -15
  80. package/src/styles.css +139 -12
@@ -1,6 +1,6 @@
1
1
  import type { Scope } from "effect";
2
2
  import { Crypto, Effect, Stream } from "effect";
3
- import { ChildProcessSpawner } from "effect/unstable/process";
3
+ import { ChildProcessSpawner } from "effect/process";
4
4
  import { TerminalAgentNotFoundError, TerminalProtocolError, TerminalTransportError } from "./errors.js";
5
5
  import { HerdrTerminalEvent, type TerminalClientCommand, type TerminalSelection } from "./model.js";
6
6
  export type TerminalError = TerminalAgentNotFoundError | TerminalProtocolError | TerminalTransportError;
@@ -56,24 +56,148 @@ export declare const makeHerdrTerminalConnector: (config: {
56
56
  }, service: {
57
57
  submit: (request: {
58
58
  readonly payload: {
59
- readonly kind: "nix.check";
60
- } | {
61
- readonly kind: "nix.apply";
62
- readonly ref: string;
63
- } | {
64
59
  readonly kind: "agent.delegate";
65
60
  readonly repository: string;
66
61
  readonly prompt: string;
67
- readonly mode: "consult" | "review" | "work";
62
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
68
63
  readonly channel?: "coordinator_chat";
64
+ } | {
65
+ readonly kind: "work.reconcile";
66
+ readonly repository: string;
67
+ readonly pullRequest: number;
68
+ readonly goalId: string;
69
+ readonly laneId: string;
70
+ readonly operationId: string;
71
+ readonly expectedRevision: number;
72
+ readonly expectedHead: string;
73
+ readonly newHead: string;
74
+ readonly expectedOwner: {
75
+ readonly id: string;
76
+ readonly name: string;
77
+ };
78
+ readonly expectedGoalEventId: string;
79
+ readonly bindingDispatchRequestId: string;
80
+ readonly sessionId: string;
81
+ readonly expectedWork: string;
82
+ readonly worker: {
83
+ readonly host: string;
84
+ readonly agentId: string;
85
+ readonly name: string;
86
+ readonly paneId: string;
87
+ readonly relationship?: {
88
+ readonly parentAgentId: string;
89
+ readonly relation: "delegated" | "pair" | "review";
90
+ };
91
+ };
92
+ readonly worktree: string;
93
+ readonly branch: string;
94
+ } | {
95
+ readonly kind: "work.admit";
96
+ readonly repository: string;
97
+ readonly pullRequest: number;
98
+ readonly reviewUrl: string;
99
+ readonly goalId: string;
100
+ readonly laneId: string;
101
+ readonly operationId: string;
102
+ readonly expectedAbsenceToken: string;
103
+ readonly head: string;
104
+ readonly baseHead: string;
105
+ readonly owner: {
106
+ readonly id: string;
107
+ readonly name: string;
108
+ };
109
+ readonly sessionId: string;
110
+ readonly expectedWork: string;
111
+ readonly worker: {
112
+ readonly host: string;
113
+ readonly agentId: string;
114
+ readonly name: string;
115
+ readonly paneId: string;
116
+ readonly relationship?: {
117
+ readonly parentAgentId: string;
118
+ readonly relation: "delegated" | "pair" | "review";
119
+ };
120
+ };
121
+ readonly worktree: string;
122
+ readonly branch: string;
123
+ readonly title: string;
124
+ readonly summary: string;
125
+ readonly detail: string;
126
+ } | {
127
+ readonly kind: "work.recover";
128
+ readonly repository: string;
129
+ readonly pullRequest: number;
130
+ readonly reviewUrl: string;
131
+ readonly goalId: string;
132
+ readonly laneId: string;
133
+ readonly operationId: string;
134
+ readonly expectedGoalEventId: string;
135
+ readonly expectedGoalUpdatedAt: number;
136
+ readonly expectedHistoryToken: string;
137
+ readonly head: string;
138
+ readonly baseHead: string;
139
+ readonly owner: {
140
+ readonly id: string;
141
+ readonly name: string;
142
+ };
143
+ readonly sessionId: string;
144
+ readonly expectedWork: string;
145
+ readonly worker: {
146
+ readonly host: string;
147
+ readonly agentId: string;
148
+ readonly name: string;
149
+ readonly paneId: string;
150
+ readonly relationship?: {
151
+ readonly parentAgentId: string;
152
+ readonly relation: "delegated" | "pair" | "review";
153
+ };
154
+ };
155
+ readonly worktree: string;
156
+ readonly branch: string;
157
+ } | {
158
+ readonly kind: "work.reassign";
159
+ readonly goalId: string;
160
+ readonly from: {
161
+ readonly id: string;
162
+ readonly name: string;
163
+ };
164
+ readonly to: {
165
+ readonly id: string;
166
+ readonly name: string;
167
+ };
168
+ readonly toAgent: {
169
+ readonly _tag: "clear";
170
+ } | {
171
+ readonly _tag: "keep";
172
+ } | {
173
+ readonly _tag: "set";
174
+ readonly agent: {
175
+ readonly host: string;
176
+ readonly agentId: string;
177
+ readonly name: string;
178
+ readonly paneId: string;
179
+ readonly relationship?: {
180
+ readonly parentAgentId: string;
181
+ readonly relation: "delegated" | "pair" | "review";
182
+ };
183
+ };
184
+ };
185
+ readonly reason: string;
186
+ readonly expectedGoalEventId: string;
187
+ readonly expectedGoalUpdatedAt: number;
188
+ } | {
189
+ readonly kind: "browser.mcp.recover";
190
+ } | {
191
+ readonly kind: "nix.check";
192
+ } | {
193
+ readonly kind: "nix.apply";
194
+ readonly ref: string;
69
195
  } | {
70
196
  readonly kind: "agent.message";
71
197
  readonly session: string;
72
198
  readonly message: string;
73
- } | {
74
- readonly kind: "browser.mcp.recover";
75
199
  };
76
- }, actor: string) => Effect.Effect<{
200
+ }, actor: string, provenance?: import("@knpkv/herdr-fleet").SubmissionProvenance | undefined) => Effect.Effect<{
77
201
  readonly id: string;
78
202
  readonly createdAt: number;
79
203
  readonly updatedAt: number;
@@ -88,24 +212,150 @@ export declare const makeHerdrTerminalConnector: (config: {
88
212
  readonly expiredAt?: number | null;
89
213
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
90
214
  readonly payload: {
91
- readonly kind: "nix.check";
92
- } | {
93
- readonly kind: "nix.apply";
94
- readonly ref: string;
95
- } | {
96
215
  readonly kind: "agent.delegate";
97
216
  readonly repository: string;
98
217
  readonly prompt: string;
99
- readonly mode: "consult" | "review" | "work";
218
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
100
219
  readonly channel?: "coordinator_chat";
220
+ } | {
221
+ readonly kind: "work.reconcile";
222
+ readonly repository: string;
223
+ readonly pullRequest: number;
224
+ readonly goalId: string;
225
+ readonly laneId: string;
226
+ readonly operationId: string;
227
+ readonly expectedRevision: number;
228
+ readonly expectedHead: string;
229
+ readonly newHead: string;
230
+ readonly expectedOwner: {
231
+ readonly id: string;
232
+ readonly name: string;
233
+ };
234
+ readonly expectedGoalEventId: string;
235
+ readonly bindingDispatchRequestId: string;
236
+ readonly sessionId: string;
237
+ readonly expectedWork: string;
238
+ readonly worker: {
239
+ readonly host: string;
240
+ readonly agentId: string;
241
+ readonly name: string;
242
+ readonly paneId: string;
243
+ readonly relationship?: {
244
+ readonly parentAgentId: string;
245
+ readonly relation: "delegated" | "pair" | "review";
246
+ };
247
+ };
248
+ readonly worktree: string;
249
+ readonly branch: string;
250
+ } | {
251
+ readonly kind: "work.admit";
252
+ readonly repository: string;
253
+ readonly pullRequest: number;
254
+ readonly reviewUrl: string;
255
+ readonly goalId: string;
256
+ readonly laneId: string;
257
+ readonly operationId: string;
258
+ readonly expectedAbsenceToken: string;
259
+ readonly head: string;
260
+ readonly baseHead: string;
261
+ readonly owner: {
262
+ readonly id: string;
263
+ readonly name: string;
264
+ };
265
+ readonly sessionId: string;
266
+ readonly expectedWork: string;
267
+ readonly worker: {
268
+ readonly host: string;
269
+ readonly agentId: string;
270
+ readonly name: string;
271
+ readonly paneId: string;
272
+ readonly relationship?: {
273
+ readonly parentAgentId: string;
274
+ readonly relation: "delegated" | "pair" | "review";
275
+ };
276
+ };
277
+ readonly worktree: string;
278
+ readonly branch: string;
279
+ readonly title: string;
280
+ readonly summary: string;
281
+ readonly detail: string;
282
+ } | {
283
+ readonly kind: "work.recover";
284
+ readonly repository: string;
285
+ readonly pullRequest: number;
286
+ readonly reviewUrl: string;
287
+ readonly goalId: string;
288
+ readonly laneId: string;
289
+ readonly operationId: string;
290
+ readonly expectedGoalEventId: string;
291
+ readonly expectedGoalUpdatedAt: number;
292
+ readonly expectedHistoryToken: string;
293
+ readonly head: string;
294
+ readonly baseHead: string;
295
+ readonly owner: {
296
+ readonly id: string;
297
+ readonly name: string;
298
+ };
299
+ readonly sessionId: string;
300
+ readonly expectedWork: string;
301
+ readonly worker: {
302
+ readonly host: string;
303
+ readonly agentId: string;
304
+ readonly name: string;
305
+ readonly paneId: string;
306
+ readonly relationship?: {
307
+ readonly parentAgentId: string;
308
+ readonly relation: "delegated" | "pair" | "review";
309
+ };
310
+ };
311
+ readonly worktree: string;
312
+ readonly branch: string;
313
+ } | {
314
+ readonly kind: "work.reassign";
315
+ readonly goalId: string;
316
+ readonly from: {
317
+ readonly id: string;
318
+ readonly name: string;
319
+ };
320
+ readonly to: {
321
+ readonly id: string;
322
+ readonly name: string;
323
+ };
324
+ readonly toAgent: {
325
+ readonly _tag: "clear";
326
+ } | {
327
+ readonly _tag: "keep";
328
+ } | {
329
+ readonly _tag: "set";
330
+ readonly agent: {
331
+ readonly host: string;
332
+ readonly agentId: string;
333
+ readonly name: string;
334
+ readonly paneId: string;
335
+ readonly relationship?: {
336
+ readonly parentAgentId: string;
337
+ readonly relation: "delegated" | "pair" | "review";
338
+ };
339
+ };
340
+ };
341
+ readonly reason: string;
342
+ readonly expectedGoalEventId: string;
343
+ readonly expectedGoalUpdatedAt: number;
344
+ } | {
345
+ readonly kind: "browser.mcp.recover";
346
+ } | {
347
+ readonly kind: "nix.check";
348
+ } | {
349
+ readonly kind: "nix.apply";
350
+ readonly ref: string;
101
351
  } | {
102
352
  readonly kind: "agent.message";
103
353
  readonly session: string;
104
354
  readonly message: string;
105
- } | {
106
- readonly kind: "browser.mcp.recover";
107
355
  };
108
356
  readonly result: string | null;
357
+ readonly acceptedReceipt?: string | null;
358
+ readonly durableOperation?: true;
109
359
  readonly error: string | null;
110
360
  readonly worker?: {
111
361
  readonly host: string;
@@ -123,7 +373,7 @@ export declare const makeHerdrTerminalConnector: (config: {
123
373
  readonly url: string;
124
374
  };
125
375
  readonly workerTerminalObservedAt?: number | null;
126
- }, import("@knpkv/herdr-fleet").FleetJobConflictError | import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
376
+ }, import("@knpkv/herdr-fleet").FleetJobConflictError | import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetOperationUnavailableError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
127
377
  approve: (jobId: string, approval: import("@knpkv/herdr-fleet").Approval, actor: string) => Effect.Effect<{
128
378
  readonly id: string;
129
379
  readonly createdAt: number;
@@ -139,24 +389,150 @@ export declare const makeHerdrTerminalConnector: (config: {
139
389
  readonly expiredAt?: number | null;
140
390
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
141
391
  readonly payload: {
142
- readonly kind: "nix.check";
143
- } | {
144
- readonly kind: "nix.apply";
145
- readonly ref: string;
146
- } | {
147
392
  readonly kind: "agent.delegate";
148
393
  readonly repository: string;
149
394
  readonly prompt: string;
150
- readonly mode: "consult" | "review" | "work";
395
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
151
396
  readonly channel?: "coordinator_chat";
397
+ } | {
398
+ readonly kind: "work.reconcile";
399
+ readonly repository: string;
400
+ readonly pullRequest: number;
401
+ readonly goalId: string;
402
+ readonly laneId: string;
403
+ readonly operationId: string;
404
+ readonly expectedRevision: number;
405
+ readonly expectedHead: string;
406
+ readonly newHead: string;
407
+ readonly expectedOwner: {
408
+ readonly id: string;
409
+ readonly name: string;
410
+ };
411
+ readonly expectedGoalEventId: string;
412
+ readonly bindingDispatchRequestId: string;
413
+ readonly sessionId: string;
414
+ readonly expectedWork: string;
415
+ readonly worker: {
416
+ readonly host: string;
417
+ readonly agentId: string;
418
+ readonly name: string;
419
+ readonly paneId: string;
420
+ readonly relationship?: {
421
+ readonly parentAgentId: string;
422
+ readonly relation: "delegated" | "pair" | "review";
423
+ };
424
+ };
425
+ readonly worktree: string;
426
+ readonly branch: string;
427
+ } | {
428
+ readonly kind: "work.admit";
429
+ readonly repository: string;
430
+ readonly pullRequest: number;
431
+ readonly reviewUrl: string;
432
+ readonly goalId: string;
433
+ readonly laneId: string;
434
+ readonly operationId: string;
435
+ readonly expectedAbsenceToken: string;
436
+ readonly head: string;
437
+ readonly baseHead: string;
438
+ readonly owner: {
439
+ readonly id: string;
440
+ readonly name: string;
441
+ };
442
+ readonly sessionId: string;
443
+ readonly expectedWork: string;
444
+ readonly worker: {
445
+ readonly host: string;
446
+ readonly agentId: string;
447
+ readonly name: string;
448
+ readonly paneId: string;
449
+ readonly relationship?: {
450
+ readonly parentAgentId: string;
451
+ readonly relation: "delegated" | "pair" | "review";
452
+ };
453
+ };
454
+ readonly worktree: string;
455
+ readonly branch: string;
456
+ readonly title: string;
457
+ readonly summary: string;
458
+ readonly detail: string;
459
+ } | {
460
+ readonly kind: "work.recover";
461
+ readonly repository: string;
462
+ readonly pullRequest: number;
463
+ readonly reviewUrl: string;
464
+ readonly goalId: string;
465
+ readonly laneId: string;
466
+ readonly operationId: string;
467
+ readonly expectedGoalEventId: string;
468
+ readonly expectedGoalUpdatedAt: number;
469
+ readonly expectedHistoryToken: string;
470
+ readonly head: string;
471
+ readonly baseHead: string;
472
+ readonly owner: {
473
+ readonly id: string;
474
+ readonly name: string;
475
+ };
476
+ readonly sessionId: string;
477
+ readonly expectedWork: string;
478
+ readonly worker: {
479
+ readonly host: string;
480
+ readonly agentId: string;
481
+ readonly name: string;
482
+ readonly paneId: string;
483
+ readonly relationship?: {
484
+ readonly parentAgentId: string;
485
+ readonly relation: "delegated" | "pair" | "review";
486
+ };
487
+ };
488
+ readonly worktree: string;
489
+ readonly branch: string;
490
+ } | {
491
+ readonly kind: "work.reassign";
492
+ readonly goalId: string;
493
+ readonly from: {
494
+ readonly id: string;
495
+ readonly name: string;
496
+ };
497
+ readonly to: {
498
+ readonly id: string;
499
+ readonly name: string;
500
+ };
501
+ readonly toAgent: {
502
+ readonly _tag: "clear";
503
+ } | {
504
+ readonly _tag: "keep";
505
+ } | {
506
+ readonly _tag: "set";
507
+ readonly agent: {
508
+ readonly host: string;
509
+ readonly agentId: string;
510
+ readonly name: string;
511
+ readonly paneId: string;
512
+ readonly relationship?: {
513
+ readonly parentAgentId: string;
514
+ readonly relation: "delegated" | "pair" | "review";
515
+ };
516
+ };
517
+ };
518
+ readonly reason: string;
519
+ readonly expectedGoalEventId: string;
520
+ readonly expectedGoalUpdatedAt: number;
521
+ } | {
522
+ readonly kind: "browser.mcp.recover";
523
+ } | {
524
+ readonly kind: "nix.check";
525
+ } | {
526
+ readonly kind: "nix.apply";
527
+ readonly ref: string;
152
528
  } | {
153
529
  readonly kind: "agent.message";
154
530
  readonly session: string;
155
531
  readonly message: string;
156
- } | {
157
- readonly kind: "browser.mcp.recover";
158
532
  };
159
533
  readonly result: string | null;
534
+ readonly acceptedReceipt?: string | null;
535
+ readonly durableOperation?: true;
160
536
  readonly error: string | null;
161
537
  readonly worker?: {
162
538
  readonly host: string;
@@ -190,24 +566,150 @@ export declare const makeHerdrTerminalConnector: (config: {
190
566
  readonly expiredAt?: number | null;
191
567
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
192
568
  readonly payload: {
193
- readonly kind: "nix.check";
194
- } | {
195
- readonly kind: "nix.apply";
196
- readonly ref: string;
197
- } | {
198
569
  readonly kind: "agent.delegate";
199
570
  readonly repository: string;
200
571
  readonly prompt: string;
201
- readonly mode: "consult" | "review" | "work";
572
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
202
573
  readonly channel?: "coordinator_chat";
574
+ } | {
575
+ readonly kind: "work.reconcile";
576
+ readonly repository: string;
577
+ readonly pullRequest: number;
578
+ readonly goalId: string;
579
+ readonly laneId: string;
580
+ readonly operationId: string;
581
+ readonly expectedRevision: number;
582
+ readonly expectedHead: string;
583
+ readonly newHead: string;
584
+ readonly expectedOwner: {
585
+ readonly id: string;
586
+ readonly name: string;
587
+ };
588
+ readonly expectedGoalEventId: string;
589
+ readonly bindingDispatchRequestId: string;
590
+ readonly sessionId: string;
591
+ readonly expectedWork: string;
592
+ readonly worker: {
593
+ readonly host: string;
594
+ readonly agentId: string;
595
+ readonly name: string;
596
+ readonly paneId: string;
597
+ readonly relationship?: {
598
+ readonly parentAgentId: string;
599
+ readonly relation: "delegated" | "pair" | "review";
600
+ };
601
+ };
602
+ readonly worktree: string;
603
+ readonly branch: string;
604
+ } | {
605
+ readonly kind: "work.admit";
606
+ readonly repository: string;
607
+ readonly pullRequest: number;
608
+ readonly reviewUrl: string;
609
+ readonly goalId: string;
610
+ readonly laneId: string;
611
+ readonly operationId: string;
612
+ readonly expectedAbsenceToken: string;
613
+ readonly head: string;
614
+ readonly baseHead: string;
615
+ readonly owner: {
616
+ readonly id: string;
617
+ readonly name: string;
618
+ };
619
+ readonly sessionId: string;
620
+ readonly expectedWork: string;
621
+ readonly worker: {
622
+ readonly host: string;
623
+ readonly agentId: string;
624
+ readonly name: string;
625
+ readonly paneId: string;
626
+ readonly relationship?: {
627
+ readonly parentAgentId: string;
628
+ readonly relation: "delegated" | "pair" | "review";
629
+ };
630
+ };
631
+ readonly worktree: string;
632
+ readonly branch: string;
633
+ readonly title: string;
634
+ readonly summary: string;
635
+ readonly detail: string;
636
+ } | {
637
+ readonly kind: "work.recover";
638
+ readonly repository: string;
639
+ readonly pullRequest: number;
640
+ readonly reviewUrl: string;
641
+ readonly goalId: string;
642
+ readonly laneId: string;
643
+ readonly operationId: string;
644
+ readonly expectedGoalEventId: string;
645
+ readonly expectedGoalUpdatedAt: number;
646
+ readonly expectedHistoryToken: string;
647
+ readonly head: string;
648
+ readonly baseHead: string;
649
+ readonly owner: {
650
+ readonly id: string;
651
+ readonly name: string;
652
+ };
653
+ readonly sessionId: string;
654
+ readonly expectedWork: string;
655
+ readonly worker: {
656
+ readonly host: string;
657
+ readonly agentId: string;
658
+ readonly name: string;
659
+ readonly paneId: string;
660
+ readonly relationship?: {
661
+ readonly parentAgentId: string;
662
+ readonly relation: "delegated" | "pair" | "review";
663
+ };
664
+ };
665
+ readonly worktree: string;
666
+ readonly branch: string;
667
+ } | {
668
+ readonly kind: "work.reassign";
669
+ readonly goalId: string;
670
+ readonly from: {
671
+ readonly id: string;
672
+ readonly name: string;
673
+ };
674
+ readonly to: {
675
+ readonly id: string;
676
+ readonly name: string;
677
+ };
678
+ readonly toAgent: {
679
+ readonly _tag: "clear";
680
+ } | {
681
+ readonly _tag: "keep";
682
+ } | {
683
+ readonly _tag: "set";
684
+ readonly agent: {
685
+ readonly host: string;
686
+ readonly agentId: string;
687
+ readonly name: string;
688
+ readonly paneId: string;
689
+ readonly relationship?: {
690
+ readonly parentAgentId: string;
691
+ readonly relation: "delegated" | "pair" | "review";
692
+ };
693
+ };
694
+ };
695
+ readonly reason: string;
696
+ readonly expectedGoalEventId: string;
697
+ readonly expectedGoalUpdatedAt: number;
698
+ } | {
699
+ readonly kind: "browser.mcp.recover";
700
+ } | {
701
+ readonly kind: "nix.check";
702
+ } | {
703
+ readonly kind: "nix.apply";
704
+ readonly ref: string;
203
705
  } | {
204
706
  readonly kind: "agent.message";
205
707
  readonly session: string;
206
708
  readonly message: string;
207
- } | {
208
- readonly kind: "browser.mcp.recover";
209
709
  };
210
710
  readonly result: string | null;
711
+ readonly acceptedReceipt?: string | null;
712
+ readonly durableOperation?: true;
211
713
  readonly error: string | null;
212
714
  readonly worker?: {
213
715
  readonly host: string;
@@ -241,24 +743,150 @@ export declare const makeHerdrTerminalConnector: (config: {
241
743
  readonly expiredAt?: number | null;
242
744
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
243
745
  readonly payload: {
244
- readonly kind: "nix.check";
245
- } | {
246
- readonly kind: "nix.apply";
247
- readonly ref: string;
248
- } | {
249
746
  readonly kind: "agent.delegate";
250
747
  readonly repository: string;
251
748
  readonly prompt: string;
252
- readonly mode: "consult" | "review" | "work";
749
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
253
750
  readonly channel?: "coordinator_chat";
751
+ } | {
752
+ readonly kind: "work.reconcile";
753
+ readonly repository: string;
754
+ readonly pullRequest: number;
755
+ readonly goalId: string;
756
+ readonly laneId: string;
757
+ readonly operationId: string;
758
+ readonly expectedRevision: number;
759
+ readonly expectedHead: string;
760
+ readonly newHead: string;
761
+ readonly expectedOwner: {
762
+ readonly id: string;
763
+ readonly name: string;
764
+ };
765
+ readonly expectedGoalEventId: string;
766
+ readonly bindingDispatchRequestId: string;
767
+ readonly sessionId: string;
768
+ readonly expectedWork: string;
769
+ readonly worker: {
770
+ readonly host: string;
771
+ readonly agentId: string;
772
+ readonly name: string;
773
+ readonly paneId: string;
774
+ readonly relationship?: {
775
+ readonly parentAgentId: string;
776
+ readonly relation: "delegated" | "pair" | "review";
777
+ };
778
+ };
779
+ readonly worktree: string;
780
+ readonly branch: string;
781
+ } | {
782
+ readonly kind: "work.admit";
783
+ readonly repository: string;
784
+ readonly pullRequest: number;
785
+ readonly reviewUrl: string;
786
+ readonly goalId: string;
787
+ readonly laneId: string;
788
+ readonly operationId: string;
789
+ readonly expectedAbsenceToken: string;
790
+ readonly head: string;
791
+ readonly baseHead: string;
792
+ readonly owner: {
793
+ readonly id: string;
794
+ readonly name: string;
795
+ };
796
+ readonly sessionId: string;
797
+ readonly expectedWork: string;
798
+ readonly worker: {
799
+ readonly host: string;
800
+ readonly agentId: string;
801
+ readonly name: string;
802
+ readonly paneId: string;
803
+ readonly relationship?: {
804
+ readonly parentAgentId: string;
805
+ readonly relation: "delegated" | "pair" | "review";
806
+ };
807
+ };
808
+ readonly worktree: string;
809
+ readonly branch: string;
810
+ readonly title: string;
811
+ readonly summary: string;
812
+ readonly detail: string;
813
+ } | {
814
+ readonly kind: "work.recover";
815
+ readonly repository: string;
816
+ readonly pullRequest: number;
817
+ readonly reviewUrl: string;
818
+ readonly goalId: string;
819
+ readonly laneId: string;
820
+ readonly operationId: string;
821
+ readonly expectedGoalEventId: string;
822
+ readonly expectedGoalUpdatedAt: number;
823
+ readonly expectedHistoryToken: string;
824
+ readonly head: string;
825
+ readonly baseHead: string;
826
+ readonly owner: {
827
+ readonly id: string;
828
+ readonly name: string;
829
+ };
830
+ readonly sessionId: string;
831
+ readonly expectedWork: string;
832
+ readonly worker: {
833
+ readonly host: string;
834
+ readonly agentId: string;
835
+ readonly name: string;
836
+ readonly paneId: string;
837
+ readonly relationship?: {
838
+ readonly parentAgentId: string;
839
+ readonly relation: "delegated" | "pair" | "review";
840
+ };
841
+ };
842
+ readonly worktree: string;
843
+ readonly branch: string;
844
+ } | {
845
+ readonly kind: "work.reassign";
846
+ readonly goalId: string;
847
+ readonly from: {
848
+ readonly id: string;
849
+ readonly name: string;
850
+ };
851
+ readonly to: {
852
+ readonly id: string;
853
+ readonly name: string;
854
+ };
855
+ readonly toAgent: {
856
+ readonly _tag: "clear";
857
+ } | {
858
+ readonly _tag: "keep";
859
+ } | {
860
+ readonly _tag: "set";
861
+ readonly agent: {
862
+ readonly host: string;
863
+ readonly agentId: string;
864
+ readonly name: string;
865
+ readonly paneId: string;
866
+ readonly relationship?: {
867
+ readonly parentAgentId: string;
868
+ readonly relation: "delegated" | "pair" | "review";
869
+ };
870
+ };
871
+ };
872
+ readonly reason: string;
873
+ readonly expectedGoalEventId: string;
874
+ readonly expectedGoalUpdatedAt: number;
875
+ } | {
876
+ readonly kind: "browser.mcp.recover";
877
+ } | {
878
+ readonly kind: "nix.check";
879
+ } | {
880
+ readonly kind: "nix.apply";
881
+ readonly ref: string;
254
882
  } | {
255
883
  readonly kind: "agent.message";
256
884
  readonly session: string;
257
885
  readonly message: string;
258
- } | {
259
- readonly kind: "browser.mcp.recover";
260
886
  };
261
887
  readonly result: string | null;
888
+ readonly acceptedReceipt?: string | null;
889
+ readonly durableOperation?: true;
262
890
  readonly error: string | null;
263
891
  readonly worker?: {
264
892
  readonly host: string;
@@ -276,7 +904,7 @@ export declare const makeHerdrTerminalConnector: (config: {
276
904
  readonly url: string;
277
905
  };
278
906
  readonly workerTerminalObservedAt?: number | null;
279
- }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
907
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
280
908
  runCoordinatorChat: (jobId: string) => Effect.Effect<{
281
909
  readonly id: string;
282
910
  readonly createdAt: number;
@@ -292,24 +920,150 @@ export declare const makeHerdrTerminalConnector: (config: {
292
920
  readonly expiredAt?: number | null;
293
921
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
294
922
  readonly payload: {
295
- readonly kind: "nix.check";
296
- } | {
297
- readonly kind: "nix.apply";
298
- readonly ref: string;
299
- } | {
300
923
  readonly kind: "agent.delegate";
301
924
  readonly repository: string;
302
925
  readonly prompt: string;
303
- readonly mode: "consult" | "review" | "work";
926
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
304
927
  readonly channel?: "coordinator_chat";
928
+ } | {
929
+ readonly kind: "work.reconcile";
930
+ readonly repository: string;
931
+ readonly pullRequest: number;
932
+ readonly goalId: string;
933
+ readonly laneId: string;
934
+ readonly operationId: string;
935
+ readonly expectedRevision: number;
936
+ readonly expectedHead: string;
937
+ readonly newHead: string;
938
+ readonly expectedOwner: {
939
+ readonly id: string;
940
+ readonly name: string;
941
+ };
942
+ readonly expectedGoalEventId: string;
943
+ readonly bindingDispatchRequestId: string;
944
+ readonly sessionId: string;
945
+ readonly expectedWork: string;
946
+ readonly worker: {
947
+ readonly host: string;
948
+ readonly agentId: string;
949
+ readonly name: string;
950
+ readonly paneId: string;
951
+ readonly relationship?: {
952
+ readonly parentAgentId: string;
953
+ readonly relation: "delegated" | "pair" | "review";
954
+ };
955
+ };
956
+ readonly worktree: string;
957
+ readonly branch: string;
958
+ } | {
959
+ readonly kind: "work.admit";
960
+ readonly repository: string;
961
+ readonly pullRequest: number;
962
+ readonly reviewUrl: string;
963
+ readonly goalId: string;
964
+ readonly laneId: string;
965
+ readonly operationId: string;
966
+ readonly expectedAbsenceToken: string;
967
+ readonly head: string;
968
+ readonly baseHead: string;
969
+ readonly owner: {
970
+ readonly id: string;
971
+ readonly name: string;
972
+ };
973
+ readonly sessionId: string;
974
+ readonly expectedWork: string;
975
+ readonly worker: {
976
+ readonly host: string;
977
+ readonly agentId: string;
978
+ readonly name: string;
979
+ readonly paneId: string;
980
+ readonly relationship?: {
981
+ readonly parentAgentId: string;
982
+ readonly relation: "delegated" | "pair" | "review";
983
+ };
984
+ };
985
+ readonly worktree: string;
986
+ readonly branch: string;
987
+ readonly title: string;
988
+ readonly summary: string;
989
+ readonly detail: string;
990
+ } | {
991
+ readonly kind: "work.recover";
992
+ readonly repository: string;
993
+ readonly pullRequest: number;
994
+ readonly reviewUrl: string;
995
+ readonly goalId: string;
996
+ readonly laneId: string;
997
+ readonly operationId: string;
998
+ readonly expectedGoalEventId: string;
999
+ readonly expectedGoalUpdatedAt: number;
1000
+ readonly expectedHistoryToken: string;
1001
+ readonly head: string;
1002
+ readonly baseHead: string;
1003
+ readonly owner: {
1004
+ readonly id: string;
1005
+ readonly name: string;
1006
+ };
1007
+ readonly sessionId: string;
1008
+ readonly expectedWork: string;
1009
+ readonly worker: {
1010
+ readonly host: string;
1011
+ readonly agentId: string;
1012
+ readonly name: string;
1013
+ readonly paneId: string;
1014
+ readonly relationship?: {
1015
+ readonly parentAgentId: string;
1016
+ readonly relation: "delegated" | "pair" | "review";
1017
+ };
1018
+ };
1019
+ readonly worktree: string;
1020
+ readonly branch: string;
1021
+ } | {
1022
+ readonly kind: "work.reassign";
1023
+ readonly goalId: string;
1024
+ readonly from: {
1025
+ readonly id: string;
1026
+ readonly name: string;
1027
+ };
1028
+ readonly to: {
1029
+ readonly id: string;
1030
+ readonly name: string;
1031
+ };
1032
+ readonly toAgent: {
1033
+ readonly _tag: "clear";
1034
+ } | {
1035
+ readonly _tag: "keep";
1036
+ } | {
1037
+ readonly _tag: "set";
1038
+ readonly agent: {
1039
+ readonly host: string;
1040
+ readonly agentId: string;
1041
+ readonly name: string;
1042
+ readonly paneId: string;
1043
+ readonly relationship?: {
1044
+ readonly parentAgentId: string;
1045
+ readonly relation: "delegated" | "pair" | "review";
1046
+ };
1047
+ };
1048
+ };
1049
+ readonly reason: string;
1050
+ readonly expectedGoalEventId: string;
1051
+ readonly expectedGoalUpdatedAt: number;
1052
+ } | {
1053
+ readonly kind: "browser.mcp.recover";
1054
+ } | {
1055
+ readonly kind: "nix.check";
1056
+ } | {
1057
+ readonly kind: "nix.apply";
1058
+ readonly ref: string;
305
1059
  } | {
306
1060
  readonly kind: "agent.message";
307
1061
  readonly session: string;
308
1062
  readonly message: string;
309
- } | {
310
- readonly kind: "browser.mcp.recover";
311
1063
  };
312
1064
  readonly result: string | null;
1065
+ readonly acceptedReceipt?: string | null;
1066
+ readonly durableOperation?: true;
313
1067
  readonly error: string | null;
314
1068
  readonly worker?: {
315
1069
  readonly host: string;
@@ -327,7 +1081,7 @@ export declare const makeHerdrTerminalConnector: (config: {
327
1081
  readonly url: string;
328
1082
  };
329
1083
  readonly workerTerminalObservedAt?: number | null;
330
- }, 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>;
1084
+ }, import("@knpkv/herdr-fleet").FleetApprovalError | import("@knpkv/herdr-fleet").FleetJobNotFoundError | import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError | import("@knpkv/herdr-fleet").FleetValidationError, never>;
331
1085
  get: (jobId: string) => Effect.Effect<{
332
1086
  readonly id: string;
333
1087
  readonly createdAt: number;
@@ -343,24 +1097,150 @@ export declare const makeHerdrTerminalConnector: (config: {
343
1097
  readonly expiredAt?: number | null;
344
1098
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
345
1099
  readonly payload: {
346
- readonly kind: "nix.check";
347
- } | {
348
- readonly kind: "nix.apply";
349
- readonly ref: string;
350
- } | {
351
1100
  readonly kind: "agent.delegate";
352
1101
  readonly repository: string;
353
1102
  readonly prompt: string;
354
- readonly mode: "consult" | "review" | "work";
1103
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
355
1104
  readonly channel?: "coordinator_chat";
1105
+ } | {
1106
+ readonly kind: "work.reconcile";
1107
+ readonly repository: string;
1108
+ readonly pullRequest: number;
1109
+ readonly goalId: string;
1110
+ readonly laneId: string;
1111
+ readonly operationId: string;
1112
+ readonly expectedRevision: number;
1113
+ readonly expectedHead: string;
1114
+ readonly newHead: string;
1115
+ readonly expectedOwner: {
1116
+ readonly id: string;
1117
+ readonly name: string;
1118
+ };
1119
+ readonly expectedGoalEventId: string;
1120
+ readonly bindingDispatchRequestId: string;
1121
+ readonly sessionId: string;
1122
+ readonly expectedWork: string;
1123
+ readonly worker: {
1124
+ readonly host: string;
1125
+ readonly agentId: string;
1126
+ readonly name: string;
1127
+ readonly paneId: string;
1128
+ readonly relationship?: {
1129
+ readonly parentAgentId: string;
1130
+ readonly relation: "delegated" | "pair" | "review";
1131
+ };
1132
+ };
1133
+ readonly worktree: string;
1134
+ readonly branch: string;
1135
+ } | {
1136
+ readonly kind: "work.admit";
1137
+ readonly repository: string;
1138
+ readonly pullRequest: number;
1139
+ readonly reviewUrl: string;
1140
+ readonly goalId: string;
1141
+ readonly laneId: string;
1142
+ readonly operationId: string;
1143
+ readonly expectedAbsenceToken: string;
1144
+ readonly head: string;
1145
+ readonly baseHead: string;
1146
+ readonly owner: {
1147
+ readonly id: string;
1148
+ readonly name: string;
1149
+ };
1150
+ readonly sessionId: string;
1151
+ readonly expectedWork: string;
1152
+ readonly worker: {
1153
+ readonly host: string;
1154
+ readonly agentId: string;
1155
+ readonly name: string;
1156
+ readonly paneId: string;
1157
+ readonly relationship?: {
1158
+ readonly parentAgentId: string;
1159
+ readonly relation: "delegated" | "pair" | "review";
1160
+ };
1161
+ };
1162
+ readonly worktree: string;
1163
+ readonly branch: string;
1164
+ readonly title: string;
1165
+ readonly summary: string;
1166
+ readonly detail: string;
1167
+ } | {
1168
+ readonly kind: "work.recover";
1169
+ readonly repository: string;
1170
+ readonly pullRequest: number;
1171
+ readonly reviewUrl: string;
1172
+ readonly goalId: string;
1173
+ readonly laneId: string;
1174
+ readonly operationId: string;
1175
+ readonly expectedGoalEventId: string;
1176
+ readonly expectedGoalUpdatedAt: number;
1177
+ readonly expectedHistoryToken: string;
1178
+ readonly head: string;
1179
+ readonly baseHead: string;
1180
+ readonly owner: {
1181
+ readonly id: string;
1182
+ readonly name: string;
1183
+ };
1184
+ readonly sessionId: string;
1185
+ readonly expectedWork: string;
1186
+ readonly worker: {
1187
+ readonly host: string;
1188
+ readonly agentId: string;
1189
+ readonly name: string;
1190
+ readonly paneId: string;
1191
+ readonly relationship?: {
1192
+ readonly parentAgentId: string;
1193
+ readonly relation: "delegated" | "pair" | "review";
1194
+ };
1195
+ };
1196
+ readonly worktree: string;
1197
+ readonly branch: string;
1198
+ } | {
1199
+ readonly kind: "work.reassign";
1200
+ readonly goalId: string;
1201
+ readonly from: {
1202
+ readonly id: string;
1203
+ readonly name: string;
1204
+ };
1205
+ readonly to: {
1206
+ readonly id: string;
1207
+ readonly name: string;
1208
+ };
1209
+ readonly toAgent: {
1210
+ readonly _tag: "clear";
1211
+ } | {
1212
+ readonly _tag: "keep";
1213
+ } | {
1214
+ readonly _tag: "set";
1215
+ readonly agent: {
1216
+ readonly host: string;
1217
+ readonly agentId: string;
1218
+ readonly name: string;
1219
+ readonly paneId: string;
1220
+ readonly relationship?: {
1221
+ readonly parentAgentId: string;
1222
+ readonly relation: "delegated" | "pair" | "review";
1223
+ };
1224
+ };
1225
+ };
1226
+ readonly reason: string;
1227
+ readonly expectedGoalEventId: string;
1228
+ readonly expectedGoalUpdatedAt: number;
1229
+ } | {
1230
+ readonly kind: "browser.mcp.recover";
1231
+ } | {
1232
+ readonly kind: "nix.check";
1233
+ } | {
1234
+ readonly kind: "nix.apply";
1235
+ readonly ref: string;
356
1236
  } | {
357
1237
  readonly kind: "agent.message";
358
1238
  readonly session: string;
359
1239
  readonly message: string;
360
- } | {
361
- readonly kind: "browser.mcp.recover";
362
1240
  };
363
1241
  readonly result: string | null;
1242
+ readonly acceptedReceipt?: string | null;
1243
+ readonly durableOperation?: true;
364
1244
  readonly error: string | null;
365
1245
  readonly worker?: {
366
1246
  readonly host: string;
@@ -394,24 +1274,150 @@ export declare const makeHerdrTerminalConnector: (config: {
394
1274
  readonly expiredAt?: number | null;
395
1275
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
396
1276
  readonly payload: {
1277
+ readonly kind: "agent.delegate";
1278
+ readonly repository: string;
1279
+ readonly prompt: string;
1280
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
1281
+ readonly channel?: "coordinator_chat";
1282
+ } | {
1283
+ readonly kind: "work.reconcile";
1284
+ readonly repository: string;
1285
+ readonly pullRequest: number;
1286
+ readonly goalId: string;
1287
+ readonly laneId: string;
1288
+ readonly operationId: string;
1289
+ readonly expectedRevision: number;
1290
+ readonly expectedHead: string;
1291
+ readonly newHead: string;
1292
+ readonly expectedOwner: {
1293
+ readonly id: string;
1294
+ readonly name: string;
1295
+ };
1296
+ readonly expectedGoalEventId: string;
1297
+ readonly bindingDispatchRequestId: string;
1298
+ readonly sessionId: string;
1299
+ readonly expectedWork: string;
1300
+ readonly worker: {
1301
+ readonly host: string;
1302
+ readonly agentId: string;
1303
+ readonly name: string;
1304
+ readonly paneId: string;
1305
+ readonly relationship?: {
1306
+ readonly parentAgentId: string;
1307
+ readonly relation: "delegated" | "pair" | "review";
1308
+ };
1309
+ };
1310
+ readonly worktree: string;
1311
+ readonly branch: string;
1312
+ } | {
1313
+ readonly kind: "work.admit";
1314
+ readonly repository: string;
1315
+ readonly pullRequest: number;
1316
+ readonly reviewUrl: string;
1317
+ readonly goalId: string;
1318
+ readonly laneId: string;
1319
+ readonly operationId: string;
1320
+ readonly expectedAbsenceToken: string;
1321
+ readonly head: string;
1322
+ readonly baseHead: string;
1323
+ readonly owner: {
1324
+ readonly id: string;
1325
+ readonly name: string;
1326
+ };
1327
+ readonly sessionId: string;
1328
+ readonly expectedWork: string;
1329
+ readonly worker: {
1330
+ readonly host: string;
1331
+ readonly agentId: string;
1332
+ readonly name: string;
1333
+ readonly paneId: string;
1334
+ readonly relationship?: {
1335
+ readonly parentAgentId: string;
1336
+ readonly relation: "delegated" | "pair" | "review";
1337
+ };
1338
+ };
1339
+ readonly worktree: string;
1340
+ readonly branch: string;
1341
+ readonly title: string;
1342
+ readonly summary: string;
1343
+ readonly detail: string;
1344
+ } | {
1345
+ readonly kind: "work.recover";
1346
+ readonly repository: string;
1347
+ readonly pullRequest: number;
1348
+ readonly reviewUrl: string;
1349
+ readonly goalId: string;
1350
+ readonly laneId: string;
1351
+ readonly operationId: string;
1352
+ readonly expectedGoalEventId: string;
1353
+ readonly expectedGoalUpdatedAt: number;
1354
+ readonly expectedHistoryToken: string;
1355
+ readonly head: string;
1356
+ readonly baseHead: string;
1357
+ readonly owner: {
1358
+ readonly id: string;
1359
+ readonly name: string;
1360
+ };
1361
+ readonly sessionId: string;
1362
+ readonly expectedWork: string;
1363
+ readonly worker: {
1364
+ readonly host: string;
1365
+ readonly agentId: string;
1366
+ readonly name: string;
1367
+ readonly paneId: string;
1368
+ readonly relationship?: {
1369
+ readonly parentAgentId: string;
1370
+ readonly relation: "delegated" | "pair" | "review";
1371
+ };
1372
+ };
1373
+ readonly worktree: string;
1374
+ readonly branch: string;
1375
+ } | {
1376
+ readonly kind: "work.reassign";
1377
+ readonly goalId: string;
1378
+ readonly from: {
1379
+ readonly id: string;
1380
+ readonly name: string;
1381
+ };
1382
+ readonly to: {
1383
+ readonly id: string;
1384
+ readonly name: string;
1385
+ };
1386
+ readonly toAgent: {
1387
+ readonly _tag: "clear";
1388
+ } | {
1389
+ readonly _tag: "keep";
1390
+ } | {
1391
+ readonly _tag: "set";
1392
+ readonly agent: {
1393
+ readonly host: string;
1394
+ readonly agentId: string;
1395
+ readonly name: string;
1396
+ readonly paneId: string;
1397
+ readonly relationship?: {
1398
+ readonly parentAgentId: string;
1399
+ readonly relation: "delegated" | "pair" | "review";
1400
+ };
1401
+ };
1402
+ };
1403
+ readonly reason: string;
1404
+ readonly expectedGoalEventId: string;
1405
+ readonly expectedGoalUpdatedAt: number;
1406
+ } | {
1407
+ readonly kind: "browser.mcp.recover";
1408
+ } | {
397
1409
  readonly kind: "nix.check";
398
1410
  } | {
399
1411
  readonly kind: "nix.apply";
400
1412
  readonly ref: string;
401
- } | {
402
- readonly kind: "agent.delegate";
403
- readonly repository: string;
404
- readonly prompt: string;
405
- readonly mode: "consult" | "review" | "work";
406
- readonly channel?: "coordinator_chat";
407
1413
  } | {
408
1414
  readonly kind: "agent.message";
409
1415
  readonly session: string;
410
1416
  readonly message: string;
411
- } | {
412
- readonly kind: "browser.mcp.recover";
413
1417
  };
414
1418
  readonly result: string | null;
1419
+ readonly acceptedReceipt?: string | null;
1420
+ readonly durableOperation?: true;
415
1421
  readonly error: string | null;
416
1422
  readonly worker?: {
417
1423
  readonly host: string;
@@ -448,24 +1454,150 @@ export declare const makeHerdrTerminalConnector: (config: {
448
1454
  readonly expiredAt?: number | null;
449
1455
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
450
1456
  readonly payload: {
451
- readonly kind: "nix.check";
452
- } | {
453
- readonly kind: "nix.apply";
454
- readonly ref: string;
455
- } | {
456
1457
  readonly kind: "agent.delegate";
457
1458
  readonly repository: string;
458
1459
  readonly prompt: string;
459
- readonly mode: "consult" | "review" | "work";
1460
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
460
1461
  readonly channel?: "coordinator_chat";
1462
+ } | {
1463
+ readonly kind: "work.reconcile";
1464
+ readonly repository: string;
1465
+ readonly pullRequest: number;
1466
+ readonly goalId: string;
1467
+ readonly laneId: string;
1468
+ readonly operationId: string;
1469
+ readonly expectedRevision: number;
1470
+ readonly expectedHead: string;
1471
+ readonly newHead: string;
1472
+ readonly expectedOwner: {
1473
+ readonly id: string;
1474
+ readonly name: string;
1475
+ };
1476
+ readonly expectedGoalEventId: string;
1477
+ readonly bindingDispatchRequestId: string;
1478
+ readonly sessionId: string;
1479
+ readonly expectedWork: string;
1480
+ readonly worker: {
1481
+ readonly host: string;
1482
+ readonly agentId: string;
1483
+ readonly name: string;
1484
+ readonly paneId: string;
1485
+ readonly relationship?: {
1486
+ readonly parentAgentId: string;
1487
+ readonly relation: "delegated" | "pair" | "review";
1488
+ };
1489
+ };
1490
+ readonly worktree: string;
1491
+ readonly branch: string;
1492
+ } | {
1493
+ readonly kind: "work.admit";
1494
+ readonly repository: string;
1495
+ readonly pullRequest: number;
1496
+ readonly reviewUrl: string;
1497
+ readonly goalId: string;
1498
+ readonly laneId: string;
1499
+ readonly operationId: string;
1500
+ readonly expectedAbsenceToken: string;
1501
+ readonly head: string;
1502
+ readonly baseHead: string;
1503
+ readonly owner: {
1504
+ readonly id: string;
1505
+ readonly name: string;
1506
+ };
1507
+ readonly sessionId: string;
1508
+ readonly expectedWork: string;
1509
+ readonly worker: {
1510
+ readonly host: string;
1511
+ readonly agentId: string;
1512
+ readonly name: string;
1513
+ readonly paneId: string;
1514
+ readonly relationship?: {
1515
+ readonly parentAgentId: string;
1516
+ readonly relation: "delegated" | "pair" | "review";
1517
+ };
1518
+ };
1519
+ readonly worktree: string;
1520
+ readonly branch: string;
1521
+ readonly title: string;
1522
+ readonly summary: string;
1523
+ readonly detail: string;
1524
+ } | {
1525
+ readonly kind: "work.recover";
1526
+ readonly repository: string;
1527
+ readonly pullRequest: number;
1528
+ readonly reviewUrl: string;
1529
+ readonly goalId: string;
1530
+ readonly laneId: string;
1531
+ readonly operationId: string;
1532
+ readonly expectedGoalEventId: string;
1533
+ readonly expectedGoalUpdatedAt: number;
1534
+ readonly expectedHistoryToken: string;
1535
+ readonly head: string;
1536
+ readonly baseHead: string;
1537
+ readonly owner: {
1538
+ readonly id: string;
1539
+ readonly name: string;
1540
+ };
1541
+ readonly sessionId: string;
1542
+ readonly expectedWork: string;
1543
+ readonly worker: {
1544
+ readonly host: string;
1545
+ readonly agentId: string;
1546
+ readonly name: string;
1547
+ readonly paneId: string;
1548
+ readonly relationship?: {
1549
+ readonly parentAgentId: string;
1550
+ readonly relation: "delegated" | "pair" | "review";
1551
+ };
1552
+ };
1553
+ readonly worktree: string;
1554
+ readonly branch: string;
1555
+ } | {
1556
+ readonly kind: "work.reassign";
1557
+ readonly goalId: string;
1558
+ readonly from: {
1559
+ readonly id: string;
1560
+ readonly name: string;
1561
+ };
1562
+ readonly to: {
1563
+ readonly id: string;
1564
+ readonly name: string;
1565
+ };
1566
+ readonly toAgent: {
1567
+ readonly _tag: "clear";
1568
+ } | {
1569
+ readonly _tag: "keep";
1570
+ } | {
1571
+ readonly _tag: "set";
1572
+ readonly agent: {
1573
+ readonly host: string;
1574
+ readonly agentId: string;
1575
+ readonly name: string;
1576
+ readonly paneId: string;
1577
+ readonly relationship?: {
1578
+ readonly parentAgentId: string;
1579
+ readonly relation: "delegated" | "pair" | "review";
1580
+ };
1581
+ };
1582
+ };
1583
+ readonly reason: string;
1584
+ readonly expectedGoalEventId: string;
1585
+ readonly expectedGoalUpdatedAt: number;
1586
+ } | {
1587
+ readonly kind: "browser.mcp.recover";
1588
+ } | {
1589
+ readonly kind: "nix.check";
1590
+ } | {
1591
+ readonly kind: "nix.apply";
1592
+ readonly ref: string;
461
1593
  } | {
462
1594
  readonly kind: "agent.message";
463
1595
  readonly session: string;
464
1596
  readonly message: string;
465
- } | {
466
- readonly kind: "browser.mcp.recover";
467
1597
  };
468
1598
  readonly result: string | null;
1599
+ readonly acceptedReceipt?: string | null;
1600
+ readonly durableOperation?: true;
469
1601
  readonly error: string | null;
470
1602
  readonly worker?: {
471
1603
  readonly host: string;
@@ -503,24 +1635,150 @@ export declare const makeHerdrTerminalConnector: (config: {
503
1635
  readonly expiredAt?: number | null;
504
1636
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
505
1637
  readonly payload: {
506
- readonly kind: "nix.check";
507
- } | {
508
- readonly kind: "nix.apply";
509
- readonly ref: string;
510
- } | {
511
1638
  readonly kind: "agent.delegate";
512
1639
  readonly repository: string;
513
1640
  readonly prompt: string;
514
- readonly mode: "consult" | "review" | "work";
1641
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
515
1642
  readonly channel?: "coordinator_chat";
1643
+ } | {
1644
+ readonly kind: "work.reconcile";
1645
+ readonly repository: string;
1646
+ readonly pullRequest: number;
1647
+ readonly goalId: string;
1648
+ readonly laneId: string;
1649
+ readonly operationId: string;
1650
+ readonly expectedRevision: number;
1651
+ readonly expectedHead: string;
1652
+ readonly newHead: string;
1653
+ readonly expectedOwner: {
1654
+ readonly id: string;
1655
+ readonly name: string;
1656
+ };
1657
+ readonly expectedGoalEventId: string;
1658
+ readonly bindingDispatchRequestId: string;
1659
+ readonly sessionId: string;
1660
+ readonly expectedWork: string;
1661
+ readonly worker: {
1662
+ readonly host: string;
1663
+ readonly agentId: string;
1664
+ readonly name: string;
1665
+ readonly paneId: string;
1666
+ readonly relationship?: {
1667
+ readonly parentAgentId: string;
1668
+ readonly relation: "delegated" | "pair" | "review";
1669
+ };
1670
+ };
1671
+ readonly worktree: string;
1672
+ readonly branch: string;
1673
+ } | {
1674
+ readonly kind: "work.admit";
1675
+ readonly repository: string;
1676
+ readonly pullRequest: number;
1677
+ readonly reviewUrl: string;
1678
+ readonly goalId: string;
1679
+ readonly laneId: string;
1680
+ readonly operationId: string;
1681
+ readonly expectedAbsenceToken: string;
1682
+ readonly head: string;
1683
+ readonly baseHead: string;
1684
+ readonly owner: {
1685
+ readonly id: string;
1686
+ readonly name: string;
1687
+ };
1688
+ readonly sessionId: string;
1689
+ readonly expectedWork: string;
1690
+ readonly worker: {
1691
+ readonly host: string;
1692
+ readonly agentId: string;
1693
+ readonly name: string;
1694
+ readonly paneId: string;
1695
+ readonly relationship?: {
1696
+ readonly parentAgentId: string;
1697
+ readonly relation: "delegated" | "pair" | "review";
1698
+ };
1699
+ };
1700
+ readonly worktree: string;
1701
+ readonly branch: string;
1702
+ readonly title: string;
1703
+ readonly summary: string;
1704
+ readonly detail: string;
1705
+ } | {
1706
+ readonly kind: "work.recover";
1707
+ readonly repository: string;
1708
+ readonly pullRequest: number;
1709
+ readonly reviewUrl: string;
1710
+ readonly goalId: string;
1711
+ readonly laneId: string;
1712
+ readonly operationId: string;
1713
+ readonly expectedGoalEventId: string;
1714
+ readonly expectedGoalUpdatedAt: number;
1715
+ readonly expectedHistoryToken: string;
1716
+ readonly head: string;
1717
+ readonly baseHead: string;
1718
+ readonly owner: {
1719
+ readonly id: string;
1720
+ readonly name: string;
1721
+ };
1722
+ readonly sessionId: string;
1723
+ readonly expectedWork: string;
1724
+ readonly worker: {
1725
+ readonly host: string;
1726
+ readonly agentId: string;
1727
+ readonly name: string;
1728
+ readonly paneId: string;
1729
+ readonly relationship?: {
1730
+ readonly parentAgentId: string;
1731
+ readonly relation: "delegated" | "pair" | "review";
1732
+ };
1733
+ };
1734
+ readonly worktree: string;
1735
+ readonly branch: string;
1736
+ } | {
1737
+ readonly kind: "work.reassign";
1738
+ readonly goalId: string;
1739
+ readonly from: {
1740
+ readonly id: string;
1741
+ readonly name: string;
1742
+ };
1743
+ readonly to: {
1744
+ readonly id: string;
1745
+ readonly name: string;
1746
+ };
1747
+ readonly toAgent: {
1748
+ readonly _tag: "clear";
1749
+ } | {
1750
+ readonly _tag: "keep";
1751
+ } | {
1752
+ readonly _tag: "set";
1753
+ readonly agent: {
1754
+ readonly host: string;
1755
+ readonly agentId: string;
1756
+ readonly name: string;
1757
+ readonly paneId: string;
1758
+ readonly relationship?: {
1759
+ readonly parentAgentId: string;
1760
+ readonly relation: "delegated" | "pair" | "review";
1761
+ };
1762
+ };
1763
+ };
1764
+ readonly reason: string;
1765
+ readonly expectedGoalEventId: string;
1766
+ readonly expectedGoalUpdatedAt: number;
1767
+ } | {
1768
+ readonly kind: "browser.mcp.recover";
1769
+ } | {
1770
+ readonly kind: "nix.check";
1771
+ } | {
1772
+ readonly kind: "nix.apply";
1773
+ readonly ref: string;
516
1774
  } | {
517
1775
  readonly kind: "agent.message";
518
1776
  readonly session: string;
519
1777
  readonly message: string;
520
- } | {
521
- readonly kind: "browser.mcp.recover";
522
1778
  };
523
1779
  readonly result: string | null;
1780
+ readonly acceptedReceipt?: string | null;
1781
+ readonly durableOperation?: true;
524
1782
  readonly error: string | null;
525
1783
  readonly worker?: {
526
1784
  readonly host: string;
@@ -563,24 +1821,150 @@ export declare const makeHerdrTerminalConnector: (config: {
563
1821
  readonly expiredAt?: number | null;
564
1822
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
565
1823
  readonly payload: {
566
- readonly kind: "nix.check";
567
- } | {
568
- readonly kind: "nix.apply";
569
- readonly ref: string;
570
- } | {
571
1824
  readonly kind: "agent.delegate";
572
1825
  readonly repository: string;
573
1826
  readonly prompt: string;
574
- readonly mode: "consult" | "review" | "work";
1827
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
575
1828
  readonly channel?: "coordinator_chat";
1829
+ } | {
1830
+ readonly kind: "work.reconcile";
1831
+ readonly repository: string;
1832
+ readonly pullRequest: number;
1833
+ readonly goalId: string;
1834
+ readonly laneId: string;
1835
+ readonly operationId: string;
1836
+ readonly expectedRevision: number;
1837
+ readonly expectedHead: string;
1838
+ readonly newHead: string;
1839
+ readonly expectedOwner: {
1840
+ readonly id: string;
1841
+ readonly name: string;
1842
+ };
1843
+ readonly expectedGoalEventId: string;
1844
+ readonly bindingDispatchRequestId: string;
1845
+ readonly sessionId: string;
1846
+ readonly expectedWork: string;
1847
+ readonly worker: {
1848
+ readonly host: string;
1849
+ readonly agentId: string;
1850
+ readonly name: string;
1851
+ readonly paneId: string;
1852
+ readonly relationship?: {
1853
+ readonly parentAgentId: string;
1854
+ readonly relation: "delegated" | "pair" | "review";
1855
+ };
1856
+ };
1857
+ readonly worktree: string;
1858
+ readonly branch: string;
1859
+ } | {
1860
+ readonly kind: "work.admit";
1861
+ readonly repository: string;
1862
+ readonly pullRequest: number;
1863
+ readonly reviewUrl: string;
1864
+ readonly goalId: string;
1865
+ readonly laneId: string;
1866
+ readonly operationId: string;
1867
+ readonly expectedAbsenceToken: string;
1868
+ readonly head: string;
1869
+ readonly baseHead: string;
1870
+ readonly owner: {
1871
+ readonly id: string;
1872
+ readonly name: string;
1873
+ };
1874
+ readonly sessionId: string;
1875
+ readonly expectedWork: string;
1876
+ readonly worker: {
1877
+ readonly host: string;
1878
+ readonly agentId: string;
1879
+ readonly name: string;
1880
+ readonly paneId: string;
1881
+ readonly relationship?: {
1882
+ readonly parentAgentId: string;
1883
+ readonly relation: "delegated" | "pair" | "review";
1884
+ };
1885
+ };
1886
+ readonly worktree: string;
1887
+ readonly branch: string;
1888
+ readonly title: string;
1889
+ readonly summary: string;
1890
+ readonly detail: string;
1891
+ } | {
1892
+ readonly kind: "work.recover";
1893
+ readonly repository: string;
1894
+ readonly pullRequest: number;
1895
+ readonly reviewUrl: string;
1896
+ readonly goalId: string;
1897
+ readonly laneId: string;
1898
+ readonly operationId: string;
1899
+ readonly expectedGoalEventId: string;
1900
+ readonly expectedGoalUpdatedAt: number;
1901
+ readonly expectedHistoryToken: string;
1902
+ readonly head: string;
1903
+ readonly baseHead: string;
1904
+ readonly owner: {
1905
+ readonly id: string;
1906
+ readonly name: string;
1907
+ };
1908
+ readonly sessionId: string;
1909
+ readonly expectedWork: string;
1910
+ readonly worker: {
1911
+ readonly host: string;
1912
+ readonly agentId: string;
1913
+ readonly name: string;
1914
+ readonly paneId: string;
1915
+ readonly relationship?: {
1916
+ readonly parentAgentId: string;
1917
+ readonly relation: "delegated" | "pair" | "review";
1918
+ };
1919
+ };
1920
+ readonly worktree: string;
1921
+ readonly branch: string;
1922
+ } | {
1923
+ readonly kind: "work.reassign";
1924
+ readonly goalId: string;
1925
+ readonly from: {
1926
+ readonly id: string;
1927
+ readonly name: string;
1928
+ };
1929
+ readonly to: {
1930
+ readonly id: string;
1931
+ readonly name: string;
1932
+ };
1933
+ readonly toAgent: {
1934
+ readonly _tag: "clear";
1935
+ } | {
1936
+ readonly _tag: "keep";
1937
+ } | {
1938
+ readonly _tag: "set";
1939
+ readonly agent: {
1940
+ readonly host: string;
1941
+ readonly agentId: string;
1942
+ readonly name: string;
1943
+ readonly paneId: string;
1944
+ readonly relationship?: {
1945
+ readonly parentAgentId: string;
1946
+ readonly relation: "delegated" | "pair" | "review";
1947
+ };
1948
+ };
1949
+ };
1950
+ readonly reason: string;
1951
+ readonly expectedGoalEventId: string;
1952
+ readonly expectedGoalUpdatedAt: number;
1953
+ } | {
1954
+ readonly kind: "browser.mcp.recover";
1955
+ } | {
1956
+ readonly kind: "nix.check";
1957
+ } | {
1958
+ readonly kind: "nix.apply";
1959
+ readonly ref: string;
576
1960
  } | {
577
1961
  readonly kind: "agent.message";
578
1962
  readonly session: string;
579
1963
  readonly message: string;
580
- } | {
581
- readonly kind: "browser.mcp.recover";
582
1964
  };
583
1965
  readonly result: string | null;
1966
+ readonly acceptedReceipt?: string | null;
1967
+ readonly durableOperation?: true;
584
1968
  readonly error: string | null;
585
1969
  readonly worker?: {
586
1970
  readonly host: string;
@@ -619,24 +2003,150 @@ export declare const makeHerdrTerminalConnector: (config: {
619
2003
  readonly expiredAt?: number | null;
620
2004
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
621
2005
  readonly payload: {
622
- readonly kind: "nix.check";
623
- } | {
624
- readonly kind: "nix.apply";
625
- readonly ref: string;
626
- } | {
627
2006
  readonly kind: "agent.delegate";
628
2007
  readonly repository: string;
629
2008
  readonly prompt: string;
630
- readonly mode: "consult" | "review" | "work";
2009
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
631
2010
  readonly channel?: "coordinator_chat";
2011
+ } | {
2012
+ readonly kind: "work.reconcile";
2013
+ readonly repository: string;
2014
+ readonly pullRequest: number;
2015
+ readonly goalId: string;
2016
+ readonly laneId: string;
2017
+ readonly operationId: string;
2018
+ readonly expectedRevision: number;
2019
+ readonly expectedHead: string;
2020
+ readonly newHead: string;
2021
+ readonly expectedOwner: {
2022
+ readonly id: string;
2023
+ readonly name: string;
2024
+ };
2025
+ readonly expectedGoalEventId: string;
2026
+ readonly bindingDispatchRequestId: string;
2027
+ readonly sessionId: string;
2028
+ readonly expectedWork: string;
2029
+ readonly worker: {
2030
+ readonly host: string;
2031
+ readonly agentId: string;
2032
+ readonly name: string;
2033
+ readonly paneId: string;
2034
+ readonly relationship?: {
2035
+ readonly parentAgentId: string;
2036
+ readonly relation: "delegated" | "pair" | "review";
2037
+ };
2038
+ };
2039
+ readonly worktree: string;
2040
+ readonly branch: string;
2041
+ } | {
2042
+ readonly kind: "work.admit";
2043
+ readonly repository: string;
2044
+ readonly pullRequest: number;
2045
+ readonly reviewUrl: string;
2046
+ readonly goalId: string;
2047
+ readonly laneId: string;
2048
+ readonly operationId: string;
2049
+ readonly expectedAbsenceToken: string;
2050
+ readonly head: string;
2051
+ readonly baseHead: string;
2052
+ readonly owner: {
2053
+ readonly id: string;
2054
+ readonly name: string;
2055
+ };
2056
+ readonly sessionId: string;
2057
+ readonly expectedWork: string;
2058
+ readonly worker: {
2059
+ readonly host: string;
2060
+ readonly agentId: string;
2061
+ readonly name: string;
2062
+ readonly paneId: string;
2063
+ readonly relationship?: {
2064
+ readonly parentAgentId: string;
2065
+ readonly relation: "delegated" | "pair" | "review";
2066
+ };
2067
+ };
2068
+ readonly worktree: string;
2069
+ readonly branch: string;
2070
+ readonly title: string;
2071
+ readonly summary: string;
2072
+ readonly detail: string;
2073
+ } | {
2074
+ readonly kind: "work.recover";
2075
+ readonly repository: string;
2076
+ readonly pullRequest: number;
2077
+ readonly reviewUrl: string;
2078
+ readonly goalId: string;
2079
+ readonly laneId: string;
2080
+ readonly operationId: string;
2081
+ readonly expectedGoalEventId: string;
2082
+ readonly expectedGoalUpdatedAt: number;
2083
+ readonly expectedHistoryToken: string;
2084
+ readonly head: string;
2085
+ readonly baseHead: string;
2086
+ readonly owner: {
2087
+ readonly id: string;
2088
+ readonly name: string;
2089
+ };
2090
+ readonly sessionId: string;
2091
+ readonly expectedWork: string;
2092
+ readonly worker: {
2093
+ readonly host: string;
2094
+ readonly agentId: string;
2095
+ readonly name: string;
2096
+ readonly paneId: string;
2097
+ readonly relationship?: {
2098
+ readonly parentAgentId: string;
2099
+ readonly relation: "delegated" | "pair" | "review";
2100
+ };
2101
+ };
2102
+ readonly worktree: string;
2103
+ readonly branch: string;
2104
+ } | {
2105
+ readonly kind: "work.reassign";
2106
+ readonly goalId: string;
2107
+ readonly from: {
2108
+ readonly id: string;
2109
+ readonly name: string;
2110
+ };
2111
+ readonly to: {
2112
+ readonly id: string;
2113
+ readonly name: string;
2114
+ };
2115
+ readonly toAgent: {
2116
+ readonly _tag: "clear";
2117
+ } | {
2118
+ readonly _tag: "keep";
2119
+ } | {
2120
+ readonly _tag: "set";
2121
+ readonly agent: {
2122
+ readonly host: string;
2123
+ readonly agentId: string;
2124
+ readonly name: string;
2125
+ readonly paneId: string;
2126
+ readonly relationship?: {
2127
+ readonly parentAgentId: string;
2128
+ readonly relation: "delegated" | "pair" | "review";
2129
+ };
2130
+ };
2131
+ };
2132
+ readonly reason: string;
2133
+ readonly expectedGoalEventId: string;
2134
+ readonly expectedGoalUpdatedAt: number;
2135
+ } | {
2136
+ readonly kind: "browser.mcp.recover";
2137
+ } | {
2138
+ readonly kind: "nix.check";
2139
+ } | {
2140
+ readonly kind: "nix.apply";
2141
+ readonly ref: string;
632
2142
  } | {
633
2143
  readonly kind: "agent.message";
634
2144
  readonly session: string;
635
2145
  readonly message: string;
636
- } | {
637
- readonly kind: "browser.mcp.recover";
638
2146
  };
639
2147
  readonly result: string | null;
2148
+ readonly acceptedReceipt?: string | null;
2149
+ readonly durableOperation?: true;
640
2150
  readonly error: string | null;
641
2151
  readonly worker?: {
642
2152
  readonly host: string;
@@ -706,7 +2216,7 @@ export declare const makeHerdrTerminalConnector: (config: {
706
2216
  readonly error: string | null;
707
2217
  };
708
2218
  }, import("@knpkv/herdr-fleet").FleetOperationError, never>;
709
- recover: () => Effect.Effect<string[], import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
2219
+ recover: () => Effect.Effect<string[], import("@knpkv/herdr-fleet").FleetOperationError | import("@knpkv/herdr-fleet").FleetStoreError | import("@knpkv/herdr-fleet").FleetTransitionConflictError, never>;
710
2220
  abortSubmission: (jobId: string, detail: string) => Effect.Effect<{
711
2221
  readonly id: string;
712
2222
  readonly createdAt: number;
@@ -722,24 +2232,150 @@ export declare const makeHerdrTerminalConnector: (config: {
722
2232
  readonly expiredAt?: number | null;
723
2233
  readonly status: "expired" | "failed" | "interrupted" | "pending_approval" | "queued" | "rejected" | "running" | "succeeded";
724
2234
  readonly payload: {
725
- readonly kind: "nix.check";
726
- } | {
727
- readonly kind: "nix.apply";
728
- readonly ref: string;
729
- } | {
730
2235
  readonly kind: "agent.delegate";
731
2236
  readonly repository: string;
732
2237
  readonly prompt: string;
733
- readonly mode: "consult" | "review" | "work";
2238
+ readonly mode: "consult" | "review" | "transition_summary" | "work";
734
2239
  readonly channel?: "coordinator_chat";
2240
+ } | {
2241
+ readonly kind: "work.reconcile";
2242
+ readonly repository: string;
2243
+ readonly pullRequest: number;
2244
+ readonly goalId: string;
2245
+ readonly laneId: string;
2246
+ readonly operationId: string;
2247
+ readonly expectedRevision: number;
2248
+ readonly expectedHead: string;
2249
+ readonly newHead: string;
2250
+ readonly expectedOwner: {
2251
+ readonly id: string;
2252
+ readonly name: string;
2253
+ };
2254
+ readonly expectedGoalEventId: string;
2255
+ readonly bindingDispatchRequestId: string;
2256
+ readonly sessionId: string;
2257
+ readonly expectedWork: string;
2258
+ readonly worker: {
2259
+ readonly host: string;
2260
+ readonly agentId: string;
2261
+ readonly name: string;
2262
+ readonly paneId: string;
2263
+ readonly relationship?: {
2264
+ readonly parentAgentId: string;
2265
+ readonly relation: "delegated" | "pair" | "review";
2266
+ };
2267
+ };
2268
+ readonly worktree: string;
2269
+ readonly branch: string;
2270
+ } | {
2271
+ readonly kind: "work.admit";
2272
+ readonly repository: string;
2273
+ readonly pullRequest: number;
2274
+ readonly reviewUrl: string;
2275
+ readonly goalId: string;
2276
+ readonly laneId: string;
2277
+ readonly operationId: string;
2278
+ readonly expectedAbsenceToken: string;
2279
+ readonly head: string;
2280
+ readonly baseHead: string;
2281
+ readonly owner: {
2282
+ readonly id: string;
2283
+ readonly name: string;
2284
+ };
2285
+ readonly sessionId: string;
2286
+ readonly expectedWork: string;
2287
+ readonly worker: {
2288
+ readonly host: string;
2289
+ readonly agentId: string;
2290
+ readonly name: string;
2291
+ readonly paneId: string;
2292
+ readonly relationship?: {
2293
+ readonly parentAgentId: string;
2294
+ readonly relation: "delegated" | "pair" | "review";
2295
+ };
2296
+ };
2297
+ readonly worktree: string;
2298
+ readonly branch: string;
2299
+ readonly title: string;
2300
+ readonly summary: string;
2301
+ readonly detail: string;
2302
+ } | {
2303
+ readonly kind: "work.recover";
2304
+ readonly repository: string;
2305
+ readonly pullRequest: number;
2306
+ readonly reviewUrl: string;
2307
+ readonly goalId: string;
2308
+ readonly laneId: string;
2309
+ readonly operationId: string;
2310
+ readonly expectedGoalEventId: string;
2311
+ readonly expectedGoalUpdatedAt: number;
2312
+ readonly expectedHistoryToken: string;
2313
+ readonly head: string;
2314
+ readonly baseHead: string;
2315
+ readonly owner: {
2316
+ readonly id: string;
2317
+ readonly name: string;
2318
+ };
2319
+ readonly sessionId: string;
2320
+ readonly expectedWork: string;
2321
+ readonly worker: {
2322
+ readonly host: string;
2323
+ readonly agentId: string;
2324
+ readonly name: string;
2325
+ readonly paneId: string;
2326
+ readonly relationship?: {
2327
+ readonly parentAgentId: string;
2328
+ readonly relation: "delegated" | "pair" | "review";
2329
+ };
2330
+ };
2331
+ readonly worktree: string;
2332
+ readonly branch: string;
2333
+ } | {
2334
+ readonly kind: "work.reassign";
2335
+ readonly goalId: string;
2336
+ readonly from: {
2337
+ readonly id: string;
2338
+ readonly name: string;
2339
+ };
2340
+ readonly to: {
2341
+ readonly id: string;
2342
+ readonly name: string;
2343
+ };
2344
+ readonly toAgent: {
2345
+ readonly _tag: "clear";
2346
+ } | {
2347
+ readonly _tag: "keep";
2348
+ } | {
2349
+ readonly _tag: "set";
2350
+ readonly agent: {
2351
+ readonly host: string;
2352
+ readonly agentId: string;
2353
+ readonly name: string;
2354
+ readonly paneId: string;
2355
+ readonly relationship?: {
2356
+ readonly parentAgentId: string;
2357
+ readonly relation: "delegated" | "pair" | "review";
2358
+ };
2359
+ };
2360
+ };
2361
+ readonly reason: string;
2362
+ readonly expectedGoalEventId: string;
2363
+ readonly expectedGoalUpdatedAt: number;
2364
+ } | {
2365
+ readonly kind: "browser.mcp.recover";
2366
+ } | {
2367
+ readonly kind: "nix.check";
2368
+ } | {
2369
+ readonly kind: "nix.apply";
2370
+ readonly ref: string;
735
2371
  } | {
736
2372
  readonly kind: "agent.message";
737
2373
  readonly session: string;
738
2374
  readonly message: string;
739
- } | {
740
- readonly kind: "browser.mcp.recover";
741
2375
  };
742
2376
  readonly result: string | null;
2377
+ readonly acceptedReceipt?: string | null;
2378
+ readonly durableOperation?: true;
743
2379
  readonly error: string | null;
744
2380
  readonly worker?: {
745
2381
  readonly host: string;