@agent-relay/factory 0.1.58 → 0.1.60

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 (60) hide show
  1. package/README.md +13 -0
  2. package/dist/cli/fleet.d.ts +7 -1
  3. package/dist/cli/fleet.d.ts.map +1 -1
  4. package/dist/cli/fleet.js +126 -10
  5. package/dist/cli/fleet.js.map +1 -1
  6. package/dist/config/schema.d.ts +777 -273
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/config/schema.js +37 -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 +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/issue-key-match.d.ts +6 -0
  21. package/dist/issue-key-match.d.ts.map +1 -1
  22. package/dist/issue-key-match.js +14 -0
  23. package/dist/issue-key-match.js.map +1 -1
  24. package/dist/mount/relayfile-github-connection-write.d.ts.map +1 -1
  25. package/dist/mount/relayfile-github-connection-write.js +6 -3
  26. package/dist/mount/relayfile-github-connection-write.js.map +1 -1
  27. package/dist/orchestrator/batch-tracker.d.ts +2 -1
  28. package/dist/orchestrator/batch-tracker.d.ts.map +1 -1
  29. package/dist/orchestrator/batch-tracker.js.map +1 -1
  30. package/dist/orchestrator/factory.d.ts.map +1 -1
  31. package/dist/orchestrator/factory.js +1473 -99
  32. package/dist/orchestrator/factory.js.map +1 -1
  33. package/dist/ports/fleet.d.ts +4 -0
  34. package/dist/ports/fleet.d.ts.map +1 -1
  35. package/dist/ports/mount.d.ts +2 -0
  36. package/dist/ports/mount.d.ts.map +1 -1
  37. package/dist/ports/state.d.ts +45 -1
  38. package/dist/ports/state.d.ts.map +1 -1
  39. package/dist/state/file-state-store.d.ts +6 -1
  40. package/dist/state/file-state-store.d.ts.map +1 -1
  41. package/dist/state/file-state-store.js +119 -2
  42. package/dist/state/file-state-store.js.map +1 -1
  43. package/dist/state/in-memory-state-store.d.ts +6 -1
  44. package/dist/state/in-memory-state-store.d.ts.map +1 -1
  45. package/dist/state/in-memory-state-store.js +62 -0
  46. package/dist/state/in-memory-state-store.js.map +1 -1
  47. package/dist/triage/schema.d.ts +36 -0
  48. package/dist/triage/schema.d.ts.map +1 -1
  49. package/dist/triage/schema.js +2 -0
  50. package/dist/triage/schema.js.map +1 -1
  51. package/dist/types.d.ts +31 -0
  52. package/dist/types.d.ts.map +1 -1
  53. package/dist/version-info.d.ts +21 -0
  54. package/dist/version-info.d.ts.map +1 -0
  55. package/dist/version-info.js +146 -0
  56. package/dist/version-info.js.map +1 -0
  57. package/dist/writeback/github.d.ts.map +1 -1
  58. package/dist/writeback/github.js +12 -0
  59. package/dist/writeback/github.js.map +1 -1
  60. package/package.json +1 -1
@@ -26,16 +26,20 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
26
26
  pollIntervalMs: z.ZodDefault<z.ZodNumber>;
27
27
  eventLimit: z.ZodDefault<z.ZodNumber>;
28
28
  replaySkewMarginMs: z.ZodDefault<z.ZodNumber>;
29
+ /** Independent source-of-truth sweep; live event watermarks remain a latency optimization. */
30
+ reconcileIntervalMs: z.ZodDefault<z.ZodNumber>;
29
31
  }, "strip", z.ZodTypeAny, {
30
32
  transport: "subscribe-and-poll" | "subscribe" | "poll";
31
33
  pollIntervalMs: number;
32
34
  eventLimit: number;
33
35
  replaySkewMarginMs: number;
36
+ reconcileIntervalMs: number;
34
37
  }, {
35
38
  transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
36
39
  pollIntervalMs?: number | undefined;
37
40
  eventLimit?: number | undefined;
38
41
  replaySkewMarginMs?: number | undefined;
42
+ reconcileIntervalMs?: number | undefined;
39
43
  }>>;
40
44
  dispatch: z.ZodDefault<z.ZodObject<{
41
45
  errorCooldownMs: z.ZodDefault<z.ZodNumber>;
@@ -211,6 +215,140 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
211
215
  batchSize?: number | undefined;
212
216
  requestTimeoutMs?: number | undefined;
213
217
  }>>;
