@siming-org/core 0.3.0 → 0.4.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 (3) hide show
  1. package/dist/index.d.ts +1010 -15
  2. package/dist/index.js +1230 -338
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -63,6 +63,26 @@ declare function createRepo<T extends {
63
63
  type Repo<T extends {
64
64
  id?: string | undefined;
65
65
  }> = ReturnType<typeof createRepo<T>>;
66
+ /**
67
+ * 模糊搜索关键词的正则元字符转义(单点收口防注入/ReDoS)——语义 = 不区分大小写的字面包含匹配。
68
+ * 消费方:任务 title / 资产 name 的 $regex 过滤(搜索输入长度上限由各路由 query schema 把守)。
69
+ */
70
+ declare function escapeRegExpLiteral(input: string): string;
71
+ /** 资产列举公共选项:includeDisabled(缺省 false = 排除停用,CLI/MCP 默认视图)+ q(名称模糊搜索)。
72
+ * 可选属性显式含 undefined(exactOptionalPropertyTypes 惯例)——路由层可直传 query 解析出的 T | undefined。 */
73
+ interface AssetListOpts {
74
+ includeDisabled?: boolean | undefined;
75
+ q?: string | undefined;
76
+ }
77
+ /**
78
+ * 可见性过滤字段片段——enabled === false 即停用,true/缺失均启用(存量零迁移语义)。
79
+ * 与既有查询条件同层展开合并(`{ ...原条件, ...enabledNeFalse() }`)。
80
+ */
81
+ declare function enabledNeFalse(): {
82
+ enabled: {
83
+ $ne: false;
84
+ };
85
+ };
66
86
 
67
87
  /**
68
88
  * Skill Schema — Skill 库(N012:支持全局 / 项目专用两种作用域)
@@ -73,6 +93,26 @@ declare const SkillScopeSchema: z.ZodEnum<{
73
93
  project: "project";
74
94
  }>;
75
95
  declare const OBJECT_ID_HEX: RegExp;
96
+ declare const SkillShapeSchema: z.ZodObject<{
97
+ id: z.ZodOptional<z.ZodString>;
98
+ name: z.ZodString;
99
+ description: z.ZodString;
100
+ content: z.ZodString;
101
+ category: z.ZodString;
102
+ version: z.ZodDefault<z.ZodString>;
103
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
+ path: z.ZodString;
105
+ content: z.ZodString;
106
+ }, z.core.$strip>>>;
107
+ scope: z.ZodDefault<z.ZodEnum<{
108
+ global: "global";
109
+ project: "project";
110
+ }>>;
111
+ projectId: z.ZodOptional<z.ZodString>;
112
+ enabled: z.ZodOptional<z.ZodBoolean>;
113
+ createdAt: z.ZodOptional<z.ZodDate>;
114
+ updatedAt: z.ZodOptional<z.ZodDate>;
115
+ }, z.core.$strip>;
76
116
  declare const SkillSchema: z.ZodObject<{
77
117
  id: z.ZodOptional<z.ZodString>;
78
118
  name: z.ZodString;
@@ -80,11 +120,16 @@ declare const SkillSchema: z.ZodObject<{
80
120
  content: z.ZodString;
81
121
  category: z.ZodString;
82
122
  version: z.ZodDefault<z.ZodString>;
123
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
124
+ path: z.ZodString;
125
+ content: z.ZodString;
126
+ }, z.core.$strip>>>;
83
127
  scope: z.ZodDefault<z.ZodEnum<{
84
128
  global: "global";
85
129
  project: "project";
86
130
  }>>;
87
131
  projectId: z.ZodOptional<z.ZodString>;
132
+ enabled: z.ZodOptional<z.ZodBoolean>;
88
133
  createdAt: z.ZodOptional<z.ZodDate>;
89
134
  updatedAt: z.ZodOptional<z.ZodDate>;
90
135
  }, z.core.$strip>;
@@ -97,9 +142,13 @@ type SkillScope = z.infer<typeof SkillScopeSchema>;
97
142
  */
98
143
  declare const SkillCreateSchema: z.ZodObject<{
99
144
  version: z.ZodDefault<z.ZodString>;
145
+ content: z.ZodString;
100
146
  name: z.ZodString;
147
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
148
+ path: z.ZodString;
149
+ content: z.ZodString;
150
+ }, z.core.$strip>>>;
101
151
  description: z.ZodString;
102
- content: z.ZodString;
103
152
  category: z.ZodString;
104
153
  projectId: z.ZodOptional<z.ZodString>;
105
154
  scope: z.ZodEnum<{
@@ -116,9 +165,13 @@ type SkillCreate = z.infer<typeof SkillCreateSchema>;
116
165
  * 解析出 {scope:'global', version:'1.0.0'} 并被 $set 写库(version 被重置 + 项目专用资产假 409)。
117
166
  */
118
167
  declare const SkillUpdateSchema: z.ZodObject<{
168
+ content: z.ZodOptional<z.ZodString>;
119
169
  name: z.ZodOptional<z.ZodString>;
170
+ references: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
171
+ path: z.ZodString;
172
+ content: z.ZodString;
173
+ }, z.core.$strip>>>>;
120
174
  description: z.ZodOptional<z.ZodString>;
121
- content: z.ZodOptional<z.ZodString>;
122
175
  category: z.ZodOptional<z.ZodString>;
123
176
  projectId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
124
177
  version: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -151,12 +204,20 @@ type SkillRepo = Repo<Skill> & {
151
204
  updateByNameScoped(name: string, scope: SkillScope, projectId: string | undefined, patch: EoptPartial<Omit<Skill, 'id'>>): Promise<Skill | null>;
152
205
  /** N016 F02:by-name 消歧删除(同 updateByNameScoped,防止跨 scope 同名时误删) */
153
206
  deleteByNameScoped(name: string, scope: SkillScope, projectId: string | undefined): Promise<boolean>;
154
- /** N016 F12:by-name 消歧解析——scope 显式指定(project → {name, projectId};global → {name, scope:'global'}) */
155
- getByNameScoped(name: string, scope: SkillScope, projectId?: string | undefined): Promise<Skill | null>;
207
+ /**
208
+ * N016 F12:by-name 消歧解析——scope 显式指定(project → {name, projectId};global {name, scope:'global'})。
209
+ * T202608290001:缺省排除停用资产(读可见性——CLI/MCP show 404 与不存在同形);
210
+ * 写通道(update/delete/copy 源解析)经 opts.includeDisabled=true 显式放行(启停不冻结管理操作)。
211
+ */
212
+ getByNameScoped(name: string, scope: SkillScope, projectId?: string | undefined, opts?: {
213
+ includeDisabled?: boolean | undefined;
214
+ }): Promise<Skill | null>;
156
215
  /** 项目上下文叠加列表(F7):global + 指定项目专用 */
157
- listSkillsByScope(projectId: string): Promise<Skill[]>;
216
+ listSkillsByScope(projectId: string, opts?: AssetListOpts): Promise<Skill[]>;
158
217
  /** N015 F12:按作用域过滤(install 拉取;projectId 仅 scope=project 时生效) */
159
- listSkillsByScopeFilter(scope: SkillScope, projectId?: string): Promise<Skill[]>;
218
+ listSkillsByScopeFilter(scope: SkillScope, projectId?: string, opts?: AssetListOpts): Promise<Skill[]>;
219
+ /** T202608290001:全量列举(管理视角,路由缺省路径)——opts 语义同上,保持启停过滤单点在仓储层 */
220
+ listSkills(opts?: AssetListOpts): Promise<Skill[]>;
160
221
  /** 绑定校验批量预取(消 N+1):按引用方 scope 可见集过滤(N016 F04——project 引用方 = global + 本项目;global 引用方 = 仅 global) */
161
222
  listSkillsByNames(names: string[], scope?: SkillScope, projectId?: string): Promise<Map<string, Skill>>;
162
223
  /** by-name 复制(N016 F08/F11):源 scope 显式消歧 + 目标跨 scope 守卫;version 重置 '1.0.0' */
@@ -179,6 +240,39 @@ declare const AgentScopeSchema: z.ZodEnum<{
179
240
  global: "global";
180
241
  project: "project";
181
242
  }>;
243
+ /** T202608260002:Agent 功能类型——reviewer=审查(install 落盘注入信息边界)/ executor=执行/通用(不注入,默认值)。
244
+ * 消费方仅 cli writer 按 reviewer 判定注入;枚举固定于 schema 为唯一权威,registry agent_function 仅展示。 */
245
+ declare const AgentFunctionSchema: z.ZodEnum<{
246
+ reviewer: "reviewer";
247
+ executor: "executor";
248
+ }>;
249
+ declare const AgentShapeSchema: z.ZodObject<{
250
+ id: z.ZodOptional<z.ZodString>;
251
+ name: z.ZodString;
252
+ description: z.ZodString;
253
+ systemPrompt: z.ZodString;
254
+ boundSkills: z.ZodDefault<z.ZodArray<z.ZodString>>;
255
+ model: z.ZodString;
256
+ version: z.ZodDefault<z.ZodString>;
257
+ tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
258
+ permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
259
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ path: z.ZodString;
261
+ content: z.ZodString;
262
+ }, z.core.$strip>>>;
263
+ scope: z.ZodDefault<z.ZodEnum<{
264
+ global: "global";
265
+ project: "project";
266
+ }>>;
267
+ function: z.ZodDefault<z.ZodEnum<{
268
+ reviewer: "reviewer";
269
+ executor: "executor";
270
+ }>>;
271
+ projectId: z.ZodOptional<z.ZodString>;
272
+ enabled: z.ZodOptional<z.ZodBoolean>;
273
+ createdAt: z.ZodOptional<z.ZodDate>;
274
+ updatedAt: z.ZodOptional<z.ZodDate>;
275
+ }, z.core.$strip>;
182
276
  declare const AgentSchema: z.ZodObject<{
183
277
  id: z.ZodOptional<z.ZodString>;
184
278
  name: z.ZodString;
@@ -189,16 +283,26 @@ declare const AgentSchema: z.ZodObject<{
189
283
  version: z.ZodDefault<z.ZodString>;
190
284
  tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
191
285
  permissions: z.ZodDefault<z.ZodArray<z.ZodString>>;
286
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
287
+ path: z.ZodString;
288
+ content: z.ZodString;
289
+ }, z.core.$strip>>>;
192
290
  scope: z.ZodDefault<z.ZodEnum<{
193
291
  global: "global";
194
292
  project: "project";
195
293
  }>>;
294
+ function: z.ZodDefault<z.ZodEnum<{
295
+ reviewer: "reviewer";
296
+ executor: "executor";
297
+ }>>;
196
298
  projectId: z.ZodOptional<z.ZodString>;
299
+ enabled: z.ZodOptional<z.ZodBoolean>;
197
300
  createdAt: z.ZodOptional<z.ZodDate>;
198
301
  updatedAt: z.ZodOptional<z.ZodDate>;
199
302
  }, z.core.$strip>;
200
303
  type Agent = z.infer<typeof AgentSchema>;
201
304
  type AgentScope = z.infer<typeof AgentScopeSchema>;
305
+ type AgentFunction = z.infer<typeof AgentFunctionSchema>;
202
306
  /**
203
307
  * 创建输入:scope 必填(PRD F7/Q6「无默认值,未选择不可提交」)。
204
308
  * extend 覆盖 scope 字段定义以剥离实体层 default(.omit() 会保留字段的 default,缺省会静默补 'global' 而非 422);
@@ -207,6 +311,10 @@ type AgentScope = z.infer<typeof AgentScopeSchema>;
207
311
  declare const AgentCreateSchema: z.ZodObject<{
208
312
  version: z.ZodDefault<z.ZodString>;
209
313
  name: z.ZodString;
314
+ references: z.ZodOptional<z.ZodArray<z.ZodObject<{
315
+ path: z.ZodString;
316
+ content: z.ZodString;
317
+ }, z.core.$strip>>>;
210
318
  description: z.ZodString;
211
319
  projectId: z.ZodOptional<z.ZodString>;
212
320
  systemPrompt: z.ZodString;
@@ -218,6 +326,10 @@ declare const AgentCreateSchema: z.ZodObject<{
218
326
  project: "project";
219
327
  }>;
220
328
  model: z.ZodString;
329
+ function: z.ZodDefault<z.ZodEnum<{
330
+ reviewer: "reviewer";
331
+ executor: "executor";
332
+ }>>;
221
333
  }, z.core.$strip>;
222
334
  type AgentCreate = z.infer<typeof AgentCreateSchema>;
223
335
  /**
@@ -229,6 +341,10 @@ type AgentCreate = z.infer<typeof AgentCreateSchema>;
229
341
  */
230
342
  declare const AgentUpdateSchema: z.ZodObject<{
231
343
  name: z.ZodOptional<z.ZodString>;
344
+ references: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
345
+ path: z.ZodString;
346
+ content: z.ZodString;
347
+ }, z.core.$strip>>>>;
232
348
  description: z.ZodOptional<z.ZodString>;
233
349
  projectId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
234
350
  systemPrompt: z.ZodOptional<z.ZodString>;
@@ -241,6 +357,10 @@ declare const AgentUpdateSchema: z.ZodObject<{
241
357
  project: "project";
242
358
  }>>>;
243
359
  model: z.ZodOptional<z.ZodOptional<z.ZodString>>;
360
+ function: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
361
+ reviewer: "reviewer";
362
+ executor: "executor";
363
+ }>>>;
244
364
  }, z.core.$strip>;
