@agent-relay/factory 0.1.57 → 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 (125) hide show
  1. package/README.md +152 -1
  2. package/dist/cli/fleet.d.ts +20 -1
  3. package/dist/cli/fleet.d.ts.map +1 -1
  4. package/dist/cli/fleet.js +550 -106
  5. package/dist/cli/fleet.js.map +1 -1
  6. package/dist/config/schema.d.ts +1778 -515
  7. package/dist/config/schema.d.ts.map +1 -1
  8. package/dist/config/schema.js +104 -6
  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/feature-guardian/conversation.d.ts +251 -0
  15. package/dist/feature-guardian/conversation.d.ts.map +1 -0
  16. package/dist/feature-guardian/conversation.js +1893 -0
  17. package/dist/feature-guardian/conversation.js.map +1 -0
  18. package/dist/feature-guardian/index.d.ts +2 -0
  19. package/dist/feature-guardian/index.d.ts.map +1 -0
  20. package/dist/feature-guardian/index.js +2 -0
  21. package/dist/feature-guardian/index.js.map +1 -0
  22. package/dist/git/agent-worktree.d.ts.map +1 -1
  23. package/dist/git/agent-worktree.js +4 -0
  24. package/dist/git/agent-worktree.js.map +1 -1
  25. package/dist/github/index.d.ts +2 -0
  26. package/dist/github/index.d.ts.map +1 -1
  27. package/dist/github/index.js +1 -0
  28. package/dist/github/index.js.map +1 -1
  29. package/dist/github/routed-pr-babysitter.d.ts +48 -0
  30. package/dist/github/routed-pr-babysitter.d.ts.map +1 -0
  31. package/dist/github/routed-pr-babysitter.js +197 -0
  32. package/dist/github/routed-pr-babysitter.js.map +1 -0
  33. package/dist/index.d.ts +5 -2
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +3 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/intake/index.d.ts +4 -0
  38. package/dist/intake/index.d.ts.map +1 -0
  39. package/dist/intake/index.js +4 -0
  40. package/dist/intake/index.js.map +1 -0
  41. package/dist/intake/notion-relay-claim.d.ts +32 -0
  42. package/dist/intake/notion-relay-claim.d.ts.map +1 -0
  43. package/dist/intake/notion-relay-claim.js +173 -0
  44. package/dist/intake/notion-relay-claim.js.map +1 -0
  45. package/dist/intake/notion-relay-contract.d.ts +33 -0
  46. package/dist/intake/notion-relay-contract.d.ts.map +1 -0
  47. package/dist/intake/notion-relay-contract.js +163 -0
  48. package/dist/intake/notion-relay-contract.js.map +1 -0
  49. package/dist/intake/notion.d.ts +375 -0
  50. package/dist/intake/notion.d.ts.map +1 -0
  51. package/dist/intake/notion.js +773 -0
  52. package/dist/intake/notion.js.map +1 -0
  53. package/dist/issue-key-match.d.ts +6 -0
  54. package/dist/issue-key-match.d.ts.map +1 -1
  55. package/dist/issue-key-match.js +14 -0
  56. package/dist/issue-key-match.js.map +1 -1
  57. package/dist/mount/github-api-issue-read.d.ts +28 -0
  58. package/dist/mount/github-api-issue-read.d.ts.map +1 -0
  59. package/dist/mount/github-api-issue-read.js +163 -0
  60. package/dist/mount/github-api-issue-read.js.map +1 -0
  61. package/dist/mount/local-mount-preflight.d.ts +2 -0
  62. package/dist/mount/local-mount-preflight.d.ts.map +1 -1
  63. package/dist/mount/local-mount-preflight.js +59 -9
  64. package/dist/mount/local-mount-preflight.js.map +1 -1
  65. package/dist/mount/mount-auth-error.d.ts +41 -0
  66. package/dist/mount/mount-auth-error.d.ts.map +1 -0
  67. package/dist/mount/mount-auth-error.js +94 -0
  68. package/dist/mount/mount-auth-error.js.map +1 -0
  69. package/dist/mount/relayfile-binary.d.ts +5 -0
  70. package/dist/mount/relayfile-binary.d.ts.map +1 -1
  71. package/dist/mount/relayfile-binary.js +16 -2
  72. package/dist/mount/relayfile-binary.js.map +1 -1
  73. package/dist/mount/relayfile-cloud-mount-client.d.ts +18 -3
  74. package/dist/mount/relayfile-cloud-mount-client.d.ts.map +1 -1
  75. package/dist/mount/relayfile-cloud-mount-client.js +157 -13
  76. package/dist/mount/relayfile-cloud-mount-client.js.map +1 -1
  77. package/dist/mount/relayfile-github-connection-write.d.ts.map +1 -1
  78. package/dist/mount/relayfile-github-connection-write.js +6 -3
  79. package/dist/mount/relayfile-github-connection-write.js.map +1 -1
  80. package/dist/mount/workspace-mirror.d.ts +13 -0
  81. package/dist/mount/workspace-mirror.d.ts.map +1 -0
  82. package/dist/mount/workspace-mirror.js +94 -0
  83. package/dist/mount/workspace-mirror.js.map +1 -0
  84. package/dist/observability/events.d.ts +32 -32
  85. package/dist/orchestrator/batch-tracker.d.ts +2 -1
  86. package/dist/orchestrator/batch-tracker.d.ts.map +1 -1
  87. package/dist/orchestrator/batch-tracker.js.map +1 -1
  88. package/dist/orchestrator/factory.d.ts +51 -0
  89. package/dist/orchestrator/factory.d.ts.map +1 -1
  90. package/dist/orchestrator/factory.js +1736 -116
  91. package/dist/orchestrator/factory.js.map +1 -1
  92. package/dist/ports/fleet.d.ts +4 -0
  93. package/dist/ports/fleet.d.ts.map +1 -1
  94. package/dist/ports/index.d.ts +1 -1
  95. package/dist/ports/index.d.ts.map +1 -1
  96. package/dist/ports/mount.d.ts +60 -1
  97. package/dist/ports/mount.d.ts.map +1 -1
  98. package/dist/ports/state.d.ts +66 -1
  99. package/dist/ports/state.d.ts.map +1 -1
  100. package/dist/state/file-state-store.d.ts +15 -1
  101. package/dist/state/file-state-store.d.ts.map +1 -1
  102. package/dist/state/file-state-store.js +210 -2
  103. package/dist/state/file-state-store.js.map +1 -1
  104. package/dist/state/in-memory-state-store.d.ts +15 -1
  105. package/dist/state/in-memory-state-store.d.ts.map +1 -1
  106. package/dist/state/in-memory-state-store.js +105 -0
  107. package/dist/state/in-memory-state-store.js.map +1 -1
  108. package/dist/testing/fakes.d.ts +4 -0
  109. package/dist/testing/fakes.d.ts.map +1 -1
  110. package/dist/testing/fakes.js +6 -0
  111. package/dist/testing/fakes.js.map +1 -1
  112. package/dist/triage/schema.d.ts +169 -0
  113. package/dist/triage/schema.d.ts.map +1 -1
  114. package/dist/triage/schema.js +21 -0
  115. package/dist/triage/schema.js.map +1 -1
  116. package/dist/types.d.ts +61 -0
  117. package/dist/types.d.ts.map +1 -1
  118. package/dist/version-info.d.ts +21 -0
  119. package/dist/version-info.d.ts.map +1 -0
  120. package/dist/version-info.js +146 -0
  121. package/dist/version-info.js.map +1 -0
  122. package/dist/writeback/github.d.ts.map +1 -1
  123. package/dist/writeback/github.js +51 -0
  124. package/dist/writeback/github.js.map +1 -1
  125. package/package.json +10 -1
@@ -1,8 +1,10 @@
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 WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
4
+ export declare const resolveRoutedRepo: (configured: string, org: string | undefined) => string | undefined;
5
+ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
5
6
  workspaceId: z.ZodOptional<z.ZodString>;
7
+ localMountRoot: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
6
8
  subscription: z.ZodDefault<z.ZodObject<{
7
9
  teams: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8
10
  projects: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -24,16 +26,20 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
24
26
  pollIntervalMs: z.ZodDefault<z.ZodNumber>;
25
27
  eventLimit: z.ZodDefault<z.ZodNumber>;
26
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>;
27
31
  }, "strip", z.ZodTypeAny, {
28
32
  transport: "subscribe-and-poll" | "subscribe" | "poll";
29
33
  pollIntervalMs: number;
30
34
  eventLimit: number;
31
35
  replaySkewMarginMs: number;
36
+ reconcileIntervalMs: number;
32
37
  }, {
33
38
  transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
34
39
  pollIntervalMs?: number | undefined;
35
40
  eventLimit?: number | undefined;
36
41
  replaySkewMarginMs?: number | undefined;
42
+ reconcileIntervalMs?: number | undefined;
37
43
  }>>;
38
44
  dispatch: z.ZodDefault<z.ZodObject<{
39
45
  errorCooldownMs: z.ZodDefault<z.ZodNumber>;
@@ -173,10 +179,22 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
173
179
  mergePolicy: z.ZodDefault<z.ZodEnum<["never", "on-green-with-review"]>>;
174
180
  babysitter: z.ZodDefault<z.ZodObject<{
175
181
  enabled: z.ZodDefault<z.ZodBoolean>;
182
+ mode: z.ZodDefault<z.ZodEnum<["factory-created", "routed-open-prs"]>>;
183
+ excludeLabels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
184
+ excludePullRequests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
185
+ notifyHumans: z.ZodDefault<z.ZodBoolean>;
176
186
  }, "strip", z.ZodTypeAny, {
177
187
  enabled: boolean;
188
+ mode: "factory-created" | "routed-open-prs";
189
+ excludeLabels: string[];
190
+ excludePullRequests: string[];
191
+ notifyHumans: boolean;
178
192
  }, {
179
193
  enabled?: boolean | undefined;
194
+ mode?: "factory-created" | "routed-open-prs" | undefined;
195
+ excludeLabels?: string[] | undefined;
196
+ excludePullRequests?: string[] | undefined;
197
+ notifyHumans?: boolean | undefined;
180
198
  }>>;
181
199
  reporting: z.ZodDefault<z.ZodObject<{
182
200
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -197,6 +215,140 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
197
215
  batchSize?: number | undefined;
198
216
  requestTimeoutMs?: number | undefined;
199
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
+ }>>;
200
352
  preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
201
353
  provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
202
354
  access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
@@ -845,8 +997,29 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
845
997
  };
846
998
  babysitter: {
847
999
  enabled: boolean;
1000
+ mode: "factory-created" | "routed-open-prs";
1001
+ excludeLabels: string[];
1002
+ excludePullRequests: string[];
1003
+ notifyHumans: boolean;
848
1004
  };
849
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
+ };
850
1023
  subscription: {
851
1024
  teams: string[];
852
1025
  projects: string[];
@@ -858,6 +1031,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
858
1031
  pollIntervalMs: number;
859
1032
  eventLimit: number;
860
1033
  replaySkewMarginMs: number;
1034
+ reconcileIntervalMs: number;
861
1035
  };