218
+ hooks: z.ZodOptional<z.ZodObject<{
219
+ onTicketDispatch: z.ZodOptional<z.ZodObject<{
220
+ notify: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"surface", [z.ZodObject<{
221
+ surface: z.ZodLiteral<"relay">;
222
+ channel: z.ZodString;
223
+ }, "strict", z.ZodTypeAny, {
224
+ channel: string;
225
+ surface: "relay";
226
+ }, {
227
+ channel: string;
228
+ surface: "relay";
229
+ }>, z.ZodObject<{
230
+ surface: z.ZodLiteral<"slack">;
231
+ channel: z.ZodOptional<z.ZodString>;
232
+ dm: z.ZodOptional<z.ZodString>;
233
+ }, "strict", z.ZodTypeAny, {
234
+ surface: "slack";
235
+ channel?: string | undefined;
236
+ dm?: string | undefined;
237
+ }, {
238
+ surface: "slack";
239
+ channel?: string | undefined;
240
+ dm?: string | undefined;
241
+ }>, z.ZodObject<{
242
+ surface: z.ZodLiteral<"telegram">;
243
+ chatId: z.ZodString;
244
+ }, "strict", z.ZodTypeAny, {
245
+ surface: "telegram";
246
+ chatId: string;
247
+ }, {
248
+ surface: "telegram";
249
+ chatId: string;
250
+ }>, z.ZodObject<{
251
+ surface: z.ZodLiteral<"linear">;
252
+ commentOnIssue: z.ZodLiteral<true>;
253
+ }, "strict", z.ZodTypeAny, {
254
+ surface: "linear";
255
+ commentOnIssue: true;
256
+ }, {
257
+ surface: "linear";
258
+ commentOnIssue: true;
259
+ }>]>, {
260
+ channel: string;
261
+ surface: "relay";
262
+ } | {
263
+ surface: "slack";
264
+ channel?: string | undefined;
265
+ dm?: string | undefined;
266
+ } | {
267
+ surface: "telegram";
268
+ chatId: string;
269
+ } | {
270
+ surface: "linear";
271
+ commentOnIssue: true;
272
+ }, {
273
+ channel: string;
274
+ surface: "relay";
275
+ } | {
276
+ surface: "slack";
277
+ channel?: string | undefined;
278
+ dm?: string | undefined;
279
+ } | {
280
+ surface: "telegram";
281
+ chatId: string;
282
+ } | {
283
+ surface: "linear";
284
+ commentOnIssue: true;
285
+ }>, "many">;
286
+ }, "strict", z.ZodTypeAny, {
287
+ notify: ({
288
+ channel: string;
289
+ surface: "relay";
290
+ } | {
291
+ surface: "slack";
292
+ channel?: string | undefined;
293
+ dm?: string | undefined;
294
+ } | {
295
+ surface: "telegram";
296
+ chatId: string;
297
+ } | {
298
+ surface: "linear";
299
+ commentOnIssue: true;
300
+ })[];
301
+ }, {
302
+ notify: ({
303
+ channel: string;
304
+ surface: "relay";
305
+ } | {
306
+ surface: "slack";
307
+ channel?: string | undefined;
308
+ dm?: string | undefined;
309
+ } | {
310
+ surface: "telegram";
311
+ chatId: string;
312
+ } | {
313
+ surface: "linear";
314
+ commentOnIssue: true;
315
+ })[];
316
+ }>>;
317
+ }, "strict", z.ZodTypeAny, {
318
+ onTicketDispatch?: {
319
+ notify: ({
320
+ channel: string;
321
+ surface: "relay";
322
+ } | {
323
+ surface: "slack";
324
+ channel?: string | undefined;
325
+ dm?: string | undefined;
326
+ } | {
327
+ surface: "telegram";
328
+ chatId: string;
329
+ } | {
330
+ surface: "linear";
331
+ commentOnIssue: true;
332
+ })[];
333
+ } | undefined;
334
+ }, {
335
+ onTicketDispatch?: {
336
+ notify: ({
337
+ channel: string;
338
+ surface: "relay";
339
+ } | {
340
+ surface: "slack";
341
+ channel?: string | undefined;
342
+ dm?: string | undefined;
343
+ } | {
344
+ surface: "telegram";
345
+ chatId: string;
346
+ } | {
347
+ surface: "linear";
348
+ commentOnIssue: true;
349
+ })[];
350
+ } | undefined;
351
+ }>>;
214
352
  preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
215
353
  provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
216
354
  access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
@@ -865,6 +1003,23 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
865
1003
  notifyHumans: boolean;
866
1004
  };
867
1005
  batchSize: number;
1006
+ linear: {
1007
+ states: {
1008
+ readyForAgent?: string | undefined;
1009
+ agentImplementing?: string | undefined;
1010
+ inPlanning?: string | undefined;
1011
+ done?: string | undefined;
1012
+ humanReview?: string | undefined;
1013
+ };
1014
+ statesByTeam: Record<string, {
1015
+ readyForAgent?: string | undefined;
1016
+ agentImplementing?: string | undefined;
1017
+ inPlanning?: string | undefined;
1018
+ done?: string | undefined;
1019
+ humanReview?: string | undefined;
1020
+ }>;
1021
+ teamIds: Record<string, string>;
1022
+ };
868
1023
  subscription: {
869
1024
  teams: string[];
870
1025
  projects: string[];
@@ -876,6 +1031,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
876
1031
  pollIntervalMs: number;
877
1032
  eventLimit: number;
878
1033
  replaySkewMarginMs: number;
1034
+ reconcileIntervalMs: number;
879
1035
  };
880
1036
  dispatch: {
881
1037
  errorCooldownMs: number;
@@ -913,23 +1069,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
913
1069
  reviewer: "spawn:codex" | "spawn:claude";
914
1070
  babysitter: "spawn:codex" | "spawn:claude";
915
1071
  };
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
1072
  github: {
934
1073
  identity: "app" | "user" | "auto";
935
1074
  };
@@ -999,8 +1138,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
999
1138
  };
1000
1139
  } | undefined;
1001
1140
  };
1002
- workspaceId?: string | undefined;
1003
- localMountRoot?: string | undefined;
1004
1141
  slack?: {
1005
1142
  channel: string;
1006
1143
  style: "threaded-summarized";
@@ -1009,7 +1146,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1009
1146
  staleAfterMs: number;
1010
1147
  conversationCoalesceMs: number;
1011
1148
  } | undefined;
1149
+ workspaceId?: string | undefined;
1150
+ localMountRoot?: string | undefined;
1012
1151
  issueSource?: "linear" | "github" | undefined;
1152
+ hooks?: {
1153
+ onTicketDispatch?: {
1154
+ notify: ({
1155
+ channel: string;
1156
+ surface: "relay";
1157
+ } | {
1158
+ surface: "slack";
1159
+ channel?: string | undefined;
1160
+ dm?: string | undefined;
1161
+ } | {
1162
+ surface: "telegram";
1163
+ chatId: string;
1164
+ } | {
1165
+ surface: "linear";
1166
+ commentOnIssue: true;
1167
+ })[];
1168
+ } | undefined;
1169
+ } | undefined;
1013
1170
  preview?: {
1014
1171
  registryPath: string;
1015
1172
  provider: "tailscale-serve";
@@ -1049,6 +1206,31 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1049
1206
  notifyHumans?: boolean | undefined;
1050
1207
  } | undefined;
1051
1208
  batchSize?: number | undefined;
1209
+ slack?: {
1210
+ channel: string;
1211
+ style?: "threaded-summarized" | undefined;
1212
+ botUserId?: string | undefined;
1213
+ stakeholderUserIds?: string[] | undefined;
1214
+ staleAfterMs?: number | undefined;
1215
+ conversationCoalesceMs?: number | undefined;
1216
+ } | undefined;
1217
+ linear?: {
1218
+ states?: {
1219
+ readyForAgent?: string | undefined;
1220
+ agentImplementing?: string | undefined;
1221
+ inPlanning?: string | undefined;
1222
+ done?: string | undefined;
1223
+ humanReview?: string | undefined;
1224
+ } | undefined;
1225
+ statesByTeam?: Record<string, {
1226
+ readyForAgent?: string | undefined;
1227
+ agentImplementing?: string | undefined;
1228
+ inPlanning?: string | undefined;
1229
+ done?: string | undefined;
1230
+ humanReview?: string | undefined;
1231
+ } | undefined> | undefined;
1232
+ teamIds?: Record<string, string> | undefined;
1233
+ } | undefined;
1052
1234
  workspaceId?: string | undefined;
