@siming-org/core 0.7.4 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +344 -14
  2. package/dist/index.js +177 -17
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -459,6 +459,38 @@ declare const SourcePresetSchema: z.ZodObject<{
459
459
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
460
460
  }, z.core.$strip>;
461
461
  type SourcePreset = z.infer<typeof SourcePresetSchema>;
462
+ /**
463
+ * 工具类检查项声明:type=CLI 检查函数注册表键(kebab-case,运行时校验——注册表在 CLI 侧,
464
+ * server 不感知检查语义,不同版本 CLI 的 type 集不同,前向兼容)。
465
+ * params 仅限检查项内部常量(如超时秒数、正则片段);项目差异参数(repoPath/baseBranch 等)
466
+ * 一律经运行时解析链(task/项目配置),禁止来自资产 params。
467
+ */
468
+ declare const ToolCheckSchema: z.ZodObject<{
469
+ type: z.ZodString;
470
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
471
+ }, z.core.$strip>;
472
+ type ToolCheck = z.infer<typeof ToolCheckSchema>;
473
+ /**
474
+ * AI 自检项声明:id 节点内唯一(推进前自检留痕按 refId=id 匹配——CheckItem.refId),
475
+ * item=自检要求原文(与节点 prompt 产出检查节同源对应)。
476
+ */
477
+ declare const AiCheckSchema: z.ZodObject<{
478
+ id: z.ZodString;
479
+ item: z.ZodString;
480
+ }, z.core.$strip>;
481
+ type AiCheck = z.infer<typeof AiCheckSchema>;
482
+ /** TOOL_CHECKS_MAX = 资产层声明上限(防配置面失控;运行时逐项执行有超时兜底) */
483
+ declare const NODE_CHECKS_MAX = 20;
484
+ /**
485
+ * 函数级校验:节点内 aiCheck id 唯一性(assertUniqueNodeIds 先例——模板级 schema 禁挂 refine,
486
+ * Zod4 partial 派生陷阱;导入/组装路由调用)。
487
+ */
488
+ declare function assertUniqueAiCheckIds(nodes: ReadonlyArray<{
489
+ id: string;
490
+ aiChecks?: ReadonlyArray<{
491
+ id: string;
492
+ }> | undefined;
493
+ }>): void;
462
494
  declare const DagNodeSchema: z.ZodObject<{
463
495
  id: z.ZodString;
464
496
  label: z.ZodString;
@@ -473,6 +505,14 @@ declare const DagNodeSchema: z.ZodObject<{
473
505
  contentHash: z.ZodString;
474
506
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
475
507
  }, z.core.$strip>>;
508
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
509
+ type: z.ZodString;
510
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
511
+ }, z.core.$strip>>>;
512
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
513
+ id: z.ZodString;
514
+ item: z.ZodString;
515
+ }, z.core.$strip>>>;
476
516
  }, z.core.$strip>;
477
517
  type DagNode = z.infer<typeof DagNodeSchema>;
478
518
  /** 暂停点类型——固定枚举,引擎仅处理这两种语义(human_approval 落 paused / checkpoint 仅记录不停留) */
@@ -562,6 +602,14 @@ declare const DagTemplateSchema: z.ZodObject<{
562
602
  contentHash: z.ZodString;
563
603
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
564
604
  }, z.core.$strip>>;
605
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
606
+ type: z.ZodString;
607
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
608
+ }, z.core.$strip>>>;
609
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
610
+ id: z.ZodString;
611
+ item: z.ZodString;
612
+ }, z.core.$strip>>>;
565
613
  }, z.core.$strip>>;
566
614
  edges: z.ZodArray<z.ZodObject<{
567
615
  from: z.ZodString;
@@ -607,6 +655,14 @@ declare const DagTemplateCreateSchema: z.ZodObject<{
607
655
  contentHash: z.ZodString;
608
656
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
609
657
  }, z.core.$strip>>;
658
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
659
+ type: z.ZodString;
660
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
661
+ }, z.core.$strip>>>;
662
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
663
+ id: z.ZodString;
664
+ item: z.ZodString;
665
+ }, z.core.$strip>>>;
610
666
  }, z.core.$strip>>;
611
667
  edges: z.ZodArray<z.ZodObject<{
612
668
  from: z.ZodString;
@@ -653,6 +709,14 @@ declare const DagTemplateUpdateSchema: z.ZodObject<{
653
709
  contentHash: z.ZodString;
654
710
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
655
711
  }, z.core.$strip>>;
712
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
713
+ type: z.ZodString;
714
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
715
+ }, z.core.$strip>>>;
716
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
717
+ id: z.ZodString;
718
+ item: z.ZodString;
719
+ }, z.core.$strip>>>;
656
720
  }, z.core.$strip>>>;
657
721
  edges: z.ZodOptional<z.ZodArray<z.ZodObject<{
658
722
  from: z.ZodString;
@@ -759,11 +823,21 @@ declare const TASK_TYPES: readonly ["feature", "bugfix", "ui-tweak", "research"]
759
823
  type TaskType = (typeof TASK_TYPES)[number];
760
824
  /** 条目短 id 格式:服务端生成 6 位 base36(条目定位/翻转用,同 record 内查重) */
761
825
  declare const ENTRY_ID_REGEX: RegExp;
762
- /** 完成判定清单条目(item = 判定项原文,passed = 逐项 ✅/❌ 状态) */
826
+ /**
827
+ * 完成判定清单条目(item = 判定项原文,passed = 逐项 ✅/❌ 状态)。
828
+ * T202609230001:source/refId——自检留痕校验通道:aiChecks.id 声明项须存在
829
+ * refId==id 且 passed===true(或 item 含不适用+理由)的留痕;source 区分自报(self,
830
+ * 缺省)与工具写入(tool,本版不写,保留通道)。
831
+ */
763
832
  declare const CheckItemSchema: z.ZodObject<{
764
833
  id: z.ZodString;
765
834
  item: z.ZodString;
766
835
  passed: z.ZodBoolean;
836
+ source: z.ZodOptional<z.ZodEnum<{
837
+ self: "self";
838
+ tool: "tool";
839
+ }>>;
840
+ refId: z.ZodOptional<z.ZodString>;
767
841
  }, z.core.$strip>;
768
842
  type CheckItem = z.infer<typeof CheckItemSchema>;
769
843
  /** 产物类型静态枚举(决策 5:API 契约字段,非用户自定义分类) */
@@ -813,9 +887,23 @@ declare const ReviewSummarySchema: z.ZodObject<{
813
887
  critical: z.ZodNumber;
814
888
  }, z.core.$strip>;
815
889
  type ReviewSummary = z.infer<typeof ReviewSummarySchema>;
890
+ /**
891
+ * 测试报告结构化留痕(B1 判定数据):command=执行命令、四计数。
892
+ * skipped>0 时须持 decisions topic=skip-authorized 授权留痕(D9 词表)。
893
+ */
894
+ declare const TestReportSchema: z.ZodObject<{
895
+ command: z.ZodString;
896
+ passed: z.ZodNumber;
897
+ failed: z.ZodNumber;
898
+ skipped: z.ZodNumber;
899
+ }, z.core.$strip>;
900
+ type TestReport = z.infer<typeof TestReportSchema>;
816
901
  /**
817
902
  * 节点执行记录(nodeId → record)。无 completedAt——完成时间单权威在
818
903
  * dagInstance.nodeStates(决策 11:状态属性归状态机,双存必然漂移)。
904
+ * T202609230001:结构化判定字段(B 档门禁数据落点,点路径 $set 小步写)——
905
+ * baseBranch(ALIGN/A2/A3/B3 链)、verifiedCommit(B5/B7)、fixesApplied(B4 条件门禁)、
906
+ * testReport(B1)、deferredIssues(B8)、evidenceFiles(B9)。
819
907
  */
820
908
  declare const NodeRecordSchema: z.ZodObject<{
821
909
  summary: z.ZodOptional<z.ZodString>;
@@ -823,6 +911,11 @@ declare const NodeRecordSchema: z.ZodObject<{
823
911
  id: z.ZodString;
824
912
  item: z.ZodString;
825
913
  passed: z.ZodBoolean;
914
+ source: z.ZodOptional<z.ZodEnum<{
915
+ self: "self";
916
+ tool: "tool";
917
+ }>>;
918
+ refId: z.ZodOptional<z.ZodString>;
826
919
  }, z.core.$strip>>>;
827
920
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
828
921
  id: z.ZodString;
@@ -856,6 +949,17 @@ declare const NodeRecordSchema: z.ZodObject<{
856
949
  rounds: z.ZodNumber;
857
950
  critical: z.ZodNumber;
858
951
  }, z.core.$strip>>;
952
+ baseBranch: z.ZodOptional<z.ZodString>;
953
+ verifiedCommit: z.ZodOptional<z.ZodString>;
954
+ fixesApplied: z.ZodOptional<z.ZodNumber>;
955
+ testReport: z.ZodOptional<z.ZodObject<{
956
+ command: z.ZodString;
957
+ passed: z.ZodNumber;
958
+ failed: z.ZodNumber;
959
+ skipped: z.ZodNumber;
960
+ }, z.core.$strip>>;
961
+ deferredIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
962
+ evidenceFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
859
963
  }, z.core.$strip>;
860
964
  type NodeRecord = z.infer<typeof NodeRecordSchema>;
861
965
  /** 任务级文档:需求 What/Why + 验收标准 + 非目标 + 轨道识别结论 */
@@ -899,6 +1003,14 @@ declare const DagInstanceNodeSchema: z.ZodObject<{
899
1003
  prompt: z.ZodString;
900
1004
  skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
901
1005
  agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1006
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1007
+ type: z.ZodString;
1008
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1009
+ }, z.core.$strip>>>;
1010
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1011
+ id: z.ZodString;
1012
+ item: z.ZodString;
1013
+ }, z.core.$strip>>>;
902
1014
  }, z.core.$strip>;
903
1015
  type DagInstanceNode = z.infer<typeof DagInstanceNodeSchema>;
904
1016
  declare const DagInstanceSchema: z.ZodObject<{
@@ -912,6 +1024,14 @@ declare const DagInstanceSchema: z.ZodObject<{
912
1024
  prompt: z.ZodString;
913
1025
  skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
914
1026
  agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1027
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1028
+ type: z.ZodString;
1029
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1030
+ }, z.core.$strip>>>;
1031
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1032
+ id: z.ZodString;
1033
+ item: z.ZodString;
1034
+ }, z.core.$strip>>>;
915
1035
  }, z.core.$strip>>;
916
1036
  edges: z.ZodArray<z.ZodObject<{
917
1037
  from: z.ZodString;
@@ -950,6 +1070,7 @@ declare const HistoryActionSchema: z.ZodEnum<{
950
1070
  rejected: "rejected";
951
1071
  cancelled: "cancelled";
952
1072
  reopened: "reopened";
1073
+ checks_rejected: "checks_rejected";
953
1074
  }>;
954
1075
  declare const HistoryEntrySchema: z.ZodObject<{
955
1076
  nodeId: z.ZodString;
@@ -963,6 +1084,7 @@ declare const HistoryEntrySchema: z.ZodObject<{
963
1084
  rejected: "rejected";
964
1085
  cancelled: "cancelled";
965
1086
  reopened: "reopened";
1087
+ checks_rejected: "checks_rejected";
966
1088
  }>;
967
1089
  timestamp: z.ZodDefault<z.ZodDate>;
968
1090
  details: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -999,6 +1121,14 @@ declare const TaskSchema: z.ZodObject<{
999
1121
  prompt: z.ZodString;
1000
1122
  skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1001
1123
  agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1124
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1125
+ type: z.ZodString;
1126
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1127
+ }, z.core.$strip>>>;
1128
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1129
+ id: z.ZodString;
1130
+ item: z.ZodString;
1131
+ }, z.core.$strip>>>;
1002
1132
  }, z.core.$strip>>;