245
365
  type AgentUpdate = z.infer<typeof AgentUpdateSchema>;
246
366
  /**
@@ -266,12 +386,20 @@ type AgentRepo = Repo<Agent> & {
266
386
  updateByNameScoped(name: string, scope: AgentScope, projectId: string | undefined, patch: EoptPartial<Omit<Agent, 'id'>>): Promise<Agent | null>;
267
387
  /** N016 F02:by-name 消歧删除(同 updateByNameScoped,防止跨 scope 同名时误删) */
268
388
  deleteByNameScoped(name: string, scope: AgentScope, projectId: string | undefined): Promise<boolean>;
269
- /** N016 F12:by-name 消歧解析——scope 显式指定(project → {name, projectId};global → {name, scope:'global'}) */
270
- getByNameScoped(name: string, scope: AgentScope, projectId?: string | undefined): Promise<Agent | null>;
389
+ /**
390
+ * N016 F12:by-name 消歧解析——scope 显式指定(project → {name, projectId};global {name, scope:'global'})。
391
+ * T202608290001:缺省排除停用资产(读可见性——CLI/MCP show 404 与不存在同形);
392
+ * 写通道(update/delete/copy 源解析)经 opts.includeDisabled=true 显式放行(启停不冻结管理操作)。
393
+ */
394
+ getByNameScoped(name: string, scope: AgentScope, projectId?: string | undefined, opts?: {
395
+ includeDisabled?: boolean | undefined;
396
+ }): Promise<Agent | null>;
271
397
  /** 项目上下文叠加列表(F7):global + 指定项目专用 */
272
- listAgentsByScope(projectId: string): Promise<Agent[]>;
398
+ listAgentsByScope(projectId: string, opts?: AssetListOpts): Promise<Agent[]>;
273
399
  /** N015 F12:按作用域过滤(install 拉取;projectId 仅 scope=project 时生效) */
274
- listAgentsByScopeFilter(scope: AgentScope, projectId?: string): Promise<Agent[]>;
400
+ listAgentsByScopeFilter(scope: AgentScope, projectId?: string, opts?: AssetListOpts): Promise<Agent[]>;
401
+ /** T202608290001:全量列举(管理视角,路由缺省路径)——opts 语义同上,保持启停过滤单点在仓储层 */
402
+ listAgents(opts?: AssetListOpts): Promise<Agent[]>;
275
403
  /** by-name 复制(N016 F08/F11):源 scope 显式消歧 + 目标跨 scope 守卫 + boundSkills 按目标作用域重校验;version 重置 '1.0.0' */
