@agent-relay/factory 0.1.58 → 0.1.62

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 (70) hide show
  1. package/README.md +36 -1
  2. package/dist/cli/fleet.d.ts +8 -1
  3. package/dist/cli/fleet.d.ts.map +1 -1
  4. package/dist/cli/fleet.js +172 -16
  5. package/dist/cli/fleet.js.map +1 -1
  6. package/dist/config/schema.d.ts +796 -273
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/config/schema.js +44 -0
  9. package/dist/config/schema.js.map +1 -1
  10. package/dist/delivery/ticket-dispatch.d.ts +15 -0
  11. package/dist/delivery/ticket-dispatch.d.ts.map +1 -0
  12. package/dist/delivery/ticket-dispatch.js +20 -0
  13. package/dist/delivery/ticket-dispatch.js.map +1 -0
  14. package/dist/git/agent-worktree.d.ts.map +1 -1
  15. package/dist/git/agent-worktree.js +4 -0
  16. package/dist/git/agent-worktree.js.map +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/issue-key-match.d.ts +6 -0
  22. package/dist/issue-key-match.d.ts.map +1 -1
  23. package/dist/issue-key-match.js +14 -0
  24. package/dist/issue-key-match.js.map +1 -1
  25. package/dist/mount/relayfile-github-connection-write.d.ts.map +1 -1
  26. package/dist/mount/relayfile-github-connection-write.js +6 -3
  27. package/dist/mount/relayfile-github-connection-write.js.map +1 -1
  28. package/dist/orchestrator/batch-tracker.d.ts +7 -1
  29. package/dist/orchestrator/batch-tracker.d.ts.map +1 -1
  30. package/dist/orchestrator/batch-tracker.js +2 -0
  31. package/dist/orchestrator/batch-tracker.js.map +1 -1
  32. package/dist/orchestrator/factory.d.ts.map +1 -1
  33. package/dist/orchestrator/factory.js +1940 -153
  34. package/dist/orchestrator/factory.js.map +1 -1
  35. package/dist/orchestrator/index.d.ts +1 -1
  36. package/dist/orchestrator/index.d.ts.map +1 -1
  37. package/dist/orchestrator/index.js +1 -1
  38. package/dist/orchestrator/index.js.map +1 -1
  39. package/dist/orchestrator/reaper.d.ts +16 -2
  40. package/dist/orchestrator/reaper.d.ts.map +1 -1
  41. package/dist/orchestrator/reaper.js +79 -5
  42. package/dist/orchestrator/reaper.js.map +1 -1
  43. package/dist/ports/fleet.d.ts +4 -0
  44. package/dist/ports/fleet.d.ts.map +1 -1
  45. package/dist/ports/mount.d.ts +2 -0
  46. package/dist/ports/mount.d.ts.map +1 -1
  47. package/dist/ports/state.d.ts +60 -1
  48. package/dist/ports/state.d.ts.map +1 -1
  49. package/dist/state/file-state-store.d.ts +9 -1
  50. package/dist/state/file-state-store.d.ts.map +1 -1
  51. package/dist/state/file-state-store.js +160 -2
  52. package/dist/state/file-state-store.js.map +1 -1
  53. package/dist/state/in-memory-state-store.d.ts +7 -1
  54. package/dist/state/in-memory-state-store.d.ts.map +1 -1
  55. package/dist/state/in-memory-state-store.js +71 -0
  56. package/dist/state/in-memory-state-store.js.map +1 -1
  57. package/dist/triage/schema.d.ts +36 -0
  58. package/dist/triage/schema.d.ts.map +1 -1
  59. package/dist/triage/schema.js +2 -0
  60. package/dist/triage/schema.js.map +1 -1
  61. package/dist/types.d.ts +64 -1
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/version-info.d.ts +21 -0
  64. package/dist/version-info.d.ts.map +1 -0
  65. package/dist/version-info.js +146 -0
  66. package/dist/version-info.js.map +1 -0
  67. package/dist/writeback/github.d.ts.map +1 -1
  68. package/dist/writeback/github.js +12 -0
  69. package/dist/writeback/github.js.map +1 -1
  70. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const FACTORY_STATE_ROLES: readonly ["readyForAgent", "agentImplementing", "inPlanning", "done", "humanReview"];
3
3
  export type FactoryStateRole = (typeof FACTORY_STATE_ROLES)[number];
4
+ export declare const DEFAULT_AGENT_HOLD_TIMEOUT_MS: number;
4
5
  export declare const resolveRoutedRepo: (configured: string, org: string | undefined) => string | undefined;
5
6
  export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
6
7
  workspaceId: z.ZodOptional<z.ZodString>;
@@ -26,26 +27,33 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
26
27
  pollIntervalMs: z.ZodDefault<z.ZodNumber>;
27
28
  eventLimit: z.ZodDefault<z.ZodNumber>;
28
29
  replaySkewMarginMs: z.ZodDefault<z.ZodNumber>;
30
+ /** Independent source-of-truth sweep; live event watermarks remain a latency optimization. */
31
+ reconcileIntervalMs: z.ZodDefault<z.ZodNumber>;
29
32
  }, "strip", z.ZodTypeAny, {
30
33
  transport: "subscribe-and-poll" | "subscribe" | "poll";
31
34
  pollIntervalMs: number;
32
35
  eventLimit: number;
33
36
  replaySkewMarginMs: number;
37
+ reconcileIntervalMs: number;
34
38
  }, {
35
39
  transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
36
40
  pollIntervalMs?: number | undefined;
37
41
  eventLimit?: number | undefined;
38
42
  replaySkewMarginMs?: number | undefined;
43
+ reconcileIntervalMs?: number | undefined;
39
44
  }>>;
40
45
  dispatch: z.ZodDefault<z.ZodObject<{
41
46
  errorCooldownMs: z.ZodDefault<z.ZodNumber>;
42
47
  maxAttempts: z.ZodDefault<z.ZodNumber>;
48
+ agentHoldTimeoutMs: z.ZodDefault<z.ZodNumber>;
43
49
  }, "strip", z.ZodTypeAny, {
44
50
  errorCooldownMs: number;
45
51
  maxAttempts: number;
52
+ agentHoldTimeoutMs: number;
46
53
  }, {
47
54
  errorCooldownMs?: number | undefined;
48
55
  maxAttempts?: number | undefined;
56
+ agentHoldTimeoutMs?: number | undefined;
49
57
  }>>;
50
58
  loop: z.ZodDefault<z.ZodObject<{
51
59
  maxIterations: z.ZodDefault<z.ZodNumber>;
@@ -211,6 +219,140 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
211
219
  batchSize?: number | undefined;
212
220
  requestTimeoutMs?: number | undefined;
213
221
  }>>;