862
1036
  dispatch: {
863
1037
  errorCooldownMs: number;
@@ -895,23 +1069,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
895
1069
  reviewer: "spawn:codex" | "spawn:claude";
896
1070
  babysitter: "spawn:codex" | "spawn:claude";
897
1071
  };
898
- linear: {
899
- states: {
900
- readyForAgent?: string | undefined;
901
- agentImplementing?: string | undefined;
902
- inPlanning?: string | undefined;
903
- done?: string | undefined;
904
- humanReview?: string | undefined;
905
- };
906
- statesByTeam: Record<string, {
907
- readyForAgent?: string | undefined;
908
- agentImplementing?: string | undefined;
909
- inPlanning?: string | undefined;
910
- done?: string | undefined;
911
- humanReview?: string | undefined;
912
- }>;
913
- teamIds: Record<string, string>;
914
- };
915
1072
  github: {
916
1073
  identity: "app" | "user" | "auto";
917
1074
  };
@@ -981,7 +1138,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
981
1138
  };
982
1139
  } | undefined;
983
1140
  };
984
- workspaceId?: string | undefined;
985
1141
  slack?: {
986
1142
  channel: string;
987
1143
  style: "threaded-summarized";
@@ -990,7 +1146,27 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
990
1146
  staleAfterMs: number;
991
1147
  conversationCoalesceMs: number;
992
1148
  } | undefined;
1149
+ workspaceId?: string | undefined;
1150
+ localMountRoot?: string | undefined;
993
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;
994
1170
  preview?: {
995
1171
  registryPath: string;
996
1172
  provider: "tailscale-serve";
@@ -1024,9 +1200,39 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1024
1200
  } | undefined;
1025
1201
  babysitter?: {
1026
1202
  enabled?: boolean | undefined;
1203
+ mode?: "factory-created" | "routed-open-prs" | undefined;
1204
+ excludeLabels?: string[] | undefined;
1205
+ excludePullRequests?: string[] | undefined;
1206
+ notifyHumans?: boolean | undefined;
1027
1207
  } | undefined;
1028
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;
1029
1234
  workspaceId?: string | undefined;
1235
+ localMountRoot?: string | undefined;
1030
1236
  subscription?: {
1031
1237
  teams?: string[] | undefined;
1032
1238
  projects?: string[] | undefined;
@@ -1038,6 +1244,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1038
1244
  pollIntervalMs?: number | undefined;
1039
1245
  eventLimit?: number | undefined;
1040
1246
  replaySkewMarginMs?: number | undefined;
1247
+ reconcileIntervalMs?: number | undefined;
1041
1248
  } | undefined;
1042
1249
  dispatch?: {
1043
1250
  errorCooldownMs?: number | undefined;
@@ -1061,31 +1268,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1061
1268
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1062
1269
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1063
1270
  } | undefined;
1064
- slack?: {
1065
- channel: string;
1066
- style?: "threaded-summarized" | undefined;
1067
- botUserId?: string | undefined;
1068
- stakeholderUserIds?: string[] | undefined;
1069
- staleAfterMs?: number | undefined;
1070
- conversationCoalesceMs?: number | undefined;
1071
- } | undefined;
1072
- linear?: {
1073
- states?: {
1074
- readyForAgent?: string | undefined;
1075
- agentImplementing?: string | undefined;
1076
- inPlanning?: string | undefined;
1077
- done?: string | undefined;
1078
- humanReview?: string | undefined;
1079
- } | undefined;
1080
- statesByTeam?: Record<string, {
1081
- readyForAgent?: string | undefined;
1082
- agentImplementing?: string | undefined;
1083
- inPlanning?: string | undefined;
1084
- done?: string | undefined;
1085
- humanReview?: string | undefined;
1086
- } | undefined> | undefined;
1087
- teamIds?: Record<string, string> | undefined;
1088
- } | undefined;
1089
1271
  github?: {
1090
1272
  identity?: "app" | "user" | "auto" | undefined;
1091
1273
  } | undefined;
@@ -1098,6 +1280,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1098
1280
  batchSize?: number | undefined;
1099
1281
  requestTimeoutMs?: number | undefined;
1100
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;
1101
1301
  preview?: {
1102
1302
  registryPath?: string | undefined;
1103
1303
  provider?: "tailscale-serve" | undefined;
@@ -1170,51 +1370,46 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1170
1370
  } | undefined;
1171
1371
  } | undefined;
1172
1372
  }>, {
1173
- subscription: {
1174
- labels: string[];
1175
- teams: string[];
1176
- projects: string[];
1177
- assignees: string[];
1178
- };
1179
- preview: {
1180
- registryPath: string;
1181
- provider: "tailscale-serve";
1182
- access: "tailnet";
1183
- services: Record<string, {
1184
- port: number;
1185
- startCommand: string;
1186
- portSpan?: number | undefined;
1187
- httpsPort?: number | undefined;
1188
- }>;
1189
- tailscaleBinary: string;
1190
- httpsPortRange: [number, number];
1191
- } | undefined;
1192
- repos: {
1193
- default?: string | undefined;
1194
- byLabel: {
1195
- [x: string]: string;
1196
- };
1197
- byProject: Record<string, string>;
1198
- keywordRules: {
1199
- pattern: string;
1200
- repo: string;
1201
- }[];
1202
- overrides: Record<string, string>;
1203
- org?: string | undefined;
1204
- names?: string[] | undefined;
1205
- };
1206
1373
  triage: {
1207
1374
  maxImplementers: number;
1208
1375
  };
1209
1376
  babysitter: {
1210
1377
  enabled: boolean;
1378
+ mode: "factory-created" | "routed-open-prs";
1379
+ excludeLabels: string[];
1380
+ excludePullRequests: string[];
1381
+ notifyHumans: boolean;
1211
1382
  };
1212
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
+ };
1401
+ subscription: {
1402
+ teams: string[];
1403
+ projects: string[];
1404
+ labels: string[];
1405
+ assignees: string[];
1406
+ };
1213
1407
  liveSubscription: {
1214
1408
  transport: "subscribe-and-poll" | "subscribe" | "poll";
1215
1409
  pollIntervalMs: number;
1216
1410
  eventLimit: number;
1217
1411
  replaySkewMarginMs: number;
1412
+ reconcileIntervalMs: number;
1218
1413
  };
1219
1414
  dispatch: {
1220
1415
  errorCooldownMs: number;
@@ -1227,6 +1422,20 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1227
1422
  registryPath: string;
1228
1423
  heartbeatStaleMs: number;
1229
1424
  };
1425
+ repos: {
1426
+ overrides: Record<string, string>;
1427
+ byLabel: Record<string, string>;
1428
+ byProject: Record<string, string>;
1429
+ keywordRules: {
1430
+ pattern: string;
1431
+ repo: string;
1432
+ }[];
1433
+ clonePaths: Record<string, string>;
1434
+ default?: string | undefined;
1435
+ org?: string | undefined;
1436
+ names?: string[] | undefined;
1437
+ cloneRoot?: string | undefined;
1438
+ };
1230
1439
  models: {
1231
1440
  babysitter: string;
1232
1441
  implementer?: string | undefined;
@@ -1238,23 +1447,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1238
1447
  reviewer: "spawn:codex" | "spawn:claude";
1239
1448
  babysitter: "spawn:codex" | "spawn:claude";
1240
1449
  };
1241
- linear: {
1242
- states: {
1243
- readyForAgent?: string | undefined;
1244
- agentImplementing?: string | undefined;
1245
- inPlanning?: string | undefined;
1246
- done?: string | undefined;
1247
- humanReview?: string | undefined;
1248
- };
1249
- statesByTeam: Record<string, {
1250
- readyForAgent?: string | undefined;
1251
- agentImplementing?: string | undefined;
1252
- inPlanning?: string | undefined;
1253
- done?: string | undefined;
1254
- humanReview?: string | undefined;
1255
- }>;
1256
- teamIds: Record<string, string>;
1257
- };
1258
1450
  github: {
1259
1451
  identity: "app" | "user" | "auto";
1260
1452
  };
@@ -1324,7 +1516,6 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1324
1516
  };
1325
1517
  } | undefined;
1326
1518
  };
1327
- workspaceId?: string | undefined;
1328
1519
  slack?: {
1329
1520
  channel: string;
1330
1521
  style: "threaded-summarized";
@@ -1333,7 +1524,40 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1333
1524
  staleAfterMs: number;
1334
1525
  conversationCoalesceMs: number;
1335
1526
  } | undefined;