1003
1133
  edges: z.ZodArray<z.ZodObject<{
1004
1134
  from: z.ZodString;
@@ -1038,6 +1168,11 @@ declare const TaskSchema: z.ZodObject<{
1038
1168
  id: z.ZodString;
1039
1169
  item: z.ZodString;
1040
1170
  passed: z.ZodBoolean;
1171
+ source: z.ZodOptional<z.ZodEnum<{
1172
+ self: "self";
1173
+ tool: "tool";
1174
+ }>>;
1175
+ refId: z.ZodOptional<z.ZodString>;
1041
1176
  }, z.core.$strip>>>;
1042
1177
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1043
1178
  id: z.ZodString;
@@ -1071,6 +1206,17 @@ declare const TaskSchema: z.ZodObject<{
1071
1206
  rounds: z.ZodNumber;
1072
1207
  critical: z.ZodNumber;
1073
1208
  }, z.core.$strip>>;
1209
+ baseBranch: z.ZodOptional<z.ZodString>;
1210
+ verifiedCommit: z.ZodOptional<z.ZodString>;
1211
+ fixesApplied: z.ZodOptional<z.ZodNumber>;
1212
+ testReport: z.ZodOptional<z.ZodObject<{
1213
+ command: z.ZodString;
1214
+ passed: z.ZodNumber;
1215
+ failed: z.ZodNumber;
1216
+ skipped: z.ZodNumber;
1217
+ }, z.core.$strip>>;
1218
+ deferredIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
1219
+ evidenceFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1074
1220
  }, z.core.$strip>>>;
1075
1221
  archNotes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1076
1222
  id: z.ZodString;
@@ -1089,6 +1235,7 @@ declare const TaskSchema: z.ZodObject<{
1089
1235
  rejected: "rejected";
1090
1236
  cancelled: "cancelled";
1091
1237
  reopened: "reopened";
1238
+ checks_rejected: "checks_rejected";
1092
1239
  }>;
1093
1240
  timestamp: z.ZodDefault<z.ZodDate>;
1094
1241
  details: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1134,6 +1281,7 @@ declare const TaskContextSchema: z.ZodObject<{
1134
1281
  "ui-tweak": "ui-tweak";
1135
1282
  research: "research";
1136
1283
  }>>;
1284
+ projectId: z.ZodString;
1137
1285
  currentNode: z.ZodString;
1138
1286
  currentPhase: z.ZodString;
1139
1287
  status: z.ZodString;
@@ -1149,6 +1297,14 @@ declare const TaskContextSchema: z.ZodObject<{
1149
1297
  skills: z.ZodArray<z.ZodString>;
1150
1298
  agents: z.ZodArray<z.ZodString>;
1151
1299
  upcomingPause: z.ZodNullable<z.ZodString>;
1300
+ toolChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
1301
+ type: z.ZodString;
1302
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
1303
+ }, z.core.$strip>>>;
1304
+ aiChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
1305
+ id: z.ZodString;
1306
+ item: z.ZodString;
1307
+ }, z.core.$strip>>>;
1152
1308
  }, z.core.$strip>>;
