@atlaswork/atlascode 0.0.0-stage → 0.1.125

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 (63) hide show
  1. package/README.md +124 -2
  2. package/dist/cli.js +506227 -0
  3. package/dist/web-contract/index.d.ts +727 -0
  4. package/dist/web-contract/index.js +260 -0
  5. package/dist/web-session-runtime/atlascode/web/contract.d.ts +10 -0
  6. package/dist/web-session-runtime/atlascode/web/cursorLedger.d.ts +63 -0
  7. package/dist/web-session-runtime/atlascode/web/entry.d.ts +19 -0
  8. package/dist/web-session-runtime/atlascode/web/errors.d.ts +16 -0
  9. package/dist/web-session-runtime/atlascode/web/follow.d.ts +82 -0
  10. package/dist/web-session-runtime/atlascode/web/limits.d.ts +63 -0
  11. package/dist/web-session-runtime/atlascode/web/projection.d.ts +69 -0
  12. package/dist/web-session-runtime/atlascode/web/readonlyRuntime.d.ts +156 -0
  13. package/dist/web-session-runtime/atlascode/web/runtimeDefault.d.ts +26 -0
  14. package/dist/web-session-runtime/atlascode/web/sessionStoreAdapter.d.ts +70 -0
  15. package/dist/web-session-runtime/engine/session/env.d.ts +32 -0
  16. package/dist/web-session-runtime/engine/session/firstPrompt.d.ts +21 -0
  17. package/dist/web-session-runtime/engine/session/json.d.ts +27 -0
  18. package/dist/web-session-runtime/engine/session/load.d.ts +88 -0
  19. package/dist/web-session-runtime/engine/session/paths.d.ts +25 -0
  20. package/dist/web-session-runtime/engine/session/predicates.d.ts +55 -0
  21. package/dist/web-session-runtime/engine/session/readonly.d.ts +29 -0
  22. package/dist/web-session-runtime/engine/session/scanner.d.ts +26 -0
  23. package/dist/web-session-runtime/engine/session/search.d.ts +44 -0
  24. package/dist/web-session-runtime/engine/session/types.d.ts +379 -0
  25. package/dist/web-session-runtime/index.d.ts +1 -0
  26. package/dist/web-session-runtime/index.js +2635 -0
  27. package/dist/web-session-runtime/kernel/protocol/webSessionV0.d.ts +727 -0
  28. package/dist/web-session-runtime/shared/ProductDefinition.d.ts +47 -0
  29. package/dist/web-session-runtime/shared/agentRoleTemplates.d.ts +44 -0
  30. package/dist/web-session-runtime/shared/agentSwarmsEnabled.d.ts +5 -0
  31. package/dist/web-session-runtime/shared/boundedImageRead.d.ts +31 -0
  32. package/dist/web-session-runtime/shared/circular-buffer.d.ts +42 -0
  33. package/dist/web-session-runtime/shared/configDir.d.ts +57 -0
  34. package/dist/web-session-runtime/shared/constants.d.ts +19 -0
  35. package/dist/web-session-runtime/shared/debug.d.ts +32 -0
  36. package/dist/web-session-runtime/shared/env.d.ts +38 -0
  37. package/dist/web-session-runtime/shared/errors.d.ts +56 -0
  38. package/dist/web-session-runtime/shared/feature.d.ts +25 -0
  39. package/dist/web-session-runtime/shared/format.d.ts +11 -0
  40. package/dist/web-session-runtime/shared/fs-operations.d.ts +116 -0
  41. package/dist/web-session-runtime/shared/hash.d.ts +13 -0
  42. package/dist/web-session-runtime/shared/identity.d.ts +23 -0
  43. package/dist/web-session-runtime/shared/index.d.ts +46 -0
  44. package/dist/web-session-runtime/shared/lazySchema.d.ts +12 -0
  45. package/dist/web-session-runtime/shared/log.d.ts +1 -0
  46. package/dist/web-session-runtime/shared/path.d.ts +22 -0
  47. package/dist/web-session-runtime/shared/pdfPageImages.d.ts +19 -0
  48. package/dist/web-session-runtime/shared/pdfReference.d.ts +70 -0
  49. package/dist/web-session-runtime/shared/permissionDeadline.d.ts +24 -0
  50. package/dist/web-session-runtime/shared/platform.d.ts +8 -0
  51. package/dist/web-session-runtime/shared/stringUtils.d.ts +110 -0
  52. package/dist/web-session-runtime/shared/swarmSchemaFilter.d.ts +23 -0
  53. package/dist/web-session-runtime/shared/teamFileSchema.d.ts +151 -0
  54. package/dist/web-session-runtime/shared/teamInboxSchema.d.ts +112 -0
  55. package/dist/web-session-runtime/shared/teammateContext.d.ts +89 -0
  56. package/dist/web-session-runtime/shared/tempDir.d.ts +1 -0
  57. package/dist/web-session-runtime/shared/textEncoding.d.ts +41 -0
  58. package/dist/web-session-runtime/shared/tokenEstimation.d.ts +36 -0
  59. package/dist/web-session-runtime/shared/types-session.d.ts +266 -0
  60. package/dist/web-session-runtime/shared/types.d.ts +190 -0
  61. package/dist/web-session-runtime/shared/unc.d.ts +5 -0
  62. package/dist/web-session-runtime/shared/windowsPaths.d.ts +24 -0
  63. package/package.json +116 -4