1527
+ workspaceId?: string | undefined;
1528
+ localMountRoot?: string | undefined;
1336
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;
1548
+ preview?: {
1549
+ registryPath: string;
1550
+ provider: "tailscale-serve";
1551
+ access: "tailnet";
1552
+ services: Record<string, {
1553
+ port: number;
1554
+ startCommand: string;
1555
+ portSpan?: number | undefined;
1556
+ httpsPort?: number | undefined;
1557
+ }>;
1558
+ tailscaleBinary: string;
1559
+ httpsPortRange: [number, number];
1560
+ } | undefined;
1337
1561
  }, {
1338
1562
  repos: {
1339
1563
  default?: string | undefined;
@@ -1354,9 +1578,39 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1354
1578
  } | undefined;
1355
1579
  babysitter?: {
1356
1580
  enabled?: boolean | undefined;
1581
+ mode?: "factory-created" | "routed-open-prs" | undefined;
1582
+ excludeLabels?: string[] | undefined;
1583
+ excludePullRequests?: string[] | undefined;
1584
+ notifyHumans?: boolean | undefined;
1357
1585
  } | undefined;
1358
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;
1359
1612
  workspaceId?: string | undefined;
1613
+ localMountRoot?: string | undefined;
1360
1614
  subscription?: {
1361
1615
  teams?: string[] | undefined;
1362
1616
  projects?: string[] | undefined;
@@ -1368,6 +1622,7 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1368
1622
  pollIntervalMs?: number | undefined;
1369
1623
  eventLimit?: number | undefined;
1370
1624
  replaySkewMarginMs?: number | undefined;
1625
+ reconcileIntervalMs?: number | undefined;
1371
1626
  } | undefined;
1372
1627
  dispatch?: {
1373
1628
  errorCooldownMs?: number | undefined;
@@ -1391,33 +1646,8 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1391
1646
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
1392
1647
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
1393
1648
  } | undefined;
1394
- slack?: {
1395
- channel: string;
1396
- style?: "threaded-summarized" | undefined;
1397
- botUserId?: string | undefined;
1398
- stakeholderUserIds?: string[] | undefined;
1399
- staleAfterMs?: number | undefined;
1400
- conversationCoalesceMs?: number | undefined;
1401
- } | undefined;
1402
- linear?: {
1403
- states?: {
1404
- readyForAgent?: string | undefined;
1405
- agentImplementing?: string | undefined;
1406
- inPlanning?: string | undefined;
1407
- done?: string | undefined;
1408
- humanReview?: string | undefined;
1409
- } | undefined;
1410
- statesByTeam?: Record<string, {
1411
- readyForAgent?: string | undefined;
1412
- agentImplementing?: string | undefined;
1413
- inPlanning?: string | undefined;
1414
- done?: string | undefined;
1415
- humanReview?: string | undefined;
1416
- } | undefined> | undefined;
1417
- teamIds?: Record<string, string> | undefined;
1418
- } | undefined;
1419
- github?: {
1420
- identity?: "app" | "user" | "auto" | undefined;
1649
+ github?: {
1650
+ identity?: "app" | "user" | "auto" | undefined;
1421
1651
  } | undefined;
1422
1652
  issueSource?: "linear" | "github" | undefined;
1423
1653
  mergePolicy?: "never" | "on-green-with-review" | undefined;
@@ -1428,6 +1658,24 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1428
1658
  batchSize?: number | undefined;
1429
1659
  requestTimeoutMs?: number | undefined;
1430
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;
1431
1679
  preview?: {
1432
1680
  registryPath?: string | undefined;
1433
1681
  provider?: "tailscale-serve" | undefined;
@@ -1499,147 +1747,13 @@ export declare const WorkspaceConfigSchema: z.ZodEffects<z.ZodObject<{
1499
1747
  } | undefined;
1500
1748
  } | undefined;
1501
1749
  } | undefined;
1502
- }>;
1503
- export declare const NodeConfigSchema: z.ZodEffects<z.ZodObject<{
1504
- workspaceId: z.ZodOptional<z.ZodString>;
1505
- capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1506
- cloneRoot: z.ZodOptional<z.ZodString>;
1507
- clonePaths: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1508
- dryRun: z.ZodDefault<z.ZodBoolean>;
1509
- factoryLoopHeartbeatPath: z.ZodOptional<z.ZodString>;
1510
- factoryLoopRegistryPath: z.ZodOptional<z.ZodString>;
1511
- preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
1512
- provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
1513
- access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
1514
- services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
1515
- /** Local HTTP port the repository's development server listens on. */
1516
- port: z.ZodNumber;
1517
- /** Consecutive node-local ports Factory may allocate for concurrent issues. */
1518
- portSpan: z.ZodOptional<z.ZodNumber>;
1519
- /** Optional stable tailnet HTTPS port; otherwise Factory allocates one. */
1520
- httpsPort: z.ZodOptional<z.ZodNumber>;
1521
- /** Foreground command Factory supervises for the issue-lifetime preview. */
1522
- startCommand: z.ZodString;
1523
- }, "strip", z.ZodTypeAny, {
1524
- port: number;
1525
- startCommand: string;
1526
- portSpan?: number | undefined;
1527
- httpsPort?: number | undefined;
1528
- }, {
1529
- port: number;
1530
- startCommand: string;
1531
- portSpan?: number | undefined;
1532
- httpsPort?: number | undefined;
1533
- }>, {
1534
- port: number;
1535
- startCommand: string;
1536
- portSpan?: number | undefined;
1537
- httpsPort?: number | undefined;
1538
- }, {
1539
- port: number;
1540
- startCommand: string;
1541
- portSpan?: number | undefined;
1542
- httpsPort?: number | undefined;
1543
- }>>>;
1544
- tailscaleBinary: z.ZodDefault<z.ZodString>;
1545
- registryPath: z.ZodDefault<z.ZodString>;
1546
- httpsPortRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
1547
- }, "strip", z.ZodTypeAny, {
1548
- registryPath: string;
1549
- provider: "tailscale-serve";
1550
- access: "tailnet";
1551
- services: Record<string, {
1552
- port: number;
1553
- startCommand: string;
1554
- portSpan?: number | undefined;
1555
- httpsPort?: number | undefined;
1556
- }>;
1557
- tailscaleBinary: string;
1558
- httpsPortRange: [number, number];
1559
- }, {
1560
- registryPath?: string | undefined;
1561
- provider?: "tailscale-serve" | undefined;
1562
- access?: "tailnet" | undefined;
1563
- services?: Record<string, {
1564
- port: number;
1565
- startCommand: string;
1566
- portSpan?: number | undefined;
1567
- httpsPort?: number | undefined;
1568
- }> | undefined;
1569
- tailscaleBinary?: string | undefined;
1570
- httpsPortRange?: [number, number] | undefined;
1571
- }>, {
1572
- registryPath: string;
1573
- provider: "tailscale-serve";
1574
- access: "tailnet";
1575
- services: Record<string, {
1576
- port: number;
1577
- startCommand: string;
1578
- portSpan?: number | undefined;
1579
- httpsPort?: number | undefined;
1580
- }>;
1581
- tailscaleBinary: string;
1582
- httpsPortRange: [number, number];
1583
- }, {
1584
- registryPath?: string | undefined;
1585
- provider?: "tailscale-serve" | undefined;
1586
- access?: "tailnet" | undefined;
1587
- services?: Record<string, {
1588
- port: number;
1589
- startCommand: string;
1590
- portSpan?: number | undefined;
1591
- httpsPort?: number | undefined;
1592
- }> | undefined;
1593
- tailscaleBinary?: string | undefined;
1594
- httpsPortRange?: [number, number] | undefined;
1595
- }>>;
1596
- }, "strip", z.ZodTypeAny, {
1597
- clonePaths: Record<string, string>;
1598
- capabilities: string[];
1599
- dryRun: boolean;
1600
- cloneRoot?: string | undefined;
1601
- workspaceId?: string | undefined;
1602
- preview?: {
1603
- registryPath: string;
1604
- provider: "tailscale-serve";
1605
- access: "tailnet";
1606
- services: Record<string, {
1607
- port: number;
1608
- startCommand: string;
1609
- portSpan?: number | undefined;
1610
- httpsPort?: number | undefined;
1611
- }>;
1612
- tailscaleBinary: string;
1613
- httpsPortRange: [number, number];
1614
- } | undefined;
1615
- factoryLoopHeartbeatPath?: string | undefined;
1616
- factoryLoopRegistryPath?: string | undefined;
1617
- }, {
1618
- cloneRoot?: string | undefined;
1619
- clonePaths?: Record<string, string> | undefined;
1620
- workspaceId?: string | undefined;
1621
- preview?: {
1622
- registryPath?: string | undefined;
1623
- provider?: "tailscale-serve" | undefined;
1624
- access?: "tailnet" | undefined;
1625
- services?: Record<string, {
1626
- port: number;
1627
- startCommand: string;
1628
- portSpan?: number | undefined;
1629
- httpsPort?: number | undefined;
1630
- }> | undefined;
1631
- tailscaleBinary?: string | undefined;
1632
- httpsPortRange?: [number, number] | undefined;
1633
- } | undefined;
1634
- capabilities?: string[] | undefined;
1635
- dryRun?: boolean | undefined;
1636
- factoryLoopHeartbeatPath?: string | undefined;
1637
- factoryLoopRegistryPath?: string | undefined;
1638
1750
  }>, {
1639
- cloneRoot: string | undefined;
1640
- clonePaths: Record<string, string>;
1641
- factoryLoopHeartbeatPath: string | undefined;
1642
- factoryLoopRegistryPath: string | undefined;
1751
+ subscription: {
1752
+ labels: string[];
1753
+ teams: string[];
1754
+ projects: string[];
1755
+ assignees: string[];
1756
+ };
1643
1757
  preview: {
1644
1758
  registryPath: string;
1645
1759
  provider: "tailscale-serve";
@@ -1653,72 +1767,589 @@ export declare const NodeConfigSchema: z.ZodEffects<z.ZodObject<{
1653
1767
  tailscaleBinary: string;
1654
1768
  httpsPortRange: [number, number];
1655
1769
  } | undefined;
1656
- capabilities: string[];
1657
- dryRun: boolean;
1658
- workspaceId?: string | undefined;
1659
- }, {
1660
- cloneRoot?: string | undefined;
1661
- clonePaths?: Record<string, string> | undefined;
1662
- workspaceId?: string | undefined;
1663
- preview?: {
1664
- registryPath?: string | undefined;
1665
- provider?: "tailscale-serve" | undefined;
1666
- access?: "tailnet" | undefined;
1667
- services?: Record<string, {
1668
- port: number;
1669
- startCommand: string;
1670
- portSpan?: number | undefined;
1671
- httpsPort?: number | undefined;
1672
- }> | undefined;
1673
- tailscaleBinary?: string | undefined;
1674
- httpsPortRange?: [number, number] | undefined;
1675
- } | undefined;
1676
- capabilities?: string[] | undefined;
1677
- dryRun?: boolean | undefined;
1678
- factoryLoopHeartbeatPath?: string | undefined;
1679
- factoryLoopRegistryPath?: string | undefined;
1680
- }>;
1681
- export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
1682
- subscription: z.ZodDefault<z.ZodObject<{
1683
- teams: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1684
- projects: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1685
- labels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1686
- assignees: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1687
- }, "strip", z.ZodTypeAny, {
1688
- teams: string[];
1689
- projects: string[];
1690
- labels: string[];
1691
- assignees: string[];
1692
- }, {
1693
- teams?: string[] | undefined;
1694
- projects?: string[] | undefined;
1695
- labels?: string[] | undefined;
1696
- assignees?: string[] | undefined;
1697
- }>>;
1698
- liveSubscription: z.ZodDefault<z.ZodObject<{
1699
- transport: z.ZodDefault<z.ZodEnum<["subscribe-and-poll", "subscribe", "poll"]>>;
1700
- pollIntervalMs: z.ZodDefault<z.ZodNumber>;
1701
- eventLimit: z.ZodDefault<z.ZodNumber>;
1702
- replaySkewMarginMs: z.ZodDefault<z.ZodNumber>;
1703
- }, "strip", z.ZodTypeAny, {
1770
+ repos: {
1771
+ default?: string | undefined;
1772
+ byLabel: {
1773
+ [x: string]: string;
1774
+ };
1775
+ byProject: Record<string, string>;
1776
+ keywordRules: {
1777
+ pattern: string;
1778
+ repo: string;
1779
+ }[];
1780
+ overrides: Record<string, string>;
1781
+ org?: string | undefined;
1782
+ names?: string[] | undefined;
1783
+ };
1784
+ triage: {
1785
+ maxImplementers: number;
1786
+ };
1787
+ babysitter: {
1788
+ enabled: boolean;
1789
+ mode: "factory-created" | "routed-open-prs";
1790
+ excludeLabels: string[];
1791
+ excludePullRequests: string[];
1792
+ notifyHumans: boolean;
1793
+ };
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
+ };
1812
+ liveSubscription: {
1704
1813
  transport: "subscribe-and-poll" | "subscribe" | "poll";
1705
1814
  pollIntervalMs: number;
1706
1815
  eventLimit: number;
1707
1816
  replaySkewMarginMs: number;
1708
- }, {
1709
- transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
1710
- pollIntervalMs?: number | undefined;
1711
- eventLimit?: number | undefined;
1712
- replaySkewMarginMs?: number | undefined;
1713
- }>>;
1714
- dispatch: z.ZodDefault<z.ZodObject<{
1715
- errorCooldownMs: z.ZodDefault<z.ZodNumber>;
1716
- maxAttempts: z.ZodDefault<z.ZodNumber>;
1717
- }, "strip", z.ZodTypeAny, {
1817
+ reconcileIntervalMs: number;
1818
+ };
1819
+ dispatch: {
1718
1820
  errorCooldownMs: number;
1719
1821
  maxAttempts: number;
1720
- }, {
1721
- errorCooldownMs?: number | undefined;
1822
+ };
1823
+ loop: {
1824
+ maxIterations: number;
1825
+ maxConsecutiveFailures: number;
1826
+ heartbeatPath: string;
1827
+ registryPath: string;
1828
+ heartbeatStaleMs: number;
1829
+ };
1830
+ models: {
1831
+ babysitter: string;
1832
+ implementer?: string | undefined;
1833
+ reviewer?: string | undefined;
1834
+ triage?: string | undefined;
1835
+ };
1836
+ agentCapabilities: {
1837
+ implementer: "spawn:codex" | "spawn:claude";
1838
+ reviewer: "spawn:codex" | "spawn:claude";
1839
+ babysitter: "spawn:codex" | "spawn:claude";
1840
+ };
1841
+ github: {
1842
+ identity: "app" | "user" | "auto";
1843
+ };
1844
+ mergePolicy: "never" | "on-green-with-review";
1845
+ reporting: {
1846
+ enabled: boolean;
1847
+ batchSize: number;
1848
+ requestTimeoutMs: number;
1849
+ instanceName?: string | undefined;
1850
+ outboxPath?: string | undefined;
1851
+ };
1852
+ verification: {
1853
+ enabled: boolean;
1854
+ descriptorPath: string;
1855
+ maxConcurrentEnvironments: number;
1856
+ maxRunTimeoutMs: number;
1857
+ maxEnvironmentTtlMs: number;
1858
+ maxTeardownTimeoutMs: number;
1859
+ };
1860
+ terminalState: "done" | "human-review";
1861
+ stateIds: {
1862
+ readyForAgent?: string | undefined;
1863
+ agentImplementing?: string | undefined;
1864
+ inPlanning?: string | undefined;
1865
+ done?: string | undefined;
1866
+ humanReview?: string | undefined;
1867
+ };
1868
+ safety: {
1869
+ requireTitlePrefix: string;
1870
+ requireLabel: string;
1871
+ requireTeamKey: string;
1872
+ };
1873
+ environments: {
1874
+ kubernetes?: {
1875
+ connections: {
1876
+ id: string;
1877
+ target: "byoc" | "managed";
1878
+ customers: string[];
1879
+ repositories: string[];
1880
+ credential: {
1881
+ kind: "kubeconfig" | "irsa";
1882
+ secretRef: string;
1883
+ };
1884
+ protectedNamespaces: string[];
1885
+ allowClusterScopedResources: boolean;
1886
+ allowedClusterScopedKinds: string[];
1887
+ nodeSelector: Record<string, string>;
1888
+ tolerations: {
1889
+ key?: string | undefined;
1890
+ operator?: "Exists" | "Equal" | undefined;
1891
+ value?: string | undefined;
1892
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
1893
+ tolerationSeconds?: number | undefined;
1894
+ }[];
1895
+ context?: string | undefined;
1896
+ fidelityCaveat?: string | undefined;
1897
+ }[];
1898
+ defaults: {
1899
+ ttlMs: number;
1900
+ readinessTimeoutMs: number;
1901
+ resourceQuota: Record<string, string>;
1902
+ limitRange: {
1903
+ default: Record<string, string>;
1904
+ max: Record<string, string>;
1905
+ defaultRequest: Record<string, string>;
1906
+ };
1907
+ };
1908
+ } | undefined;
1909
+ };
1910
+ slack?: {
1911
+ channel: string;
1912
+ style: "threaded-summarized";
1913
+ botUserId: string;
1914
+ stakeholderUserIds: string[];
1915
+ staleAfterMs: number;
1916
+ conversationCoalesceMs: number;
1917
+ } | undefined;
1918
+ workspaceId?: string | undefined;
1919
+ localMountRoot?: string | undefined;
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;
1939
+ }, {
1940
+ repos: {
1941
+ default?: string | undefined;
1942
+ org?: string | undefined;
1943
+ names?: string[] | undefined;
1944
+ overrides?: Record<string, string> | undefined;
1945
+ byLabel?: Record<string, string> | undefined;
1946
+ byProject?: Record<string, string> | undefined;
1947
+ keywordRules?: {
1948
+ pattern: string;
1949
+ repo: string;
1950
+ }[] | undefined;
1951
+ cloneRoot?: string | undefined;
1952
+ clonePaths?: Record<string, string> | undefined;
1953
+ };
1954
+ triage?: {
1955
+ maxImplementers?: number | undefined;
1956
+ } | undefined;
1957
+ babysitter?: {
1958
+ enabled?: boolean | undefined;
1959
+ mode?: "factory-created" | "routed-open-prs" | undefined;
1960
+ excludeLabels?: string[] | undefined;
1961
+ excludePullRequests?: string[] | undefined;
1962
+ notifyHumans?: boolean | undefined;
1963
+ } | undefined;
1964
+ batchSize?: number | 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;
1972
+ } | 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;
2000
+ pollIntervalMs?: number | undefined;
2001
+ eventLimit?: number | undefined;
2002
+ replaySkewMarginMs?: number | undefined;
2003
+ reconcileIntervalMs?: number | undefined;
2004
+ } | undefined;
2005
+ dispatch?: {
2006
+ errorCooldownMs?: number | undefined;
2007
+ maxAttempts?: number | undefined;
2008
+ } | undefined;
2009
+ loop?: {
2010
+ maxIterations?: number | undefined;
2011
+ maxConsecutiveFailures?: number | undefined;
2012
+ heartbeatPath?: string | undefined;
2013
+ registryPath?: string | undefined;
2014
+ heartbeatStaleMs?: number | undefined;
2015
+ } | undefined;
2016
+ models?: {
2017
+ implementer?: string | undefined;
2018
+ reviewer?: string | undefined;
2019
+ triage?: string | undefined;
2020
+ babysitter?: string | undefined;
2021
+ } | undefined;
2022
+ agentCapabilities?: {
2023
+ implementer?: "spawn:codex" | "spawn:claude" | undefined;
2024
+ reviewer?: "spawn:codex" | "spawn:claude" | undefined;
2025
+ babysitter?: "spawn:codex" | "spawn:claude" | undefined;
2026
+ } | undefined;
2027
+ github?: {
2028
+ identity?: "app" | "user" | "auto" | undefined;
2029
+ } | undefined;
2030
+ issueSource?: "linear" | "github" | undefined;
2031
+ mergePolicy?: "never" | "on-green-with-review" | undefined;
2032
+ reporting?: {
2033
+ enabled?: boolean | undefined;
2034
+ instanceName?: string | undefined;
2035
+ outboxPath?: string | undefined;
2036
+ batchSize?: number | undefined;
2037
+ requestTimeoutMs?: number | undefined;
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;
2057
+ preview?: {
2058
+ registryPath?: string | undefined;
2059
+ provider?: "tailscale-serve" | undefined;
2060
+ access?: "tailnet" | undefined;
2061
+ services?: Record<string, {
2062
+ port: number;
2063
+ startCommand: string;
2064
+ portSpan?: number | undefined;
2065
+ httpsPort?: number | undefined;
2066
+ }> | undefined;
2067
+ tailscaleBinary?: string | undefined;
2068
+ httpsPortRange?: [number, number] | undefined;
2069
+ } | undefined;
2070
+ verification?: {
2071
+ enabled?: boolean | undefined;
2072
+ descriptorPath?: string | undefined;
2073
+ maxConcurrentEnvironments?: number | undefined;
2074
+ maxRunTimeoutMs?: number | undefined;
2075
+ maxEnvironmentTtlMs?: number | undefined;
2076
+ maxTeardownTimeoutMs?: number | undefined;
2077
+ } | undefined;
2078
+ terminalState?: "done" | "human-review" | undefined;
2079
+ stateIds?: {
2080
+ readyForAgent?: string | undefined;
2081
+ agentImplementing?: string | undefined;
2082
+ inPlanning?: string | undefined;
2083
+ done?: string | undefined;
2084
+ humanReview?: string | undefined;
2085
+ } | undefined;
2086
+ safety?: {
2087
+ requireTitlePrefix?: string | undefined;
2088
+ requireLabel?: string | undefined;
2089
+ requireTeamKey?: string | undefined;
2090
+ } | undefined;
2091
+ environments?: {
2092
+ kubernetes?: {
2093
+ connections?: {
2094
+ id: string;
2095
+ credential: {
2096
+ kind: "kubeconfig" | "irsa";
2097
+ secretRef: string;
2098
+ };
2099
+ target?: "byoc" | "managed" | undefined;
2100
+ customers?: string[] | undefined;
2101
+ repositories?: string[] | undefined;
2102
+ context?: string | undefined;
2103
+ protectedNamespaces?: string[] | undefined;
2104
+ allowClusterScopedResources?: boolean | undefined;
2105
+ allowedClusterScopedKinds?: string[] | undefined;
2106
+ nodeSelector?: Record<string, string> | undefined;
2107
+ tolerations?: {
2108
+ key?: string | undefined;
2109
+ operator?: "Exists" | "Equal" | undefined;
2110
+ value?: string | undefined;
2111
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
2112
+ tolerationSeconds?: number | undefined;
2113
+ }[] | undefined;
2114
+ fidelityCaveat?: string | undefined;
2115
+ }[] | undefined;
2116
+ defaults?: {
2117
+ ttlMs?: number | undefined;
2118
+ readinessTimeoutMs?: number | undefined;
2119
+ resourceQuota?: Record<string, string> | undefined;
2120
+ limitRange?: {
2121
+ default?: Record<string, string> | undefined;
2122
+ max?: Record<string, string> | undefined;
2123
+ defaultRequest?: Record<string, string> | undefined;
2124
+ } | undefined;
2125
+ } | undefined;
2126
+ } | undefined;
2127
+ } | undefined;
2128
+ }>;
2129
+ export declare const NodeConfigSchema: z.ZodEffects<z.ZodObject<{
2130
+ workspaceId: z.ZodOptional<z.ZodString>;
2131
+ capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2132
+ cloneRoot: z.ZodOptional<z.ZodString>;
2133
+ clonePaths: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2134
+ dryRun: z.ZodDefault<z.ZodBoolean>;
2135
+ factoryLoopHeartbeatPath: z.ZodOptional<z.ZodString>;
2136
+ factoryLoopRegistryPath: z.ZodOptional<z.ZodString>;
2137
+ preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2138
+ provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
2139
+ access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
2140
+ services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
2141
+ /** Local HTTP port the repository's development server listens on. */
2142
+ port: z.ZodNumber;
2143
+ /** Consecutive node-local ports Factory may allocate for concurrent issues. */
2144
+ portSpan: z.ZodOptional<z.ZodNumber>;
2145
+ /** Optional stable tailnet HTTPS port; otherwise Factory allocates one. */
2146
+ httpsPort: z.ZodOptional<z.ZodNumber>;
2147
+ /** Foreground command Factory supervises for the issue-lifetime preview. */
2148
+ startCommand: z.ZodString;
2149
+ }, "strip", z.ZodTypeAny, {
2150
+ port: number;
2151
+ startCommand: string;
2152
+ portSpan?: number | undefined;
2153
+ httpsPort?: number | undefined;
2154
+ }, {
2155
+ port: number;
2156
+ startCommand: string;
2157
+ portSpan?: number | undefined;
2158
+ httpsPort?: number | undefined;
2159
+ }>, {
2160
+ port: number;
2161
+ startCommand: string;
2162
+ portSpan?: number | undefined;
2163
+ httpsPort?: number | undefined;
2164
+ }, {
2165
+ port: number;
2166
+ startCommand: string;
2167
+ portSpan?: number | undefined;
2168
+ httpsPort?: number | undefined;
2169
+ }>>>;
2170
+ tailscaleBinary: z.ZodDefault<z.ZodString>;
2171
+ registryPath: z.ZodDefault<z.ZodString>;
2172
+ httpsPortRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
2173
+ }, "strip", z.ZodTypeAny, {
2174
+ registryPath: string;
2175
+ provider: "tailscale-serve";
2176
+ access: "tailnet";
2177
+ services: Record<string, {
2178
+ port: number;
2179
+ startCommand: string;
2180
+ portSpan?: number | undefined;
2181
+ httpsPort?: number | undefined;
2182
+ }>;
2183
+ tailscaleBinary: string;
2184
+ httpsPortRange: [number, number];
2185
+ }, {
2186
+ registryPath?: string | undefined;
2187
+ provider?: "tailscale-serve" | undefined;
2188
+ access?: "tailnet" | undefined;
2189
+ services?: Record<string, {
2190
+ port: number;
2191
+ startCommand: string;
2192
+ portSpan?: number | undefined;
2193
+ httpsPort?: number | undefined;
2194
+ }> | undefined;
2195
+ tailscaleBinary?: string | undefined;
2196
+ httpsPortRange?: [number, number] | undefined;
2197
+ }>, {
2198
+ registryPath: string;
2199
+ provider: "tailscale-serve";
2200
+ access: "tailnet";
2201
+ services: Record<string, {
2202
+ port: number;
2203
+ startCommand: string;
2204
+ portSpan?: number | undefined;
2205
+ httpsPort?: number | undefined;
2206
+ }>;
2207
+ tailscaleBinary: string;
2208
+ httpsPortRange: [number, number];
2209
+ }, {
2210
+ registryPath?: string | undefined;
2211
+ provider?: "tailscale-serve" | undefined;
2212
+ access?: "tailnet" | undefined;
2213
+ services?: Record<string, {
2214
+ port: number;
2215
+ startCommand: string;
2216
+ portSpan?: number | undefined;
2217
+ httpsPort?: number | undefined;
2218
+ }> | undefined;
2219
+ tailscaleBinary?: string | undefined;
2220
+ httpsPortRange?: [number, number] | undefined;
2221
+ }>>;
2222
+ }, "strip", z.ZodTypeAny, {
2223
+ clonePaths: Record<string, string>;
2224
+ capabilities: string[];
2225
+ dryRun: boolean;
2226
+ cloneRoot?: string | undefined;
2227
+ workspaceId?: string | undefined;
2228
+ preview?: {
2229
+ registryPath: string;
2230
+ provider: "tailscale-serve";
2231
+ access: "tailnet";
2232
+ services: Record<string, {
2233
+ port: number;
2234
+ startCommand: string;
2235
+ portSpan?: number | undefined;
2236
+ httpsPort?: number | undefined;
2237
+ }>;
2238
+ tailscaleBinary: string;
2239
+ httpsPortRange: [number, number];
2240
+ } | undefined;
2241
+ factoryLoopHeartbeatPath?: string | undefined;
2242
+ factoryLoopRegistryPath?: string | undefined;
2243
+ }, {
2244
+ cloneRoot?: string | undefined;
2245
+ clonePaths?: Record<string, string> | undefined;
2246
+ workspaceId?: string | undefined;
2247
+ preview?: {
2248
+ registryPath?: string | undefined;
2249
+ provider?: "tailscale-serve" | undefined;
2250
+ access?: "tailnet" | undefined;
2251
+ services?: Record<string, {
2252
+ port: number;
2253
+ startCommand: string;
2254
+ portSpan?: number | undefined;
2255
+ httpsPort?: number | undefined;
2256
+ }> | undefined;
2257
+ tailscaleBinary?: string | undefined;
2258
+ httpsPortRange?: [number, number] | undefined;
2259
+ } | undefined;
2260
+ capabilities?: string[] | undefined;
2261
+ dryRun?: boolean | undefined;
2262
+ factoryLoopHeartbeatPath?: string | undefined;
2263
+ factoryLoopRegistryPath?: string | undefined;
2264
+ }>, {
2265
+ cloneRoot: string | undefined;
2266
+ clonePaths: Record<string, string>;
2267
+ factoryLoopHeartbeatPath: string | undefined;
2268
+ factoryLoopRegistryPath: string | undefined;
2269
+ preview: {
2270
+ registryPath: string;
2271
+ provider: "tailscale-serve";
2272
+ access: "tailnet";
2273
+ services: Record<string, {
2274
+ port: number;
2275
+ startCommand: string;
2276
+ portSpan?: number | undefined;
2277
+ httpsPort?: number | undefined;
2278
+ }>;
2279
+ tailscaleBinary: string;
2280
+ httpsPortRange: [number, number];
2281
+ } | undefined;
2282
+ capabilities: string[];
2283
+ dryRun: boolean;
2284
+ workspaceId?: string | undefined;
2285
+ }, {
2286
+ cloneRoot?: string | undefined;
2287
+ clonePaths?: Record<string, string> | undefined;
2288
+ workspaceId?: string | undefined;
2289
+ preview?: {
2290
+ registryPath?: string | undefined;
2291
+ provider?: "tailscale-serve" | undefined;
2292
+ access?: "tailnet" | undefined;
2293
+ services?: Record<string, {
2294
+ port: number;
2295
+ startCommand: string;
2296
+ portSpan?: number | undefined;
2297
+ httpsPort?: number | undefined;
2298
+ }> | undefined;
2299
+ tailscaleBinary?: string | undefined;
2300
+ httpsPortRange?: [number, number] | undefined;
2301
+ } | undefined;
2302
+ capabilities?: string[] | undefined;
2303
+ dryRun?: boolean | undefined;
2304
+ factoryLoopHeartbeatPath?: string | undefined;
2305
+ factoryLoopRegistryPath?: string | undefined;
2306
+ }>;
2307
+ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
2308
+ localMountRoot: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2309
+ subscription: z.ZodDefault<z.ZodObject<{
2310
+ teams: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2311
+ projects: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2312
+ labels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2313
+ assignees: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2314
+ }, "strip", z.ZodTypeAny, {
2315
+ teams: string[];
2316
+ projects: string[];
2317
+ labels: string[];
2318
+ assignees: string[];
2319
+ }, {
2320
+ teams?: string[] | undefined;
2321
+ projects?: string[] | undefined;
2322
+ labels?: string[] | undefined;
2323
+ assignees?: string[] | undefined;
2324
+ }>>;
2325
+ liveSubscription: z.ZodDefault<z.ZodObject<{
2326
+ transport: z.ZodDefault<z.ZodEnum<["subscribe-and-poll", "subscribe", "poll"]>>;
2327
+ pollIntervalMs: z.ZodDefault<z.ZodNumber>;
2328
+ eventLimit: z.ZodDefault<z.ZodNumber>;
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>;
2332
+ }, "strip", z.ZodTypeAny, {
2333
+ transport: "subscribe-and-poll" | "subscribe" | "poll";
2334
+ pollIntervalMs: number;
2335
+ eventLimit: number;
2336
+ replaySkewMarginMs: number;
2337
+ reconcileIntervalMs: number;
2338
+ }, {
2339
+ transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
2340
+ pollIntervalMs?: number | undefined;
2341
+ eventLimit?: number | undefined;
2342
+ replaySkewMarginMs?: number | undefined;
2343
+ reconcileIntervalMs?: number | undefined;
2344
+ }>>;
2345
+ dispatch: z.ZodDefault<z.ZodObject<{
2346
+ errorCooldownMs: z.ZodDefault<z.ZodNumber>;
2347
+ maxAttempts: z.ZodDefault<z.ZodNumber>;
2348
+ }, "strip", z.ZodTypeAny, {
2349
+ errorCooldownMs: number;
2350
+ maxAttempts: number;
2351
+ }, {
2352
+ errorCooldownMs?: number | undefined;
1722
2353
  maxAttempts?: number | undefined;
1723
2354
  }>>;