1053
1235
  localMountRoot?: string | undefined;
1054
1236
  subscription?: {
@@ -1062,6 +1244,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1062
1244
  pollIntervalMs?: number | undefined;
1063
1245
  eventLimit?: number | undefined;
1064
1246
  replaySkewMarginMs?: number | undefined;
1247
+ reconcileIntervalMs?: number | undefined;
1065
1248
  } | undefined;
1066
1249
  dispatch?: {
1067
1250
  errorCooldownMs?: number | undefined;
@@ -1085,31 +1268,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1085
1268
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1086
1269
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1087
1270
  } | 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
1271
  github?: {
1114
1272
  identity?: "app" | "user" | "auto" | undefined;
1115
1273
  } | undefined;
@@ -1122,6 +1280,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1122
1280
  batchSize?: number | undefined;
1123
1281
  requestTimeoutMs?: number | undefined;
1124
1282
  } | undefined;
1283
+ hooks?: {
1284
+ onTicketDispatch?: {
1285
+ notify: ({
1286
+ channel: string;
1287
+ surface: "relay";
1288
+ } | {
1289
+ surface: "slack";
1290
+ channel?: string | undefined;
1291
+ dm?: string | undefined;
1292
+ } | {
1293
+ surface: "telegram";
1294
+ chatId: string;
1295
+ } | {
1296
+ surface: "linear";
1297
+ commentOnIssue: true;
1298
+ })[];
1299
+ } | undefined;
1300
+ } | undefined;
1125
1301
  preview?: {
1126
1302
  registryPath?: string | undefined;
1127
1303
  provider?: "tailscale-serve" | undefined;
@@ -1205,6 +1381,23 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1205
1381
  notifyHumans: boolean;
1206
1382
  };
1207
1383
  batchSize: number;
1384
+ linear: {
1385
+ states: {
1386
+ readyForAgent?: string | undefined;
1387
+ agentImplementing?: string | undefined;
1388
+ inPlanning?: string | undefined;
1389
+ done?: string | undefined;
1390
+ humanReview?: string | undefined;
1391
+ };
1392
+ statesByTeam: Record<string, {
1393
+ readyForAgent?: string | undefined;
1394
+ agentImplementing?: string | undefined;
1395
+ inPlanning?: string | undefined;
1396
+ done?: string | undefined;
1397
+ humanReview?: string | undefined;
1398
+ }>;
1399
+ teamIds: Record<string, string>;
1400
+ };
1208
1401
  subscription: {
1209
1402
  teams: string[];
1210
1403
  projects: string[];
@@ -1216,6 +1409,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1216
1409
  pollIntervalMs: number;
1217
1410
  eventLimit: number;
1218
1411
  replaySkewMarginMs: number;
1412
+ reconcileIntervalMs: number;
1219
1413
  };
1220
1414
  dispatch: {
1221
1415
  errorCooldownMs: number;
@@ -1253,23 +1447,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1253
1447
  reviewer: "spawn:codex" | "spawn:claude";
1254
1448
  babysitter: "spawn:codex" | "spawn:claude";
1255
1449
  };
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
1450
  github: {
1274
1451
  identity: "app" | "user" | "auto";
1275
1452
  };
@@ -1339,8 +1516,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1339
1516
  };
1340
1517
  } | undefined;
1341
1518
  };
1342
- workspaceId?: string | undefined;
1343
- localMountRoot?: string | undefined;
1344
1519
  slack?: {
1345
1520
  channel: string;
1346
1521
  style: "threaded-summarized";
@@ -1349,7 +1524,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1349
1524
  staleAfterMs: number;
1350
1525
  conversationCoalesceMs: number;
1351
1526
  } | undefined;
1527
+ workspaceId?: string | undefined;
1528
+ localMountRoot?: string | undefined;
1352
1529
  issueSource?: "linear" | "github" | undefined;
1530
+ hooks?: {
1531
+ onTicketDispatch?: {
1532
+ notify: ({
1533
+ channel: string;
1534
+ surface: "relay";
1535
+ } | {
1536
+ surface: "slack";
1537
+ channel?: string | undefined;
1538
+ dm?: string | undefined;
1539
+ } | {
1540
+ surface: "telegram";
1541
+ chatId: string;
1542
+ } | {
1543
+ surface: "linear";
1544
+ commentOnIssue: true;
1545
+ })[];
1546
+ } | undefined;
1547
+ } | undefined;
1353
1548
  preview?: {
1354
1549
  registryPath: string;
1355
1550
  provider: "tailscale-serve";
@@ -1389,6 +1584,31 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1389
1584
  notifyHumans?: boolean | undefined;
1390
1585
  } | undefined;
1391
1586
  batchSize?: number | undefined;
1587
+ slack?: {
1588
+ channel: string;
1589
+ style?: "threaded-summarized" | undefined;
1590
+ botUserId?: string | undefined;
1591
+ stakeholderUserIds?: string[] | undefined;
1592
+ staleAfterMs?: number | undefined;
1593
+ conversationCoalesceMs?: number | undefined;
1594
+ } | undefined;
1595
+ linear?: {
1596
+ states?: {
1597
+ readyForAgent?: string | undefined;
1598
+ agentImplementing?: string | undefined;
1599
+ inPlanning?: string | undefined;
1600
+ done?: string | undefined;
1601
+ humanReview?: string | undefined;
1602
+ } | undefined;
1603
+ statesByTeam?: Record<string, {
1604
+ readyForAgent?: string | undefined;
1605
+ agentImplementing?: string | undefined;
1606
+ inPlanning?: string | undefined;
1607
+ done?: string | undefined;
1608
+ humanReview?: string | undefined;
1609
+ } | undefined> | undefined;
1610
+ teamIds?: Record<string, string> | undefined;
1611
+ } | undefined;
1392
1612
  workspaceId?: string | undefined;