1153
1309
  pausedAtEdge: z.ZodNullable<z.ZodObject<{
1154
1310
  from: z.ZodString;
@@ -1169,6 +1325,10 @@ declare const TaskContextSchema: z.ZodObject<{
1169
1325
  enteredAt: z.ZodNullable<z.ZodDate>;
1170
1326
  completedAt: z.ZodNullable<z.ZodDate>;
1171
1327
  }, z.core.$strip>>;
1328
+ edges: z.ZodDefault<z.ZodArray<z.ZodObject<{
1329
+ from: z.ZodString;
1330
+ to: z.ZodString;
1331
+ }, z.core.$strip>>>;
1172
1332
  taskDoc: z.ZodNullable<z.ZodObject<{
1173
1333
  what: z.ZodString;
1174
1334
  why: z.ZodString;
@@ -1182,6 +1342,11 @@ declare const TaskContextSchema: z.ZodObject<{
1182
1342
  id: z.ZodString;
1183
1343
  item: z.ZodString;
1184
1344
  passed: z.ZodBoolean;
1345
+ source: z.ZodOptional<z.ZodEnum<{
1346
+ self: "self";
1347
+ tool: "tool";
1348
+ }>>;
1349
+ refId: z.ZodOptional<z.ZodString>;
1185
1350
  }, z.core.$strip>>>;
1186
1351
  artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1187
1352
  id: z.ZodString;
@@ -1215,6 +1380,17 @@ declare const TaskContextSchema: z.ZodObject<{
1215
1380
  rounds: z.ZodNumber;
1216
1381
  critical: z.ZodNumber;
1217
1382
  }, z.core.$strip>>;
1383
+ baseBranch: z.ZodOptional<z.ZodString>;
1384
+ verifiedCommit: z.ZodOptional<z.ZodString>;
1385
+ fixesApplied: z.ZodOptional<z.ZodNumber>;
1386
+ testReport: z.ZodOptional<z.ZodObject<{
1387
+ command: z.ZodString;
1388
+ passed: z.ZodNumber;
1389
+ failed: z.ZodNumber;
1390
+ skipped: z.ZodNumber;
1391
+ }, z.core.$strip>>;
1392
+ deferredIssues: z.ZodOptional<z.ZodArray<z.ZodString>>;
1393
+ evidenceFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
1218
1394
  }, z.core.$strip>>;
1219
1395
  archNotes: z.ZodArray<z.ZodObject<{
1220
1396
  id: z.ZodString;
@@ -1294,24 +1470,26 @@ type TaskRepo = Repo<Task> & {
1294
1470
  declare function createTaskRepo(db: Db): TaskRepo;
1295
1471
 
1296
1472
  /**
1297
- * Issue 相关 Schemas(T202609150002 问题池)
1298
- * 小问题轻量跟进:入池 → 整理(合并/拆分)→ 转任务(多对多)。
1473
+ * Issue 相关 Schemas(T202609150002 问题池;T202609200001 直接标记完成 + 审批原话)
1474
+ * 小问题轻量跟进:入池 → 整理(合并/拆分)→ 转任务(多对多)或直接标记完成。
1299
1475
  *
1300
- * 状态语义(PRD 3.2 四态,终态禁止回转):
1301
- * - pending 待整理 / partial 部分转任务(存在未覆盖遗留)/ converted 已转任务 / cancelled 已取消
1476
+ * 状态语义(PRD 3.2 四态基础上 T202609200001 增 done,终态禁止回转):
1477
+ * - pending 待整理 / partial 部分转任务(存在未覆盖遗留)/ converted 已转任务 / cancelled 已取消 / done 已直接标记完成
1478
+ * - done:无需转任务、在某个任务/改动中顺带解决时的人工收尾终态(taskLinks 保留——已建立关联时进度可读)
1302
1479
  * - 任务后续演进(完成/取消)不触碰问题状态,进度是读时聚合(taskLinks × tasks.status)
1303
1480
  *
1304
1481
  * 关联模型(D1):单一真相源在 Issue 侧(taskLinks 嵌入数组),Task 零改动;
1305
1482
  * 多对多,同项目内组合;取消问题时 taskLinks 终止条目拷入 history(D8 结构化追溯)。
1306
1483
  */
1307
- /** 池内状态(终态 = converted / cancelled,状态机保护见 issue.repo) */
1308
- declare const ISSUE_STATUSES: readonly ["pending", "partial", "converted", "cancelled"];
1484
+ /** 池内状态(终态 = converted / cancelled / done,状态机保护见 issue.repo) */
1485
+ declare const ISSUE_STATUSES: readonly ["pending", "partial", "converted", "cancelled", "done"];
1309
1486
  type IssueStatus = (typeof ISSUE_STATUSES)[number];
1310
1487
  declare const IssueStatusSchema: z.ZodEnum<{
1311
1488
  pending: "pending";
1312
1489
  cancelled: "cancelled";
1313
1490
  partial: "partial";
1314
1491
  converted: "converted";
1492
+ done: "done";
1315
1493
  }>;
1316
1494
  /** 可参与转出/取消的非终态集合(事务内条件更新的并发安全带) */
1317
1495
  declare const ISSUE_ACTIVE_STATUSES: readonly ["pending", "partial"];
@@ -1360,12 +1538,14 @@ declare const IssueHistoryEntrySchema: z.ZodObject<{
1360
1538
  cancelled: "cancelled";
1361
1539
  partial: "partial";
1362
1540
  converted: "converted";
1541
+ done: "done";
1363
1542
  }>>;
1364
1543
  to: z.ZodOptional<z.ZodEnum<{
1365
1544
  pending: "pending";
1366
1545
  cancelled: "cancelled";
1367
1546
  partial: "partial";
1368
1547
  converted: "converted";
1548
+ done: "done";
1369
1549
  }>>;
1370
1550
  taskId: z.ZodOptional<z.ZodString>;
1371
1551
  reason: z.ZodOptional<z.ZodString>;
@@ -1388,7 +1568,9 @@ declare const IssueSchema: z.ZodObject<{
1388
1568
  cancelled: "cancelled";
1389
1569
  partial: "partial";
1390
1570
  converted: "converted";
1571
+ done: "done";
1391
1572
  }>>;
1573
+ approved: z.ZodOptional<z.ZodString>;
1392
1574
  taskLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
1393
1575
  taskId: z.ZodString;
1394
1576
  mode: z.ZodEnum<{
@@ -1410,12 +1592,14 @@ declare const IssueSchema: z.ZodObject<{
1410
1592
  cancelled: "cancelled";
1411
1593
  partial: "partial";
1412
1594
  converted: "converted";
1595
+ done: "done";
1413
1596
  }>>;
1414
1597
  to: z.ZodOptional<z.ZodEnum<{
1415
1598
  pending: "pending";
1416
1599
  cancelled: "cancelled";
1417
1600
  partial: "partial";
1418
1601
  converted: "converted";
1602
+ done: "done";
1419
1603
  }>>;
1420
1604
  taskId: z.ZodOptional<z.ZodString>;
1421
1605
  reason: z.ZodOptional<z.ZodString>;
@@ -1428,10 +1612,13 @@ type Issue = z.infer<typeof IssueSchema>;
1428
1612
  /**
1429
1613
  * 录入输入:source/projectId 由服务端按通道/项目解析注入,不入客户端 schema
1430
1614
  * (source 是统计信息非权限依据;projectId 缺省按 key=default 解析)。
1615
+ * approved(T202609200001):人类审批原话逐字(1-500 字);AI 通道(mcp/cli)强制在 server 路由层
1616
+ * (source 感知),schema 保持通道中立——Web 录入无此字段。
1431
1617
  */
1432
1618
  declare const IssueCreateSchema: z.ZodObject<{
1433
1619
  title: z.ZodString;
1434
1620
  description: z.ZodOptional<z.ZodString>;
1621
+ approved: z.ZodOptional<z.ZodString>;
1435
1622
  }, z.core.$strip>;
1436
1623
  type IssueCreate = z.infer<typeof IssueCreateSchema>;
1437
1624
  /** 编辑输入(独立 object 不派生——Zod4 UpdateSchema 范式;任意状态可编辑,终态无副作用) */
@@ -1473,8 +1660,8 @@ type TaskIssueView = {
1473
1660
  };
1474
1661
 
1475
1662
  /**
1476
- * Issue 仓储(T202609150002)
1477
- * 状态机保护在此层:终态(converted/cancelled)禁止 cancel/convert 关联写入——
1663
+ * Issue 仓储(T202609150002;T202609200001 直接标记完成 done)
1664
+ * 状态机保护在此层:终态(converted/cancelled/done)禁止 cancel/convert/markDone 写入——
1478
1665
  * 条件更新双保险(filter 携带 status ∈ {pending, partial},命中 0 行即并发终态)。
1479
1666
  * 进度计算两步批查(D2:不用 $lookup——Zod parse 单源 + 一次 $in 往返 + 内存映射)。
1480
1667
  */
@@ -1511,6 +1698,8 @@ type IssueRepo = Repo<Issue> & {
1511
1698
  getByIssueId(issueId: string): Promise<Issue | null>;
1512
1699
  updateIssue(issueId: string, patch: IssueUpdate): Promise<Issue>;
1513
1700
  cancelIssue(issueId: string, reason?: string): Promise<Issue>;
1701
+ /** 直接标记完成(T202609200001):终态三值互斥;taskLinks 保留(D3),note 落 history reason */
1702
+ markDone(issueId: string, note?: string): Promise<Issue>;
1514
1703
  /** 列表(进度聚合 + view=open 过滤;两支合并 createdAt 降序统一切片) */
1515
1704
  listIssues(filter?: IssueListFilter): Promise<{
1516
1705
  items: IssueWithProgress[];
@@ -1546,6 +1735,22 @@ declare const ProjectStatusSchema: z.ZodEnum<{
1546
1735
  active: "active";
1547
1736
  archived: "archived";
1548
1737
  }>;
1738
+ /**
1739
+ * T202609230001:项目级 VCS 配置(门禁参数解析链第 2 级——任务级结构化字段优先)。
1740
+ * 全部可选:缺省形态=分支模型开启+repoPath 走 cwd 解析(本地单机即用,零迁移)。
1741
+ */
1742
+ declare const VcsConfigSchema: z.ZodObject<{
1743
+ enabled: z.ZodOptional<z.ZodBoolean>;
1744
+ baseBranch: z.ZodOptional<z.ZodString>;
1745
+ repoPath: z.ZodOptional<z.ZodString>;
1746
+ branchPattern: z.ZodOptional<z.ZodString>;
1747
+ worktreeMode: z.ZodOptional<z.ZodBoolean>;
1748
+ archiveToBase: z.ZodOptional<z.ZodBoolean>;
1749
+ docPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
1750
+ }, z.core.$strip>;
1751
+ type VcsConfig = z.infer<typeof VcsConfigSchema>;
1752
+ /** docPaths 缺省清单(B7 豁免:文档库/设计文档/临时目录/根级 markdown) */
1753
+ declare const DEFAULT_VCS_DOC_PATHS: readonly ["ProjectHub/", "docs/", "temp/", "*.md"];
1549
1754
  declare const ProjectSchema: z.ZodObject<{
1550
1755
  id: z.ZodOptional<z.ZodString>;
1551
1756
  key: z.ZodString;
@@ -1555,6 +1760,15 @@ declare const ProjectSchema: z.ZodObject<{
1555
1760
  active: "active";
1556
1761
  archived: "archived";
1557
1762
  }>>;
1763
+ vcs: z.ZodOptional<z.ZodObject<{
1764
+ enabled: z.ZodOptional<z.ZodBoolean>;
1765
+ baseBranch: z.ZodOptional<z.ZodString>;
1766
+ repoPath: z.ZodOptional<z.ZodString>;
1767
+ branchPattern: z.ZodOptional<z.ZodString>;
1768
+ worktreeMode: z.ZodOptional<z.ZodBoolean>;
1769
+ archiveToBase: z.ZodOptional<z.ZodBoolean>;
1770
+ docPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
1771
+ }, z.core.$strip>>;
1558
1772
  createdAt: z.ZodOptional<z.ZodDate>;
1559
1773
  updatedAt: z.ZodOptional<z.ZodDate>;
1560
1774
  }, z.core.$strip>;
@@ -1572,6 +1786,7 @@ declare const ProjectCreateSchema: z.ZodObject<{
1572
1786
  type ProjectCreate = z.infer<typeof ProjectCreateSchema>;
1573
1787
  /**
1574
1788
  * 更新输入:不含 key(key 是锚点字段,创建后不可变,F6 精神)。
1789
+ * vcs 经 exactOptionalPropertyTypes 逐字段构造(PATCH 透传,嵌套对象整体替换)。
1575
1790
  */
1576
1791
  declare const ProjectUpdateSchema: z.ZodObject<{
1577
1792
  name: z.ZodOptional<z.ZodString>;
@@ -1580,6 +1795,15 @@ declare const ProjectUpdateSchema: z.ZodObject<{
1580
1795
  active: "active";
1581
1796
  archived: "archived";
1582
1797
  }>>;
1798
+ vcs: z.ZodOptional<z.ZodObject<{
1799
+ enabled: z.ZodOptional<z.ZodBoolean>;
1800
+ baseBranch: z.ZodOptional<z.ZodString>;
1801
+ repoPath: z.ZodOptional<z.ZodString>;
1802
+ branchPattern: z.ZodOptional<z.ZodString>;
1803
+ worktreeMode: z.ZodOptional<z.ZodBoolean>;
1804
+ archiveToBase: z.ZodOptional<z.ZodBoolean>;
1805
+ docPaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
1806
+ }, z.core.$strip>>;
1583
1807
  }, z.core.$strip>;
1584
1808
  type ProjectUpdate = z.infer<typeof ProjectUpdateSchema>;
1585
1809
 
@@ -1811,6 +2035,14 @@ declare const NodePresetShapeSchema: z.ZodObject<{
1811
2035
  source: z.ZodOptional<z.ZodObject<{
1812
2036
  package: z.ZodString;
1813
2037
  }, z.core.$strip>>;
2038
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2039
+ type: z.ZodString;
2040
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2041
+ }, z.core.$strip>>>;
2042
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2043
+ id: z.ZodString;
2044
+ item: z.ZodString;
2045
+ }, z.core.$strip>>>;
1814
2046
  enabled: z.ZodOptional<z.ZodBoolean>;
1815
2047
  createdAt: z.ZodOptional<z.ZodDate>;
1816
2048
  updatedAt: z.ZodOptional<z.ZodDate>;
@@ -1835,6 +2067,14 @@ declare const NodePresetSchema: z.ZodObject<{
1835
2067
  source: z.ZodOptional<z.ZodObject<{
1836
2068
  package: z.ZodString;
1837
2069
  }, z.core.$strip>>;
2070
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2071
+ type: z.ZodString;
2072
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2073
+ }, z.core.$strip>>>;
2074
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2075
+ id: z.ZodString;
2076
+ item: z.ZodString;
2077
+ }, z.core.$strip>>>;
1838
2078
  enabled: z.ZodOptional<z.ZodBoolean>;
1839
2079
  createdAt: z.ZodOptional<z.ZodDate>;
1840
2080
  updatedAt: z.ZodOptional<z.ZodDate>;
@@ -1856,10 +2096,18 @@ declare const NodePresetCreateSchema: z.ZodObject<{
1856
2096
  phase: z.ZodString;
1857
2097
  label: z.ZodString;
1858
2098
  prompt: z.ZodString;
1859
- nodeId: z.ZodString;
2099
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2100
+ type: z.ZodString;
2101
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2102
+ }, z.core.$strip>>>;
2103
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2104
+ id: z.ZodString;
2105
+ item: z.ZodString;
2106
+ }, z.core.$strip>>>;
1860
2107
  source: z.ZodOptional<z.ZodObject<{
1861
2108
  package: z.ZodString;
1862
2109
  }, z.core.$strip>>;
2110
+ nodeId: z.ZodString;
1863
2111
  skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1864
2112
  agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
1865
2113
  version: z.ZodDefault<z.ZodString>;
@@ -1884,10 +2132,18 @@ declare const NodePresetUpdateSchema: z.ZodObject<{
1884
2132
  phase: z.ZodOptional<z.ZodString>;
1885
2133
  label: z.ZodOptional<z.ZodString>;
1886
2134
  prompt: z.ZodOptional<z.ZodString>;
1887
- nodeId: z.ZodOptional<z.ZodString>;
2135
+ toolChecks: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2136
+ type: z.ZodString;
2137
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2138
+ }, z.core.$strip>>>>;
2139
+ aiChecks: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2140
+ id: z.ZodString;
2141
+ item: z.ZodString;
2142
+ }, z.core.$strip>>>>;
1888
2143
  source: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1889
2144
  package: z.ZodString;
1890
2145
  }, z.core.$strip>>>;
2146
+ nodeId: z.ZodOptional<z.ZodString>;
1891
2147
  version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1892
2148
  }, z.core.$strip>;
1893
2149
  type NodePresetUpdate = z.infer<typeof NodePresetUpdateSchema>;
@@ -2496,6 +2752,14 @@ declare const TemplatePayloadSchema: z.ZodObject<{
2496
2752
  contentHash: z.ZodString;
2497
2753
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2498
2754
  }, z.core.$strip>>;
2755
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2756
+ type: z.ZodString;
2757
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2758
+ }, z.core.$strip>>>;
2759
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2760
+ id: z.ZodString;
2761
+ item: z.ZodString;
2762
+ }, z.core.$strip>>>;
2499
2763
  }, z.core.$strip>>;
2500
2764
  edges: z.ZodArray<z.ZodObject<{
2501
2765
  from: z.ZodString;
@@ -2596,6 +2860,14 @@ declare const ExportBundleSchema: z.ZodObject<{
2596
2860
  contentHash: z.ZodString;
2597
2861
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2598
2862
  }, z.core.$strip>>;
2863
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2864
+ type: z.ZodString;
2865
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2866
+ }, z.core.$strip>>>;
2867
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2868
+ id: z.ZodString;
2869
+ item: z.ZodString;
2870
+ }, z.core.$strip>>>;
2599
2871
  }, z.core.$strip>>;
2600
2872
  edges: z.ZodArray<z.ZodObject<{
2601
2873
  from: z.ZodString;
@@ -2686,6 +2958,14 @@ declare const ImportPlanRequestSchema: z.ZodObject<{
2686
2958
  contentHash: z.ZodString;
2687
2959
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2688
2960
  }, z.core.$strip>>;
2961
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2962
+ type: z.ZodString;
2963
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
2964
+ }, z.core.$strip>>>;
2965
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
2966
+ id: z.ZodString;
2967
+ item: z.ZodString;
2968
+ }, z.core.$strip>>>;
2689
2969
  }, z.core.$strip>>;
2690
2970
  edges: z.ZodArray<z.ZodObject<{
2691
2971
  from: z.ZodString;
@@ -2809,6 +3089,14 @@ declare const ImportApplyRequestSchema: z.ZodObject<{
2809
3089
  contentHash: z.ZodString;
2810
3090
  agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
2811
3091
  }, z.core.$strip>>;
3092
+ toolChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
3093
+ type: z.ZodString;
3094
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3095
+ }, z.core.$strip>>>;
3096
+ aiChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
3097
+ id: z.ZodString;
3098
+ item: z.ZodString;
3099
+ }, z.core.$strip>>>;
2812
3100
  }, z.core.$strip>>;