@@ -0,0 +1,47 @@
1
+ /**
2
+ * ProductDefinition(0.1.98 S1a 硬化波,工单 docs/2026-11-12-p0-wave-0198-s1a-ticket.md
3
+ * lock-face ①④ 批复形):per-product 运行时差异的唯一接口面。
4
+ *
5
+ * 与 IDN-1 构建配方归一边界:品牌串走 identity.ts 构建配方(buildUserAgent 等),
6
+ * 本接口只承载**运行时清单参数**(工具子集 / 配置目录维度〔0.1.99 步 2 激活〕)。
7
+ *
8
+ * ★不参数化清单(lock-face §0 冻结,禁顺手漂移——改动 = row F 回 f4):
9
+ * 1. modelprovider/constants.ts 两 beta 头(SUMMARIZE_CONNECTOR_TEXT_BETA_HEADER /
10
+ * AFK_MODE_BETA_HEADER)——wire 协议常量(WIRE 冻结族),非产品工具面。
11
+ * 2. coordinator localShellTask `MONITOR_TOOL` 门——coordinator 行为门(env 已可关)。
12
+ * 3. tui 域 FEATURE_* env kill-switch 行为门族——TUI 行为门 ≠ 工具子集。
13
+ * 4. 项目级 `.atlas/skills` 约定目录字面(loadSkillsDir)——项目根约定,非
14
+ * ~/.atlas 配置目录,product 无关。
15
+ * 5. 工具 prompt 文案中 `~/.atlas` 用户引导字面——用户可见文案,不入本接口。
16
+ *
17
+ * 解析时序(lock-face ④ 判据 (a)):**解析一次性**——ACTIVE_PRODUCT 模块级冻结,
18
+ * 启动期定谳,消费方(loopDeps/toolRegistry)读引用不重解析;禁 per-call 重解析。
19
+ */
20
+ export interface ProductDefinition {
21
+ /** 产品 id(注册清单键;当前唯一 'atlascode')。 */
22
+ readonly id: string;
23
+ /**
24
+ * 运行时工具子集(工具名冻结清单;**undefined = 全量装配,atlascode 零变更**)。
25
+ * 消费点 = toolRegistry getAllBaseTools 装配层过滤(Agent/base/ascend 段,
26
+ * mcpTools 动态面不参 subset);过滤与 isEnabled 判别同路(lock-face ④ (c)),
27
+ * 禁旁路 env 直查。defer/ToolSearch 面消费 registry 产物,subset 外工具不可见。
28
+ */
29
+ readonly toolSubset?: readonly string[];
30
+ /**
31
+ * 配置目录名维度(0.1.99 步 2 激活):部署期产品默认层。
32
+ * env 四层次序(0.1.99 lock-face 必改① 钉死)= ATLAS_CONFIG_DIR(全路径
33
+ * 显式)> ATLAS_CONFIG_DIR_NAME(用户显式)> 本值(部署期默认)> '.atlas'
34
+ * ——显式用户意图恒压部署期产品默认。消费经 shared/configDir provider
35
+ * 槽惰性读(倒置 getter 形,shared 零 import 纯度)。
36
+ */
37
+ readonly configDirName?: string;
38
+ /**
39
+ * team durable 持久化档部署期缺省回落(0.1.100 W-D-B-1 段 D 批复形
40
+ * @bbe99518):settings teams.persistence 缺席时回落本值,再落 'memory'。
41
+ * **仅缺省回落**——读写点禁 product id 条件旁路(工单 §6 吸收①,§8 分档
42
+ * 门纪律);undefined = 'memory'(现网行为字节级不变)。
43
+ */
44
+ readonly teamPersistenceDefault?: 'memory' | 'durable';
45
+ }
46
+ /** 活跃产品定义(解析一次性:返回模块级冻结引用,禁调用方重解析/复制)。 */
47
+ export declare function getActiveProductDefinition(): ProductDefinition;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * shared/agentRoleTemplates — 0.1.93 W-D-A(Form A 临时小组,工单
3
+ * docs/2026-11-08-p0-wave-0193-ticket.md;f4 批复 2026-11-08)。
4
+ *
5
+ * 职责两件:
6
+ * 1. renderTeammatePrompt — spawn 触发点(Agent 扩参 name/team_name)的
7
+ * prompt 组装纯函数:把 TeamCreate members 名册(role/goal/backstory
8
+ * 三元组,CrewAI 词汇吸收)+ 任务 prompt 合成为成员首条指令。纯函数
9
+ * 零 I/O、零门依赖 → 落 shared(engine AgentTool 与未来 TUI 预览面
10
+ * 双消费)。
11
+ * 2. named 角色模板注册表(A4 载体)——role 标签 → 模板片段映射;
12
+ * renderTeammatePrompt 消费(命中则注入模板片段)。注册 = 组合根 /
13
+ * 域包显式装配(PRT-2 同型:非模块顶层自注册);缺省零注册 =
14
+ * render 恒等走名册三元组,零行为差。
15
+ */
16
+ /** named 角色模板(role 标签检索单元;systemPromptFragment = 组装时注入
17
+ * 的固定指令片段)。 */
18
+ export type AgentRoleTemplate = {
19
+ role: string;
20
+ systemPromptFragment?: string;
21
+ };
22
+ /** 组合根 / 域包注册(幂等 last-wins;测试 resetAgentRoleTemplates 复位)。 */
23
+ export declare function registerAgentRoleTemplate(template: AgentRoleTemplate): void;
24
+ /** role 标签检索(未注册 = undefined,render 走名册三元组)。 */
25
+ export declare function getAgentRoleTemplate(role: string): AgentRoleTemplate | undefined;
26
+ /** 测试复位(teardown 用)。 */
27
+ export declare function resetAgentRoleTemplates(): void;
28
+ /** renderTeammatePrompt 输入面(TeamCreate roster 条目 + Agent 任务 prompt)。 */
29
+ export type TeammatePromptParts = {
30
+ /** 成员名(spawn 身份)。 */
31
+ name: string;
32
+ /** 角色标签(命中注册表则注入模板片段)。 */
33
+ role?: string;
34
+ goal?: string;
35
+ backstory?: string;
36
+ /** 任务 prompt(Agent call 透传原文)。 */
37
+ prompt: string;
38
+ };
39
+ /**
40
+ * 合成成员首条指令:身份行 + 模板/角色元数据段 + 任务 prompt 原文。
41
+ * 纯函数(无 I/O 无门);roster 字段全可选(缺省只渲染任务 prompt +
42
+ * 身份行 = roster 未建组仍可 spawn 的退化面)。
43
+ */
44
+ export declare function renderTeammatePrompt(parts: TeammatePromptParts): string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Centralized runtime check for agent teams/teammate features.
3
+ * Opt-in: ATLAS_EXPERIMENTAL_AGENT_TEAMS env var OR --agent-teams flag.
4
+ */
5
+ export declare function isAgentSwarmsEnabled(): boolean;
@@ -0,0 +1,31 @@
1
+ /** 图片源读上限:128 MiB(上游 302:>128MB 应拒)。 */
2
+ export declare const MAX_IMAGE_SOURCE_BYTES: number;
3
+ /** 非 regular 文件(FIFO/设备/socket):类型拒绝,读循环/解码器不可达。 */
4
+ export declare class NonRegularFileError extends Error {
5
+ constructor(filePath: string, fileKindDescription: string);
6
+ }
7
+ /** 源超限:fstat 阶段(读取前)或读循环累计超限(增长守卫)拒绝。 */
8
+ export declare class ImageSourceTooLargeError extends Error {
9
+ constructor(filePath: string, sizeBytes: number, maxBytes: number);
10
+ }
11
+ /** 读循环 duck 句柄(fs.promises.FileHandle 满足;测试可注 fake)。 */
12
+ export interface BoundedReadHandle {
13
+ read(buffer: Buffer, offset: number, length: number, position: number | null): Promise<{
14
+ bytesRead: number;
15
+ }>;
16
+ close(): Promise<void>;
17
+ }
18
+ /**
19
+ * 有界读循环(核心):分块读至 EOF;单次读长 = min(chunk, 剩余预算+1)
20
+ * (增长面不整块过读);累计 > maxBytes 拒;chunk 间查 abort。
21
+ * 句柄 duck 注入面(单测 fake 无盘判别:EOF 恰内容/无穷流累计帽/abort)。
22
+ */
23
+ export declare function readBoundedFromHandle(handle: BoundedReadHandle, maxBytes: number, signal?: AbortSignal, sourcePath?: string): Promise<Buffer>;
24
+ /**
25
+ * 有界文件读:O_NONBLOCK 打开(FIFO/设备不阻塞等 producer)→ fstat
26
+ * 类型 + 大小双验(读取前)→ 有界读循环 → 恒 close(close 失败不吞读
27
+ * 结果;handle 非空态直接 .catch,无可选链短路面)。
28
+ */
29
+ export declare function readBoundedFileBytes(filePath: string, maxBytes: number, signal?: AbortSignal): Promise<Buffer>;
30
+ /** 图片源读固定上限面(K5-1 产品入口)。 */
31
+ export declare function readBoundedImageBytes(filePath: string, signal?: AbortSignal): Promise<Buffer>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 定长循环缓冲(C1 叶子下沉,整文件复制自旧仓 utils/CircularBuffer.ts)。
3
+ *
4
+ * 零依赖纯类:维护滚动数据窗口(shell 输出尾窗 / 日志环形缓冲等)。
5
+ */
6
+ /**
7
+ * A fixed-size circular buffer that automatically evicts the oldest items
8
+ * when the buffer is full. Useful for maintaining a rolling window of data.
9
+ */
10
+ export declare class CircularBuffer<T> {
11
+ private capacity;
12
+ private buffer;
13
+ private head;
14
+ private size;
15
+ constructor(capacity: number);
16
+ /**
17
+ * Add an item to the buffer. If the buffer is full,
18
+ * the oldest item will be evicted.
19
+ */
20
+ add(item: T): void;
21
+ /**
22
+ * Add multiple items to the buffer at once.
23
+ */
24
+ addAll(items: T[]): void;
25
+ /**
26
+ * Get the most recent N items from the buffer.
27
+ * Returns fewer items if the buffer contains less than N items.
28
+ */
29
+ getRecent(count: number): T[];
30
+ /**
31
+ * Get all items currently in the buffer, in order from oldest to newest.
32
+ */
33
+ toArray(): T[];
34
+ /**
35
+ * Clear all items from the buffer.
36
+ */
37
+ clear(): void;
38
+ /**
39
+ * Get the current number of items in the buffer.
40
+ */
41
+ length(): number;
42
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * 配置目录名(跨域纯叶子,C-Deep 切片 3 T5 下沉)
3
+ *
4
+ * 旧仓来源(a8af45b): src/utils/configDir.ts — getConfigDirName 单一事实源。
5
+ * permissions 域(DANGEROUS_DIRECTORIES / getAtlasTempDir* / isClaudeConfigFile)
6
+ * 与 sandbox 域(createSandboxManager 配置目录 denyWrite 族)共线消费,属跨 ≥2 域
7
+ * 纯叶子 → shared 下沉(L3 四域互不 import,shared 为唯一跨域叶子汇)。
8
+ *
9
+ * 纯叶子:只读 env + provider 槽,无域依赖。
10
+ *
11
+ * 0.1.99 S1a 步 2(工单 docs/2026-11-12-p0-wave-0199-s1a-step2-ticket.md §7
12
+ * lock-face 定谳):product.configDirName 维度激活——依赖方向 = **倒置惰性
13
+ * getter 形**(本文件持 provider 槽 + 组合根 compose.ts 注入,setSettingsPathsProvider
14
+ * 同款先例):shared 保零 import 纯度(禁反向 import ProductDefinition),
15
+ * provider 槽天然兼任 product 层判别格测试注入口。
16
+ *
17
+ * env 四层次序(lock-face 必改① 钉死,显式用户意图恒压部署期产品默认):
18
+ * 1. ATLAS_CONFIG_DIR —— 全路径显式(仅 homedir 锚出口;见下「双出口语义」)。
19
+ * 2. ATLAS_CONFIG_DIR_NAME —— 用户显式目录名。
20
+ * 3. product.configDirName —— 部署期产品默认(provider 槽惰性读,未注入 = 无此层)。
21
+ * 4. '.atlas' —— 缺省(无盘探;陈旧 `~/.claude` 不再把运行时拉回 legacy 目录)。
22
+ *
23
+ * 双出口语义(0.1.99 row F 批复 @f4 §8 b8a55c40,两维不同维禁混用):
24
+ * - `getConfigDirName()` —— **homedir 锚**(用户配置目录):四层全序。L1 全路径
25
+ * 经 `join(homedir(), v)` 绝对段重置后解析为显式目录本身,语义正确。
26
+ * - `getConfigDirNameForProject()` —— **项目根锚 / 名字标签**(repo 内 `.atlas`
27
+ * 点目录、managed 目录子路径、tmp 目录名标签、权限 pattern 串):剥 L1 的三层
28
+ * (NAME > product 默认 > '.atlas')。L1 是「用户配置目录全路径」,对项目点
29
+ * 目录=维度错配(join(repoRoot, 全路径) 绝对段重置 → 项目点目录漂移到用户
30
+ * 配置目录,canon 19 fail 单根因实证);名字标签位进全路径同样破坏匹配。
31
+ * - 恒等判据:ATLAS_CONFIG_DIR 未设时两出口同值(现网行为字节级不变)。
32
+ */
33
+ /** 产品配置目录名提供器(无参惰性 getter:读活跃 ProductDefinition 当前值)。 */
34
+ export type ConfigDirNameProvider = () => string | undefined;
35
+ /** 组合根注入产品配置目录名提供器(读 activeProduct.configDirName)。 */
36
+ export declare function setConfigDirNameProvider(provider: ConfigDirNameProvider): void;
37
+ /** 测试复位(teardown 用,防跨用例泄漏——mock.module 泄漏同族守)。 */
38
+ export declare function resetConfigDirNameProvider(): void;
39
+ /**
40
+ * 配置目录名(homedir 锚出口)。Clean migration:缺省恒 `.atlas`——无 legacy
41
+ * `~/.claude` 回落,供第二套 agent 平台同机共存而不互相写穿配置目录。
42
+ *
43
+ * 解析序见头注(env 四层:ATLAS_CONFIG_DIR > ATLAS_CONFIG_DIR_NAME >
44
+ * product.configDirName > '.atlas')。消费面 = homedir/XDG 锚(用户配置目录),
45
+ * 逐点分型清册见 docs/2026-11-12-0199-configdir-anchor-enumeration.md。
46
+ */
47
+ export declare function getConfigDirName(): string;
48
+ /**
49
+ * 配置目录名(项目根锚 / 名字标签出口)。剥 L1(ATLAS_CONFIG_DIR 全路径)的
50
+ * 三层解析:ATLAS_CONFIG_DIR_NAME > product.configDirName > '.atlas'。
51
+ *
52
+ * 消费面 = repo 内 `.atlas` 点目录(skills/worktrees/settings/rules/agent-memory
53
+ * 等 join(root, …))、managed 目录子路径、tmp 目录名标签、权限 pattern 串——
54
+ * 这些位置需要的是「名字」而非「用户配置目录全路径」。恒等判据:L1 未设时
55
+ * 与 getConfigDirName() 同值。
56
+ */
57
+ export declare function getConfigDirNameForProject(): string;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 跨域常量叶子(C-Deep 切片 3 T3:task 输出磁盘上限单一事实源)。
3
+ *
4
+ * 旧仓单一事实源分裂两处:utils/task/diskOutput.ts L30-31(
5
+ * MAX_TASK_OUTPUT_BYTES / MAX_TASK_OUTPUT_BYTES_DISPLAY)+
6
+ * utils/ShellCommand.ts L54(SIZE_WATCHDOG_INTERVAL_MS)。上限的两个
7
+ * 消费者在新仓分属两域——task(diskOutput:pipe 模式 DiskTaskOutput
8
+ * 超限只追加截断标记 + 丢 chunk)与 executor(ShellCommand:file 模式
9
+ * 5s 轮询 stat watchdog,超限 kill 后台任务)——L3 四域互不 import,
10
+ * shared 是唯一跨域叶子下沉处 → 上限落此单一事实源。watchdog 轮询
11
+ * 间隔单消费者(executor)→ 留 executor 域内(ShellCommand.ts 模块
12
+ * 常量),不随下沉。
13
+ *
14
+ * 显示串不再单设 DISPLAY 常量:两消费点改用 shared formatFileSize(bytes)
15
+ * 推导(默认 5GB → '5GB',与旧仓 '5GB' 字面一致;自定义上限时随值
16
+ * 缩放,优于旧仓硬编码字面)。
17
+ */
18
+ /** task 输出磁盘文件上限:5GB。pipe 模式丢弃线 = file 模式 watchdog kill 线。 */
19
+ export declare const MAX_TASK_OUTPUT_BYTES: number;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * debug 日志(charter C-4:本期不加第 9 port,logging port 定案前维持占位)。
3
+ *
4
+ * 单一事实源(C1 统一裁定):C-Deep 填 executor/sandbox stub 时旧仓 Shell.ts
5
+ * 会大量 import logForDebugging——禁止每域各复制一份 no-op(B 波
6
+ * modelprovider/debug.ts 先例已废)。logging port 定案后整文件替换为
7
+ * port 实现(签名不变,调用点零改动)。
8
+ *
9
+ * 0.1.93b 段 R-aux(f4 裁定 2026-11-09,工单 @c22716f6 §3):最小可注入
10
+ * sink 窗(Port 5/Port 1 set/get 双函数 + 模块级持有先例同型)。背景 =
11
+ * 0.1.93 W-D-A e2e 缺口回执:R-①/②/⑤ 判别格依赖的 swarm 域
12
+ * `[inProcessRunner]` debug 行(~30 处)import 自本文件 = 纯 no-op →
13
+ * 任何 lane 零输出,判别格空转;cli/debugSink.ts 完整 sink(--debug-file
14
+ * 落盘 + ISO 时间戳)此前仅绑 cli 域三文件。
15
+ *
16
+ * 缺省零行为变更(锁面②):sink 未注入 = 纯 no-op;仅 cli/debugSink 在
17
+ * 启动期(initDebugSink,--debug/--debug-file/env DEBUG 任一启用的既有
18
+ * 组合入口)注册注入。与 C-4 前向兼容——logging port 定案时整文件替换,
19
+ * set/get 窗口随替换面一并删除(登记:architecture-charter C-4 节扩格批注)。
20
+ */
21
+ export type DebugLogLevel = 'verbose' | 'debug' | 'info' | 'warn' | 'error';
22
+ export type DebugSink = (message: string, options?: {
23
+ level?: DebugLogLevel;
24
+ }) => void;
25
+ /** 启动期注入(cli/debugSink initDebugSink 唯一生产调用点;测试面可置 null 复位)。 */
26
+ export declare function setDebugSink(sink: DebugSink | null): void;
27
+ /** 当前 sink(诊断/测试断言面;未注入 = null)。 */
28
+ export declare function getDebugSink(): DebugSink | null;
29
+ /** 经注入 sink 转发;未注入 = no-op(缺省零输出零 I/O,锁面②)。 */
30
+ export declare function logForDebugging(message: string, options?: {
31
+ level: DebugLogLevel;
32
+ }): void;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * env 解析纯函数(shared 工具,B 波 S1 加)。
3
+ *
4
+ * 四域 config.ts 共用的 env 读取原语。纯函数无副作用(不依赖 debug/log),
5
+ * 旧仓 validateBoundedIntEnvVar 带 logForDebugging 依赖 → 此处剥离为纯函数,
6
+ * 调用方自行决定是否记录(charter L3 域自治:config 层不拉 cross-domain utils)。
7
+ */
8
+ /**
9
+ * 解析有界整数 env:缺失/无效 → defaultValue;parsed > upperLimit → cap 到 upperLimit。
10
+ * 语义对齐旧仓 validateBoundedIntEnvVar(剥掉 logForDebugging 依赖,
11
+ * message 字段随之删除——旧仓 message 仅 logForDebugging 消费)。
12
+ *
13
+ * 下界裁定(C1):默认 `min = 0`(0 合法,GLOB_TIMEOUT=0 表"不限时");
14
+ * timeout 类 env 传 `min = 1` 恢复旧仓"0 无效回落默认"语义。
15
+ *
16
+ * @param name env 变量名(仅用于返回 status,不做日志)
17
+ * @param value env 原始值
18
+ * @param defaultValue 缺失/无效时的回落值
19
+ * @param upperLimit 上限(parsed > upperLimit 时 cap)
20
+ * @param min 下界(默认 0;传 1 拒绝 0/负值)
21
+ */
22
+ export declare function parseBoundedIntEnv(name: string, value: string | undefined, defaultValue: number, upperLimit: number, min?: number): {
23
+ effective: number;
24
+ status: "valid" | "capped" | "invalid";
25
+ };
26
+ /**
27
+ * 判断 env 值是否为「真」:`1` / `true` / `yes` / `on`(trim + 大小写不敏感)→ true。
28
+ * 接受 boolean(透传)。语义 = 旧仓 utils/envUtils.ts isEnvTruthy(T3 布尔 env 约定)。
29
+ *
30
+ * C1 统一裁定:本函数是布尔 env 单一事实源——替代 B 波 parseBoolEnv(窄集合)
31
+ * 与 memory/modelprovider 域内本地副本;C1b 消费方全部切到本函数后其余形态删除。
32
+ */
33
+ export declare function isEnvTruthy(envVar: string | boolean | undefined): boolean;
34
+ /**
35
+ * 判断 env 值是否显式设为「假」:`0` / `false` / `no` / `off`(trim + 大小写不敏感)。
36
+ * undefined → false(未设不算显式假)。语义 = 旧仓 utils/envUtils.ts isEnvDefinedFalsy。
37
+ */
38
+ export declare function isEnvDefinedFalsy(envVar: string | boolean | undefined): boolean;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * 错误处理纯助手(C1 叶子下沉,复制自旧仓 utils/errors.ts 纯函数段)。
3
+ *
4
+ * 零依赖:仅错误对象形状检查,不 import 任何域/错误类(旧仓 error 类族
5
+ * TelemetrySafeError/AxiosErrorKind 等留在各自域,不随叶子下沉)。
6
+ * 消费者:catch 边界归一化 / fs 错误分类 / 工具结果回传模型的短栈提取。
7
+ */
8
+ export declare function hasExactErrorMessage(error: unknown, message: string): boolean;
9
+ /**
10
+ * Normalize an unknown value into an Error.
11
+ * Use at catch-site boundaries when you need an Error instance.
12
+ */
13
+ export declare function toError(e: unknown): Error;
14
+ /**
15
+ * Extract a string message from an unknown error-like value.
16
+ * Use when you only need the message (e.g., for logging or display).
17
+ */
18
+ export declare function errorMessage(e: unknown): string;
19
+ /**
20
+ * Extract the errno code (e.g., 'ENOENT', 'EACCES') from a caught error.
21
+ * Returns undefined if the error has no code or is not an ErrnoException.
22
+ * Replaces the `(e as NodeJS.ErrnoException).code` cast pattern.
23
+ */
24
+ export declare function getErrnoCode(e: unknown): string | undefined;
25
+ /**
26
+ * True if the error is ENOENT (file or directory does not exist).
27
+ * Replaces `(e as NodeJS.ErrnoException).code === 'ENOENT'`.
28
+ */
29
+ export declare function isENOENT(e: unknown): boolean;
30
+ /**
31
+ * Extract the errno path (the filesystem path that triggered the error)
32
+ * from a caught error. Returns undefined if the error has no path.
33
+ * Replaces the `(e as NodeJS.ErrnoException).path` cast pattern.
34
+ */
35
+ export declare function getErrnoPath(e: unknown): string | undefined;
36
+ /**
37
+ * Extract error message + top N stack frames from an unknown error.
38
+ * Use when the error flows to the model as a tool_result — full stack
39
+ * traces are ~500-2000 chars of mostly-irrelevant internal frames and
40
+ * waste context tokens. Keep the full stack in debug logs instead.
41
+ */
42
+ export declare function shortErrorStack(e: unknown, maxFrames?: number): string;
43
+ /**
44
+ * True if the error means the path is missing, inaccessible, or
45
+ * structurally unreachable — use in catch blocks after fs operations to
46
+ * distinguish expected "nothing there / no access" from unexpected errors.
47
+ *
48
+ * Covers:
49
+ * ENOENT — path does not exist
50
+ * EACCES — permission denied
51
+ * EPERM — operation not permitted
52
+ * ENOTDIR — a path component is not a directory (e.g. a file named
53
+ * `.claude` exists where a directory is expected)
54
+ * ELOOP — too many symlink levels (circular symlinks)
55
+ */
56
+ export declare function isFsInaccessible(e: unknown): e is NodeJS.ErrnoException;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * feature(name) — 特性灰度开关(charter d 裁定:普通模块, 非 bun:bundle 内建)
3
+ *
4
+ * 旧仓双形态(127 内建 bun:bundle + 45 F5 shim bunBundle.ts)→ 新仓统一为
5
+ * 本普通模块。解掉旧仓 bun:bundle feature() 测试中恒 false 不可测的坑
6
+ * (charter PRT-1 连带收益)。
7
+ *
8
+ * 机制:
9
+ * - 读 `FEATURE_<NAME>` env(大写), call-time 求值(非构建期常量)
10
+ * - `FEATURE_X=true` → 开; `FEATURE_X=false` → 显式关(压过 ON_BY_DEFAULT)
11
+ * - ON_BY_DEFAULT 集合中的 flag 未设 env 时默认开(生产 bundle 经本模块生效)
12
+ *
13
+ * 测试:直接 `process.env['FEATURE_X'] = 'true'` / `delete` 控制, 无需 preload。
14
+ *
15
+ * 域级 flag 不在此(扩展点机制 = DomainPackage.featureGate 声明式, charter PRT-1)。
16
+ * 远程实验配置(growthbook)走 Port 8 FeatureConfigPort, 不在此。
17
+ */
18
+ /**
19
+ * 特性灰度开关。call-time 读 env, 非构建期常量。
20
+ * @param name flag 名(大写, 如 "ASCEND_TOOLS")
21
+ * @returns true = 该特性当前开启
22
+ */
23
+ export declare function feature(name: string): boolean;
24
+ /** 导出 ON_BY_DEFAULT 供测试断言(只读副本, 不导出可变引用) */
25
+ export declare const FEATURE_ON_BY_DEFAULT: readonly string[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 字节大小格式化(C1 叶子下沉,复制自旧仓 utils/format.ts 的 formatFileSize)。
3
+ *
4
+ * 纯函数无 intl 依赖。旧仓消费者:modelprovider(PDF 尺寸回传)/
5
+ * memory(readFileInRange 超限提示)/ shell(输出统计)——跨 ≥2 域,归 shared。
6
+ */
7
+ /**
8
+ * Formats a byte count to a human-readable string (KB, MB, GB).
9
+ * @example formatFileSize(1536) → "1.5KB"
10
+ */
11
+ export declare function formatFileSize(sizeInBytes: number): string;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * 文件系统抽象(C1 下沉,跨 ≥2 域:memory FileSystemMemoryStore +
3
+ * C-Deep executor Shell.ts 移植(旧仓 utils/fsOperations.ts 消费方含 Shell.ts/debug.ts 等 10+ 文件))。
4
+ *
5
+ * 从 memory/fsOperations.ts 的 B 波裁剪版上移:最小集(旧仓 60+ 方法全量 YAGNI)。
6
+ * C-Deep 时 executor 若需更多原语(writeFile/appendFile/rm…)→ 接口**加法式**扩展,
7
+ * 不另开第二份抽象(防腐:fs 抽象单一事实源在 shared)。
8
+ *
9
+ * slowOperations 计时 / errors.getErrnoCode 依赖已断开。
10
+ * mkdir 的 EEXIST 容错保留(Bun/Windows 只读目录位误判,旧仓 issue 30924)。
11
+ */
12
+ import * as fs from 'fs';
13
+ import { type FileHandle } from 'fs/promises';
14
+ /**
15
+ * 最小 FS 操作集(跨域共享,C-Deep 按需加法扩展)。
16
+ *
17
+ * C-Deep 切片 1 加法(executor Shell.ts 消费;防腐口径不变:fs 抽象单一
18
+ * 事实源在 shared,executor 不直连 node:fs):
19
+ * - mkdir 加 mode 参数(沙箱临时目录 0o700;recursive + EEXIST 容错语义不变)
20
+ * - realpathSync(setCwd 符号链接解析 + cwd 消失恢复,旧仓 fsOperations 同名原语)
21
+ * - open(file 模式 spawn fd:O_WRONLY|O_CREAT|O_APPEND|O_NOFOLLOW)
22
+ * - unlinkSync(cwd 跟踪临时文件清理,ENOENT 容错在调用方)
23
+ *
24
+ * E-3 S-3b 加法(engine/config settings 加载/写回消费;旧仓 settings.ts 经
25
+ * getFsImplementation 走 sync 面,单测 mock 注入无真实磁盘):
26
+ * - readdirSync(withFileTypes,managed-settings.d drop-in 枚举)
27
+ * - writeFileSync(settings 写回,UTF-8 字符串;旧仓 writeFileSyncAndFlush 的
28
+ * fsync 段为 durability 优化,新仓裁剪——settings 非 durability 敏感数据)
29
+ * - mkdirSync(写回前建目录,recursive + EEXIST 容错,同 async mkdir 语义)
30
+ *
31
+ * E-4 S-4c1 加法(engine/permissions 规则磁盘加载/写回消费):
32
+ * - lstatSync(safeResolvePath 特殊文件守卫)
33
+ * - safeResolvePath 助手(接口外纯函数,旧仓 utils/fsOperations.ts:138 逐字)
34
+ *
35
+ * §8.55 S-C1 加法(engine/tools/files 依赖闭包层消费,旧仓
36
+ * utils/fsOperations.ts NodeFsOperations 同名原语逐字,slowLogging 裁):
37
+ * - readFileBytes(fs.readFile 无 encoding → Buffer;FileRead 图像支
38
+ * 消费;readFile 强制 encoding 成员不复用)
39
+ * - readSync(openSync + readSync(fd) + closeSync 逐字,非 Node 22
40
+ * fs.readSync(path, opts) 新 API;detectLineEndings 4KB 采样)
41
+ * - isDirEmptySync(readdirSync withFileTypes length===0 逐字)
42
+ * - readlinkSync / renameSync(writeFileSyncAndFlush_DEPRECATED 原子写
43
+ * 面符号链接保留 + 原子 rename)
44
+ *
45
+ * 存量 setFsImplementation 测试 stub(9 文件字面实现)不补新成员:
46
+ * tests/ 不在 tsconfig include(tsc 0 基线实证)+ 各 stub 消费面
47
+ * 零调用新成员(运行时安全)——E-4 lstatSync 加法同款裁定先例。
48
+ *
49
+ * 0.1.84 V3-5 K5-3 加法(readFileSyncWithMetadata 全量字节无损判别消费):
50
+ * - readFileBytesSync(fs.readFileSync 无 encoding → Buffer;readFileBytes
51
+ * 的同步 twin,readFileSync 强制 encoding 成员不复用——同款先例;命名对齐
52
+ * TUI 本地 twin 既有同名成员,fileRead 双体逐字同构)
53
+ * 例外登记:sc1-fs/notebook-se2 两 stub 消费面非零(驱动
54
+ * readFileSyncWithMetadata 链),已补成员;其余 stub 维持零消费。
55
+ */
56
+ export type FsOperations = {
57
+ cwd(): string;
58
+ existsSync(path: string): boolean;
59
+ stat(path: string): Promise<fs.Stats>;
60
+ readdir(path: string, options?: {
61
+ recursive?: boolean;
62
+ }): Promise<fs.Dirent[]>;
63
+ mkdir(path: string, options?: {
64
+ mode?: number;
65
+ }): Promise<void>;
66
+ readFile(path: string, options: {
67
+ encoding: BufferEncoding;
68
+ }): Promise<string>;
69
+ readFileSync(path: string, options: {
70
+ encoding: BufferEncoding;
71
+ }): string;
72
+ readFileBytesSync(path: string): Buffer;
73
+ statSync(path: string): fs.Stats;
74
+ realpathSync(path: string): string;
75
+ open(path: string, flags: number): Promise<FileHandle>;
76
+ unlinkSync(path: string): void;
77
+ readdirSync(path: string): fs.Dirent[];
78
+ writeFileSync(path: string, data: string): void;
79
+ mkdirSync(path: string): void;
80
+ lstatSync(path: string): fs.Stats;
81
+ readFileBytes(path: string): Promise<Buffer>;
82
+ readSync(path: string, options: {
83
+ length: number;
84
+ }): {
85
+ buffer: Buffer;
86
+ bytesRead: number;
87
+ };
88
+ isDirEmptySync(path: string): boolean;
89
+ readlinkSync(path: string): string;
90
+ renameSync(oldPath: string, newPath: string): void;
91
+ };
92
+ export declare const NodeFsOperations: FsOperations;
93
+ /** 覆盖 FS 实现(测试注入)。 */
94
+ export declare function setFsImplementation(implementation: FsOperations): void;
95
+ /** 当前活跃 FS 实现。 */
96
+ export declare function getFsImplementation(): FsOperations;
97
+ /** 重置为 Node 默认实现。 */
98
+ export declare function setOriginalFsImplementation(): void;
99
+ /**
100
+ * 安全解析路径(E-4 S-4c1 加法,旧仓 utils/fsOperations.ts:138 逐字):
101
+ * realpath 解析 + 符号链接判定,失败回落原路径(不抛)。
102
+ *
103
+ * 语义(旧仓逐字):
104
+ * - UNC 路径(// 或 \\ 开头)在任何 fs 访问前阻塞(Windows DNS/SMB 防网络请求)
105
+ * - 特殊文件(FIFO/socket/字符/块设备)不 realpath(realpathSync 会阻塞等写入者)
106
+ * - 文件不存在 / 符号链接断裂 / EACCES / ELOOP → 回落原路径(允许文件创建场景)
107
+ * - isCanonical = realpath 成功(全路径分量符号链接已解,调用方可跳过再解析)
108
+ *
109
+ * 消费点:engine/permissions permissionRulesLoader lenient reader +
110
+ * permissionSetup isSymlinkTo(H6 实挂)。
111
+ */
112
+ export declare function safeResolvePath(fs: FsOperations, filePath: string): {
113
+ resolvedPath: string;
114
+ isSymlink: boolean;
115
+ isCanonical: boolean;
116
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * djb2 字符串哈希(跨域纯叶子,C-Deep 切片 3 T5 下沉)
3
+ *
4
+ * 旧仓来源(a8af45b): src/utils/hash.ts — djb2Hash 单一事实源。
5
+ * sanitizePath 的 Node 兜底分支消费(Bun.hash 不可用时),跨域纯叶子 →
6
+ * shared 下沉。
7
+ */
8
+ /**
9
+ * djb2 字符串哈希——快速非加密哈希,返回有符号 32 位 int。跨运行时确定性
10
+ * (区别于 Bun.hash 的 wyhash)。Bun.hash 不可用或需盘上稳定输出(如须
11
+ * 跨运行时升级存活的缓存目录名)时作兜底。
12
+ */
13
+ export declare function djb2Hash(str: string): number;
@@ -0,0 +1,23 @@
1
+ export declare const PRODUCT_NAME = "AtlasCode";
2
+ export declare const PACKAGE_NAME = "@atlasharness/atlascode";
3
+ export declare const REPOSITORY_URL = "https://github.com/vincentlau2046/AtlasCode";
4
+ /**
5
+ * 仓库 slug(owner/repo 形,0.1.98 S1a 焊点① 派生自 REPOSITORY_URL 单一事实源
6
+ * ——coordinatorMode 提示词示例产品串注入消费;禁 engine 域字面回归,判据 =
7
+ * literal-inventory 域级 grep)。
8
+ */
9
+ export declare const REPOSITORY_SLUG: string;
10
+ /**
11
+ * 品牌身份扩常量(BR-1,spec §6.2)——identity 单一事实源落地:
12
+ * 家族共享名 / 对外品牌名 / 反馈通道 / 强调色相配方。
13
+ */
14
+ export declare const PRODUCT_FAMILY = "Atlas";
15
+ export declare const PRODUCT_BRAND = "AtlasCode";
16
+ export declare const FEEDBACK_CHANNEL = "https://github.com/vincentlau2046/AtlasCode/issues";
17
+ export declare const ACCENT_HUE = "compute";
18
+ export declare function getVersion(): string;
19
+ /** LLM 出站 User-Agent 品牌串(与 tui/utils/http.ts `AtlasCode/<v> (repo)` 语义对齐,无字面 `+`)。 */
20
+ export declare function buildUserAgent(): string;
21
+ /** WebFetch UA 共用 builder(tui `getWebFetchUserAgent` ④ 与 engine `WEB_FETCH_USER_AGENT` ⑤ 同一出处,零分叉)。
22
+ * 'Atlas-User' = 家族级 WebFetch agent 名(robots.txt 匹配串,Branded House 共享面,§10.3 spec §12)。 */
23
+ export declare function buildWebFetchUserAgent(): string;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * shared 模块唯一公共出口(STR-1 门面规则)。
3
+ *
4
+ * 外部模块只许 `import { ... } from "../shared.js"`(或 "src/shared"),
5
+ * 不许 reach 内部文件(entry-point lint 拦截)。
6
+ *
7
+ * re-export: feature(A 波已实现)/ types / types-session /
8
+ * identity / sanitizeToolName / tokenEstimation(随各文件 B/C 波落地)
9
+ */
10
+ export { feature, FEATURE_ON_BY_DEFAULT } from "./feature.js";
11
+ export { PRODUCT_NAME, PACKAGE_NAME, REPOSITORY_URL, REPOSITORY_SLUG, // 0.1.98 S1a 焊点①(owner/repo 派生,coordinatorMode 提示词消费)
12
+ PRODUCT_FAMILY, PRODUCT_BRAND, FEEDBACK_CHANNEL, ACCENT_HUE, getVersion, buildUserAgent, buildWebFetchUserAgent, } from "./identity.js";
13
+ export { parseBoundedIntEnv, isEnvTruthy, isEnvDefinedFalsy } from "./env.js";
14
+ export { escapeRegExp, capitalize, plural, firstLineOf, countCharInString, normalizeFullWidthDigits, normalizeFullWidthSpace, safeJoinLines, EndTruncatingAccumulator, truncateToLines, } from "./stringUtils.js";
15
+ export { CircularBuffer } from "./circular-buffer.js";
16
+ export { hasExactErrorMessage, toError, errorMessage, getErrnoCode, isENOENT, getErrnoPath, shortErrorStack, isFsInaccessible, } from "./errors.js";
17
+ export { formatFileSize } from "./format.js";
18
+ export { MAX_IMAGE_SOURCE_BYTES, NonRegularFileError, ImageSourceTooLargeError, readBoundedFileBytes, readBoundedFromHandle, readBoundedImageBytes, type BoundedReadHandle, } from "./boundedImageRead.js";
19
+ export { PDF_PAGE_IMAGE_MAX_BYTES, readPDFPageImages, type PDFPageImageBlock, } from "./pdfPageImages.js";
20
+ export { decodeTextLosslessly, hasUtf16LeBom, UndecodableTextError, type DecodedText, } from "./textEncoding.js";
21
+ export { MAX_TASK_OUTPUT_BYTES } from "./constants.js";
22
+ export { getConfigDirName, getConfigDirNameForProject, setConfigDirNameProvider, resetConfigDirNameProvider, type ConfigDirNameProvider, } from "./configDir.js";
23
+ export { TEAM_FILE_SCHEMA_VERSION, STALE_LOCK_MS, LOCK_RETRY_MAX, teamFileV2Schema, parseTeamFileV2, getLeadInstanceId, resetLeadInstanceId, getTeamsDirShared, getTeamFilePathShared, decideStaleLock, writeTeamFileV2Atomic, readTeamFileV2, sweepTmpOrphans, type TeamPersistenceMode, type TeamAllowedPath, type TeamRosterEntry, type TeamMemberV2, type TeamFileV2, type TeamFileLegacyExtras, type TeamFile, type ParsedTeamFileV2, } from "./teamFileSchema.js";
24
+ export { INBOX_SCHEMA_VERSION, MAX_INBOX_MESSAGES, inboxMessageSchema, inboxEnvelopeSchema, readInboxFile, writeInboxFileAtomic, isInboxSourceAllowed, inboxFullWarning, type InboxMessageSource, type SharedInboxMessage, type InboxEnvelope, type ReadInboxResult, } from "./teamInboxSchema.js";
25
+ export { getAtlasTempDirName } from "./tempDir.js";
26
+ export { getPlatform, SUPPORTED_PLATFORMS, type Platform, } from "./platform.js";
27
+ export { expandPath, containsPathTraversal, sanitizePath, MAX_SANITIZED_LENGTH, } from "./path.js";
28
+ export { containsVulnerableUncPath } from "./unc.js";
29
+ export { djb2Hash } from "./hash.js";
30
+ export { lazySchema } from "./lazySchema.js";
31
+ export { logForDebugging, type DebugLogLevel } from "./debug.js";
32
+ export { setDebugSink, getDebugSink, type DebugSink } from "./debug.js";
33
+ export { logError } from "./log.js";
34
+ export { windowsPathToPosixPath, posixPathToWindowsPath, } from "./windowsPaths.js";
35
+ export { NodeFsOperations, setFsImplementation, getFsImplementation, setOriginalFsImplementation, safeResolvePath, type FsOperations, } from "./fs-operations.js";
36
+ export { roughTokenCountEstimation, bytesPerTokenForFileType, roughTokenCountEstimationForFileType, } from "./tokenEstimation.js";
37
+ export type * from "./types.js";
38
+ export { EFFORT_LEVELS, asSystemPrompt } from "./types.js";
39
+ export type * from "./types-session.js";
40
+ export { resolveMailboxPermissionDeadlineMs, approvalUnavailableReason, } from "./permissionDeadline.js";
41
+ export { collectPDFReferenceAttachmentsForCompact, formatPDFReferenceForModel, FullPDFReadUnsupportedError, projectPDFReferenceForRecord, type PDFReferenceMetadata, } from "./pdfReference.js";
42
+ export { isAgentSwarmsEnabled } from "./agentSwarmsEnabled.js";
43
+ export { SWARM_FIELDS_BY_TOOL, filterSwarmFieldsFromSchema, } from "./swarmSchemaFilter.js";
44
+ export { type AgentRoleTemplate, registerAgentRoleTemplate, getAgentRoleTemplate, resetAgentRoleTemplates, type TeammatePromptParts, renderTeammatePrompt, } from "./agentRoleTemplates.js";
45
+ export { type TeammateContext, getTeammateContext, runWithTeammateContext, isInProcessTeammate, createTeammateContext, } from "./teammateContext.js";
46
+ export { getActiveProductDefinition, type ProductDefinition, } from "./ProductDefinition.js";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 懒加载 schema 工厂(跨域纯叶子,C-Deep 切片 3 T5 下沉)
3
+ *
4
+ * 旧仓来源(a8af45b): src/utils/lazySchema.ts — 零依赖 memoize 工厂。
5
+ * permissions 域 PermissionRule.ts(zod schema 延迟到首调构造,避免模块 init
6
+ * 期构建)消费;跨域纯叶子 → shared 下沉。
7
+ */
8
+ /**
9
+ * 返回一个 memoize 工厂函数:首调时才构造值,之后恒返回缓存。
10
+ * 用于把 Zod schema 构造从模块 init 期推迟到首次访问。
11
+ */
12
+ export declare function lazySchema<T>(factory: () => T): () => T;
@@ -0,0 +1 @@
1
+ export declare function logError(error: unknown): void;