@structured-vibe-coding/core 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/defaults/teams/research/roles/researcher.md +29 -0
  2. package/defaults/teams/research/team.yaml +7 -0
  3. package/defaults/teams/software/roles/architect.md +31 -0
  4. package/defaults/teams/software/roles/dev-lead.md +32 -0
  5. package/defaults/teams/software/roles/developer.md +30 -0
  6. package/defaults/teams/software/roles/product-manager.md +32 -0
  7. package/defaults/teams/software/roles/product-owner.md +30 -0
  8. package/defaults/teams/software/roles/qa.md +35 -0
  9. package/defaults/teams/software/routing.yaml +4 -0
  10. package/defaults/teams/software/team.yaml +24 -0
  11. package/defaults/teams/solo/roles/developer.md +28 -0
  12. package/defaults/teams/solo/team.yaml +7 -0
  13. package/defaults/templates/plan.md +17 -0
  14. package/defaults/templates/qa-testing.md +11 -0
  15. package/defaults/templates/review.md +11 -0
  16. package/defaults/templates/signoff.md +7 -0
  17. package/defaults/templates/story.md +13 -0
  18. package/defaults/templates/task.md +11 -0
  19. package/defaults/workflows/team-software.yaml +293 -0
  20. package/dist/{agents-AKSUXQHN.js → agents-YN3Z3VOH.js} +3 -3
  21. package/dist/{change-context-REE7UKU7.js → change-context-CZT3U7MZ.js} +1 -1
  22. package/dist/{chunk-QGP43XCN.js → chunk-EDXT3RTN.js} +1 -1
  23. package/dist/{chunk-44LQ5BKZ.js → chunk-HUSXETPS.js} +833 -4
  24. package/dist/{chunk-LHSR7JG2.js → chunk-NY5FFWXG.js} +306 -31
  25. package/dist/{chunk-4PIRWYRA.js → chunk-O4OQWVC7.js} +166 -81
  26. package/dist/{chunk-QHV5KZKX.js → chunk-TNWFMRIA.js} +139 -10
  27. package/dist/{gather-ZNV2NAUN.js → gather-ZKVMJW5L.js} +1 -1
  28. package/dist/{greenfield-I5S5OS2D.js → greenfield-O2DI27HY.js} +3 -3
  29. package/dist/index.d.ts +833 -10
  30. package/dist/index.js +3357 -511
  31. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -5,16 +5,20 @@ declare const GateSchema: z.ZodObject<{
5
5
  type: z.ZodDefault<z.ZodEnum<["none", "soft", "hard"]>>;
6
6
  mode: z.ZodDefault<z.ZodEnum<["none", "human_approval", "checklist"]>>;
7
7
  checklist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
8
+ /** Role names, or human for a person listed on the team. */
9
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
8
10
  overridable: z.ZodDefault<z.ZodBoolean>;
9
11
  }, "strip", z.ZodTypeAny, {
10
12
  type: "none" | "soft" | "hard";
11
13
  checklist: string[];
12
14
  mode: "none" | "human_approval" | "checklist";
13
15
  overridable: boolean;
16
+ approvers?: string[] | undefined;
14
17
  }, {
15
18
  type?: "none" | "soft" | "hard" | undefined;
16
19
  checklist?: string[] | undefined;
17
20
  mode?: "none" | "human_approval" | "checklist" | undefined;
21
+ approvers?: string[] | undefined;
18
22
  overridable?: boolean | undefined;
19
23
  }>;