2813
3101
  edges: z.ZodArray<z.ZodObject<{
2814
3102
  from: z.ZodString;
@@ -2984,11 +3272,11 @@ declare const ImportPlanResponseSchema: z.ZodObject<{
2984
3272
  }, z.core.$strip>;
2985
3273
  type ImportPlanResponse = z.infer<typeof ImportPlanResponseSchema>;
2986
3274
  declare const DependencyActionSchema: z.ZodEnum<{
3275
+ failed: "failed";
2987
3276
  skipped: "skipped";
2988
3277
  created: "created";
2989
3278
  identical: "identical";
2990
3279
  updated: "updated";
2991
- failed: "failed";
2992
3280
  }>;
2993
3281
  type DependencyAction = z.infer<typeof DependencyActionSchema>;
2994
3282
  declare const ImportApplyResponseSchema: z.ZodObject<{
@@ -3013,11 +3301,11 @@ declare const ImportApplyResponseSchema: z.ZodObject<{
3013
3301
  project: "project";
3014
3302
  }>>;
3015
3303
  action: z.ZodEnum<{
3304
+ failed: "failed";
3016
3305
  skipped: "skipped";
3017
3306
  created: "created";
3018
3307
  identical: "identical";
3019
3308
  updated: "updated";
3020
- failed: "failed";
3021
3309
  }>;
3022
3310
  message: z.ZodOptional<z.ZodString>;
3023
3311
  }, z.core.$strip>>;
@@ -3063,6 +3351,7 @@ declare const TaskPublicSchema: z.ZodObject<{
3063
3351
  "ui-tweak": "ui-tweak";
3064
3352
  research: "research";
3065
3353
  }>>;
3354
+ projectId: z.ZodString;
3066
3355
  currentNode: z.ZodString;
3067
3356
  currentPhase: z.ZodString;
3068
3357
  status: z.ZodString;
@@ -3079,6 +3368,14 @@ declare const NodeInfoSchema: z.ZodObject<{
3079
3368
  skills: z.ZodArray<z.ZodString>;
3080
3369
  agents: z.ZodArray<z.ZodString>;
3081
3370
  upcomingPause: z.ZodNullable<z.ZodString>;
3371
+ toolChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3372
+ type: z.ZodString;
3373
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3374
+ }, z.core.$strip>>>;
3375
+ aiChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3376
+ id: z.ZodString;
3377
+ item: z.ZodString;
3378
+ }, z.core.$strip>>>;
3082
3379
  }, z.core.$strip>;
3083
3380
  type NodeInfo = z.infer<typeof NodeInfoSchema>;
3084
3381
  /** N017 D7:删 gate_failed 分支(union 收窄为 advanced / paused / completed);paused 分支 pausePoint 类型改 EdgePausePoint */
@@ -3093,6 +3390,7 @@ declare const AdvanceResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3093
3390
  "ui-tweak": "ui-tweak";
3094
3391
  research: "research";
3095
3392
  }>>;
3393
+ projectId: z.ZodString;
3096
3394
  currentNode: z.ZodString;
3097
3395
  currentPhase: z.ZodString;
3098
3396
  status: z.ZodString;
@@ -3107,6 +3405,14 @@ declare const AdvanceResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3107
3405
  skills: z.ZodArray<z.ZodString>;
3108
3406
  agents: z.ZodArray<z.ZodString>;
3109
3407
  upcomingPause: z.ZodNullable<z.ZodString>;
3408
+ toolChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3409
+ type: z.ZodString;
3410
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3411
+ }, z.core.$strip>>>;
3412
+ aiChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3413
+ id: z.ZodString;
3414
+ item: z.ZodString;
3415
+ }, z.core.$strip>>>;
3110
3416
  }, z.core.$strip>;
3111
3417
  }, z.core.$strip>, z.ZodObject<{
3112
3418
  status: z.ZodLiteral<"paused">;
@@ -3119,6 +3425,7 @@ declare const AdvanceResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3119
3425
  "ui-tweak": "ui-tweak";
3120
3426
  research: "research";
3121
3427
  }>>;
3428
+ projectId: z.ZodString;
3122
3429
  currentNode: z.ZodString;
3123
3430
  currentPhase: z.ZodString;
3124
3431
  status: z.ZodString;
@@ -3145,6 +3452,7 @@ declare const AdvanceResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3145
3452
  "ui-tweak": "ui-tweak";
3146
3453
  research: "research";
3147
3454
  }>>;
3455
+ projectId: z.ZodString;
3148
3456
  currentNode: z.ZodString;
3149
3457
  currentPhase: z.ZodString;
3150
3458
  status: z.ZodString;
@@ -3164,6 +3472,7 @@ declare const ApproveResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3164
3472
  "ui-tweak": "ui-tweak";
3165
3473
  research: "research";
3166
3474
  }>>;
3475
+ projectId: z.ZodString;
3167
3476
  currentNode: z.ZodString;
3168
3477
  currentPhase: z.ZodString;
3169
3478
  status: z.ZodString;
@@ -3178,6 +3487,14 @@ declare const ApproveResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3178
3487
  skills: z.ZodArray<z.ZodString>;
3179
3488
  agents: z.ZodArray<z.ZodString>;
3180
3489
  upcomingPause: z.ZodNullable<z.ZodString>;
3490
+ toolChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3491
+ type: z.ZodString;
3492
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3493
+ }, z.core.$strip>>>;
3494
+ aiChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3495
+ id: z.ZodString;
3496
+ item: z.ZodString;
3497
+ }, z.core.$strip>>>;
3181
3498
  }, z.core.$strip>;
3182
3499
  }, z.core.$strip>, z.ZodObject<{
3183
3500
  status: z.ZodLiteral<"rejected">;
@@ -3190,6 +3507,7 @@ declare const ApproveResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3190
3507
  "ui-tweak": "ui-tweak";
3191
3508
  research: "research";
3192
3509
  }>>;
3510
+ projectId: z.ZodString;
3193
3511
  currentNode: z.ZodString;
3194
3512
  currentPhase: z.ZodString;
3195
3513
  status: z.ZodString;
@@ -3208,6 +3526,7 @@ declare const ApproveResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3208
3526
  "ui-tweak": "ui-tweak";
3209
3527
  research: "research";
3210
3528
  }>>;
3529
+ projectId: z.ZodString;
3211
3530
  currentNode: z.ZodString;
3212
3531
  currentPhase: z.ZodString;
3213
3532
  status: z.ZodString;
@@ -3429,6 +3748,14 @@ declare const CreateTaskResponseSchema: z.ZodObject<{
3429
3748
  skills: z.ZodArray<z.ZodString>;
3430
3749
  agents: z.ZodArray<z.ZodString>;
3431
3750
  upcomingPause: z.ZodNullable<z.ZodString>;
3751
+ toolChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3752
+ type: z.ZodString;
3753
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
3754
+ }, z.core.$strip>>>;
3755
+ aiChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
3756
+ id: z.ZodString;
3757
+ item: z.ZodString;
3758
+ }, z.core.$strip>>>;
3432
3759
  }, z.core.$strip>;
3433
3760
  }, z.core.$strip>;
3434
3761
  type CreateTaskResponse = z.infer<typeof CreateTaskResponseSchema>;
@@ -3791,6 +4118,9 @@ interface UpgradePlanItem {
3791
4118
  added: string[];
3792
4119
  removed: string[];
3793
4120
  } | null;
4121
+ /** T202609230001:门禁声明差异可见性(plan 展示用;不参与 contentHash——见 D「hash 残余」声明) */
4122
+ toolChecks: 'changed' | null;
4123
+ aiChecks: 'changed' | null;
3794
4124
  };
3795
4125
  }