1393
1613
  localMountRoot?: string | undefined;
1394
1614
  subscription?: {
@@ -1402,6 +1622,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1402
1622
  pollIntervalMs?: number | undefined;
1403
1623
  eventLimit?: number | undefined;
1404
1624
  replaySkewMarginMs?: number | undefined;
1625
+ reconcileIntervalMs?: number | undefined;
1405
1626
  } | undefined;
1406
1627
  dispatch?: {
1407
1628
  errorCooldownMs?: number | undefined;
@@ -1425,31 +1646,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1425
1646
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1426
1647
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1427
1648
  } | 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
1649
  github?: {
1454
1650
  identity?: "app" | "user" | "auto" | undefined;
1455
1651
  } | undefined;
@@ -1462,6 +1658,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1462
1658
  batchSize?: number | undefined;
1463
1659
  requestTimeoutMs?: number | undefined;
1464
1660
  } | undefined;
1661
+ hooks?: {
1662
+ onTicketDispatch?: {
1663
+ notify: ({
1664
+ channel: string;
1665
+ surface: "relay";
1666
+ } | {
1667
+ surface: "slack";
1668
+ channel?: string | undefined;
1669
+ dm?: string | undefined;
1670
+ } | {
1671
+ surface: "telegram";
1672
+ chatId: string;
1673
+ } | {
1674
+ surface: "linear";
1675
+ commentOnIssue: true;
1676
+ })[];
1677
+ } | undefined;
1678
+ } | undefined;
1465
1679
  preview?: {
1466
1680
  registryPath?: string | undefined;
1467
1681
  provider?: "tailscale-serve" | undefined;
@@ -1578,11 +1792,29 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1578
1792
  notifyHumans: boolean;
1579
1793
  };
1580
1794
  batchSize: number;
1795
+ linear: {
1796
+ states: {
1797
+ readyForAgent?: string | undefined;
1798
+ agentImplementing?: string | undefined;
1799
+ inPlanning?: string | undefined;
1800
+ done?: string | undefined;
1801
+ humanReview?: string | undefined;
1802
+ };
1803
+ statesByTeam: Record<string, {
1804
+ readyForAgent?: string | undefined;
1805
+ agentImplementing?: string | undefined;
1806
+ inPlanning?: string | undefined;
1807
+ done?: string | undefined;
1808
+ humanReview?: string | undefined;
1809
+ }>;
1810
+ teamIds: Record<string, string>;
1811
+ };
1581
1812
  liveSubscription: {
1582
1813
  transport: "subscribe-and-poll" | "subscribe" | "poll";
1583
1814
  pollIntervalMs: number;
1584
1815
  eventLimit: number;
1585
1816
  replaySkewMarginMs: number;
1817
+ reconcileIntervalMs: number;
1586
1818
  };
1587
1819
  dispatch: {
1588
1820
  errorCooldownMs: number;
@@ -1606,23 +1838,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1606
1838
  reviewer: "spawn:codex" | "spawn:claude";
1607
1839
  babysitter: "spawn:codex" | "spawn:claude";
1608
1840
  };
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
1841
  github: {
1627
1842
  identity: "app" | "user" | "auto";
1628
1843
  };
@@ -1692,8 +1907,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1692
1907
  };
1693
1908
  } | undefined;
1694
1909
  };
1695
- workspaceId?: string | undefined;
1696
- localMountRoot?: string | undefined;
1697
1910
  slack?: {
1698
1911
  channel: string;
1699
1912
  style: "threaded-summarized";
@@ -1702,7 +1915,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1702
1915
  staleAfterMs: number;
1703
1916
  conversationCoalesceMs: number;
1704
1917
  } | undefined;
1918
+ workspaceId?: string | undefined;
1919
+ localMountRoot?: string | undefined;
1705
1920
  issueSource?: "linear" | "github" | undefined;