222
+ hooks: z.ZodOptional<z.ZodObject<{
223
+ onTicketDispatch: z.ZodOptional<z.ZodObject<{
224
+ notify: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"surface", [z.ZodObject<{
225
+ surface: z.ZodLiteral<"relay">;
226
+ channel: z.ZodString;
227
+ }, "strict", z.ZodTypeAny, {
228
+ channel: string;
229
+ surface: "relay";
230
+ }, {
231
+ channel: string;
232
+ surface: "relay";
233
+ }>, z.ZodObject<{
234
+ surface: z.ZodLiteral<"slack">;
235
+ channel: z.ZodOptional<z.ZodString>;
236
+ dm: z.ZodOptional<z.ZodString>;
237
+ }, "strict", z.ZodTypeAny, {
238
+ surface: "slack";
239
+ channel?: string | undefined;
240
+ dm?: string | undefined;
241
+ }, {
242
+ surface: "slack";
243
+ channel?: string | undefined;
244
+ dm?: string | undefined;
245
+ }>, z.ZodObject<{
246
+ surface: z.ZodLiteral<"telegram">;
247
+ chatId: z.ZodString;
248
+ }, "strict", z.ZodTypeAny, {
249
+ surface: "telegram";
250
+ chatId: string;
251
+ }, {
252
+ surface: "telegram";
253
+ chatId: string;
254
+ }>, z.ZodObject<{
255
+ surface: z.ZodLiteral<"linear">;
256
+ commentOnIssue: z.ZodLiteral<true>;
257
+ }, "strict", z.ZodTypeAny, {
258
+ surface: "linear";
259
+ commentOnIssue: true;
260
+ }, {
261
+ surface: "linear";
262
+ commentOnIssue: true;
263
+ }>]>, {
264
+ channel: string;
265
+ surface: "relay";
266
+ } | {
267
+ surface: "slack";
268
+ channel?: string | undefined;
269
+ dm?: string | undefined;
270
+ } | {
271
+ surface: "telegram";
272
+ chatId: string;
273
+ } | {
274
+ surface: "linear";
275
+ commentOnIssue: true;
276
+ }, {
277
+ channel: string;
278
+ surface: "relay";
279
+ } | {
280
+ surface: "slack";
281
+ channel?: string | undefined;
282
+ dm?: string | undefined;
283
+ } | {
284
+ surface: "telegram";
285
+ chatId: string;
286
+ } | {
287
+ surface: "linear";
288
+ commentOnIssue: true;
289
+ }>, "many">;
290
+ }, "strict", z.ZodTypeAny, {
291
+ notify: ({
292
+ channel: string;
293
+ surface: "relay";
294
+ } | {
295
+ surface: "slack";
296
+ channel?: string | undefined;
297
+ dm?: string | undefined;
298
+ } | {
299
+ surface: "telegram";
300
+ chatId: string;
301
+ } | {
302
+ surface: "linear";
303
+ commentOnIssue: true;
304
+ })[];
305
+ }, {
306
+ notify: ({
307
+ channel: string;
308
+ surface: "relay";
309
+ } | {
310
+ surface: "slack";
311
+ channel?: string | undefined;
312
+ dm?: string | undefined;
313
+ } | {
314
+ surface: "telegram";
315
+ chatId: string;
316
+ } | {
317
+ surface: "linear";
318
+ commentOnIssue: true;
319
+ })[];
320
+ }>>;
321
+ }, "strict", z.ZodTypeAny, {
322
+ onTicketDispatch?: {
323
+ notify: ({
324
+ channel: string;
325
+ surface: "relay";
326
+ } | {
327
+ surface: "slack";
328
+ channel?: string | undefined;
329
+ dm?: string | undefined;
330
+ } | {
331
+ surface: "telegram";
332
+ chatId: string;
333
+ } | {
334
+ surface: "linear";
335
+ commentOnIssue: true;
336
+ })[];
337
+ } | undefined;
338
+ }, {
339
+ onTicketDispatch?: {
340
+ notify: ({
341
+ channel: string;
342
+ surface: "relay";
343
+ } | {
344
+ surface: "slack";
345
+ channel?: string | undefined;
346
+ dm?: string | undefined;
347
+ } | {
348
+ surface: "telegram";
349
+ chatId: string;
350
+ } | {
351
+ surface: "linear";
352
+ commentOnIssue: true;
353
+ })[];
354
+ } | undefined;
355
+ }>>;
214
356
  preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
215
357
  provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
216
358
  access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
@@ -865,6 +1007,23 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
865
1007
  notifyHumans: boolean;
866
1008
  };
867
1009
  batchSize: number;
1010
+ linear: {
1011
+ states: {
1012
+ readyForAgent?: string | undefined;
1013
+ agentImplementing?: string | undefined;
1014
+ inPlanning?: string | undefined;
1015
+ done?: string | undefined;
1016
+ humanReview?: string | undefined;
1017
+ };
1018
+ statesByTeam: Record<string, {
1019
+ readyForAgent?: string | undefined;
1020
+ agentImplementing?: string | undefined;
1021
+ inPlanning?: string | undefined;
1022
+ done?: string | undefined;
1023
+ humanReview?: string | undefined;
1024
+ }>;
1025
+ teamIds: Record<string, string>;
1026
+ };
868
1027
  subscription: {
869
1028
  teams: string[];
870
1029
  projects: string[];
@@ -876,10 +1035,12 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
876
1035
  pollIntervalMs: number;
877
1036
  eventLimit: number;
878
1037
  replaySkewMarginMs: number;
1038
+ reconcileIntervalMs: number;
879
1039
  };
880
1040
  dispatch: {
881
1041
  errorCooldownMs: number;
882
1042
  maxAttempts: number;
1043
+ agentHoldTimeoutMs: number;
883
1044
  };
884
1045
  loop: {
885
1046
  maxIterations: number;
@@ -913,23 +1074,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
913
1074
  reviewer: "spawn:codex" | "spawn:claude";
914
1075
  babysitter: "spawn:codex" | "spawn:claude";
915
1076
  };
916
- linear: {
917
- states: {
918
- readyForAgent?: string | undefined;
919
- agentImplementing?: string | undefined;
920
- inPlanning?: string | undefined;
921
- done?: string | undefined;
922
- humanReview?: string | undefined;
923
- };
924
- statesByTeam: Record<string, {
925
- readyForAgent?: string | undefined;
926
- agentImplementing?: string | undefined;
927
- inPlanning?: string | undefined;
928
- done?: string | undefined;
929
- humanReview?: string | undefined;
930
- }>;
931
- teamIds: Record<string, string>;
932
- };
933
1077
  github: {
934
1078
  identity: "app" | "user" | "auto";
935
1079
  };
@@ -999,8 +1143,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
999
1143
  };
1000
1144
  } | undefined;
1001
1145
  };
1002
- workspaceId?: string | undefined;
1003
- localMountRoot?: string | undefined;
1004
1146
  slack?: {
1005
1147
  channel: string;
1006
1148
  style: "threaded-summarized";
@@ -1009,7 +1151,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1009
1151
  staleAfterMs: number;
1010
1152
  conversationCoalesceMs: number;
1011
1153
  } | undefined;
1154
+ workspaceId?: string | undefined;
1155
+ localMountRoot?: string | undefined;
1012
1156
  issueSource?: "linear" | "github" | undefined;
1157
+ hooks?: {
1158
+ onTicketDispatch?: {
1159
+ notify: ({
1160
+ channel: string;
1161
+ surface: "relay";
1162
+ } | {
1163
+ surface: "slack";
1164
+ channel?: string | undefined;
1165
+ dm?: string | undefined;
1166
+ } | {
1167
+ surface: "telegram";
1168
+ chatId: string;
1169
+ } | {
1170
+ surface: "linear";
1171
+ commentOnIssue: true;
1172
+ })[];
1173
+ } | undefined;
1174
+ } | undefined;
1013
1175
  preview?: {
1014
1176
  registryPath: string;
1015
1177
  provider: "tailscale-serve";
@@ -1049,6 +1211,31 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1049
1211
  notifyHumans?: boolean | undefined;
1050
1212
  } | undefined;
1051
1213
  batchSize?: number | undefined;
1214
+ slack?: {
1215
+ channel: string;
1216
+ style?: "threaded-summarized" | undefined;
1217
+ botUserId?: string | undefined;
1218
+ stakeholderUserIds?: string[] | undefined;
1219
+ staleAfterMs?: number | undefined;
1220
+ conversationCoalesceMs?: number | undefined;
1221
+ } | undefined;
1222
+ linear?: {
1223
+ states?: {
1224
+ readyForAgent?: string | undefined;
1225
+ agentImplementing?: string | undefined;
1226
+ inPlanning?: string | undefined;
1227
+ done?: string | undefined;
1228
+ humanReview?: string | undefined;
1229
+ } | undefined;
1230
+ statesByTeam?: Record<string, {
1231
+ readyForAgent?: string | undefined;
1232
+ agentImplementing?: string | undefined;
1233
+ inPlanning?: string | undefined;
1234
+ done?: string | undefined;
1235
+ humanReview?: string | undefined;
1236
+ } | undefined> | undefined;
1237
+ teamIds?: Record<string, string> | undefined;
1238
+ } | undefined;
1052
1239
  workspaceId?: string | undefined;
1053
1240
  localMountRoot?: string | undefined;
1054
1241
  subscription?: {
@@ -1062,10 +1249,12 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1062
1249
  pollIntervalMs?: number | undefined;
1063
1250
  eventLimit?: number | undefined;
1064
1251
  replaySkewMarginMs?: number | undefined;
1252
+ reconcileIntervalMs?: number | undefined;
1065
1253
  } | undefined;