276
404
  copyAgent(sourceName: string, source: {
277
405
  scope: AgentScope;
@@ -405,6 +533,7 @@ declare const DagTemplateSchema: z.ZodObject<{
405
533
  }, z.core.$strip>>>;
406
534
  isDefault: z.ZodDefault<z.ZodBoolean>;
407
535
  version: z.ZodDefault<z.ZodString>;
536
+ enabled: z.ZodOptional<z.ZodBoolean>;
408
537
  createdAt: z.ZodOptional<z.ZodDate>;
409
538
  updatedAt: z.ZodOptional<z.ZodDate>;
410
539
  }, z.core.$strip>;
@@ -490,10 +619,15 @@ type DagTemplateCopy = z.infer<typeof DagTemplateCopySchema>;
490
619
 
491
620
  type DagTemplateRepo = Repo<DagTemplate> & {
492
621
  createDagTemplate(data: DagTemplateCreate): Promise<DagTemplate>;
493
- /** N015 F17:list 支持 name 过滤(export 查重按 projectId+name,name 项目内唯一) */
622
+ /**
623
+ * N015 F17:list 支持 name 过滤(export 查查重按 projectId+name,name 项目内唯一)。
624
+ * T202608290001:includeDisabled 缺省排除停用模板(CLI/MCP 列举 + 建任务选择器视图);
625
+ * true 时含停用(Web 管理台列表视图)。by-id 寻址不过滤(详情/创建守卫走显式判定)。
626
+ */
494
627
  listDagTemplates(filter?: {
495
628
  projectId?: string;
496
629
  name?: string;
630
+ includeDisabled?: boolean;
497
631
  }): Promise<DagTemplate[]>;
498
632
  /** 深拷贝复制(N012 F5/D5):副本落目标项目,version 重置 '1.0.0'、isDefault=false;目标项目内重名 → 409 */
499
633
  copyDagTemplate(sourceId: string, targetProjectId: string, newName: string): Promise<DagTemplate>;
@@ -996,6 +1130,8 @@ type TaskListFilter = {
996
1130
  page?: number;
997
1131
  limit?: number;
998
1132
  sort?: 'progress' | 'createdAt' | 'updatedAt';
1133
+ /** T202608290001:标题模糊搜索(不区分大小写的包含匹配——元字符转义防注入,长度上限归路由层) */
1134
+ q?: string;
999
1135
  };
1000
1136
  /**
1001
1137
  * N020 D1:点路径小步更新载荷。sets/pushes 的 key 均为(点)路径字符串,
@@ -1180,7 +1316,7 @@ declare function assertModelAliasExists(repo: ModelAliasRepo, code: string): Pro
1180
1316
  * - color:可选 UI 语义色 token(如 --success);
1181
1317
  * - order:下拉排序;builtin:内置值(禁删,D8);active:启停(禁用值下拉不可选,D8)。
1182
1318
  */
1183
- /** 7 类注册表 category 白名单(D4:固定分类,不可增删) */
1319
+ /** 注册表 category 白名单(D4:固定分类,不可增删)。T202608260002:agent_function 为第二个「schema 固定枚举权威 + registry 仅展示」双轨类(继 pause_type 先例) */
1184
1320
  declare const EnumRegistryCategorySchema: z.ZodEnum<{
1185
1321
  scope: "scope";
1186
1322
  dag_phase: "dag_phase";
@@ -1189,6 +1325,7 @@ declare const EnumRegistryCategorySchema: z.ZodEnum<{
1189
1325
  task_status: "task_status";
1190
1326
  node_status: "node_status";
1191
1327
  skill_category: "skill_category";
1328
+ agent_function: "agent_function";
1192
1329
  }>;
1193
1330
  type EnumRegistryCategory = z.infer<typeof EnumRegistryCategorySchema>;
1194
1331
  /** 注册表条目(D5) */
@@ -1212,6 +1349,7 @@ declare const EnumRegistrySchema: z.ZodObject<{
1212
1349
  task_status: "task_status";
1213
1350
  node_status: "node_status";
1214
1351
  skill_category: "skill_category";
1352
+ agent_function: "agent_function";
1215
1353
  }>;
1216
1354
  entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
1217
1355
  value: z.ZodString;
@@ -1241,7 +1379,7 @@ declare const EnumRegistryUpdateSchema: z.ZodObject<{
1241
1379
  type EnumRegistryUpdate = z.infer<typeof EnumRegistryUpdateSchema>;
1242
1380
 
1243
1381
  type EnumRegistryRepo = Repo<EnumRegistry> & {
1244
- /** 全量 7 类(SettingsPage 一次性加载;N017 删 gate_type 后由 8 类收窄) */
1382
+ /** 全量 8 类(SettingsPage 一次性加载;N017 删 gate_type 后收窄为 7 类,T202608260002 增 agent_function 复为 8 类) */
1245
1383
  listRegistries(): Promise<EnumRegistry[]>;
1246
1384
  /** 单类(按 category) */
1247
1385
  getRegistry(category: EnumRegistryCategory): Promise<EnumRegistry | null>;
@@ -1266,6 +1404,623 @@ type EnumRegistryRepo = Repo<EnumRegistry> & {
1266
1404
  };
1267
1405
  declare function createEnumRegistryRepo(db: Db): EnumRegistryRepo;
1268
1406
 
1407
+ /**
1408
+ * 引用文档 Schema(T202608270002:skill/agent 资产多文件支持)
1409
+ * 引用文档 = 资产主文档之外的附加文档集合,以相对路径标识、内嵌实体存储;
1410
+ * install 时按 path 相对资产根落盘(录入/存储/安装三环节同值,Q2 裁定:目录深度保真不限制)。
1411
+ */
1412
+ /**
1413
+ * 引用文档规模上限(PRD §7 Q1 用户裁定:宽松上限兜底,正常使用无感知,超限明确报错)。
1414
+ * 数学依据:maxTotalChars=3M 字符在 UTF-8 最坏 4 字节/字符下约 12MB,
1415
+ * 含字段名与元数据余量仍低于 MongoDB 16MB 单文档上限——分项全合法但聚合超标的 payload
1416
+ * 在应用层 422 拒绝,杜绝驱动层 BSONObjectTooLarge 落入 500 兜底。
1417
+ */
1418
+ declare const REFERENCE_LIMITS: {
1419
+ /** 单资产引用文档数量上限 */
1420
+ readonly maxCount: 20;
1421
+ /** 单引用文档内容字符数上限 */
1422
+ readonly maxContentChars: 1000000;
1423
+ /** 聚合护栏:主文档正文 + Σ引用文档内容的字符总量上限 */
1424
+ readonly maxTotalChars: 3000000;
1425
+ };
1426
+ /** skill 资产主文档文件名(install 落盘名与 path 校验共用同源,install writer 经此引用) */
1427
+ declare const SKILL_MAIN_DOC = "SKILL.md";
1428
+ /** agent 资产主文档文件名 */
1429
+ declare const AGENT_MAIN_DOC = "agent.md";
1430
+ type ReferenceDoc = z.infer<typeof ReferenceDocBaseSchema>;
1431
+ /** 单条引用文档基础形状(路径规则矩阵由 createReferenceDocSchema 按资产类型挂载) */
1432
+ declare const ReferenceDocBaseSchema: z.ZodObject<{
1433
+ path: z.ZodString;
1434
+ content: z.ZodString;
1435
+ }, z.core.$strip>;
1436
+ /**
1437
+ * 比对用规范化:去除 '.' 冗余段并统一小写。
1438
+ * 小写化使冲突判定按大小写不敏感执行——.agents 落盘目标含大小写不敏感文件系统(macOS 默认),
1439
+ * 大小写不敏感判重在该类系统上防真实覆盖冲突,在大小写敏感系统上只是额外保守。
1440
+ * 存储侧保留原始 path 不做改写(录入/存储/安装三环节同值)。
1441
+ *
1442
+ * ⚠️ 行为镜像防护:web 编辑器新增区有本地预检镜像副本(packages/web/src/components/common/
1443
+ * ReferencesEditor.tsx canonicalRefPath + validateNewRefPath)——本函数规则变更须同步该处。
1444
+ */
1445
+ declare function canonicalizeReferencePath(path: string): string;
1446
+ /** 聚合字符数:Σ引用文档 content 长度(undefined 安全,供实体级聚合上限 refine 使用) */
1447
+ declare function sumReferenceContentChars(references: ReadonlyArray<{
1448
+ content: string;
1449
+ }> | undefined): number;
1450
+ /**
1451
+ * 构造某资产类型的引用文档数组 schema。
1452
+ * 元素级:路径规则矩阵(禁绝对路径/反斜杠/空段/../主文档名冲突,中文错误带 path 值)。
1453
+ * 数组级:数量上限 + 规范化后判重 + 目录前缀冲突(`a` 与 `a/b.md` 并存会导致落盘文件/目录同名冲突)。
1454
+ * 元素与数组的 refine 位于本 schema 内部,随实体 shape 进入派生链后不受外层 .partial() 影响(运行时探针验证过)。
1455
+ */
1456
+ declare function createReferencesSchema(mainDocName: string): z.ZodArray<z.ZodObject<{
1457
+ path: z.ZodString;
1458
+ content: z.ZodString;
1459
+ }, z.core.$strip>>;
1460
+ /**
1461
+ * 引用文档删除保护(T202608270002 PRD 场景 C 边界规则):PUT 整笔替换时,
1462
+ * 被移除的引用文档 path 若仍以文本形式出现在本次提交后的主文档正文中 → 409 REFERENCE_IN_USE。
1463
+ * 两态语义:nextReferences=undefined 表示本次不修改 references(直接放行);
1464
+ * 主文档正文缺省时以现值正文参与判定(仅更新 references 的部分提交场景)。
1465
+ * 校验失败抛 ConflictError(skill/agent 路由共用同一规则,四面通道经 server schema 天然一致)。
1466
+ */
1467
+ declare function assertReferencesDeletable(params: {
1468
+ resource: 'skill' | 'agent';
1469
+ name: string;
1470
+ /** 库内现值 references(缺失 = 无引用文档可删) */
1471
+ existingReferences: ReadonlyArray<{
1472
+ path: string;
1473
+ }> | undefined;
1474
+ /** 本次提交的 references;undefined = 不修改该字段 */
1475
+ nextReferences: ReadonlyArray<{
1476
+ path: string;
1477
+ }> | undefined;
1478
+ /** 本次提交的主文档正文;undefined = 用现值判定 */
1479
+ nextMainBody: string | undefined;
1480
+ /** 库内现值主文档正文 */
1481
+ currentMainBody: string;
1482
+ }): void;
1483
+ /**
1484
+ * 引用文档聚合上限复核(server 路由层 PUT 专用):schema 级聚合校验只覆盖单次 payload——
1485
+ * 仅携带 references 的部分提交以现值主文档正文参与判定,堵住「分步提交绕过护栏」的通道
1486
+ * (先 PUT 大主文档、再 PUT 仅大 references 的两步合计可超 BSON 文档安全余量)。
1487
+ * nextMainBody 由调用方给出有效正文(payload 携带用 payload 值,未携带用库内现值)。
1488
+ * 超限抛 ValidationError(422)。
1489
+ */
1490
+ declare function assertReferenceAggregateLimit(params: {
1491
+ /** 有效主文档正文:本次提交携带则为其值,否则为库内现值 */
1492
+ effectiveMainBody: string;
1493
+ /** 本次提交的 references;undefined = 不修改该字段,跳过校验 */
1494
+ nextReferences: ReadonlyArray<{
1495
+ content: string;
1496
+ }> | undefined;
1497
+ }): void;
1498
+
1499
+ /**
1500
+ * 模板导入/导出 bundle 契约(T202608300002)
1501
+ *
1502
+ * 导出产物与导入请求的 `bundle` 字段共用同一 schema(单一真相源)。
1503
+ * Payload 全部从 Shape 层(纯 object schema)omit 派生——refined 全量 schema 上调
1504
+ * 对象级方法(.pick()/.omit() 后的 .partial() 同理)存在 Zod4 运行时陷阱,typecheck
1505
+ * 绿不算数;实体 schema 演进(新增内容字段)自动跟随进 payload。
1506
+ *
1507
+ * 剥离原则(PRD F4/F16):id / projectId / enabled / createdAt / updatedAt 不入 bundle——
1508
+ * projectId 由导入时的 targetProjectId 决定归属;enabled 属环境运营状态不迁移。
1509
+ */
1510
+ /** 当前导出格式版本(前向兼容锚点:升级格式时递增并处理旧版兼容) */
1511
+ declare const EXPORT_FORMAT_VERSION = "1.0";
1512
+ /** 模板内容投影:剥 id/projectId/enabled/时间戳;version/isDefault 剥 default 强制显式携带 */
1513
+ declare const TemplatePayloadSchema: z.ZodObject<{
1514
+ name: z.ZodString;
1515
+ description: z.ZodString;
1516
+ nodes: z.ZodArray<z.ZodObject<{
1517
+ id: z.ZodString;
1518
+ label: z.ZodString;
1519
+ phase: z.ZodString;
1520
+ track: z.ZodString;
1521
+ prompt: z.ZodString;
1522
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1523
+ }, z.core.$strip>>;
1524
+ edges: z.ZodArray<z.ZodObject<{
1525
+ from: z.ZodString;
1526
+ to: z.ZodString;
1527
+ condition: z.ZodOptional<z.ZodString>;
1528
+ pausePoint: z.ZodOptional<z.ZodObject<{
1529
+ type: z.ZodEnum<{
1530
+ human_approval: "human_approval";
1531
+ checkpoint: "checkpoint";
1532
+ }>;
1533
+ description: z.ZodString;
1534
+ autoResume: z.ZodDefault<z.ZodBoolean>;
1535
+ }, z.core.$strip>>;
1536
+ }, z.core.$strip>>;
1537
+ layout: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1538
+ x: z.ZodNumber;
1539
+ y: z.ZodNumber;
1540
+ }, z.core.$strip>>>;
1541
+ version: z.ZodString;
1542
+ isDefault: z.ZodBoolean;
1543
+ }, z.core.$strip>;
1544
+ type TemplatePayload = z.infer<typeof TemplatePayloadSchema>;
1545
+ /**
1546
+ * SKILL 内容投影:references 改必填数组(无引用文档的资产表达为 []——
1547
+ * 整笔替换语义无歧义,缺省键与「清空引用」不可区分是两态语义的坑);
1548
+ * scope/version 剥 default 强制显式携带。
1549
+ */
1550
+ declare const SkillPayloadSchema: z.ZodObject<{
1551
+ content: z.ZodString;
1552
+ name: z.ZodString;
1553
+ description: z.ZodString;
1554
+ category: z.ZodString;
1555
+ version: z.ZodString;
1556
+ scope: z.ZodEnum<{
1557
+ global: "global";
1558
+ project: "project";
1559
+ }>;
1560
+ references: z.ZodArray<z.ZodObject<{
1561
+ path: z.ZodString;
1562
+ content: z.ZodString;
1563
+ }, z.core.$strip>>;
1564
+ }, z.core.$strip>;
1565
+ type SkillPayload = z.infer<typeof SkillPayloadSchema>;
1566
+ /** AGENT 内容投影:同 SkillPayload 原则,另剥 boundSkills/tools/permissions/function 的 default */
1567
+ declare const AgentPayloadSchema: z.ZodObject<{
1568
+ name: z.ZodString;
1569
+ description: z.ZodString;
1570
+ systemPrompt: z.ZodString;
1571
+ model: z.ZodString;
1572
+ version: z.ZodString;
1573
+ scope: z.ZodEnum<{
1574
+ global: "global";
1575
+ project: "project";
1576
+ }>;
1577
+ references: z.ZodArray<z.ZodObject<{
1578
+ path: z.ZodString;
1579
+ content: z.ZodString;
1580
+ }, z.core.$strip>>;
1581
+ boundSkills: z.ZodArray<z.ZodString>;
1582
+ tools: z.ZodArray<z.ZodString>;
1583
+ permissions: z.ZodArray<z.ZodString>;
1584
+ function: z.ZodEnum<{
1585
+ reviewer: "reviewer";
1586
+ executor: "executor";
1587
+ }>;
1588
+ }, z.core.$strip>;
1589
+ type AgentPayload = z.infer<typeof AgentPayloadSchema>;
1590
+ /** 模型映射内容投影(无 scope/enabled 概念,仅剥 id/时间戳) */
1591
+ declare const ModelAliasPayloadSchema: z.ZodObject<{
1592
+ name: z.ZodString;
1593
+ code: z.ZodString;
1594
+ realModel: z.ZodString;
1595
+ }, z.core.$strip>;
1596
+ type ModelAliasPayload = z.infer<typeof ModelAliasPayloadSchema>;
1597
+ /**
1598
+ * 导出 bundle。exportFormatVersion 用 literal + 定制 error——`z.literal` 对非匹配值
1599
+ * parse 即失败 short-circuit,外挂 superRefine 不会执行,message 必须经 error 参数内联
1600
+ * (PRD 验收 14:错误信息明确提示版本不支持)。
1601
+ */
1602
+ declare const ExportBundleSchema: z.ZodObject<{
1603
+ exportFormatVersion: z.ZodLiteral<"1.0">;
1604
+ exportedAt: z.ZodString;
1605
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1606
+ template: z.ZodObject<{
1607
+ name: z.ZodString;
1608
+ description: z.ZodString;
1609
+ nodes: z.ZodArray<z.ZodObject<{
1610
+ id: z.ZodString;
1611
+ label: z.ZodString;
1612
+ phase: z.ZodString;
1613
+ track: z.ZodString;
1614
+ prompt: z.ZodString;
1615
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1616
+ }, z.core.$strip>>;
1617
+ edges: z.ZodArray<z.ZodObject<{
1618
+ from: z.ZodString;
1619
+ to: z.ZodString;
1620
+ condition: z.ZodOptional<z.ZodString>;
1621
+ pausePoint: z.ZodOptional<z.ZodObject<{
1622
+ type: z.ZodEnum<{
1623
+ human_approval: "human_approval";
1624
+ checkpoint: "checkpoint";
1625
+ }>;
1626
+ description: z.ZodString;
1627
+ autoResume: z.ZodDefault<z.ZodBoolean>;
1628
+ }, z.core.$strip>>;
1629
+ }, z.core.$strip>>;
1630
+ layout: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1631
+ x: z.ZodNumber;
1632
+ y: z.ZodNumber;
1633
+ }, z.core.$strip>>>;
1634
+ version: z.ZodString;
1635
+ isDefault: z.ZodBoolean;
1636
+ }, z.core.$strip>;
1637
+ dependencies: z.ZodObject<{
1638
+ skills: z.ZodArray<z.ZodObject<{
1639
+ content: z.ZodString;
1640
+ name: z.ZodString;
1641
+ description: z.ZodString;
1642
+ category: z.ZodString;
1643
+ version: z.ZodString;
1644
+ scope: z.ZodEnum<{
1645
+ global: "global";
1646
+ project: "project";
1647
+ }>;
1648
+ references: z.ZodArray<z.ZodObject<{
1649
+ path: z.ZodString;
1650
+ content: z.ZodString;
1651
+ }, z.core.$strip>>;
1652
+ }, z.core.$strip>>;
1653
+ agents: z.ZodArray<z.ZodObject<{
1654
+ name: z.ZodString;
1655
+ description: z.ZodString;
1656
+ systemPrompt: z.ZodString;
1657
+ model: z.ZodString;
1658
+ version: z.ZodString;
1659
+ scope: z.ZodEnum<{
1660
+ global: "global";
1661
+ project: "project";
1662
+ }>;
1663
+ references: z.ZodArray<z.ZodObject<{
1664
+ path: z.ZodString;
1665
+ content: z.ZodString;
1666
+ }, z.core.$strip>>;
1667
+ boundSkills: z.ZodArray<z.ZodString>;
1668
+ tools: z.ZodArray<z.ZodString>;
1669
+ permissions: z.ZodArray<z.ZodString>;
1670
+ function: z.ZodEnum<{
1671
+ reviewer: "reviewer";
1672
+ executor: "executor";
1673
+ }>;
1674
+ }, z.core.$strip>>;
1675
+ modelAliases: z.ZodArray<z.ZodObject<{
1676
+ name: z.ZodString;
1677
+ code: z.ZodString;
1678
+ realModel: z.ZodString;
1679
+ }, z.core.$strip>>;
1680
+ }, z.core.$strip>;
1681
+ }, z.core.$strip>;
1682
+ type ExportBundle = z.infer<typeof ExportBundleSchema>;
1683
+ declare const ImportPlanRequestSchema: z.ZodObject<{
1684
+ targetProjectId: z.ZodString;
1685
+ bundle: z.ZodObject<{
1686
+ exportFormatVersion: z.ZodLiteral<"1.0">;
1687
+ exportedAt: z.ZodString;
1688
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1689
+ template: z.ZodObject<{
1690
+ name: z.ZodString;
1691
+ description: z.ZodString;
1692
+ nodes: z.ZodArray<z.ZodObject<{
1693
+ id: z.ZodString;
1694
+ label: z.ZodString;
1695
+ phase: z.ZodString;
1696
+ track: z.ZodString;
1697
+ prompt: z.ZodString;
1698
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1699
+ }, z.core.$strip>>;
1700
+ edges: z.ZodArray<z.ZodObject<{
1701
+ from: z.ZodString;
1702
+ to: z.ZodString;
1703
+ condition: z.ZodOptional<z.ZodString>;
1704
+ pausePoint: z.ZodOptional<z.ZodObject<{
1705
+ type: z.ZodEnum<{
1706
+ human_approval: "human_approval";
1707
+ checkpoint: "checkpoint";
1708
+ }>;
1709
+ description: z.ZodString;
1710
+ autoResume: z.ZodDefault<z.ZodBoolean>;
1711
+ }, z.core.$strip>>;
1712
+ }, z.core.$strip>>;
1713
+ layout: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1714
+ x: z.ZodNumber;
1715
+ y: z.ZodNumber;
1716
+ }, z.core.$strip>>>;
1717
+ version: z.ZodString;
1718
+ isDefault: z.ZodBoolean;
1719
+ }, z.core.$strip>;
1720
+ dependencies: z.ZodObject<{
1721
+ skills: z.ZodArray<z.ZodObject<{
1722
+ content: z.ZodString;
1723
+ name: z.ZodString;
1724
+ description: z.ZodString;
1725
+ category: z.ZodString;
1726
+ version: z.ZodString;
1727
+ scope: z.ZodEnum<{
1728
+ global: "global";
1729
+ project: "project";
1730
+ }>;
1731
+ references: z.ZodArray<z.ZodObject<{
1732
+ path: z.ZodString;
1733
+ content: z.ZodString;
1734
+ }, z.core.$strip>>;
1735
+ }, z.core.$strip>>;
1736
+ agents: z.ZodArray<z.ZodObject<{
1737
+ name: z.ZodString;
1738
+ description: z.ZodString;
1739
+ systemPrompt: z.ZodString;
1740
+ model: z.ZodString;
1741
+ version: z.ZodString;
1742
+ scope: z.ZodEnum<{
1743
+ global: "global";
1744
+ project: "project";
1745
+ }>;
1746
+ references: z.ZodArray<z.ZodObject<{
1747
+ path: z.ZodString;
1748
+ content: z.ZodString;
1749
+ }, z.core.$strip>>;
1750
+ boundSkills: z.ZodArray<z.ZodString>;
1751
+ tools: z.ZodArray<z.ZodString>;
1752
+ permissions: z.ZodArray<z.ZodString>;
1753
+ function: z.ZodEnum<{
1754
+ reviewer: "reviewer";
1755
+ executor: "executor";
1756
+ }>;
1757
+ }, z.core.$strip>>;
1758
+ modelAliases: z.ZodArray<z.ZodObject<{
1759
+ name: z.ZodString;
1760
+ code: z.ZodString;
1761
+ realModel: z.ZodString;
1762
+ }, z.core.$strip>>;
1763
+ }, z.core.$strip>;
1764
+ }, z.core.$strip>;
1765
+ }, z.core.$strip>;
1766
+ type ImportPlanRequest = z.infer<typeof ImportPlanRequestSchema>;
1767
+ /** 依赖冲突决策向量(discriminated union:skill/agent 必填 scope 消歧同名双 scope 并存;modelAlias 无 scope) */
1768
+ declare const ImportDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1769
+ kind: z.ZodLiteral<"skill">;
1770
+ name: z.ZodString;
1771
+ scope: z.ZodEnum<{
1772
+ global: "global";
1773
+ project: "project";
1774
+ }>;
1775
+ action: z.ZodEnum<{
1776
+ skip: "skip";
1777
+ overwrite: "overwrite";
1778
+ }>;
1779
+ }, z.core.$strip>, z.ZodObject<{
1780
+ kind: z.ZodLiteral<"agent">;
1781
+ name: z.ZodString;
1782
+ scope: z.ZodEnum<{
1783
+ global: "global";
1784
+ project: "project";
1785
+ }>;
1786
+ action: z.ZodEnum<{
1787
+ skip: "skip";
1788
+ overwrite: "overwrite";
1789
+ }>;
1790
+ }, z.core.$strip>, z.ZodObject<{
1791
+ kind: z.ZodLiteral<"modelAlias">;
1792
+ name: z.ZodString;
1793
+ action: z.ZodEnum<{
1794
+ skip: "skip";
1795
+ overwrite: "overwrite";
1796
+ }>;
1797
+ }, z.core.$strip>], "kind">;
1798
+ type ImportDecision = z.infer<typeof ImportDecisionSchema>;
1799
+ declare const ImportApplyRequestSchema: z.ZodObject<{
1800
+ targetProjectId: z.ZodString;
1801
+ bundle: z.ZodObject<{
1802
+ exportFormatVersion: z.ZodLiteral<"1.0">;
1803
+ exportedAt: z.ZodString;
1804
+ warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
1805
+ template: z.ZodObject<{
1806
+ name: z.ZodString;
1807
+ description: z.ZodString;
1808
+ nodes: z.ZodArray<z.ZodObject<{
1809
+ id: z.ZodString;
1810
+ label: z.ZodString;
1811
+ phase: z.ZodString;
1812
+ track: z.ZodString;
1813
+ prompt: z.ZodString;
1814
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
1815
+ }, z.core.$strip>>;
1816
+ edges: z.ZodArray<z.ZodObject<{
1817
+ from: z.ZodString;
1818
+ to: z.ZodString;
1819
+ condition: z.ZodOptional<z.ZodString>;
1820
+ pausePoint: z.ZodOptional<z.ZodObject<{
1821
+ type: z.ZodEnum<{
1822
+ human_approval: "human_approval";
1823
+ checkpoint: "checkpoint";
1824
+ }>;
1825
+ description: z.ZodString;
1826
+ autoResume: z.ZodDefault<z.ZodBoolean>;
1827
+ }, z.core.$strip>>;
1828
+ }, z.core.$strip>>;
1829
+ layout: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1830
+ x: z.ZodNumber;
1831
+ y: z.ZodNumber;
1832
+ }, z.core.$strip>>>;
1833
+ version: z.ZodString;
1834
+ isDefault: z.ZodBoolean;
1835
+ }, z.core.$strip>;
1836
+ dependencies: z.ZodObject<{
1837
+ skills: z.ZodArray<z.ZodObject<{
1838
+ content: z.ZodString;
1839
+ name: z.ZodString;
1840
+ description: z.ZodString;
1841
+ category: z.ZodString;
1842
+ version: z.ZodString;
1843
+ scope: z.ZodEnum<{
1844
+ global: "global";
1845
+ project: "project";
1846
+ }>;
1847
+ references: z.ZodArray<z.ZodObject<{
1848
+ path: z.ZodString;
1849
+ content: z.ZodString;
1850
+ }, z.core.$strip>>;
1851
+ }, z.core.$strip>>;
1852
+ agents: z.ZodArray<z.ZodObject<{
1853
+ name: z.ZodString;
1854
+ description: z.ZodString;
1855
+ systemPrompt: z.ZodString;
1856
+ model: z.ZodString;
1857
+ version: z.ZodString;
1858
+ scope: z.ZodEnum<{
1859
+ global: "global";
1860
+ project: "project";
1861
+ }>;
1862
+ references: z.ZodArray<z.ZodObject<{
1863
+ path: z.ZodString;
1864
+ content: z.ZodString;
1865
+ }, z.core.$strip>>;
1866
+ boundSkills: z.ZodArray<z.ZodString>;
1867
+ tools: z.ZodArray<z.ZodString>;
1868
+ permissions: z.ZodArray<z.ZodString>;
1869
+ function: z.ZodEnum<{
1870
+ reviewer: "reviewer";
1871
+ executor: "executor";
1872
+ }>;
1873
+ }, z.core.$strip>>;
1874
+ modelAliases: z.ZodArray<z.ZodObject<{
1875
+ name: z.ZodString;
1876
+ code: z.ZodString;
1877
+ realModel: z.ZodString;
1878
+ }, z.core.$strip>>;
1879
+ }, z.core.$strip>;
1880
+ }, z.core.$strip>;
1881
+ decisions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1882
+ kind: z.ZodLiteral<"skill">;
1883
+ name: z.ZodString;
1884
+ scope: z.ZodEnum<{
1885
+ global: "global";
1886
+ project: "project";
1887
+ }>;
1888
+ action: z.ZodEnum<{
1889
+ skip: "skip";
1890
+ overwrite: "overwrite";
1891
+ }>;
1892
+ }, z.core.$strip>, z.ZodObject<{
1893
+ kind: z.ZodLiteral<"agent">;
1894
+ name: z.ZodString;
1895
+ scope: z.ZodEnum<{
1896
+ global: "global";
1897
+ project: "project";
1898
+ }>;
1899
+ action: z.ZodEnum<{
1900
+ skip: "skip";
1901
+ overwrite: "overwrite";
1902
+ }>;
1903
+ }, z.core.$strip>, z.ZodObject<{
1904
+ kind: z.ZodLiteral<"modelAlias">;
1905
+ name: z.ZodString;
1906
+ action: z.ZodEnum<{
1907
+ skip: "skip";
1908
+ overwrite: "overwrite";
1909
+ }>;
1910
+ }, z.core.$strip>], "kind">>>;
1911
+ }, z.core.$strip>;
1912
+ type ImportApplyRequest = z.infer<typeof ImportApplyRequestSchema>;
1913
+ declare const DependencyStatusSchema: z.ZodEnum<{
1914
+ conflict: "conflict";
1915
+ create: "create";
1916
+ identical: "identical";
1917
+ }>;
1918
+ type DependencyStatus = z.infer<typeof DependencyStatusSchema>;
1919
+ declare const DependencyCheckSchema: z.ZodObject<{
1920
+ kind: z.ZodEnum<{
1921
+ skill: "skill";
1922
+ agent: "agent";
1923
+ modelAlias: "modelAlias";
1924
+ }>;
1925
+ name: z.ZodString;
1926
+ scope: z.ZodOptional<z.ZodEnum<{
1927
+ global: "global";
1928
+ project: "project";
1929
+ }>>;
1930
+ status: z.ZodEnum<{
1931
+ conflict: "conflict";
1932
+ create: "create";
1933
+ identical: "identical";
1934
+ }>;
1935
+ currentVersion: z.ZodOptional<z.ZodString>;
1936
+ importVersion: z.ZodOptional<z.ZodString>;
1937
+ changeSummary: z.ZodOptional<z.ZodString>;
1938
+ impact: z.ZodEnum<{
1939
+ global: "global";
1940
+ project: "project";
1941
+ }>;
1942
+ }, z.core.$strip>;
1943
+ type DependencyCheck = z.infer<typeof DependencyCheckSchema>;
1944
+ declare const ImportPlanResponseSchema: z.ZodObject<{
1945
+ template: z.ZodObject<{
1946
+ name: z.ZodString;
1947
+ willOverwrite: z.ZodBoolean;
1948
+ currentVersion: z.ZodOptional<z.ZodString>;
1949
+ importVersion: z.ZodString;
1950
+ isDefaultRequested: z.ZodBoolean;
1951
+ isDefaultEffect: z.ZodBoolean;
1952
+ downgradeReason: z.ZodOptional<z.ZodString>;
1953
+ }, z.core.$strip>;
1954
+ dependencies: z.ZodArray<z.ZodObject<{
1955
+ kind: z.ZodEnum<{
1956
+ skill: "skill";
1957
+ agent: "agent";
1958
+ modelAlias: "modelAlias";
1959
+ }>;
1960
+ name: z.ZodString;
1961
+ scope: z.ZodOptional<z.ZodEnum<{
1962
+ global: "global";
1963
+ project: "project";
1964
+ }>>;
1965
+ status: z.ZodEnum<{
1966
+ conflict: "conflict";
1967
+ create: "create";
1968
+ identical: "identical";
1969
+ }>;
1970
+ currentVersion: z.ZodOptional<z.ZodString>;
1971
+ importVersion: z.ZodOptional<z.ZodString>;
1972
+ changeSummary: z.ZodOptional<z.ZodString>;
1973
+ impact: z.ZodEnum<{
1974
+ global: "global";
1975
+ project: "project";
1976
+ }>;
1977
+ }, z.core.$strip>>;
1978
+ warnings: z.ZodArray<z.ZodString>;
1979
+ }, z.core.$strip>;
1980
+ type ImportPlanResponse = z.infer<typeof ImportPlanResponseSchema>;
1981
+ declare const DependencyActionSchema: z.ZodEnum<{
1982
+ skipped: "skipped";
1983
+ identical: "identical";
1984
+ created: "created";
1985
+ updated: "updated";
1986
+ failed: "failed";
1987
+ }>;
1988
+ type DependencyAction = z.infer<typeof DependencyActionSchema>;
1989
+ declare const ImportApplyResponseSchema: z.ZodObject<{
1990
+ template: z.ZodObject<{
1991
+ id: z.ZodString;
1992
+ name: z.ZodString;
1993
+ action: z.ZodEnum<{
1994
+ created: "created";
1995
+ updated: "updated";
1996
+ }>;
1997
+ isDefaultEffect: z.ZodBoolean;
1998
+ }, z.core.$strip>;
1999
+ dependencies: z.ZodArray<z.ZodObject<{
2000
+ kind: z.ZodEnum<{
2001
+ skill: "skill";
2002
+ agent: "agent";
2003
+ modelAlias: "modelAlias";
2004
+ }>;
2005
+ name: z.ZodString;
2006
+ scope: z.ZodOptional<z.ZodEnum<{
2007
+ global: "global";
2008
+ project: "project";
2009
+ }>>;
2010
+ action: z.ZodEnum<{
2011
+ skipped: "skipped";
2012
+ identical: "identical";
2013
+ created: "created";
2014
+ updated: "updated";
2015
+ failed: "failed";
2016
+ }>;
2017
+ message: z.ZodOptional<z.ZodString>;
2018
+ }, z.core.$strip>>;
2019
+ }, z.core.$strip>;
2020
+ type ImportApplyResponse = z.infer<typeof ImportApplyResponseSchema>;
2021
+ /** 决策向量寻址键(skill/agent 含 scope 段,modelAlias 空段) */
2022
+ declare function decisionKey(kind: 'skill' | 'agent' | 'modelAlias', scope: 'global' | 'project' | undefined, name: string): string;
2023
+
1269
2024
  /**
1270
2025
  * Advance / Approve 相关 Schemas
1271
2026
  *
@@ -1459,6 +2214,174 @@ declare const ResumeRequestSchema: z.ZodObject<{
1459
2214
  decision: z.ZodOptional<z.ZodString>;
1460
2215
  }, z.core.$strip>;
1461
2216
  type ResumeRequest = z.infer<typeof ResumeRequestSchema>;
2217
+ /**
2218
+ * 任务取消请求体:active/paused(含暂停点等待态)可取消 → cancelled 终态(不可逆)。
2219
+ * reason 可选——仅进 history 留痕 details(对齐 pause 的 reason 惯例,不改变行为流)。
2220
+ */
2221
+ declare const CancelRequestSchema: z.ZodObject<{
2222
+ reason: z.ZodOptional<z.ZodString>;
2223
+ }, z.core.$strip>;
2224
+ type CancelRequest = z.infer<typeof CancelRequestSchema>;
2225
+
2226
+ /**
2227
+ * T202608280007 F1:写入轻量回执——任务信息结构化写端点(doc/record/archnote 域 +
2228
+ * title/pause/resume)成功响应统一形态。调研实测写响应回灌完整 Task 实体占会话注入
2229
+ * 84.8%(写入 79B 换回 12.7KB),回执只携带「写成了什么 + 新条目标识 + 生效时间 +
2230
+ * 任务进度摘要」,投影发生在 server 路由层(仓储层保持全量实体返回供预读校验/CAS)。
2231
+ */
2232
+ /** 有服务端短 id 的条目类别($push 五类);acceptance/non-goal 为纯字符串条目无 id,不入 entry */
2233
+ declare const WRITE_ACK_ENTRY_KINDS: readonly ["check", "artifact", "decision", "confirmation", "archnote"];
2234
+ declare const WriteAckEntryKindSchema: z.ZodEnum<{
2235
+ check: "check";
2236
+ decision: "decision";
2237
+ artifact: "artifact";
2238
+ confirmation: "confirmation";
2239
+ archnote: "archnote";
2240
+ }>;
2241
+ type WriteAckEntryKind = z.infer<typeof WriteAckEntryKindSchema>;
2242
+ /** 写入回显项:触及字段点路径 + 值摘要(excerpt 上限 120 字符,多字段写入逐字段一条) */
2243
+ declare const EchoItemSchema: z.ZodObject<{
2244
+ path: z.ZodString;
2245
+ excerpt: z.ZodString;
2246
+ }, z.core.$strip>;
2247
+ type EchoItem = z.infer<typeof EchoItemSchema>;
2248
+ /** 任务进度计数(口径与列表概要投影一致:completed=completed 节点数,skipped 不计入分母) */
2249
+ declare const TaskProgressSchema: z.ZodObject<{
2250
+ completed: z.ZodNumber;
2251
+ total: z.ZodNumber;
2252
+ }, z.core.$strip>;
2253
+ type TaskProgress = z.infer<typeof TaskProgressSchema>;
2254
+ /** TaskPublic + projectId + progress:写入回执/创建响应共用的任务进度摘要。
2255
+ * projectId 单列(TaskPublic 无)——项目归属是创建响应的语义要点(N012 归属继承行为需在写入时点可见) */
2256
+ declare const TaskProgressPublicSchema: z.ZodObject<{
2257
+ taskId: z.ZodString;
2258
+ title: z.ZodString;
2259
+ type: z.ZodOptional<z.ZodEnum<{
2260
+ feature: "feature";
2261
+ bugfix: "bugfix";
2262
+ "ui-tweak": "ui-tweak";
2263
+ research: "research";
2264
+ }>>;
2265
+ currentNode: z.ZodString;
2266
+ currentPhase: z.ZodString;
2267
+ status: z.ZodString;
2268
+ pausedAt: z.ZodNullable<z.ZodString>;
2269
+ track: z.ZodString;
2270
+ projectId: z.ZodString;
2271
+ progress: z.ZodObject<{
2272
+ completed: z.ZodNumber;
2273
+ total: z.ZodNumber;
2274
+ }, z.core.$strip>;
2275
+ }, z.core.$strip>;
2276
+ type TaskProgressPublic = z.infer<typeof TaskProgressPublicSchema>;
2277
+ declare const WriteAckSchema: z.ZodObject<{
2278
+ taskId: z.ZodString;
2279
+ updated: z.ZodArray<z.ZodString>;
2280
+ entry: z.ZodOptional<z.ZodObject<{
2281
+ id: z.ZodString;
2282
+ kind: z.ZodEnum<{
2283
+ check: "check";
2284
+ decision: "decision";
2285
+ artifact: "artifact";
2286
+ confirmation: "confirmation";
2287
+ archnote: "archnote";
2288
+ }>;
2289
+ }, z.core.$strip>>;
2290
+ echo: z.ZodOptional<z.ZodArray<z.ZodObject<{
2291
+ path: z.ZodString;
2292
+ excerpt: z.ZodString;
2293
+ }, z.core.$strip>>>;
2294
+ updatedAt: z.ZodDate;
2295
+ task: z.ZodObject<{
2296
+ taskId: z.ZodString;
2297
+ title: z.ZodString;
2298
+ type: z.ZodOptional<z.ZodEnum<{
2299
+ feature: "feature";
2300
+ bugfix: "bugfix";
2301
+ "ui-tweak": "ui-tweak";
2302
+ research: "research";
2303
+ }>>;
2304
+ currentNode: z.ZodString;
2305
+ currentPhase: z.ZodString;
2306
+ status: z.ZodString;
2307
+ pausedAt: z.ZodNullable<z.ZodString>;
2308
+ track: z.ZodString;
2309
+ projectId: z.ZodString;
2310
+ progress: z.ZodObject<{
2311
+ completed: z.ZodNumber;
2312
+ total: z.ZodNumber;
2313
+ }, z.core.$strip>;
2314
+ }, z.core.$strip>;
2315
+ }, z.core.$strip>;
2316
+ type WriteAck = z.infer<typeof WriteAckSchema>;
2317
+ /** T202608280007 F1:任务创建响应(原全量 Task 实体)——任务摘要 + 首节点开工资料,与 advance 轻量形态同构 */
2318
+ declare const CreateTaskResponseSchema: z.ZodObject<{
2319
+ task: z.ZodObject<{
2320
+ taskId: z.ZodString;
2321
+ title: z.ZodString;
2322
+ type: z.ZodOptional<z.ZodEnum<{
2323
+ feature: "feature";
2324
+ bugfix: "bugfix";
2325
+ "ui-tweak": "ui-tweak";
2326
+ research: "research";
2327
+ }>>;
2328
+ currentNode: z.ZodString;
2329
+ currentPhase: z.ZodString;
2330
+ status: z.ZodString;
2331
+ pausedAt: z.ZodNullable<z.ZodString>;
2332
+ track: z.ZodString;
2333
+ projectId: z.ZodString;
2334
+ progress: z.ZodObject<{
2335
+ completed: z.ZodNumber;
2336
+ total: z.ZodNumber;
2337
+ }, z.core.$strip>;
2338
+ }, z.core.$strip>;
2339
+ firstNode: z.ZodObject<{
2340
+ nodeId: z.ZodString;
2341
+ label: z.ZodString;
2342
+ track: z.ZodString;
2343
+ prompt: z.ZodString;
2344
+ skills: z.ZodArray<z.ZodString>;
2345
+ upcomingPause: z.ZodNullable<z.ZodString>;
2346
+ }, z.core.$strip>;
2347
+ }, z.core.$strip>;
2348
+ type CreateTaskResponse = z.infer<typeof CreateTaskResponseSchema>;
2349
+ /**
2350
+ * 进度计数单源(列表聚合管道同口径,供路由层回执组装):
2351
+ * completed = nodeStates 中 status='completed' 的节点数;
2352
+ * total = 实例节点数 - skipped 节点数(裁剪节点不计分母)。
2353
+ */
2354
+ declare function taskProgress(task: Task): TaskProgress;
2355
+ /**
2356
+ * 值摘要截断——按 Unicode 码点截断(防 astral 字符劈开代理对产出非法 JSON),
2357
+ * 总长含省略号封顶 max。
2358
+ */
2359
+ declare function excerpt(value: string, max?: number): string;
2360
+ /**
2361
+ * T202608280007 F2:context 分层视图——basic(默认)剥离 artifact content 全文快照;
2362
+ * full 与既有形态逐字节等价(断点续跑自足性不回退红线)。HTTP query / CLI --view /
2363
+ * MCP view 三通道单源。
2364
+ *
2365
+ * 实现裁定(架构评审① F01 留痕):不另建 ArtifactRefSchema——ArtifactSchema.content
2366
+ * 本就 optional,basic 剥离后仍为合法 Artifact 形态,TaskContextSchema 原样可用;
2367
+ * 分层属传输投影(server 路由层 stripArtifactContent),不引入消费方可感知的类型分叉。
2368
+ */
2369
+ declare const CONTEXT_VIEWS: readonly ["basic", "full"];
2370
+ declare const ContextViewSchema: z.ZodEnum<{
2371
+ basic: "basic";
2372
+ full: "full";
2373
+ }>;
2374
+ type ContextView = z.infer<typeof ContextViewSchema>;
2375
+
2376
+ /**
2377
+ * 资产启停切换请求体(T202608290001)——skill / agent / dag-template 三类资产共用。
2378
+ * 专用端点唯一入参:POST /api/{skills|agents}/:name/enabled 与 POST /api/dag/templates/:id/enabled。
2379
+ * 启停不进 Create/Update schema、不触发版本号提升(内容未变——版本标记随产物走)。
2380
+ */
2381
+ declare const AssetSetEnabledSchema: z.ZodObject<{
2382
+ enabled: z.ZodBoolean;
2383
+ }, z.core.$strip>;
2384
+ type AssetSetEnabled = z.infer<typeof AssetSetEnabledSchema>;
1462
2385
 