1724
2355
  loop: z.ZodDefault<z.ZodObject<{
@@ -1849,10 +2480,22 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
1849
2480
  mergePolicy: z.ZodDefault<z.ZodEnum<["never", "on-green-with-review"]>>;
1850
2481
  babysitter: z.ZodDefault<z.ZodObject<{
1851
2482
  enabled: z.ZodDefault<z.ZodBoolean>;
2483
+ mode: z.ZodDefault<z.ZodEnum<["factory-created", "routed-open-prs"]>>;
2484
+ excludeLabels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2485
+ excludePullRequests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2486
+ notifyHumans: z.ZodDefault<z.ZodBoolean>;
1852
2487
  }, "strip", z.ZodTypeAny, {
1853
2488
  enabled: boolean;
2489
+ mode: "factory-created" | "routed-open-prs";
2490
+ excludeLabels: string[];
2491
+ excludePullRequests: string[];
2492
+ notifyHumans: boolean;
1854
2493
  }, {
1855
2494
  enabled?: boolean | undefined;
2495
+ mode?: "factory-created" | "routed-open-prs" | undefined;
2496
+ excludeLabels?: string[] | undefined;
2497
+ excludePullRequests?: string[] | undefined;
2498
+ notifyHumans?: boolean | undefined;
1856
2499
  }>>;
1857
2500
  reporting: z.ZodDefault<z.ZodObject<{
1858
2501
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -1873,6 +2516,140 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
1873
2516
  batchSize?: number | undefined;
1874
2517
  requestTimeoutMs?: number | undefined;
1875
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
+ }>>;
1876
2653
  github: z.ZodDefault<z.ZodObject<{
1877
2654
  identity: z.ZodDefault<z.ZodEnum<["app", "user", "auto"]>>;
1878
2655
  }, "strip", z.ZodTypeAny, {
@@ -2393,88 +3170,317 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2393
3170
  };
2394
3171
  };