1066
1254
  dispatch?: {
1067
1255
  errorCooldownMs?: number | undefined;
1068
1256
  maxAttempts?: number | undefined;
1257
+ agentHoldTimeoutMs?: number | undefined;
1069
1258
  } | undefined;
1070
1259
  loop?: {
1071
1260
  maxIterations?: number | undefined;
@@ -1085,31 +1274,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1085
1274
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1086
1275
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1087
1276
  } | undefined;
1088
- slack?: {
1089
- channel: string;
1090
- style?: "threaded-summarized" | undefined;
1091
- botUserId?: string | undefined;
1092
- stakeholderUserIds?: string[] | undefined;
1093
- staleAfterMs?: number | undefined;
1094
- conversationCoalesceMs?: number | undefined;
1095
- } | undefined;
1096
- linear?: {
1097
- states?: {
1098
- readyForAgent?: string | undefined;
1099
- agentImplementing?: string | undefined;
1100
- inPlanning?: string | undefined;
1101
- done?: string | undefined;
1102
- humanReview?: string | undefined;
1103
- } | undefined;
1104
- statesByTeam?: Record<string, {
1105
- readyForAgent?: string | undefined;
1106
- agentImplementing?: string | undefined;
1107
- inPlanning?: string | undefined;
1108
- done?: string | undefined;
1109
- humanReview?: string | undefined;
1110
- } | undefined> | undefined;
1111
- teamIds?: Record<string, string> | undefined;
1112
- } | undefined;
1113
1277
  github?: {
1114
1278
  identity?: "app" | "user" | "auto" | undefined;
1115
1279
  } | undefined;
@@ -1122,6 +1286,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1122
1286
  batchSize?: number | undefined;
1123
1287
  requestTimeoutMs?: number | undefined;
1124
1288
  } | undefined;
1289
+ hooks?: {
1290
+ onTicketDispatch?: {
1291
+ notify: ({
1292
+ channel: string;
1293
+ surface: "relay";
1294
+ } | {
1295
+ surface: "slack";
1296
+ channel?: string | undefined;
1297
+ dm?: string | undefined;
1298
+ } | {
1299
+ surface: "telegram";
1300
+ chatId: string;
1301
+ } | {
1302
+ surface: "linear";
1303
+ commentOnIssue: true;
1304
+ })[];
1305
+ } | undefined;
1306
+ } | undefined;
1125
1307
  preview?: {
1126
1308
  registryPath?: string | undefined;
1127
1309
  provider?: "tailscale-serve" | undefined;
@@ -1205,6 +1387,23 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1205
1387
  notifyHumans: boolean;
1206
1388
  };
1207
1389
  batchSize: number;
1390
+ linear: {
1391
+ states: {
1392
+ readyForAgent?: string | undefined;
1393
+ agentImplementing?: string | undefined;
1394
+ inPlanning?: string | undefined;
1395
+ done?: string | undefined;
1396
+ humanReview?: string | undefined;
1397
+ };
1398
+ statesByTeam: Record<string, {
1399
+ readyForAgent?: string | undefined;
1400
+ agentImplementing?: string | undefined;
1401
+ inPlanning?: string | undefined;
1402
+ done?: string | undefined;
1403
+ humanReview?: string | undefined;
1404
+ }>;
1405
+ teamIds: Record<string, string>;
1406
+ };
1208
1407
  subscription: {
1209
1408
  teams: string[];
1210
1409
  projects: string[];
@@ -1216,10 +1415,12 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1216
1415
  pollIntervalMs: number;
1217
1416
  eventLimit: number;
1218
1417
  replaySkewMarginMs: number;
1418
+ reconcileIntervalMs: number;
1219
1419
  };
1220
1420
  dispatch: {
1221
1421
  errorCooldownMs: number;
1222
1422
  maxAttempts: number;
1423
+ agentHoldTimeoutMs: number;
1223
1424
  };
1224
1425
  loop: {
1225
1426
  maxIterations: number;
@@ -1253,23 +1454,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1253
1454
  reviewer: "spawn:codex" | "spawn:claude";
1254
1455
  babysitter: "spawn:codex" | "spawn:claude";
1255
1456
  };
1256
- linear: {
1257
- states: {
1258
- readyForAgent?: string | undefined;
1259
- agentImplementing?: string | undefined;
1260
- inPlanning?: string | undefined;
1261
- done?: string | undefined;
1262
- humanReview?: string | undefined;
1263
- };
1264
- statesByTeam: Record<string, {
1265
- readyForAgent?: string | undefined;
1266
- agentImplementing?: string | undefined;
1267
- inPlanning?: string | undefined;
1268
- done?: string | undefined;
1269
- humanReview?: string | undefined;
1270
- }>;
1271
- teamIds: Record<string, string>;
1272
- };
1273
1457
  github: {
1274
1458
  identity: "app" | "user" | "auto";
1275
1459
  };
@@ -1339,8 +1523,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1339
1523
  };
1340
1524
  } | undefined;
1341
1525
  };
1342
- workspaceId?: string | undefined;
1343
- localMountRoot?: string | undefined;
1344
1526
  slack?: {
1345
1527
  channel: string;
1346
1528
  style: "threaded-summarized";
@@ -1349,7 +1531,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1349
1531
  staleAfterMs: number;
1350
1532
  conversationCoalesceMs: number;
1351
1533
  } | undefined;
1534
+ workspaceId?: string | undefined;
1535
+ localMountRoot?: string | undefined;
1352
1536
  issueSource?: "linear" | "github" | undefined;
1537
+ hooks?: {
1538
+ onTicketDispatch?: {
1539
+ notify: ({
1540
+ channel: string;
1541
+ surface: "relay";
1542
+ } | {
1543
+ surface: "slack";
1544
+ channel?: string | undefined;
1545
+ dm?: string | undefined;
1546
+ } | {
1547
+ surface: "telegram";
1548
+ chatId: string;
1549
+ } | {
1550
+ surface: "linear";
1551
+ commentOnIssue: true;
1552
+ })[];
1553
+ } | undefined;
1554
+ } | undefined;
1353
1555
  preview?: {
1354
1556
  registryPath: string;
1355
1557
  provider: "tailscale-serve";
@@ -1389,6 +1591,31 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1389
1591
  notifyHumans?: boolean | undefined;
1390
1592
  } | undefined;
1391
1593
  batchSize?: number | undefined;
1594
+ slack?: {
1595
+ channel: string;
1596
+ style?: "threaded-summarized" | undefined;
1597
+ botUserId?: string | undefined;
1598
+ stakeholderUserIds?: string[] | undefined;
1599
+ staleAfterMs?: number | undefined;
1600
+ conversationCoalesceMs?: number | undefined;
1601
+ } | undefined;
1602
+ linear?: {
1603
+ states?: {
1604
+ readyForAgent?: string | undefined;
1605
+ agentImplementing?: string | undefined;
1606
+ inPlanning?: string | undefined;
1607
+ done?: string | undefined;
1608
+ humanReview?: string | undefined;
1609
+ } | undefined;
1610
+ statesByTeam?: Record<string, {
1611
+ readyForAgent?: string | undefined;
1612
+ agentImplementing?: string | undefined;
1613
+ inPlanning?: string | undefined;
1614
+ done?: string | undefined;
1615
+ humanReview?: string | undefined;
1616
+ } | undefined> | undefined;
1617
+ teamIds?: Record<string, string> | undefined;
1618
+ } | undefined;
1392
1619
  workspaceId?: string | undefined;
1393
1620
  localMountRoot?: string | undefined;
1394
1621
  subscription?: {
@@ -1402,10 +1629,12 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1402
1629
  pollIntervalMs?: number | undefined;
1403
1630
  eventLimit?: number | undefined;
1404
1631
  replaySkewMarginMs?: number | undefined;
1632
+ reconcileIntervalMs?: number | undefined;
1405
1633
  } | undefined;
1406
1634
  dispatch?: {
1407
1635
  errorCooldownMs?: number | undefined;
1408
1636
  maxAttempts?: number | undefined;
1637
+ agentHoldTimeoutMs?: number | undefined;
1409
1638
  } | undefined;
1410
1639
  loop?: {
1411
1640
  maxIterations?: number | undefined;
@@ -1425,31 +1654,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1425
1654
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1426
1655
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1427
1656
  } | undefined;