1921
+ hooks?: {
1922
+ onTicketDispatch?: {
1923
+ notify: ({
1924
+ channel: string;
1925
+ surface: "relay";
1926
+ } | {
1927
+ surface: "slack";
1928
+ channel?: string | undefined;
1929
+ dm?: string | undefined;
1930
+ } | {
1931
+ surface: "telegram";
1932
+ chatId: string;
1933
+ } | {
1934
+ surface: "linear";
1935
+ commentOnIssue: true;
1936
+ })[];
1937
+ } | undefined;
1938
+ } | undefined;
1706
1939
  }, {
1707
1940
  repos: {
1708
1941
  default?: string | undefined;
@@ -1729,19 +1962,45 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1729
1962
  notifyHumans?: boolean | undefined;
1730
1963
  } | undefined;
1731
1964
  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;
1965
+ slack?: {
1966
+ channel: string;
1967
+ style?: "threaded-summarized" | undefined;
1968
+ botUserId?: string | undefined;
1969
+ stakeholderUserIds?: string[] | undefined;
1970
+ staleAfterMs?: number | undefined;
1971
+ conversationCoalesceMs?: number | undefined;
1739
1972
  } | undefined;
1740
- liveSubscription?: {
1741
- transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
1973
+ linear?: {
1974
+ states?: {
1975
+ readyForAgent?: string | undefined;
1976
+ agentImplementing?: string | undefined;
1977
+ inPlanning?: string | undefined;
1978
+ done?: string | undefined;
1979
+ humanReview?: string | undefined;
1980
+ } | undefined;
1981
+ statesByTeam?: Record<string, {
1982
+ readyForAgent?: string | undefined;
1983
+ agentImplementing?: string | undefined;
1984
+ inPlanning?: string | undefined;
1985
+ done?: string | undefined;
1986
+ humanReview?: string | undefined;
1987
+ } | undefined> | undefined;
1988
+ teamIds?: Record<string, string> | undefined;
1989
+ } | undefined;
1990
+ workspaceId?: string | undefined;
1991
+ localMountRoot?: string | undefined;
1992
+ subscription?: {
1993
+ teams?: string[] | undefined;
1994
+ projects?: string[] | undefined;
1995
+ labels?: string[] | undefined;
1996
+ assignees?: string[] | undefined;
1997
+ } | undefined;
1998
+ liveSubscription?: {
1999
+ transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
1742
2000
  pollIntervalMs?: number | undefined;
1743
2001
  eventLimit?: number | undefined;
1744
2002
  replaySkewMarginMs?: number | undefined;
2003
+ reconcileIntervalMs?: number | undefined;
1745
2004
  } | undefined;
1746
2005
  dispatch?: {
1747
2006
  errorCooldownMs?: number | undefined;
@@ -1765,31 +2024,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1765
2024
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1766
2025
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1767
2026
  } | 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
2027
  github?: {
1794
2028
  identity?: "app" | "user" | "auto" | undefined;
1795
2029
  } | undefined;
@@ -1802,6 +2036,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
1802
2036
  batchSize?: number | undefined;
1803
2037
  requestTimeoutMs?: number | undefined;
1804
2038
  } | undefined;
2039
+ hooks?: {
2040
+ onTicketDispatch?: {
2041
+ notify: ({
2042
+ channel: string;
2043
+ surface: "relay";
2044
+ } | {
2045
+ surface: "slack";
2046
+ channel?: string | undefined;
2047
+ dm?: string | undefined;
2048
+ } | {
2049
+ surface: "telegram";
2050
+ chatId: string;
2051
+ } | {
2052
+ surface: "linear";
2053
+ commentOnIssue: true;
2054
+ })[];
2055
+ } | undefined;
2056
+ } | undefined;
1805
2057
  preview?: {
1806
2058
  registryPath?: string | undefined;
1807
2059
  provider?: "tailscale-serve" | undefined;
@@ -2075,16 +2327,20 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2075
2327
  pollIntervalMs: z.ZodDefault<z.ZodNumber>;
2076
2328
  eventLimit: z.ZodDefault<z.ZodNumber>;
2077
2329
  replaySkewMarginMs: z.ZodDefault<z.ZodNumber>;
2330
+ /** Independent source-of-truth sweep; live event watermarks remain a latency optimization. */
2331
+ reconcileIntervalMs: z.ZodDefault<z.ZodNumber>;
2078
2332
  }, "strip", z.ZodTypeAny, {
2079
2333
  transport: "subscribe-and-poll" | "subscribe" | "poll";
2080
2334
  pollIntervalMs: number;
2081
2335
  eventLimit: number;
2082
2336
  replaySkewMarginMs: number;
2337
+ reconcileIntervalMs: number;
2083
2338
  }, {
2084
2339
  transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
2085
2340
  pollIntervalMs?: number | undefined;
2086
2341
  eventLimit?: number | undefined;
2087
2342
  replaySkewMarginMs?: number | undefined;
2343
+ reconcileIntervalMs?: number | undefined;
2088
2344
  }>>;
2089
2345
  dispatch: z.ZodDefault<z.ZodObject<{
2090
2346
  errorCooldownMs: z.ZodDefault<z.ZodNumber>;
@@ -2260,6 +2516,140 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2260
2516
  batchSize?: number | undefined;
2261
2517
  requestTimeoutMs?: number | undefined;
2262
2518
  }>>;
2519
+ hooks: z.ZodOptional<z.ZodObject<{
2520
+ onTicketDispatch: z.ZodOptional<z.ZodObject<{
2521
+ notify: z.ZodArray<z.ZodEffects<z.ZodDiscriminatedUnion<"surface", [z.ZodObject<{
2522
+ surface: z.ZodLiteral<"relay">;
2523
+ channel: z.ZodString;
2524
+ }, "strict", z.ZodTypeAny, {
2525
+ channel: string;
2526
+ surface: "relay";
2527
+ }, {
2528
+ channel: string;
2529
+ surface: "relay";
2530
+ }>, z.ZodObject<{
2531
+ surface: z.ZodLiteral<"slack">;
2532
+ channel: z.ZodOptional<z.ZodString>;
2533
+ dm: z.ZodOptional<z.ZodString>;
2534
+ }, "strict", z.ZodTypeAny, {
2535
+ surface: "slack";
2536
+ channel?: string | undefined;
2537
+ dm?: string | undefined;
2538
+ }, {
2539
+ surface: "slack";
2540
+ channel?: string | undefined;
2541
+ dm?: string | undefined;
2542
+ }>, z.ZodObject<{
2543
+ surface: z.ZodLiteral<"telegram">;
2544
+ chatId: z.ZodString;
2545
+ }, "strict", z.ZodTypeAny, {
2546
+ surface: "telegram";
2547
+ chatId: string;
2548
+ }, {
2549
+ surface: "telegram";
2550
+ chatId: string;
2551
+ }>, z.ZodObject<{
2552
+ surface: z.ZodLiteral<"linear">;
2553
+ commentOnIssue: z.ZodLiteral<true>;
2554
+ }, "strict", z.ZodTypeAny, {
2555
+ surface: "linear";
2556
+ commentOnIssue: true;
2557
+ }, {
2558
+ surface: "linear";
2559
+ commentOnIssue: true;
2560
+ }>]>, {
2561
+ channel: string;
2562
+ surface: "relay";
2563
+ } | {
2564
+ surface: "slack";
2565
+ channel?: string | undefined;
2566
+ dm?: string | undefined;
2567
+ } | {
2568
+ surface: "telegram";
2569
+ chatId: string;
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
+ }>, "many">;
2587
+ }, "strict", z.ZodTypeAny, {
2588
+ notify: ({
2589
+ channel: string;
2590
+ surface: "relay";
2591
+ } | {
2592
+ surface: "slack";
2593
+ channel?: string | undefined;
2594
+ dm?: string | undefined;
2595
+ } | {
2596
+ surface: "telegram";
2597
+ chatId: string;
2598
+ } | {
2599
+ surface: "linear";
2600
+ commentOnIssue: true;
2601
+ })[];
2602
+ }, {
2603
+ notify: ({
2604
+ channel: string;
2605
+ surface: "relay";
2606
+ } | {
2607
+ surface: "slack";
2608
+ channel?: string | undefined;
2609
+ dm?: string | undefined;
2610
+ } | {
2611
+ surface: "telegram";
2612
+ chatId: string;
2613
+ } | {
2614
+ surface: "linear";
2615
+ commentOnIssue: true;
2616
+ })[];
2617
+ }>>;
2618
+ }, "strict", z.ZodTypeAny, {
2619
+ onTicketDispatch?: {
2620
+ notify: ({
2621
+ channel: string;
2622
+ surface: "relay";
2623
+ } | {
2624
+ surface: "slack";
2625
+ channel?: string | undefined;
2626
+ dm?: string | undefined;
2627
+ } | {
2628
+ surface: "telegram";
2629
+ chatId: string;
2630
+ } | {
2631
+ surface: "linear";
2632
+ commentOnIssue: true;
2633
+ })[];
2634
+ } | undefined;
2635
+ }, {
2636
+ onTicketDispatch?: {
2637
+ notify: ({
2638
+ channel: string;
2639
+ surface: "relay";
2640
+ } | {
2641
+ surface: "slack";
2642
+ channel?: string | undefined;
2643
+ dm?: string | undefined;
2644
+ } | {
2645
+ surface: "telegram";
2646
+ chatId: string;
2647
+ } | {
2648
+ surface: "linear";
2649
+ commentOnIssue: true;
2650
+ })[];
2651
+ } | undefined;
2652
+ }>>;
2263
2653
  github: z.ZodDefault<z.ZodObject<{
2264
2654
  identity: z.ZodDefault<z.ZodEnum<["app", "user", "auto"]>>;
2265
2655
  }, "strip", z.ZodTypeAny, {
@@ -2923,6 +3313,23 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2923
3313
  notifyHumans: boolean;
2924
3314
  };
2925
3315
  batchSize: number;
3316
+ linear: {
3317
+ states: {
3318
+ readyForAgent?: string | undefined;
3319
+ agentImplementing?: string | undefined;
3320
+ inPlanning?: string | undefined;
3321
+ done?: string | undefined;
3322
+ humanReview?: string | undefined;
3323
+ };
3324
+ statesByTeam: Record<string, {
3325
+ readyForAgent?: string | undefined;
3326
+ agentImplementing?: string | undefined;
3327
+ inPlanning?: string | undefined;
3328
+ done?: string | undefined;
3329
+ humanReview?: string | undefined;
3330
+ }>;
3331
+ teamIds: Record<string, string>;
3332
+ };
2926
3333
  subscription: {
2927
3334
  teams: string[];
2928
3335
  projects: string[];
@@ -2934,6 +3341,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2934
3341
  pollIntervalMs: number;
2935
3342
  eventLimit: number;
2936
3343
  replaySkewMarginMs: number;
3344
+ reconcileIntervalMs: number;
2937
3345
  };
2938
3346
  dispatch: {
2939
3347
  errorCooldownMs: number;
@@ -2971,23 +3379,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
2971
3379
  reviewer: "spawn:codex" | "spawn:claude";
2972
3380
  babysitter: "spawn:codex" | "spawn:claude";
2973
3381
  };
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
3382
  github: {
2992
3383
  identity: "app" | "user" | "auto";
2993
3384
  };
@@ -3060,8 +3451,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3060
3451
  capabilities: string[];
3061
3452
  dryRun: boolean;
3062
3453
  cloneRoot?: string | undefined;
3063
- workspaceId?: string | undefined;
3064
- localMountRoot?: string | undefined;
3065
3454
  slack?: {
3066
3455
  channel: string;
3067
3456
  style: "threaded-summarized";
@@ -3070,7 +3459,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3070
3459
  staleAfterMs: number;
3071
3460
  conversationCoalesceMs: number;
3072
3461
  } | undefined;
3462
+ workspaceId?: string | undefined;
3463
+ localMountRoot?: string | undefined;
3073
3464
  issueSource?: "linear" | "github" | undefined;
3465
+ hooks?: {
3466
+ onTicketDispatch?: {
3467
+ notify: ({
3468
+ channel: string;
3469
+ surface: "relay";
3470
+ } | {
3471
+ surface: "slack";
3472
+ channel?: string | undefined;
3473
+ dm?: string | undefined;
3474
+ } | {
3475
+ surface: "telegram";
3476
+ chatId: string;
3477
+ } | {
3478
+ surface: "linear";
3479
+ commentOnIssue: true;
3480
+ })[];
3481
+ } | undefined;
3482
+ } | undefined;
3074
3483
  preview?: {
3075
3484
  registryPath: string;
3076
3485
  provider: "tailscale-serve";
@@ -3114,6 +3523,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3114
3523
  notifyHumans?: boolean | undefined;
3115
3524
  } | undefined;
3116
3525
  batchSize?: number | undefined;
3526
+ slack?: {
3527
+ channel: string;
3528
+ style?: "threaded-summarized" | undefined;
3529
+ botUserId?: string | undefined;
3530
+ stakeholderUserIds?: string[] | undefined;
3531
+ staleAfterMs?: number | undefined;
3532
+ conversationCoalesceMs?: number | undefined;
3533
+ } | undefined;
3534
+ linear?: {
3535
+ states?: {
3536
+ readyForAgent?: string | undefined;
3537
+ agentImplementing?: string | undefined;
3538
+ inPlanning?: string | undefined;
3539
+ done?: string | undefined;
3540
+ humanReview?: string | undefined;
3541
+ } | undefined;
3542
+ statesByTeam?: Record<string, {
3543
+ readyForAgent?: string | undefined;
3544
+ agentImplementing?: string | undefined;
3545
+ inPlanning?: string | undefined;
3546
+ done?: string | undefined;
3547
+ humanReview?: string | undefined;
3548
+ } | undefined> | undefined;
3549
+ teamIds?: Record<string, string> | undefined;
3550
+ } | undefined;
3117
3551
  workspaceId?: string | undefined;
3118
3552
  localMountRoot?: string | undefined;
3119
3553
  subscription?: {
@@ -3127,6 +3561,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3127
3561
  pollIntervalMs?: number | undefined;
3128
3562
  eventLimit?: number | undefined;
3129
3563
  replaySkewMarginMs?: number | undefined;
3564
+ reconcileIntervalMs?: number | undefined;
3130
3565
  } | undefined;
3131
3566
  dispatch?: {
3132
3567
  errorCooldownMs?: number | undefined;
@@ -3150,31 +3585,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3150
3585
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3151
3586
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3152
3587
  } | 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
3588
  github?: {
3179
3589
  identity?: "app" | "user" | "auto" | undefined;
3180
3590
  } | undefined;
@@ -3187,6 +3597,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3187
3597
  batchSize?: number | undefined;
3188
3598
  requestTimeoutMs?: number | undefined;
3189
3599
  } | undefined;
