aitable-workflow-core 0.1.28 → 0.1.29-beta.1790736949347

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.
package/dist/index.d.ts CHANGED
@@ -767,6 +767,15 @@ type TableToolkit = {
767
767
  recordId: string;
768
768
  fields: Record<string, unknown>;
769
769
  }>>;
770
+ /**
771
+ * 列出指定表的全部记录(无过滤,默认上限 200 行)。
772
+ * 面向跨表的**小型配置表**读取场景(如模块配置表):表内容即白名单,
773
+ * 调用方不应再在代码里硬编码候选值——那会让"表可自由维护"的承诺失效。
774
+ */
775
+ listRecordsIn(target: TableRef, limit?: number): Promise<Array<{
776
+ recordId: string;
777
+ fields: Record<string, unknown>;
778
+ }>>;
770
779
  /** 在指定表中按唯一键查询单条记录(未命中返回 null) */
771
780
  findRecordIn(target: TableRef, uniqueBy: string, uniqueValue: unknown): Promise<{
772
781
  recordId: string;
@@ -819,7 +828,7 @@ type CodingToolkit = {
819
828
  type CodingRunOptions = {
820
829
  /** 覆盖使用的 Agent 类型 */
821
830
  agent?: string;
822
- /** 工作目录 */
831
+ /** 项目相对工作目录;由 coding toolkit 在本机执行前解析。 */
823
832
  workDir?: string;
824
833
  /** 续接同一 Agent 与工作目录此前创建的会话 */
825
834
  sessionId?: string;
@@ -1163,7 +1172,7 @@ type GitToolkit = {
1163
1172
  /** 推送分支到远程 */
1164
1173
  push(repoDir: string, branch?: string): Promise<void>;
1165
1174
  /** 暂存(add -A)并提交工作区改动;无改动则跳过(committed=false)。用于把编程 Agent 写入工作区的改动落成提交 */
1166
- commit(repoDir: string, message: string): Promise<{
1175
+ commit(repoDir: string, message: string, options?: GitCommitOptions): Promise<{
1167
1176
  committed: boolean;
1168
1177
  }>;
1169
1178
  /** 获取 diff 摘要 */
@@ -1176,21 +1185,40 @@ type GitToolkit = {
1176
1185
  changed: boolean;
1177
1186
  files: string[];
1178
1187
  }>;
1188
+ /** 拉取指定远端分支并将干净的 worktree 更新到该分支最新提交。 */
1189
+ syncWorktree(repository: string | GitRepositoryDefinition, itemId: string, branch: string): Promise<void>;
1179
1190
  /**
1180
1191
  * 确保工单在指定仓库上有一个 worktree(基础库只 clone 一次,已存在则 fetch 复用)。
1181
1192
  * 幂等:worktree 已存在则直接复用。返回该仓库 worktree 目录及多库共享父目录。
1182
1193
  */
1183
- ensureWorktree(repoUrl: string, itemId: string, branch: string, options?: {
1184
- baseRef?: string;
1185
- depth?: number;
1186
- }): Promise<WorktreeResult>;
1194
+ ensureWorktree(repository: string | GitRepositoryDefinition, itemId: string, branch: string, options?: EnsureWorktreeOptions): Promise<WorktreeResult>;
1187
1195
  /** 清理某工单在某仓库的 worktree(best-effort,失败不抛) */
1188
1196
  removeWorktree(repoUrl: string, itemId: string): Promise<void>;
1189
1197
  };
1198
+ /** profile 的仓库声明;YAML anchor 展开后由各 recipe 作为完整结构传给 Git toolkit。 */
1199
+ type GitRepositoryDefinition = {
1200
+ url: string;
1201
+ default_branch?: string;
1202
+ commands?: GitRepositoryCommand[];
1203
+ };
1204
+ /** 初始化命令必须以 bin + args 表达,禁止 shell 字符串以保持跨平台边界。 */
1205
+ type GitRepositoryCommand = {
1206
+ bin: string;
1207
+ args: string[];
1208
+ timeout_ms?: number;
1209
+ };
1210
+ type EnsureWorktreeOptions = {
1211
+ baseRef?: string;
1212
+ depth?: number;
1213
+ };
1214
+ type GitCommitOptions = {
1215
+ /** 仅测试模式允许跳过仓库 hook;默认执行所有 hook。 */
1216
+ noVerify?: boolean;
1217
+ };
1190
1218
  type WorktreeResult = {
1191
- /** 该仓库的 worktree 目录: <root>/worktrees/<itemId>/<repoKey> */
1219
+ /** 项目相对 worktree 路径;可直接传给其他 toolkit 方法。 */
1192
1220
  dir: string;
1193
- /** 多库共享父目录: <root>/worktrees/<itemId>(用作 coding.run 的 workDir) */
1221
+ /** 项目相对的多库共享父目录(用作 coding.run 的 workDir)。 */
1194
1222
  workspaceDir: string;
1195
1223
  /** worktree 所在分支 */
1196
1224
  branch: string;
@@ -1844,6 +1872,7 @@ declare const agentSchema: z.ZodObject<{
1844
1872
  timeout_ms: z.ZodDefault<z.ZodNumber>;
1845
1873
  max_step_failures: z.ZodDefault<z.ZodNumber>;
1846
1874
  auto_advance: z.ZodDefault<z.ZodBoolean>;
1875
+ allow_ask: z.ZodDefault<z.ZodBoolean>;
1847
1876
  retry: z.ZodOptional<z.ZodObject<{
1848
1877
  max_attempts: z.ZodDefault<z.ZodNumber>;
1849
1878
  base_backoff_ms: z.ZodDefault<z.ZodNumber>;
@@ -2062,6 +2091,7 @@ declare const configSchema: z.ZodObject<{
2062
2091
  timeout_ms: z.ZodDefault<z.ZodNumber>;
2063
2092
  max_step_failures: z.ZodDefault<z.ZodNumber>;
2064
2093
  auto_advance: z.ZodDefault<z.ZodBoolean>;
2094
+ allow_ask: z.ZodDefault<z.ZodBoolean>;
2065
2095
  retry: z.ZodOptional<z.ZodObject<{
2066
2096
  max_attempts: z.ZodDefault<z.ZodNumber>;
2067
2097
  base_backoff_ms: z.ZodDefault<z.ZodNumber>;
@@ -2601,6 +2631,86 @@ interface Tracker {
2601
2631
  /** 等待指定工单(或全部)的异步旁路写入落盘(可选实现) */
2602
2632
  flush?(itemId?: string): Promise<void>;
2603
2633
  }
2634
+ declare class AITableTracker implements Tracker {
2635
+ private readonly config;
2636
+ private readonly fields;
2637
+ private readonly dws;
2638
+ private readonly appendLocks;
2639
+ /** event_log 内存快照:避免每次 appendEvent 都「先读后写」(根因 3) */
2640
+ private readonly eventLogCache;
2641
+ /** 字段名 → 字段ID(写入时翻译) */
2642
+ private nameToId;
2643
+ /** 字段ID → 字段名(读取时翻译) */
2644
+ private idToName;
2645
+ /** 字段名 → MCP 字段类型(供 normalize 使用) */
2646
+ private nameToType;
2647
+ private initialized;
2648
+ /** 本机智能体身份;undefined = 不做认领过滤,捞所有候选行(引入身份前的行为) */
2649
+ private readonly identity?;
2650
+ constructor(config: TrackerConfig, dws?: DwsClient, identity?: IdentityConfig);
2651
+ /** 认领列字段名(复用既有的 `tracker.fields.owner` 槽位,不新增字段映射键) */
2652
+ private get claimField();
2653
+ /**
2654
+ * 初始化字段映射 — 从 AI 表格 schema 获取 fieldName ↔ fieldId 映射。
2655
+ * 必须在首次使用前调用。
2656
+ */
2657
+ init(): Promise<void>;
2658
+ /** 将 fieldId-keyed cells 转换为 fieldName-keyed cells */
2659
+ private translateCellsToNames;
2660
+ /** 将 fieldName-keyed cells 转换为 fieldId-keyed cells */
2661
+ private translateCellsToIds;
2662
+ /**
2663
+ * 递归翻译过滤条件里的字段引用 name→id。
2664
+ * AI 表格服务端按字段【名】过滤会走慢路径直接 TIMEOUT,必须用字段【ID】。
2665
+ * - 逻辑节点(and/or/not):operands 是嵌套过滤条件 → 递归。
2666
+ * - 比较节点(eq/neq/...):operands[0] 是字段引用(字符串) → name→id,值(operands[1..]) 原样保留。
2667
+ * 已是字段 ID 或未知名的引用会原样透传(nameToId 命中不到则回退)。
2668
+ */
2669
+ private translateFilterFieldNames;
2670
+ fetchCandidateItems(): Promise<WorkItem[]>;
2671
+ /**
2672
+ * 认领过滤(identity.agent_id)—— 入水的最后一道闸,多智能体共表时只放行指派给本机的行。
2673
+ *
2674
+ * 为什么在内存里筛而不是一条 `--filters` 下推:AI 表格 OpenAPI 的过滤条件是**扁平单层**,
2675
+ * 逻辑节点里再套逻辑节点会被服务端直接拒(`INVALID_FILTER_OPERATOR: 'or'`,实测)。
2676
+ * 而「(状态 ∈ initial∪active) ∧ (认领列 = 我)」恰好需要 or 嵌在 and 里,下推只能拆成
2677
+ * 每个状态一次往返(每次约 1.5s 固定开销),比现状慢且没有正确性收益。
2678
+ * 这里沿用已有的那条 or 状态查询,只把认领判定放在客户端做。
2679
+ */
2680
+ private applyClaimFilter;
2681
+ fetchItemsByIds(ids: string[]): Promise<WorkItem[]>;
2682
+ fetchItemsByStates(states: string[]): Promise<WorkItem[]>;
2683
+ /**
2684
+ * 按「字段名 = 值」等值条件查当前表,返回带 `id`(即 recordId)的 WorkItem。
2685
+ *
2686
+ * 存在的理由:上层此前只能靠 `fetchAllItems()` 拉全表再在内存里筛,而 `fetchAllItems`
2687
+ * 本身还额外按 state 白名单过滤——于是「按业务字段找那一行」既慢,又会漏掉状态不在
2688
+ * 白名单里的行。这里直接把等值条件下推给 dws(字段名→fieldId 的翻译由
2689
+ * translateFilterFieldNames 处理)。
2690
+ *
2691
+ * 空条件返回空数组而不是全表:要全表请显式调 fetchAllItems()。若这里回落成全表,
2692
+ * 一个拼错字段名的过滤条件就会静默变成「匹配所有行」,而调用方通常紧接着拿 [0] 去写
2693
+ * —— 那是写错行的数据污染,比返回空更难发现。
2694
+ */
2695
+ fetchItemsByFilter(filter: Record<string, unknown>, limit?: number): Promise<WorkItem[]>;
2696
+ fetchAllItems(): Promise<WorkItem[]>;
2697
+ updateState(itemId: string, state: string): Promise<void>;
2698
+ updateCurrentStep(itemId: string, stepId: string): Promise<void>;
2699
+ updateFields(itemId: string, fields: Record<string, unknown>): Promise<void>;
2700
+ /**
2701
+ * 把结构化 checkpoint 压成一组 cells,合并为一次 `aitable record update`。
2702
+ * 状态字段 / 当前步骤字段以显式 state/currentStep 为准,避免 recipe output 覆盖流程控制字段。
2703
+ */
2704
+ updateCheckpoint(itemId: string, checkpoint: TrackerCheckpoint): Promise<void>;
2705
+ appendEvent(itemId: string, event: string): Promise<void>;
2706
+ /** 等待异步旁路写入落盘(关键检查点:终态/人工等待/处理结束前) */
2707
+ flush(itemId?: string): Promise<void>;
2708
+ private doAppendEvent;
2709
+ private updateRecord;
2710
+ private queryRecords;
2711
+ private recordToWorkItem;
2712
+ private fillSubmitterFromMetadata;
2713
+ }
2604
2714
 
2605
2715
  /**
2606
2716
  * aitable-workflow — ToolkitDescriptor
@@ -4254,6 +4364,10 @@ declare function activateGlobalDwsOnPath(options?: GlobalDwsActivationOptions):
4254
4364
  * 入口 + 相对 .js→.ts。tsx 不可用时静默跳过,回退原生 import。幂等,仅注册一次。
4255
4365
  */
4256
4366
  declare function ensureTsxRegistered(): Promise<void>;
4367
+ interface EnsureRecipeModuleFormatOptions {
4368
+ /** 是否允许写盘补 ESM 标记。静态校验/诊断路径应传 false,避免污染源码树。 */
4369
+ allowWrite?: boolean;
4370
+ }
4257
4371
  /**
4258
4372
  * 确保 .ts recipe 所在目录被 Node / tsx 判定为 ES 模块。
4259
4373
  *
@@ -4266,8 +4380,10 @@ declare function ensureTsxRegistered(): Promise<void>;
4266
4380
  * 修复:在 recipe 目录补一个 `{ "type": "module" }` 的 package.json,让格式判定为 ESM。
4267
4381
  * 幂等且保守:目录已有 package.json 时**不覆盖**(尊重模板/调用方自带配置);
4268
4382
  * 只读目录等写入失败时静默跳过,交由 import() 自身报错诊断。
4383
+ *
4384
+ * @param allowWrite 为 false 时只判定不写盘,用于 validate/inspect/sync 等静态校验路径。
4269
4385
  */
4270
- declare function ensureRecipeModuleFormat(recipePath: string): void;
4386
+ declare function ensureRecipeModuleFormat(recipePath: string, options?: EnsureRecipeModuleFormatOptions): void;
4271
4387
 
4272
4388
  /**
4273
4389
  * module-url — 把本地绝对路径转成动态 import 可用的 file:// URL。
@@ -4309,6 +4425,10 @@ type SafeFilenameOptions = {
4309
4425
  fallback?: string;
4310
4426
  maxLength?: number;
4311
4427
  };
4428
+ type ProjectRelativePathOptions = {
4429
+ /** 是否允许 `.` 表示项目根;默认允许。 */
4430
+ allowRoot?: boolean;
4431
+ };
4312
4432
  type PathBoundaryReason = "INVALID_ROOT" | "INVALID_RELATIVE_PATH" | "ABSOLUTE_PATH" | "OUTSIDE_ROOT" | "ROOT_NOT_ALLOWED" | "INVALID_PORTABLE_ID";
4313
4433
  /** 路径越界或路径形态不可移植。 */
4314
4434
  declare class PathBoundaryError extends Error {
@@ -4324,6 +4444,13 @@ declare class PathBoundaryError extends Error {
4324
4444
  * 对 root/target 做 realpath 校验。
4325
4445
  */
4326
4446
  declare function resolveInsideRoot(root: string, relativePath: string, options?: ResolveInsideRootOptions): string;
4447
+ /**
4448
+ * 校验并规范化项目内路径。与 manifest 路径不同,项目根 `.` 是合法值;任意 `..`
4449
+ * 段、跨平台绝对路径和 NUL 都拒绝,确保配置可在 local 与 relay 执行端复用。
4450
+ */
4451
+ declare function toProjectRelativePath(relativePath: string, options?: ProjectRelativePathOptions): string;
4452
+ /** 解析项目相对路径为当前执行机上的绝对路径。 */
4453
+ declare function resolveProjectPath(projectRoot: string, relativePath: string, options?: ProjectRelativePathOptions & Pick<ResolveInsideRootOptions, "flavor">): string;
4327
4454
  /**
4328
4455
  * 校验业务 ID 可安全、原样地作为任意支持系统上的单个文件名段使用。
4329
4456
  * 身份值不做静默改写,避免磁盘路径与业务主键发生不可见偏差。
@@ -4725,6 +4852,12 @@ type ConfigCheckResult = {
4725
4852
  type CheckOptions = {
4726
4853
  configPath: string;
4727
4854
  workflowId?: string;
4855
+ /**
4856
+ * 显式指定执行节点上已探测到的 coding agent runtimes(如 ["qoder", "claudecode"])。
4857
+ * 传入后 coding_agent 模块不再检测「本机」,而是按该列表判定,文案也对应显示为「执行节点」。
4858
+ * relay/app 形态下由服务端把已绑定的执行节点 runtimes 传入。
4859
+ */
4860
+ executionRuntimes?: string[];
4728
4861
  };
4729
4862
  declare function runCheck(options: CheckOptions): Promise<ConfigCheckResult>;
4730
4863
 
@@ -4835,6 +4968,14 @@ declare function loadProfileConfig(configDir: string, envSource?: Record<string,
4835
4968
  }): ProfileConfig | null;
4836
4969
  /** 重置缓存(测试用) */
4837
4970
  declare function resetProfileCache(): void;
4971
+ /**
4972
+ * 只清指定 configDir 的 profile 缓存(lenient/strict 两个键都清)。
4973
+ * 供长活进程(gateway/server run session)的装配入口调用:profile-loader 是进程级
4974
+ * 缓存,而热更 watcher 仅在 app.start() 内启动且不递归监听 profile/ 子目录——
4975
+ * 若不强制刷新,改过 profile 后重开的 run session 会命中上一 session 的旧缓存
4976
+ * (P5 实测:PATCH /files 换仓库 URL 后 attempt 3 仍下发旧 stepConfig)。
4977
+ */
4978
+ declare function resetProfileCacheForConfigDir(configDir: string): void;
4838
4979
  /**
4839
4980
  * 将 profile.workflows 配置注入到内存中的 WorkflowTemplate。
4840
4981
  * 锚点(wfId/stepId/事件源 name)找不到 → 抛错拒跑。
@@ -5593,12 +5734,8 @@ interface CredentialEntry {
5593
5734
  name: string;
5594
5735
  /** Gateway / 平台地址。 */
5595
5736
  serverUrl: string;
5596
- /** owner-token 或 API Key(明文存储,文件权限 600 保护)。 */
5737
+ /** 对应一个执行引擎的 machine token(明文存储,文件权限 600 保护)。 */
5597
5738
  token: string;
5598
- /** machine/bootstrap key(与 token 二选一;owner-token 模式下留空)。 */
5599
- key?: string;
5600
- /** 稳定机器身份(首次 connect 后由服务端分配并回填)。 */
5601
- machineId?: string;
5602
5739
  /** 工作区根目录(可选,relay 启动时使用)。 */
5603
5740
  workspaceRoot?: string;
5604
5741
  /** 创建时间 ISO8601。 */
@@ -6548,6 +6685,170 @@ type FieldInfo = {
6548
6685
  */
6549
6686
  declare function fetchFields(dws: DwsClient, baseId: string, tableId: string): Promise<FieldInfo[]>;
6550
6687
 
6688
+ /**
6689
+ * aitable-workflow — DeferredTracker(惰性建行装饰器)
6690
+ *
6691
+ * 包装真实 Tracker,按 itemId 多路复用:
6692
+ * - 真实 recordId → 所有方法原样透传(现状行为不变)。
6693
+ * - 瞬态 id(beginTransient 分配)→ 内存缓冲读写;finalize 时按裁决 materialize(建行)或 discard。
6694
+ *
6695
+ * StepEngine/RecipeExecutor/Toolkit 无感知,因为 Tracker 全部方法都以 itemId 为参数。
6696
+ */
6697
+
6698
+ type TrackerFields = {
6699
+ state: string;
6700
+ title: string;
6701
+ current_step?: string;
6702
+ event_log?: string;
6703
+ };
6704
+ declare class DeferredTracker implements Tracker {
6705
+ private readonly inner;
6706
+ private readonly fields;
6707
+ private readonly buffers;
6708
+ constructor(inner: Tracker, fields: TrackerFields);
6709
+ updateCheckpoint?: (itemId: string, checkpoint: TrackerCheckpoint) => Promise<void>;
6710
+ flush?: (itemId?: string) => Promise<void>;
6711
+ /** 开启一个瞬态运行,返回瞬态 itemId(不落库);seed 为初始字段(字段名 keyed) */
6712
+ beginTransient(seedFields: Record<string, unknown>): string;
6713
+ /** 结束瞬态运行:materialize → 用缓冲最终字段建行;否则丢弃 */
6714
+ finalize(transientId: string, opts: {
6715
+ materialize: boolean;
6716
+ }): Promise<void>;
6717
+ fetchItemsByIds(ids: string[]): Promise<WorkItem[]>;
6718
+ fetchCandidateItems(): Promise<WorkItem[]>;
6719
+ fetchItemsByStates(states: string[]): Promise<WorkItem[]>;
6720
+ fetchAllItems(): Promise<WorkItem[]>;
6721
+ fetchItemsByFilter(filter: Record<string, unknown>, limit?: number): Promise<WorkItem[]>;
6722
+ updateState(itemId: string, state: string): Promise<void>;
6723
+ updateCurrentStep(itemId: string, stepId: string): Promise<void>;
6724
+ updateFields(itemId: string, fields: Record<string, unknown>): Promise<void>;
6725
+ appendEvent(itemId: string, event: string): Promise<void>;
6726
+ private applyCheckpoint;
6727
+ private bufferToItem;
6728
+ }
6729
+
6730
+ /**
6731
+ * aitable-workflow — Table Toolkit
6732
+ *
6733
+ * 提供 AI 表格操作能力,封装 Tracker 接口为 Recipe 可用的工具。
6734
+ * Phase 1: 读/查当前表 + 更新当前行
6735
+ * Phase 2: 多表写入(createRecordIn / createRecordsIn / upsertRecordIn)
6736
+ */
6737
+
6738
+ /**
6739
+ * 创建 Table Toolkit 实例。
6740
+ *
6741
+ * @param tracker 当前 workflow 的 tracker(操作当前表)
6742
+ * @param item 当前工单
6743
+ * @param dws DwsClient 实例(多表写入用;不传则多表方法抛错)
6744
+ * @param baseId 当前 tracker 表所在 base ID(附件上传用;不传则 uploadAttachment 抛错)
6745
+ */
6746
+ declare function createTableToolkit(tracker: Tracker, item: WorkItem, dws?: DwsClient, baseId?: string): TableToolkit;
6747
+
6748
+ /**
6749
+ * aitable-workflow — coding agent 运行时上下文组装(内置注入)
6750
+ *
6751
+ * 调用 coding agent 时应自动带上「运行时上下文」,而非由每个 recipe 自行拼接。
6752
+ * 当前组装两类上下文,后续可在此扩展(如 memory 更新、工具白名单说明等):
6753
+ * 1. 角色上下文(role):人设 / 技能 / 约束 / 输出规范 / 记忆;
6754
+ * 2. 知识库(KB, A 案):已编译 wiki 的索引块 + 3-hop 导航协议(含 KB 时还带 rootDir 供渐进读)。
6755
+ *
6756
+ * 产物 InjectedContext 由 coding toolkit(recipe 路径)与 executor(prompt 步骤路径)共用,
6757
+ * 保证两条路径注入一致、不分叉。
6758
+ */
6759
+
6760
+ interface InjectedContext {
6761
+ /** 前置到 coding prompt 的上下文块(角色 + KB 等) */
6762
+ promptBlock: string;
6763
+ /** 含可用 KB 时为 wiki 隐藏根目录,coding agent workDir 指向它以渐进读 */
6764
+ kbRootDir?: string;
6765
+ /** 是否含可用 KB(决定是否设 workDir / 开放渐进读工具) */
6766
+ kbActive: boolean;
6767
+ }
6768
+
6769
+ /**
6770
+ * aitable-workflow — Coding Agent Toolkit
6771
+ *
6772
+ * 将 coding-agents 适配层封装为 Recipe Toolkit 可用的接口。
6773
+ * 让 Recipe 可以调用编程 Agent 执行代码生成、文件创建、模板生成等任务。
6774
+ *
6775
+ * 设计思路:
6776
+ * - engine 为 "claude"/"qoder"/"codex" 时启用完整 Agent 能力
6777
+ * - engine 为 "llm_only" 时提供 graceful 降级(available() 返回 false)
6778
+ * - Recipe 内通过 ctx.toolkit.coding.run(...) 调用
6779
+ */
6780
+
6781
+ type CodingToolkitConfig = {
6782
+ engine: AgentEngine;
6783
+ /** coding-agents.config.json 路径(可选) */
6784
+ configPath?: string;
6785
+ /** 默认项目相对工作目录;设置 projectRoot 时在调用 Agent 前解析。 */
6786
+ workDir?: string;
6787
+ /** 项目根目录;公开的 cwd/workDir 使用相对路径,在调用 agent 前解析。 */
6788
+ projectRoot?: string;
6789
+ /** 默认模型 */
6790
+ model?: string;
6791
+ /** 从全局 agent.timeout_ms 注入的默认运行超时(毫秒)。 */
6792
+ timeoutMs?: number;
6793
+ /**
6794
+ * 预组装的运行时上下文(角色人设 + 知识库索引 + 未来 memory)。
6795
+ * present 时:coding.run 自动把上下文块前置到 prompt;含 KB 时 workDir 指向 wiki 根并开放渐进读工具。
6796
+ * 这是「调用 coding agent 自动带上上下文」的内置能力,recipe 无需手动拼接。
6797
+ */
6798
+ injected?: InjectedContext;
6799
+ /**
6800
+ * 底层执行函数,缺省 `runCodingAgent`(本机 spawn 路径)。
6801
+ * 注入点供单测与 daemon 复用:run:recipe 的 coding 面重建经 relay deps.runAgent
6802
+ * 注入 fake(与 RelayDaemon 的 `run:agent` 同一注入惯式),不真起子进程。
6803
+ */
6804
+ runAgent?: (prompt: string, options?: RunCodingAgentOptions) => Promise<RunResult>;
6805
+ };
6806
+ /** Resolve the default project-relative coding workspace; a recipe role beats config fallbacks. */
6807
+ declare function resolveCodingWorkspaceDir(roleId: string | undefined, fallbackDir?: string): string;
6808
+ /**
6809
+ * 创建 Coding Toolkit 实例
6810
+ */
6811
+ declare function createCodingToolkit(config: CodingToolkitConfig): CodingToolkit;
6812
+ /**
6813
+ * 创建一个不可用的 Coding Toolkit(llm_only 模式降级)
6814
+ */
6815
+ declare function createNullCodingToolkit(): CodingToolkit;
6816
+
6817
+ /**
6818
+ * aitable-workflow — Git Toolkit
6819
+ *
6820
+ * 封装 git CLI,提供 clone/branch/push/diff 能力。
6821
+ * 模式参考:messaging/dws-adapter.ts(CommandRunner 注入 + 双工厂函数)
6822
+ */
6823
+
6824
+ type GitConfig = {
6825
+ gitBin: string;
6826
+ timeoutMs: number;
6827
+ cloneDepth: number;
6828
+ /** 工作区根目录;设置 projectRoot 时按项目相对路径解析,否则视为绝对路径。 */
6829
+ workspaceRoot: string;
6830
+ /** 项目根目录;提供时,workspaceRoot 和 Git toolkit 的目录参数均使用项目相对路径。 */
6831
+ projectRoot?: string;
6832
+ /** worktree 基准分支回落值 */
6833
+ defaultBranch: string;
6834
+ runner?: CommandRunner;
6835
+ };
6836
+ declare function createGitToolkitFromConfig(config: GitConfig): GitToolkit;
6837
+
6838
+ /**
6839
+ * aitable-workflow — CodeReview Toolkit
6840
+ *
6841
+ * 封装 a1 repo mr CLI,提供 MR 创建/评审评论查询/合并就绪检查。
6842
+ * 模式参考:todo/dws-adapter.ts(CommandRunner 注入 + 双工厂函数 + JSON 解析)
6843
+ */
6844
+
6845
+ type CodeReviewConfig = {
6846
+ a1Bin: string;
6847
+ timeoutMs: number;
6848
+ runner?: CommandRunner;
6849
+ };
6850
+ declare function createCodeReviewToolkitFromConfig(config: CodeReviewConfig): CodeReviewToolkit;
6851
+
6551
6852
  /**
6552
6853
  * execution/relay-transport — Relay 执行器的最小传输接口
6553
6854
  *
@@ -6822,6 +7123,105 @@ declare function runWithDwsRunner<T>(runner: DwsRunner$1 | undefined, fn: () =>
6822
7123
  * 时返回 `undefined`(local 模式),此时 `DwsClient.runJson` 走本机 spawn,行为零变化。
6823
7124
  */
6824
7125
  declare function getCurrentDwsRunner(): DwsRunner$1 | undefined;
7126
+ /**
7127
+ * 单步 recipe runner 的可序列化数据请求(由 RecipeExecutor 组装;relay runner
7128
+ * 再映射为 `run:recipe` 帧):
7129
+ * - `recipePath`:相对项目根的 recipe 文件路径;
7130
+ * - `globalVars`:顶层 key 快照(store 不可序列化面全量物化,缺项 fail-fast 不静默);
7131
+ * - `trackerConfig`:生效 tracker 配置(daemon 侧 `toolkit.table` 重建输入);
7132
+ * - `stepConfig`:三层 merge + ref 解析后的终值。
7133
+ */
7134
+ type RecipeRunRequest = {
7135
+ stepId: string;
7136
+ recipeId: string;
7137
+ recipePath: string;
7138
+ itemId: string;
7139
+ input: Record<string, unknown>;
7140
+ variables: Record<string, unknown>;
7141
+ globalVars: Record<string, unknown>;
7142
+ stepConfig: Record<string, unknown>;
7143
+ trackerConfig: unknown;
7144
+ trackerRef: {
7145
+ baseId: string;
7146
+ tableId: string;
7147
+ };
7148
+ /**
7149
+ * coding 面生效配置快照(daemon 侧 `toolkit.coding` 重建输入)。
7150
+ * stepConfig 刻意只带业务参数(toolkit keys 被 resolveStepConfig 剥离),
7151
+ * coding 的三层 merge 结果必须走这个独立快照字段——同 trackerConfig 的先例。
7152
+ * llm_only / step 禁用 coding 时缺省,daemon 侧保持 RECIPE_SNAPSHOT_GAP。
7153
+ */
7154
+ codingConfig?: RecipeCodingConfig;
7155
+ /**
7156
+ * git 面生效配置快照(daemon 侧 `toolkit.git` 重建输入)。
7157
+ * 与服务端语义一致:git 默认装配 → **恒随帧**(值可为空对象);
7158
+ * 仅 step 显式 `git: false` 时缺省,daemon 侧保持 RECIPE_SNAPSHOT_GAP。
7159
+ */
7160
+ gitConfig?: RecipeGitConfig;
7161
+ /**
7162
+ * codeReview 面使能快照(daemon 侧 `toolkit.codeReview` 重建输入)。
7163
+ * a1 CLI 无服务端可调配置 → 与 gitConfig 同构地恒随帧;
7164
+ * 仅 step 显式 `codeReview: false` 时缺省,daemon 侧保持 RECIPE_SNAPSHOT_GAP。
7165
+ */
7166
+ codeReviewConfig?: RecipeCodeReviewConfig;
7167
+ timeoutMs: number;
7168
+ };
7169
+ /** coding 的有效配置快照;gateway 映射给 daemon 后由本地 toolkit 解析路径。 */
7170
+ type RecipeCodingConfig = {
7171
+ engine: string;
7172
+ model?: string;
7173
+ /** 项目相对配置目录 fallback;recipe role 默认 workspace 在执行端从 recipe.meta.role 推导。 */
7174
+ workspaceDir?: string;
7175
+ timeoutMs?: number;
7176
+ };
7177
+ /** git 的有效配置快照。 */
7178
+ type RecipeGitConfig = {
7179
+ /** 项目相对 git 工作区根。 */
7180
+ workspaceRoot?: string;
7181
+ defaultBranch?: string;
7182
+ cloneDepth?: number;
7183
+ };
7184
+ /** 存在即启用 codeReview toolkit。 */
7185
+ type RecipeCodeReviewConfig = Record<string, never>;
7186
+ /** RecipeResult 附加执行端收集的 globalVarWrites,由 runner 实现合并回运行进程。 */
7187
+ type RecipeRunResult = RecipeResult & {
7188
+ globalVarWrites?: Record<string, unknown>;
7189
+ };
7190
+ /**
7191
+ * RecipeRunner 是 recipe 执行入口。RecipeExecutor 准备一次运行请求并调用注入的
7192
+ * runner;此接口不约定实现使用进程内执行还是 relay 传输。
7193
+ */
7194
+ interface RecipeRunner {
7195
+ run(request: RecipeRunRequest, context: RecipeRunnerContext): Promise<RecipeRunResult>;
7196
+ }
7197
+ /** Runtime-only callbacks; intentionally separated from the serializable request DTO. */
7198
+ interface RecipeRunnerContext {
7199
+ executeLocal: () => Promise<RecipeRunResult>;
7200
+ /**
7201
+ * 现读当前行「执行引擎」字段的值并作为行级路由标识下发:空 = 未指定(回退项目绑定);
7202
+ * 非空字符串应为 machine id(UUID,非密钥,可安全落在协作文档中)。
7203
+ * machine token(`sk_machine_*`)属认证密钥,由 gateway 路由侧按前缀显式拒绝
7204
+ * (ENGINE_TOKEN_REJECTED)并指引改填 id;core 不做形态判定,原样透传。
7205
+ */
7206
+ resolveRowEngineId: () => Promise<string | undefined>;
7207
+ }
7208
+ /** 兼容旧导入名;迁移完成后删除。 */
7209
+ type RemoteRecipeRequest = RecipeRunRequest;
7210
+ type RemoteRecipeCodingConfig = RecipeCodingConfig;
7211
+ type RemoteRecipeGitConfig = RecipeGitConfig;
7212
+ type RemoteRecipeCodeReviewConfig = RecipeCodeReviewConfig;
7213
+ type RemoteRecipeResult = RecipeRunResult;
7214
+ type RecipeTransport = (request: RecipeRunRequest) => Promise<RecipeRunResult>;
7215
+ /**
7216
+ * 在给定 recipe runner 上下文中运行 fn。传 undefined 表示无 runner 覆盖,
7217
+ * RecipeExecutor 使用 core 本地执行路径。
7218
+ */
7219
+ declare function runWithRecipeRunner<T>(runner: RecipeRunner | undefined, fn: () => T): T;
7220
+ declare function getCurrentRecipeRunner(): RecipeRunner | undefined;
7221
+ /** @deprecated 使用 RecipeRunner / runWithRecipeRunner。 */
7222
+ declare function runWithRecipeTransport<T>(transport: RecipeTransport | undefined, fn: () => T): T;
7223
+ /** @deprecated 使用 getCurrentRecipeRunner。 */
7224
+ declare function getCurrentRecipeTransport(): RecipeTransport | undefined;
6825
7225
 
6826
7226
  /**
6827
7227
  * design/context — 上下文收集
@@ -8083,6 +8483,12 @@ interface EnsureBaseOptions {
8083
8483
  configPath: string;
8084
8484
  settings: Settings;
8085
8485
  onProgress?: (message: string, checkpoint?: string) => void | Promise<void>;
8486
+ /**
8487
+ * 新建 Base 时的名称兜底(仅在 `config.yml` 未声明 `base_name` 时生效)。
8488
+ * server / relay 交付形态下由调用方传入 `project.title`,避免 Base 露出裸项目 id
8489
+ * (如 `wf_5baba1aa`)——那串目录名对人不可读。优先级:`base_name` > 本参数 > 目录名。
8490
+ */
8491
+ baseName?: string;
8086
8492
  }
8087
8493
  /**
8088
8494
  * 确保 tracker.base_id 存在。解析链按权威度从高到低:
@@ -8095,6 +8501,57 @@ declare function ensureBaseExists(options: EnsureBaseOptions): Promise<{
8095
8501
  baseId: string;
8096
8502
  created: boolean;
8097
8503
  }>;
8504
+ /** 单个工作流的预加载信息(tracker 来源 + table_id 回写落点),供建表与自动化轮共用。 */
8505
+ type SetupWorkflowInfo = {
8506
+ entry: Settings["workflowEntries"][number];
8507
+ workflow: Awaited<ReturnType<typeof loadWorkflowTemplate>>;
8508
+ trackerConfig: NonNullable<Settings["tracker"]>;
8509
+ trackerFilePath: string;
8510
+ };
8511
+ /** 一张已建出的主表的结构化结果;server 据此生成 schema 摘要与 AI 表格链接。 */
8512
+ type SetupTableResult = {
8513
+ workflowId: string;
8514
+ label: string;
8515
+ baseId: string;
8516
+ tableId: string;
8517
+ warnings: string[];
8518
+ workflow: SetupWorkflowInfo["workflow"];
8519
+ perSettings: Settings;
8520
+ };
8521
+ type RunSetupTablesOptions = {
8522
+ /** 配置文件路径(目录或文件) */
8523
+ config: string;
8524
+ /** 逐行输出:CLI 传 `console.log` 保持原样,server 传静默或 trace 落日志。 */
8525
+ log?: (line: string) => void;
8526
+ /** 清理空白行(默认 true)。 */
8527
+ clean?: boolean;
8528
+ /** 与 `SetupOptions.only` 同义:`"automations"` 时不建 base/表,只把已有配置折成 perSettings。 */
8529
+ only?: "automations";
8530
+ /**
8531
+ * 新建 Base 时的名称兜底,透传给 `ensureBaseExists`。server/relay 传 `project.title`,
8532
+ * 使交付项目的 Base 显示人类可读标题而非裸目录名。`config.yml` 有 `base_name` 时仍以它为准。
8533
+ */
8534
+ baseName?: string;
8535
+ };
8536
+ type SetupTablesResult = {
8537
+ baseId: string;
8538
+ /** 本次建出的各工作流主表(`--only automations` 下为空)。 */
8539
+ tables: SetupTableResult[];
8540
+ settings: Settings;
8541
+ perSettingsMap: Map<string, Settings>;
8542
+ workflowInfos: SetupWorkflowInfo[];
8543
+ profileConfig: ReturnType<typeof loadProfileConfig>;
8544
+ profileFilePath: string;
8545
+ };
8546
+ /**
8547
+ * 确保 base 存在 + 逐个工作流建表(第一轮建表 → G6 归属校验 → 第二轮辅助表 → 第三轮字段/视图)。
8548
+ *
8549
+ * 从 `runSetupCommand` 抽出:CLI setup 与 server/web 搭建阶段共用这一份建表逻辑,
8550
+ * 避免 server 内联副本相对 CLI 缩水——历史上它只建 `workflowEntries[0]` 一张表,
8551
+ * 且漏做辅助表(`setupSurfaceTables`)与归属校验(`assertTableBelongsToBase`)。
8552
+ * 第四轮自动化与知识库编译仍留在 `runSetupCommand`(交互式 setup 刻意不做)。
8553
+ */
8554
+ declare function runSetupTables(options: RunSetupTablesOptions): Promise<SetupTablesResult>;
8098
8555
  /** setup 命令主流程:确保 base 存在 → 为每个工作流建表 + 初始化结构,最后编译一次知识库。 */
8099
8556
  declare function runSetupCommand(options: SetupOptions): Promise<void>;
8100
8557
 
@@ -8241,9 +8698,18 @@ type DefinitionLoadResult<T> = {
8241
8698
  /**
8242
8699
  * 从 recipeDir 动态加载单个 recipe 定义,并保留失败原因供 config/sync 展示。
8243
8700
  * .ts recipe 在 import 前主动注册 tsx,不能依赖调用方恰好通过 tsx 启动。
8244
- */
8245
- declare function loadRecipeDefinitionResult(recipeDir: string, recipeId: string): Promise<DefinitionLoadResult<RecipeDefinition>>;
8246
- declare function loadRecipeDefinition(recipeDir: string, recipeId: string): Promise<RecipeDefinition | null>;
8701
+ *
8702
+ * `cacheBust`:给 import URL 追加 query 使模块 key 唯一。长驻进程(relay daemon)
8703
+ * 里 Node ESM 按 URL 缓存模块——workspace-sync 更新磁盘文件后同 URL 的 import
8704
+ * 仍返回旧模块(2026-09-23 git 面 e2e 实锤:改 recipe + PATCH 后不重启就跑旧代码)。
8705
+ * 一次性 CLI 进程不需要,缺省保持缓存语义。
8706
+ */
8707
+ declare function loadRecipeDefinitionResult(recipeDir: string, recipeId: string, options?: {
8708
+ cacheBust?: string;
8709
+ }): Promise<DefinitionLoadResult<RecipeDefinition>>;
8710
+ declare function loadRecipeDefinition(recipeDir: string, recipeId: string, options?: {
8711
+ cacheBust?: string;
8712
+ }): Promise<RecipeDefinition | null>;
8247
8713
  /** 从 recipeDir 动态加载单个 EventHandler 定义,并保留失败原因。 */
8248
8714
  declare function loadEventHandlerDefinitionResult(recipeDir: string, recipeId: string): Promise<DefinitionLoadResult<EventHandlerRecipeDefinition>>;
8249
8715
  declare function loadEventHandlerDefinition(recipeDir: string, recipeId: string): Promise<EventHandlerRecipeDefinition | null>;
@@ -9711,4 +10177,4 @@ declare function buildCandidateId(input: CandidateIdentityInput): string;
9711
10177
  declare function buildCandidateRevision(input: CandidateRevisionInput): string;
9712
10178
  declare function buildReviewKey(candidateId: string, revision: string): string;
9713
10179
 
9714
- export { AGENT_TO_ENGINE, type AIToolkit, type AgentAdapter, type AgentConfig, type AgentEngine, type AgentExecutor, type AgentExecutorKind, type AgentFailure, type AgentFailureKind, type AgentLifecycleEvent, type AgentLifecyclePhase, type AgentMemoryToolkit, type AgentOptions, type AgentSession, type AitableAgentConfigMeta, type AnyToolkitDescriptor, type App, type ApprovalCandidate, type ApprovalCreateParams, type ApprovalStatus, type ApprovalToolkit, type ArtifactLintIssue, type ArtifactLintReport, type AtOptions, type AttachmentDetail, type AutomationResult, BASE_AGENT_DEFS, type BaseAgentOptions, type BaseIdMigrationResult, type BaseTablesCache, type BotApprovalSnapshot, BotProvisionError, BotProvisioner, CANDIDATE_IDENTITY_CONTRACT_VERSION, CANDIDATE_REVISION_CONTRACT_VERSION, type CIRunStatus, type CIToolkit, type CandidateIdentityInput, type CandidateRevisionInput, type CardAction, type CardPayload, type CheckApprovalResponse, type CheckItem, type CheckOptions, type CheckStatus, type ClarifyRoundOptions, type ClarifyRoundResult, type ClaudeCodeConfig, type ClaudeCodeOptions, type CleanupOrphansOptions, type CleanupOrphansResult, type CliEnvironment, type CliIdentity, type CodeReviewToolkit, type CodexConfig, type CodexOptions, type CodingAgentDetection, type CodingAgentInfo, type CodingAgentRunner, type CodingAgentSelection, type CodingAgentsConfig, type CodingRunOptions, type CodingRunResult, type CodingToolkit, type CollectContextOptions, CommandAbortedError, type CommandProbeResult, type CommandResult, type CommandRunOptions, type CommandRunner, CommandTimeoutError, type CompactOptions, type CompactResult, type Config, type ConfigAccess, type ConfigCheckResult, type ConfigDefaultStrategy, type ConfigFileMergeSummary, type ConfigFileRef, type ConfigHint, type ConfigHintEntry, type ConfigHintType, type ConfigOwnership, type ConfigSaveBody, ConfigSaveError, type ConfigSetupPolicy, type ConfigSurfaceItem, type ConfigSurfaceOwner, type ConfigSurfaceSource, type ConfigSurfaceValueType, type ConfigValueType, type ContactIdentity, type ContentIndex, type ContentIndexArticle, type ContentIndexEntry, type ContractKeys, type CreateAppOptions, type CredentialEntry, type CredentialsStore, type CronSchedulerConfig, CronSchedulerSource, DEFAULT_TAXONOMY, DEFAULT_VISION_BASE_MS, DEFAULT_VISION_PER_PAGE_MS, DISTILL_PRESETS, DWS_HOST_ENV_KEYS, DWS_RECORDS_FILE_FLAG, type DefinitionLoadFailure, type DefinitionLoadResult, type DesignContext, type DesignOptions, type DesignResult, type DesignValidationContext, type DesignWorkflowTarget, type DetectedAgentInfo, type DetectedCodingAgent, type DetectedCodingEngine, type DetectionResult, type DevAppEntry, type DingTalkActionCard$1 as DingTalkActionCard, type DingTalkActionCardButton$1 as DingTalkActionCardButton, type DingTalkActionCardButtons$1 as DingTalkActionCardButtons, type DingTalkActionCardResult$1 as DingTalkActionCardResult, type DingTalkAtUserIdResolver, type DingTalkAtUserIdResolverOptions, type DingTalkContactCandidate, type DingTalkContactSearch, type DingTalkGroupMessageResult$1 as DingTalkGroupMessageResult, DingTalkRobotClient, type DingTalkRobotClientConfig, type DingTalkRobotSendOptions, type DingTalkRobotUserSendOptions, type DingTalkStreamMessageEventContext, type DingTalkWebhookActionCard, type DingTalkWebhookMentionEventContext, type DiscoverLocalSourcesOptions, type DiscoveredLocalSource, type DistillPreset, type DistillPresetSpec, type DwsChatListAllResponse, type DwsChatListMineResponse, DwsClient, type DwsClientOptions, type DwsConversationSummary, DwsDevRunner, type DwsDevRunnerOptions, DwsError, type DwsJsonRunner, type DwsMaintenanceOptions, type DwsMaintenanceResult, type DwsRunner$1 as DwsRunner, ENGINE_TO_AGENT, type EdgeDefinition, type EnsureBaseOptions, type EnsureTableOptions, type EnterpriseRobotEntry, type EnvJsonMapSpec, type EventBinding, type EventCallback, type EventContext, type EventHandlerDefinition, type EventHandlerMeta, type EventHandlerRecipeDefinition, type EventSource, type EventSourceConfig, type EventSourceDefinition, type ExternalEvent, type FieldDefinition, type FieldDefinitionConfig, type FieldInfo, type FieldPlan, type FieldType$1 as FieldType, type FieldTypeEnum, type FieldsConfig, type FileRefHint, type FileToolkit, type FingerprintWindow, type FingerprintWindowOptions, type FirstResponseInfo, type GateEmptySnapshotResult, type GateId, type GateIssue, type GateIssueLocation, type GateIssueSeverity, type GateReport, type GateResult, type GateRunOptions, type GenericAgentConfig, type GitToolkit, type GlobalDwsActivationOptions, type GlobalDwsActivationResult, type GlobalVarAccessor, type GlobalVarStore, type HandlerInitContext, type HandlerInstance, type IdentityConfig, InMemoryGlobalVarStore, InMemoryObjectStore, type InferredContract, IngestError, type IngestOptions, type IngestReport, type IngestResult, type IngestSourceType, type InitAnswers, type InitOptions, type Invocation, KNOWN_AGENT_IDS, type KbCleanupCommandOptions, type KbCommandOptions, type KbContext, type KbIngestCommandOptions, type KbProgressInfo, type KbRunSummary, type KbState, type KbStatus, type KbWiki, type LLMCallOptions, type LLMCallTrace, type ListDwsConversationsOptions, type ListDwsConversationsResult, type ListDwsConversationsRole, type LoadSettingsOptions, type LoadWorkflowOptions, LocalSpawnExecutor, type LogContext, type LogLevel, type LogSink, type ManagedProcess, type ManagedProcessExit, type ManagedProcessSpec, type ManagedProcessSyncSpec, type MemoryEntry, type MemoryQuery, type MemoryScope, type MemoryScopeInput, type MemoryToolkitConfig, type MessageEmotionContext, type MessageTarget, type MessagingToolkit, type MigrateOptions, type MigrateResult, type MigrationPlan, type ModelSwitchable, type ModuleResult, type ModuleUrlOptions, type MrComment, type MultiWorkflowConfig, type NeedsHuman, type NormalizedMessage, type NotificationConfig, type ObjectStore, type ObjectStoreConfig, type OutboundChannel, PROVISION_PHASES, PathBoundaryError, type PathBoundaryReason, type PathFlavor, type PdfDensityAssessment, type PdfDensityOptions, type PdfDensityTier, type PendingAction, type PendingDigestItem, type PortableIdOptions, type PreflightIssue, type PreflightLevel, type PreflightModule, type PreflightOutcome, type PresignedUpload, type PrintfLogger, type ProfileConfig, type ProgressReporter, type ProjectShape, type ProvisionErrorKind, type ProvisionEvent, type ProvisionGroupOutcome, type ProvisionOptions, type ProvisionPhase, type ProvisionResult, type ProvisionState, type ProvisionedGroupEntry, type ProvisionerDeps, QUESTION_FORM_TAG, type QoderConfig, type QoderOptions, type RecipeCheckIssue, type RecipeCheckLevel, type RecipeCheckResult, type RecipeConfig, type RecipeContext, type RecipeDefinition, type RecipeInspectRow, type RecipeMeta, type RecipeResult, type RecipeResultStatus, type RecoverResult, type RecoverStats, type RecoverThreadStoreOptions, type ReferencedFields, type RefreshOptions, type RefreshResult, type RegistryConfig, type RegistryFieldsConfig, type RelayAgent, RelayAgentSession, type RelayAgentSessionConfig, RelayExecutor, type RelayExecutorConfig, type RelayTransport, type ReplyResult, type ReplyToConversationOptions, type ResolveContactsByUserIdsOptions, type ResolveContactsByUserIdsResult, type ResolveInsideRootOptions, type ResolvedDingTalkStreamMessageEventContext, type ResolvedDingTalkWebhookMentionEventContext, type ReviewStateResolution, type RobotCredentialEntry, type RobotLifecycle, type RobotResultResponse, type RobotSubmitResponse, type RolesConfig, type RunCodingAgentOptions, type RunDesignOptions, type RunEventSink, type RunRecordSnapshot, type RunResult, SCAFFOLD_FIELD_NAMES, type SafeFilenameOptions, type ScaffoldOptions, type SearchDwsChatGroupsOptions, type SearchDwsChatGroupsResult, type SessionReplyEntry, type SessionReplyOptions, type Settings, type SetupAutomationsOptions, type SetupOptions, type SetupSchemaField, type SharedKnowledgeEntry, type SharedKnowledgeMapping, ShellNotAllowedError, type ShellRunOptions, type ShellRunResult, type ShellToolkit, type SingleWorkflowConfig, type SkippedWorkflow, type SlsReportDeps, type SourceDiscoveryResult, type SourceDiscoverySkipReason, type StatesConfig, type StepDefinition, type StepSLA, type StepTrace, type SyncOptions, type SyncResult, TAGS_INDEX_DIR, THREAD_CLOSE_REASONS, THREAD_CONFIDENCES, THREAD_CONTRACT_VERSION, THREAD_ROLES, type TableRef, type TableToolkit, type TaxonomyCategory, TaxonomyError, type TemplateScaffoldResult, type TerminateProcessOptions, type ThreadAssignment, type ThreadAssignmentReason, type ThreadAssignmentTrace, type ThreadAssignmentWarning, type ThreadCloseReason, type ThreadConfidence, type ThreadEdge, ThreadLog, type ThreadLogEvent, type ThreadLogOptions, type ThreadParticipant, type ThreadReviewSummary, type ThreadRole, type ThreadRoleRoster, type ThreadSnapshot, ThreadStore, type ThreadStoreOptions, type TodoToolkit, type Toolkit, type ToolkitContext, type ToolkitDescriptor, ToolkitError, type ToolkitMethodMeta, type ToolkitPermission, Tracer, type TrackerConfig, type TriggerOnceRequest, type TriggerOnceResult, VISION_META_NAME, VISION_NORMALIZED_NAME, type ValidationResult, type VersionCreateResponse, type VersionListItem, type VersionStatusResponse, type ViewDef, type ViewFilterCondition, type ViewType, type ViewsConfig, type VisionMeta, type VisionNormalizePromptInput, WORKSPACE_BUNDLE_FORMAT, type WebhookSendOptions, type WikiTaxonomy, type WizardOptions, type WizardResult, type WorkflowCheckResult, type WorkflowCodingEngine, type WorkflowDTO, type WorkflowEntry, type WorkflowGateResult, type WorkflowInstance, type WorkflowMeta, type WorkflowProfileConfig, type WorkflowResponseDTO, type WorkflowStepDTO, type WorkflowTemplate, type WorkspaceBundleFile, type WorkspaceBundlePayload, type WorktreeResult, type WriteProfileRolesResult, type WriteRolesResult, type WriteTarget, _resetDigestQueues, _resetThreadStoreRegistry, activateGlobalDwsOnPath, agentEngineSchema, agentToEngine, applyConfigSave, applyProvisionEvent, approvalCandidateSchema, assertDownloadMatchesExtension, assertPortableId, assertTableBelongsToBase, assessPdfDensity, assignThreadRoles, buildAgentChoices, buildArtifactKey, buildBotApprovalReportLines, buildCandidateId, buildCandidateRevision, buildClarifyReply, buildEnvSource, buildEnvSourceSync, buildFixPrompt, buildMetaPrompt, buildReviewKey, canOfferDefaultFor, canonicalJson, checkApprovalSchema, checkEnv, checkMigrateHint, checkRecipeSyntax, checkRecipeTypes, checkWorkflowRecipes, checkWorkflows, chooseDetectedEngine, classifyProvisionError, cleanupOrphanArticles, codingAgentsConfigSchema, coerceJsonValue, coerceYamlValue, collectAllItems, collectBaseIdCandidateFiles, collectConfigHints, collectDesignContext, collectEnvRefDetails, collectEnvRefs, collectionDir, commandsInFlight, composeToolkitRegistry, computeFirstResponse, computeParticipants, computeWorkspaceRevision, configSchema, configTrackerSchema, contentIndexKey, createApp, createDingTalkAtUserIdResolver, createExecShellToolkit, createFingerprintWindow, createInitialProvisionState, createLocalSpawnExecutor, createPerWorkflowSettings, createPrintfLogger, createRelayExecutor, createStandaloneExecShellToolkit, createWorkflowTable, credentialsFilePath, decodeWorkspaceBundle, defaultCommandRunner, defaultProvisionStatePath, defaultToolkitRegistry, degradeConfidence, deriveEnvJsonMapSpec, describeConfigPath, detectAgentFailure, detectAgents, detectCodingEngines, detectInstalledAgents, detectInstalledCodingAgents, detectScope, detectSourceType, devAppEntrySchema, discoverLocalSources, distillPresetSpec, drainCommands, dwsCommandOptions, dwsErrorEnvelopeSchema, dwsPayload, emptyContentIndex, emptyStore, emptyStreakKey, encodeWorkspaceBundle, engineToAgent, enqueueForDigest, enrichLogContext, ensureBaseExists, ensureLatestDws, ensureRecipeModuleFormat, ensureTableExists, ensureTsxRegistered, evaluateStrictGate, extractAddBotRobotName, extractAttachmentDetails, extractErrorInfo, extractPdfPageCount, extractStructuredJson, fetchFields, fieldDefinitionSchema, fieldTypeSchema, fileRefConfigSchema, findArrayPayload, findConflictingCredential, findCursor, formatArtifactLint, formatCommandError, formatZonedDateTime, formatZonedHm, gateEmptySnapshot, generateCodingAgentsConfig, generateMainConfig, getActiveCredential, getAgentConfig, getAgentDef, getAitableAgentConfigMeta, getConfigHint, getConfigValueAtPath, getCurrentDwsRunner, getCurrentExecutor, getDefaultAgentEntry, getFileRefHint, getGlobalDwsBinPath, getLogContext, getPendingItems, getSemanticKey, getThreadStore, getTracer, getZodObjectShape, globalVarRefPath, groupEntriesOf, hasArtifactError, hasHumanStep, hasOssCredentials, hashNormalizedContent, incrementDigestAttempts, indexPath, inferRecipeContractFromSource, ingest, initSlsReport, initTable, initTracer, initialTableFields, injectProfileConfig, interpolateEnv, isAllowedArtifactPath, isDigestQueueEmpty, isDistillPreset, isEngineDetected, isGlobalVarRef, isOwnedAutoCreateHint, isPublishedStatus, isRecord, isSafeRelativePath, isSlsReportDisabled, lintArtifacts, listCodingAgents, listCredentials, listDwsConversations, listProfiles, listTemplates, loadAgentConfig, loadEventHandlerDefinition, loadEventHandlerDefinitionResult, loadProfileConfig, loadProvisionState, loadRecipeDefinition, loadRecipeDefinitionResult, loadSettings, loadTaxonomy, loadWorkflowTemplate, logDateDir, logPreflightSummary, logger, lowerConfidence, mapWithConcurrency, markDigestFailure, maskSecret, materializeSharedKnowledge, materializeWithMapping, mergeCommandEnv, mergeEnterpriseRobotCredentials, migrateBaseIdInFiles, moduleDir, nextStepForPhase, normalizeArtifactRelPath, normalizeByType, normalizeCategory, normalizeEol, normalizeTimezone, padStaffId, parseDwsAuthIdentity, parseDwsVersionOutput, parseEnterpriseRobots, parseEnvExampleValues, parseEnvValue, parseFrontmatter, parseGroupTargets, parseProvisionState, parseQuestionForm, parseVisionMeta, preflightModuleResult, prependGlobalDwsToPath, printFieldPlan, printKbProgress, printKbSummary, probeCommand, probeProjectShape, provisionGuidance, provisionStateFileSchema, provisionedGroupEntrySchema, readContentIndex, readCredentials, readSection, readState, readTitle, readYamlValueAt, recoverThreadStoreOnce, redactPayloadForLog, refreshKnowledgeBases, remainingDesignTimeoutMs, removeFromDigestQueue, renderDistillPrompt, renderForm, renderForms, renderKbPromptBlock, renderSimpleDistillPrompt, renderThread, renderVisionNormalizePrompt, repairJsonStringValues, reportCliEvent, reportPath, requireAgentDef, resetProfileCache, resolveAllCollections, resolveCodingAgentSelection, resolveCompileAgent, resolveConfigPath, resolveContactsByUserIds, resolveDingTalkAtUserId, resolveDingTalkStreamMessageEventContext, resolveDingTalkWebhookMentionEventContext, resolveDwsCommandBin, resolveGlobalVarRef, resolveInsideRoot, resolveKbContext, resolveRecipePath, resolveRecordsFilePath, resolveReportProject, resolveReviewState, resolveReviewStateDetailed, resolveTriggerTarget, resolveWorkflowTracker, robotLifecycleSchema, robotResultSchema, robotSubmitSchema, runCheck, runClarifyRound, runCodingAgent, runCodingAgentViaSpawn, runCommand, runDesign, runDesignCommand, runDwsCommand, runDwsRecordsFile, runInit, runInstancePreflight, runKbCleanupCommand, runKbCompileCommand, runKbIngestCommand, runKbStatusCommand, runKbUpdateCommand, runMigrate, runSetupCommand, runSync, runWithDwsRunner, runWithExecutor, runWithLogContext, runWorkflowGate, runWorkflowGates, safeFilename, safeParseJson, sanitizeProvisionText, saveCredential, saveProvisionState, scaffold, scaffoldFromTemplate, scanWorkflowDirs, searchDwsChatGroups, sessionWebhookRegistry, setActiveAgent, setGlobalDwsRunner, setInJson, setReportProject, setupAutomations, setupKnowledgeBases, setupSurfaceTables, shellToken, shouldDetachCommand, shouldRunVisionRound, snapshotRunRecord, spawnManagedProcess, spawnManagedProcessSync, splitFrontmatter, stringOrNull, stripPdfSeparators, substituteArgPath, syncFieldsFromWorkflow, tableRefConfigSchema, index as tableSource, taxonomyCategoryIds, taxonomyFingerprint, threadLogFileName, threadNeedsReview, tidySection, toModuleUrl, toPortableRelPath, toStringList, trackerSchema, tryReuseStagingArticles, tzOffsetMs, upsertContentIndexEntry, validateDesignArtifacts, validateDesignOutput, validateProvisionName, validateStateConsistency, versionCreateSchema, versionListItemSchema, versionStatusSchema, viewDefSchema, viewFilterConditionSchema, viewTypeSchema, visionTimeoutMs, wikiDir, workspaceAgentConfigPath, writeBack, writeContentIndex, writeCredentials, writeEnvFile, writeJsonFile, writeProfileRoles, writeRoleDefinitions, writeTableIdToConfig, writeYaml, yamlFlowList, yamlScalar, yesterdayRange, zodToFormatExample, zonedDateParts, zonedWallClockToUtc };
10180
+ export { AGENT_TO_ENGINE, AITableTracker, type AIToolkit, type AgentAdapter, type AgentConfig, type AgentEngine, type AgentExecutor, type AgentExecutorKind, type AgentFailure, type AgentFailureKind, type AgentLifecycleEvent, type AgentLifecyclePhase, type AgentMemoryToolkit, type AgentOptions, type AgentSession, type AitableAgentConfigMeta, type AnyToolkitDescriptor, type App, type ApprovalCandidate, type ApprovalCreateParams, type ApprovalStatus, type ApprovalToolkit, type ArtifactLintIssue, type ArtifactLintReport, type AtOptions, type AttachmentDetail, type AutomationResult, BASE_AGENT_DEFS, type BaseAgentOptions, type BaseIdMigrationResult, type BaseTablesCache, type BotApprovalSnapshot, BotProvisionError, BotProvisioner, CANDIDATE_IDENTITY_CONTRACT_VERSION, CANDIDATE_REVISION_CONTRACT_VERSION, type CIRunStatus, type CIToolkit, type CandidateIdentityInput, type CandidateRevisionInput, type CardAction, type CardPayload, type CheckApprovalResponse, type CheckItem, type CheckOptions, type CheckStatus, type ClarifyRoundOptions, type ClarifyRoundResult, type ClaudeCodeConfig, type ClaudeCodeOptions, type CleanupOrphansOptions, type CleanupOrphansResult, type CliEnvironment, type CliIdentity, type CodeReviewConfig, type CodeReviewToolkit, type CodexConfig, type CodexOptions, type CodingAgentDetection, type CodingAgentInfo, type CodingAgentRunner, type CodingAgentSelection, type CodingAgentsConfig, type CodingRunOptions, type CodingRunResult, type CodingToolkit, type CodingToolkitConfig, type CollectContextOptions, CommandAbortedError, type CommandProbeResult, type CommandResult, type CommandRunOptions, type CommandRunner, CommandTimeoutError, type CompactOptions, type CompactResult, type Config, type ConfigAccess, type ConfigCheckResult, type ConfigDefaultStrategy, type ConfigFileMergeSummary, type ConfigFileRef, type ConfigHint, type ConfigHintEntry, type ConfigHintType, type ConfigOwnership, type ConfigSaveBody, ConfigSaveError, type ConfigSetupPolicy, type ConfigSurfaceItem, type ConfigSurfaceOwner, type ConfigSurfaceSource, type ConfigSurfaceValueType, type ConfigValueType, type ContactIdentity, type ContentIndex, type ContentIndexArticle, type ContentIndexEntry, type ContractKeys, type CreateAppOptions, type CredentialEntry, type CredentialsStore, type CronSchedulerConfig, CronSchedulerSource, DEFAULT_TAXONOMY, DEFAULT_VISION_BASE_MS, DEFAULT_VISION_PER_PAGE_MS, DISTILL_PRESETS, DWS_HOST_ENV_KEYS, DWS_RECORDS_FILE_FLAG, DeferredTracker, type DefinitionLoadFailure, type DefinitionLoadResult, type DesignContext, type DesignOptions, type DesignResult, type DesignValidationContext, type DesignWorkflowTarget, type DetectedAgentInfo, type DetectedCodingAgent, type DetectedCodingEngine, type DetectionResult, type DevAppEntry, type DingTalkActionCard$1 as DingTalkActionCard, type DingTalkActionCardButton$1 as DingTalkActionCardButton, type DingTalkActionCardButtons$1 as DingTalkActionCardButtons, type DingTalkActionCardResult$1 as DingTalkActionCardResult, type DingTalkAtUserIdResolver, type DingTalkAtUserIdResolverOptions, type DingTalkContactCandidate, type DingTalkContactSearch, type DingTalkGroupMessageResult$1 as DingTalkGroupMessageResult, DingTalkRobotClient, type DingTalkRobotClientConfig, type DingTalkRobotSendOptions, type DingTalkRobotUserSendOptions, type DingTalkStreamMessageEventContext, type DingTalkWebhookActionCard, type DingTalkWebhookMentionEventContext, type DiscoverLocalSourcesOptions, type DiscoveredLocalSource, type DistillPreset, type DistillPresetSpec, type DwsChatListAllResponse, type DwsChatListMineResponse, DwsClient, type DwsClientOptions, type DwsConversationSummary, DwsDevRunner, type DwsDevRunnerOptions, DwsError, type DwsJsonRunner, type DwsMaintenanceOptions, type DwsMaintenanceResult, type DwsRunner$1 as DwsRunner, ENGINE_TO_AGENT, type EdgeDefinition, type EnsureBaseOptions, type EnsureRecipeModuleFormatOptions, type EnsureTableOptions, type EnsureWorktreeOptions, type EnterpriseRobotEntry, type EnvJsonMapSpec, type EventBinding, type EventCallback, type EventContext, type EventHandlerDefinition, type EventHandlerMeta, type EventHandlerRecipeDefinition, type EventSource, type EventSourceConfig, type EventSourceDefinition, type ExternalEvent, type FieldDefinition, type FieldDefinitionConfig, type FieldInfo, type FieldPlan, type FieldType$1 as FieldType, type FieldTypeEnum, type FieldsConfig, type FileRefHint, type FileToolkit, type FingerprintWindow, type FingerprintWindowOptions, type FirstResponseInfo, type GateEmptySnapshotResult, type GateId, type GateIssue, type GateIssueLocation, type GateIssueSeverity, type GateReport, type GateResult, type GateRunOptions, type GenericAgentConfig, type GitCommitOptions, type GitConfig, type GitRepositoryCommand, type GitRepositoryDefinition, type GitToolkit, type GlobalDwsActivationOptions, type GlobalDwsActivationResult, type GlobalVarAccessor, type GlobalVarStore, type HandlerInitContext, type HandlerInstance, type IdentityConfig, InMemoryGlobalVarStore, InMemoryObjectStore, type InferredContract, IngestError, type IngestOptions, type IngestReport, type IngestResult, type IngestSourceType, type InitAnswers, type InitOptions, type Invocation, KNOWN_AGENT_IDS, type KbCleanupCommandOptions, type KbCommandOptions, type KbContext, type KbIngestCommandOptions, type KbProgressInfo, type KbRunSummary, type KbState, type KbStatus, type KbWiki, type LLMCallOptions, type LLMCallTrace, type ListDwsConversationsOptions, type ListDwsConversationsResult, type ListDwsConversationsRole, type LoadSettingsOptions, type LoadWorkflowOptions, LocalSpawnExecutor, type LogContext, type LogLevel, type LogSink, type ManagedProcess, type ManagedProcessExit, type ManagedProcessSpec, type ManagedProcessSyncSpec, type MemoryEntry, type MemoryQuery, type MemoryScope, type MemoryScopeInput, type MemoryToolkitConfig, type MessageEmotionContext, type MessageTarget, type MessagingToolkit, type MigrateOptions, type MigrateResult, type MigrationPlan, type ModelSwitchable, type ModuleResult, type ModuleUrlOptions, type MrComment, type MultiWorkflowConfig, type NeedsHuman, type NormalizedMessage, type NotificationConfig, type ObjectStore, type ObjectStoreConfig, type OutboundChannel, PROVISION_PHASES, PathBoundaryError, type PathBoundaryReason, type PathFlavor, type PdfDensityAssessment, type PdfDensityOptions, type PdfDensityTier, type PendingAction, type PendingDigestItem, type PortableIdOptions, type PreflightIssue, type PreflightLevel, type PreflightModule, type PreflightOutcome, type PresignedUpload, type PrintfLogger, type ProfileConfig, type ProgressReporter, type ProjectRelativePathOptions, type ProjectShape, type ProvisionErrorKind, type ProvisionEvent, type ProvisionGroupOutcome, type ProvisionOptions, type ProvisionPhase, type ProvisionResult, type ProvisionState, type ProvisionedGroupEntry, type ProvisionerDeps, QUESTION_FORM_TAG, type QoderConfig, type QoderOptions, type RecipeCheckIssue, type RecipeCheckLevel, type RecipeCheckResult, type RecipeCodeReviewConfig, type RecipeCodingConfig, type RecipeConfig, type RecipeContext, type RecipeDefinition, type RecipeGitConfig, type RecipeInspectRow, type RecipeMeta, type RecipeResult, type RecipeResultStatus, type RecipeRunRequest, type RecipeRunResult, type RecipeRunner, type RecipeRunnerContext, type RecipeTransport, type RecoverResult, type RecoverStats, type RecoverThreadStoreOptions, type ReferencedFields, type RefreshOptions, type RefreshResult, type RegistryConfig, type RegistryFieldsConfig, type RelayAgent, RelayAgentSession, type RelayAgentSessionConfig, RelayExecutor, type RelayExecutorConfig, type RelayTransport, type RemoteRecipeCodeReviewConfig, type RemoteRecipeCodingConfig, type RemoteRecipeGitConfig, type RemoteRecipeRequest, type RemoteRecipeResult, type ReplyResult, type ReplyToConversationOptions, type ResolveContactsByUserIdsOptions, type ResolveContactsByUserIdsResult, type ResolveInsideRootOptions, type ResolvedDingTalkStreamMessageEventContext, type ResolvedDingTalkWebhookMentionEventContext, type ReviewStateResolution, type RobotCredentialEntry, type RobotLifecycle, type RobotResultResponse, type RobotSubmitResponse, type RolesConfig, type RunCodingAgentOptions, type RunDesignOptions, type RunEventSink, type RunRecordSnapshot, type RunResult, type RunSetupTablesOptions, SCAFFOLD_FIELD_NAMES, type SafeFilenameOptions, type ScaffoldOptions, type SearchDwsChatGroupsOptions, type SearchDwsChatGroupsResult, type SessionReplyEntry, type SessionReplyOptions, type Settings, type SetupAutomationsOptions, type SetupOptions, type SetupSchemaField, type SetupTableResult, type SetupTablesResult, type SetupWorkflowInfo, type SharedKnowledgeEntry, type SharedKnowledgeMapping, ShellNotAllowedError, type ShellRunOptions, type ShellRunResult, type ShellToolkit, type SingleWorkflowConfig, type SkippedWorkflow, type SlsReportDeps, type SourceDiscoveryResult, type SourceDiscoverySkipReason, type StatesConfig, type StepDefinition, type StepSLA, type StepTrace, type SyncOptions, type SyncResult, TAGS_INDEX_DIR, THREAD_CLOSE_REASONS, THREAD_CONFIDENCES, THREAD_CONTRACT_VERSION, THREAD_ROLES, type TableRef, type TableToolkit, type TaxonomyCategory, TaxonomyError, type TemplateScaffoldResult, type TerminateProcessOptions, type ThreadAssignment, type ThreadAssignmentReason, type ThreadAssignmentTrace, type ThreadAssignmentWarning, type ThreadCloseReason, type ThreadConfidence, type ThreadEdge, ThreadLog, type ThreadLogEvent, type ThreadLogOptions, type ThreadParticipant, type ThreadReviewSummary, type ThreadRole, type ThreadRoleRoster, type ThreadSnapshot, ThreadStore, type ThreadStoreOptions, type TodoToolkit, type Toolkit, type ToolkitContext, type ToolkitDescriptor, ToolkitError, type ToolkitMethodMeta, type ToolkitPermission, Tracer, type Tracker, type TrackerConfig, type TriggerOnceRequest, type TriggerOnceResult, VISION_META_NAME, VISION_NORMALIZED_NAME, type ValidationResult, type VersionCreateResponse, type VersionListItem, type VersionStatusResponse, type ViewDef, type ViewFilterCondition, type ViewType, type ViewsConfig, type VisionMeta, type VisionNormalizePromptInput, WORKSPACE_BUNDLE_FORMAT, type WebhookSendOptions, type WikiTaxonomy, type WizardOptions, type WizardResult, type WorkItem, type WorkflowCheckResult, type WorkflowCodingEngine, type WorkflowDTO, type WorkflowEntry, type WorkflowGateResult, type WorkflowInstance, type WorkflowMeta, type WorkflowProfileConfig, type WorkflowResponseDTO, type WorkflowStepDTO, type WorkflowTemplate, type WorkspaceBundleFile, type WorkspaceBundlePayload, type WorktreeResult, type WriteProfileRolesResult, type WriteRolesResult, type WriteTarget, _resetDigestQueues, _resetThreadStoreRegistry, activateGlobalDwsOnPath, agentEngineSchema, agentToEngine, applyConfigSave, applyProvisionEvent, approvalCandidateSchema, assertDownloadMatchesExtension, assertPortableId, assertTableBelongsToBase, assessPdfDensity, assignThreadRoles, buildAgentChoices, buildArtifactKey, buildBotApprovalReportLines, buildCandidateId, buildCandidateRevision, buildClarifyReply, buildEnvSource, buildEnvSourceSync, buildFixPrompt, buildMetaPrompt, buildReviewKey, canOfferDefaultFor, canonicalJson, checkApprovalSchema, checkEnv, checkMigrateHint, checkRecipeSyntax, checkRecipeTypes, checkWorkflowRecipes, checkWorkflows, chooseDetectedEngine, classifyProvisionError, cleanupOrphanArticles, codingAgentsConfigSchema, coerceJsonValue, coerceYamlValue, collectAllItems, collectBaseIdCandidateFiles, collectConfigHints, collectDesignContext, collectEnvRefDetails, collectEnvRefs, collectionDir, commandsInFlight, composeToolkitRegistry, computeFirstResponse, computeParticipants, computeWorkspaceRevision, configSchema, configTrackerSchema, contentIndexKey, createApp, createCodeReviewToolkitFromConfig, createCodingToolkit, createDingTalkAtUserIdResolver, createExecShellToolkit, createFingerprintWindow, createGitToolkitFromConfig, createInitialProvisionState, createLocalSpawnExecutor, createNullCodingToolkit, createPerWorkflowSettings, createPrintfLogger, createRelayExecutor, createStandaloneExecShellToolkit, createTableToolkit, createWorkflowTable, credentialsFilePath, decodeWorkspaceBundle, defaultCommandRunner, defaultProvisionStatePath, defaultToolkitRegistry, degradeConfidence, deriveEnvJsonMapSpec, describeConfigPath, detectAgentFailure, detectAgents, detectCodingEngines, detectInstalledAgents, detectInstalledCodingAgents, detectScope, detectSourceType, devAppEntrySchema, discoverLocalSources, distillPresetSpec, drainCommands, dwsCommandOptions, dwsErrorEnvelopeSchema, dwsPayload, emptyContentIndex, emptyStore, emptyStreakKey, encodeWorkspaceBundle, engineToAgent, enqueueForDigest, enrichLogContext, ensureBaseExists, ensureLatestDws, ensureRecipeModuleFormat, ensureTableExists, ensureTsxRegistered, evaluateStrictGate, extractAddBotRobotName, extractAttachmentDetails, extractErrorInfo, extractPdfPageCount, extractStructuredJson, fetchFields, fieldDefinitionSchema, fieldTypeSchema, fileRefConfigSchema, findArrayPayload, findConflictingCredential, findCursor, formatArtifactLint, formatCommandError, formatZonedDateTime, formatZonedHm, gateEmptySnapshot, generateCodingAgentsConfig, generateMainConfig, getActiveCredential, getAgentConfig, getAgentDef, getAitableAgentConfigMeta, getConfigHint, getConfigValueAtPath, getCurrentDwsRunner, getCurrentExecutor, getCurrentRecipeRunner, getCurrentRecipeTransport, getDefaultAgentEntry, getFileRefHint, getGlobalDwsBinPath, getLogContext, getPendingItems, getSemanticKey, getThreadStore, getTracer, getZodObjectShape, globalVarRefPath, groupEntriesOf, hasArtifactError, hasHumanStep, hasOssCredentials, hashNormalizedContent, incrementDigestAttempts, indexPath, inferRecipeContractFromSource, ingest, initSlsReport, initTable, initTracer, initialTableFields, injectProfileConfig, interpolateEnv, isAllowedArtifactPath, isDigestQueueEmpty, isDistillPreset, isEngineDetected, isGlobalVarRef, isOwnedAutoCreateHint, isPublishedStatus, isRecord, isSafeRelativePath, isSlsReportDisabled, lintArtifacts, listCodingAgents, listCredentials, listDwsConversations, listProfiles, listTemplates, loadAgentConfig, loadEventHandlerDefinition, loadEventHandlerDefinitionResult, loadProfileConfig, loadProvisionState, loadRecipeDefinition, loadRecipeDefinitionResult, loadSettings, loadTaxonomy, loadWorkflowTemplate, logDateDir, logPreflightSummary, logger, lowerConfidence, mapWithConcurrency, markDigestFailure, maskSecret, materializeSharedKnowledge, materializeWithMapping, mergeCommandEnv, mergeEnterpriseRobotCredentials, migrateBaseIdInFiles, moduleDir, nextStepForPhase, normalizeArtifactRelPath, normalizeByType, normalizeCategory, normalizeEol, normalizeTimezone, padStaffId, parseDwsAuthIdentity, parseDwsVersionOutput, parseEnterpriseRobots, parseEnvExampleValues, parseEnvValue, parseFrontmatter, parseGroupTargets, parseProvisionState, parseQuestionForm, parseVisionMeta, preflightModuleResult, prependGlobalDwsToPath, printFieldPlan, printKbProgress, printKbSummary, probeCommand, probeProjectShape, provisionGuidance, provisionStateFileSchema, provisionedGroupEntrySchema, readContentIndex, readCredentials, readSection, readState, readTitle, readYamlValueAt, recoverThreadStoreOnce, redactPayloadForLog, refreshKnowledgeBases, remainingDesignTimeoutMs, removeFromDigestQueue, renderDistillPrompt, renderForm, renderForms, renderKbPromptBlock, renderSimpleDistillPrompt, renderThread, renderVisionNormalizePrompt, repairJsonStringValues, reportCliEvent, reportPath, requireAgentDef, resetProfileCache, resetProfileCacheForConfigDir, resolveAllCollections, resolveCodingAgentSelection, resolveCodingWorkspaceDir, resolveCompileAgent, resolveConfigPath, resolveContactsByUserIds, resolveDingTalkAtUserId, resolveDingTalkStreamMessageEventContext, resolveDingTalkWebhookMentionEventContext, resolveDwsCommandBin, resolveGlobalVarRef, resolveInsideRoot, resolveKbContext, resolveProjectPath, resolveRecipePath, resolveRecordsFilePath, resolveReportProject, resolveReviewState, resolveReviewStateDetailed, resolveTriggerTarget, resolveWorkflowTracker, robotLifecycleSchema, robotResultSchema, robotSubmitSchema, runCheck, runClarifyRound, runCodingAgent, runCodingAgentViaSpawn, runCommand, runDesign, runDesignCommand, runDwsCommand, runDwsRecordsFile, runInit, runInstancePreflight, runKbCleanupCommand, runKbCompileCommand, runKbIngestCommand, runKbStatusCommand, runKbUpdateCommand, runMigrate, runSetupCommand, runSetupTables, runSync, runWithDwsRunner, runWithExecutor, runWithLogContext, runWithRecipeRunner, runWithRecipeTransport, runWorkflowGate, runWorkflowGates, safeFilename, safeParseJson, sanitizeProvisionText, saveCredential, saveProvisionState, scaffold, scaffoldFromTemplate, scanWorkflowDirs, searchDwsChatGroups, sessionWebhookRegistry, setActiveAgent, setGlobalDwsRunner, setInJson, setReportProject, setupAutomations, setupKnowledgeBases, setupSurfaceTables, shellToken, shouldDetachCommand, shouldRunVisionRound, snapshotRunRecord, spawnManagedProcess, spawnManagedProcessSync, splitFrontmatter, stringOrNull, stripPdfSeparators, substituteArgPath, syncFieldsFromWorkflow, tableRefConfigSchema, index as tableSource, taxonomyCategoryIds, taxonomyFingerprint, threadLogFileName, threadNeedsReview, tidySection, toModuleUrl, toPortableRelPath, toProjectRelativePath, toStringList, trackerSchema, tryReuseStagingArticles, tzOffsetMs, upsertContentIndexEntry, validateDesignArtifacts, validateDesignOutput, validateProvisionName, validateStateConsistency, versionCreateSchema, versionListItemSchema, versionStatusSchema, viewDefSchema, viewFilterConditionSchema, viewTypeSchema, visionTimeoutMs, wikiDir, workspaceAgentConfigPath, writeBack, writeContentIndex, writeCredentials, writeEnvFile, writeJsonFile, writeProfileRoles, writeRoleDefinitions, writeTableIdToConfig, writeYaml, yamlFlowList, yamlScalar, yesterdayRange, zodToFormatExample, zonedDateParts, zonedWallClockToUtc };