1428
- slack?: {
1429
- channel: string;
1430
- style?: "threaded-summarized" | undefined;
1431
- botUserId?: string | undefined;
1432
- stakeholderUserIds?: string[] | undefined;
1433
- staleAfterMs?: number | undefined;
1434
- conversationCoalesceMs?: number | undefined;
1435
- } | undefined;
1436
- linear?: {
1437
- states?: {
1438
- readyForAgent?: string | undefined;
1439
- agentImplementing?: string | undefined;
1440
- inPlanning?: string | undefined;
1441
- done?: string | undefined;
1442
- humanReview?: string | undefined;
1443
- } | undefined;
1444
- statesByTeam?: Record<string, {
1445
- readyForAgent?: string | undefined;
1446
- agentImplementing?: string | undefined;
1447
- inPlanning?: string | undefined;
1448
- done?: string | undefined;
1449
- humanReview?: string | undefined;
1450
- } | undefined> | undefined;
1451
- teamIds?: Record<string, string> | undefined;
1452
- } | undefined;
1453
1657
  github?: {
1454
1658
  identity?: "app" | "user" | "auto" | undefined;
1455
1659
  } | undefined;
@@ -1462,6 +1666,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1462
1666
  batchSize?: number | undefined;
1463
1667
  requestTimeoutMs?: number | undefined;
1464
1668
  } | undefined;
1669
+ hooks?: {
1670
+ onTicketDispatch?: {
1671
+ notify: ({
1672
+ channel: string;
1673
+ surface: "relay";
1674
+ } | {
1675
+ surface: "slack";
1676
+ channel?: string | undefined;
1677
+ dm?: string | undefined;
1678
+ } | {
1679
+ surface: "telegram";
1680
+ chatId: string;
1681
+ } | {
1682
+ surface: "linear";
1683
+ commentOnIssue: true;
1684
+ })[];
1685
+ } | undefined;
1686
+ } | undefined;
1465
1687
  preview?: {
1466
1688
  registryPath?: string | undefined;
1467
1689
  provider?: "tailscale-serve" | undefined;
@@ -1578,15 +1800,34 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1578
1800
  notifyHumans: boolean;
1579
1801
  };
1580
1802
  batchSize: number;
1803
+ linear: {
1804
+ states: {
1805
+ readyForAgent?: string | undefined;
1806
+ agentImplementing?: string | undefined;
1807
+ inPlanning?: string | undefined;
1808
+ done?: string | undefined;
1809
+ humanReview?: string | undefined;
1810
+ };
1811
+ statesByTeam: Record<string, {
1812
+ readyForAgent?: string | undefined;
1813
+ agentImplementing?: string | undefined;
1814
+ inPlanning?: string | undefined;
1815
+ done?: string | undefined;
1816
+ humanReview?: string | undefined;
1817
+ }>;
1818
+ teamIds: Record<string, string>;
1819
+ };
1581
1820
  liveSubscription: {
1582
1821
  transport: "subscribe-and-poll" | "subscribe" | "poll";
1583
1822
  pollIntervalMs: number;
1584
1823
  eventLimit: number;
1585
1824
  replaySkewMarginMs: number;
1825
+ reconcileIntervalMs: number;
1586
1826
  };
1587
1827
  dispatch: {
1588
1828
  errorCooldownMs: number;
1589
1829
  maxAttempts: number;
1830
+ agentHoldTimeoutMs: number;
1590
1831
  };
1591
1832
  loop: {
1592
1833
  maxIterations: number;
@@ -1606,23 +1847,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1606
1847
  reviewer: "spawn:codex" | "spawn:claude";
1607
1848
  babysitter: "spawn:codex" | "spawn:claude";
1608
1849
  };
1609
- linear: {
1610
- states: {
1611
- readyForAgent?: string | undefined;
1612
- agentImplementing?: string | undefined;
1613
- inPlanning?: string | undefined;
1614
- done?: string | undefined;
1615
- humanReview?: string | undefined;
1616
- };
1617
- statesByTeam: Record<string, {
1618
- readyForAgent?: string | undefined;
1619
- agentImplementing?: string | undefined;
1620
- inPlanning?: string | undefined;
1621
- done?: string | undefined;
1622
- humanReview?: string | undefined;
1623
- }>;
1624
- teamIds: Record<string, string>;
1625
- };
1626
1850
  github: {
1627
1851
  identity: "app" | "user" | "auto";
1628
1852
  };
@@ -1692,8 +1916,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1692
1916
  };
1693
1917
  } | undefined;
1694
1918
  };
1695
- workspaceId?: string | undefined;
1696
- localMountRoot?: string | undefined;
1697
1919
  slack?: {
1698
1920
  channel: string;
1699
1921
  style: "threaded-summarized";
@@ -1702,7 +1924,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1702
1924
  staleAfterMs: number;
1703
1925
  conversationCoalesceMs: number;
1704
1926
  } | undefined;
1927
+ workspaceId?: string | undefined;
1928
+ localMountRoot?: string | undefined;
1705
1929
  issueSource?: "linear" | "github" | undefined;