3600
+ hooks?: {
3601
+ onTicketDispatch?: {
3602
+ notify: ({
3603
+ channel: string;
3604
+ surface: "relay";
3605
+ } | {
3606
+ surface: "slack";
3607
+ channel?: string | undefined;
3608
+ dm?: string | undefined;
3609
+ } | {
3610
+ surface: "telegram";
3611
+ chatId: string;
3612
+ } | {
3613
+ surface: "linear";
3614
+ commentOnIssue: true;
3615
+ })[];
3616
+ } | undefined;
3617
+ } | undefined;
3190
3618
  preview?: {
3191
3619
  registryPath?: string | undefined;
3192
3620
  provider?: "tailscale-serve" | undefined;
@@ -3275,6 +3703,23 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3275
3703
  notifyHumans: boolean;
3276
3704
  };
3277
3705
  batchSize: number;
3706
+ linear: {
3707
+ states: {
3708
+ readyForAgent?: string | undefined;
3709
+ agentImplementing?: string | undefined;
3710
+ inPlanning?: string | undefined;
3711
+ done?: string | undefined;
3712
+ humanReview?: string | undefined;
3713
+ };
3714
+ statesByTeam: Record<string, {
3715
+ readyForAgent?: string | undefined;
3716
+ agentImplementing?: string | undefined;
3717
+ inPlanning?: string | undefined;
3718
+ done?: string | undefined;
3719
+ humanReview?: string | undefined;
3720
+ }>;
3721
+ teamIds: Record<string, string>;
3722
+ };
3278
3723
  subscription: {
3279
3724
  teams: string[];
3280
3725
  projects: string[];
@@ -3286,6 +3731,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3286
3731
  pollIntervalMs: number;
3287
3732
  eventLimit: number;
3288
3733
  replaySkewMarginMs: number;
3734
+ reconcileIntervalMs: number;
3289
3735
  };