1463
2386
  /**
1464
2387
  * 服务配置 schema(N018 D5):Zod 单一真相源,core 只承载纯 schema + env 键映射,
@@ -1501,7 +2424,7 @@ declare const SIMING_CONFIG_ENV_KEYS: Record<SimingConfigKey, string>;
1501
2424
  * Domain error types — thrown by core business logic, caught by server's app.onError().
1502
2425
  */
1503
2426
  /** N012 语义化业务错误码(可选挂载到 AppError 子类;HTTP 形状向后兼容:error 字段缺省仍为 http 级 code) */
1504
- type BizCode = 'PROJECT_ARCHIVED' | 'TEMPLATE_PROJECT_MISMATCH' | 'TEMPLATE_PROJECT_IMMUTABLE' | 'SCOPE_IMMUTABLE' | 'TASK_PROJECT_IMMUTABLE' | 'DEFAULT_PROJECT_IMMUTABLE' | 'TEMPLATE_NAME_CONFLICT' | 'PROJECT_NOT_FOUND' | 'AGENT_SKILL_SCOPE_CONFLICT' | 'MODEL_CODE_EXISTS' | 'MODEL_CODE_IMMUTABLE' | 'MODEL_ALIAS_IN_USE' | 'ENUM_ENTRY_BUILTIN' | 'ENUM_ENTRY_IN_USE' | 'ENUM_VALUE_CONFLICT' | 'NAME_SCOPE_CONFLICT' | 'TASK_DOC_NOT_SET' | 'TASK_DOC_NOT_FOUND' | 'TASK_DOC_SECTION_NOT_FOUND' | 'TASK_AT_PAUSE_POINT' | 'TASK_NOT_AT_PAUSE_POINT' | 'NODE_NOT_IN_INSTANCE' | 'CHECK_NOT_FOUND' | 'NODE_RECORD_NOT_WRITABLE' | 'TASK_TERMINATED' | 'TASK_PRUNE_GRAPH_INVALID' | 'TASK_SKIP_NODE_NOT_FOUND' | 'TASK_TYPE_TRACK_MISMATCH';
2427
+ type BizCode = 'PROJECT_ARCHIVED' | 'TEMPLATE_PROJECT_MISMATCH' | 'TEMPLATE_PROJECT_IMMUTABLE' | 'SCOPE_IMMUTABLE' | 'TASK_PROJECT_IMMUTABLE' | 'DEFAULT_PROJECT_IMMUTABLE' | 'TEMPLATE_NAME_CONFLICT' | 'PROJECT_NOT_FOUND' | 'AGENT_SKILL_SCOPE_CONFLICT' | 'MODEL_CODE_EXISTS' | 'MODEL_CODE_IMMUTABLE' | 'MODEL_ALIAS_IN_USE' | 'ENUM_ENTRY_BUILTIN' | 'ENUM_ENTRY_IN_USE' | 'ENUM_VALUE_CONFLICT' | 'NAME_SCOPE_CONFLICT' | 'REFERENCE_IN_USE' | 'TASK_DOC_NOT_SET' | 'TASK_DOC_NOT_FOUND' | 'TASK_DOC_SECTION_NOT_FOUND' | 'TASK_AT_PAUSE_POINT' | 'TASK_NOT_AT_PAUSE_POINT' | 'NODE_NOT_IN_INSTANCE' | 'CHECK_NOT_FOUND' | 'NODE_RECORD_NOT_WRITABLE' | 'TASK_TERMINATED' | 'TASK_PRUNE_GRAPH_INVALID' | 'TASK_SKIP_NODE_NOT_FOUND' | 'TASK_TYPE_TRACK_MISMATCH' | 'TEMPLATE_DISABLED';
1505
2428
  /** bizCode → 用户可读中文 message(单一真相源,路由层抛错时引用) */