1930
+ hooks?: {
1931
+ onTicketDispatch?: {
1932
+ notify: ({
1933
+ channel: string;
1934
+ surface: "relay";
1935
+ } | {
1936
+ surface: "slack";
1937
+ channel?: string | undefined;
1938
+ dm?: string | undefined;
1939
+ } | {
1940
+ surface: "telegram";
1941
+ chatId: string;
1942
+ } | {
1943
+ surface: "linear";
1944
+ commentOnIssue: true;
1945
+ })[];
1946
+ } | undefined;
1947
+ } | undefined;
1706
1948
  }, {
1707
1949
  repos: {
1708
1950
  default?: string | undefined;
@@ -1729,23 +1971,50 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1729
1971
  notifyHumans?: boolean | undefined;
1730
1972
  } | undefined;
1731
1973
  batchSize?: number | undefined;
1732
- workspaceId?: string | undefined;
1733
- localMountRoot?: string | undefined;
1734
- subscription?: {
1735
- teams?: string[] | undefined;
1736
- projects?: string[] | undefined;
1737
- labels?: string[] | undefined;
1738
- assignees?: string[] | undefined;
1974
+ slack?: {
1975
+ channel: string;
1976
+ style?: "threaded-summarized" | undefined;
1977
+ botUserId?: string | undefined;
1978
+ stakeholderUserIds?: string[] | undefined;
1979
+ staleAfterMs?: number | undefined;
1980
+ conversationCoalesceMs?: number | undefined;
1739
1981
  } | undefined;
1740
- liveSubscription?: {
1741
- transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
1982
+ linear?: {
1983
+ states?: {
1984
+ readyForAgent?: string | undefined;
1985
+ agentImplementing?: string | undefined;
1986
+ inPlanning?: string | undefined;
1987
+ done?: string | undefined;
1988
+ humanReview?: string | undefined;
1989
+ } | undefined;
1990
+ statesByTeam?: Record<string, {
1991
+ readyForAgent?: string | undefined;
1992
+ agentImplementing?: string | undefined;
1993
+ inPlanning?: string | undefined;
1994
+ done?: string | undefined;
1995
+ humanReview?: string | undefined;
1996
+ } | undefined> | undefined;
1997
+ teamIds?: Record<string, string> | undefined;
1998
+ } | undefined;
1999
+ workspaceId?: string | undefined;
2000
+ localMountRoot?: string | undefined;
2001
+ subscription?: {
2002
+ teams?: string[] | undefined;
2003
+ projects?: string[] | undefined;
2004
+ labels?: string[] | undefined;
2005
+ assignees?: string[] | undefined;
2006
+ } | undefined;
2007
+ liveSubscription?: {
2008
+ transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
1742
2009
  pollIntervalMs?: number | undefined;
1743
2010
  eventLimit?: number | undefined;
1744
2011
  replaySkewMarginMs?: number | undefined;
2012
+ reconcileIntervalMs?: number | undefined;
1745
2013
  } | undefined;
1746
2014
  dispatch?: {
1747
2015
  errorCooldownMs?: number | undefined;
1748
2016
  maxAttempts?: number | undefined;
2017
+ agentHoldTimeoutMs?: number | undefined;
1749
2018
  } | undefined;
1750
2019
  loop?: {
1751
2020
  maxIterations?: number | undefined;
@@ -1765,31 +2034,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1765
2034
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1766
2035
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1767
2036
  } | undefined;
1768
- slack?: {
1769
- channel: string;
1770
- style?: "threaded-summarized" | undefined;
1771
- botUserId?: string | undefined;
1772
- stakeholderUserIds?: string[] | undefined;
1773
- staleAfterMs?: number | undefined;
1774
- conversationCoalesceMs?: number | undefined;
1775
- } | undefined;
1776
- linear?: {
1777
- states?: {
1778
- readyForAgent?: string | undefined;
1779
- agentImplementing?: string | undefined;
1780
- inPlanning?: string | undefined;
1781
- done?: string | undefined;
1782
- humanReview?: string | undefined;
1783
- } | undefined;
1784
- statesByTeam?: Record<string, {
1785
- readyForAgent?: string | undefined;
1786
- agentImplementing?: string | undefined;
1787
- inPlanning?: string | undefined;
1788
- done?: string | undefined;
1789
- humanReview?: string | undefined;
1790
- } | undefined> | undefined;
1791
- teamIds?: Record<string, string> | undefined;
1792
- } | undefined;
1793
2037
  github?: {
1794
2038
  identity?: "app" | "user" | "auto" | undefined;
1795
2039
  } | undefined;
@@ -1802,6 +2046,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1802
2046
  batchSize?: number | undefined;
1803
2047
  requestTimeoutMs?: number | undefined;
1804
2048
  } | undefined;
2049
+ hooks?: {
2050
+ onTicketDispatch?: {
2051
+ notify: ({
2052
+ channel: string;
2053
+ surface: "relay";
2054
+ } | {
2055
+ surface: "slack";
2056
+ channel?: string | undefined;
2057
+ dm?: string | undefined;
2058
+ } | {
2059
+ surface: "telegram";
2060
+ chatId: string;
2061
+ } | {
2062
+ surface: "linear";
2063
+ commentOnIssue: true;
2064
+ })[];
2065
+ } | undefined;
2066
+ } | undefined;
1805
2067
  preview?: {
1806
2068
  registryPath?: string | undefined;
1807
2069
  provider?: "tailscale-serve" | undefined;
@@ -2075,26 +2337,33 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2075
2337
  pollIntervalMs: z.ZodDefault<z.ZodNumber>;
2076
2338
  eventLimit: z.ZodDefault<z.ZodNumber>;
2077
2339
  replaySkewMarginMs: z.ZodDefault<z.ZodNumber>;
2340
+ /** Independent source-of-truth sweep; live event watermarks remain a latency optimization. */
2341
+ reconcileIntervalMs: z.ZodDefault<z.ZodNumber>;
2078
2342
  }, "strip", z.ZodTypeAny, {
2079
2343
  transport: "subscribe-and-poll" | "subscribe" | "poll";
2080
2344
  pollIntervalMs: number;
2081
2345
  eventLimit: number;
2082
2346
  replaySkewMarginMs: number;
2347
+ reconcileIntervalMs: number;
2083
2348
  }, {
2084
2349
  transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
2085
2350
  pollIntervalMs?: number | undefined;
2086
2351
  eventLimit?: number | undefined;
2087
2352
  replaySkewMarginMs?: number | undefined;
2353
+ reconcileIntervalMs?: number | undefined;
2088
2354
  }>>;
2089
2355
  dispatch: z.ZodDefault<z.ZodObject<{
2090
2356
  errorCooldownMs: z.ZodDefault<z.ZodNumber>;
2091
2357
  maxAttempts: z.ZodDefault<z.ZodNumber>;
2358
+ agentHoldTimeoutMs: z.ZodDefault<z.ZodNumber>;
2092
2359
  }, "strip", z.ZodTypeAny, {
2093
2360
  errorCooldownMs: number;
2094
2361
  maxAttempts: number;
2362
+ agentHoldTimeoutMs: number;
2095
2363
  }, {
2096
2364
  errorCooldownMs?: number | undefined;
2097
2365
  maxAttempts?: number | undefined;
2366
+ agentHoldTimeoutMs?: number | undefined;
2098
2367
  }>>;
2099
2368
  loop: z.ZodDefault<z.ZodObject<{
2100
2369
  maxIterations: z.ZodDefault<z.ZodNumber>;
@@ -2260,6 +2529,140 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2260
2529
  batchSize?: number | undefined;
2261
2530
  requestTimeoutMs?: number | undefined;
2262
2531
  }>>;
2532
+ hooks: z.ZodOptional<z.ZodObject<{
2533
+ onTicketDispatch: z.ZodOptional<z.ZodObject<{
2534
+ notify: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"surface", [z.ZodObject<{
2535
+ surface: z.ZodLiteral<"relay">;
2536
+ channel: z.ZodString;
2537
+ }, "strict", z.ZodTypeAny, {
2538
+ channel: string;
2539
+ surface: "relay";
2540
+ }, {
2541
+ channel: string;
2542
+ surface: "relay";
2543
+ }>, z.ZodObject<{
2544
+ surface: z.ZodLiteral<"slack">;
2545
+ channel: z.ZodOptional<z.ZodString>;
2546
+ dm: z.ZodOptional<z.ZodString>;
2547
+ }, "strict", z.ZodTypeAny, {
2548
+ surface: "slack";
2549
+ channel?: string | undefined;
2550
+ dm?: string | undefined;
2551
+ }, {
2552
+ surface: "slack";
2553
+ channel?: string | undefined;
2554
+ dm?: string | undefined;
2555
+ }>, z.ZodObject<{
2556
+ surface: z.ZodLiteral<"telegram">;
2557
+ chatId: z.ZodString;
2558
+ }, "strict", z.ZodTypeAny, {
2559
+ surface: "telegram";
2560
+ chatId: string;
2561
+ }, {
2562
+ surface: "telegram";
2563
+ chatId: string;
2564
+ }>, z.ZodObject<{
2565
+ surface: z.ZodLiteral<"linear">;
2566
+ commentOnIssue: z.ZodLiteral<true>;
2567
+ }, "strict", z.ZodTypeAny, {
2568
+ surface: "linear";
2569
+ commentOnIssue: true;
2570
+ }, {
2571
+ surface: "linear";
2572
+ commentOnIssue: true;
2573
+ }>]>, {
2574
+ channel: string;
2575
+ surface: "relay";
2576
+ } | {
2577
+ surface: "slack";
2578
+ channel?: string | undefined;
2579
+ dm?: string | undefined;
2580
+ } | {
2581
+ surface: "telegram";
2582
+ chatId: string;
2583
+ } | {
2584
+ surface: "linear";
2585
+ commentOnIssue: true;
2586
+ }, {
2587
+ channel: string;
2588
+ surface: "relay";
2589
+ } | {
2590
+ surface: "slack";
2591
+ channel?: string | undefined;
2592
+ dm?: string | undefined;
2593
+ } | {
2594
+ surface: "telegram";
2595
+ chatId: string;
2596
+ } | {
2597
+ surface: "linear";
2598
+ commentOnIssue: true;
2599
+ }>, "many">;
2600
+ }, "strict", z.ZodTypeAny, {
2601
+ notify: ({
2602
+ channel: string;
2603
+ surface: "relay";
2604
+ } | {
2605
+ surface: "slack";
2606
+ channel?: string | undefined;
2607
+ dm?: string | undefined;
2608
+ } | {
2609
+ surface: "telegram";
2610
+ chatId: string;
2611
+ } | {
2612
+ surface: "linear";
2613
+ commentOnIssue: true;
2614
+ })[];
2615
+ }, {
2616
+ notify: ({
2617
+ channel: string;
2618
+ surface: "relay";
2619
+ } | {
2620
+ surface: "slack";
2621
+ channel?: string | undefined;
2622
+ dm?: string | undefined;
2623
+ } | {
2624
+ surface: "telegram";
2625
+ chatId: string;
2626
+ } | {
2627
+ surface: "linear";
2628
+ commentOnIssue: true;
2629
+ })[];
2630
+ }>>;
2631
+ }, "strict", z.ZodTypeAny, {
2632
+ onTicketDispatch?: {
2633
+ notify: ({
2634
+ channel: string;
2635
+ surface: "relay";
2636
+ } | {
2637
+ surface: "slack";
2638
+ channel?: string | undefined;
2639
+ dm?: string | undefined;
2640
+ } | {
2641
+ surface: "telegram";
2642
+ chatId: string;
2643
+ } | {
2644
+ surface: "linear";
2645
+ commentOnIssue: true;
2646
+ })[];
2647
+ } | undefined;
2648
+ }, {
2649
+ onTicketDispatch?: {
2650
+ notify: ({
2651
+ channel: string;
2652
+ surface: "relay";
2653
+ } | {
2654
+ surface: "slack";
2655
+ channel?: string | undefined;
2656
+ dm?: string | undefined;
2657
+ } | {
2658
+ surface: "telegram";
2659
+ chatId: string;
2660
+ } | {
2661
+ surface: "linear";
2662
+ commentOnIssue: true;
2663
+ })[];
2664
+ } | undefined;
2665
+ }>>;
2263
2666
  github: z.ZodDefault<z.ZodObject<{
2264
2667
  identity: z.ZodDefault<z.ZodEnum<["app", "user", "auto"]>>;
2265
2668
  }, "strip", z.ZodTypeAny, {
@@ -2923,6 +3326,23 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2923
3326
  notifyHumans: boolean;
2924
3327
  };
2925
3328
  batchSize: number;
3329
+ linear: {
3330
+ states: {
3331
+ readyForAgent?: string | undefined;
3332
+ agentImplementing?: string | undefined;
3333
+ inPlanning?: string | undefined;
3334
+ done?: string | undefined;
3335
+ humanReview?: string | undefined;
3336
+ };
3337
+ statesByTeam: Record<string, {
3338
+ readyForAgent?: string | undefined;
3339
+ agentImplementing?: string | undefined;
3340
+ inPlanning?: string | undefined;
3341
+ done?: string | undefined;
3342
+ humanReview?: string | undefined;
3343
+ }>;
3344
+ teamIds: Record<string, string>;
3345
+ };
2926
3346
  subscription: {
2927
3347
  teams: string[];
2928
3348
  projects: string[];
@@ -2934,10 +3354,12 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2934
3354
  pollIntervalMs: number;
2935
3355
  eventLimit: number;
2936
3356
  replaySkewMarginMs: number;
3357
+ reconcileIntervalMs: number;
2937
3358
  };
2938
3359
  dispatch: {
2939
3360
  errorCooldownMs: number;
2940
3361
  maxAttempts: number;
3362
+ agentHoldTimeoutMs: number;
2941
3363
  };
2942
3364
  loop: {
2943
3365
  maxIterations: number;
@@ -2971,23 +3393,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2971
3393
  reviewer: "spawn:codex" | "spawn:claude";
2972
3394
  babysitter: "spawn:codex" | "spawn:claude";
2973
3395
  };
2974
- linear: {
2975
- states: {
2976
- readyForAgent?: string | undefined;
2977
- agentImplementing?: string | undefined;
2978
- inPlanning?: string | undefined;
2979
- done?: string | undefined;
2980
- humanReview?: string | undefined;
2981
- };
2982
- statesByTeam: Record<string, {
2983
- readyForAgent?: string | undefined;
2984
- agentImplementing?: string | undefined;
2985
- inPlanning?: string | undefined;
2986
- done?: string | undefined;
2987
- humanReview?: string | undefined;
2988
- }>;
2989
- teamIds: Record<string, string>;
2990
- };
2991
3396
  github: {
2992
3397
  identity: "app" | "user" | "auto";
2993
3398
  };
@@ -3060,8 +3465,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3060
3465
  capabilities: string[];
3061
3466
  dryRun: boolean;
3062
3467
  cloneRoot?: string | undefined;
3063
- workspaceId?: string | undefined;
3064
- localMountRoot?: string | undefined;
3065
3468
  slack?: {
3066
3469
  channel: string;
3067
3470
  style: "threaded-summarized";
@@ -3070,7 +3473,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3070
3473
  staleAfterMs: number;
3071
3474
  conversationCoalesceMs: number;
3072
3475
  } | undefined;
3476
+ workspaceId?: string | undefined;
3477
+ localMountRoot?: string | undefined;
3073
3478
  issueSource?: "linear" | "github" | undefined;
3479
+ hooks?: {
3480
+ onTicketDispatch?: {
3481
+ notify: ({
3482
+ channel: string;
3483
+ surface: "relay";
3484
+ } | {
3485
+ surface: "slack";
3486
+ channel?: string | undefined;
3487
+ dm?: string | undefined;
3488
+ } | {
3489
+ surface: "telegram";
3490
+ chatId: string;
3491
+ } | {
3492
+ surface: "linear";
3493
+ commentOnIssue: true;
3494
+ })[];
3495
+ } | undefined;
3496
+ } | undefined;
3074
3497
  preview?: {
3075
3498
  registryPath: string;
3076
3499
  provider: "tailscale-serve";
@@ -3114,6 +3537,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3114
3537
  notifyHumans?: boolean | undefined;
3115
3538
  } | undefined;
3116
3539
  batchSize?: number | undefined;
3540
+ slack?: {
3541
+ channel: string;
3542
+ style?: "threaded-summarized" | undefined;
3543
+ botUserId?: string | undefined;
3544
+ stakeholderUserIds?: string[] | undefined;
3545
+ staleAfterMs?: number | undefined;
3546
+ conversationCoalesceMs?: number | undefined;
3547
+ } | undefined;
3548
+ linear?: {
3549
+ states?: {
3550
+ readyForAgent?: string | undefined;
3551
+ agentImplementing?: string | undefined;
3552
+ inPlanning?: string | undefined;
3553
+ done?: string | undefined;
3554
+ humanReview?: string | undefined;
3555
+ } | undefined;
3556
+ statesByTeam?: Record<string, {
3557
+ readyForAgent?: string | undefined;
3558
+ agentImplementing?: string | undefined;
3559
+ inPlanning?: string | undefined;
3560
+ done?: string | undefined;
3561
+ humanReview?: string | undefined;
3562
+ } | undefined> | undefined;
3563
+ teamIds?: Record<string, string> | undefined;
3564
+ } | undefined;
3117
3565
  workspaceId?: string | undefined;
3118
3566
  localMountRoot?: string | undefined;
3119
3567
  subscription?: {
@@ -3127,10 +3575,12 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3127
3575
  pollIntervalMs?: number | undefined;
3128
3576
  eventLimit?: number | undefined;
3129
3577
  replaySkewMarginMs?: number | undefined;
3578
+ reconcileIntervalMs?: number | undefined;
3130
3579
  } | undefined;
3131
3580
  dispatch?: {
3132
3581
  errorCooldownMs?: number | undefined;
3133
3582
  maxAttempts?: number | undefined;
3583
+ agentHoldTimeoutMs?: number | undefined;
3134
3584
  } | undefined;
3135
3585
  loop?: {
3136
3586
  maxIterations?: number | undefined;
@@ -3150,31 +3600,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3150
3600
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3151
3601
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3152
3602
  } | undefined;
3153
- slack?: {
3154
- channel: string;
3155
- style?: "threaded-summarized" | undefined;
3156
- botUserId?: string | undefined;
3157
- stakeholderUserIds?: string[] | undefined;
3158
- staleAfterMs?: number | undefined;
3159
- conversationCoalesceMs?: number | undefined;
3160
- } | undefined;
3161
- linear?: {
3162
- states?: {
3163
- readyForAgent?: string | undefined;
3164
- agentImplementing?: string | undefined;
3165
- inPlanning?: string | undefined;
3166
- done?: string | undefined;
3167
- humanReview?: string | undefined;
3168
- } | undefined;
3169
- statesByTeam?: Record<string, {
3170
- readyForAgent?: string | undefined;
3171
- agentImplementing?: string | undefined;
3172
- inPlanning?: string | undefined;
3173
- done?: string | undefined;
3174
- humanReview?: string | undefined;
3175
- } | undefined> | undefined;
3176
- teamIds?: Record<string, string> | undefined;
3177
- } | undefined;
3178
3603
  github?: {
3179
3604
  identity?: "app" | "user" | "auto" | undefined;
3180
3605
  } | undefined;
@@ -3187,6 +3612,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3187
3612
  batchSize?: number | undefined;
3188
3613
  requestTimeoutMs?: number | undefined;
3189
3614
  } | undefined;
3615
+ hooks?: {
3616
+ onTicketDispatch?: {
3617
+ notify: ({
3618
+ channel: string;
3619
+ surface: "relay";
3620
+ } | {
3621
+ surface: "slack";
3622
+ channel?: string | undefined;
3623
+ dm?: string | undefined;
3624
+ } | {
3625
+ surface: "telegram";
3626
+ chatId: string;
3627
+ } | {
3628
+ surface: "linear";
3629
+ commentOnIssue: true;
3630
+ })[];
3631
+ } | undefined;
3632
+ } | undefined;
3190
3633
  preview?: {
3191
3634
  registryPath?: string | undefined;
3192
3635
  provider?: "tailscale-serve" | undefined;
@@ -3275,6 +3718,23 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3275
3718
  notifyHumans: boolean;
3276
3719
  };
3277
3720
  batchSize: number;
3721
+ linear: {
3722
+ states: {
3723
+ readyForAgent?: string | undefined;
3724
+ agentImplementing?: string | undefined;
3725
+ inPlanning?: string | undefined;
3726
+ done?: string | undefined;
3727
+ humanReview?: string | undefined;
3728
+ };
3729
+ statesByTeam: Record<string, {
3730
+ readyForAgent?: string | undefined;
3731
+ agentImplementing?: string | undefined;
3732
+ inPlanning?: string | undefined;
3733
+ done?: string | undefined;
3734
+ humanReview?: string | undefined;
3735
+ }>;
3736
+ teamIds: Record<string, string>;
3737
+ };
3278
3738
  subscription: {
3279
3739
  teams: string[];
3280
3740
  projects: string[];
@@ -3286,10 +3746,12 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3286
3746
  pollIntervalMs: number;
3287
3747
  eventLimit: number;
3288
3748
  replaySkewMarginMs: number;
3749
+ reconcileIntervalMs: number;
3289
3750
  };
3290
3751
  dispatch: {
3291
3752
  errorCooldownMs: number;
3292
3753
  maxAttempts: number;
3754
+ agentHoldTimeoutMs: number;
3293
3755
  };
3294
3756
  loop: {
3295
3757
  maxIterations: number;
@@ -3323,23 +3785,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3323
3785
  reviewer: "spawn:codex" | "spawn:claude";
3324
3786
  babysitter: "spawn:codex" | "spawn:claude";
3325
3787
  };
3326
- linear: {
3327
- states: {
3328
- readyForAgent?: string | undefined;
3329
- agentImplementing?: string | undefined;
3330
- inPlanning?: string | undefined;
3331
- done?: string | undefined;
3332
- humanReview?: string | undefined;
3333
- };
3334
- statesByTeam: Record<string, {
3335
- readyForAgent?: string | undefined;
3336
- agentImplementing?: string | undefined;
3337
- inPlanning?: string | undefined;
3338
- done?: string | undefined;
3339
- humanReview?: string | undefined;
3340
- }>;
3341
- teamIds: Record<string, string>;
3342
- };
3343
3788
  github: {
3344
3789
  identity: "app" | "user" | "auto";
3345
3790
  };
@@ -3412,8 +3857,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3412
3857
  capabilities: string[];
3413
3858
  dryRun: boolean;
3414
3859
  cloneRoot?: string | undefined;
3415
- workspaceId?: string | undefined;
3416
- localMountRoot?: string | undefined;
3417
3860
  slack?: {
3418
3861
  channel: string;
3419
3862
  style: "threaded-summarized";
@@ -3422,7 +3865,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3422
3865
  staleAfterMs: number;
3423
3866
  conversationCoalesceMs: number;
3424
3867
  } | undefined;
3868
+ workspaceId?: string | undefined;
3869
+ localMountRoot?: string | undefined;
3425
3870
  issueSource?: "linear" | "github" | undefined;
3871
+ hooks?: {
3872
+ onTicketDispatch?: {
3873
+ notify: ({
3874
+ channel: string;
3875
+ surface: "relay";
3876
+ } | {
3877
+ surface: "slack";
3878
+ channel?: string | undefined;
3879
+ dm?: string | undefined;
3880
+ } | {
3881
+ surface: "telegram";
3882
+ chatId: string;
3883
+ } | {
3884
+ surface: "linear";
3885
+ commentOnIssue: true;
3886
+ })[];
3887
+ } | undefined;
3888
+ } | undefined;
3426
3889
  preview?: {
3427
3890
  registryPath: string;
3428
3891
  provider: "tailscale-serve";
@@ -3466,6 +3929,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3466
3929
  notifyHumans?: boolean | undefined;
3467
3930
  } | undefined;
3468
3931
  batchSize?: number | undefined;
3932
+ slack?: {
3933
+ channel: string;
3934
+ style?: "threaded-summarized" | undefined;
3935
+ botUserId?: string | undefined;
3936
+ stakeholderUserIds?: string[] | undefined;
3937
+ staleAfterMs?: number | undefined;
3938
+ conversationCoalesceMs?: number | undefined;
3939
+ } | undefined;
3940
+ linear?: {
3941
+ states?: {
3942
+ readyForAgent?: string | undefined;
3943
+ agentImplementing?: string | undefined;
3944
+ inPlanning?: string | undefined;
3945
+ done?: string | undefined;
3946
+ humanReview?: string | undefined;
3947
+ } | undefined;
3948
+ statesByTeam?: Record<string, {
3949
+ readyForAgent?: string | undefined;
3950
+ agentImplementing?: string | undefined;
3951
+ inPlanning?: string | undefined;
3952
+ done?: string | undefined;
3953
+ humanReview?: string | undefined;
3954
+ } | undefined> | undefined;
3955
+ teamIds?: Record<string, string> | undefined;
3956
+ } | undefined;
3469
3957
  workspaceId?: string | undefined;
3470
3958
  localMountRoot?: string | undefined;
3471
3959
  subscription?: {
@@ -3479,10 +3967,12 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3479
3967
  pollIntervalMs?: number | undefined;
3480
3968
  eventLimit?: number | undefined;
3481
3969
  replaySkewMarginMs?: number | undefined;
3970
+ reconcileIntervalMs?: number | undefined;
3482
3971
  } | undefined;
3483
3972
  dispatch?: {
3484
3973
  errorCooldownMs?: number | undefined;
3485
3974
  maxAttempts?: number | undefined;
3975
+ agentHoldTimeoutMs?: number | undefined;
3486
3976
  } | undefined;
3487
3977
  loop?: {
3488
3978
  maxIterations?: number | undefined;
@@ -3502,31 +3992,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3502
3992
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3503
3993
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3504
3994
  } | undefined;
3505
- slack?: {
3506
- channel: string;
3507
- style?: "threaded-summarized" | undefined;
3508
- botUserId?: string | undefined;
3509
- stakeholderUserIds?: string[] | undefined;
3510
- staleAfterMs?: number | undefined;
3511
- conversationCoalesceMs?: number | undefined;
3512
- } | undefined;
3513
- linear?: {
3514
- states?: {
3515
- readyForAgent?: string | undefined;
3516
- agentImplementing?: string | undefined;
3517
- inPlanning?: string | undefined;
3518
- done?: string | undefined;
3519
- humanReview?: string | undefined;
3520
- } | undefined;
3521
- statesByTeam?: Record<string, {
3522
- readyForAgent?: string | undefined;
3523
- agentImplementing?: string | undefined;
3524
- inPlanning?: string | undefined;
3525
- done?: string | undefined;
3526
- humanReview?: string | undefined;
3527
- } | undefined> | undefined;
3528
- teamIds?: Record<string, string> | undefined;
3529
- } | undefined;
3530
3995
  github?: {
3531
3996
  identity?: "app" | "user" | "auto" | undefined;
3532
3997
  } | undefined;
@@ -3539,6 +4004,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3539
4004
  batchSize?: number | undefined;
3540
4005
  requestTimeoutMs?: number | undefined;
3541
4006
  } | undefined;