2395
3172
  } | undefined;
2396
- }, {
2397
- kubernetes?: {
2398
- connections?: {
2399
- id: string;
2400
- credential: {
2401
- kind: "kubeconfig" | "irsa";
2402
- secretRef: string;
2403
- };
2404
- target?: "byoc" | "managed" | undefined;
2405
- customers?: string[] | undefined;
2406
- repositories?: string[] | undefined;
2407
- context?: string | undefined;
2408
- protectedNamespaces?: string[] | undefined;
2409
- allowClusterScopedResources?: boolean | undefined;
2410
- allowedClusterScopedKinds?: string[] | undefined;
2411
- nodeSelector?: Record<string, string> | undefined;
2412
- tolerations?: {
2413
- key?: string | undefined;
2414
- operator?: "Exists" | "Equal" | undefined;
2415
- value?: string | undefined;
2416
- effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
2417
- tolerationSeconds?: number | undefined;
2418
- }[] | undefined;
2419
- fidelityCaveat?: string | undefined;
2420
- }[] | undefined;
2421
- defaults?: {
2422
- ttlMs?: number | undefined;
2423
- readinessTimeoutMs?: number | undefined;
2424
- resourceQuota?: Record<string, string> | undefined;
2425
- limitRange?: {
2426
- default?: Record<string, string> | undefined;
2427
- max?: Record<string, string> | undefined;
2428
- defaultRequest?: Record<string, string> | undefined;
2429
- } | undefined;
2430
- } | undefined;
3173
+ }, {
3174
+ kubernetes?: {
3175
+ connections?: {
3176
+ id: string;
3177
+ credential: {
3178
+ kind: "kubeconfig" | "irsa";
3179
+ secretRef: string;
3180
+ };
3181
+ target?: "byoc" | "managed" | undefined;
3182
+ customers?: string[] | undefined;
3183
+ repositories?: string[] | undefined;
3184
+ context?: string | undefined;
3185
+ protectedNamespaces?: string[] | undefined;
3186
+ allowClusterScopedResources?: boolean | undefined;
3187
+ allowedClusterScopedKinds?: string[] | undefined;
3188
+ nodeSelector?: Record<string, string> | undefined;
3189
+ tolerations?: {
3190
+ key?: string | undefined;
3191
+ operator?: "Exists" | "Equal" | undefined;
3192
+ value?: string | undefined;
3193
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
3194
+ tolerationSeconds?: number | undefined;
3195
+ }[] | undefined;
3196
+ fidelityCaveat?: string | undefined;
3197
+ }[] | undefined;
3198
+ defaults?: {
3199
+ ttlMs?: number | undefined;
3200
+ readinessTimeoutMs?: number | undefined;
3201
+ resourceQuota?: Record<string, string> | undefined;
3202
+ limitRange?: {
3203
+ default?: Record<string, string> | undefined;
3204
+ max?: Record<string, string> | undefined;
3205
+ defaultRequest?: Record<string, string> | undefined;
3206
+ } | undefined;
3207
+ } | undefined;
3208
+ } | undefined;
3209
+ }>>;
3210
+ } & {
3211
+ workspaceId: z.ZodOptional<z.ZodString>;
3212
+ capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
3213
+ cloneRoot: z.ZodOptional<z.ZodString>;
3214
+ clonePaths: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
3215
+ dryRun: z.ZodDefault<z.ZodBoolean>;
3216
+ factoryLoopHeartbeatPath: z.ZodOptional<z.ZodString>;
3217
+ factoryLoopRegistryPath: z.ZodOptional<z.ZodString>;
3218
+ preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
3219
+ provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
3220
+ access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
3221
+ services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
3222
+ /** Local HTTP port the repository's development server listens on. */
3223
+ port: z.ZodNumber;
3224
+ /** Consecutive node-local ports Factory may allocate for concurrent issues. */
3225
+ portSpan: z.ZodOptional<z.ZodNumber>;
3226
+ /** Optional stable tailnet HTTPS port; otherwise Factory allocates one. */
3227
+ httpsPort: z.ZodOptional<z.ZodNumber>;
3228
+ /** Foreground command Factory supervises for the issue-lifetime preview. */
3229
+ startCommand: z.ZodString;
3230
+ }, "strip", z.ZodTypeAny, {
3231
+ port: number;
3232
+ startCommand: string;
3233
+ portSpan?: number | undefined;
3234
+ httpsPort?: number | undefined;
3235
+ }, {
3236
+ port: number;
3237
+ startCommand: string;
3238
+ portSpan?: number | undefined;
3239
+ httpsPort?: number | undefined;
3240
+ }>, {
3241
+ port: number;
3242
+ startCommand: string;
3243
+ portSpan?: number | undefined;
3244
+ httpsPort?: number | undefined;
3245
+ }, {
3246
+ port: number;
3247
+ startCommand: string;
3248
+ portSpan?: number | undefined;
3249
+ httpsPort?: number | undefined;
3250
+ }>>>;
3251
+ tailscaleBinary: z.ZodDefault<z.ZodString>;
3252
+ registryPath: z.ZodDefault<z.ZodString>;
3253
+ httpsPortRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
3254
+ }, "strip", z.ZodTypeAny, {
3255
+ registryPath: string;
3256
+ provider: "tailscale-serve";
3257
+ access: "tailnet";
3258
+ services: Record<string, {
3259
+ port: number;
3260
+ startCommand: string;
3261
+ portSpan?: number | undefined;
3262
+ httpsPort?: number | undefined;
3263
+ }>;
3264
+ tailscaleBinary: string;
3265
+ httpsPortRange: [number, number];
3266
+ }, {
3267
+ registryPath?: string | undefined;
3268
+ provider?: "tailscale-serve" | undefined;
3269
+ access?: "tailnet" | undefined;
3270
+ services?: Record<string, {
3271
+ port: number;
3272
+ startCommand: string;
3273
+ portSpan?: number | undefined;
3274
+ httpsPort?: number | undefined;
3275
+ }> | undefined;
3276
+ tailscaleBinary?: string | undefined;
3277
+ httpsPortRange?: [number, number] | undefined;
3278
+ }>, {
3279
+ registryPath: string;
3280
+ provider: "tailscale-serve";
3281
+ access: "tailnet";
3282
+ services: Record<string, {
3283
+ port: number;
3284
+ startCommand: string;
3285
+ portSpan?: number | undefined;
3286
+ httpsPort?: number | undefined;
3287
+ }>;
3288
+ tailscaleBinary: string;
3289
+ httpsPortRange: [number, number];
3290
+ }, {
3291
+ registryPath?: string | undefined;
3292
+ provider?: "tailscale-serve" | undefined;
3293
+ access?: "tailnet" | undefined;
3294
+ services?: Record<string, {
3295
+ port: number;
3296
+ startCommand: string;
3297
+ portSpan?: number | undefined;
3298
+ httpsPort?: number | undefined;
3299
+ }> | undefined;
3300
+ tailscaleBinary?: string | undefined;
3301
+ httpsPortRange?: [number, number] | undefined;
3302
+ }>>;
3303
+ }, "strip", z.ZodTypeAny, {
3304
+ clonePaths: Record<string, string>;
3305
+ triage: {
3306
+ maxImplementers: number;
3307
+ };
3308
+ babysitter: {
3309
+ enabled: boolean;
3310
+ mode: "factory-created" | "routed-open-prs";
3311
+ excludeLabels: string[];
3312
+ excludePullRequests: string[];
3313
+ notifyHumans: boolean;
3314
+ };
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
+ };
3333
+ subscription: {
3334
+ teams: string[];
3335
+ projects: string[];
3336
+ labels: string[];
3337
+ assignees: string[];
3338
+ };
3339
+ liveSubscription: {
3340
+ transport: "subscribe-and-poll" | "subscribe" | "poll";
3341
+ pollIntervalMs: number;
3342
+ eventLimit: number;
3343
+ replaySkewMarginMs: number;
3344
+ reconcileIntervalMs: number;
3345
+ };
3346
+ dispatch: {
3347
+ errorCooldownMs: number;
3348
+ maxAttempts: number;
3349
+ };
3350
+ loop: {
3351
+ maxIterations: number;
3352
+ maxConsecutiveFailures: number;
3353
+ heartbeatPath: string;
3354
+ registryPath: string;
3355
+ heartbeatStaleMs: number;
3356
+ };
3357
+ repos: {
3358
+ overrides: Record<string, string>;
3359
+ byLabel: Record<string, string>;
3360
+ byProject: Record<string, string>;
3361
+ keywordRules: {
3362
+ pattern: string;
3363
+ repo: string;
3364
+ }[];
3365
+ clonePaths: Record<string, string>;
3366
+ default?: string | undefined;
3367
+ org?: string | undefined;
3368
+ names?: string[] | undefined;
3369
+ cloneRoot?: string | undefined;
3370
+ };
3371
+ models: {
3372
+ babysitter: string;
3373
+ implementer?: string | undefined;
3374
+ reviewer?: string | undefined;
3375
+ triage?: string | undefined;
3376
+ };
3377
+ agentCapabilities: {
3378
+ implementer: "spawn:codex" | "spawn:claude";
3379
+ reviewer: "spawn:codex" | "spawn:claude";
3380
+ babysitter: "spawn:codex" | "spawn:claude";
3381
+ };
3382
+ github: {
3383
+ identity: "app" | "user" | "auto";
3384
+ };
3385
+ mergePolicy: "never" | "on-green-with-review";
3386
+ reporting: {
3387
+ enabled: boolean;
3388
+ batchSize: number;
3389
+ requestTimeoutMs: number;
3390
+ instanceName?: string | undefined;
3391
+ outboxPath?: string | undefined;
3392
+ };
3393
+ verification: {
3394
+ enabled: boolean;
3395
+ descriptorPath: string;
3396
+ maxConcurrentEnvironments: number;
3397
+ maxRunTimeoutMs: number;
3398
+ maxEnvironmentTtlMs: number;
3399
+ maxTeardownTimeoutMs: number;
3400
+ };
3401
+ terminalState: "done" | "human-review";
3402
+ stateIds: {
3403
+ readyForAgent?: string | undefined;
3404
+ agentImplementing?: string | undefined;
3405
+ inPlanning?: string | undefined;
3406
+ done?: string | undefined;
3407
+ humanReview?: string | undefined;
3408
+ };
3409
+ safety: {
3410
+ requireTitlePrefix: string;
3411
+ requireLabel: string;
3412
+ requireTeamKey: string;
3413
+ };
3414
+ environments: {
3415
+ kubernetes?: {
3416
+ connections: {
3417
+ id: string;
3418
+ target: "byoc" | "managed";
3419
+ customers: string[];
3420
+ repositories: string[];
3421
+ credential: {
3422
+ kind: "kubeconfig" | "irsa";
3423
+ secretRef: string;
3424
+ };
3425
+ protectedNamespaces: string[];
3426
+ allowClusterScopedResources: boolean;
3427
+ allowedClusterScopedKinds: string[];
3428
+ nodeSelector: Record<string, string>;
3429
+ tolerations: {
3430
+ key?: string | undefined;
3431
+ operator?: "Exists" | "Equal" | undefined;
3432
+ value?: string | undefined;
3433
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
3434
+ tolerationSeconds?: number | undefined;
3435
+ }[];
3436
+ context?: string | undefined;
3437
+ fidelityCaveat?: string | undefined;
3438
+ }[];
3439
+ defaults: {
3440
+ ttlMs: number;
3441
+ readinessTimeoutMs: number;
3442
+ resourceQuota: Record<string, string>;
3443
+ limitRange: {
3444
+ default: Record<string, string>;
3445
+ max: Record<string, string>;
3446
+ defaultRequest: Record<string, string>;
3447
+ };
3448
+ };
3449
+ } | undefined;
3450
+ };
3451
+ capabilities: string[];
3452
+ dryRun: boolean;
3453
+ cloneRoot?: string | undefined;
3454
+ slack?: {
3455
+ channel: string;
3456
+ style: "threaded-summarized";
3457
+ botUserId: string;
3458
+ stakeholderUserIds: string[];
3459
+ staleAfterMs: number;
3460
+ conversationCoalesceMs: number;
3461
+ } | undefined;
3462
+ workspaceId?: string | undefined;
3463
+ localMountRoot?: string | undefined;
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
+ })[];
2431
3481
  } | undefined;