1506
2429
  declare const BIZ_CODE_MESSAGES: Record<BizCode, string>;
1507
2430
  interface AppErrorOptions {
@@ -1568,6 +2491,21 @@ declare class ValidationError extends AppError {
1568
2491
  };
1569
2492
  }
1570
2493
 
2494
+ /**
2495
+ * 资产版本(skill/agent 的 version 字段)递增单源(T202608260002 D1 自 cli export 上移)。
2496
+ * 注意与包版本 VERSION(index.ts,读 package.json 的发布版本)是两个概念——本文件只管资产版本 bump。
2497
+ * 两种语义并存(实现必须显式区分,禁止混用):
2498
+ * - bumpPatch:传播语义——解析失败以 '1.0.0' 为基准 +1(恒返回可比较的新版本)。
2499
+ * 用于服务端 function 变更自动 bump 与存量回填 bump:若原样返回旧值,
2500
+ * install 的版本相等 skip 会吞掉本次变更(已装环境旧文案残留)。
2501
+ * - bumpPatchOrPassthrough:export 宽松语义——解析失败原样返回。
2502
+ * export 条目版本允许自由文本(UpdateSchema 不限格式),不可解析时不误伤原值。
2503
+ */
2504
+ /** 传播语义:非法版本视为 '1.0.0' → 返回 '1.0.1'(保证版本必变,防 skip 吞传播) */
2505
+ declare function bumpPatch(version: string): string;
2506
+ /** export 宽松语义:解析失败原样返回(不误伤自由文本版本) */
2507
+ declare function bumpPatchOrPassthrough(version: string): string;
2508
+
1571
2509
  /**
1572
2510
  * N017 F8 流转引擎(新语义状态机,见技术方案 §2.2):
1573
2511
  *
@@ -1605,6 +2543,16 @@ declare function advanceTask(deps: AdvanceDeps, taskId: string, input?: AdvanceI
1605
2543
  declare function approveTask(deps: AdvanceDeps, taskId: string, request: ApproveRequest): Promise<ApproveResponse>;
1606
2544
  declare function pauseTask(deps: AdvanceDeps, taskId: string, reason?: string): Promise<Task>;
1607
2545
  declare function resumeTask(deps: AdvanceDeps, taskId: string, decision?: string): Promise<Task>;
2546
+ /**
2547
+ * T202608290001 任务取消:active/paused(含暂停点等待态)→ cancelled 终态(不可逆,无撤销)。
2548
+ *
2549
+ * - 既有记录(doc/nodeRecords/archNotes/dagInstance)原样冻结保留,零删除零补写;
2550
+ * - pausedAt 清 null(终态只读,残留暂停锚点无消费方但易误导);
2551
+ * - 取消后只读性由既有守卫天然构成:advance(非 active 拒绝)/ approve(非暂停点拒绝)/
2552
+ * pause(非 active 拒绝)/ resume(非手动暂停拒绝)/ 记录写端点(TASK_TERMINATED);
2553
+ * - 终态重复取消 → 400 TASK_TERMINATED(复用既有码:completed/cancelled 同语义)。
2554
+ */
2555
+ declare function cancelTask(deps: AdvanceDeps, taskId: string, reason?: string): Promise<Task>;
1608
2556
  /**
1609
2557
  * @internal 供单测直接验证的模块私有 helper(非公共 API)
1610
2558
  * N017:findNextNode → findNextEdge——返回边对象(调用方需要 pausePoint)
@@ -1665,6 +2613,8 @@ declare function pruneInstance(template: DagTemplate, taskTrack: string, skipNod
1665
2613
  * T202608240003:任务轨道 → 实例节点 track 匹配集。
1666
2614
  * 独立单源模块——prune(剪枝轨道剔除 + 引擎路径可达性校验)与 advance-engine
1667
2615
  * (流转路由 + 终止判定)消费同一语义,防止剪枝与路由口径漂移。
2616
+ * T202608280004:web dag-editor validate 规则 4 持有本函数的本地镜像副本——
2617
+ * 本函数语义演进须同步该副本。
1668
2618
  */