4007
+ hooks?: {
4008
+ onTicketDispatch?: {
4009
+ notify: ({
4010
+ channel: string;
4011
+ surface: "relay";
4012
+ } | {
4013
+ surface: "slack";
4014
+ channel?: string | undefined;
4015
+ dm?: string | undefined;
4016
+ } | {
4017
+ surface: "telegram";
4018
+ chatId: string;
4019
+ } | {
4020
+ surface: "linear";
4021
+ commentOnIssue: true;
4022
+ })[];
4023
+ } | undefined;
4024
+ } | undefined;
3542
4025
  preview?: {
3543
4026
  registryPath?: string | undefined;
3544
4027
  provider?: "tailscale-serve" | undefined;
@@ -3674,15 +4157,34 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3674
4157
  notifyHumans: boolean;
3675
4158
  };
3676
4159
  batchSize: number;
4160
+ linear: {
4161
+ states: {
4162
+ readyForAgent?: string | undefined;
4163
+ agentImplementing?: string | undefined;
4164
+ inPlanning?: string | undefined;
4165
+ done?: string | undefined;
4166
+ humanReview?: string | undefined;
4167
+ };
4168
+ statesByTeam: Record<string, {
4169
+ readyForAgent?: string | undefined;
4170
+ agentImplementing?: string | undefined;
4171
+ inPlanning?: string | undefined;
4172
+ done?: string | undefined;
4173
+ humanReview?: string | undefined;
4174
+ }>;
4175
+ teamIds: Record<string, string>;
4176
+ };
3677
4177
  liveSubscription: {
3678
4178
  transport: "subscribe-and-poll" | "subscribe" | "poll";
3679
4179
  pollIntervalMs: number;
3680
4180
  eventLimit: number;
3681
4181
  replaySkewMarginMs: number;
4182
+ reconcileIntervalMs: number;
3682
4183
  };