3796
4126
  interface UpgradePlanResult {
@@ -4084,4 +4414,4 @@ declare function applyImport(deps: TemplateTransferDeps, targetProjectId: string
4084
4414
  declare const VERSION: string;
4085
4415
  declare function ping(): string;
4086
4416
 
4087
- export { AGENT_MAIN_DOC, ARTIFACT_TYPES, AUTH_COLLECTIONS, type AdvanceDeps, type AdvanceInput, type AdvanceRequest, AdvanceRequestSchema, type AdvanceResponse, AdvanceResponseSchema, type Agent, type AgentCopy, AgentCopySchema, type AgentCreate, AgentCreateSchema, type AgentFunction, AgentFunctionSchema, type AgentPayload, AgentPayloadSchema, type AgentRepo, AgentSchema, type AgentScope, AgentScopeSchema, AgentShapeSchema, type AgentUpdate, AgentUpdateSchema, AppError, type AppErrorOptions, type ApproveRequest, ApproveRequestSchema, type ApproveResponse, ApproveResponseSchema, type ArchNote, ArchNoteSchema, type Artifact, ArtifactSchema, type ArtifactType, type AssetListOpts, type AssetSetEnabled, AssetSetEnabledSchema, type AuthAccount, type AuthAccountCreate, AuthAccountCreateSchema, AuthAccountSchema, type AuthSession, type AuthStatus, AuthStatusSchema, type AuthToken, type AuthTokenGenResponse, AuthTokenGenResponseSchema, type AuthTokenKind, AuthTokenSchema, type AuthTokenStatus, AuthTokenStatusSchema, type AuthTokenType, AuthTokenTypeSchema, type AuthWhoami, AuthWhoamiSchema, BIZ_CODE_MESSAGES, BadRequestError, type BizCode, CONTEXT_VIEWS, type CancelRequest, CancelRequestSchema, type CheckItem, CheckItemSchema, type Composition, type CompositionEdge, CompositionEdgeSchema, CompositionSchema, type Confirmation, ConfirmationSchema, ConflictError, type ContextView, ContextViewSchema, type ConvertGroupOutcome, type CreateTaskResponse, CreateTaskResponseSchema, DAG_PHASES, DAG_TRACKS, DEFAULT_PROJECT_KEY, type DagEdge, DagEdgeSchema, type DagInstance, type DagInstanceNode, DagInstanceNodeSchema, DagInstanceSchema, type DagNode, DagNodePhaseSchema, DagNodeSchema, DagNodeTrackSchema, type DagTemplate, type DagTemplateCopy, DagTemplateCopySchema, type DagTemplateCreate, DagTemplateCreateSchema, type DagTemplateRepo, DagTemplateSchema, type DagTemplateUpdate, DagTemplateUpdateSchema, type Decision, DecisionSchema, type DependencyAction, DependencyActionSchema, type DependencyCheck, DependencyCheckSchema, type DependencyStatus, DependencyStatusSchema, ENTRY_ID_REGEX, EXPORT_FORMAT_VERSION, type EchoItem, EchoItemSchema, type EdgePausePoint, EdgePausePointBaseSchema, EdgePausePointSchema, type EnumEntry, EnumEntrySchema, type EnumRegistry, type EnumRegistryCategory, EnumRegistryCategorySchema, type EnumRegistryRepo, EnumRegistrySchema, type EnumRegistryUpdate, EnumRegistryUpdateSchema, type ExportBundle, ExportBundleSchema, ForbiddenError, HistoryActionSchema, type HistoryEntry, HistoryEntrySchema, ISSUE_ACTIVE_STATUSES, ISSUE_CONVERT_MODES, ISSUE_SOURCES, ISSUE_STATUSES, type ImportApplyRequest, ImportApplyRequestSchema, type ImportApplyResponse, ImportApplyResponseSchema, type ImportDecision, ImportDecisionSchema, type ImportPlanRequest, ImportPlanRequestSchema, type ImportPlanResponse, ImportPlanResponseSchema, type Issue, type IssueConvertMode, IssueConvertModeSchema, type IssueCreate, IssueCreateSchema, type IssueHistoryEntry, IssueHistoryEntrySchema, type IssueListFilter, type IssueProgress, IssueProgressSchema, type IssueRepo, IssueSchema, type IssueSource, IssueSourceSchema, type IssueStatus, type IssueStatusChange, IssueStatusSchema, type IssueTaskSnapshot, type IssueUpdate, IssueUpdateSchema, type IssueWithProgress, type LoginInput, LoginSchema, type ModelAlias, type ModelAliasCreate, ModelAliasCreateSchema, type ModelAliasPayload, ModelAliasPayloadSchema, type ModelAliasRepo, ModelAliasSchema, ModelAliasShapeSchema, type ModelAliasUpdate, ModelAliasUpdateSchema, type ModelAliasWithRefCount, ModelAliasWithRefCountSchema, NODE_ID_PATTERN, NODE_PRESET_CODE_PATTERN, NODE_STATUSES, type NodeContentFields, type NodeInfo, NodeInfoSchema, type NodeLibrary, type NodeLibraryRepo, NodeLibrarySchema, type NodeLibraryUpsert, NodeLibraryUpsertSchema, type NodePreset, type NodePresetCopy, NodePresetCopySchema, type NodePresetCreate, NodePresetCreateSchema, type NodePresetListFilter, type NodePresetRepo, NodePresetSchema, NodePresetShapeSchema, type NodePresetUpdate, NodePresetUpdateSchema, type NodeRecord, NodeRecordSchema, type NodeState, NodeStateSchema, NodeStatusSchema, NotFoundError, OBJECT_ID_HEX, type OmitId, PAUSE_POINT_TYPES, type PasswordChange, PasswordChangeSchema, PausePointTypeSchema, type PauseRequest, PauseRequestSchema, type Project, type ProjectCreate, ProjectCreateSchema, type ProjectRepo, ProjectSchema, type ProjectStatus, ProjectStatusSchema, type ProjectUpdate, ProjectUpdateSchema, type PruneResult, REFERENCE_LIMITS, type ReferenceDoc, type ReopenInput, type ReopenRequest, ReopenRequestSchema, type ReopenResponse, type Repo, type ResumeRequest, ResumeRequestSchema, type ReviewSummary, ReviewSummarySchema, SIMING_CODE_REGEX, SIMING_CONFIG_ENV_KEYS, SIMING_CONFIG_KEYS, SKILL_MAIN_DOC, type SimingClient, type SimingConfig, type SimingConfigKey, SimingConfigSchema, SimingLogLevelSchema, type Skill, type SkillCopy, SkillCopySchema, type SkillCreate, SkillCreateSchema, type SkillPayload, SkillPayloadSchema, type SkillRepo, SkillSchema, type SkillScope, SkillScopeSchema, SkillShapeSchema, type SkillUpdate, SkillUpdateSchema, type SourcePreset, SourcePresetSchema, TASK_PHASES, TASK_STATUSES, TASK_TYPES, TEMPLATE_CODE_MAX_LENGTH, TEMPLATE_CODE_REGEX, type Task, type TaskBatchAck, TaskBatchAckSchema, type TaskBatchEntry, TaskBatchEntrySchema, type TaskBatchFailure, TaskBatchFailureSchema, type TaskContext, TaskContextSchema, type TaskCreateInput, TaskCreateInputSchema, type TaskDocContent, TaskDocContentSchema, type TaskIssueView, type TaskLink, TaskLinkSchema, type TaskPatch, TaskPhaseSchema, type TaskProgress, type TaskProgressPublic, TaskProgressPublicSchema, TaskProgressSchema, type TaskPublic, TaskPublicSchema, type TaskRepo, TaskSchema, TaskStatusSchema, type TaskSummary, TaskSummarySchema, type TaskType, type TemplateCandidate, TemplateCandidateSchema, TemplateCodeFieldSchema, type TemplateContentChanges, type TemplateContentDiff, type TemplateContentSource, type TemplatePayload, TemplatePayloadSchema, type TemplateTransferDeps, UnauthorizedError, type UpgradeAction, UpgradeActionSchema, type UpgradeApplyOutcome, type UpgradeApplyRequest, UpgradeApplyRequestSchema, type UpgradeApplyResultItem, type UpgradeDecision, type UpgradeDecisionInput, UpgradeDecisionSchema, type UpgradeNodeStatus, UpgradeNodeStatusSchema, type UpgradePlanItem, type UpgradePlanResult, VERSION, ValidationError, WRITE_ACK_ENTRY_KINDS, type WithId, type WriteAck, type WriteAckEntryKind, WriteAckEntryKindSchema, WriteAckSchema, advanceTask, applyImport, applyUpgradeDecisions, approveTask, assertBoundSkillsCompatible, assertModelAliasExists, assertReferenceAggregateLimit, assertReferencesDeletable, assertUniqueNodeIds, buildImportPlan, buildTemplateCode, buildUpgradePlan, bumpPatch, bumpPatchOrPassthrough, cancelTask, canonicalizeReferencePath, checkTermination, composeExportBundle, computeNodeContentHash, computeUpgradeStatus, createAgentRepo, createAuthAccountRepo, createAuthSessionRepo, createAuthTokenRepo, createDagTemplateRepo, createEnumRegistryRepo, createIssueRepo, createModelAliasRepo, createMongoClient, createNodeLibraryRepo, createNodePresetRepo, createProjectRepo, createReferencesSchema, createRepo, createSkillRepo, createTaskRepo, decisionKey, derivePreTerminalState, diffTemplateContent, enabledNeFalse, escapeRegExpLiteral, excerpt, findDuplicateNodeIds, findNextEdge, findTemplateByName, generateEntryId, generateProjectKey, generateSessionId, generateToken, hasProjectDefault, hashPassword, hashToken, isLegalTemplateCode, mkHistory, normalizeNameToTemplateCode, parseAuthEnabledEnvValue, pauseTask, ping, pruneInstance, renderPrompt, reopenTask, resumeTask, sumReferenceContentChars, taskProgress, toNodeInfo, toTaskPublic, tokenTypeFromValue, trackMatchSet, verifyPassword, withTransaction };
4417
+ export { AGENT_MAIN_DOC, ARTIFACT_TYPES, AUTH_COLLECTIONS, type AdvanceDeps, type AdvanceInput, type AdvanceRequest, AdvanceRequestSchema, type AdvanceResponse, AdvanceResponseSchema, type Agent, type AgentCopy, AgentCopySchema, type AgentCreate, AgentCreateSchema, type AgentFunction, AgentFunctionSchema, type AgentPayload, AgentPayloadSchema, type AgentRepo, AgentSchema, type AgentScope, AgentScopeSchema, AgentShapeSchema, type AgentUpdate, AgentUpdateSchema, type AiCheck, AiCheckSchema, AppError, type AppErrorOptions, type ApproveRequest, ApproveRequestSchema, type ApproveResponse, ApproveResponseSchema, type ArchNote, ArchNoteSchema, type Artifact, ArtifactSchema, type ArtifactType, type AssetListOpts, type AssetSetEnabled, AssetSetEnabledSchema, type AuthAccount, type AuthAccountCreate, AuthAccountCreateSchema, AuthAccountSchema, type AuthSession, type AuthStatus, AuthStatusSchema, type AuthToken, type AuthTokenGenResponse, AuthTokenGenResponseSchema, type AuthTokenKind, AuthTokenSchema, type AuthTokenStatus, AuthTokenStatusSchema, type AuthTokenType, AuthTokenTypeSchema, type AuthWhoami, AuthWhoamiSchema, BIZ_CODE_MESSAGES, BadRequestError, type BizCode, CONTEXT_VIEWS, type CancelRequest, CancelRequestSchema, type CheckItem, CheckItemSchema, type Composition, type CompositionEdge, CompositionEdgeSchema, CompositionSchema, type Confirmation, ConfirmationSchema, ConflictError, type ContextView, ContextViewSchema, type ConvertGroupOutcome, type CreateTaskResponse, CreateTaskResponseSchema, DAG_PHASES, DAG_TRACKS, DEFAULT_PROJECT_KEY, DEFAULT_VCS_DOC_PATHS, type DagEdge, DagEdgeSchema, type DagInstance, type DagInstanceNode, DagInstanceNodeSchema, DagInstanceSchema, type DagNode, DagNodePhaseSchema, DagNodeSchema, DagNodeTrackSchema, type DagTemplate, type DagTemplateCopy, DagTemplateCopySchema, type DagTemplateCreate, DagTemplateCreateSchema, type DagTemplateRepo, DagTemplateSchema, type DagTemplateUpdate, DagTemplateUpdateSchema, type Decision, DecisionSchema, type DependencyAction, DependencyActionSchema, type DependencyCheck, DependencyCheckSchema, type DependencyStatus, DependencyStatusSchema, ENTRY_ID_REGEX, EXPORT_FORMAT_VERSION, type EchoItem, EchoItemSchema, type EdgePausePoint, EdgePausePointBaseSchema, EdgePausePointSchema, type EnumEntry, EnumEntrySchema, type EnumRegistry, type EnumRegistryCategory, EnumRegistryCategorySchema, type EnumRegistryRepo, EnumRegistrySchema, type EnumRegistryUpdate, EnumRegistryUpdateSchema, type ExportBundle, ExportBundleSchema, ForbiddenError, HistoryActionSchema, type HistoryEntry, HistoryEntrySchema, ISSUE_ACTIVE_STATUSES, ISSUE_CONVERT_MODES, ISSUE_SOURCES, ISSUE_STATUSES, type ImportApplyRequest, ImportApplyRequestSchema, type ImportApplyResponse, ImportApplyResponseSchema, type ImportDecision, ImportDecisionSchema, type ImportPlanRequest, ImportPlanRequestSchema, type ImportPlanResponse, ImportPlanResponseSchema, type Issue, type IssueConvertMode, IssueConvertModeSchema, type IssueCreate, IssueCreateSchema, type IssueHistoryEntry, IssueHistoryEntrySchema, type IssueListFilter, type IssueProgress, IssueProgressSchema, type IssueRepo, IssueSchema, type IssueSource, IssueSourceSchema, type IssueStatus, type IssueStatusChange, IssueStatusSchema, type IssueTaskSnapshot, type IssueUpdate, IssueUpdateSchema, type IssueWithProgress, type LoginInput, LoginSchema, type ModelAlias, type ModelAliasCreate, ModelAliasCreateSchema, type ModelAliasPayload, ModelAliasPayloadSchema, type ModelAliasRepo, ModelAliasSchema, ModelAliasShapeSchema, type ModelAliasUpdate, ModelAliasUpdateSchema, type ModelAliasWithRefCount, ModelAliasWithRefCountSchema, NODE_CHECKS_MAX, NODE_ID_PATTERN, NODE_PRESET_CODE_PATTERN, NODE_STATUSES, type NodeContentFields, type NodeInfo, NodeInfoSchema, type NodeLibrary, type NodeLibraryRepo, NodeLibrarySchema, type NodeLibraryUpsert, NodeLibraryUpsertSchema, type NodePreset, type NodePresetCopy, NodePresetCopySchema, type NodePresetCreate, NodePresetCreateSchema, type NodePresetListFilter, type NodePresetRepo, NodePresetSchema, NodePresetShapeSchema, type NodePresetUpdate, NodePresetUpdateSchema, type NodeRecord, NodeRecordSchema, type NodeState, NodeStateSchema, NodeStatusSchema, NotFoundError, OBJECT_ID_HEX, type OmitId, PAUSE_POINT_TYPES, type PasswordChange, PasswordChangeSchema, PausePointTypeSchema, type PauseRequest, PauseRequestSchema, type Project, type ProjectCreate, ProjectCreateSchema, type ProjectRepo, ProjectSchema, type ProjectStatus, ProjectStatusSchema, type ProjectUpdate, ProjectUpdateSchema, type PruneResult, REFERENCE_LIMITS, type ReferenceDoc, type ReopenInput, type ReopenRequest, ReopenRequestSchema, type ReopenResponse, type Repo, type ResumeRequest, ResumeRequestSchema, type ReviewSummary, ReviewSummarySchema, SIMING_CODE_REGEX, SIMING_CONFIG_ENV_KEYS, SIMING_CONFIG_KEYS, SKILL_MAIN_DOC, type SimingClient, type SimingConfig, type SimingConfigKey, SimingConfigSchema, SimingLogLevelSchema, type Skill, type SkillCopy, SkillCopySchema, type SkillCreate, SkillCreateSchema, type SkillPayload, SkillPayloadSchema, type SkillRepo, SkillSchema, type SkillScope, SkillScopeSchema, SkillShapeSchema, type SkillUpdate, SkillUpdateSchema, type SourcePreset, SourcePresetSchema, TASK_PHASES, TASK_STATUSES, TASK_TYPES, TEMPLATE_CODE_MAX_LENGTH, TEMPLATE_CODE_REGEX, type Task, type TaskBatchAck, TaskBatchAckSchema, type TaskBatchEntry, TaskBatchEntrySchema, type TaskBatchFailure, TaskBatchFailureSchema, type TaskContext, TaskContextSchema, type TaskCreateInput, TaskCreateInputSchema, type TaskDocContent, TaskDocContentSchema, type TaskIssueView, type TaskLink, TaskLinkSchema, type TaskPatch, TaskPhaseSchema, type TaskProgress, type TaskProgressPublic, TaskProgressPublicSchema, TaskProgressSchema, type TaskPublic, TaskPublicSchema, type TaskRepo, TaskSchema, TaskStatusSchema, type TaskSummary, TaskSummarySchema, type TaskType, type TemplateCandidate, TemplateCandidateSchema, TemplateCodeFieldSchema, type TemplateContentChanges, type TemplateContentDiff, type TemplateContentSource, type TemplatePayload, TemplatePayloadSchema, type TemplateTransferDeps, type TestReport, TestReportSchema, type ToolCheck, ToolCheckSchema, UnauthorizedError, type UpgradeAction, UpgradeActionSchema, type UpgradeApplyOutcome, type UpgradeApplyRequest, UpgradeApplyRequestSchema, type UpgradeApplyResultItem, type UpgradeDecision, type UpgradeDecisionInput, UpgradeDecisionSchema, type UpgradeNodeStatus, UpgradeNodeStatusSchema, type UpgradePlanItem, type UpgradePlanResult, VERSION, ValidationError, type VcsConfig, VcsConfigSchema, WRITE_ACK_ENTRY_KINDS, type WithId, type WriteAck, type WriteAckEntryKind, WriteAckEntryKindSchema, WriteAckSchema, advanceTask, applyImport, applyUpgradeDecisions, approveTask, assertBoundSkillsCompatible, assertModelAliasExists, assertReferenceAggregateLimit, assertReferencesDeletable, assertUniqueAiCheckIds, assertUniqueNodeIds, buildImportPlan, buildTemplateCode, buildUpgradePlan, bumpPatch, bumpPatchOrPassthrough, cancelTask, canonicalizeReferencePath, checkTermination, composeExportBundle, computeNodeContentHash, computeUpgradeStatus, createAgentRepo, createAuthAccountRepo, createAuthSessionRepo, createAuthTokenRepo, createDagTemplateRepo, createEnumRegistryRepo, createIssueRepo, createModelAliasRepo, createMongoClient, createNodeLibraryRepo, createNodePresetRepo, createProjectRepo, createReferencesSchema, createRepo, createSkillRepo, createTaskRepo, decisionKey, derivePreTerminalState, diffTemplateContent, enabledNeFalse, escapeRegExpLiteral, excerpt, findDuplicateNodeIds, findNextEdge, findTemplateByName, generateEntryId, generateProjectKey, generateSessionId, generateToken, hasProjectDefault, hashPassword, hashToken, isLegalTemplateCode, mkHistory, normalizeNameToTemplateCode, parseAuthEnabledEnvValue, pauseTask, ping, pruneInstance, renderPrompt, reopenTask, resumeTask, sumReferenceContentChars, taskProgress, toNodeInfo, toTaskPublic, tokenTypeFromValue, trackMatchSet, verifyPassword, withTransaction };
package/dist/index.js CHANGED
@@ -157,7 +157,8 @@ var BIZ_CODE_MESSAGES = {
157
157
  UPGRADE_DECISION_REQUIRED: "\u672C\u5730\u5DF2\u4FEE\u6539\u7684\u8282\u70B9\u5FC5\u987B\u663E\u5F0F\u51B3\u7B56\uFF08upgrade/keep/skip\uFF09",
158
158
  UPGRADE_STALE: "\u6A21\u677F\u72B6\u6001\u4E0E\u5347\u7EA7\u8BA1\u5212\u4E0D\u7B26\uFF08\u8BA1\u5212\u540E\u6A21\u677F\u5DF2\u88AB\u7F16\u8F91\uFF09\uFF0C\u8BF7\u91CD\u65B0\u83B7\u53D6\u5347\u7EA7\u8BA1\u5212",
159
159
  FLOW_MANIFEST_INVALID: "\u8282\u70B9\u5E93 manifest \u683C\u5F0F\u6216\u7248\u672C\u4E0D\u652F\u6301",
160
- // T202609150002:问题池域(message 由路由层按状态差异化——已转任务携带关联任务标识 / 已取消提示废弃)
160
+ // T202609150002:问题池域(终态含 done 自身,T202609200001;message 由路由层按状态差异化——
161
+ // 已转任务携带关联任务标识 / 已取消提示废弃 / done 提示不可再次终态)
161
162
  ISSUE_NOT_FOUND: "\u95EE\u9898\u4E0D\u5B58\u5728",
162
163
  ISSUE_INVALID_TRANSITION: "\u95EE\u9898\u5DF2\u662F\u7EC8\u6001\uFF0C\u7981\u6B62\u8BE5\u64CD\u4F5C\uFF08\u7EC8\u6001\u65E0\u56DE\u8F6C\uFF09",
163
164
  ISSUE_PROJECT_MISMATCH: "\u95EE\u9898\u4E0E\u76EE\u6807\u9879\u76EE\u5F52\u5C5E\u4E0D\u4E00\u81F4\uFF0C\u7981\u6B62\u8DE8\u9879\u76EE\u7EC4\u5408\u8F6C\u51FA",
@@ -731,6 +732,26 @@ var SourcePresetSchema = z3.object({
731
732
  /** Agent 名称独立基线;不改变既有 contentHash 算法,存量缺键按空清单比较 */
732
733
  agents: capabilityNamesSchema.optional()
733
734
  });
735
+ var ToolCheckSchema = z3.object({
736
+ type: z3.string().min(1).max(50).regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, "toolCheck.type \u5FC5\u987B\u4E3A kebab-case \u6CE8\u518C\u8868\u952E"),
737
+ params: z3.record(z3.string(), z3.union([z3.string(), z3.number(), z3.boolean()])).optional()
738
+ });
739
+ var AiCheckSchema = z3.object({
740
+ id: z3.string().min(2).max(30).regex(/^[a-z0-9-]+$/, "aiCheck.id \u53EA\u5141\u8BB8\u5C0F\u5199\u5B57\u6BCD/\u6570\u5B57/\u8FDE\u5B57\u7B26"),
741
+ item: z3.string().min(1).max(200)
742
+ });
743
+ var NODE_CHECKS_MAX = 20;
744
+ function assertUniqueAiCheckIds(nodes) {
745
+ for (const node of nodes) {
746
+ const seen = /* @__PURE__ */ new Set();
747
+ for (const check of node.aiChecks ?? []) {
748
+ if (seen.has(check.id)) {
749
+ throw new Error(`\u8282\u70B9 ${node.id} \u7684 aiCheck id \u91CD\u590D\uFF1A${check.id}\uFF08\u8282\u70B9\u5185\u987B\u552F\u4E00\uFF0CrefId \u5339\u914D\u4F9D\u8D56\uFF09`);
750
+ }
751
+ seen.add(check.id);
752
+ }
753
+ }
754
+ }
734
755
  var DagNodeSchema = z3.object({
735
756
  id: z3.string().regex(NODE_ID_PATTERN, "node id \u53EA\u5141\u8BB8\u5B57\u6BCD/\u6570\u5B57/\u4E0B\u5212\u7EBF/\u8FDE\u5B57\u7B26\uFF08\u70B9\u8DEF\u5F84\u62FC\u63A5\u5B89\u5168\u524D\u63D0\uFF09"),
736
757
  label: z3.string(),
@@ -740,7 +761,11 @@ var DagNodeSchema = z3.object({
740
761
  skills: capabilityNamesSchema.default([]),
741
762
  /** 存量模板允许缺键;新组装和任务实例化路径写入完整数组 */
742
763
  agents: capabilityNamesSchema.optional(),
743
- sourcePreset: SourcePresetSchema.optional()
764
+ sourcePreset: SourcePresetSchema.optional(),
765
+ /** T202609230001:工具类门禁声明(可选——存量模板/任务零迁移,读侧 ?? [] 归一) */
766
+ toolChecks: z3.array(ToolCheckSchema).max(NODE_CHECKS_MAX).optional(),
767
+ /** T202609230001:AI 自检项声明(同上,值拷贝进任务实例随资料包分发) */
768
+ aiChecks: z3.array(AiCheckSchema).max(NODE_CHECKS_MAX).optional()
744
769
  });
745
770
  var PausePointTypeSchema = z3.enum(["human_approval", "checkpoint"]);
746
771
  var PAUSE_POINT_TYPES = ["human_approval", "checkpoint"];
@@ -1045,7 +1070,9 @@ var ENTRY_ID_REGEX = /^[a-z0-9]{6}$/;
1045
1070
  var CheckItemSchema = z4.object({
1046
1071
  id: z4.string().regex(ENTRY_ID_REGEX),
1047
1072
  item: z4.string().min(1),
1048
- passed: z4.boolean()
1073
+ passed: z4.boolean(),
1074
+ source: z4.enum(["self", "tool"]).optional(),
1075
+ refId: z4.string().min(2).max(30).optional()
1049
1076
  });
1050
1077
  var ARTIFACT_TYPES = ["prd", "tech", "code", "test", "doc", "other"];
1051
1078
  var ArtifactSchema = z4.object({
@@ -1070,13 +1097,25 @@ var ReviewSummarySchema = z4.object({
1070
1097
  rounds: z4.number().int().min(1),
1071
1098
  critical: z4.number().int().min(0)
1072
1099
  });
1100
+ var TestReportSchema = z4.object({
1101
+ command: z4.string().min(1).max(200),
1102
+ passed: z4.number().int().min(0),
1103
+ failed: z4.number().int().min(0),
1104
+ skipped: z4.number().int().min(0)
1105
+ });
1073
1106
  var NodeRecordSchema = z4.object({
1074
1107
  summary: z4.string().optional(),
1075
1108
  checks: z4.array(CheckItemSchema).default([]),
1076
1109
  artifacts: z4.array(ArtifactSchema).default([]),
1077
1110
  confirmations: z4.array(ConfirmationSchema).default([]),
1078
1111
  decisions: z4.array(DecisionSchema).default([]),
1079
- review: ReviewSummarySchema.optional()
1112
+ review: ReviewSummarySchema.optional(),
1113
+ baseBranch: z4.string().min(1).max(50).optional(),
1114
+ verifiedCommit: z4.string().min(7).max(40).optional(),
1115
+ fixesApplied: z4.number().int().min(0).optional(),
1116
+ testReport: TestReportSchema.optional(),
1117
+ deferredIssues: z4.array(z4.string()).max(20).optional(),
1118
+ evidenceFiles: z4.array(z4.string()).max(50).optional()
1080
1119
  });
1081
1120
  var TaskDocContentSchema = z4.object({
1082
1121
  what: z4.string().min(1),
@@ -1105,7 +1144,10 @@ var DagInstanceNodeSchema = z4.object({
1105
1144
  track: z4.string(),
1106
1145
  prompt: z4.string(),
1107
1146
  skills: z4.array(z4.string()).default([]),
1108
- agents: z4.array(z4.string()).default([])
1147
+ agents: z4.array(z4.string()).default([]),
1148
+ // T202609230001:门禁配置快照(创建时值拷贝——模板升版不回溯在途任务,行为可预期)
1149
+ toolChecks: z4.array(ToolCheckSchema).optional(),
1150
+ aiChecks: z4.array(AiCheckSchema).optional()
1109
1151
  });
1110
1152
  var DagInstanceSchema = z4.object({
1111
1153
  templateId: z4.string(),
@@ -1121,7 +1163,7 @@ var DagInstanceSchema = z4.object({
1121
1163
  prunedNodes: z4.array(z4.string()),
1122
1164
  nodeStates: z4.record(z4.string(), NodeStateSchema)
1123
1165
  });
1124
- var HistoryActionSchema = z4.enum(["entered", "advanced", "paused", "resumed", "approved", "rejected", "completed", "cancelled", "reopened"]);
1166
+ var HistoryActionSchema = z4.enum(["entered", "advanced", "paused", "resumed", "approved", "rejected", "completed", "cancelled", "reopened", "checks_rejected"]);
1125
1167
  var HistoryEntrySchema = z4.object({
1126
1168
  nodeId: z4.string(),
1127
1169
  action: HistoryActionSchema,
@@ -1628,6 +1670,8 @@ function toTaskPublic(task) {
1628
1670
  title: task.title,
1629
1671
  // T202608240003:type 进 context/advance 公共投影(模板 PRD 调研变体判定依赖 context 可见)
1630
1672
  ...task.type !== void 0 ? { type: task.type } : {},
1673
+ // T202609230001:projectId 进公共投影(advance 门禁读项目 vcs 配置;实体层恒有值——N012 去哨兵)
1674
+ projectId: task.projectId,
1631
1675
  currentNode: task.currentNode,
1632
1676
  currentPhase: task.currentPhase,
1633
1677
  status: task.status,
@@ -1649,7 +1693,10 @@ function toNodeInfo(node, task) {
1649
1693
  prompt: renderPrompt(node.prompt, task),
1650
1694
  skills: node.skills,
1651
1695
  agents: node.agents ?? [],
1652
- upcomingPause: nextEdge?.pausePoint?.description ?? null
1696
+ upcomingPause: nextEdge?.pausePoint?.description ?? null,
1697
+ // T202609230001:门禁项注入(?? [] 归一——存量节点缺字段时响应恒为数组)
1698
+ toolChecks: node.toolChecks ?? [],
1699
+ aiChecks: node.aiChecks ?? []
1653
1700
  };
1654
1701
  }
1655
1702
  function mkHistory(nodeId, action, details) {
@@ -2034,7 +2081,10 @@ function deepCopyNode(node) {
2034
2081
  track: node.track,
2035
2082
  prompt: node.prompt,
2036
2083
  skills: [...node.skills],
2037
- agents: [...node.agents ?? []]
2084
+ agents: [...node.agents ?? []],
2085
+ // T202609230001:门禁配置快照(显式枚举拷贝——不同步即丢,浅拷贝数组与 skills 同范式)
2086
+ ...node.toolChecks ? { toolChecks: node.toolChecks.map((c) => c.params ? { ...c, params: { ...c.params } } : { ...c }) } : {},
2087
+ ...node.aiChecks ? { aiChecks: node.aiChecks.map((c) => ({ ...c })) } : {}
2038
2088
  };
2039
2089
  }
2040
2090
  function deepCopyEdge(edge) {
@@ -2063,7 +2113,7 @@ function generateEntryId(existing) {
2063
2113
 
2064
2114
  // src/schemas/issue.ts
2065
2115
  import { z as z5 } from "zod";
2066
- var ISSUE_STATUSES = ["pending", "partial", "converted", "cancelled"];
2116
+ var ISSUE_STATUSES = ["pending", "partial", "converted", "cancelled", "done"];
2067
2117
  var IssueStatusSchema = z5.enum(ISSUE_STATUSES);
2068
2118
  var ISSUE_ACTIVE_STATUSES = ["pending", "partial"];
2069
2119
  var ISSUE_SOURCES = ["mcp", "cli", "web"];
@@ -2095,6 +2145,8 @@ var IssueSchema = z5.object({
2095
2145
  source: IssueSourceSchema,
2096
2146
  projectId: z5.string().regex(OBJECT_ID_HEX, "projectId must be a valid ObjectId hex"),
2097
2147
  status: IssueStatusSchema.default("pending"),
2148
+ /** 人类审批原话(T202609200001:AI 通道 mcp/cli 录入必须携带用户批准时的原文逐字,供事后审计;Web 豁免——人工录入天然即批准) */
2149
+ approved: z5.string().min(1).max(500).optional(),
2098
2150
  taskLinks: z5.array(TaskLinkSchema).default([]),
2099
2151
  history: z5.array(IssueHistoryEntrySchema).default([]),
2100
2152
  createdAt: z5.date().optional(),
@@ -2102,7 +2154,8 @@ var IssueSchema = z5.object({
2102
2154
  });
2103
2155
  var IssueCreateSchema = z5.object({
2104
2156
  title: z5.string().min(1).max(200),
2105
- description: z5.string().max(1e4).optional()
2157
+ description: z5.string().max(1e4).optional(),
2158
+ approved: z5.string().min(1).max(500).optional()
2106
2159
  });
2107
2160
  var IssueUpdateSchema = z5.object({
2108
2161
  title: z5.string().min(1).max(200).optional(),
@@ -2145,6 +2198,8 @@ function createIssueRepo(db) {
2145
2198
  issueId,
2146
2199
  title: data.title,
2147
2200
  ...data.description !== void 0 ? { description: data.description } : {},
2201
+ // 审批原话(T202609200001):AI 通道强制已在 server 路由层校验,repo 仅透传落库
2202
+ ...data.approved !== void 0 ? { approved: data.approved } : {},
2148
2203
  source,
2149
2204
  projectId,
2150
2205
  status: "pending",
@@ -2179,7 +2234,7 @@ function createIssueRepo(db) {
2179
2234
  if (!current) {
2180
2235
  throw new NotFoundError("issue", issueId, { bizCode: "ISSUE_NOT_FOUND" });
2181
2236
  }
2182
- if (current.status === "converted" || current.status === "cancelled") {
2237
+ if (current.status === "converted" || current.status === "cancelled" || current.status === "done") {
2183
2238
  throw new ConflictError("issue", issueId, {
2184
2239
  bizCode: "ISSUE_INVALID_TRANSITION",
2185
2240
  message: `\u95EE\u9898\u5DF2\u662F\u7EC8\u6001\uFF08${String(current.status)}\uFF09\uFF0C\u7981\u6B62\u53D6\u6D88`
@@ -2220,7 +2275,45 @@ function createIssueRepo(db) {
2220
2275
  if (!result) {
2221
2276
  throw new ConflictError("issue", issueId, {
2222
2277
  bizCode: "ISSUE_INVALID_TRANSITION",
2223
- message: "\u95EE\u9898\u5DF2\u88AB\u5E76\u53D1\u5904\u7406\uFF08\u8F6C\u51FA/\u53D6\u6D88\uFF09\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5"
2278
+ message: "\u95EE\u9898\u5DF2\u88AB\u5E76\u53D1\u5904\u7406\uFF08\u8F6C\u51FA/\u53D6\u6D88/\u5B8C\u6210\uFF09\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5"
2279
+ });
2280
+ }
2281
+ return toEntity(result);
2282
+ },
2283
+ async markDone(issueId, note) {
2284
+ const current = await base._collection.findOne({ issueId });
2285
+ if (!current) {
2286
+ throw new NotFoundError("issue", issueId, { bizCode: "ISSUE_NOT_FOUND" });
2287
+ }
2288
+ if (current.status === "converted" || current.status === "cancelled" || current.status === "done") {
2289
+ throw new ConflictError("issue", issueId, {
2290
+ bizCode: "ISSUE_INVALID_TRANSITION",
2291
+ message: `\u95EE\u9898\u5DF2\u662F\u7EC8\u6001\uFF08${String(current.status)}\uFF09\uFF0C\u7981\u6B62\u6807\u8BB0\u5B8C\u6210`
2292
+ });
2293
+ }
2294
+ const now = /* @__PURE__ */ new Date();
2295
+ const result = await base._collection.findOneAndUpdate(
2296
+ // 并发安全带:读后窗口内外部转出/取消/完成 → 命中 0 行报终态冲突(终态以先到者为准)
2297
+ { issueId, status: { $in: ISSUE_ACTIVE_STATUSES } },
2298
+ {
2299
+ $set: { status: "done", updatedAt: now },
2300
+ $push: {
2301
+ history: {
2302
+ id: generateEntryId([]),
2303
+ action: "status-change",
2304
+ from: current.status,
2305
+ to: "done",
2306
+ ...note !== void 0 ? { reason: note } : {},
2307
+ at: now
2308
+ }
2309
+ }
2310
+ },
2311
+ { returnDocument: "after" }
2312
+ );
2313
+ if (!result) {
2314
+ throw new ConflictError("issue", issueId, {
2315
+ bizCode: "ISSUE_INVALID_TRANSITION",
2316
+ message: "\u95EE\u9898\u5DF2\u88AB\u5E76\u53D1\u5904\u7406\uFF08\u8F6C\u51FA/\u53D6\u6D88/\u5B8C\u6210\uFF09\uFF0C\u8BF7\u5237\u65B0\u540E\u91CD\u8BD5"
2224
2317
  });
2225
2318
  }
2226
2319
  return toEntity(result);
@@ -3250,6 +3343,8 @@ var TaskPublicSchema = z10.object({
3250
3343
  title: z10.string(),
3251
3344
  // T202608240003:任务类型标签(缺省 = 裸任务/旧任务;模板 PRD 调研变体判定消费)
3252
3345
  type: z10.enum(TASK_TYPES).optional(),
3346
+ /** T202609230001:归属项目(CLI advance 门禁经 context 直取 projectId 读项目 vcs 配置,免额外实体查询) */
3347
+ projectId: z10.string(),
3253
3348
  currentNode: z10.string(),
3254
3349
  currentPhase: z10.string(),
3255
3350
  status: z10.string(),
@@ -3263,7 +3358,13 @@ var NodeInfoSchema = z10.object({
3263
3358
  prompt: z10.string(),
3264
3359
  skills: z10.array(z10.string()),
3265
3360
  agents: z10.array(z10.string()),
3266
- upcomingPause: z10.string().nullable()
3361
+ upcomingPause: z10.string().nullable(),
3362
+ /**
3363
+ * T202609230001:门禁项随资料包注入(四响应单源 toNodeInfo)——响应恒为数组(?? [] 归一),
3364
+ * 每节点注入即红线自动重申(对抗长上下文漂移);AI 据此先自检后推进。
3365
+ */
3366
+ toolChecks: z10.array(ToolCheckSchema).default([]),
3367
+ aiChecks: z10.array(AiCheckSchema).default([])
3267
3368
  });
3268
3369
  var AdvanceResponseSchema = z10.discriminatedUnion("status", [
3269
3370
  z10.object({
@@ -3321,6 +3422,8 @@ var TaskContextSchema = z11.object({
3321
3422
  title: z11.string(),
3322
3423
  // T202608240003:与 TaskPublicSchema 同步(toTaskPublic 运行时已产出,schema 声明漂移会导致 typed 消费方 strip 掉 type)
3323
3424
  type: z11.enum(TASK_TYPES).optional(),
3425
+ // T202609230001:与 TaskPublicSchema 同步(advance 门禁读项目 vcs 配置依赖)
3426
+ projectId: z11.string(),
3324
3427
  currentNode: z11.string(),
3325
3428
  currentPhase: z11.string(),
3326
3429
  status: z11.string(),
@@ -3337,7 +3440,13 @@ var TaskContextSchema = z11.object({
3337
3440
  skills: z11.array(z11.string()),
3338
3441
  agents: z11.array(z11.string()),
3339
3442
  /** 完成当前节点后出边上的暂停点描述(经 findNextEdge 按轨选边) */
3340
- upcomingPause: z11.string().nullable()
3443
+ upcomingPause: z11.string().nullable(),
3444
+ /**
3445
+ * T202609230001:门禁项注入(与 NodeInfoSchema 同步的内联镜像——CLI 侧
3446
+ * TaskContext['currentNode'] 类型取门禁项供 advance 前置校验消费)。
3447
+ */
3448
+ toolChecks: z11.array(ToolCheckSchema).default([]),
3449
+ aiChecks: z11.array(AiCheckSchema).default([])
3341
3450
  }).nullable(),
3342
3451
  pausedAtEdge: z11.object({
3343
3452
  from: z11.string(),
@@ -3352,6 +3461,12 @@ var TaskContextSchema = z11.object({
3352
3461
  enteredAt: z11.date().nullable(),
3353
3462
  completedAt: z11.date().nullable()
3354
3463
  })),
3464
+ /**
3465
+ * T202609230001:实例有向边表(B6 前序闭包判定数据源——「前序」按 DAG 拓扑而非列表序,
3466
+ * 后继 pending 节点不算前序)。旧 server 不携带 → 客户端 ?? [] 兜底(闭包为空 = 不拦截,
3467
+ * 老组合形态本就无门禁,不构成静默放行新增面)。
3468
+ */
3469
+ edges: z11.array(z11.object({ from: z11.string(), to: z11.string() })).default([]),
3355
3470
  /** N020 D1:任务级结构化文档(未写时 null) */
3356
3471
  taskDoc: TaskDocContentSchema.nullable(),
3357
3472
  /** N020 D1:节点执行记录(仅含已写记录的 nodeId) */
@@ -3451,12 +3566,30 @@ var ContextViewSchema = z12.enum(CONTEXT_VIEWS);
3451
3566
  // src/schemas/project.ts
3452
3567
  import { z as z13 } from "zod";
3453
3568
  var ProjectStatusSchema = z13.enum(["active", "archived"]);
3569
+ var VcsConfigSchema = z13.object({
3570
+ /** false=项目级豁免:全部 git 类检查 N/A(纯文档/无分支模型项目不误拦) */
3571
+ enabled: z13.boolean().optional(),
3572
+ /** 基础分支(参数解析链第 2 级;第 1 级=nodeRecords[ALIGN].baseBranch) */
3573
+ baseBranch: z13.string().min(1).max(50).optional(),
3574
+ /** 仓库绝对路径(MCP 宿主 cwd 未必是任务仓库时由管理台配置;缺省=cwd 探测) */
3575
+ repoPath: z13.string().min(1).optional(),
3576
+ /** 任务分支前缀模式(A1 判定用) */
3577
+ branchPattern: z13.string().min(1).max(50).optional(),
3578
+ /** true=worktree 并行模式(A6 停留子项 N/A——主工作区停留基础分支由主会话承载) */
3579
+ worktreeMode: z13.boolean().optional(),
3580
+ /** false=项目声明无分支归档流程(A5 N/A;表达「有分支模型但无归档流程」粒度) */
3581
+ archiveToBase: z13.boolean().optional(),
3582
+ /** B7 版本一致判定的豁免路径清单(文档/临时产物) */
3583
+ docPaths: z13.array(z13.string().min(1)).max(50).optional()
3584
+ });
3585
+ var DEFAULT_VCS_DOC_PATHS = ["ProjectHub/", "docs/", "temp/", "*.md"];
3454
3586
  var ProjectSchema = z13.object({
3455
3587
  id: z13.string().optional(),
3456
3588
  key: z13.string().regex(/^[a-z0-9][a-z0-9-]{1,30}$/, "key \u5FC5\u987B\u4E3A kebab-case\uFF082-31 \u5B57\u7B26\uFF09"),
3457
3589
  name: z13.string().min(1).max(50),
3458
3590
  description: z13.string().max(500).optional(),
3459
3591
  status: ProjectStatusSchema.default("active"),
3592
+ vcs: VcsConfigSchema.optional(),
3460
3593
  createdAt: z13.date().optional(),
3461
3594
  updatedAt: z13.date().optional()
3462
3595
  });
@@ -3468,7 +3601,8 @@ var ProjectCreateSchema = z13.object({
3468
3601
  var ProjectUpdateSchema = z13.object({
3469
3602
  name: z13.string().min(1).max(50).optional(),
3470
3603
  description: z13.string().max(500).optional(),
3471
- status: ProjectStatusSchema.optional()
3604
+ status: ProjectStatusSchema.optional(),
3605
+ vcs: VcsConfigSchema.optional()
3472
3606
  });
3473
3607
 
3474
3608
  // src/schemas/enum-registry.ts
@@ -3621,6 +3755,12 @@ var NodePresetShapeSchema = z17.object({
3621
3755
  version: z17.string(),
3622
3756
  /** 分发来源标注(flow install 落库时填充包名;手工创建无此字段——「来源可见可核查」信任模型) */
3623
3757
  source: z17.object({ package: z17.string().min(1) }).optional(),
3758
+ /**
3759
+ * T202609230001:门禁声明(与 DagNodeSchema 同形)。此层不同步则 flow install 写入
3760
+ * 资产时 Zod strip 未知键——字段在资产入库时静默丢弃(分发链中段 F1 同步点)。
3761
+ */
3762
+ toolChecks: z17.array(ToolCheckSchema).max(NODE_CHECKS_MAX).optional(),
3763
+ aiChecks: z17.array(AiCheckSchema).max(NODE_CHECKS_MAX).optional(),
3624
3764
  /** 资产启停(可选——存量无此字段 = 启用;唯一写入口 POST /:code/enabled,不入 Create/Update/Copy) */
3625
3765
  enabled: z17.boolean().optional(),
3626
3766
  createdAt: z17.date().optional(),
@@ -3859,8 +3999,13 @@ var EMPTY_DIFF = {
3859
3999
  phase: null,
3860
4000
  track: null,
3861
4001
  skills: null,
3862
- agents: null
4002
+ agents: null,
4003
+ toolChecks: null,
4004
+ aiChecks: null
3863
4005
  };
4006
+ function sameChecks(left, right) {
4007
+ return JSON.stringify(left ?? []) === JSON.stringify(right ?? []);
4008
+ }
3864
4009
  function diffNames(beforeNames, afterNames) {
3865
4010
  const before = new Set(beforeNames);
3866
4011
  const after = new Set(afterNames);
@@ -3878,7 +4023,9 @@ function diffNodeAgainstPreset(node, preset) {
3878
4023
  phase: node.phase === preset.phase ? null : "changed",
3879
4024
  track: node.track === preset.track ? null : "changed",
3880
4025
  skills: diffNames(node.skills, preset.skills),
3881
- agents: diffNames(node.agents ?? [], preset.agents ?? [])
4026
+ agents: diffNames(node.agents ?? [], preset.agents ?? []),
4027
+ toolChecks: sameChecks(node.toolChecks, preset.toolChecks) ? null : "changed",
4028
+ aiChecks: sameChecks(node.aiChecks, preset.aiChecks) ? null : "changed"
3882
4029
  };
3883
4030
  }
3884
4031
  function computeUpgradeStatus(node, latest) {
@@ -3943,6 +4090,9 @@ function applyUpgradeDecisions(template, presetsByCode, decisions) {
3943
4090
  ...node,
3944
4091
  skills: [...node.skills],
3945
4092
  agents: [...node.agents ?? []],
4093
+ // T202609230001:门禁声明数组重建(同 skills 范式——keep 分支保留本地值时亦不共享引用)
4094
+ ...node.toolChecks ? { toolChecks: node.toolChecks.map((c) => c.params ? { ...c, params: { ...c.params } } : { ...c }) } : {},
4095
+ ...node.aiChecks ? { aiChecks: node.aiChecks.map((c) => ({ ...c })) } : {},
3946
4096
  ...node.sourcePreset ? {
3947
4097
  sourcePreset: {
3948
4098
  ...node.sourcePreset,
@@ -4018,6 +4168,8 @@ function applyUpgradeDecisions(template, presetsByCode, decisions) {
4018
4168
  working.prompt = latest.prompt;
4019
4169
  working.skills = [...latest.skills];
4020
4170
  working.agents = [...latest.agents ?? []];
4171
+ working.toolChecks = latest.toolChecks?.map((c) => c.params ? { ...c, params: { ...c.params } } : { ...c });
4172
+ working.aiChecks = latest.aiChecks?.map((c) => ({ ...c }));
4021
4173
  working.sourcePreset = {
4022
4174
  code: source.code,
4023
4175
  version: latest.version,
@@ -4302,6 +4454,7 @@ async function applyImport(deps, targetProjectId, bundle, decisions) {
4302
4454
  throw new ValidationError("\u6A21\u677F\u5185\u5BB9\u6821\u9A8C\u5931\u8D25\uFF08\u5BFC\u5165\u6587\u4EF6\u5B57\u6BB5\u975E\u6CD5\uFF09", parsed.error.issues);
4303
4455
  }
4304
4456
  assertUniqueNodeIds(nodesForWrite);
4457
+ assertUniqueAiCheckIds(nodesForWrite);
4305
4458
  const contentFields = {
4306
4459
  name: tplPayload.name,
4307
4460
  description: tplPayload.description,
@@ -4497,6 +4650,7 @@ export {
4497
4650
  AgentScopeSchema,
4498
4651
  AgentShapeSchema,
4499
4652
  AgentUpdateSchema,
4653
+ AiCheckSchema,
4500
4654
  AppError,
4501
4655
  ApproveRequestSchema,
4502
4656
  ApproveResponseSchema,
@@ -4525,6 +4679,7 @@ export {
4525
4679
  DAG_PHASES,
4526
4680
  DAG_TRACKS,
4527
4681
  DEFAULT_PROJECT_KEY,
4682
+ DEFAULT_VCS_DOC_PATHS,
4528
4683
  DagEdgeSchema,
4529
4684
  DagInstanceNodeSchema,
4530
4685
  DagInstanceSchema,
@@ -4576,6 +4731,7 @@ export {
4576
4731
  ModelAliasShapeSchema,
4577
4732
  ModelAliasUpdateSchema,
4578
4733
  ModelAliasWithRefCountSchema,
4734
+ NODE_CHECKS_MAX,
4579
4735
  NODE_ID_PATTERN,
4580
4736
  NODE_PRESET_CODE_PATTERN,
4581
4737
  NODE_STATUSES,
@@ -4640,6 +4796,8 @@ export {
4640
4796
  TemplateCandidateSchema,
4641
4797
  TemplateCodeFieldSchema,
4642
4798
  TemplatePayloadSchema,
4799
+ TestReportSchema,
4800
+ ToolCheckSchema,
4643
4801
  UnauthorizedError,
4644
4802
  UpgradeActionSchema,
4645
4803
  UpgradeApplyRequestSchema,
@@ -4647,6 +4805,7 @@ export {
4647
4805
  UpgradeNodeStatusSchema,
4648
4806
  VERSION,
4649
4807
  ValidationError,
4808
+ VcsConfigSchema,
4650
4809
  WRITE_ACK_ENTRY_KINDS,
4651
4810
  WriteAckEntryKindSchema,
4652
4811
  WriteAckSchema,
@@ -4658,6 +4817,7 @@ export {
4658
4817
  assertModelAliasExists,
4659
4818
  assertReferenceAggregateLimit,
4660
4819
  assertReferencesDeletable,
4820
+ assertUniqueAiCheckIds,
4661
4821
  assertUniqueNodeIds,
4662
4822
  buildImportPlan,
4663
4823
  buildTemplateCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siming-org/core",
3
- "version": "0.7.4",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
5
  "author": "Wuchao",
6
6
  "engines": {