20
24
  declare const ArtifactDefSchema: z.ZodObject<{
@@ -58,6 +62,15 @@ declare const StageSchema: z.ZodObject<{
58
62
  kind: z.ZodDefault<z.ZodEnum<["standard", "brainstorm", "clarify"]>>;
59
63
  /** When true, stage is optional (skippable); agents may skip if not needed */
60
64
  optional: z.ZodDefault<z.ZodBoolean>;
65
+ /** Role that produces this stage. */
66
+ owner: z.ZodOptional<z.ZodString>;
67
+ /** Roles who work with the owner on this stage. */
68
+ collaborates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
69
+ /**
70
+ * One item per matching file when the stage starts.
71
+ * A directory, a slash, and one star in the file name: tasks/T-*.md
72
+ */
73
+ items_from: z.ZodOptional<z.ZodString>;
61
74
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
62
75
  id: z.ZodString;
63
76
  path: z.ZodString;
@@ -78,16 +91,20 @@ declare const StageSchema: z.ZodObject<{
78
91
  type: z.ZodDefault<z.ZodEnum<["none", "soft", "hard"]>>;
79
92
  mode: z.ZodDefault<z.ZodEnum<["none", "human_approval", "checklist"]>>;
80
93
  checklist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
94
+ /** Role names, or human for a person listed on the team. */
95
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
81
96
  overridable: z.ZodDefault<z.ZodBoolean>;
82
97
  }, "strip", z.ZodTypeAny, {
83
98
  type: "none" | "soft" | "hard";
84
99
  checklist: string[];
85
100
  mode: "none" | "human_approval" | "checklist";
86
101
  overridable: boolean;
102
+ approvers?: string[] | undefined;
87
103
  }, {
88
104
  type?: "none" | "soft" | "hard" | undefined;
89
105
  checklist?: string[] | undefined;
90
106
  mode?: "none" | "human_approval" | "checklist" | undefined;
107
+ approvers?: string[] | undefined;
91
108
  overridable?: boolean | undefined;
92
109
  }>>;
93
110
  skippable: z.ZodDefault<z.ZodBoolean>;
@@ -153,10 +170,14 @@ declare const StageSchema: z.ZodObject<{
153
170
  checklist: string[];
154
171
  mode: "none" | "human_approval" | "checklist";
155
172
  overridable: boolean;
173
+ approvers?: string[] | undefined;
156
174
  };
157
175
  skippable: boolean;
158
176
  title?: string | undefined;
159
177
  summary?: string | undefined;
178
+ owner?: string | undefined;
179
+ collaborates?: string[] | undefined;
180
+ items_from?: string | undefined;
160
181
  skip_when?: {
161
182
  flags?: string[] | undefined;
162
183
  } | undefined;
@@ -178,6 +199,9 @@ declare const StageSchema: z.ZodObject<{
178
199
  summary?: string | undefined;
179
200
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
180
201
  optional?: boolean | undefined;
202
+ owner?: string | undefined;
203
+ collaborates?: string[] | undefined;
204
+ items_from?: string | undefined;
181
205
  artifacts?: {
182
206
  path: string;
183
207
  id: string;
@@ -188,6 +212,7 @@ declare const StageSchema: z.ZodObject<{
188
212
  type?: "none" | "soft" | "hard" | undefined;
189
213
  checklist?: string[] | undefined;
190
214
  mode?: "none" | "human_approval" | "checklist" | undefined;
215
+ approvers?: string[] | undefined;
191
216
  overridable?: boolean | undefined;
192
217
  } | undefined;
193
218
  skippable?: boolean | undefined;
@@ -223,6 +248,15 @@ declare const WorkflowSchema: z.ZodObject<{
223
248
  kind: z.ZodDefault<z.ZodEnum<["standard", "brainstorm", "clarify"]>>;
224
249
  /** When true, stage is optional (skippable); agents may skip if not needed */
225
250
  optional: z.ZodDefault<z.ZodBoolean>;
251
+ /** Role that produces this stage. */
252
+ owner: z.ZodOptional<z.ZodString>;
253
+ /** Roles who work with the owner on this stage. */
254
+ collaborates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
255
+ /**
256
+ * One item per matching file when the stage starts.
257
+ * A directory, a slash, and one star in the file name: tasks/T-*.md
258
+ */
259
+ items_from: z.ZodOptional<z.ZodString>;
226
260
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
227
261
  id: z.ZodString;
228
262
  path: z.ZodString;
@@ -243,16 +277,20 @@ declare const WorkflowSchema: z.ZodObject<{
243
277
  type: z.ZodDefault<z.ZodEnum<["none", "soft", "hard"]>>;
244
278
  mode: z.ZodDefault<z.ZodEnum<["none", "human_approval", "checklist"]>>;
245
279
  checklist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
280
+ /** Role names, or human for a person listed on the team. */
281
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
246
282
  overridable: z.ZodDefault<z.ZodBoolean>;
247
283
  }, "strip", z.ZodTypeAny, {
248
284
  type: "none" | "soft" | "hard";
249
285
  checklist: string[];
250
286
  mode: "none" | "human_approval" | "checklist";
251
287
  overridable: boolean;
288
+ approvers?: string[] | undefined;
252
289
  }, {
253
290
  type?: "none" | "soft" | "hard" | undefined;
254
291
  checklist?: string[] | undefined;
255
292
  mode?: "none" | "human_approval" | "checklist" | undefined;
293
+ approvers?: string[] | undefined;
256
294
  overridable?: boolean | undefined;
257
295
  }>>;
258
296
  skippable: z.ZodDefault<z.ZodBoolean>;
@@ -318,10 +356,14 @@ declare const WorkflowSchema: z.ZodObject<{
318
356
  checklist: string[];
319
357
  mode: "none" | "human_approval" | "checklist";
320
358
  overridable: boolean;
359
+ approvers?: string[] | undefined;
321
360
  };
322
361
  skippable: boolean;
323
362
  title?: string | undefined;
324
363
  summary?: string | undefined;
364
+ owner?: string | undefined;
365
+ collaborates?: string[] | undefined;
366
+ items_from?: string | undefined;
325
367
  skip_when?: {
326
368
  flags?: string[] | undefined;
327
369
  } | undefined;
@@ -343,6 +385,9 @@ declare const WorkflowSchema: z.ZodObject<{
343
385
  summary?: string | undefined;
344
386
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
345
387
  optional?: boolean | undefined;
388
+ owner?: string | undefined;
389
+ collaborates?: string[] | undefined;
390
+ items_from?: string | undefined;
346
391
  artifacts?: {
347
392
  path: string;
348
393
  id: string;
@@ -353,6 +398,7 @@ declare const WorkflowSchema: z.ZodObject<{
353
398
  type?: "none" | "soft" | "hard" | undefined;
354
399
  checklist?: string[] | undefined;
355
400
  mode?: "none" | "human_approval" | "checklist" | undefined;
401
+ approvers?: string[] | undefined;
356
402
  overridable?: boolean | undefined;
357
403
  } | undefined;
358
404
  skippable?: boolean | undefined;
@@ -435,10 +481,14 @@ declare const WorkflowSchema: z.ZodObject<{
435
481
  checklist: string[];
436
482
  mode: "none" | "human_approval" | "checklist";
437
483
  overridable: boolean;
484
+ approvers?: string[] | undefined;
438
485
  };
439
486
  skippable: boolean;
440
487
  title?: string | undefined;
441
488
  summary?: string | undefined;
489
+ owner?: string | undefined;
490
+ collaborates?: string[] | undefined;
491
+ items_from?: string | undefined;
442
492
  skip_when?: {
443
493
  flags?: string[] | undefined;
444
494
  } | undefined;
@@ -477,6 +527,9 @@ declare const WorkflowSchema: z.ZodObject<{
477
527
  summary?: string | undefined;
478
528
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
479
529
  optional?: boolean | undefined;
530
+ owner?: string | undefined;
531
+ collaborates?: string[] | undefined;
532
+ items_from?: string | undefined;
480
533
  artifacts?: {
481
534
  path: string;
482
535
  id: string;
@@ -487,6 +540,7 @@ declare const WorkflowSchema: z.ZodObject<{
487
540
  type?: "none" | "soft" | "hard" | undefined;
488
541
  checklist?: string[] | undefined;
489
542
  mode?: "none" | "human_approval" | "checklist" | undefined;
543
+ approvers?: string[] | undefined;
490
544
  overridable?: boolean | undefined;
491
545
  } | undefined;
492
546
  skippable?: boolean | undefined;
@@ -681,6 +735,15 @@ declare const ChangeMetaSchema: z.ZodObject<{
681
735
  kind: z.ZodDefault<z.ZodEnum<["standard", "brainstorm", "clarify"]>>;
682
736
  /** When true, stage is optional (skippable); agents may skip if not needed */
683
737
  optional: z.ZodDefault<z.ZodBoolean>;
738
+ /** Role that produces this stage. */
739
+ owner: z.ZodOptional<z.ZodString>;
740
+ /** Roles who work with the owner on this stage. */
741
+ collaborates: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
742
+ /**
743
+ * One item per matching file when the stage starts.
744
+ * A directory, a slash, and one star in the file name: tasks/T-*.md
745
+ */
746
+ items_from: z.ZodOptional<z.ZodString>;
684
747
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
685
748
  id: z.ZodString;
686
749
  path: z.ZodString;
@@ -701,16 +764,20 @@ declare const ChangeMetaSchema: z.ZodObject<{
701
764
  type: z.ZodDefault<z.ZodEnum<["none", "soft", "hard"]>>;
702
765
  mode: z.ZodDefault<z.ZodEnum<["none", "human_approval", "checklist"]>>;
703
766
  checklist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
767
+ /** Role names, or human for a person listed on the team. */
768
+ approvers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
704
769
  overridable: z.ZodDefault<z.ZodBoolean>;
705
770
  }, "strip", z.ZodTypeAny, {
706
771
  type: "none" | "soft" | "hard";
707
772
  checklist: string[];
708
773
  mode: "none" | "human_approval" | "checklist";
709
774
  overridable: boolean;
775
+ approvers?: string[] | undefined;
710
776
  }, {
711
777
  type?: "none" | "soft" | "hard" | undefined;
712
778
  checklist?: string[] | undefined;
713
779
  mode?: "none" | "human_approval" | "checklist" | undefined;
780
+ approvers?: string[] | undefined;
714
781
  overridable?: boolean | undefined;
715
782
  }>>;
716
783
  skippable: z.ZodDefault<z.ZodBoolean>;
@@ -776,10 +843,14 @@ declare const ChangeMetaSchema: z.ZodObject<{
776
843
  checklist: string[];
777
844
  mode: "none" | "human_approval" | "checklist";
778
845
  overridable: boolean;
846
+ approvers?: string[] | undefined;
779
847
  };
780
848
  skippable: boolean;
781
849
  title?: string | undefined;
782
850
  summary?: string | undefined;
851
+ owner?: string | undefined;
852
+ collaborates?: string[] | undefined;
853
+ items_from?: string | undefined;
783
854
  skip_when?: {
784
855
  flags?: string[] | undefined;
785
856
  } | undefined;
@@ -801,6 +872,9 @@ declare const ChangeMetaSchema: z.ZodObject<{
801
872
  summary?: string | undefined;
802
873
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
803
874
  optional?: boolean | undefined;
875
+ owner?: string | undefined;
876
+ collaborates?: string[] | undefined;
877
+ items_from?: string | undefined;
804
878
  artifacts?: {
805
879
  path: string;
806
880
  id: string;
@@ -811,6 +885,7 @@ declare const ChangeMetaSchema: z.ZodObject<{
811
885
  type?: "none" | "soft" | "hard" | undefined;
812
886
  checklist?: string[] | undefined;
813
887
  mode?: "none" | "human_approval" | "checklist" | undefined;
888
+ approvers?: string[] | undefined;
814
889
  overridable?: boolean | undefined;
815
890
  } | undefined;
816
891
  skippable?: boolean | undefined;
@@ -848,10 +923,14 @@ declare const ChangeMetaSchema: z.ZodObject<{
848
923
  checklist: string[];
849
924
  mode: "none" | "human_approval" | "checklist";
850
925
  overridable: boolean;
926
+ approvers?: string[] | undefined;
851
927
  };
852
928
  skippable: boolean;
853
929
  title?: string | undefined;
854
930
  summary?: string | undefined;
931
+ owner?: string | undefined;
932
+ collaborates?: string[] | undefined;
933
+ items_from?: string | undefined;
855
934
  skip_when?: {
856
935
  flags?: string[] | undefined;
857
936
  } | undefined;
@@ -877,6 +956,9 @@ declare const ChangeMetaSchema: z.ZodObject<{
877
956
  summary?: string | undefined;
878
957
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
879
958
  optional?: boolean | undefined;
959
+ owner?: string | undefined;
960
+ collaborates?: string[] | undefined;
961
+ items_from?: string | undefined;
880
962
  artifacts?: {
881
963
  path: string;
882
964
  id: string;
@@ -887,6 +969,7 @@ declare const ChangeMetaSchema: z.ZodObject<{
887
969
  type?: "none" | "soft" | "hard" | undefined;
888
970
  checklist?: string[] | undefined;
889
971
  mode?: "none" | "human_approval" | "checklist" | undefined;
972
+ approvers?: string[] | undefined;
890
973
  overridable?: boolean | undefined;
891
974
  } | undefined;
892
975
  skippable?: boolean | undefined;
@@ -1011,10 +1094,14 @@ declare const ChangeMetaSchema: z.ZodObject<{
1011
1094
  checklist: string[];
1012
1095
  mode: "none" | "human_approval" | "checklist";
1013
1096
  overridable: boolean;
1097
+ approvers?: string[] | undefined;
1014
1098
  };
1015
1099
  skippable: boolean;
1016
1100
  title?: string | undefined;
1017
1101
  summary?: string | undefined;
1102
+ owner?: string | undefined;
1103
+ collaborates?: string[] | undefined;
1104
+ items_from?: string | undefined;
1018
1105
  skip_when?: {
1019
1106
  flags?: string[] | undefined;
1020
1107
  } | undefined;
@@ -1086,6 +1173,9 @@ declare const ChangeMetaSchema: z.ZodObject<{
1086
1173
  summary?: string | undefined;
1087
1174
  kind?: "standard" | "brainstorm" | "clarify" | undefined;
1088
1175
  optional?: boolean | undefined;
1176
+ owner?: string | undefined;
1177
+ collaborates?: string[] | undefined;
1178
+ items_from?: string | undefined;
1089
1179
  artifacts?: {
1090
1180
  path: string;
1091
1181
  id: string;
@@ -1096,6 +1186,7 @@ declare const ChangeMetaSchema: z.ZodObject<{
1096
1186
  type?: "none" | "soft" | "hard" | undefined;
1097
1187
  checklist?: string[] | undefined;
1098
1188
  mode?: "none" | "human_approval" | "checklist" | undefined;
1189
+ approvers?: string[] | undefined;
1099
1190
  overridable?: boolean | undefined;
1100
1191
  } | undefined;
1101
1192
  skippable?: boolean | undefined;
@@ -1240,6 +1331,37 @@ declare const TokenUsageMetricSchema: z.ZodObject<{
1240
1331
  measured: true;
1241
1332
  model?: string | null | undefined;
1242
1333
  }>;
1334
+ declare const DecisionMetricSchema: z.ZodObject<{
1335
+ workType: z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>;
1336
+ kind: z.ZodEnum<["reason", "decide"]>;
1337
+ provider: z.ZodEnum<["command", "ollama"]>;
1338
+ model: z.ZodNullable<z.ZodString>;
1339
+ startedAt: z.ZodString;
1340
+ inputTokens: z.ZodNullable<z.ZodNumber>;
1341
+ cacheReadTokens: z.ZodNullable<z.ZodNumber>;
1342
+ cacheWriteTokens: z.ZodNullable<z.ZodNumber>;
1343
+ outputTokens: z.ZodNullable<z.ZodNumber>;
1344
+ }, "strip", z.ZodTypeAny, {
1345
+ kind: "reason" | "decide";
1346
+ startedAt: string;
1347
+ provider: "command" | "ollama";
1348
+ model: string | null;
1349
+ inputTokens: number | null;
1350
+ cacheReadTokens: number | null;
1351
+ cacheWriteTokens: number | null;
1352
+ outputTokens: number | null;
1353
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1354
+ }, {
1355
+ kind: "reason" | "decide";
1356
+ startedAt: string;
1357
+ provider: "command" | "ollama";
1358
+ model: string | null;
1359
+ inputTokens: number | null;
1360
+ cacheReadTokens: number | null;
1361
+ cacheWriteTokens: number | null;
1362
+ outputTokens: number | null;
1363
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1364
+ }>;
1243
1365
  declare const ChangeMetricsSchema: z.ZodObject<{
1244
1366
  version: z.ZodLiteral<1>;
1245
1367
  phases: z.ZodArray<z.ZodEffects<z.ZodObject<{
@@ -1297,6 +1419,37 @@ declare const ChangeMetricsSchema: z.ZodObject<{
1297
1419
  measured: true;
1298
1420
  model?: string | null | undefined;
1299
1421
  }>, "many">;
1422
+ decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1423
+ workType: z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>;
1424
+ kind: z.ZodEnum<["reason", "decide"]>;
1425
+ provider: z.ZodEnum<["command", "ollama"]>;
1426
+ model: z.ZodNullable<z.ZodString>;
1427
+ startedAt: z.ZodString;
1428
+ inputTokens: z.ZodNullable<z.ZodNumber>;
1429
+ cacheReadTokens: z.ZodNullable<z.ZodNumber>;
1430
+ cacheWriteTokens: z.ZodNullable<z.ZodNumber>;
1431
+ outputTokens: z.ZodNullable<z.ZodNumber>;
1432
+ }, "strip", z.ZodTypeAny, {
1433
+ kind: "reason" | "decide";
1434
+ startedAt: string;
1435
+ provider: "command" | "ollama";
1436
+ model: string | null;
1437
+ inputTokens: number | null;
1438
+ cacheReadTokens: number | null;
1439
+ cacheWriteTokens: number | null;
1440
+ outputTokens: number | null;
1441
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1442
+ }, {
1443
+ kind: "reason" | "decide";
1444
+ startedAt: string;
1445
+ provider: "command" | "ollama";
1446
+ model: string | null;
1447
+ inputTokens: number | null;
1448
+ cacheReadTokens: number | null;
1449
+ cacheWriteTokens: number | null;
1450
+ outputTokens: number | null;
1451
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1452
+ }>, "many">>;
1300
1453
  }, "strip", z.ZodTypeAny, {
1301
1454
  version: 1;
1302
1455
  phases: {
@@ -1316,6 +1469,17 @@ declare const ChangeMetricsSchema: z.ZodObject<{
1316
1469
  measured: true;
1317
1470
  model?: string | null | undefined;
1318
1471
  }[];
1472
+ decisions?: {
1473
+ kind: "reason" | "decide";
1474
+ startedAt: string;
1475
+ provider: "command" | "ollama";
1476
+ model: string | null;
1477
+ inputTokens: number | null;
1478
+ cacheReadTokens: number | null;
1479
+ cacheWriteTokens: number | null;
1480
+ outputTokens: number | null;
1481
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1482
+ }[] | undefined;
1319
1483
  }, {
1320
1484
  version: 1;
1321
1485
  phases: {
@@ -1335,9 +1499,21 @@ declare const ChangeMetricsSchema: z.ZodObject<{
1335
1499
  measured: true;
1336
1500
  model?: string | null | undefined;
1337
1501
  }[];
1502
+ decisions?: {
1503
+ kind: "reason" | "decide";
1504
+ startedAt: string;
1505
+ provider: "command" | "ollama";
1506
+ model: string | null;
1507
+ inputTokens: number | null;
1508
+ cacheReadTokens: number | null;
1509
+ cacheWriteTokens: number | null;
1510
+ outputTokens: number | null;
1511
+ workType: "code" | "route" | "classify" | "check" | "draft" | "design" | "review";
1512
+ }[] | undefined;
1338
1513
  }>;
1339
1514
  type PhaseMetric = z.infer<typeof PhaseMetricSchema>;
1340
1515
  type TokenUsageMetric = z.infer<typeof TokenUsageMetricSchema>;
1516
+ type DecisionMetric = z.infer<typeof DecisionMetricSchema>;
1341
1517
  type ChangeMetrics = z.infer<typeof ChangeMetricsSchema>;
1342
1518
  interface MetricsImportResult {
1343
1519
  imported: number;
@@ -1349,6 +1525,7 @@ interface MetricsImportResult {
1349
1525
  }
1350
1526
  declare function emptyChangeMetrics(): ChangeMetrics;
1351
1527
  declare function readChangeMetrics(projectRoot: string, config: Config, changeId: string): Promise<ChangeMetrics>;
1528
+ declare function recordDecisionMetric(projectRoot: string, config: Config, changeId: string, draft: DecisionMetric): Promise<void>;
1352
1529
  declare function startPhase(projectRoot: string, config: Config, changeId: string, phase: string, startedAt?: string): Promise<void>;
1353
1530
  declare function transitionPhase(projectRoot: string, config: Config, changeId: string, fromPhase: string, toPhase: string | null, at?: string, fromStartedAt?: string): Promise<void>;
1354
1531
  /**
@@ -1827,6 +2004,11 @@ declare function syncChangeHead(projectRoot: string, config: Config, changeId: s
1827
2004
  }): Promise<SyncChangeResult>;
1828
2005
 
1829
2006
  declare function listWorkflowNames(projectRoot: string): Promise<string[]>;
2007
+ /** Workflow packs shipped inside this CLI build. */
2008
+ declare function listBundledWorkflowNames(): Promise<string[]>;
2009
+ /** Bundled workflow names that this project has not copied into `.sdd/workflows/`. */
2010
+ declare function missingBundledWorkflows(projectRoot: string): Promise<string[]>;
2011
+ declare function workflowUnavailableMessage(name: string, available: string[], bundled: string[]): string;
1830
2012
  declare function loadWorkflow(projectRoot: string, name: string): Promise<Workflow>;
1831
2013
  /** Resolve effective stages for a change (workflow + per-change overrides). */
1832
2014
  declare function resolveStages(workflow: Workflow, meta: ChangeMeta): Stage[];
@@ -1855,6 +2037,9 @@ declare function recommendWorkflow(projectRoot: string, title: string, config: C
1855
2037
  alternatives: string[];
1856
2038
  }>;
1857
2039
 
2040
+ /** cl100k counts for each workflow file, its artifact templates, and the active change. */
2041
+ declare function formatTokenInventory(projectRoot: string, config: Config): Promise<string>;
2042
+
1858
2043
  interface ChangeContext {
1859
2044
  id: string;
1860
2045
  /** Absolute directory used for file reads and writes. */
@@ -1881,7 +2066,7 @@ declare function resolveChangeId(projectRoot: string, config: Config, changeId?:
1881
2066
  */
1882
2067
  declare function incompletePriorStageErrors(ctx: ChangeContext): Promise<string[]>;
1883
2068
  /** Artifact + gate + verify checks before leaving the current stage. */
1884
- declare function canLeaveStage(ctx: ChangeContext, config: Config): Promise<{
2069
+ declare function canLeaveStage(ctx: ChangeContext, config: Config, projectRoot?: string): Promise<{
1885
2070
  ok: boolean;
1886
2071
  errors: string[];
1887
2072
  warnings: string[];
@@ -2005,6 +2190,29 @@ declare function saveGeneratedManifest(path: string, manifest: GeneratedManifest
2005
2190
  declare function reconcileGeneratedTree(projectRoot: string, sourceDir: string, destinationDir: string, destinationRelative: string, manifest: GeneratedManifest, force: boolean): Promise<ReconcileGeneratedResult>;
2006
2191
  declare function describeKept(k: KeptFile): string;
2007
2192
 
2193
+ /** One product role, in the order the host agent must run. */
2194
+ interface ProductTeamMember {
2195
+ order: number;
2196
+ name: string;
2197
+ job: string;
2198
+ accepts: string;
2199
+ file: string;
2200
+ source: "repo" | "user";
2201
+ }
2202
+ /**
2203
+ * Directory whose `.sdd/` holds a user-default team.
2204
+ * `SDD_HOME` overrides the home directory so a test does not read a real `~/.sdd`.
2205
+ */
2206
+ declare function productTeamHome(): string;
2207
+ /**
2208
+ * Product team for the host entrypoint.
2209
+ * A repo `team.yaml` sets the order. Role files in name order are the fallback.
2210
+ * A user-global team is used only when the repo has neither.
2211
+ */
2212
+ declare function loadProductTeam(projectRoot: string): Promise<ProductTeamMember[]>;
2213
+ /** Markdown block for protocol, AGENTS.md, the host rule, and the handoff. */
2214
+ declare function renderProductTeamSection(members: ProductTeamMember[]): string;
2215
+
2008
2216
  /**
2009
2217
  * AI coding agents (not IDEs).
2010
2218
  * Speckit-style: one integration at a time; public keys: `copilot` | `claude` | `grok` | `ollama` | `kilo`.
@@ -2158,7 +2366,7 @@ declare function installAgentIntegration(opts: InstallAgentOptions): Promise<Ins
2158
2366
  */
2159
2367
  declare function installAgentIntegrations(opts: InstallAgentsOptions): Promise<InstallAgentsResult>;
2160
2368
  /** Thin agent body shared across hosts (same text). Paths come from config. */
2161
- declare function renderThinAgent(role: SddAgentRole, config?: Config): string;
2369
+ declare function renderThinAgent(role: SddAgentRole, config?: Config, team?: ProductTeamMember[]): string;
2162
2370
  interface InstalledAgentSnapshot {
2163
2371
  /** Public key: copilot | claude | grok | ollama | kilo */
2164
2372
  ai: string;
@@ -2193,8 +2401,8 @@ declare function refreshActiveAgentContext(projectRoot: string): Promise<string
2193
2401
  /** Default-path protocol text. Generated files use {@link renderProtocolMd}. */
2194
2402
  declare const PROTOCOL_MD: string;
2195
2403
  /** Single playbook — paths come from project config, not hard-coded defaults. */
2196
- declare function renderProtocolMd(config: Pick<Config, "memory_path" | "changes_path">): string;
2197
- declare function renderAgentsMd(integ: AgentIntegration, config?: Config): string;
2404
+ declare function renderProtocolMd(config: Pick<Config, "memory_path" | "changes_path">, team?: ProductTeamMember[]): string;
2405
+ declare function renderAgentsMd(integ: AgentIntegration, config?: Config, team?: ProductTeamMember[]): string;
2198
2406
 
2199
2407
  interface InitOptions {
2200
2408
  projectRoot: string;
@@ -2277,6 +2485,7 @@ declare function uniqueChangeDirName(base: string, taken: Set<string>): string;
2277
2485
  */
2278
2486
  declare function defaultsRoot(): string;
2279
2487
  declare function defaultWorkflowsDir(): string;
2488
+ declare function defaultTeamsDir(): string;
2280
2489
  declare function defaultTemplatesDir(): string;
2281
2490
  declare function defaultMemoryDir(): string;
2282
2491
  declare function defaultMcpYamlPath(): string;
@@ -2764,9 +2973,9 @@ declare const McpSourceSchema: z.ZodObject<{
2764
2973
  };
2765
2974
  priority: number;
2766
2975
  enabled: boolean;
2976
+ command: string;
2767
2977
  args: string[];
2768
2978
  transport: "stdio";
2769
- command: string;
2770
2979
  env: Record<string, string>;
2771
2980
  cwd?: string | undefined;
2772
2981
  invoke?: {
@@ -2873,9 +3082,9 @@ declare const McpConfigSchema: z.ZodObject<{
2873
3082
  };
2874
3083
  priority: number;
2875
3084
  enabled: boolean;
3085
+ command: string;
2876
3086
  args: string[];
2877
3087
  transport: "stdio";
2878
- command: string;
2879
3088
  env: Record<string, string>;
2880
3089
  cwd?: string | undefined;
2881
3090
  invoke?: {
@@ -2920,9 +3129,9 @@ declare const McpConfigSchema: z.ZodObject<{
2920
3129
  };
2921
3130
  priority: number;
2922
3131
  enabled: boolean;
3132
+ command: string;
2923
3133
  args: string[];
2924
3134
  transport: "stdio";
2925
- command: string;
2926
3135
  env: Record<string, string>;
2927
3136
  cwd?: string | undefined;
2928
3137
  invoke?: {
@@ -3051,7 +3260,21 @@ declare function gatherMcpContextForChange(projectRoot: string, ctx: ChangeConte
3051
3260
  declare function formatMcpContextForHandoff(results: McpFetchResult[]): string;
3052
3261
  declare function listMatchingSourceIds(sources: McpSource[], match: McpMatchContext): string[];
3053
3262
 
3054
- interface RoleProfile {
3263
+ interface RoleLists {
3264
+ stages: string[];
3265
+ owns: string[];
3266
+ inputs: string[];
3267
+ outputs: string[];
3268
+ collaborates: string[];
3269
+ reviews: string[];
3270
+ approvers: string[];
3271
+ never: string[];
3272
+ askHumanWhen: string[];
3273
+ skills: string[];
3274
+ rules: string[];
3275
+ goals: string[];
3276
+ }
3277
+ interface RoleProfile extends RoleLists {
3055
3278
  name: string;
3056
3279
  label: string;
3057
3280
  job: string;
@@ -3066,6 +3289,27 @@ interface RoleModel {
3066
3289
  prompt: string;
3067
3290
  }): Promise<string>;
3068
3291
  }
3292
+ declare const WORK_TYPES: readonly ["route", "classify", "check", "draft", "design", "code", "review"];
3293
+ type WorkType = (typeof WORK_TYPES)[number];
3294
+ declare function isWorkType(value: string): value is WorkType;
3295
+ /** Route, classify, and check are cheap decisions. The other work types reason. */
3296
+ declare function workKind(workType: WorkType): "reason" | "decide";
3297
+ interface DecisionModel {
3298
+ decide<T extends string>(input: {
3299
+ state: string;
3300
+ question: string;
3301
+ options: readonly T[];
3302
+ }): Promise<{
3303
+ pick: T;
3304
+ probs: Record<T, number>;
3305
+ }>;
3306
+ }
3307
+ interface ModelChoice {
3308
+ id: string;
3309
+ kind: "reason" | "decide";
3310
+ provider: "rules" | "command" | "ollama";
3311
+ why: string;
3312
+ }
3069
3313
  interface RoleCommandResult {
3070
3314
  exitCode: number;
3071
3315
  stdout: string;
@@ -3117,6 +3361,10 @@ interface RunRoleInput {
3117
3361
  stop?: boolean;
3118
3362
  model?: RoleModel;
3119
3363
  now?: () => Date;
3364
+ /** One draft for the guide. Writes stay inside this role, and a team file is not used. */
3365
+ guide?: {
3366
+ changeDir: string;
3367
+ };
3120
3368
  }
3121
3369
  interface AllowRoleInput {
3122
3370
  runId: string;
@@ -3126,18 +3374,52 @@ interface AllowRoleInput {
3126
3374
  declare function runRole(root: string, input: RunRoleInput): Promise<RoleCommandResult>;
3127
3375
  declare function allowRole(root: string, input: AllowRoleInput): Promise<RoleCommandResult>;
3128
3376
 
3377
+ declare function roleContextBody(root: string, name: string): Promise<string>;
3378
+ declare function setRoleContext(root: string, input: {
3379
+ name: string;
3380
+ text?: string;
3381
+ knowledge?: string;
3382
+ generate?: boolean;
3383
+ }): Promise<RoleCommandResult>;
3384
+
3385
+ type Duty = "planning" | "architecture" | "construction";
3386
+ declare function dutyForStage(id: string, allIds: string[]): Duty;
3387
+ declare function prepareGuide(root: string, input?: {
3388
+ workflow?: string;
3389
+ agents?: false | AgentTarget;
3390
+ }): Promise<RoleCommandResult>;
3391
+ declare function runGuide(root: string, input?: {
3392
+ title?: string;
3393
+ answer?: string;
3394
+ workflow?: string;
3395
+ model?: RoleModel;
3396
+ agents?: false | AgentTarget;
3397
+ now?: () => Date;
3398
+ }): Promise<RoleCommandResult>;
3399
+
3400
+ declare function recordSignoff(root: string, input: {
3401
+ note?: string;
3402
+ stage?: string;
3403
+ change?: string;
3404
+ }): Promise<RoleCommandResult>;
3405
+ declare function recordDecisionRequest(root: string, input: {
3406
+ note?: string;
3407
+ change?: string;
3408
+ }): Promise<RoleCommandResult>;
3409
+
3129
3410
  declare function createRole(root: string, input: {
3130
3411
  name: string;
3131
3412
  label: string;
3132
3413
  job: string;
3133
3414
  description?: string;
3134
3415
  askFirst?: boolean;
3135
- }): Promise<RoleCommandResult>;
3416
+ } & Partial<RoleLists>): Promise<RoleCommandResult>;
3136
3417
  declare function editRole(root: string, nameInput: string, patch: {
3137
3418
  label?: string;
3138
3419
  job?: string;
3139
3420
  description?: string;
3140
3421
  askFirst?: boolean;
3422
+ stages?: string[];
3141
3423
  }): Promise<RoleCommandResult>;
3142
3424
  declare function pinRole(root: string, name: string): Promise<RoleCommandResult>;
3143
3425
  declare function hideRole(root: string, name: string): Promise<RoleCommandResult>;
@@ -3148,6 +3430,547 @@ declare function showRoles(root: string, opts?: {
3148
3430
  declare function duplicateRole(root: string, nameInput: string): Promise<RoleCommandResult>;
3149
3431
  declare function deleteRole(root: string, nameInput: string): Promise<RoleCommandResult>;
3150
3432
 
3433
+ /** Project team file written to `.sdd/team.yaml`. */
3434
+ declare const TeamSchema: z.ZodEffects<z.ZodObject<{
3435
+ template: z.ZodOptional<z.ZodString>;
3436
+ branch: z.ZodString;
3437
+ rooms: z.ZodObject<{
3438
+ commit: z.ZodBoolean;
3439
+ }, "strict", z.ZodTypeAny, {
3440
+ commit: boolean;
3441
+ }, {
3442
+ commit: boolean;
3443
+ }>;
3444
+ bots: z.ZodArray<z.ZodObject<{
3445
+ name: z.ZodString;
3446
+ role: z.ZodString;
3447
+ wip: z.ZodNumber;
3448
+ }, "strict", z.ZodTypeAny, {
3449
+ name: string;
3450
+ role: string;
3451
+ wip: number;
3452
+ }, {
3453
+ name: string;
3454
+ role: string;
3455
+ wip: number;
3456
+ }>, "many">;
3457
+ humans: z.ZodDefault<z.ZodArray<z.ZodObject<{
3458
+ name: z.ZodString;
3459
+ }, "strict", z.ZodTypeAny, {
3460
+ name: string;
3461
+ }, {
3462
+ name: string;
3463
+ }>, "many">>;
3464
+ role_wip: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3465
+ limits: z.ZodOptional<z.ZodEffects<z.ZodObject<{
3466
+ loop_max_steps: z.ZodOptional<z.ZodNumber>;
3467
+ room_rounds: z.ZodOptional<z.ZodNumber>;
3468
+ }, "strict", z.ZodTypeAny, {
3469
+ loop_max_steps?: number | undefined;
3470
+ room_rounds?: number | undefined;
3471
+ }, {
3472
+ loop_max_steps?: number | undefined;
3473
+ room_rounds?: number | undefined;
3474
+ }>, {
3475
+ loop_max_steps?: number | undefined;
3476
+ room_rounds?: number | undefined;
3477
+ }, {
3478
+ loop_max_steps?: number | undefined;
3479
+ room_rounds?: number | undefined;
3480
+ }>>;
3481
+ }, "strict", z.ZodTypeAny, {
3482
+ branch: string;
3483
+ bots: {
3484
+ name: string;
3485
+ role: string;
3486
+ wip: number;
3487
+ }[];
3488
+ rooms: {
3489
+ commit: boolean;
3490
+ };
3491
+ humans: {
3492
+ name: string;
3493
+ }[];
3494
+ template?: string | undefined;
3495
+ role_wip?: Record<string, number> | undefined;
3496
+ limits?: {
3497
+ loop_max_steps?: number | undefined;
3498
+ room_rounds?: number | undefined;
3499
+ } | undefined;
3500
+ }, {
3501
+ branch: string;
3502
+ bots: {
3503
+ name: string;
3504
+ role: string;
3505
+ wip: number;
3506
+ }[];
3507
+ rooms: {
3508
+ commit: boolean;
3509
+ };
3510
+ template?: string | undefined;
3511
+ humans?: {
3512
+ name: string;
3513
+ }[] | undefined;
3514
+ role_wip?: Record<string, number> | undefined;
3515
+ limits?: {
3516
+ loop_max_steps?: number | undefined;
3517
+ room_rounds?: number | undefined;
3518
+ } | undefined;
3519
+ }>, {
3520
+ branch: string;
3521
+ bots: {
3522
+ name: string;
3523
+ role: string;
3524
+ wip: number;
3525
+ }[];
3526
+ rooms: {
3527
+ commit: boolean;
3528
+ };
3529
+ humans: {
3530
+ name: string;
3531
+ }[];
3532
+ template?: string | undefined;
3533
+ role_wip?: Record<string, number> | undefined;
3534
+ limits?: {
3535
+ loop_max_steps?: number | undefined;
3536
+ room_rounds?: number | undefined;
3537
+ } | undefined;
3538
+ }, {
3539
+ branch: string;
3540
+ bots: {
3541
+ name: string;
3542
+ role: string;
3543
+ wip: number;
3544
+ }[];
3545
+ rooms: {
3546
+ commit: boolean;
3547
+ };
3548
+ template?: string | undefined;
3549
+ humans?: {
3550
+ name: string;
3551
+ }[] | undefined;
3552
+ role_wip?: Record<string, number> | undefined;
3553
+ limits?: {
3554
+ loop_max_steps?: number | undefined;
3555
+ room_rounds?: number | undefined;
3556
+ } | undefined;
3557
+ }>;
3558
+ type TeamConfig = z.infer<typeof TeamSchema>;
3559
+
3560
+ declare const ModelEntrySchema: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
3561
+ kind: z.ZodLiteral<"decide">;
3562
+ provider: z.ZodLiteral<"rules">;
3563
+ }, "strict", z.ZodTypeAny, {
3564
+ kind: "decide";
3565
+ provider: "rules";
3566
+ }, {
3567
+ kind: "decide";
3568
+ provider: "rules";
3569
+ }>, z.ZodObject<{
3570
+ kind: z.ZodEnum<["decide", "reason"]>;
3571
+ provider: z.ZodLiteral<"command">;
3572
+ command_env: z.ZodString;
3573
+ min_confidence: z.ZodOptional<z.ZodNumber>;
3574
+ }, "strict", z.ZodTypeAny, {
3575
+ kind: "reason" | "decide";
3576
+ provider: "command";
3577
+ command_env: string;
3578
+ min_confidence?: number | undefined;
3579
+ }, {
3580
+ kind: "reason" | "decide";
3581
+ provider: "command";
3582
+ command_env: string;
3583
+ min_confidence?: number | undefined;
3584
+ }>, z.ZodObject<{
3585
+ kind: z.ZodLiteral<"decide">;
3586
+ provider: z.ZodLiteral<"ollama">;
3587
+ model: z.ZodString;
3588
+ base_url_env: z.ZodString;
3589
+ min_confidence: z.ZodOptional<z.ZodNumber>;
3590
+ }, "strict", z.ZodTypeAny, {
3591
+ kind: "decide";
3592
+ provider: "ollama";
3593
+ model: string;
3594
+ base_url_env: string;
3595
+ min_confidence?: number | undefined;
3596
+ }, {
3597
+ kind: "decide";
3598
+ provider: "ollama";
3599
+ model: string;
3600
+ base_url_env: string;
3601
+ min_confidence?: number | undefined;
3602
+ }>]>;
3603
+ type ModelEntry = z.infer<typeof ModelEntrySchema>;
3604
+ declare const ModelsConfigSchema: z.ZodEffects<z.ZodObject<{
3605
+ version: z.ZodLiteral<1>;
3606
+ models: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
3607
+ kind: z.ZodLiteral<"decide">;
3608
+ provider: z.ZodLiteral<"rules">;
3609
+ }, "strict", z.ZodTypeAny, {
3610
+ kind: "decide";
3611
+ provider: "rules";
3612
+ }, {
3613
+ kind: "decide";
3614
+ provider: "rules";
3615
+ }>, z.ZodObject<{
3616
+ kind: z.ZodEnum<["decide", "reason"]>;
3617
+ provider: z.ZodLiteral<"command">;
3618
+ command_env: z.ZodString;
3619
+ min_confidence: z.ZodOptional<z.ZodNumber>;
3620
+ }, "strict", z.ZodTypeAny, {
3621
+ kind: "reason" | "decide";
3622
+ provider: "command";
3623
+ command_env: string;
3624
+ min_confidence?: number | undefined;
3625
+ }, {
3626
+ kind: "reason" | "decide";
3627
+ provider: "command";
3628
+ command_env: string;
3629
+ min_confidence?: number | undefined;
3630
+ }>, z.ZodObject<{
3631
+ kind: z.ZodLiteral<"decide">;
3632
+ provider: z.ZodLiteral<"ollama">;
3633
+ model: z.ZodString;
3634
+ base_url_env: z.ZodString;
3635
+ min_confidence: z.ZodOptional<z.ZodNumber>;
3636
+ }, "strict", z.ZodTypeAny, {
3637
+ kind: "decide";
3638
+ provider: "ollama";
3639
+ model: string;
3640
+ base_url_env: string;
3641
+ min_confidence?: number | undefined;
3642
+ }, {
3643
+ kind: "decide";
3644
+ provider: "ollama";
3645
+ model: string;
3646
+ base_url_env: string;
3647
+ min_confidence?: number | undefined;
3648
+ }>]>>;
3649
+ defaults: z.ZodObject<{
3650
+ by_work_type: z.ZodRecord<z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>, z.ZodString>;
3651
+ fallback_reason: z.ZodString;
3652
+ fallback_decide: z.ZodString;
3653
+ }, "strict", z.ZodTypeAny, {
3654
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3655
+ fallback_reason: string;
3656
+ fallback_decide: string;
3657
+ }, {
3658
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3659
+ fallback_reason: string;
3660
+ fallback_decide: string;
3661
+ }>;
3662
+ overrides: z.ZodOptional<z.ZodObject<{
3663
+ bots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>, z.ZodString>>>;
3664
+ stages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>, z.ZodString>>>;
3665
+ roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["route", "classify", "check", "draft", "design", "code", "review"]>, z.ZodString>>>;
3666
+ }, "strict", z.ZodTypeAny, {
3667
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3668
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3669
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3670
+ }, {
3671
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3672
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3673
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3674
+ }>>;
3675
+ }, "strict", z.ZodTypeAny, {
3676
+ version: 1;
3677
+ models: Record<string, {
3678
+ kind: "decide";
3679
+ provider: "rules";
3680
+ } | {
3681
+ kind: "reason" | "decide";
3682
+ provider: "command";
3683
+ command_env: string;
3684
+ min_confidence?: number | undefined;
3685
+ } | {
3686
+ kind: "decide";
3687
+ provider: "ollama";
3688
+ model: string;
3689
+ base_url_env: string;
3690
+ min_confidence?: number | undefined;
3691
+ }>;
3692
+ defaults: {
3693
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3694
+ fallback_reason: string;
3695
+ fallback_decide: string;
3696
+ };
3697
+ overrides?: {
3698
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3699
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3700
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3701
+ } | undefined;
3702
+ }, {
3703
+ version: 1;
3704
+ models: Record<string, {
3705
+ kind: "decide";
3706
+ provider: "rules";
3707
+ } | {
3708
+ kind: "reason" | "decide";
3709
+ provider: "command";
3710
+ command_env: string;
3711
+ min_confidence?: number | undefined;
3712
+ } | {
3713
+ kind: "decide";
3714
+ provider: "ollama";
3715
+ model: string;
3716
+ base_url_env: string;
3717
+ min_confidence?: number | undefined;
3718
+ }>;
3719
+ defaults: {
3720
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3721
+ fallback_reason: string;
3722
+ fallback_decide: string;
3723
+ };
3724
+ overrides?: {
3725
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3726
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3727
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3728
+ } | undefined;
3729
+ }>, {
3730
+ version: 1;
3731
+ models: Record<string, {
3732
+ kind: "decide";
3733
+ provider: "rules";
3734
+ } | {
3735
+ kind: "reason" | "decide";
3736
+ provider: "command";
3737
+ command_env: string;
3738
+ min_confidence?: number | undefined;
3739
+ } | {
3740
+ kind: "decide";
3741
+ provider: "ollama";
3742
+ model: string;
3743
+ base_url_env: string;
3744
+ min_confidence?: number | undefined;
3745
+ }>;
3746
+ defaults: {
3747
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3748
+ fallback_reason: string;
3749
+ fallback_decide: string;
3750
+ };
3751
+ overrides?: {
3752
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3753
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3754
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3755
+ } | undefined;
3756
+ }, {
3757
+ version: 1;
3758
+ models: Record<string, {
3759
+ kind: "decide";
3760
+ provider: "rules";
3761
+ } | {
3762
+ kind: "reason" | "decide";
3763
+ provider: "command";
3764
+ command_env: string;
3765
+ min_confidence?: number | undefined;
3766
+ } | {
3767
+ kind: "decide";
3768
+ provider: "ollama";
3769
+ model: string;
3770
+ base_url_env: string;
3771
+ min_confidence?: number | undefined;
3772
+ }>;
3773
+ defaults: {
3774
+ by_work_type: Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>;
3775
+ fallback_reason: string;
3776
+ fallback_decide: string;
3777
+ };
3778
+ overrides?: {
3779
+ stages?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3780
+ bots?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3781
+ roles?: Record<string, Partial<Record<"code" | "route" | "classify" | "check" | "draft" | "design" | "review", string>>> | undefined;
3782
+ } | undefined;
3783
+ }>;
3784
+ type ModelsConfig = z.infer<typeof ModelsConfigSchema>;
3785
+ declare function loadModels(root: string): Promise<{
3786
+ config: ModelsConfig;
3787
+ } | {
3788
+ error: string;
3789
+ } | null>;
3790
+ declare function checkModels(root: string): Promise<{
3791
+ ok: true;
3792
+ } | {
3793
+ ok: false;
3794
+ message: string;
3795
+ }>;
3796
+
3797
+ interface ModelContext {
3798
+ workType: WorkType;
3799
+ role?: string;
3800
+ bot?: string;
3801
+ stage?: string;
3802
+ }
3803
+ /** Pure precedence: bot, stage, role, work-type default, then the fallback for that kind. */
3804
+ declare function selectModel(config: ModelsConfig, ctx: ModelContext): ModelChoice;
3805
+
3806
+ interface DecideInput<T extends string> {
3807
+ models: ModelsConfig | null;
3808
+ ctx: ModelContext & {
3809
+ workType: WorkType;
3810
+ };
3811
+ state: string;
3812
+ question: string;
3813
+ options: readonly T[];
3814
+ env: Readonly<Record<string, string | undefined>>;
3815
+ fetch?: typeof fetch;
3816
+ runCommand?: (command: string, stdin: string) => Promise<string>;
3817
+ now?: () => Date;
3818
+ metrics?: {
3819
+ projectRoot: string;
3820
+ config: Config;
3821
+ changeId: string;
3822
+ };
3823
+ }
3824
+ interface DecisionOutcome<T extends string> {
3825
+ pick: T | "human";
3826
+ source: "rules" | "decide" | "reason" | "human";
3827
+ choice: ModelChoice | null;
3828
+ confidence: number | null;
3829
+ }
3830
+ declare function decide<T extends string>(input: DecideInput<T>): Promise<DecisionOutcome<T>>;
3831
+
3832
+ declare function spawnModelCommand(command: string, stdin: string): Promise<string>;
3833
+ declare function modelFromEnv(env: Readonly<Record<string, string | undefined>>): RoleModel | undefined;
3834
+
3835
+ declare function formatModels(config: ModelsConfig): string;
3836
+ declare function explainModel(config: ModelsConfig, workType: WorkType, ctx: {
3837
+ role?: string;
3838
+ bot?: string;
3839
+ stage?: string;
3840
+ }): string;
3841
+
3842
+ interface RouteItem {
3843
+ id?: string;
3844
+ stage?: string;
3845
+ artifact?: string;
3846
+ skill?: string;
3847
+ bot?: string;
3848
+ }
3849
+ interface RouteDeps {
3850
+ env?: Readonly<Record<string, string | undefined>>;
3851
+ fetch?: typeof fetch;
3852
+ runCommand?: (command: string, stdin: string) => Promise<string>;
3853
+ now?: () => Date;
3854
+ }
3855
+ type RouteHit = {
3856
+ kind: "role";
3857
+ role: string;
3858
+ reason: string;
3859
+ rule: string;
3860
+ } | {
3861
+ kind: "ask";
3862
+ reason: string;
3863
+ };
3864
+ declare function routeRole(root: string, input: RouteItem, deps?: RouteDeps): Promise<RoleCommandResult>;
3865
+ declare function queueRole(root: string, bot?: string): Promise<RoleCommandResult>;
3866
+ declare function takeRole(root: string, input: RouteItem): Promise<RoleCommandResult>;
3867
+
3868
+ declare function gitUserName(root: string): string | null;
3869
+ declare function listTeamTemplates(): Promise<string[]>;
3870
+ declare function listRoleTemplates(): Promise<string[]>;
3871
+ declare function initTeam(root: string, template: string, gitUser: string | null): Promise<RoleCommandResult>;
3872
+ declare function readTeamConfig(root: string): Promise<{
3873
+ team: TeamConfig;
3874
+ } | {
3875
+ error: string;
3876
+ }>;
3877
+ declare function formatTeam(team: TeamConfig, gitUser: string | null): string;
3878
+ declare function resolveBot(team: TeamConfig, name: string): TeamConfig["bots"][number] | {
3879
+ error: string;
3880
+ };
3881
+ declare function showTeam(root: string, gitUser: string | null): Promise<RoleCommandResult>;
3882
+ declare function checkTeam(root: string): Promise<RoleCommandResult>;
3883
+ declare function createRoleFromTemplate(root: string, input: {
3884
+ name: string;
3885
+ template: string;
3886
+ label?: string;
3887
+ job?: string;
3888
+ description?: string;
3889
+ }): Promise<RoleCommandResult>;
3890
+
3891
+ interface Fact {
3892
+ key: string;
3893
+ value: string;
3894
+ ts: string;
3895
+ by: string;
3896
+ source: string;
3897
+ }
3898
+ declare function getFacts(root: string, query?: {
3899
+ keys?: string[];
3900
+ query?: string;
3901
+ }): Promise<Fact[]>;
3902
+ declare function setFact(root: string, input: {
3903
+ key?: string;
3904
+ value?: string;
3905
+ source?: string;
3906
+ }): Promise<RoleCommandResult>;
3907
+ declare function showFact(root: string, key?: string): Promise<RoleCommandResult>;
3908
+ declare function listFacts(root: string, query?: string): Promise<RoleCommandResult>;
3909
+
3910
+ interface Lesson {
3911
+ ts: string;
3912
+ by: string;
3913
+ text: string;
3914
+ source?: string;
3915
+ tags?: string[];
3916
+ }
3917
+ declare function showMemory(root: string, bot: string): Promise<RoleCommandResult>;
3918
+ declare function addLesson(root: string, bot: string, text: string): Promise<RoleCommandResult>;
3919
+ declare function migrateTeamMemory(root: string): Promise<RoleCommandResult>;
3920
+
3921
+ interface PackedFile {
3922
+ path: string;
3923
+ text: string;
3924
+ }
3925
+ interface WorkItem {
3926
+ text: string;
3927
+ }
3928
+ interface Brain {
3929
+ role: RoleProfile;
3930
+ bot: TeamConfig["bots"][number];
3931
+ memory: string;
3932
+ lessons: Lesson[];
3933
+ facts: Fact[];
3934
+ inputs: PackedFile[];
3935
+ prompt: string;
3936
+ warning: string;
3937
+ }
3938
+ declare function loadBrain(root: string, cfg: TeamConfig, bot: string, item: WorkItem, budgetTokens: number): Promise<Brain | {
3939
+ error: string;
3940
+ }>;
3941
+
3942
+ declare function runLoop(input: {
3943
+ root: string;
3944
+ cfg: TeamConfig;
3945
+ brain: Brain;
3946
+ model: RoleModel;
3947
+ file: string;
3948
+ roleName: string;
3949
+ logName: string;
3950
+ }): Promise<RoleCommandResult>;
3951
+
3952
+ declare function showRoom(root: string, input: {
3953
+ change?: string;
3954
+ stage?: string;
3955
+ }): Promise<RoleCommandResult>;
3956
+ declare function postRoom(root: string, input: {
3957
+ change?: string;
3958
+ stage?: string;
3959
+ from?: string;
3960
+ type?: string;
3961
+ text?: string;
3962
+ cite?: string;
3963
+ evidence?: string[];
3964
+ }): Promise<RoleCommandResult>;
3965
+ declare function reviewRoom(root: string, input: {
3966
+ change?: string;
3967
+ stage?: string;
3968
+ roles?: string[];
3969
+ model?: RoleModel;
3970
+ env?: Readonly<Record<string, string | undefined>>;
3971
+ runCommand?: (command: string, stdin: string) => Promise<string>;
3972
+ }): Promise<RoleCommandResult>;
3973
+
3151
3974
  interface StoryNode {
3152
3975
  changeId: string;
3153
3976
  title: string;
@@ -3182,4 +4005,4 @@ declare function formatEpicGraph(nodes: StoryNode[]): {
3182
4005
  /** Graph errors, then open dependencies. Null means the branch may be created. */
3183
4006
  declare function branchBlock(nodes: StoryNode[], story: string): string | null;
3184
4007
 
3185
- export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdapterExtractResult, AdapterRegistry, type AdvanceResult, type AgentInstallPlan, AgentInstallPreflightError, type AgentIntegration, type AgentTarget, type AgentTargetOption, type AllowRoleInput, type ArtifactDef, ArtifactDefSchema, type BuildRefinePlanOptions, type CallMcpToolResult, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type ChangeMetrics, ChangeMetricsSchema, type ChangePhaseOrder, type CodeContextCaps, type CodeContextGap, type CodeContextGapCode, type CodeContextRequest, type CodeContextResult, type CodeContextSummary, type CodeSlice, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_CODE_CONTEXT_CAPS, DEFAULT_INIT_INTEGRATION, EMBEDDINGS_UNAVAILABLE, EMBEDDING_MODEL, type Embedder, type FastembedHooks, type FocusPlan, type Gate, GateSchema, type GatherMcpOptions, type GenerateCodeContextDeps, type GeneratedManifest, type GeneratedState, type GitHeadRunner, type GreenfieldFeature, type IndexStats, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, type InstalledAgentSnapshot, type KeptFile, type KeptReason, type LanguageAdapter, type McpConfig, McpConfigSchema, type McpFetchResult, type McpInvoke, McpInvokeSchema, type McpMatchContext, type McpSource, McpSourceSchema, type McpWhen, McpWhenSchema, type MetricsImportResult, PROTOCOL_MD, type PhaseMetric, PhaseMetricSchema, type PhaseTiming, type PhaseTimingRow, type PlannedWrite, type PriceCard, type Prices, RRF_K, type RawHit, type ReconcileGeneratedResult, type RefineArtifactRef, type RefineMode, type RefinePlan, type RemoveAgentHostsResult, type RenderChangeReportInput, type RoleCommandResult, type RoleModel, type RoleProfile, type RunRoleInput, SDD_AGENT_ROLES, SDD_CORE_VERSION, SDD_DIR, SUMMARY_TOKEN_CAP, type SddAgentRole, type SddAgentRoleId, SddError, type SearchConfig, SearchConfigError, type SearchHit, type SearchProvider, type SearchQuery, type SearchResult, type SearchRuntime, type SearchScope, type Stage, StageSchema, type StartFeatureInput, type StartGreenfieldInput, type StartGreenfieldResult, type StoryDraft, type StoryNode, type SymbolInfo, type SymbolKind, type SyncChangeResult, type TokenCounts, type TokenUsageMetric, TokenUsageMetricSchema, VerifyCommandSchema, type VerifyResult, type VerifyStatus, type Workflow, WorkflowSchema, acceptNetwork, activePointerPath, activeStages, addMcpSource, advanceStage, agentHostPaths, agentKickoffMessage, allowRole, approveGate, archiveDir, assertAgentInstallable, assertSessionLogAllowed, branchBlock, budgetForStage, buildAgentPrompt, buildContext, buildRefinePlan, buildRetrievedInner, callMcpSourceTool, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, changesPathRel, chunkCode, chunkMarkdown, classifyPath, clearActiveIf, clearRegisteredSearchProviders, compareChangesByFirstPhase, completeChange, configPath, contentHash, copyDir, copyDirSkipExisting, costFor, countTokens, createBuiltinProvider, createChange, createFastembedEmbedder, createRole, defaultConfig, defaultMcpConfig, defaultMcpYamlPath, defaultMemoryDir, defaultPricesYamlPath, defaultSearchYamlPath, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, deleteRole, describeFsError, describeKept, displayArchivePath, displayChangePath, domainsDir, duplicateRole, editRole, embedSearchQuery, emptyChangeMetrics, ensureDir, ensureMcpConfig, errorMessage, executeSearch, explainMatch, extractiveSummary, fallbackAdapter, fallbackIncompleteStageId, fallbackWarning, fastembedImportCount, findFeaturesBacklogPath, firstActiveStageId, formatDuration, formatEpicGraph, formatJsonSummary, formatMcpContextForHandoff, formatStatus, ftsTokens, fuseByRank, fuseHits, gatherMcpContext, gatherMcpContextForChange, generateCodeContext, generatedState, getActiveChangeId, getHeadSha, getIntegration, getStage, guidancePaths, handoffRole, hideRole, importSessionMetrics, incompletePriorStageErrors, indexDbPath, inferComplexity, initProject, installAgentIntegration, installAgentIntegrations, integrationKeyFor, interpolate, interpolateArgs, isHardDenied, isIgnoredPath, isInitialized, isPrunedDir, isSddError, isSecretPath, isStageSkipped, isSubstantiveArtifactContent, keywordHits, listBacklogFeatures, listChanges, listDirs, listFiles, listMatchingSourceIds, listMcpSourceTools, listScopeHits, listWorkflowNames, loadChangeMeta, loadConfig, loadEpicStories, loadExcluder, loadGeneratedManifest, loadInstalledAgent, loadMcpConfig, loadPrices, loadSearchConfig, loadWorkflow, markGenerated, matchMcpSources, mcpConfigPath, mcpTimeoutMs, memoryDir, memoryPathRel, mergeCaps, mergeConfigDefaults, mergeRankedHits, nextStageId, nowIso, optionForTarget, packHits, parseAgentTargets, parseFeaturesBacklog, parseIntegration, parseStoryDraft, pathExists, phaseTiming, pinRole, planAgentIntegration, planNetwork, promoteGreenfieldToMemory, rankScope, readChangeMetrics, readHandoffCodePoints, readText, readYaml, rebuildNetwork, recommendWorkflow, reconcileGeneratedTree, refreshActiveAgentContext, refreshConfiguredGuidance, registerSearchProvider, removeMcpSource, removeOtherAgentHosts, removeOtherAgentHostsDetailed, removePath, renderAgentsMd, renderBlock, renderChangeReport, renderMemoryIndex, renderProtocolMd, renderSddReadme, renderThinAgent, repairRequiredIgnores, reportAllChanges, reportChange, resolveActiveDirectory, resolveChangeId, resolveEmbedder, resolveFocus, resolveSearchProvider, resolveStages, rrf, runLocalVerify, runNetwork, runRole, saveChangeMeta, saveConfig, saveGeneratedManifest, saveMcpConfig, scopeForPath, sddRoot, searchConfigPath, searchPreamble, setActiveChange, setRoleMessaging, shouldAutoSkip, showRoleGroup, showRoles, skipStage, slugify, startFeatureFromBacklog, startGreenfield, startPhase, storyIdTaken, switchWorkflow, syncChangeHead, templatesDir, toProcessEnv, todayIsoDate, tokenizeKeywords, transitionPhase, typescriptAdapter, uniqueChangeDirName, updateFeatureStatus, validBranchName, withMcpSource, workflowsDir, writeAgentHandoff, writeRefineBrief, writeText, writeTextIfMissing, writeYaml };
4008
+ export { AGENT_INTEGRATIONS, AGENT_TARGET_OPTIONS, ALL_AGENT_TARGETS, type AdapterExtractResult, AdapterRegistry, type AdvanceResult, type AgentInstallPlan, AgentInstallPreflightError, type AgentIntegration, type AgentTarget, type AgentTargetOption, type AllowRoleInput, type ArtifactDef, ArtifactDefSchema, type BuildRefinePlanOptions, type CallMcpToolResult, type ChangeContext, type ChangeMeta, ChangeMetaSchema, type ChangeMetrics, ChangeMetricsSchema, type ChangePhaseOrder, type CodeContextCaps, type CodeContextGap, type CodeContextGapCode, type CodeContextRequest, type CodeContextResult, type CodeContextSummary, type CodeSlice, type Complexity, type Config, ConfigSchema, type CreateChangeInput, DEFAULT_CODE_CONTEXT_CAPS, DEFAULT_INIT_INTEGRATION, type DecideInput, type DecisionMetric, DecisionMetricSchema, type DecisionModel, type DecisionOutcome, type Duty, EMBEDDINGS_UNAVAILABLE, EMBEDDING_MODEL, type Embedder, type FastembedHooks, type FocusPlan, type Gate, GateSchema, type GatherMcpOptions, type GenerateCodeContextDeps, type GeneratedManifest, type GeneratedState, type GitHeadRunner, type GreenfieldFeature, type IndexStats, type InitOptions, type InitResult, type InstallAgentOptions, type InstallAgentResult, type InstallAgentsOptions, type InstallAgentsResult, type InstalledAgentSnapshot, type KeptFile, type KeptReason, type LanguageAdapter, type McpConfig, McpConfigSchema, type McpFetchResult, type McpInvoke, McpInvokeSchema, type McpMatchContext, type McpSource, McpSourceSchema, type McpWhen, McpWhenSchema, type MetricsImportResult, type ModelChoice, type ModelContext, type ModelEntry, type ModelsConfig, ModelsConfigSchema, PROTOCOL_MD, type PhaseMetric, PhaseMetricSchema, type PhaseTiming, type PhaseTimingRow, type PlannedWrite, type PriceCard, type Prices, type ProductTeamMember, RRF_K, type RawHit, type ReconcileGeneratedResult, type RefineArtifactRef, type RefineMode, type RefinePlan, type RemoveAgentHostsResult, type RenderChangeReportInput, type RoleCommandResult, type RoleLists, type RoleModel, type RoleProfile, type RouteDeps, type RouteHit, type RouteItem, type RunRoleInput, SDD_AGENT_ROLES, SDD_CORE_VERSION, SDD_DIR, SUMMARY_TOKEN_CAP, type SddAgentRole, type SddAgentRoleId, SddError, type SearchConfig, SearchConfigError, type SearchHit, type SearchProvider, type SearchQuery, type SearchResult, type SearchRuntime, type SearchScope, type Stage, StageSchema, type StartFeatureInput, type StartGreenfieldInput, type StartGreenfieldResult, type StoryDraft, type StoryNode, type SymbolInfo, type SymbolKind, type SyncChangeResult, type TeamConfig, TeamSchema, type TokenCounts, type TokenUsageMetric, TokenUsageMetricSchema, VerifyCommandSchema, type VerifyResult, type VerifyStatus, WORK_TYPES, type WorkType, type Workflow, WorkflowSchema, acceptNetwork, activePointerPath, activeStages, addLesson, addMcpSource, advanceStage, agentHostPaths, agentKickoffMessage, allowRole, approveGate, archiveDir, assertAgentInstallable, assertSessionLogAllowed, branchBlock, budgetForStage, buildAgentPrompt, buildContext, buildRefinePlan, buildRetrievedInner, callMcpSourceTool, canLeaveStage, changeDirName, changeMetaPath, changePath, changesDir, changesPathRel, checkModels, checkTeam, chunkCode, chunkMarkdown, classifyPath, clearActiveIf, clearRegisteredSearchProviders, compareChangesByFirstPhase, completeChange, configPath, contentHash, copyDir, copyDirSkipExisting, costFor, countTokens, createBuiltinProvider, createChange, createFastembedEmbedder, createRole, createRoleFromTemplate, decide, defaultConfig, defaultMcpConfig, defaultMcpYamlPath, defaultMemoryDir, defaultPricesYamlPath, defaultSearchYamlPath, defaultTeamsDir, defaultTemplatesDir, defaultWorkflowsDir, defaultsRoot, deleteRole, describeFsError, describeKept, displayArchivePath, displayChangePath, domainsDir, duplicateRole, dutyForStage, editRole, embedSearchQuery, emptyChangeMetrics, ensureDir, ensureMcpConfig, errorMessage, executeSearch, explainMatch, explainModel, extractiveSummary, fallbackAdapter, fallbackIncompleteStageId, fallbackWarning, fastembedImportCount, findFeaturesBacklogPath, firstActiveStageId, formatDuration, formatEpicGraph, formatJsonSummary, formatMcpContextForHandoff, formatModels, formatStatus, formatTeam, formatTokenInventory, ftsTokens, fuseByRank, fuseHits, gatherMcpContext, gatherMcpContextForChange, generateCodeContext, generatedState, getActiveChangeId, getFacts, getHeadSha, getIntegration, getStage, gitUserName, guidancePaths, handoffRole, hideRole, importSessionMetrics, incompletePriorStageErrors, indexDbPath, inferComplexity, initProject, initTeam, installAgentIntegration, installAgentIntegrations, integrationKeyFor, interpolate, interpolateArgs, isHardDenied, isIgnoredPath, isInitialized, isPrunedDir, isSddError, isSecretPath, isStageSkipped, isSubstantiveArtifactContent, isWorkType, keywordHits, listBacklogFeatures, listBundledWorkflowNames, listChanges, listDirs, listFacts, listFiles, listMatchingSourceIds, listMcpSourceTools, listRoleTemplates, listScopeHits, listTeamTemplates, listWorkflowNames, loadBrain, loadChangeMeta, loadConfig, loadEpicStories, loadExcluder, loadGeneratedManifest, loadInstalledAgent, loadMcpConfig, loadModels, loadPrices, loadProductTeam, loadSearchConfig, loadWorkflow, markGenerated, matchMcpSources, mcpConfigPath, mcpTimeoutMs, memoryDir, memoryPathRel, mergeCaps, mergeConfigDefaults, mergeRankedHits, migrateTeamMemory, missingBundledWorkflows, modelFromEnv, nextStageId, nowIso, optionForTarget, packHits, parseAgentTargets, parseFeaturesBacklog, parseIntegration, parseStoryDraft, pathExists, phaseTiming, pinRole, planAgentIntegration, planNetwork, postRoom, prepareGuide, productTeamHome, promoteGreenfieldToMemory, queueRole, rankScope, readChangeMetrics, readHandoffCodePoints, readTeamConfig, readText, readYaml, rebuildNetwork, recommendWorkflow, reconcileGeneratedTree, recordDecisionMetric, recordDecisionRequest, recordSignoff, refreshActiveAgentContext, refreshConfiguredGuidance, registerSearchProvider, removeMcpSource, removeOtherAgentHosts, removeOtherAgentHostsDetailed, removePath, renderAgentsMd, renderBlock, renderChangeReport, renderMemoryIndex, renderProductTeamSection, renderProtocolMd, renderSddReadme, renderThinAgent, repairRequiredIgnores, reportAllChanges, reportChange, resolveActiveDirectory, resolveBot, resolveChangeId, resolveEmbedder, resolveFocus, resolveSearchProvider, resolveStages, reviewRoom, roleContextBody, routeRole, rrf, runGuide, runLocalVerify, runLoop, runNetwork, runRole, saveChangeMeta, saveConfig, saveGeneratedManifest, saveMcpConfig, scopeForPath, sddRoot, searchConfigPath, searchPreamble, selectModel, setActiveChange, setFact, setRoleContext, setRoleMessaging, shouldAutoSkip, showFact, showMemory, showRoleGroup, showRoles, showRoom, showTeam, skipStage, slugify, spawnModelCommand, startFeatureFromBacklog, startGreenfield, startPhase, storyIdTaken, switchWorkflow, syncChangeHead, takeRole, templatesDir, toProcessEnv, todayIsoDate, tokenizeKeywords, transitionPhase, typescriptAdapter, uniqueChangeDirName, updateFeatureStatus, validBranchName, withMcpSource, workKind, workflowUnavailableMessage, workflowsDir, writeAgentHandoff, writeRefineBrief, writeText, writeTextIfMissing, writeYaml };