3683
4184
  dispatch: {
3684
4185
  errorCooldownMs: number;
3685
4186
  maxAttempts: number;
4187
+ agentHoldTimeoutMs: number;
3686
4188
  };
3687
4189
  models: {
3688
4190
  babysitter: string;
@@ -3695,23 +4197,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3695
4197
  reviewer: "spawn:codex" | "spawn:claude";
3696
4198
  babysitter: "spawn:codex" | "spawn:claude";
3697
4199
  };
3698
- linear: {
3699
- states: {
3700
- readyForAgent?: string | undefined;
3701
- agentImplementing?: string | undefined;
3702
- inPlanning?: string | undefined;
3703
- done?: string | undefined;
3704
- humanReview?: string | undefined;
3705
- };
3706
- statesByTeam: Record<string, {
3707
- readyForAgent?: string | undefined;
3708
- agentImplementing?: string | undefined;
3709
- inPlanning?: string | undefined;
3710
- done?: string | undefined;
3711
- humanReview?: string | undefined;
3712
- }>;
3713
- teamIds: Record<string, string>;
3714
- };
3715
4200
  github: {
3716
4201
  identity: "app" | "user" | "auto";
3717
4202
  };
@@ -3783,8 +4268,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3783
4268
  };
3784
4269
  capabilities: string[];