3290
3736
  dispatch: {
3291
3737
  errorCooldownMs: number;
@@ -3323,23 +3769,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3323
3769
  reviewer: "spawn:codex" | "spawn:claude";
3324
3770
  babysitter: "spawn:codex" | "spawn:claude";
3325
3771
  };
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
3772
  github: {
3344
3773
  identity: "app" | "user" | "auto";
3345
3774
  };
@@ -3412,8 +3841,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3412
3841
  capabilities: string[];
3413
3842
  dryRun: boolean;
3414
3843
  cloneRoot?: string | undefined;
3415
- workspaceId?: string | undefined;
3416
- localMountRoot?: string | undefined;
3417
3844
  slack?: {
3418
3845
  channel: string;
3419
3846
  style: "threaded-summarized";
@@ -3422,7 +3849,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3422
3849
  staleAfterMs: number;
3423
3850
  conversationCoalesceMs: number;
3424
3851
  } | undefined;
3852
+ workspaceId?: string | undefined;
3853
+ localMountRoot?: string | undefined;
3425
3854
  issueSource?: "linear" | "github" | undefined;
3855
+ hooks?: {
3856
+ onTicketDispatch?: {
3857
+ notify: ({
3858
+ channel: string;
3859
+ surface: "relay";
3860
+ } | {
3861
+ surface: "slack";
3862
+ channel?: string | undefined;
3863
+ dm?: string | undefined;
3864
+ } | {
3865
+ surface: "telegram";
3866
+ chatId: string;
3867
+ } | {
3868
+ surface: "linear";
3869
+ commentOnIssue: true;
3870
+ })[];
3871
+ } | undefined;
3872
+ } | undefined;
3426
3873
  preview?: {
3427
3874
  registryPath: string;
3428
3875
  provider: "tailscale-serve";
@@ -3466,6 +3913,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3466
3913
  notifyHumans?: boolean | undefined;
3467
3914
  } | undefined;
3468
3915
  batchSize?: number | undefined;
3916
+ slack?: {
3917
+ channel: string;
3918
+ style?: "threaded-summarized" | undefined;
3919
+ botUserId?: string | undefined;
3920
+ stakeholderUserIds?: string[] | undefined;
3921
+ staleAfterMs?: number | undefined;
3922
+ conversationCoalesceMs?: number | undefined;
3923
+ } | undefined;
3924
+ linear?: {
3925
+ states?: {
3926
+ readyForAgent?: string | undefined;
3927
+ agentImplementing?: string | undefined;
3928
+ inPlanning?: string | undefined;
3929
+ done?: string | undefined;
3930
+ humanReview?: string | undefined;
3931
+ } | undefined;
3932
+ statesByTeam?: Record<string, {
3933
+ readyForAgent?: string | undefined;
3934
+ agentImplementing?: string | undefined;
3935
+ inPlanning?: string | undefined;
3936
+ done?: string | undefined;
3937
+ humanReview?: string | undefined;
3938
+ } | undefined> | undefined;
3939
+ teamIds?: Record<string, string> | undefined;
3940
+ } | undefined;
3469
3941
  workspaceId?: string | undefined;
3470
3942
  localMountRoot?: string | undefined;
3471
3943
  subscription?: {
@@ -3479,6 +3951,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3479
3951
  pollIntervalMs?: number | undefined;
3480
3952
  eventLimit?: number | undefined;
3481
3953
  replaySkewMarginMs?: number | undefined;
3954
+ reconcileIntervalMs?: number | undefined;
3482
3955
  } | undefined;
3483
3956
  dispatch?: {
3484
3957
  errorCooldownMs?: number | undefined;
@@ -3502,31 +3975,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3502
3975
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3503
3976
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3504
3977
  } | 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
3978
  github?: {
3531
3979
  identity?: "app" | "user" | "auto" | undefined;
3532
3980
  } | undefined;
@@ -3539,6 +3987,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3539
3987
  batchSize?: number | undefined;
3540
3988
  requestTimeoutMs?: number | undefined;
3541
3989
  } | undefined;