2432
- }>>;
2433
- } & {
2434
- workspaceId: z.ZodOptional<z.ZodString>;
2435
- capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2436
- cloneRoot: z.ZodOptional<z.ZodString>;
2437
- clonePaths: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
2438
- dryRun: z.ZodDefault<z.ZodBoolean>;
2439
- factoryLoopHeartbeatPath: z.ZodOptional<z.ZodString>;
2440
- factoryLoopRegistryPath: z.ZodOptional<z.ZodString>;
2441
- preview: z.ZodOptional<z.ZodEffects<z.ZodObject<{
2442
- provider: z.ZodDefault<z.ZodLiteral<"tailscale-serve">>;
2443
- access: z.ZodDefault<z.ZodLiteral<"tailnet">>;
2444
- services: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
2445
- /** Local HTTP port the repository's development server listens on. */
2446
- port: z.ZodNumber;
2447
- /** Consecutive node-local ports Factory may allocate for concurrent issues. */
2448
- portSpan: z.ZodOptional<z.ZodNumber>;
2449
- /** Optional stable tailnet HTTPS port; otherwise Factory allocates one. */
2450
- httpsPort: z.ZodOptional<z.ZodNumber>;
2451
- /** Foreground command Factory supervises for the issue-lifetime preview. */
2452
- startCommand: z.ZodString;
2453
- }, "strip", z.ZodTypeAny, {
2454
- port: number;
2455
- startCommand: string;
2456
- portSpan?: number | undefined;
2457
- httpsPort?: number | undefined;
2458
- }, {
2459
- port: number;
2460
- startCommand: string;
2461
- portSpan?: number | undefined;
2462
- httpsPort?: number | undefined;
2463
- }>, {
2464
- port: number;
2465
- startCommand: string;
2466
- portSpan?: number | undefined;
2467
- httpsPort?: number | undefined;
2468
- }, {
2469
- port: number;
2470
- startCommand: string;
2471
- portSpan?: number | undefined;
2472
- httpsPort?: number | undefined;
2473
- }>>>;
2474
- tailscaleBinary: z.ZodDefault<z.ZodString>;
2475
- registryPath: z.ZodDefault<z.ZodString>;
2476
- httpsPortRange: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
2477
- }, "strip", z.ZodTypeAny, {
3482
+ } | undefined;
3483
+ preview?: {
2478
3484
  registryPath: string;
2479
3485
  provider: "tailscale-serve";
2480
3486
  access: "tailnet";
@@ -2486,31 +3492,130 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2486
3492
  }>;