3785
4270
  dryRun: boolean;
3786
- workspaceId?: string | undefined;
3787
- localMountRoot?: string | undefined;
3788
4271
  slack?: {
3789
4272
  channel: string;
3790
4273
  style: "threaded-summarized";
@@ -3793,7 +4276,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3793
4276
  staleAfterMs: number;
3794
4277
  conversationCoalesceMs: number;
3795
4278
  } | undefined;
4279
+ workspaceId?: string | undefined;
4280
+ localMountRoot?: string | undefined;
3796
4281
  issueSource?: "linear" | "github" | undefined;
4282
+ hooks?: {
4283
+ onTicketDispatch?: {
4284
+ notify: ({
4285
+ channel: string;
4286
+ surface: "relay";
4287
+ } | {
4288
+ surface: "slack";
4289
+ channel?: string | undefined;
4290
+ dm?: string | undefined;
4291
+ } | {
4292
+ surface: "telegram";
4293
+ chatId: string;
4294
+ } | {
4295
+ surface: "linear";
4296
+ commentOnIssue: true;
4297
+ })[];
4298
+ } | undefined;
4299
+ } | undefined;
3797
4300
  }, {
3798
4301
  repos: {
3799
4302
  default?: string | undefined;
@@ -3822,6 +4325,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3822
4325
  notifyHumans?: boolean | undefined;
3823
4326
  } | undefined;
3824
4327
  batchSize?: number | undefined;
4328
+ slack?: {
4329
+ channel: string;
4330
+ style?: "threaded-summarized" | undefined;
4331
+ botUserId?: string | undefined;
4332
+ stakeholderUserIds?: string[] | undefined;
4333
+ staleAfterMs?: number | undefined;
4334
+ conversationCoalesceMs?: number | undefined;
4335
+ } | undefined;
4336
+ linear?: {
4337
+ states?: {
4338
+ readyForAgent?: string | undefined;
4339
+ agentImplementing?: string | undefined;
4340
+ inPlanning?: string | undefined;
4341
+ done?: string | undefined;
4342
+ humanReview?: string | undefined;
4343
+ } | undefined;
4344
+ statesByTeam?: Record<string, {
4345
+ readyForAgent?: string | undefined;
4346
+ agentImplementing?: string | undefined;
4347
+ inPlanning?: string | undefined;
4348
+ done?: string | undefined;
4349
+ humanReview?: string | undefined;
4350
+ } | undefined> | undefined;
4351
+ teamIds?: Record<string, string> | undefined;
4352
+ } | undefined;
3825
4353
  workspaceId?: string | undefined;
3826
4354
  localMountRoot?: string | undefined;
3827
4355
  subscription?: {
@@ -3835,10 +4363,12 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3835
4363
  pollIntervalMs?: number | undefined;
3836
4364
  eventLimit?: number | undefined;
3837
4365
  replaySkewMarginMs?: number | undefined;
4366
+ reconcileIntervalMs?: number | undefined;
3838
4367
  } | undefined;
3839
4368
  dispatch?: {
3840
4369
  errorCooldownMs?: number | undefined;
3841
4370
  maxAttempts?: number | undefined;
4371
+ agentHoldTimeoutMs?: number | undefined;
3842
4372
  } | undefined;
3843
4373
  loop?: {
3844
4374
  maxIterations?: number | undefined;
@@ -3858,31 +4388,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3858
4388
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3859
4389
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3860
4390
  } | undefined;
3861
- slack?: {
3862
- channel: string;
3863
- style?: "threaded-summarized" | undefined;
3864
- botUserId?: string | undefined;
3865
- stakeholderUserIds?: string[] | undefined;
3866
- staleAfterMs?: number | undefined;
3867
- conversationCoalesceMs?: number | undefined;
3868
- } | undefined;
3869
- linear?: {
3870
- states?: {
3871
- readyForAgent?: string | undefined;
3872
- agentImplementing?: string | undefined;
3873
- inPlanning?: string | undefined;
3874
- done?: string | undefined;
3875
- humanReview?: string | undefined;
3876
- } | undefined;
3877
- statesByTeam?: Record<string, {
3878
- readyForAgent?: string | undefined;
3879
- agentImplementing?: string | undefined;
3880
- inPlanning?: string | undefined;
3881
- done?: string | undefined;
3882
- humanReview?: string | undefined;
3883
- } | undefined> | undefined;
3884
- teamIds?: Record<string, string> | undefined;
3885
- } | undefined;
3886
4391
  github?: {
3887
4392
  identity?: "app" | "user" | "auto" | undefined;
3888
4393
  } | undefined;
@@ -3895,6 +4400,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3895
4400
  batchSize?: number | undefined;
3896
4401
  requestTimeoutMs?: number | undefined;
3897
4402
  } | undefined;
4403
+ hooks?: {
4404
+ onTicketDispatch?: {
4405
+ notify: ({
4406
+ channel: string;
4407
+ surface: "relay";
4408
+ } | {
4409
+ surface: "slack";
4410
+ channel?: string | undefined;
4411
+ dm?: string | undefined;
4412
+ } | {
4413
+ surface: "telegram";
4414
+ chatId: string;
4415
+ } | {
4416
+ surface: "linear";
4417
+ commentOnIssue: true;
4418
+ })[];
4419
+ } | undefined;
4420
+ } | undefined;
3898
4421
  preview?: {
3899
4422
  registryPath?: string | undefined;
3900
4423
  provider?: "tailscale-serve" | undefined;