@epoch-agent/core 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +28 -0
  2. package/dist/index.d.ts +535 -112
  3. package/dist/index.js +2586 -2489
  4. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1369,6 +1369,16 @@ interface MemorySearchResult {
1369
1369
  score: number;
1370
1370
  similarity?: number;
1371
1371
  }
1372
+ /** {@link MemoryManager.read} 的结果。**认不出的 id 单独一栏**,不是静默丢掉 */
1373
+ interface MemoryReadResult {
1374
+ found: Array<{
1375
+ id: string;
1376
+ target: MemoryTarget;
1377
+ content: string;
1378
+ }>;
1379
+ /** 索引里没有这个 id。多半是模型自己编了一个,或者引用了上个会话的索引 */
1380
+ missing: string[];
1381
+ }
1372
1382
  /** 数据库中的记忆条目 */
1373
1383
  interface MemoryEntry {
1374
1384
  id: string;
@@ -1382,8 +1392,15 @@ interface MemoryEntry {
1382
1392
  lastAccessedAt: Date;
1383
1393
  }
1384
1394
  interface MemoryConfig {
1395
+ /** `MEMORY.md` 能存多少字符。**存储**配额,不进 prompt,抬它几乎不花钱 */
1385
1396
  memoryCharLimit: number;
1397
+ /** `USER.md` 能存多少字符。同上 */
1386
1398
  userCharLimit: number;
1399
+ /**
1400
+ * 索引块进 system prompt 的字符上限 —— 三个数里**唯一按轮计费**的那个。
1401
+ * 对照表在 protocol 的 `EpochConfig.memory` 上。
1402
+ */
1403
+ indexCharLimit: number;
1387
1404
  }
1388
1405
  interface MemoryManager$1 {
1389
1406
  /** 会话启动:加载文件 → 去重 → 注入扫描 → 冻结快照 → 返回 system prompt 块 */
@@ -1397,9 +1414,15 @@ interface MemoryManager$1 {
1397
1414
  search(query: string, limit?: number): Promise<MemorySearchResult[]>;
1398
1415
  keywordSearch(query: string, limit?: number): Promise<MemorySearchResult[]>;
1399
1416
  semanticSearch(query: string, limit?: number): Promise<MemorySearchResult[]>;
1417
+ /** 按索引里的短 id 取全文。索引块印的 id 就是这里认的那一套 */
1418
+ read(ids: readonly string[]): Promise<MemoryReadResult>;
1400
1419
  add(target: MemoryTarget, content: string): Promise<MemoryWriteResult>;
1401
1420
  replace(target: MemoryTarget, oldText: string, content: string): Promise<MemoryWriteResult>;
1402
- remove(target: MemoryTarget, oldText: string): Promise<void>;
1421
+ /**
1422
+ * 删一条。`ref` 是**全文**或索引里那个**短 id**。
1423
+ * 返回删没删掉 —— 报「已删除」而其实一条没动,会让模型以为腾出了地方。
1424
+ */
1425
+ remove(target: MemoryTarget, ref: string): Promise<boolean>;
1403
1426
  getBudget(): {
1404
1427
  memory: BudgetInfo;
1405
1428
  user: BudgetInfo;
@@ -1412,10 +1435,29 @@ interface MemoryManager$1 {
1412
1435
  /**
1413
1436
  * memory 工具 — 让 LLM 显式读写长期记忆。
1414
1437
  *
1415
- * MemoryManager.sync() 不自动写入(见 manager.ts:97),记忆的产生完全依赖
1438
+ * MemoryManager.sync() 不自动写入(见 manager.ts),记忆的产生完全依赖
1416
1439
  * 本工具被调用。没有它,MemoryManager 只能读不能写。
1417
1440
  *
1418
- * 对标 Hermes tools/memory_tool.py 的 action 分发形式。
1441
+ * ---
1442
+ *
1443
+ * # ⚠️ 改这个文件里的 `description` / `parameters` = 34 段 eval 录像作废
1444
+ *
1445
+ * 工具定义(名字 / 描述 / 参数)进 eval 的新鲜度指纹
1446
+ * (`evals/harness/fingerprint.ts`,那个文件头说得很清楚为什么必须进)。
1447
+ * 于是这里改一个字,`pnpm eval` 全红,而 pre-push 会跑它。
1448
+ *
1449
+ * **2026-09-10 那一轮是明知代价改的**:`read` 这个 action 是记忆结构改造
1450
+ * (正文不再全量进 prompt,见 `memory/manager.ts` 文件头)**必需**的另一半 ——
1451
+ * 没有它,索引块里那些 id 一个也取不回全文,那不是「少一个便利」,
1452
+ * 是把记忆变成只有摘要。
1453
+ *
1454
+ * 收账走 `evals/README.md` 里那条**「只重贴指纹」的窄例外**(它成立的前提是
1455
+ * 「改的是工具表增量、system prompt 没动」,而这一轮 system prompt 那一侧
1456
+ * 恰好没动 —— 空库的索引块是空串,判据在 `manager.ts` 文件头最后一节)。
1457
+ * 例外带**举证义务**:拿真 key 对最可能被干扰的那几条 eval 录活体,
1458
+ * 数 `memory` 在 `toolCalls` 里出现几次,必须是 0。
1459
+ *
1460
+ * ⚠️ 下次再想在这儿加一句话之前先问:**非说在工具描述里不可吗**。
1419
1461
  */
1420
1462
 
1421
1463
  declare function createMemoryTool(memory: MemoryManager$1): EpochTool;
@@ -1845,91 +1887,6 @@ interface PlanModeDeps {
1845
1887
  */
1846
1888
  declare function createPlanModeTools(deps: PlanModeDeps): EpochTool[];
1847
1889
 
1848
- /**
1849
- * `plugin_validate` / `plugin_pack` —— 模型**做一个插件包**的那两条路(2026-09-09)。
1850
- *
1851
- * ## 一、⚠️ 刻意**没有** `plugin_install`,而那是这个文件的正题
1852
- *
1853
- * 装一个插件会往用户机器上落下 `hooks.json`(每一条都是会 spawn 的 shell 命令)
1854
- * 和 `mcp.json`(stdio 那档同样起子进程)。整套安装链上给人的那道闸门就是
1855
- * 「装之前看一屏预览再确认」(`core/src/plugin/install.ts` 的 `confirm`),
1856
- * 而把安装交给模型等于**让被审批的一方自己按下确认**。
1857
- *
1858
- * 所以这两个工具在**打出那个包**那一步停住,回执里明写交接点:
1859
- * `epoch plugin install <zip>`(本机压缩包那一档是现成的路,见 `source.ts`)。
1860
- * ⚠️ **想加安装的时候要答的问题是「模型给用户装了一条 PreToolUse hook,
1861
- * 他从哪儿知道」**,而不是「能力层已经有这个函数了」——
1862
- * 判据同 `skill-write.ts` 第三节对 `delete` 的处置。
1863
- *
1864
- * ## 二、为什么值得有这两个工具(模型手上明明有 `file_write`)
1865
- *
1866
- * 因为它们恰好是 `file_write` 做不对的那两件:
1867
- *
1868
- * | 模型要答的问题 | 只有 file_write 时 | 有了这两个 |
1869
- * | -------------------------- | ------------------------ | ------------------------------ |
1870
- * | 「我这个目录算不算插件」 | 猜,或者读一遍文档再猜 | {@link PLUGIN_VALIDATE_TOOL} |
1871
- * | 「装进去会带来什么」 | 答不上来 | 同上(六类扩展物盘点) |
1872
- * | 「打成包」 | 做不到(要起 tar) | {@link PLUGIN_PACK_TOOL} |
1873
- *
1874
- * 校验那一条**复用安装时那一份**(`readPluginManifest` + `scanPluginDir`),
1875
- * 和 `epoch plugin validate` 逐字节同一条判据 —— 于是「这里绿了装上去就不会因为
1876
- * 格式被拒」这句话对模型和对人是同一句。**不为模型另写一份校验**:两份的那天,
1877
- * 模型会照着一份不作数的规则改文件。
1878
- *
1879
- * ## 三、⚠️ `plugin_pack` 归 `file_write` 不归 `command`,虽然它 spawn `tar`
1880
- *
1881
- * 反过来那条判据(`runtime/src/mcp-tools.ts` 第一节:`mcp_add` 归 `command`,
1882
- * 因为「写一台 stdio server 就是配一条以后会被 spawn 的命令行」)在这里
1883
- * **结论相反**,而理由是同一条:
1884
- *
1885
- * - 那 argv 是定死的(`tar -c -f <zip> --format zip -C <dir> -T <list>`),
1886
- * **不过 shell**,模型能控的只有两条路径 —— 它配不出一条命令行;
1887
- * - `PermissionManager.ruleMatches` 按**类别**授权(规则到不了工具名这一级),
1888
- * 于是一条 `allow: plugin_pack` 如果归 `command`,顺带放行的是**任意进程启动**。
1889
- * 而用户在审批框里真正要判的是「把这个目录打成一个包写到那儿」,那是 `file_write`。
1890
- *
1891
- * ## 四、⚠️ 两个工具都吃工作区闸门(`isInWorkspace`),这是唯一一处边界
1892
- *
1893
- * `planPack` 会**递归走完整个目录**,`packPlugin` 会把它写成一个 zip ——
1894
- * 不卡边界的话这一对就是一条「读任意目录 + 写任意位置」的原语。
1895
- * 判定走 infra 那一份(全仓唯一,验收 #11),相对路径按 `ctx.workDir` 解析。
1896
- *
1897
- * ⚠️ 顺带还有一道**天然的**闸,比上面那道更早生效:`planPack` 第一句就是
1898
- * `readPluginManifest(dir)`,没有 `epoch-plugin.json` 直接拒。也就是说这条路
1899
- * 打不出「随便一个目录的包」—— 目标必须先是一个插件。
1900
- *
1901
- * ## 五、错误话术为什么是英文
1902
- *
1903
- * 判据逐字同 [skill-view.ts](./skill-view.js) 第七节。⚠️ 但**下一层的 `t()`
1904
- * 措辞原样转发**(`plugin_manifest.*` / `plugin_pack.*` 那几句)——
1905
- * 那些话里带着字段路径和文件路径,是模型下一步唯一的依据,翻一遍只会译丢。
1906
- * 口径同 `mcp-tools.ts` 第四节。
1907
- */
1908
-
1909
- /**
1910
- * 两个工具名。**这是同构位置的真源** —— 另外两处认它们:
1911
- * `permission/operation-type.ts`(`plugin_validate` 进 `FILE_READ_TOOLS`,
1912
- * `plugin_pack` 进 `FILE_WRITE_TOOLS`)、`docs/TOOLS.md` 顶上那张表
1913
- * (两处由根 `__tests__/tool-registration.test.ts` 守着)。
1914
- *
1915
- * ⚠️ **下面 `name:` 那几格写的是字面量,不是这些常量,别「顺手」统一** ——
1916
- * 判据全文在 `SKILL_VIEW_TOOL` 的 JSDoc 上。
1917
- */
1918
- declare const PLUGIN_VALIDATE_TOOL = "plugin_validate";
1919
- declare const PLUGIN_PACK_TOOL = "plugin_pack";
1920
- /**
1921
- * 建那两个插件写作工具。
1922
- *
1923
- * **一个服务都不要,所以无条件注册** —— 口径同 `createMcpTools` 那句「控制面在
1924
- * 就全部注册」。它们的边界不是「有没有依赖」,是权限管线 + 工作区闸门,
1925
- * 两者都在每一次调用时才生效。
1926
- *
1927
- * 交出一个数组而不是两个 `createXxxTool`:装配层那一侧是一行
1928
- * `registry.registerTools(...)`,分成两个等于让「再加一个」变成一次要改两个文件的
1929
- * 改动,而漏接的表现是那个工具静默不存在(判据同 `createSkillWriteTools`)。
1930
- */
1931
- declare function createPluginAuthorTools(): EpochTool[];
1932
-
1933
1890
  /**
1934
1891
  * `schedule_draft` —— 在对话里**起草**一条定时任务,交给人去审。
1935
1892
  *
@@ -5240,6 +5197,20 @@ declare function resolveSource(raw: string): ResolvedSource | undefined;
5240
5197
  *
5241
5198
  * 不是「警告之后照装」。带 `#sha256=` 的 URL 说明用户在乎可重现性,
5242
5199
  * 而一个内容变了的压缩包和一个被替换掉的压缩包,在这一层是同一件事。
5200
+ *
5201
+ * ## ⚠️ 装这一下**没有对应的模型工具**,而那是判断不是缺口
5202
+ *
5203
+ * 装一个插件会往用户机器上落下 `hooks.json`(每一条都是会 spawn 的 shell 命令)
5204
+ * 和 `mcp.json`(stdio 那档同样起子进程),而整条安装链上给人的闸门就是
5205
+ * {@link InstallOptions.confirm} 那一屏 —— **把安装交给模型等于让被审批的一方
5206
+ * 自己按下确认**。判据同 `tools/builtin/skill-write.ts` 第三节对 `delete` 的处置。
5207
+ *
5208
+ * 这条判断的家原来在 `tools/builtin/plugin-author.ts` 的文件头上,而那个文件
5209
+ * 2026-09-10 整个删了(`plugin_validate` / `plugin_pack` 移除,模型侧现在一个
5210
+ * 插件工具都没有)—— 搬到这儿是因为**它和那两个工具在不在没关系**:只要这条
5211
+ * 安装链还在,「要不要给模型一个 `plugin_install`」就还会被问一次。
5212
+ * ⚠️ 想加的时候要答的问题是**「模型给用户装了一条 hook,他从哪儿知道」**,
5213
+ * 而不是「能力层已经有这个函数了」。
5243
5214
  */
5244
5215
 
5245
5216
  interface InstallOptions {
@@ -5307,7 +5278,16 @@ interface InstallPreview {
5307
5278
  manifest: PluginManifest;
5308
5279
  source: ResolvedSource;
5309
5280
  inventory: PluginInventory;
5310
- /** 已经装过的同名插件;有值时这次安装会被拒(验收 #8) */
5281
+ /**
5282
+ * 已经装过的同名插件;有值时这次安装会被拒(验收 #8)。
5283
+ *
5284
+ * ⚠️ **`replace` 命中的那一条不算**(2026-09-10):`epoch plugin update` 走的
5285
+ * 就是「同名重装一遍」,那条记录是**被替换的那一个**,不是挡路的。判据在
5286
+ * {@link InstallOptions.replace} 上(「所以同名不是冲突」那句从一开始就写着)。
5287
+ *
5288
+ * 这一格是**结论**不是事实 —— 它答的是「这次会不会被拒」,不是「锁里有没有
5289
+ * 同名的」。写成后者的代价见 `runInstall` 里算它那两行上的注释。
5290
+ */
5311
5291
  conflict?: PluginRecord;
5312
5292
  /**
5313
5293
  * 清单里的 `epochVersion` 和当前引擎不匹配:**装得上,但加载器会跳过它**。
@@ -5495,6 +5475,7 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
5495
5475
  * {
5496
5476
  * "name": "acme",
5497
5477
  * "owner": { "name": "Acme Inc." },
5478
+ * "display": { "fields": ["status", "downloads", "author"] },
5498
5479
  * "plugins": [
5499
5480
  * {
5500
5481
  * "name": "toolkit",
@@ -5502,6 +5483,7 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
5502
5483
  * "source": "./plugins/toolkit",
5503
5484
  * "category": "dev",
5504
5485
  * "author": { "name": "张三" },
5486
+ * "status": "listed",
5505
5487
  * "downloads": 1240,
5506
5488
  * "likes": 87
5507
5489
  * }
@@ -5512,6 +5494,16 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
5512
5494
  * ⚠️ `downloads` / `likes` 是**市场那一侧数的**,而且**冻在加市场那一刻**
5513
5495
  * (目录是快照,见下面第二节)—— 判据在那两格自己的注释上。
5514
5496
  *
5497
+ * ## 顶上那格 `display`:**市场自己说印哪几格**(2026-09-10)
5498
+ *
5499
+ * 在它之前,「印不印作者」这件事只有一个开关 —— **填没填**。于是一个既想在自己
5500
+ * 后台记着作者、又不想在这套界面上印它的市场,没有任何写法表达得出来。
5501
+ *
5502
+ * `display.fields` 是一张**白名单**,只管徽标 / 元信息那一档(名单和「为什么承重
5503
+ * 的那几格一格都不在里面」在 {@link MARKETPLACE_DISPLAY_FIELDS} 上)。
5504
+ * ⚠️ **整格不写 = 照旧「填了就画」** —— 存量目录一个字都不用改,
5505
+ * 判据在 `DisplaySchema.fields` 上那张三行的表。
5506
+ *
5515
5507
  * ## ⚠️ 「没有上传接口」这句话 2026-09-08 改了半句
5516
5508
  *
5517
5509
  * 原话是「没有服务端、没有账号、**没有上传接口**、没有审核」。改的是第三句 ——
@@ -5565,10 +5557,42 @@ declare const EntrySchema: z.ZodObject<{
5565
5557
  changelog: z.ZodOptional<z.ZodString>;
5566
5558
  size: z.ZodOptional<z.ZodNumber>;
5567
5559
  homepage: z.ZodOptional<z.ZodString>;
5568
- visibility: z.ZodOptional<z.ZodEnum<{
5560
+ visibility: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5569
5561
  private: "private";
5570
5562
  public: "public";
5571
- }>>;
5563
+ }>>>;
5564
+ status: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5565
+ rejected: "rejected";
5566
+ listed: "listed";
5567
+ reviewing: "reviewing";
5568
+ offline: "offline";
5569
+ }>>>;
5570
+ }, z.core.$strip>;
5571
+ /**
5572
+ * 市场说了算的那几格「要不要印在屏幕上」(2026-09-10)。
5573
+ *
5574
+ * ## ⚠️ 这张名单里**一格承重的都没有**,那是它的定义不是巧合
5575
+ *
5576
+ * 缺席的那几格各有各的理由,而它们都不是「忘了列」:
5577
+ *
5578
+ * | 没进名单 | 为什么它不许被藏起来 |
5579
+ * | ------------ | -------------------------------------------------------------- |
5580
+ * | `name` | 它是标识 —— 藏了之后这一条在屏幕上没有名字 |
5581
+ * | `source` | 装它要靠它,而且 `search()` 拿它判「本地还是要 clone」 |
5582
+ * | `version` | `updateAvailable` 是拿它比出来的 —— 藏它 = **藏掉一次真的更新** |
5583
+ * | `description`| 卡片的正题;藏了之后一屏卡片全是空的 |
5584
+ * | `keywords` | 它压根不上屏,它是检索面 |
5585
+ * | `displayName`| 「给人看的名字」是身份不是徽标 —— 藏它只会退回那串机器标识 |
5586
+ *
5587
+ * 也就是说这张名单管的**只有徽标 / 元信息那一档**:一格藏没了,屏幕上少一枚芯片,
5588
+ * 别的一个字都不动。这条性质是这个功能能成立的全部前提 —— 一张能藏掉 `source`
5589
+ * 的名单会让一份合法的目录变得装不了东西,而报错会指着一个和它无关的地方。
5590
+ */
5591
+ declare const MARKETPLACE_DISPLAY_FIELDS: readonly ["status", "downloads", "likes", "author", "category", "visibility", "icon", "homepage", "size"];
5592
+ /** {@link MARKETPLACE_DISPLAY_FIELDS} 里的一格 */
5593
+ type MarketplaceDisplayField = (typeof MARKETPLACE_DISPLAY_FIELDS)[number];
5594
+ declare const DisplaySchema: z.ZodObject<{
5595
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5572
5596
  }, z.core.$strip>;
5573
5597
  declare const CatalogSchema: z.ZodObject<{
5574
5598
  name: z.ZodString;
@@ -5577,6 +5601,9 @@ declare const CatalogSchema: z.ZodObject<{
5577
5601
  name: z.ZodString;
5578
5602
  url: z.ZodOptional<z.ZodString>;
5579
5603
  }, z.core.$strip>>;
5604
+ display: z.ZodOptional<z.ZodObject<{
5605
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5606
+ }, z.core.$strip>>;
5580
5607
  plugins: z.ZodArray<z.ZodObject<{
5581
5608
  name: z.ZodString;
5582
5609
  description: z.ZodOptional<z.ZodString>;
@@ -5596,10 +5623,16 @@ declare const CatalogSchema: z.ZodObject<{
5596
5623
  changelog: z.ZodOptional<z.ZodString>;
5597
5624
  size: z.ZodOptional<z.ZodNumber>;
5598
5625
  homepage: z.ZodOptional<z.ZodString>;
5599
- visibility: z.ZodOptional<z.ZodEnum<{
5626
+ visibility: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5600
5627
  private: "private";
5601
5628
  public: "public";
5602
- }>>;
5629
+ }>>>;
5630
+ status: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5631
+ rejected: "rejected";
5632
+ listed: "listed";
5633
+ reviewing: "reviewing";
5634
+ offline: "offline";
5635
+ }>>>;
5603
5636
  }, z.core.$strip>>;
5604
5637
  }, z.core.$strip>;
5605
5638
  declare const RecordSchema: z.ZodObject<{
@@ -5613,6 +5646,9 @@ declare const RecordSchema: z.ZodObject<{
5613
5646
  name: z.ZodString;
5614
5647
  url: z.ZodOptional<z.ZodString>;
5615
5648
  }, z.core.$strip>>;
5649
+ display: z.ZodOptional<z.ZodObject<{
5650
+ fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
5651
+ }, z.core.$strip>>;
5616
5652
  plugins: z.ZodArray<z.ZodObject<{
5617
5653
  name: z.ZodString;
5618
5654
  description: z.ZodOptional<z.ZodString>;
@@ -5632,16 +5668,45 @@ declare const RecordSchema: z.ZodObject<{
5632
5668
  changelog: z.ZodOptional<z.ZodString>;
5633
5669
  size: z.ZodOptional<z.ZodNumber>;
5634
5670
  homepage: z.ZodOptional<z.ZodString>;
5635
- visibility: z.ZodOptional<z.ZodEnum<{
5671
+ visibility: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5636
5672
  private: "private";
5637
5673
  public: "public";
5638
- }>>;
5674
+ }>>>;
5675
+ status: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
5676
+ rejected: "rejected";
5677
+ listed: "listed";
5678
+ reviewing: "reviewing";
5679
+ offline: "offline";
5680
+ }>>>;
5639
5681
  }, z.core.$strip>>;
5640
5682
  }, z.core.$strip>;
5641
5683
  }, z.core.$strip>;
5642
5684
  type MarketplaceEntry = z.infer<typeof EntrySchema>;
5643
5685
  type MarketplaceCatalog = z.infer<typeof CatalogSchema>;
5644
5686
  type MarketplaceRecord = z.infer<typeof RecordSchema>;
5687
+ /** 这一条在市场那一侧的档口,见 `EntrySchema.status` 上那张四行的表 */
5688
+ type MarketplaceStatus = NonNullable<MarketplaceEntry['status']>;
5689
+ type MarketplaceDisplay = z.infer<typeof DisplaySchema>;
5690
+ /**
5691
+ * 按目录自己声明的白名单,把**没被选中的展示格抹掉**(2026-09-10)。
5692
+ *
5693
+ * ## ⚠️ 它是「抹掉」不是「打个标记」,而那是这个功能唯一说得通的做法
5694
+ *
5695
+ * 另一条路是把 `display` 原样发到每一层去,让 CLI / 网线 / 浏览器各自判一次
5696
+ * 「这一格该不该画」。那条路上「这一格印不印」会有**三个**能推出答案的地方,
5697
+ * 而它们分叉的那天表现是:同一份目录在 `epoch plugin search` 里印着作者、
5698
+ * 在浏览器上不印。判据同 `PluginSearchHit.installable` 为什么不把 `allowRemote`
5699
+ * 透出去 —— **一个问题只该有一个答案**。
5700
+ *
5701
+ * 抹掉之后,下游那一整条链路上现成的规矩(「有就画、没有整格不画」)一个字都不用改,
5702
+ * 而**新增的分支数是零**。这也正是它被放在 {@link searchMarketplaces} 里的理由:
5703
+ * 那是「市场里有什么」这个问题在全仓唯一的出口,CLI / TUI / 网线三条路都从它出来。
5704
+ *
5705
+ * ⚠️ **不碰装那条路**(`resolveMarketplaceRef` 读的是原始记录,不经过这儿):
5706
+ * 一份目录该印什么和它装不装得上是两件事,判据在 {@link MARKETPLACE_DISPLAY_FIELDS}
5707
+ * 那张表上。
5708
+ */
5709
+ declare function projectEntryForDisplay(entry: MarketplaceEntry, display: MarketplaceDisplay | undefined): MarketplaceEntry;
5645
5710
  interface MarketplaceOptions {
5646
5711
  /** `marketplacesPath(homeDir)` */
5647
5712
  statePath: string;
@@ -9650,6 +9715,29 @@ declare function formatUsd(usd: number): string;
9650
9715
  * 可选维度加完仍是 0 就不写进结果 —— 保住「0 是真的零,undefined 是不知道」:
9651
9716
  * 两轮都没缓存命中,累计里就不该冒出一个 `cacheHitTokens: 0` 让人以为
9652
9717
  * 这个 provider 支持缓存只是没命中。
9718
+ *
9719
+ * ## ⚠️ `totalTokens` **不是**可加的维度,别照着上面三项写
9720
+ *
9721
+ * 上面三项缺席当 0 加是对的(0 是加法的单位元);`totalTokens` 不是,它是一个
9722
+ * **总量**。`(a.totalTokens ?? 0) + (b.totalTokens ?? 0)` 在「一边报了、另一边
9723
+ * 没报」时收到的只有报了的那一份,而 `inputTokens` / `outputTokens` 两侧是加全
9724
+ * 了的 —— 于是这份累计**自相矛盾**:`totalTokens < promptTokens + outputTokens`。
9725
+ *
9726
+ * 这一档不是假想:`toTokenUsage` 明确放行了「两个总量都在、`totalTokens` 缺席」
9727
+ * 的 usage(OpenAI 兼容端点不带 `stream_options` 的那一家就这样),而同一段会话
9728
+ * 里换 provider(降级、或压缩那一发走别的模型)就会把两种 usage 加到一起。
9729
+ *
9730
+ * 症状有两层,**第二层不是显示问题**:
9731
+ *
9732
+ * 1. 屏幕上「共 X token」比旁边 `↑ + ↓` 还小(两处都读 `totalUsageTokens()`,
9733
+ * 而它优先信 `totalTokens`);
9734
+ * 2. `budget.maxTokens` 那道闸门读的是同一个数(`budget-guard.ts` 的
9735
+ * `sessionBreach()`),偏小 = **上限拦不住**,多跑的那几轮是真花钱的。
9736
+ *
9737
+ * 所以没报的那一侧按我们自己的口径折算一份(`totalUsageTokens()` 的兜底那一支,
9738
+ * 对那一侧来说是精确值),再相加。两边都没报时仍然整个不写 —— 那时
9739
+ * `totalUsageTokens()` 自己算出来的和这里能算出来的是同一个数,凭空多一个字段
9740
+ * 只会让「provider 报过」和「我们替它算的」变得分不出来。
9653
9741
  */
9654
9742
  declare function addUsage(a: TokenUsage, b: TokenUsage): TokenUsage;
9655
9743
  /**
@@ -10266,6 +10354,19 @@ declare function hasProviderCredentials(homeDir?: string): boolean;
10266
10354
  * 所以丢弃也不会动到用户文件)。
10267
10355
  */
10268
10356
 
10357
+ /**
10358
+ * 自动压缩的内置阈值 —— 提示词占到上下文窗口的几成时开始压。
10359
+ *
10360
+ * **默认值的单一真源就是这一行**(本文件头那句话对它同样成立)。
10361
+ * `ContextCompressor` 直接 `new` 出来、没给 `threshold` 时也回落到它,
10362
+ * 走的是 import 而不是在那边再写一个 `0.5` —— 两处各写一份的话,
10363
+ * 调了这个数之后「配置里读到的默认值」和「引擎真的在用的默认值」会分叉,
10364
+ * 而设置页印的恰好是前者。
10365
+ *
10366
+ * ⚠️ 改这个数对**所有没配过这个键的人**生效,是一次用户能感知的行为变更
10367
+ * (压缩来得更早或更晚),要写 changeset。
10368
+ */
10369
+ declare const DEFAULT_COMPRESSION_THRESHOLD = 0.5;
10269
10370
  declare const EpochConfigSchema: z.ZodObject<{
10270
10371
  provider: z.ZodPrefault<z.ZodObject<{
10271
10372
  type: z.ZodDefault<z.ZodEnum<{
@@ -10371,6 +10472,11 @@ declare const EpochConfigSchema: z.ZodObject<{
10371
10472
  enabled: z.ZodDefault<z.ZodBoolean>;
10372
10473
  threshold: z.ZodDefault<z.ZodNumber>;
10373
10474
  }, z.core.$strip>>;
10475
+ memory: z.ZodPrefault<z.ZodObject<{
10476
+ memoryCharLimit: z.ZodDefault<z.ZodInt>;
10477
+ userCharLimit: z.ZodDefault<z.ZodInt>;
10478
+ indexCharLimit: z.ZodDefault<z.ZodInt>;
10479
+ }, z.core.$strip>>;
10374
10480
  artifacts: z.ZodPrefault<z.ZodObject<{
10375
10481
  maxAgeDays: z.ZodDefault<z.ZodInt>;
10376
10482
  maxTotalBytes: z.ZodDefault<z.ZodInt>;
@@ -10717,7 +10823,7 @@ declare function isSettingWriteLayer(value: string): value is SettingWriteLayer;
10717
10823
  * 安全中心指两件事(「新会话从哪一档起」vs「这个会话此刻哪一档」),
10718
10824
  * 而那正是决定 20 ④ 拆开的那个歧义 —— 记住上一次那一档没有把这个歧义请回来。
10719
10825
  */
10720
- declare const SETTING_WRITE_KEYS: readonly ["model", "maxTurns", "models.utility", "fallback.model", "contextLength", "compression.enabled", "compression.threshold", "budget.maxCostUsd", "budget.maxTokens", "budget.warnAtPercent", "budget.onUnknownPricing", "permission"];
10826
+ declare const SETTING_WRITE_KEYS: readonly ["model", "maxTurns", "models.utility", "fallback.model", "contextLength", "compression.enabled", "compression.threshold", "memory.memoryCharLimit", "memory.userCharLimit", "memory.indexCharLimit", "budget.maxCostUsd", "budget.maxTokens", "budget.warnAtPercent", "budget.onUnknownPricing", "permission"];
10721
10827
  type SettingWriteKey = (typeof SETTING_WRITE_KEYS)[number];
10722
10828
  /** 这个键写得进去吗。名单就是 {@link SETTING_WRITE_KEYS} 本身,别在别处抄一份字面量 */
10723
10829
  declare function isWritableSettingKey(value: string): value is SettingWriteKey;
@@ -11041,24 +11147,107 @@ declare function loadKeybindings({ path, defaults }: LoadKeybindingsOptions): Lo
11041
11147
  /**
11042
11148
  * 记忆管理器 — 文件驱动 + SQLite 索引双存储。
11043
11149
  *
11044
- * 参考 Hermes tools/memory_tool.py(1240 行)。
11045
11150
  * 核心设计:
11046
11151
  * 1. MEMORY.md / USER.md 文件是主存储
11047
11152
  * 2. SQLite 是搜索索引(FTS5 + sqlite-vec)
11048
11153
  * 3. 会话级冻结快照,保护 prompt cache
11049
11154
  * 4. 字符配额 + 超限压缩提示(而非直接拒绝)
11050
11155
  * 5. 注入检测
11156
+ *
11157
+ * ---
11158
+ *
11159
+ * # 2026-09-10:进 prompt 的从「全文」换成「索引」
11160
+ *
11161
+ * ## 改之前是什么样,以及为什么它把两件事焊死了
11162
+ *
11163
+ * 原来 `initialize()` 把**整个记忆库的正文**渲染进 system prompt(`renderBlock()`
11164
+ * 把每一条 `§` 拼起来)。参考的是 Hermes(`tools/memory_tool.py`,它今天仍是
11165
+ * 这个形状)。后果是「能存多少」和「每轮烧多少 token」**是同一个数**:
11166
+ * 想多记一点,就得每一轮都为它付钱。
11167
+ *
11168
+ * 于是那两个配额被钉在 `2200 / 1375`(连数字都是从 Hermes 抄的)好几个月,
11169
+ * 而用户的原话是「memory 好像只有 2000 字,太少了」。在旧结构下这个抱怨
11170
+ * **没有便宜的解法** —— 调大就是每轮变贵。
11171
+ *
11172
+ * ## 改之后:目录进 prompt,正文按需取
11173
+ *
11174
+ * 形状对齐 codex(`codex-rs/ext/memories/`):那边 `~/.codex/memories/` 里的
11175
+ * 文件数量不设上限,进 developer instructions 的只有一份摘要(它那个常量叫
11176
+ * `MEMORY_TOOL_DEVELOPER_INSTRUCTIONS_SUMMARY_TOKEN_LIMIT`,2500 tokens),
11177
+ * 正文靠 `memories.list` / `read` / `search` 三个工具按需取。
11178
+ *
11179
+ * epoch 这边**检索那一半本来就修好了**,所以这一轮做的比看上去小:
11180
+ *
11181
+ * - `search()` 是真的 BM25(FTS5,见 `db.ts`)
11182
+ * - `prefetch()` 每轮拿用户输入检索一次,塞进 `<memory-recall>`
11183
+ * (`agent/prompt.ts`,走 messages 那一侧)
11184
+ *
11185
+ * 缺的只有两样,这一轮补上:**system prompt 里换成索引**({@link renderIndexBlock}),
11186
+ * 以及**一个能按 id 取全文的动作**({@link read})。
11187
+ *
11188
+ * ## ⚠️ 空库时索引块必须是**空串**,这不是优化
11189
+ *
11190
+ * `agent/prompt.ts` 把这个块 push 进 system prompt,而 system prompt 全文进
11191
+ * eval 的新鲜度指纹(`evals/harness/fingerprint.ts`)。空库渲染成空串,
11192
+ * 是 34 段录像在这一轮里**不因为 system prompt 而**作废的唯一原因
11193
+ * (工具描述那一侧另算,见 `tools/builtin/memory.ts`)。
11194
+ * 改这个函数时先想一遍「库是空的时候它返回什么」。
11051
11195
  */
11052
11196
 
11053
11197
  declare class MemoryManager {
11054
11198
  private db;
11055
11199
  private config;
11056
11200
  private memDir;
11057
- /** 冻结快照——会话初始化时构建,整个会话不变 [Hermes] */
11201
+ /**
11202
+ * 冻结快照 —— 会话初始化时构建,整个会话不变 [Hermes]。
11203
+ *
11204
+ * ⚠️ **2026-09-10 起它装的是索引不是正文**(文件头那一节)。冻结这件事没变,
11205
+ * 变的是冻的是什么:冻正文是为了保 prefix cache,冻索引除了保 cache 还多一层
11206
+ * 作用 —— 模型手上那份 id 表在一个会话里不会动,于是它引用 `m:a3f1c2` 时
11207
+ * 指的一定是它当初看到的那一条。
11208
+ */
11058
11209
  private snapshot;
11210
+ /**
11211
+ * 短 id → 条目。**这一份是活的,不跟着快照冻**。
11212
+ *
11213
+ * 两者不同步是刻意的:快照冻住「模型看得到的目录」,这一份答「这个 id 现在
11214
+ * 还指着什么」。会话中途新写的条目立刻 `read` 得到(它不在冻结的索引里,
11215
+ * 但模型刚写完自己知道 id);被改掉的条目老 id 会落进
11216
+ * {@link MemoryReadResult.missing} —— 那是实话,那条内容确实不在了。
11217
+ *
11218
+ * id 从**内容哈希**来而不是从位置来,正是为了这里:删掉第 3 条不会让第 4 条
11219
+ * 之后所有 id 集体平移,而那种平移会让模型手上那份索引静默指错条目。
11220
+ */
11221
+ private ids;
11222
+ /** 上面那张表的反向索引(`target\0content` → id),渲染索引时按内容反查用 */
11223
+ private idByContent;
11059
11224
  /** 当前会话是否已初始化 */
11060
11225
  private initialized;
11061
- /** 本轮 consolidation 失败计数 [Hermes] */
11226
+ /**
11227
+ * 本轮 consolidation **白撞**次数。撞满 {@link MAX_CONSOLIDATION_FAILURES_PER_TURN}
11228
+ * 就不再给指引,改成一句「别再试了」。
11229
+ *
11230
+ * ## ⚠️ 它数的是「白撞了几次」,不是「试了几次」
11231
+ *
11232
+ * 这个区别就是用户 2026-09-10 那张截图:
11233
+ *
11234
+ * > 记忆库满了(3 次合并机会已用完),但关键信息已经落在 RUNBOOK.md 里
11235
+ *
11236
+ * 一个**谨慎**的模型会一条条腾地方 —— 删一条、试一下够不够、不够再删一条。
11237
+ * 而原来只有 `add` / `replace` **成功**时才重置,`remove` 成功不重置,于是:
11238
+ *
11239
+ * ```
11240
+ * add(失败1) → remove → add(失败2) → remove → add(失败3) → remove → add(失败4) → 叫停
11241
+ * ```
11242
+ *
11243
+ * 它每一步都在真的腾空间,却被记成四次失败,最后被自己的安全阀打死。
11244
+ * **越谨慎越容易撞**:一次性删五条的反而没事。上限本身是对的
11245
+ * (防模型无限重试同一个 `add`),错的是口径。
11246
+ *
11247
+ * 所以**任何一次让库变小 / 变整齐的操作都重置它**:`add` 成功、`replace`
11248
+ * 成功、`remove` 成功。剩下那一档 —— 反复 `add` 同一个装不下的东西而中间
11249
+ * 什么都没干 —— 才是它要拦的。
11250
+ */
11062
11251
  private consolidationFailures;
11063
11252
  /** 上次审查发现的问题(由 MemoryReviewer 写入) */
11064
11253
  reviewIssues: Array<{
@@ -11067,12 +11256,33 @@ declare class MemoryManager {
11067
11256
  message: string;
11068
11257
  suggestion?: string;
11069
11258
  }>;
11070
- constructor(dbPath?: string, memDir?: string);
11259
+ /**
11260
+ * @param config 三个配额,来自 `EpochConfig.memory`(runtime 的 `services.ts` 递进来)。
11261
+ * **按字段合并到默认值上**,不是整份替换 —— 用户只在 yaml 里写了
11262
+ * `memoryCharLimit` 时,另外两个该回落到内置默认,而不是变成 `undefined`
11263
+ * 然后在 `getBudget()` 里算出 `NaN%`。
11264
+ *
11265
+ * 不给 = 三个都走默认(真源在 `config/schema.ts`)。2026-09-10 之前这个参数
11266
+ * 压根不存在,于是 `MemoryConfig` 这个类型有、却没有任何人给得出非默认值 ——
11267
+ * 用户抱怨的「设置里改不了」就是这一格。
11268
+ */
11269
+ constructor(dbPath?: string, memDir?: string, config?: Partial<MemoryConfig>);
11071
11270
  initialize(_sessionId: string): Promise<string>;
11072
11271
  prefetch(userQuery: string): Promise<string>;
11073
11272
  sync(_userMessage: string, _assistantResponse: string): Promise<void>;
11074
11273
  finalize(): Promise<void>;
11075
11274
  reloadFromDisk(): Promise<void>;
11275
+ /**
11276
+ * 重建 短 id → 条目 的映射。
11277
+ *
11278
+ * id = `<前缀>:<内容 sha256 的前 N 位十六进制>`。前缀 `m` / `u` 分开两个库,
11279
+ * 于是**同一份内容同时存在两个库里也不会撞**(那是合法状态:「用户用 pnpm」
11280
+ * 既可以是画像也可以是项目知识)。
11281
+ *
11282
+ * 冲突时按 4 位一档加长,而**只加长撞上的那一个** —— 全表统一加长的话,
11283
+ * 加一条新记忆可能让**所有**老 id 变样,而模型手上那份索引是冻结的。
11284
+ */
11285
+ private assignIds;
11076
11286
  /**
11077
11287
  * 把某个 target 的内容同步成 `desired`,**保留仍存在条目的元数据**。
11078
11288
  *
@@ -11080,6 +11290,14 @@ declare class MemoryManager {
11080
11290
  * accessCount / createdAt 全部归零,schema 里那几个字段等于白设。
11081
11291
  */
11082
11292
  private syncTarget;
11293
+ /**
11294
+ * 落盘。**顺带重建 id 表** —— 这个方法是 add / replace / remove 三条写路径
11295
+ * 唯一的汇合点,挂在这儿就不会出现「新加了一条记忆,同一轮里 `read` 不到」。
11296
+ *
11297
+ * ⚠️ 重建的是 {@link ids}(活的),**不动 {@link snapshot}**(冻的)。
11298
+ * 顺手把快照也刷了的话,一次写记忆就会改掉 system prompt ——
11299
+ * prefix cache 当场作废,而那正是快照冻结要挡的事。
11300
+ */
11083
11301
  flushToDisk(): Promise<void>;
11084
11302
  /** 渲染成可被 readFile 原样解析回来的格式(多行条目也不会散) */
11085
11303
  private renderFile;
@@ -11089,9 +11307,28 @@ declare class MemoryManager {
11089
11307
  * score 是真实的 BM25 相关度(越大越相关),原来恒为 1——
11090
11308
  * 上层拿它排序等于没排。命中的条目会记一次访问,
11091
11309
  * 让 accessCount 真的反映使用情况。
11310
+ *
11311
+ * ⚠️ **返回的 `id` 是索引里那个短 id,不是 DB 的 UUID**(2026-09-10 改)。
11312
+ * 这一条上层看得见:模型拿搜索结果去 `read` / 对照索引时,两处的 id 必须是
11313
+ * 同一套词。发 UUID 出去等于给了它一个在别处一次也用不上的标识符 ——
11314
+ * 而它会照着用,然后 `read` 一律 `missing`。
11315
+ *
11316
+ * 短 id 反查不到时(`assignIds()` 还没跑过)**回落到 UUID 而不是丢掉这一条**:
11317
+ * 少一条搜索结果是静默的错误答案,多一个认不出的 id 只是一次 `missing`。
11092
11318
  */
11093
11319
  search(query: string, limit?: number): Promise<MemorySearchResult[]>;
11094
11320
  keywordSearch(query: string, limit?: number): Promise<MemorySearchResult[]>;
11321
+ /**
11322
+ * 按索引里的短 id 取全文(2026-09-10 新增,见文件头)。
11323
+ *
11324
+ * ⚠️ **认不出的 id 走 `missing` 而不是被跳过。** 模型会编 id(或者引用上个会话
11325
+ * 那份索引里的),静默少返回一条的话它拿到的是一份看起来完整、实际缺一块的
11326
+ * 答案,而它没有任何办法发现这件事。
11327
+ *
11328
+ * 命中的条目记一次访问 —— 于是「被 read 过」也算热度,下一个会话的索引里
11329
+ * 它更靠前(判据在 {@link renderIndexBlock} 的排序那一段)。
11330
+ */
11331
+ read(ids: readonly string[]): Promise<MemoryReadResult>;
11095
11332
  /** 获取所有条目(供后台审查使用) */
11096
11333
  getAllEntries(): Array<{
11097
11334
  content: string;
@@ -11106,7 +11343,43 @@ declare class MemoryManager {
11106
11343
  semanticSearch(query: string, limit?: number): Promise<MemorySearchResult[]>;
11107
11344
  add(target: MemoryTarget, content: string): Promise<MemoryWriteResult>;
11108
11345
  replace(target: MemoryTarget, oldText: string, content: string): Promise<MemoryWriteResult>;
11109
- remove(target: MemoryTarget, oldText: string): Promise<void>;
11346
+ /**
11347
+ * 删一条。`oldText` 可以是**全文**,也可以是索引里那个**短 id**(见 {@link locate})。
11348
+ *
11349
+ * 返回删没删掉 —— 原来固定返回 `void`,于是「id 拼错了」和「真的删了」
11350
+ * 在调用方那里长得一模一样,模型会以为腾出了地方然后继续撞墙。
11351
+ */
11352
+ remove(target: MemoryTarget, oldText: string): Promise<boolean>;
11353
+ /**
11354
+ * 按「全文」或「索引里的短 id」定位一条记忆。
11355
+ *
11356
+ * ## 为什么要认 id(2026-09-10)
11357
+ *
11358
+ * 索引化之后,模型在 prompt 里看到的只有**首行摘要**(截断到 80 字符),
11359
+ * 而 `replace` / `remove` 原来走的是 `WHERE content = ?` —— **全文精确相等**。
11360
+ * 两者对不上:**我们只发布了摘要,却要求全文**。于是「照着屏幕上看得见的
11361
+ * 东西去合并」这条最自然的路径必然 `Entry not found`。
11362
+ *
11363
+ * ⚠️ **它不是一个「不修就必死」的回归,别照那个力度去理解。** 2026-09-10
11364
+ * 拿真 key 打过 A/B(3 个场景 × 改动前后 × 各 3 发,DeepSeek):**不认 id 的
11365
+ * 那一侧也 9/9 成功** —— 模型会自己先 `read` 一遍拿全文,之后全文匹配就成立了。
11366
+ * `read` 和索引是同一轮加的,所以那条死路从来没有以「不可恢复」的形态存在过。
11367
+ *
11368
+ * 认 id 的价值是把它从「先 read 再匹配」缩成「一步」,并且让**只看索引**
11369
+ * 这条路径也成立。这是补齐操作面,不是抢救。
11370
+ *
11371
+ * ⚠️ 先试 id 再试全文,顺序不能反:一条内容恰好长得像 `m:abc123` 的记忆
11372
+ * 理论上存在,但那时按 id 解释才是**模型的本意**(它手上的 id 就长这样)。
11373
+ */
11374
+ private locate;
11375
+ /**
11376
+ * 「没找到」时**告诉模型下一步干什么**,而不是只说没找到。
11377
+ *
11378
+ * 一句光秃秃的 `Entry not found` 会让模型原地重试同一个错的 `old_text`,
11379
+ * 而它重试几次就撞上 consolidation 上限。绝大多数情况下它错在
11380
+ * **拿索引里的摘要当全文**,所以这句话要直接点破那一点。
11381
+ */
11382
+ private notFoundHint;
11110
11383
  getBudget(): {
11111
11384
  memory: BudgetInfo;
11112
11385
  user: BudgetInfo;
@@ -11127,11 +11400,53 @@ declare class MemoryManager {
11127
11400
  * 项目约定来说并不宽裕,原来的做法会把合法长条目直接吞掉。
11128
11401
  */
11129
11402
  private scanInjection;
11130
- /** 渲染 system prompt 注入块 [Hermes] */
11131
- private renderBlock;
11132
- /** 构建快照 system prompt 注入块 */
11133
- private buildSnapshotBlock;
11403
+ /**
11404
+ * 一条条目在索引里长什么样。摘要取**首行**并截断到
11405
+ * {@link INDEX_SUMMARY_CHARS}。
11406
+ *
11407
+ * 取首行而不是前 N 字符:条目是「一条一个事实」,第一行基本就是那句结论,
11408
+ * 而横跨换行去截会把下一行的开头黏上来,读起来像一句破句。
11409
+ */
11410
+ private indexEntries;
11411
+ /**
11412
+ * 渲染进 system prompt 的**索引块**(2026-09-10 起替代原来的全文块)。
11413
+ *
11414
+ * ## 空库返回空串 —— 这一条是硬约束
11415
+ *
11416
+ * 判据在文件头最后一节:这个块的返回值进 system prompt,而 system prompt
11417
+ * 全文进 eval 新鲜度指纹。改这个函数时先答「库是空的时候它返回什么」。
11418
+ *
11419
+ * ## 装不下的时候丢谁
11420
+ *
11421
+ * 按「用得多的留下」排(`accessCount` 降序,同票看 `lastAccessedAt`),
11422
+ * 取到装不下为止 —— 那两个字段 `db.ts` 一直在维护,而 `search()` 命中时会
11423
+ * `markAccessed()`,所以「用得多」是真的使用情况,不是猜的。
11424
+ *
11425
+ * ⚠️ **挑完之后按 position 重排再印**。挑选顺序是「谁重要」,展示顺序是
11426
+ * 「文件里的顺序」—— 两者混成一个的话,用户在 `MEMORY.md` 里看到的顺序和
11427
+ * 模型看到的顺序不一样,而排查「模型为什么没用那条记忆」时人是对着文件看的。
11428
+ *
11429
+ * ⚠️ 被挤掉的部分**在块尾如实说有几条**,并指向 `search`。静默截断是这里
11430
+ * 最不该干的事:模型会把「我看到的」当成「全部」,然后理直气壮地说
11431
+ * 「记忆里没有这件事」。
11432
+ */
11433
+ private renderIndexBlock;
11434
+ /** 索引里的一行:`m:a1b2c3 摘要 (412 chars)` */
11435
+ private indexLine;
11134
11436
  /** 构建超限压缩提示 [Hermes] */
11437
+ /**
11438
+ * 配额满时交给模型的指引。
11439
+ *
11440
+ * ## ⚠️ 这段话必须给出一条**在索引架构下真的走得通**的操作序列
11441
+ *
11442
+ * 上一版写的是「use replace() to combine or shorten existing entries」外加一个
11443
+ * 抄全文的例子。索引化之后那是一条**死路**:模型手上只有摘要,`old_text` 拼不出来
11444
+ * (判据全文在 {@link locate})。它照着做 → `Entry not found` → 重试 → 撞上
11445
+ * {@link MAX_CONSOLIDATION_FAILURES_PER_TURN} → 只好说「记忆库满了,合并机会用完」。
11446
+ *
11447
+ * 所以现在给的是**按 id 走**的三步,并且把最近几条 id 直接列出来 ——
11448
+ * 让模型不必先去猜、也不必多跑一趟 `search`。
11449
+ */
11135
11450
  private buildConsolidateHint;
11136
11451
  }
11137
11452
 
@@ -12756,8 +13071,8 @@ declare const MAX_AUDIT_ENTRIES = 500;
12756
13071
  *
12757
13072
  * | 级别 | 意图 |
12758
13073
  * | ------------- | -------------------------------------------------- |
12759
- * | `bypass` | 全放行 —— 但**挡不住第 1 层安全底线**,那层在前面 |
12760
- * | `auto` | 信任 agent:读写和网络放行,非只读命令仍确认 |
13074
+ * | `bypass` | 全放行 —— 但**挡不住第 1 层那两条 deny**,那层在前面 |
13075
+ * | `auto` | 信任 agent:这一档自己不拦,边界全在第 1 层 |
12761
13076
  * | `plan` | 只读:写入 / 命令 / 网络 / 执行代码一律拒 |
12762
13077
  * | `acceptEdits` | 工作区内读写免确认,工作区外和写命令确认 |
12763
13078
  * | `default` | 只读操作免确认,其余一律确认 |
@@ -12948,7 +13263,9 @@ declare function matchRuleLists(rules: CompiledRules, operation: Operation, flav
12948
13263
  *
12949
13264
  * check() 分三层,顺序即安全语义:
12950
13265
  * 1. 安全底线(危险命令 / 敏感路径 / 混淆构造)—— 任何级别、任何模式都生效,
12951
- * **不可**被 headless 预授权覆盖
13266
+ * **不可**被 headless 预授权覆盖。⚠️ 前两条直接 deny;第三条是「要人确认」,
13267
+ * 而「问」在 `bypass` 和非交互下问不出来 —— 那两种现场怎么塌成一个结论,
13268
+ * 判据全文在 {@link PermissionManager.settleUnaskable} 上
12952
13269
  * 2. 策略规则 + 审批缓存 + 权限级别 —— 得出 allow / deny / ask_user
12953
13270
  * 3. headless 预授权 —— 只能把 ask_user 变成放行,
12954
13271
  * 永远不能把第 1、2 层的 deny 变成放行
@@ -13145,6 +13462,111 @@ declare class PermissionManager implements PermissionManager$1 {
13145
13462
  check(operation: Operation): PermissionDecision;
13146
13463
  /** 三层判定的本体。**每个出口都必须带原因码**,见文件头 */
13147
13464
  private decide;
13465
+ /**
13466
+ * 安全底线里那条「要人确认」的判定 —— **问不出来的时候它塌成什么**(2026-09-10)。
13467
+ *
13468
+ * 返回 null = 问得出来,照原样弹给用户。
13469
+ *
13470
+ * ## 这一层要守的不变量:**「不问」这一档下没有任何东西可以塌成「问」**
13471
+ *
13472
+ * 两家参照实现都把它写成纪律,而 epoch 此前只守住了一半:
13473
+ *
13474
+ * - Hermes 靠顺序 —— `approval_floors.py` 的 docstring 第一句是
13475
+ * 「decisions that never reach a prompt」,floor 里只有 hardline 灾难命令、
13476
+ * `sudo -S` 灌密码、用户自己写的 deny 规则,**一个 ask 形状的出口都没有**;
13477
+ * 所有会弹的判定都排在 `_yolo_active()` 检查之后(`tools/approval.py`)。
13478
+ * - Codex 靠显式塌缩 —— `exec_policy.rs` 的原话是「We prefer to prompt the user
13479
+ * rather than outright forbid the command, but if the user has explicitly
13480
+ * disabled prompts, we must forbid the command」,落地成
13481
+ * `AskForApproval::Never => Decision::Forbidden`,另有 `prompt_is_rejected_by_policy`
13482
+ * 把**任何**要弹的东西在那一档下变成一句拒绝。
13483
+ *
13484
+ * 这个方法此前只有第 3 条(非交互),判据挂在「**有没有人可问**」上,漏了
13485
+ * 「**用户说了别问我**」—— 而这两件事在语义上是同一件。落地的后果是屏幕上
13486
+ * 那句「跳过全部检查 · 什么都不问」是假话:实测 `echo "$(date)"`、`node -e`、
13487
+ * `python3 -c` 在 `bypass` 档下照旧弹框。
13488
+ *
13489
+ * ## 四条的顺序不能换,每一条各有各的理由
13490
+ *
13491
+ * 1. **`plan` → 拒绝。** 那一档是只读的,「问一句就能干」这回事在它里面不存在。
13492
+ * ⚠️ 这一条修的是一个**旧洞**:底线那一层跑在档位判定前面,所以在这之前
13493
+ * plan 模式下一条判不了的命令会弹给用户,用户点「允许」它就真跑了 ——
13494
+ * 而 `checkPlan()` 那句「plan 模式禁止写入和命令执行」压根没机会说话。
13495
+ *
13496
+ * 2. **`bypass` + `obfuscated` → 放行。** 排在缓存前面,于是「`bypass` 整段不查
13497
+ * 审批缓存」({@link checkRulesAndCache} 那一节)对**规则那条路**逐字仍然成立。
13498
+ *
13499
+ * ⚠️ **认码,不是认「所有 ask 形状的底线」**(2026-09-10 用户拍的):
13500
+ * `dangerous-command`(tier-2,危险但可恢复)在这一档下**照旧问**。
13501
+ * 用户的原话是「除了那种真的非常危险的操作,和无法判断的才会……停下来找
13502
+ * 用户」,而他随后选定的两档形状是:**危险的问一句(点了就能干活)、
13503
+ * 判不了的不问**。所以这一支只塌 `obfuscated`。
13504
+ *
13505
+ * ⚠️ 塌向「放行」而不是 Codex 的「拒绝」:这条判定的原话是「静态检查无法
13506
+ * 判定其真实行为,需人工确认」—— 它是一句「我判不了」,不是一句「这危险」,
13507
+ * 而 `bypass` 的字面意思正是「别拿你判不了的事来问我」。这一档下**逐字就是
13508
+ * Hermes 的 yolo**(它的 floor 只有 hardline,判不了那一族住在 Tier-2、
13509
+ * 被 yolo 整段跳过)。
13510
+ *
13511
+ * ⚠️ **代价说清楚**:`bypass` + 提示注入 + `$(…)` 拼命令名这条路由此打通。
13512
+ * Hermes 在 `tools/approval.py` 那句 `# this and bypass every approval check
13513
+ * (prompt-injection escalation path)` 上承认的是同一个敞口。不接受的人该做的是
13514
+ * **别用这一档**,而不是让这一档偷偷弹框 —— 一个说了「不问」却还在问的开关,
13515
+ * 会让用户学会闭眼点「允许」,那比敞口更坏。
13516
+ *
13517
+ * 3. **用户以前对这一条明确答过 → 照他的答复。** 这是另一个缺陷:审批缓存躺在
13518
+ * 这一层**后面**,所以一条判不了 / tier-2 危险的命令上点一百次「永久允许」,
13519
+ * 第一百零一次照样弹 —— 那个出口在这一族上是**画着但不通**的。
13520
+ *
13521
+ * ⚠️ 这里查缓存**不受 `approvalCacheActive()` 约束**(那条只管规则那条路):
13522
+ * 走到这儿说明这一刻真的要弹窗,而缓存的定义就是「弹窗答案的记忆」。
13523
+ * 2026-08-17 那条判据(`bypass` 下缓存的 deny 不该拦住任何东西)没有被翻 ——
13524
+ * 它说的是**档位本来就放行**的操作,而这一支下面的操作档位从来不放行。
13525
+ *
13526
+ * 这不是「让缓存绕过黑名单」:绕不过的是 deny 形状的那两条(灾难级危险命令、
13527
+ * 敏感路径),它们在 `hard.requireApproval` 为假时压根走不到这儿。
13528
+ *
13529
+ * 4. **非交互 → 拒绝**(原有行为,一字未动)。它排在最后:前面几条各自都是
13530
+ * 「这道题已经有答案了」,而这一条说的是「没人可答」。
13531
+ */
13532
+ private settleUnaskable;
13533
+ /**
13534
+ * **规则那条路**上会不会查审批缓存(2026-08-17 的判据:`bypass` 整段不查,
13535
+ * 全文在 {@link checkRulesAndCache} 上)。
13536
+ *
13537
+ * ⚠️ **它不是「这个档位记不记得住」**:安全底线那条路({@link settleUnaskable})
13538
+ * 在任何档位下都查缓存。宿主要知道的是**这一次问的这道题**记不记得住,
13539
+ * 那个答案在 `PermissionDecision.rememberable` 上,由 {@link rememberFlag} 打。
13540
+ */
13541
+ approvalCacheActive(): boolean;
13542
+ /**
13543
+ * 给规则表那条路上的 ask 打「记不记得住」这一格。
13544
+ *
13545
+ * 只在**记不住**的时候产出这个键:`{ rememberable: undefined }` 和「没有这个键」
13546
+ * 在 JSON / wire 上是两回事(后者会被编成一个 null),而协议那边写的是
13547
+ * **不给 = 记得住**。
13548
+ *
13549
+ * 走到这儿的 ask 是规则表判的,所以它和 {@link approvalCacheActive} 同一个答案;
13550
+ * 底线那条路不经过这里(它的答复一律记得住)。
13551
+ */
13552
+ private rememberFlag;
13553
+ /**
13554
+ * 审批缓存那一格 —— **全类唯一一处查它的地方**。
13555
+ *
13556
+ * 两个调用方({@link checkRulesAndCache} 的第 2 层、{@link settleUnaskable} 的
13557
+ * 第 2 条)必须用同一套 key,否则「批过的那一条」在其中一条路上永远命不中;
13558
+ * 而那种分叉两边各自都自洽,没有任何检查抓得到。
13559
+ *
13560
+ * key 用「工具名 + 目标」:按类别做 key 会让拒绝一次 `code_exec` 连坐到
13561
+ * terminal 和所有 MCP 工具。
13562
+ *
13563
+ * ⚠️ **它自己不认档位。** 「`bypass` 不查缓存」那条判据只管**规则那条路**,
13564
+ * 所以那道闸在 {@link checkRulesAndCache} 的调用点上(`approvalCacheActive()`),
13565
+ * 不在这里 —— {@link settleUnaskable} 那条路必须在任何档位下都查得到,
13566
+ * 判据在它的第 3 条上。搬进来的后果是「问过一次的 tier-2 命令在 `bypass` 下
13567
+ * 永远问不完」。
13568
+ */
13569
+ private cachedDecision;
13148
13570
  /**
13149
13571
  * 策略规则 + 紧凑权限规则 + 审批缓存。返回 null 表示三者都没定论,
13150
13572
  * 交给权限级别判。
@@ -13168,8 +13590,9 @@ declare class PermissionManager implements PermissionManager$1 {
13168
13590
  * 档下对一条命令点了「拒绝」,`tool-executor` 把那一下写成
13169
13591
  * `recordApproval(…, 'deny')`;随后切到 `bypass` 再敲同一条,屏幕上回的是
13170
13592
  * 「操作被拦截 [权限]: 已缓存拒绝」。而三处真源都说它该过:
13171
- * [docs/PERMISSIONS.md](../../../../docs/PERMISSIONS.md) 的档位表写「允许一切」、
13172
- * [by-level.ts](./by-level.ts) 那张五档表写「全放行 —— 但挡不住第 1 层安全底线」、
13593
+ * [docs/PERMISSIONS.md](../../../../docs/PERMISSIONS.md) 的档位表(当时写的是
13594
+ * 「允许一切」,2026-09-10 改成「不问你任何事」)、
13595
+ * [by-level.ts](./by-level.ts) 那张五档表写「全放行 —— 但挡不住第 1 层那两条 deny」、
13173
13596
  * 方案 46 §七 写「`bypass` 之下危险命令表是**唯一还在岗的东西**」。
13174
13597
  *
13175
13598
  * 这一档下**没有被放松的东西**:第 1 层安全底线(危险命令表 / 敏感路径 /
@@ -14863,8 +15286,8 @@ declare const PolicyRuleSchema: z.ZodObject<{
14863
15286
  command_prefix: z.ZodOptional<z.ZodString>;
14864
15287
  target_pattern: z.ZodOptional<z.ZodString>;
14865
15288
  decision: z.ZodEnum<{
14866
- deny: "deny";
14867
15289
  allow: "allow";
15290
+ deny: "deny";
14868
15291
  ask_user: "ask_user";
14869
15292
  }>;
14870
15293
  deny_message: z.ZodOptional<z.ZodString>;
@@ -17219,4 +17642,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
17219
17642
  */
17220
17643
  declare function codeModeWorkerPath(): string | undefined;
17221
17644
 
17222
- export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, type AcquireResult, type AgentConfig, AgentLoop, type AgentProvider, type AgentSite, type AgentSiteRef, type AppendMessageInput, ApprovalCache, type ApprovalDecision, type ApprovalScope, type ArtifactOpenRefusal, type ArtifactRetention, type AskQuestionDeps, BLOCKED_TOOLS, type BackendOptions, type BackendOutcome, type BackgroundTaskSource, type BaseOrigin, type BaseSlot, type BeginTurnInput, type BreakdownInput, BudgetGuard, type BudgetGuardOptions, type BudgetInfo, type BudgetLevel, type BudgetOptions, type BudgetStatus, BudgetStore, type BudgetStoreOptions, type BuildFireArgvInput, type BuildIndexOptions, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, type CachedApproval, type CachedDecision, type CheckpointCapture, type CheckpointFile, CheckpointManager, type CheckpointManagerOptions, type CheckpointManifest, CheckpointStore, type CheckpointStoreOptions, type CheckpointSummary, type ClaudeHooksParseOptions, type CodeModeLimits, type CodeRequest, type CodeResult, CodeSandbox, type CommandHookConfig, type CommandHookResult, type CommandLoadOutcome, type CommandLoadSummary, type CommandResult, type CommandRunner, type CompactionResult, type CompiledRules, type ComplianceDirSpec, type ComplianceDirsSummary, ComplianceEngine, type ComplianceEngineInput, type ComplianceGate, type ComplianceHit, type ComplianceRule, type ComplianceRuleSource, type ComplianceSettings, type ComplianceVerdict, type CompressConfig, type CompressResult, type ConfigMigration, type ConfigOrigins, ContextCompressor, type ContextEngine, type CreateScheduleInput, type CreateSessionInput, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, type DelegateArgs, type DelegateConfig, DelegateManager, type DelegateTaskResult, type DiagnoseOptions, type DiscoverOutcome, type DiscoveredFile, type DoctorReport, type DraftParse, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, type ExpandOptions, type ExtractOutcome, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PACK_EXCLUDES, PACK_MAX_BYTES, PACK_MAX_FILES, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_NAME_PATTERN, PLUGIN_PACK_TOOL, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, PLUGIN_VALIDATE_TOOL, POLICY_DECISIONS, PROJECT_AGENTS_SUBDIR, PROVIDER_NO_CREDENTIAL, type PackFile, type PackLimits, type PackOutcome, type PackPlan, type PackPlanOutcome, type PermissionAuditCode, type PermissionAuditEntry, type PermissionAuditOutcome, type PermissionAuditScope, type PermissionAuditSnapshot, PermissionManager, type PersistedBudget, type PersistedPart, type PlanApprovalFn, type PlanEnterResult, type PlanModeDeps, PlanModeState, type PlanSettlement, type PluginArtifacts, type PluginAuthor, PluginAuthorSchema, type PluginCommandDir, type PluginCounts, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginSettingsFile, type PluginSourceType, type PluginStateReadOutcome, PluginStore, type PolicyDirSpec, type PolicyDirsSummary, type PolicyLoadOutcome, type PolicyRule, PolicyRuleSchema, type ProjectContext, ProviderError, ProviderRouter, type ProviderStreamChunk, type ProviderToolCall$1 as ProviderToolCall, type ProviderWarning, type PruneResult, type QuestionAskFn, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, type ReadMessagesInput, type ReadMessagesOutput, type RecentWorkspace, RecentWorkspaces, type RecordRunInput, type RecorderOptions, type RecoveryAction, type RegisterInput, type RegisterOutcome, type RegistrarOptions, type RegistrationPatch, type RepairOutcome, type ResolveMentionsOptions, type ResolveReferenceInput, type ResolveSettingsOptions, type ResolvedCompression, type ResolvedReference, type ResolvedSource, type ResponseFormat, type RestorePartsOptions, type ReviewIssue, type RewindAction, type RewindDrift, type RewindFilePlan, type RewindOptions, type RewindOutcome, type RewindPreview, type RoleCreateFailure, type RoleCreateInput, type RoleCreateOptions, type RoleCreateOutcome, type RoleLoadOutcome, type RoleLoadSummary, type RoleMergeNotice, type RoleMergeResult, type RoleScope, type RuleMatch, type RuleSuggestion, type RuleVerdict, type RunCodeFailure, type RunCodeInput, type RunCodeOutcome, type RunCodeToolDeps, type RunEstimateInput, type RunInput, type RunResult, SANDBOX_COVERS, SANDBOX_EXCLUDES, SCALAR_KEYS, SCHEDULE_DEFAULTS, SCHEDULE_DEFAULT_ALLOWLIST, SCHEDULE_ISSUE_CODES, SCHTASKS_FOLDER, SESSION_MESSAGES_READ_TOOL, SESSION_MESSAGES_SEARCH_TOOL, SESSION_QUERY_TOOLS, SESSION_SEARCH_TOOL, SESSION_TRACE_TOOL, SETTINGS_LAYER_ORDER, SETTING_WRITE_APPLY, SETTING_WRITE_KEYS, SETTING_WRITE_LAYERS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_PATCH_TOOL, SKILL_VIEW_TOOL, SKILL_WRITE_FILE_TOOL, SLASH_COMMANDS_DIAG_MODULE, type ScalarKey, type ScanInstructionsOptions, type ScheduleArgvRefusal, type ScheduleArgvResult, type ScheduleArgvWarning, type ScheduleBackend, type ScheduleCliEntry, type ScheduleDraftDeps, type ScheduleDrift, type ScheduleDriftKind, type ScheduleInstallForm, type ScheduleIssue, type ScheduleIssueCode, type ScheduleLock, ScheduleRecorder, ScheduleRegistrar, ScheduleStore, type ScheduleValidation, type SchemaExport, type SearchHit, type SearchInput, type SearchMessagesInput, type SearchMessagesOutput, type SearchOutput, type SearchSessionsInput, type SelectionDeps, type Session, type SessionCandidate, type SessionHit, SessionManager, type SessionMentionDeps, type SessionMeta, SessionQueries, SessionReferences, type SessionSearchDeps, type SessionStats, type SessionSurface, type SessionTrace, type SessionVisibility, type SessionVisibilityInput, type SettingApply, type SettingChain, type SettingFutile, type SettingLayer, type SettingStep, type SettingValue, type SettingValueKind, type SettingWriteFailure, type SettingWriteKey, type SettingWriteLayer, type SettingWriteOutcome, type SettingWriteRequest, type SettingWriteTarget, type SettingWriteTargetsOptions, type SettingsFile, SettingsFileError, SettingsFileSchema, type SettingsLayer, type SettingsResolution, type ShadowFinding, type ShadowKind, type Skill, type SkillDirSource, type SkillDirSpec, type SkillDirsSummary, type SkillImportConflict, type SkillImportDone, type SkillImportEntry, type SkillImportFailure, type SkillImportForm, type SkillImportOptions, type SkillImportPreview, type SkillImportResult, type SkillIndexEntry, type SkillIndexOptions, type SkillIndexResidency, type SkillIndexStats, SkillLearner, type SkillLearningProvider, type SkillMeta, type SkillStats, SkillSystem, type SkillSystemOptions, type SkillViewDeps, type SkillWriteDeps, type SubAgentRunner, type SubTask, type SubToolCaller, type SummarizeOutput, type SurfaceMessage, type SystemPromptParams, type SystemPromptSegments, TOOL_SEARCH_TOOL, TaskNoticeTracker, type TodoItem, type ToolCall, type ToolConflict, type ToolGate, type ToolNameFidelity, type ToolNameLookup, ToolRegistry, type ToolRevealState, type ToolScope, type ToolSearchDeps, type ToolTableCost, type TraceInput, type TraceNode, TrackerDB, type TrustDecision, type TrustGate, type TrustGateOptions, TrustManager, type TurnRecord, type TurnTiming, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, checkEpochVersion, checkFtsHealth, checkShadowing, classifyProviderError, clearModelCache, coalesceRecording, codeModeWorkerPath, commandNameFromRelPath, compileRuleLists, compressionOptions, computeCost, computeCostMicros, countRules, createAllowAllGate, createAllowAllImportGate, createAskQuestionTool, createCodeExecTool, createDelegateTool, createDenyAllGate, createDenyAllImportGate, createGoalTool, createImportGate, createMemoryTool, createPlanModeTools, createPluginAuthorTools, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, defaultModelOf, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, draftCommandLine, draftWidening, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, extractArchive, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasPromptCaching, hasProviderCredentials, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelListCandidates, needsAllowlist, nextFallbackModel, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, pruneArtifacts, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeSessionArtifacts, renderImportTree, renderProjectContext, renderSdkDeclaration, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolveProjectRoot, resolveScheduleBackend, resolveSessionReference, resolveSessionVisibility, resolveSettings, resolveSkillDirs, resolveSource, resolveTar, resolveWorkspace, restoreParts, revealScopedProvider, roleScopedProvider, roleSourceLabel, ruleCovers, ruleFromString, ruleToString, runCode, runCommand, sanitizeArgNames, sanitizeCommand, sanitizeFtsQuery, sanitizePath, sanitizeToolOutput, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, updateMarketplace, updatePlugin, usdToMicros, validateSchedule, validateTrigger, validateWindow, withGoalCompression, withGoalPrompt, workspaceDisplayPath, writeSettingValue };
17645
+ export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, type AcquireResult, type AgentConfig, AgentLoop, type AgentProvider, type AgentSite, type AgentSiteRef, type AppendMessageInput, ApprovalCache, type ApprovalDecision, type ApprovalScope, type ArtifactOpenRefusal, type ArtifactRetention, type AskQuestionDeps, BLOCKED_TOOLS, type BackendOptions, type BackendOutcome, type BackgroundTaskSource, type BaseOrigin, type BaseSlot, type BeginTurnInput, type BreakdownInput, BudgetGuard, type BudgetGuardOptions, type BudgetInfo, type BudgetLevel, type BudgetOptions, type BudgetStatus, BudgetStore, type BudgetStoreOptions, type BuildFireArgvInput, type BuildIndexOptions, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, type CachedApproval, type CachedDecision, type CheckpointCapture, type CheckpointFile, CheckpointManager, type CheckpointManagerOptions, type CheckpointManifest, CheckpointStore, type CheckpointStoreOptions, type CheckpointSummary, type ClaudeHooksParseOptions, type CodeModeLimits, type CodeRequest, type CodeResult, CodeSandbox, type CommandHookConfig, type CommandHookResult, type CommandLoadOutcome, type CommandLoadSummary, type CommandResult, type CommandRunner, type CompactionResult, type CompiledRules, type ComplianceDirSpec, type ComplianceDirsSummary, ComplianceEngine, type ComplianceEngineInput, type ComplianceGate, type ComplianceHit, type ComplianceRule, type ComplianceRuleSource, type ComplianceSettings, type ComplianceVerdict, type CompressConfig, type CompressResult, type ConfigMigration, type ConfigOrigins, ContextCompressor, type ContextEngine, type CreateScheduleInput, type CreateSessionInput, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, type DelegateArgs, type DelegateConfig, DelegateManager, type DelegateTaskResult, type DiagnoseOptions, type DiscoverOutcome, type DiscoveredFile, type DoctorReport, type DraftParse, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, type ExpandOptions, type ExtractOutcome, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_DISPLAY_FIELDS, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceDisplay, type MarketplaceDisplayField, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MarketplaceStatus, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PACK_EXCLUDES, PACK_MAX_BYTES, PACK_MAX_FILES, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_NAME_PATTERN, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, POLICY_DECISIONS, PROJECT_AGENTS_SUBDIR, PROVIDER_NO_CREDENTIAL, type PackFile, type PackLimits, type PackOutcome, type PackPlan, type PackPlanOutcome, type PermissionAuditCode, type PermissionAuditEntry, type PermissionAuditOutcome, type PermissionAuditScope, type PermissionAuditSnapshot, PermissionManager, type PersistedBudget, type PersistedPart, type PlanApprovalFn, type PlanEnterResult, type PlanModeDeps, PlanModeState, type PlanSettlement, type PluginArtifacts, type PluginAuthor, PluginAuthorSchema, type PluginCommandDir, type PluginCounts, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginSettingsFile, type PluginSourceType, type PluginStateReadOutcome, PluginStore, type PolicyDirSpec, type PolicyDirsSummary, type PolicyLoadOutcome, type PolicyRule, PolicyRuleSchema, type ProjectContext, ProviderError, ProviderRouter, type ProviderStreamChunk, type ProviderToolCall$1 as ProviderToolCall, type ProviderWarning, type PruneResult, type QuestionAskFn, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, type ReadMessagesInput, type ReadMessagesOutput, type RecentWorkspace, RecentWorkspaces, type RecordRunInput, type RecorderOptions, type RecoveryAction, type RegisterInput, type RegisterOutcome, type RegistrarOptions, type RegistrationPatch, type RepairOutcome, type ResolveMentionsOptions, type ResolveReferenceInput, type ResolveSettingsOptions, type ResolvedCompression, type ResolvedReference, type ResolvedSource, type ResponseFormat, type RestorePartsOptions, type ReviewIssue, type RewindAction, type RewindDrift, type RewindFilePlan, type RewindOptions, type RewindOutcome, type RewindPreview, type RoleCreateFailure, type RoleCreateInput, type RoleCreateOptions, type RoleCreateOutcome, type RoleLoadOutcome, type RoleLoadSummary, type RoleMergeNotice, type RoleMergeResult, type RoleScope, type RuleMatch, type RuleSuggestion, type RuleVerdict, type RunCodeFailure, type RunCodeInput, type RunCodeOutcome, type RunCodeToolDeps, type RunEstimateInput, type RunInput, type RunResult, SANDBOX_COVERS, SANDBOX_EXCLUDES, SCALAR_KEYS, SCHEDULE_DEFAULTS, SCHEDULE_DEFAULT_ALLOWLIST, SCHEDULE_ISSUE_CODES, SCHTASKS_FOLDER, SESSION_MESSAGES_READ_TOOL, SESSION_MESSAGES_SEARCH_TOOL, SESSION_QUERY_TOOLS, SESSION_SEARCH_TOOL, SESSION_TRACE_TOOL, SETTINGS_LAYER_ORDER, SETTING_WRITE_APPLY, SETTING_WRITE_KEYS, SETTING_WRITE_LAYERS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_PATCH_TOOL, SKILL_VIEW_TOOL, SKILL_WRITE_FILE_TOOL, SLASH_COMMANDS_DIAG_MODULE, type ScalarKey, type ScanInstructionsOptions, type ScheduleArgvRefusal, type ScheduleArgvResult, type ScheduleArgvWarning, type ScheduleBackend, type ScheduleCliEntry, type ScheduleDraftDeps, type ScheduleDrift, type ScheduleDriftKind, type ScheduleInstallForm, type ScheduleIssue, type ScheduleIssueCode, type ScheduleLock, ScheduleRecorder, ScheduleRegistrar, ScheduleStore, type ScheduleValidation, type SchemaExport, type SearchHit, type SearchInput, type SearchMessagesInput, type SearchMessagesOutput, type SearchOutput, type SearchSessionsInput, type SelectionDeps, type Session, type SessionCandidate, type SessionHit, SessionManager, type SessionMentionDeps, type SessionMeta, SessionQueries, SessionReferences, type SessionSearchDeps, type SessionStats, type SessionSurface, type SessionTrace, type SessionVisibility, type SessionVisibilityInput, type SettingApply, type SettingChain, type SettingFutile, type SettingLayer, type SettingStep, type SettingValue, type SettingValueKind, type SettingWriteFailure, type SettingWriteKey, type SettingWriteLayer, type SettingWriteOutcome, type SettingWriteRequest, type SettingWriteTarget, type SettingWriteTargetsOptions, type SettingsFile, SettingsFileError, SettingsFileSchema, type SettingsLayer, type SettingsResolution, type ShadowFinding, type ShadowKind, type Skill, type SkillDirSource, type SkillDirSpec, type SkillDirsSummary, type SkillImportConflict, type SkillImportDone, type SkillImportEntry, type SkillImportFailure, type SkillImportForm, type SkillImportOptions, type SkillImportPreview, type SkillImportResult, type SkillIndexEntry, type SkillIndexOptions, type SkillIndexResidency, type SkillIndexStats, SkillLearner, type SkillLearningProvider, type SkillMeta, type SkillStats, SkillSystem, type SkillSystemOptions, type SkillViewDeps, type SkillWriteDeps, type SubAgentRunner, type SubTask, type SubToolCaller, type SummarizeOutput, type SurfaceMessage, type SystemPromptParams, type SystemPromptSegments, TOOL_SEARCH_TOOL, TaskNoticeTracker, type TodoItem, type ToolCall, type ToolConflict, type ToolGate, type ToolNameFidelity, type ToolNameLookup, ToolRegistry, type ToolRevealState, type ToolScope, type ToolSearchDeps, type ToolTableCost, type TraceInput, type TraceNode, TrackerDB, type TrustDecision, type TrustGate, type TrustGateOptions, TrustManager, type TurnRecord, type TurnTiming, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, checkEpochVersion, checkFtsHealth, checkShadowing, classifyProviderError, clearModelCache, coalesceRecording, codeModeWorkerPath, commandNameFromRelPath, compileRuleLists, compressionOptions, computeCost, computeCostMicros, countRules, createAllowAllGate, createAllowAllImportGate, createAskQuestionTool, createCodeExecTool, createDelegateTool, createDenyAllGate, createDenyAllImportGate, createGoalTool, createImportGate, createMemoryTool, createPlanModeTools, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, defaultModelOf, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, draftCommandLine, draftWidening, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, extractArchive, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasPromptCaching, hasProviderCredentials, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelListCandidates, needsAllowlist, nextFallbackModel, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, projectEntryForDisplay, pruneArtifacts, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeSessionArtifacts, renderImportTree, renderProjectContext, renderSdkDeclaration, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolveProjectRoot, resolveScheduleBackend, resolveSessionReference, resolveSessionVisibility, resolveSettings, resolveSkillDirs, resolveSource, resolveTar, resolveWorkspace, restoreParts, revealScopedProvider, roleScopedProvider, roleSourceLabel, ruleCovers, ruleFromString, ruleToString, runCode, runCommand, sanitizeArgNames, sanitizeCommand, sanitizeFtsQuery, sanitizePath, sanitizeToolOutput, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, updateMarketplace, updatePlugin, usdToMicros, validateSchedule, validateTrigger, validateWindow, withGoalCompression, withGoalPrompt, workspaceDisplayPath, writeSettingValue };