2487
3493
  tailscaleBinary: string;
2488
3494
  httpsPortRange: [number, number];
2489
- }, {
3495
+ } | undefined;
3496
+ factoryLoopHeartbeatPath?: string | undefined;
3497
+ factoryLoopRegistryPath?: string | undefined;
3498
+ }, {
3499
+ repos: {
3500
+ default?: string | undefined;
3501
+ org?: string | undefined;
3502
+ names?: string[] | undefined;
3503
+ overrides?: Record<string, string> | undefined;
3504
+ byLabel?: Record<string, string> | undefined;
3505
+ byProject?: Record<string, string> | undefined;
3506
+ keywordRules?: {
3507
+ pattern: string;
3508
+ repo: string;
3509
+ }[] | undefined;
3510
+ cloneRoot?: string | undefined;
3511
+ clonePaths?: Record<string, string> | undefined;
3512
+ };
3513
+ cloneRoot?: string | undefined;
3514
+ clonePaths?: Record<string, string> | undefined;
3515
+ triage?: {
3516
+ maxImplementers?: number | undefined;
3517
+ } | undefined;
3518
+ babysitter?: {
3519
+ enabled?: boolean | undefined;
3520
+ mode?: "factory-created" | "routed-open-prs" | undefined;
3521
+ excludeLabels?: string[] | undefined;
3522
+ excludePullRequests?: string[] | undefined;
3523
+ notifyHumans?: boolean | undefined;
3524
+ } | undefined;
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;
3551
+ workspaceId?: string | undefined;
3552
+ localMountRoot?: string | undefined;
3553
+ subscription?: {
3554
+ teams?: string[] | undefined;
3555
+ projects?: string[] | undefined;
3556
+ labels?: string[] | undefined;
3557
+ assignees?: string[] | undefined;
3558
+ } | undefined;
3559
+ liveSubscription?: {
3560
+ transport?: "subscribe-and-poll" | "subscribe" | "poll" | undefined;
3561
+ pollIntervalMs?: number | undefined;
3562
+ eventLimit?: number | undefined;
3563
+ replaySkewMarginMs?: number | undefined;
3564
+ reconcileIntervalMs?: number | undefined;
3565
+ } | undefined;
3566
+ dispatch?: {
3567
+ errorCooldownMs?: number | undefined;
3568
+ maxAttempts?: number | undefined;
3569
+ } | undefined;
3570
+ loop?: {
3571
+ maxIterations?: number | undefined;
3572
+ maxConsecutiveFailures?: number | undefined;
3573
+ heartbeatPath?: string | undefined;
2490
3574
  registryPath?: string | undefined;
2491
- provider?: "tailscale-serve" | undefined;
2492
- access?: "tailnet" | undefined;
2493
- services?: Record<string, {
2494
- port: number;
2495
- startCommand: string;
2496
- portSpan?: number | undefined;
2497
- httpsPort?: number | undefined;
2498
- }> | undefined;
2499
- tailscaleBinary?: string | undefined;
2500
- httpsPortRange?: [number, number] | undefined;
2501
- }>, {
2502
- registryPath: string;
2503
- provider: "tailscale-serve";
2504
- access: "tailnet";
2505
- services: Record<string, {
2506
- port: number;
2507
- startCommand: string;
2508
- portSpan?: number | undefined;
2509
- httpsPort?: number | undefined;
2510
- }>;
2511
- tailscaleBinary: string;
2512
- httpsPortRange: [number, number];
2513
- }, {
3575
+ heartbeatStaleMs?: number | undefined;
3576
+ } | undefined;
3577
+ models?: {
3578
+ implementer?: string | undefined;
3579
+ reviewer?: string | undefined;
3580
+ triage?: string | undefined;
3581
+ babysitter?: string | undefined;
3582
+ } | undefined;
3583
+ agentCapabilities?: {
3584
+ implementer?: "spawn:codex" | "spawn:claude" | undefined;
3585
+ reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3586
+ babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3587
+ } | undefined;
3588
+ github?: {
3589
+ identity?: "app" | "user" | "auto" | undefined;
3590
+ } | undefined;
3591
+ issueSource?: "linear" | "github" | undefined;
3592
+ mergePolicy?: "never" | "on-green-with-review" | undefined;
3593
+ reporting?: {
3594
+ enabled?: boolean | undefined;
3595
+ instanceName?: string | undefined;
3596
+ outboxPath?: string | undefined;
3597
+ batchSize?: number | undefined;
3598
+ requestTimeoutMs?: number | undefined;
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;
3618
+ preview?: {
2514
3619
  registryPath?: string | undefined;
2515
3620
  provider?: "tailscale-serve" | undefined;
2516
3621
  access?: "tailnet" | undefined;
@@ -2522,16 +3627,99 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2522
3627
  }> | undefined;
2523
3628
  tailscaleBinary?: string | undefined;
2524
3629
  httpsPortRange?: [number, number] | undefined;
2525
- }>>;
2526
- }, "strip", z.ZodTypeAny, {
3630
+ } | undefined;
3631
+ verification?: {
3632
+ enabled?: boolean | undefined;
3633
+ descriptorPath?: string | undefined;
3634
+ maxConcurrentEnvironments?: number | undefined;
3635
+ maxRunTimeoutMs?: number | undefined;
3636
+ maxEnvironmentTtlMs?: number | undefined;
3637
+ maxTeardownTimeoutMs?: number | undefined;
3638
+ } | undefined;
3639
+ terminalState?: "done" | "human-review" | undefined;
3640
+ stateIds?: {
3641
+ readyForAgent?: string | undefined;
3642
+ agentImplementing?: string | undefined;
3643
+ inPlanning?: string | undefined;
3644
+ done?: string | undefined;
3645
+ humanReview?: string | undefined;
3646
+ } | undefined;
3647
+ safety?: {
3648
+ requireTitlePrefix?: string | undefined;
3649
+ requireLabel?: string | undefined;
3650
+ requireTeamKey?: string | undefined;
3651
+ } | undefined;
3652
+ environments?: {
3653
+ kubernetes?: {
3654
+ connections?: {
3655
+ id: string;
3656
+ credential: {
3657
+ kind: "kubeconfig" | "irsa";
3658
+ secretRef: string;
3659
+ };
3660
+ target?: "byoc" | "managed" | undefined;
3661
+ customers?: string[] | undefined;
3662
+ repositories?: string[] | undefined;
3663
+ context?: string | undefined;
3664
+ protectedNamespaces?: string[] | undefined;
3665
+ allowClusterScopedResources?: boolean | undefined;
3666
+ allowedClusterScopedKinds?: string[] | undefined;
3667
+ nodeSelector?: Record<string, string> | undefined;
3668
+ tolerations?: {
3669
+ key?: string | undefined;
3670
+ operator?: "Exists" | "Equal" | undefined;
3671
+ value?: string | undefined;
3672
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute" | undefined;
3673
+ tolerationSeconds?: number | undefined;
3674
+ }[] | undefined;
3675
+ fidelityCaveat?: string | undefined;
3676
+ }[] | undefined;
3677
+ defaults?: {
3678
+ ttlMs?: number | undefined;
3679
+ readinessTimeoutMs?: number | undefined;
3680
+ resourceQuota?: Record<string, string> | undefined;
3681
+ limitRange?: {
3682
+ default?: Record<string, string> | undefined;
3683
+ max?: Record<string, string> | undefined;
3684
+ defaultRequest?: Record<string, string> | undefined;
3685
+ } | undefined;
3686
+ } | undefined;
3687
+ } | undefined;
3688
+ } | undefined;
3689
+ capabilities?: string[] | undefined;
3690
+ dryRun?: boolean | undefined;
3691
+ factoryLoopHeartbeatPath?: string | undefined;
3692
+ factoryLoopRegistryPath?: string | undefined;
3693
+ }>, {
2527
3694
  clonePaths: Record<string, string>;
2528
3695
  triage: {
2529
3696
  maxImplementers: number;
2530
3697
  };
2531
3698
  babysitter: {
2532
3699
  enabled: boolean;
3700
+ mode: "factory-created" | "routed-open-prs";
3701
+ excludeLabels: string[];
3702
+ excludePullRequests: string[];
3703
+ notifyHumans: boolean;
2533
3704
  };
2534
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
+ };
2535
3723
  subscription: {
2536
3724
  teams: string[];
2537
3725
  projects: string[];
@@ -2543,6 +3731,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2543
3731
  pollIntervalMs: number;
2544
3732
  eventLimit: number;
2545
3733
  replaySkewMarginMs: number;
3734
+ reconcileIntervalMs: number;
2546
3735
  };