1669
2619
  /**
1670
2620
  * - backend/ui/research:匹配本轨道节点 + 'all' 哨兵
@@ -1690,7 +2640,52 @@ declare function generateEntryId(existing: readonly string[]): string;
1690
2640
  */
1691
2641
  declare function renderPrompt(template: string, task: Task): string;
1692
2642
 
2643
+ /** 模板导入/导出编排依赖(repo 显式注入,无 DI 框架) */
2644
+ interface TemplateTransferDeps {
2645
+ templateRepo: DagTemplateRepo;
2646
+ skillRepo: SkillRepo;
2647
+ agentRepo: AgentRepo;
2648
+ modelAliasRepo: ModelAliasRepo;
2649
+ }
2650
+ /**
2651
+ * 导出依赖闭包推导(T202608300002 §2.2,PRD 3.1 规则 1-4,一跳封闭):
2652
+ * 1. SKILL 直接引用集 = 模板所有节点 skills 字段(去重)
2653
+ * 2. AGENT 集 = boundSkills 与直接引用集有交集的 agent(查询范围:global 全集 + 源项目 project 全集)
2654
+ * 3. SKILL 全集 = 直接引用 ∪ 被导出 AGENT 的 boundSkills(一跳封闭——新增 SKILL 不反查更多 AGENT)
2655
+ * 4. 模型映射集 = 被导出 AGENT 的 model code 对应别名
2656
+ *
2657
+ * 启停矩阵(统一含停用——备份完整性):agent/skill 收集查询显式含停用;
2658
+ * 停用模板可导出(与详情页 by-id 可见策略一致)。源环境悬空引用记入 warnings 不阻断。
2659
+ */
2660
+ declare function composeExportBundle(deps: TemplateTransferDeps, templateId: string): Promise<ExportBundle>;
2661
+
2662
+ /**
2663
+ * 项目内默认模板存在性(含停用——启停与默认无联动,排除停用会在「默认模板恰为停用态」时误判双默认)。
2664
+ * 不排除同名自身:D9-b 裁定「查项目内任何默认(含自身同名)」——F17/PRD 验收 19 字面语义
2665
+ * 「无论是否同名覆盖 → 降 false」,自指极端场景(默认位空缺)已登记 PRD 开放问题,由管理台重新指定。
2666
+ */
2667
+ declare function hasProjectDefault(deps: TemplateTransferDeps, targetProjectId: string): Promise<boolean>;
2668
+ /** 模板同名定位(含停用) */
2669
+ declare function findTemplateByName(deps: TemplateTransferDeps, targetProjectId: string, name: string): Promise<{
2670
+ id: string;
2671
+ version: string;
2672
+ } | null>;
2673
+ declare function buildImportPlan(deps: TemplateTransferDeps, targetProjectId: string, bundle: ExportBundle): Promise<ImportPlanResponse>;
2674
+
2675
+ /**
2676
+ * 导入执行(T202608300002 §2.5)。
2677
+ *
2678
+ * 模板写 = 单文档操作天然原子(同名覆盖 findOneAndUpdate / 新建 insertOne,无多步中间态,
2679
+ * PRD F7 失败不变性由此满足——repo 层无 session 贯通,不引入真事务)。
2680
+ * 依赖写逐条独立(顺序:重映射 → 写前自证校验 → 写库),任一失败不阻断其余,进结果清单。
2681
+ *
2682
+ * 写前自证校验(repo 直写不经路由 zValidator,校验责任内聚编排层):
2683
+ * scope=project 的 payload 先补 projectId=targetProjectId 再 safeParse——CreateSchema 的
2684
+ * superRefine 要求 scope=project ⇒ projectId 必填,先 parse 后补必失败。
2685
+ */
2686
+ declare function applyImport(deps: TemplateTransferDeps, targetProjectId: string, bundle: ExportBundle, decisions: ImportDecision[]): Promise<ImportApplyResponse>;
2687
+
1693
2688
  declare const VERSION: string;