3990
+ hooks?: {
3991
+ onTicketDispatch?: {
3992
+ notify: ({
3993
+ channel: string;
3994
+ surface: "relay";
3995
+ } | {
3996
+ surface: "slack";
3997
+ channel?: string | undefined;
3998
+ dm?: string | undefined;
3999
+ } | {
4000
+ surface: "telegram";
4001
+ chatId: string;
4002
+ } | {
4003
+ surface: "linear";
4004
+ commentOnIssue: true;
4005
+ })[];
4006
+ } | undefined;
4007
+ } | undefined;
3542
4008
  preview?: {
3543
4009
  registryPath?: string | undefined;
3544
4010
  provider?: "tailscale-serve" | undefined;
@@ -3674,11 +4140,29 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3674
4140
  notifyHumans: boolean;
3675
4141
  };
3676
4142
  batchSize: number;
4143
+ linear: {
4144
+ states: {
4145
+ readyForAgent?: string | undefined;
4146
+ agentImplementing?: string | undefined;
4147
+ inPlanning?: string | undefined;
4148
+ done?: string | undefined;
4149
+ humanReview?: string | undefined;
4150
+ };
4151
+ statesByTeam: Record<string, {
4152
+ readyForAgent?: string | undefined;
4153
+ agentImplementing?: string | undefined;
4154
+ inPlanning?: string | undefined;
4155
+ done?: string | undefined;
4156
+ humanReview?: string | undefined;
4157
+ }>;
4158
+ teamIds: Record<string, string>;
4159
+ };
3677
4160
  liveSubscription: {
3678
4161
  transport: "subscribe-and-poll" | "subscribe" | "poll";
3679
4162
  pollIntervalMs: number;
3680
4163
  eventLimit: number;
3681
4164
  replaySkewMarginMs: number;
4165
+ reconcileIntervalMs: number;
3682
4166
  };
3683
4167
  dispatch: {
3684
4168
  errorCooldownMs: number;
@@ -3695,23 +4179,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3695
4179
  reviewer: "spawn:codex" | "spawn:claude";
3696
4180
  babysitter: "spawn:codex" | "spawn:claude";
3697
4181
  };
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
4182
  github: {
3716
4183
  identity: "app" | "user" | "auto";
3717
4184
  };
@@ -3783,8 +4250,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3783
4250
  };
3784
4251
  capabilities: string[];
3785
4252
  dryRun: boolean;
3786
- workspaceId?: string | undefined;
3787
- localMountRoot?: string | undefined;
3788
4253
  slack?: {
3789
4254
  channel: string;
3790
4255
  style: "threaded-summarized";
@@ -3793,7 +4258,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3793
4258
  staleAfterMs: number;
3794
4259
  conversationCoalesceMs: number;
3795
4260
  } | undefined;
4261
+ workspaceId?: string | undefined;
4262
+ localMountRoot?: string | undefined;
3796
4263
  issueSource?: "linear" | "github" | undefined;
4264
+ hooks?: {
4265
+ onTicketDispatch?: {
4266
+ notify: ({
4267
+ channel: string;
4268
+ surface: "relay";
4269
+ } | {
4270
+ surface: "slack";
4271
+ channel?: string | undefined;
4272
+ dm?: string | undefined;
4273
+ } | {
4274
+ surface: "telegram";
4275
+ chatId: string;
4276
+ } | {
4277
+ surface: "linear";
4278
+ commentOnIssue: true;
4279
+ })[];
4280
+ } | undefined;
4281
+ } | undefined;
3797
4282
  }, {
3798
4283
  repos: {
3799
4284
  default?: string | undefined;
@@ -3822,6 +4307,31 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3822
4307
  notifyHumans?: boolean | undefined;
3823
4308
  } | undefined;
3824
4309
  batchSize?: number | undefined;
4310
+ slack?: {
4311
+ channel: string;
4312
+ style?: "threaded-summarized" | undefined;
4313
+ botUserId?: string | undefined;
4314
+ stakeholderUserIds?: string[] | undefined;
4315
+ staleAfterMs?: number | undefined;
4316
+ conversationCoalesceMs?: number | undefined;
4317
+ } | undefined;
4318
+ linear?: {
4319
+ states?: {
4320
+ readyForAgent?: string | undefined;
4321
+ agentImplementing?: string | undefined;
4322
+ inPlanning?: string | undefined;
4323
+ done?: string | undefined;
4324
+ humanReview?: string | undefined;
4325
+ } | undefined;
4326
+ statesByTeam?: Record<string, {
4327
+ readyForAgent?: string | undefined;
4328
+ agentImplementing?: string | undefined;
4329
+ inPlanning?: string | undefined;
4330
+ done?: string | undefined;
4331
+ humanReview?: string | undefined;
4332
+ } | undefined> | undefined;
4333
+ teamIds?: Record<string, string> | undefined;
4334
+ } | undefined;
3825
4335
  workspaceId?: string | undefined;
3826
4336
  localMountRoot?: string | undefined;
3827
4337
  subscription?: {
@@ -3835,6 +4345,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3835
4345
  pollIntervalMs?: number | undefined;
3836
4346
  eventLimit?: number | undefined;
3837
4347
  replaySkewMarginMs?: number | undefined;
4348
+ reconcileIntervalMs?: number | undefined;
3838
4349
  } | undefined;
3839
4350
  dispatch?: {
3840
4351
  errorCooldownMs?: number | undefined;
@@ -3858,31 +4369,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3858
4369
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3859
4370
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3860
4371
  } | 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
4372
  github?: {
3887
4373
  identity?: "app" | "user" | "auto" | undefined;
3888
4374
  } | undefined;
@@ -3895,6 +4381,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<
3895
4381
  batchSize?: number | undefined;
3896
4382
  requestTimeoutMs?: number | undefined;
3897
4383
  } | undefined;
4384
+ hooks?: {
4385
+ onTicketDispatch?: {
4386
+ notify: ({
4387
+ channel: string;
4388
+ surface: "relay";
4389
+ } | {
4390
+ surface: "slack";
4391
+ channel?: string | undefined;
4392
+ dm?: string | undefined;
4393
+ } | {
4394
+ surface: "telegram";
4395
+ chatId: string;
4396
+ } | {
4397
+ surface: "linear";
4398
+ commentOnIssue: true;
4399
+ })[];
4400
+ } | undefined;
4401
+ } | undefined;
3898
4402
  preview?: {
3899
4403
  registryPath?: string | undefined;
3900
4404
  provider?: "tailscale-serve" | undefined;