2547
3736
  dispatch: {
2548
3737
  errorCooldownMs: number;
@@ -2580,23 +3769,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2580
3769
  reviewer: "spawn:codex" | "spawn:claude";
2581
3770
  babysitter: "spawn:codex" | "spawn:claude";
2582
3771
  };
2583
- linear: {
2584
- states: {
2585
- readyForAgent?: string | undefined;
2586
- agentImplementing?: string | undefined;
2587
- inPlanning?: string | undefined;
2588
- done?: string | undefined;
2589
- humanReview?: string | undefined;
2590
- };
2591
- statesByTeam: Record<string, {
2592
- readyForAgent?: string | undefined;
2593
- agentImplementing?: string | undefined;
2594
- inPlanning?: string | undefined;
2595
- done?: string | undefined;
2596
- humanReview?: string | undefined;
2597
- }>;
2598
- teamIds: Record<string, string>;
2599
- };
2600
3772
  github: {
2601
3773
  identity: "app" | "user" | "auto";
2602
3774
  };
@@ -2669,7 +3841,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2669
3841
  capabilities: string[];
2670
3842
  dryRun: boolean;
2671
3843
  cloneRoot?: string | undefined;
2672
- workspaceId?: string | undefined;
2673
3844
  slack?: {
2674
3845
  channel: string;
2675
3846
  style: "threaded-summarized";
@@ -2678,7 +3849,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2678
3849
  staleAfterMs: number;
2679
3850
  conversationCoalesceMs: number;
2680
3851
  } | undefined;
3852
+ workspaceId?: string | undefined;
3853
+ localMountRoot?: string | undefined;
2681
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;
2682
3873
  preview?: {
2683
3874
  registryPath: string;
2684
3875
  provider: "tailscale-serve";
@@ -2716,9 +3907,39 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2716
3907
  } | undefined;
2717
3908
  babysitter?: {
2718
3909
  enabled?: boolean | undefined;
3910
+ mode?: "factory-created" | "routed-open-prs" | undefined;
3911
+ excludeLabels?: string[] | undefined;
3912
+ excludePullRequests?: string[] | undefined;
3913
+ notifyHumans?: boolean | undefined;
2719
3914
  } | undefined;
2720
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;
2721
3941
  workspaceId?: string | undefined;
3942
+ localMountRoot?: string | undefined;
2722
3943
  subscription?: {
2723
3944
  teams?: string[] | undefined;
2724
3945
  projects?: string[] | undefined;
@@ -2730,6 +3951,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2730
3951
  pollIntervalMs?: number | undefined;
2731
3952
  eventLimit?: number | undefined;
2732
3953
  replaySkewMarginMs?: number | undefined;
3954
+ reconcileIntervalMs?: number | undefined;
2733
3955
  } | undefined;
2734
3956
  dispatch?: {
2735
3957
  errorCooldownMs?: number | undefined;
@@ -2753,31 +3975,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2753
3975
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
2754
3976
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
2755
3977
  } | undefined;
2756
- slack?: {
2757
- channel: string;
2758
- style?: "threaded-summarized" | undefined;
2759
- botUserId?: string | undefined;
2760
- stakeholderUserIds?: string[] | undefined;
2761
- staleAfterMs?: number | undefined;
2762
- conversationCoalesceMs?: number | undefined;
2763
- } | undefined;
2764
- linear?: {
2765
- states?: {
2766
- readyForAgent?: string | undefined;
2767
- agentImplementing?: string | undefined;
2768
- inPlanning?: string | undefined;
2769
- done?: string | undefined;
2770
- humanReview?: string | undefined;
2771
- } | undefined;
2772
- statesByTeam?: Record<string, {
2773
- readyForAgent?: string | undefined;
2774
- agentImplementing?: string | undefined;
2775
- inPlanning?: string | undefined;
2776
- done?: string | undefined;
2777
- humanReview?: string | undefined;
2778
- } | undefined> | undefined;
2779
- teamIds?: Record<string, string> | undefined;
2780
- } | undefined;
2781
3978
  github?: {
2782
3979
  identity?: "app" | "user" | "auto" | undefined;
2783
3980
  } | undefined;
@@ -2790,6 +3987,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2790
3987
  batchSize?: number | undefined;
2791
3988
  requestTimeoutMs?: number | undefined;
2792
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;
2793
4008
  preview?: {
2794
4009
  registryPath?: string | undefined;
2795
4010
  provider?: "tailscale-serve" | undefined;
@@ -2919,13 +4134,35 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2919
4134
  };
2920
4135
  babysitter: {
2921
4136
  enabled: boolean;
4137
+ mode: "factory-created" | "routed-open-prs";
4138
+ excludeLabels: string[];
4139
+ excludePullRequests: string[];
4140
+ notifyHumans: boolean;
2922
4141
  };
2923
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
+ };
2924
4160
  liveSubscription: {
2925
4161
  transport: "subscribe-and-poll" | "subscribe" | "poll";
2926
4162
  pollIntervalMs: number;
2927
4163
  eventLimit: number;
2928
4164
  replaySkewMarginMs: number;
4165
+ reconcileIntervalMs: number;
2929
4166
  };
2930
4167
  dispatch: {
2931
4168
  errorCooldownMs: number;
@@ -2942,23 +4179,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
2942
4179
  reviewer: "spawn:codex" | "spawn:claude";
2943
4180
  babysitter: "spawn:codex" | "spawn:claude";
2944
4181
  };
2945
- linear: {
2946
- states: {
2947
- readyForAgent?: string | undefined;
2948
- agentImplementing?: string | undefined;
2949
- inPlanning?: string | undefined;
2950
- done?: string | undefined;
2951
- humanReview?: string | undefined;
2952
- };
2953
- statesByTeam: Record<string, {
2954
- readyForAgent?: string | undefined;
2955
- agentImplementing?: string | undefined;
2956
- inPlanning?: string | undefined;
2957
- done?: string | undefined;
2958
- humanReview?: string | undefined;
2959
- }>;
2960
- teamIds: Record<string, string>;
2961
- };
2962
4182
  github: {
2963
4183
  identity: "app" | "user" | "auto";
2964
4184
  };
@@ -3030,7 +4250,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3030
4250
  };
3031
4251
  capabilities: string[];
3032
4252
  dryRun: boolean;
3033
- workspaceId?: string | undefined;
3034
4253
  slack?: {
3035
4254
  channel: string;
3036
4255
  style: "threaded-summarized";
@@ -3039,7 +4258,27 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3039
4258
  staleAfterMs: number;
3040
4259
  conversationCoalesceMs: number;
3041
4260
  } | undefined;
4261
+ workspaceId?: string | undefined;
4262
+ localMountRoot?: string | undefined;
3042
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;
3043
4282
  }, {
3044
4283
  repos: {
3045
4284
  default?: string | undefined;
@@ -3062,9 +4301,39 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3062
4301
  } | undefined;
3063
4302
  babysitter?: {
3064
4303
  enabled?: boolean | undefined;
4304
+ mode?: "factory-created" | "routed-open-prs" | undefined;
4305
+ excludeLabels?: string[] | undefined;
4306
+ excludePullRequests?: string[] | undefined;
4307
+ notifyHumans?: boolean | undefined;
3065
4308
  } | undefined;
3066
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;
3067
4335
  workspaceId?: string | undefined;
4336
+ localMountRoot?: string | undefined;
3068
4337
  subscription?: {
3069
4338
  teams?: string[] | undefined;
3070
4339
  projects?: string[] | undefined;
@@ -3076,6 +4345,7 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3076
4345
  pollIntervalMs?: number | undefined;
3077
4346
  eventLimit?: number | undefined;
3078
4347
  replaySkewMarginMs?: number | undefined;
4348
+ reconcileIntervalMs?: number | undefined;
3079
4349
  } | undefined;
3080
4350
  dispatch?: {
3081
4351
  errorCooldownMs?: number | undefined;
@@ -3099,31 +4369,6 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3099
4369
  reviewer?: "spawn:codex" | "spawn:claude" | undefined;
3100
4370
  babysitter?: "spawn:codex" | "spawn:claude" | undefined;
3101
4371
  } | undefined;
3102
- slack?: {
3103
- channel: string;
3104
- style?: "threaded-summarized" | undefined;
3105
- botUserId?: string | undefined;
3106
- stakeholderUserIds?: string[] | undefined;
3107
- staleAfterMs?: number | undefined;
3108
- conversationCoalesceMs?: number | undefined;
3109
- } | undefined;
3110
- linear?: {
3111
- states?: {
3112
- readyForAgent?: string | undefined;
3113
- agentImplementing?: string | undefined;
3114
- inPlanning?: string | undefined;
3115
- done?: string | undefined;
3116
- humanReview?: string | undefined;
3117
- } | undefined;
3118
- statesByTeam?: Record<string, {
3119
- readyForAgent?: string | undefined;
3120
- agentImplementing?: string | undefined;
3121
- inPlanning?: string | undefined;
3122
- done?: string | undefined;
3123
- humanReview?: string | undefined;
3124
- } | undefined> | undefined;
3125
- teamIds?: Record<string, string> | undefined;
3126
- } | undefined;
3127
4372
  github?: {
3128
4373
  identity?: "app" | "user" | "auto" | undefined;
3129
4374
  } | undefined;
@@ -3136,6 +4381,24 @@ export declare const FactoryConfigSchema: z.ZodEffects<z.ZodObject<{
3136
4381
  batchSize?: number | undefined;
3137
4382
  requestTimeoutMs?: number | undefined;
3138
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;
3139
4402
  preview?: {
3140
4403
  registryPath?: string | undefined;
3141
4404
  provider?: "tailscale-serve" | undefined;