1694
2689
  declare function ping(): string;
1695
2690
 
1696
- export { ARTIFACT_TYPES, type AdvanceDeps, type AdvanceInput, type AdvanceRequest, AdvanceRequestSchema, type AdvanceResponse, AdvanceResponseSchema, type Agent, type AgentCopy, AgentCopySchema, type AgentCreate, AgentCreateSchema, type AgentRepo, AgentSchema, type AgentScope, AgentScopeSchema, type AgentUpdate, AgentUpdateSchema, AppError, type AppErrorOptions, type ApproveRequest, ApproveRequestSchema, type ApproveResponse, ApproveResponseSchema, type ArchNote, ArchNoteSchema, type Artifact, ArtifactSchema, type ArtifactType, BIZ_CODE_MESSAGES, BadRequestError, type BizCode, type CheckItem, CheckItemSchema, type Confirmation, ConfirmationSchema, ConflictError, DAG_PHASES, DAG_TRACKS, DEFAULT_PROJECT_KEY, type DagEdge, DagEdgeSchema, type DagInstance, DagInstanceSchema, type DagNode, DagNodePhaseSchema, DagNodeSchema, DagNodeTrackSchema, type DagTemplate, type DagTemplateCopy, DagTemplateCopySchema, type DagTemplateCreate, DagTemplateCreateSchema, type DagTemplateRepo, DagTemplateSchema, type DagTemplateUpdate, DagTemplateUpdateSchema, type Decision, DecisionSchema, ENTRY_ID_REGEX, type EdgePausePoint, EdgePausePointBaseSchema, EdgePausePointSchema, type EnumEntry, EnumEntrySchema, type EnumRegistry, type EnumRegistryCategory, EnumRegistryCategorySchema, type EnumRegistryRepo, EnumRegistrySchema, type EnumRegistryUpdate, EnumRegistryUpdateSchema, HistoryActionSchema, type HistoryEntry, HistoryEntrySchema, type ModelAlias, type ModelAliasCreate, ModelAliasCreateSchema, type ModelAliasRepo, ModelAliasSchema, ModelAliasShapeSchema, type ModelAliasUpdate, ModelAliasUpdateSchema, type ModelAliasWithRefCount, ModelAliasWithRefCountSchema, NODE_ID_PATTERN, NODE_STATUSES, type NodeInfo, NodeInfoSchema, type NodeRecord, NodeRecordSchema, type NodeState, NodeStateSchema, NodeStatusSchema, NotFoundError, OBJECT_ID_HEX, type OmitId, PAUSE_POINT_TYPES, PausePointTypeSchema, type PauseRequest, PauseRequestSchema, type Project, type ProjectCreate, ProjectCreateSchema, type ProjectRepo, ProjectSchema, type ProjectStatus, ProjectStatusSchema, type ProjectUpdate, ProjectUpdateSchema, type PruneResult, type Repo, type ResumeRequest, ResumeRequestSchema, type ReviewSummary, ReviewSummarySchema, SIMING_CODE_REGEX, SIMING_CONFIG_ENV_KEYS, SIMING_CONFIG_KEYS, type SimingClient, type SimingConfig, type SimingConfigKey, SimingConfigSchema, SimingLogLevelSchema, type Skill, type SkillCopy, SkillCopySchema, type SkillCreate, SkillCreateSchema, type SkillRepo, SkillSchema, type SkillScope, SkillScopeSchema, type SkillUpdate, SkillUpdateSchema, TASK_PHASES, TASK_STATUSES, TASK_TYPES, type Task, type TaskContext, TaskContextSchema, type TaskCreateInput, TaskCreateInputSchema, type TaskDocContent, TaskDocContentSchema, type TaskPatch, TaskPhaseSchema, type TaskPublic, TaskPublicSchema, type TaskRepo, TaskSchema, TaskStatusSchema, type TaskSummary, TaskSummarySchema, type TaskType, VERSION, ValidationError, type WithId, advanceTask, approveTask, assertBoundSkillsCompatible, assertModelAliasExists, checkTermination, createAgentRepo, createDagTemplateRepo, createEnumRegistryRepo, createModelAliasRepo, createMongoClient, createProjectRepo, createRepo, createSkillRepo, createTaskRepo, findNextEdge, generateEntryId, generateProjectKey, mkHistory, pauseTask, ping, pruneInstance, renderPrompt, resumeTask, toNodeInfo, toTaskPublic, trackMatchSet, withTransaction };
2691
+ export { AGENT_MAIN_DOC, ARTIFACT_TYPES, 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, BIZ_CODE_MESSAGES, BadRequestError, type BizCode, CONTEXT_VIEWS, type CancelRequest, CancelRequestSchema, type CheckItem, CheckItemSchema, type Confirmation, ConfirmationSchema, ConflictError, type ContextView, ContextViewSchema, type CreateTaskResponse, CreateTaskResponseSchema, DAG_PHASES, DAG_TRACKS, DEFAULT_PROJECT_KEY, type DagEdge, DagEdgeSchema, type DagInstance, 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, HistoryActionSchema, type HistoryEntry, HistoryEntrySchema, type ImportApplyRequest, ImportApplyRequestSchema, type ImportApplyResponse, ImportApplyResponseSchema, type ImportDecision, ImportDecisionSchema, type ImportPlanRequest, ImportPlanRequestSchema, type ImportPlanResponse, ImportPlanResponseSchema, type ModelAlias, type ModelAliasCreate, ModelAliasCreateSchema, type ModelAliasPayload, ModelAliasPayloadSchema, type ModelAliasRepo, ModelAliasSchema, ModelAliasShapeSchema, type ModelAliasUpdate, ModelAliasUpdateSchema, type ModelAliasWithRefCount, ModelAliasWithRefCountSchema, NODE_ID_PATTERN, NODE_STATUSES, type NodeInfo, NodeInfoSchema, type NodeRecord, NodeRecordSchema, type NodeState, NodeStateSchema, NodeStatusSchema, NotFoundError, OBJECT_ID_HEX, type OmitId, PAUSE_POINT_TYPES, 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 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, TASK_PHASES, TASK_STATUSES, TASK_TYPES, type Task, type TaskContext, TaskContextSchema, type TaskCreateInput, TaskCreateInputSchema, type TaskDocContent, TaskDocContentSchema, type TaskPatch, TaskPhaseSchema, type TaskProgress, type TaskProgressPublic, TaskProgressPublicSchema, TaskProgressSchema, type TaskPublic, TaskPublicSchema, type TaskRepo, TaskSchema, TaskStatusSchema, type TaskSummary, TaskSummarySchema, type TaskType, type TemplatePayload, TemplatePayloadSchema, type TemplateTransferDeps, VERSION, ValidationError, WRITE_ACK_ENTRY_KINDS, type WithId, type WriteAck, type WriteAckEntryKind, WriteAckEntryKindSchema, WriteAckSchema, advanceTask, applyImport, approveTask, assertBoundSkillsCompatible, assertModelAliasExists, assertReferenceAggregateLimit, assertReferencesDeletable, buildImportPlan, bumpPatch, bumpPatchOrPassthrough, cancelTask, canonicalizeReferencePath, checkTermination, composeExportBundle, createAgentRepo, createDagTemplateRepo, createEnumRegistryRepo, createModelAliasRepo, createMongoClient, createProjectRepo, createReferencesSchema, createRepo, createSkillRepo, createTaskRepo, decisionKey, enabledNeFalse, escapeRegExpLiteral, excerpt, findNextEdge, findTemplateByName, generateEntryId, generateProjectKey, hasProjectDefault, mkHistory, pauseTask, ping, pruneInstance, renderPrompt, resumeTask, sumReferenceContentChars, taskProgress, toNodeInfo, toTaskPublic, trackMatchSet, withTransaction };