@epoch-agent/core 0.7.1 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +601 -33
- package/dist/index.js +4469 -3563
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1845,6 +1845,91 @@ interface PlanModeDeps {
|
|
|
1845
1845
|
*/
|
|
1846
1846
|
declare function createPlanModeTools(deps: PlanModeDeps): EpochTool[];
|
|
1847
1847
|
|
|
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
|
+
|
|
1848
1933
|
/**
|
|
1849
1934
|
* `schedule_draft` —— 在对话里**起草**一条定时任务,交给人去审。
|
|
1850
1935
|
*
|
|
@@ -2856,17 +2941,27 @@ interface SkillSystem$1 {
|
|
|
2856
2941
|
*
|
|
2857
2942
|
* ## 三、输出**不自己截**
|
|
2858
2943
|
*
|
|
2859
|
-
* 一份 `SKILL.md`
|
|
2860
|
-
*
|
|
2861
|
-
*
|
|
2862
|
-
*
|
|
2863
|
-
*
|
|
2864
|
-
* >
|
|
2865
|
-
* >
|
|
2866
|
-
* >
|
|
2867
|
-
* >
|
|
2868
|
-
* >
|
|
2869
|
-
* >
|
|
2944
|
+
* 一份 `SKILL.md` 轻易超过工具输出预算(`agent/output-budget.ts` 的
|
|
2945
|
+
* `MAX_TOOL_OUTPUT`),而截一半的操作说明比没有更坏 —— 模型会照着前半截把事做完。
|
|
2946
|
+
* 所以这里既不分页也不摘要,正文原样交出去,豁免由工具定义上的
|
|
2947
|
+
* `governsOwnOutput: true` 负责(判据在 `EpochTool.governsOwnOutput` 上)。
|
|
2948
|
+
*
|
|
2949
|
+
* > ⚠️ **2026-09-08:这一段上一次「核过」核错了,而正文被静默截到 2000 字符
|
|
2950
|
+
* > 一直在发生。** 原话是「✅ 2026-08-27 核过:那一格已经是
|
|
2951
|
+
* > `new Set([SKILL_VIEW_TOOL])` 了」——**名字确实对上了,但那个集合没有人用**。
|
|
2952
|
+
* > 它唯一的读者是 `message-utils.ts` 的 `truncateToolOutput()`,而那个函数
|
|
2953
|
+
* > **全仓没有一处生产调用方**:活路径是 `ToolExecutor` 自己那一刀
|
|
2954
|
+
* > (`agent/tool-executor.ts`),它当时不认任何豁免。
|
|
2955
|
+
* > 钉着那个集合的用例直接调那个死函数,所以**它一直是绿的**。
|
|
2956
|
+
* >
|
|
2957
|
+
* > 这一轮的处置是把豁免搬到**执行那一处**能看见的地方(工具定义上),
|
|
2958
|
+
* > 并把那份第二实现(`truncateToolOutput` / `PROTECTED_TOOLS` /
|
|
2959
|
+
* > `TOOL_OUTPUT_MAX_CHARS`)整个删掉 —— 留着它就是留着「下一次又有人把修复
|
|
2960
|
+
* > 接到死函数上」的入口。
|
|
2961
|
+
* >
|
|
2962
|
+
* > **那笔账的形状比上一次记的更值钱**:上一次记的是「一个豁免名单和一个工具名
|
|
2963
|
+
* > 分两处写,走散了不会红」;真正的教训是**核一个豁免要核到它的读者**,
|
|
2964
|
+
* > 光核「名字对不对得上」是核了一半 —— 而对不上和没人用,症状完全一样。
|
|
2870
2965
|
*
|
|
2871
2966
|
* ## 四、`openWorldHint: false` —— 正文**不包** `<tool_output untrusted="true">`
|
|
2872
2967
|
*
|
|
@@ -2914,10 +3009,14 @@ interface SkillSystem$1 {
|
|
|
2914
3009
|
*/
|
|
2915
3010
|
|
|
2916
3011
|
/**
|
|
2917
|
-
* 工具名。**这是同构位置的真源** ——
|
|
3012
|
+
* 工具名。**这是同构位置的真源** —— 另外两处认它:
|
|
2918
3013
|
* `permission/operation-type.ts` 的 `INTERNAL_TOOLS`、`docs/TOOLS.md` 顶上那张表
|
|
2919
|
-
* (这两处由根 `__tests__/tool-registration.test.ts`
|
|
2920
|
-
*
|
|
3014
|
+
* (这两处由根 `__tests__/tool-registration.test.ts` 守着)。
|
|
3015
|
+
*
|
|
3016
|
+
* ⚠️ **2026-09-08 少了一处**:原来还列着 `agent/message-utils.ts` 的
|
|
3017
|
+
* `PROTECTED_TOOLS`(截断豁免名单)。那个名单整个删了,豁免改成下面工具定义上的
|
|
3018
|
+
* `governsOwnOutput: true` —— **同一个对象上的一个字段,不再是异地的一份名字**,
|
|
3019
|
+
* 所以这类「两处走散」从此在这一格上不可能发生。判据全文在文件头第三节。
|
|
2921
3020
|
*
|
|
2922
3021
|
* ⚠️ **下面 `name:` 那一格写的是字面量,不是这个常量,别「顺手」统一** ——
|
|
2923
3022
|
* `.husky/commit-msg` 那道模型门禁认的是 `name: '<snake_case>',` **这一行本身**
|
|
@@ -3140,6 +3239,8 @@ declare function createToolSearchTool(deps: ToolSearchDeps): EpochTool;
|
|
|
3140
3239
|
/**
|
|
3141
3240
|
* Tracker 类型定义 — 会话级 TODO 管理。
|
|
3142
3241
|
*/
|
|
3242
|
+
/** TODO 状态的值域 */
|
|
3243
|
+
type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
3143
3244
|
/** TODO 项 */
|
|
3144
3245
|
interface TodoItem {
|
|
3145
3246
|
/** 6 位 hex 短 ID */
|
|
@@ -3147,7 +3248,7 @@ interface TodoItem {
|
|
|
3147
3248
|
/** 任务描述 */
|
|
3148
3249
|
content: string;
|
|
3149
3250
|
/** 任务状态 */
|
|
3150
|
-
status:
|
|
3251
|
+
status: TodoStatus;
|
|
3151
3252
|
/**
|
|
3152
3253
|
* 放弃这件事的理由。**只有 `cancelled` 那一档会有**,而且**可以没有**。
|
|
3153
3254
|
*
|
|
@@ -3201,6 +3302,14 @@ declare class TrackerDB {
|
|
|
3201
3302
|
constructor(dbPath: string);
|
|
3202
3303
|
/** 按会话 ID 获取所有 TODO */
|
|
3203
3304
|
listBySession(sessionId: string): TodoItem[];
|
|
3305
|
+
/**
|
|
3306
|
+
* 这个会话还有多少没做完({@link isOpenTodo} 那一档)。
|
|
3307
|
+
*
|
|
3308
|
+
* ⚠️ 为什么在 SQL 里数、不 `listBySession()` 再 filter:整个列表可能上千条,
|
|
3309
|
+
* 而这道闸门在**每一轮收工**都会问一次 —— 多拉一个数组比多跑一个 `COUNT(*)`
|
|
3310
|
+
* 贵一个数量级,而且这个数只进一句提示语,用不上任何一行正文。
|
|
3311
|
+
*/
|
|
3312
|
+
countOpen(sessionId: string): number;
|
|
3204
3313
|
/** 全量替换会话的 TODO 列表(事务:DELETE + INSERT 批量) */
|
|
3205
3314
|
replaceAll(sessionId: string, todos: TodoItem[]): void;
|
|
3206
3315
|
/** 释放连接(引用计数归零才真正关闭) */
|
|
@@ -4430,7 +4539,8 @@ declare function loadPlugins(opts: PluginLoadOptions): PluginArtifacts;
|
|
|
4430
4539
|
*
|
|
4431
4540
|
* 插件名会**变成命名空间前缀**(`/my-toolkit:review`、角色 `my-toolkit:reviewer`),
|
|
4432
4541
|
* 所以它必须同时是合法的命令名片段、合法的角色名、以及合法的目录名。
|
|
4433
|
-
*
|
|
4542
|
+
* {@link PLUGIN_NAME_PATTERN}:`[a-z0-9]` 开头,中间允许连字符和下划线
|
|
4543
|
+
* (下划线 2026-09-08 加的,判据在那个常量上)。
|
|
4434
4544
|
* 特别地**不允许 `:`** —— 允许了就能构造出 `a:b` 这种名字,装完之后
|
|
4435
4545
|
* `/a:b:c` 到底是哪个插件的哪条命令要靠猜。
|
|
4436
4546
|
*
|
|
@@ -4443,11 +4553,46 @@ declare const PLUGIN_MANIFEST_FILE = "epoch-plugin.json";
|
|
|
4443
4553
|
/**
|
|
4444
4554
|
* 插件名的合法形状。理由见文件头 —— 它同时是命令前缀、角色前缀和目录名。
|
|
4445
4555
|
*
|
|
4446
|
-
*
|
|
4447
|
-
*
|
|
4556
|
+
* ## ⚠️ 2026-09-08 加宽了:多认一个下划线
|
|
4557
|
+
*
|
|
4558
|
+
* 原来是 `^[a-z0-9][a-z0-9-]*$`,注释写着「和 `AGENT_ROLE_NAME_PATTERN` 逐字相同
|
|
4559
|
+
* 不是巧合:角色名是三者里最严的那个」。**那句话现在不成立了,而加宽是有外因的**:
|
|
4560
|
+
* 嵌入宿主那一侧的插件标识(盘古的 `plugin_key`)允许下划线,而**那个标识必须和
|
|
4561
|
+
* 这个名字是同一个字符串** —— 市场目录里的条目名、包里 `epoch-plugin.json` 的
|
|
4562
|
+
* `name`、宿主用来判「这一条装了没有」的键,三者是同一个东西。
|
|
4563
|
+
* 不加宽的话,一个叫 `my_shop_helper` 的插件在这套体系里**根本装不进来**。
|
|
4564
|
+
*
|
|
4565
|
+
* ## 逐条核过下游三处,`_` 全是安全的(不是「应该没事」)
|
|
4566
|
+
*
|
|
4567
|
+
* | 拼出来的东西 | 谁在判 | `_` 合法吗 |
|
|
4568
|
+
* | ----------------------- | ---------------------------------------------- | ---------- |
|
|
4569
|
+
* | 命令 `/my_plugin:review`| **没人判形状** —— 名字取自文件名,按空白切分 | ✅ |
|
|
4570
|
+
* | 角色 `my_plugin:review` | 复合名带 `:`,本来就过不了那张正则,**不重判** | ✅ |
|
|
4571
|
+
* | 工具 `mcp__my_plugin__x`| provider 那条 `^[a-zA-Z0-9_-]{1,128}$` | ✅(含 `_`)|
|
|
4572
|
+
* | 目录 `plugins/my_plugin`| 文件系统 | ✅ |
|
|
4573
|
+
*
|
|
4574
|
+
* 第三行原来是 `plugin-mcp-servers.ts` 里「前半截白拿」那条判据的依据(它引的是
|
|
4575
|
+
* 「两张正则逐字相同」)—— 那个文件头已经跟着改了:白拿的理由现在是
|
|
4576
|
+
* **provider 的正则本身含 `_`**,而不是「和角色名同宽」。
|
|
4577
|
+
*
|
|
4578
|
+
* ⚠️ **开头那一位没动**(照旧 `[a-z0-9]`):加宽只加中间那一段,这样任何一个
|
|
4579
|
+
* 今天合法的名字明天照样合法。⚠️ **`.` 和路径分隔符仍然不许**(判据见文件头:
|
|
4580
|
+
* 这个名字会被直接 `join(pluginsDir, name)`),**`:` 也仍然不许**。
|
|
4448
4581
|
*/
|
|
4449
4582
|
declare const PLUGIN_NAME_PATTERN: RegExp;
|
|
4450
4583
|
declare function isValidPluginName(name: string): boolean;
|
|
4584
|
+
/**
|
|
4585
|
+
* 「谁写的」。
|
|
4586
|
+
*
|
|
4587
|
+
* ⚠️ **导出它,因为市场目录的条目上也有一格 author**(`marketplace.ts` 的
|
|
4588
|
+
* `EntrySchema`)。两处各写一份 zod 的话,它们分家的那天没有任何东西会红 ——
|
|
4589
|
+
* 而分家的表现是一份在清单里合法的 author 在市场目录里被 `parseLenient` 静默丢掉。
|
|
4590
|
+
*/
|
|
4591
|
+
declare const PluginAuthorSchema: z.ZodObject<{
|
|
4592
|
+
name: z.ZodString;
|
|
4593
|
+
email: z.ZodOptional<z.ZodString>;
|
|
4594
|
+
url: z.ZodOptional<z.ZodString>;
|
|
4595
|
+
}, z.core.$strip>;
|
|
4451
4596
|
declare const ManifestSchema: z.ZodObject<{
|
|
4452
4597
|
name: z.ZodString;
|
|
4453
4598
|
version: z.ZodString;
|
|
@@ -4461,6 +4606,7 @@ declare const ManifestSchema: z.ZodObject<{
|
|
|
4461
4606
|
homepage: z.ZodOptional<z.ZodString>;
|
|
4462
4607
|
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4463
4608
|
}, z.core.$strip>;
|
|
4609
|
+
type PluginAuthor = z.infer<typeof PluginAuthorSchema>;
|
|
4464
4610
|
type PluginManifest = z.infer<typeof ManifestSchema>;
|
|
4465
4611
|
interface ManifestReadOutcome {
|
|
4466
4612
|
/** 校验通过的清单;缺席表示这个目录不是一个可用的插件 */
|
|
@@ -4533,6 +4679,214 @@ declare function checkEpochVersion(range: string | undefined, current: string):
|
|
|
4533
4679
|
*/
|
|
4534
4680
|
declare function currentEpochVersion(): string;
|
|
4535
4681
|
|
|
4682
|
+
/**
|
|
4683
|
+
* 压缩包解包 —— zip 和 tar.gz 都交给系统的 `tar`(方案 32 的第三、四种来源)。
|
|
4684
|
+
*
|
|
4685
|
+
* ## 为什么是 `tar` 而不是一个 npm 依赖
|
|
4686
|
+
*
|
|
4687
|
+
* 当前支持的两个平台上,系统自带的 `tar` **都是 bsdtar,都认 zip**:
|
|
4688
|
+
*
|
|
4689
|
+
* - macOS 自带 bsdtar(`/usr/bin/tar`)
|
|
4690
|
+
* - Windows 10 1803 起自带 `C:\Windows\System32\tar.exe`,同样是 bsdtar
|
|
4691
|
+
*
|
|
4692
|
+
* ## ⚠️ Windows 上必须**指名**那个 bsdtar,不能赌 `PATH`(2026-08-12 修的 bug)
|
|
4693
|
+
*
|
|
4694
|
+
* 上面那句「Windows 上 tar 是 bsdtar」只对**干净的** `PATH` 成立。任何装了
|
|
4695
|
+
* Git for Windows / MSYS2 的机器上,`PATH` 里 `/usr/bin` 排在 `System32`
|
|
4696
|
+
* 前面,`tar` 解析到的是 **GNU tar** —— 而 GNU tar 不吃 Windows 路径:
|
|
4697
|
+
*
|
|
4698
|
+
* - `-f C:\...\x.tgz` 被当成 `host:path` 的远程归档:
|
|
4699
|
+
* `tar (child): Cannot connect to C: resolve failed`
|
|
4700
|
+
* - 连 `-C C:\...\dest` 都会被它按 POSIX 路径 + 反斜杠转义处理掉
|
|
4701
|
+
*
|
|
4702
|
+
* **`--force-local` 解决不了**:GNU tar 认它,而 bsdtar 直接
|
|
4703
|
+
* `Option --force-local is not supported` —— 一个 flag 服务不了两边。
|
|
4704
|
+
* 所以走 {@link resolveTar}:Windows 上指名 `%SystemRoot%\System32\tar.exe`,
|
|
4705
|
+
* 找不到才回落到 `PATH`。这条和 infra 的 `resolveRipgrep()` 是同一个形状 ——
|
|
4706
|
+
* **别让一个外部二进制的身份取决于用户的 PATH 顺序。**
|
|
4707
|
+
*
|
|
4708
|
+
* 换成 JS 实现要自己解 zip 的中央目录 + inflate,再加一份 tar 解析 —— 三百行
|
|
4709
|
+
* 安全敏感的解析代码(路径穿越、zip slip、符号链接逃逸都得自己防),
|
|
4710
|
+
* 而 bsdtar 早就把这些处理完了。多引一个 npm 包则是往一条**会下载并解压
|
|
4711
|
+
* 网络内容**的路径上再加一个供应链面,方向反了。
|
|
4712
|
+
*
|
|
4713
|
+
* `unzip` 不用是因为 Windows 上没有它。
|
|
4714
|
+
*
|
|
4715
|
+
* ## 单根目录会被自动摊平
|
|
4716
|
+
*
|
|
4717
|
+
* GitHub 的 zip 裹一层 `repo-main/`,npm 的 tarball 裹一层 `package/` ——
|
|
4718
|
+
* 两者都不该出现在插件目录里。与其让调用方各猜一个 `--strip-components`,
|
|
4719
|
+
* 不如解完之后看一眼:**清单不在顶层、而顶层恰好只有一个目录**,就把那一层
|
|
4720
|
+
* 提上来。判据是「清单在哪」而不是「有几个条目」,所以一个本来就把
|
|
4721
|
+
* `epoch-plugin.json` 放在顶层、旁边还有一个 `commands/` 的正常包不会被误摊。
|
|
4722
|
+
*/
|
|
4723
|
+
type ExtractOutcome = {
|
|
4724
|
+
ok: true;
|
|
4725
|
+
} | {
|
|
4726
|
+
ok: false;
|
|
4727
|
+
reason: string;
|
|
4728
|
+
};
|
|
4729
|
+
/**
|
|
4730
|
+
* 解一个压缩包到 `dest`(目录必须已存在),然后按需摊平单根目录。
|
|
4731
|
+
*
|
|
4732
|
+
* `tar` 的 `-x` 对 zip 和 tar.gz 是同一条命令 —— bsdtar 按内容自动识别格式,
|
|
4733
|
+
* 不用我们先判后缀(后缀本来也不可信,URL 上写什么都行)。
|
|
4734
|
+
*/
|
|
4735
|
+
/**
|
|
4736
|
+
* 用哪个 `tar`。见文件头那条 ⚠️ —— Windows 上指名系统自带的 bsdtar。
|
|
4737
|
+
*
|
|
4738
|
+
* 用 `%SystemRoot%` 而不是写死 `C:\Windows`:系统盘不一定是 C,而这个环境变量
|
|
4739
|
+
* 是 Windows 自己维护的。取不到再退回字面量,那时候我们已经在猜了,猜一个
|
|
4740
|
+
* 比不猜好 —— 后面还有一层「找不到就回落 PATH」兜着。
|
|
4741
|
+
*/
|
|
4742
|
+
declare function resolveTar(): string;
|
|
4743
|
+
declare function extractArchive(archive: string, dest: string): Promise<ExtractOutcome>;
|
|
4744
|
+
|
|
4745
|
+
/**
|
|
4746
|
+
* 插件打包 —— 一条本地插件目录 → 一个 `.zip`。
|
|
4747
|
+
*
|
|
4748
|
+
* 这是 [archive.ts](./archive.ts) 的**反方向**:那一份把下载来的包解开,这一份
|
|
4749
|
+
* 把用户自己写的插件裹起来交出去。两边共用 {@link resolveTar},所以「用哪个 tar」
|
|
4750
|
+
* 只有一个答案(Windows 上 `PATH` 顺序那个坑记在那个文件头)。
|
|
4751
|
+
*
|
|
4752
|
+
* ```
|
|
4753
|
+
* planPack('/Users/me/my-plugin') → 会打包哪 12 个文件、一共多大、有没有可疑的
|
|
4754
|
+
* packPlugin(plan, mkdtempSync(…)) → /tmp/…/my-plugin-1.0.0.zip
|
|
4755
|
+
* ```
|
|
4756
|
+
*
|
|
4757
|
+
* ## ⚠️ 零、格式是 **zip**,而 2026-09-08 从 `.tar.gz` 改过来的
|
|
4758
|
+
*
|
|
4759
|
+
* 改的原因是外部约束:嵌入宿主的插件仓库(盘古那套)**只收 `.zip`**,
|
|
4760
|
+
* 传别的格式当场被拒。
|
|
4761
|
+
*
|
|
4762
|
+
* 当初选 tar.gz 的理由是「GNU tar 写不出 zip,只有 bsdtar 能」—— 那个顾虑
|
|
4763
|
+
* **不成立**,因为这个项目**只支持 Windows 和 macOS**(README 第一节明写
|
|
4764
|
+
* 「Linux 暂不支持」),而**两个平台自带的都是 bsdtar**。同一条事实也是
|
|
4765
|
+
* `archive.ts` 敢用 `tar -xf` 解 zip 的依据 —— 也就是说「读」那一侧早就在
|
|
4766
|
+
* 依赖它了,「写」这一侧跟着它走才是一致的。
|
|
4767
|
+
*
|
|
4768
|
+
* 落法是 `--format zip`(**不是**靠后缀猜):bsdtar 按 `-f` 的后缀选格式这件事
|
|
4769
|
+
* 不是它的契约,显式给格式才是。本机实测过:`tar -c -f x.zip --format zip` 出来的
|
|
4770
|
+
* 是真 zip(`file(1)` 认、`unzip -l` 也认)—— 后者要紧,因为**解包那一侧可能不是
|
|
4771
|
+
* 我们**(宿主的服务端拿 Python / Java 去解)。
|
|
4772
|
+
*
|
|
4773
|
+
* ## 一、⚠️ 分成两段,是因为**上传是不可逆的对外发布**
|
|
4774
|
+
*
|
|
4775
|
+
* 装一个插件出了错还能卸掉;把一个目录发到别人的服务器上**收不回来**。所以这条路
|
|
4776
|
+
* 上给人的那道闸门不是「确认吗」,而是**「这些文件会离开这台机器」的那一份清单**——
|
|
4777
|
+
* `planPack` 存在的全部理由就是让那份清单在按下去之前拿得到。
|
|
4778
|
+
*
|
|
4779
|
+
* ## 二、⚠️ 喂给 `tar` 的就是 {@link PackPlan.files},**不是一套 `--exclude` 规则**
|
|
4780
|
+
*
|
|
4781
|
+
* 两个理由,第二个是正题:
|
|
4782
|
+
*
|
|
4783
|
+
* 1. `--exclude` 的 glob 语义 GNU tar 和 bsdtar **不一致**(`.git` 这个模式对上
|
|
4784
|
+
* `./.git` 两边表现不同),把排除项建在它上面等于把一条安全相关的判断交给
|
|
4785
|
+
* 「用户机器上装没装 Git for Windows」;
|
|
4786
|
+
* 2. **用户看到的那一份和真发出去的那一份,在构造上必须是同一份。** 走两套规则
|
|
4787
|
+
* (预览走 fs 遍历、打包走 tar 的 glob)的话,它们分叉的那天没有任何东西会红 ——
|
|
4788
|
+
* 而分叉的表现是「预览里没有的东西被发出去了」。
|
|
4789
|
+
*
|
|
4790
|
+
* 所以 `-T <清单文件>`:清单由 {@link planPack} 产出,`packPlugin` 只是把它抄给 tar。
|
|
4791
|
+
*
|
|
4792
|
+
* ## 三、⚠️ 软链**不打包**,而且要说出来
|
|
4793
|
+
*
|
|
4794
|
+
* 一条指向 `~/.ssh/id_rsa` 的软链,tar 默认存的是「链接目标那串字符」而不是内容 ——
|
|
4795
|
+
* 发出去无害但读起来莫名其妙;而真要跟着解引用又是一次**目录外的读取**。
|
|
4796
|
+
* 两头都不选:跳过它,然后在 {@link PackPlan.skippedLinks} 里报出来。
|
|
4797
|
+
* 静默跳过的表现是「解开的包比原目录少东西,而没人说过为什么」。
|
|
4798
|
+
*
|
|
4799
|
+
* ## 四、⚠️ 看起来像密钥的文件**照打**,只是警告
|
|
4800
|
+
*
|
|
4801
|
+
* 处置口径同 `hooks.json` / `mcp.json` 那两行(在安装预览里带警示色、但不拦):
|
|
4802
|
+
* 静默剔除会让用户以为发出去的是全量,而那正是他之后据以判断「要不要重新发一版」
|
|
4803
|
+
* 的依据。说一句、让他自己决定 —— 判据同「拿不准时说拿不准,不猜一个」。
|
|
4804
|
+
*/
|
|
4805
|
+
|
|
4806
|
+
/**
|
|
4807
|
+
* 一律不打包的顶层 / 任意层目录名。
|
|
4808
|
+
*
|
|
4809
|
+
* 四个都是「本机产物」而不是插件内容:`.git` 里有完整历史(常常比插件大两个
|
|
4810
|
+
* 数量级,而且带着作者的邮箱和别的分支),`node_modules` 是装出来的,
|
|
4811
|
+
* `.DS_Store` 是 Finder 写的,`__pycache__` 是 CPython 写的字节码缓存。
|
|
4812
|
+
*
|
|
4813
|
+
* ⚠️ 最后一个 2026-09-09 加的,而它不只是「省点体积」:`.pyc` 里钉着**生成它的
|
|
4814
|
+
* 那个解释器版本**(`cpython-311`),发到一台跑 3.13 的机器上是死重量。
|
|
4815
|
+
* 名字这一格可以按字面判,因为 `__pycache__` 是 CPython 保留的目录名(PEP 3147),
|
|
4816
|
+
* 不会是用户自己的东西 —— 虚拟环境那一档不成立,所以它走 {@link isVirtualenv}。
|
|
4817
|
+
*/
|
|
4818
|
+
declare const PACK_EXCLUDES: readonly string[];
|
|
4819
|
+
/** 默认容量上限。超了拒 —— 一个 2GB 的包交给宿主回调不是「慢一点」,是把它打挂 */
|
|
4820
|
+
declare const PACK_MAX_BYTES: number;
|
|
4821
|
+
declare const PACK_MAX_FILES = 2000;
|
|
4822
|
+
interface PackLimits {
|
|
4823
|
+
maxBytes?: number;
|
|
4824
|
+
maxFiles?: number;
|
|
4825
|
+
}
|
|
4826
|
+
/** 会被打进包里的一个文件 */
|
|
4827
|
+
interface PackFile {
|
|
4828
|
+
/** 相对插件根,**永远用 `/` 分隔** —— 它要写进 tar 的清单文件 */
|
|
4829
|
+
path: string;
|
|
4830
|
+
bytes: number;
|
|
4831
|
+
/**
|
|
4832
|
+
* 落在 token 里,用来判「预览之后这个目录又被改过」。
|
|
4833
|
+
*
|
|
4834
|
+
* 只看大小不够:改一个字符的 `hooks.json` 完全可能字节数不变,而那一改正是
|
|
4835
|
+
* 「你确认的和真发出去的是两份」里最要紧的一种。
|
|
4836
|
+
*/
|
|
4837
|
+
mtimeMs: number;
|
|
4838
|
+
}
|
|
4839
|
+
/** 「会打包什么」。这份东西**同时**是给人看的那一屏和喂给 tar 的清单 */
|
|
4840
|
+
interface PackPlan {
|
|
4841
|
+
/** 插件根的绝对路径 */
|
|
4842
|
+
dir: string;
|
|
4843
|
+
manifest: PluginManifest;
|
|
4844
|
+
/** 按路径排过序 —— 屏幕上要稳定,token 也要稳定 */
|
|
4845
|
+
files: readonly PackFile[];
|
|
4846
|
+
totalBytes: number;
|
|
4847
|
+
/** 名字看起来像密钥的那几条(**在 `files` 里面**,只是被点名了),见文件头第四节 */
|
|
4848
|
+
suspicious: readonly string[];
|
|
4849
|
+
/** 跳过的软链(**不在 `files` 里**),见文件头第三节 */
|
|
4850
|
+
skippedLinks: readonly string[];
|
|
4851
|
+
}
|
|
4852
|
+
type PackPlanOutcome = {
|
|
4853
|
+
ok: true;
|
|
4854
|
+
plan: PackPlan;
|
|
4855
|
+
} | {
|
|
4856
|
+
ok: false;
|
|
4857
|
+
reason: string;
|
|
4858
|
+
};
|
|
4859
|
+
type PackOutcome = {
|
|
4860
|
+
ok: true;
|
|
4861
|
+
archivePath: string;
|
|
4862
|
+
bytes: number;
|
|
4863
|
+
} | {
|
|
4864
|
+
ok: false;
|
|
4865
|
+
reason: string;
|
|
4866
|
+
};
|
|
4867
|
+
/**
|
|
4868
|
+
* 会打包什么。**纯遍历,一个字节都不写、一个子进程都不起。**
|
|
4869
|
+
*
|
|
4870
|
+
* @param dir 插件根的绝对路径(里面得有 `epoch-plugin.json`)
|
|
4871
|
+
*/
|
|
4872
|
+
declare function planPack(dir: string, limits?: PackLimits): PackPlanOutcome;
|
|
4873
|
+
/**
|
|
4874
|
+
* 打好的包叫什么。`<name>-<version>.zip` —— 两格都已经过了清单校验。
|
|
4875
|
+
*
|
|
4876
|
+
* ⚠️ 这个名字**会被宿主原样用作上传的文件名**(盘古那侧按后缀判「只收 .zip」),
|
|
4877
|
+
* 所以后缀不是装饰。判据见文件头第零节。
|
|
4878
|
+
*/
|
|
4879
|
+
declare function packFileName(manifest: PluginManifest): string;
|
|
4880
|
+
/**
|
|
4881
|
+
* 照着 {@link PackPlan} 打一个包。
|
|
4882
|
+
*
|
|
4883
|
+
* ⚠️ **`destDir` 必须在 `plan.dir` 外面。** 同 `install.ts` 的 `withDownloadDir`
|
|
4884
|
+
* 记的那个坑:一个躺在插件目录旁边的压缩包会被下一次 `planPack` 数进去,
|
|
4885
|
+
* 而解包那一侧的 `flattenSingleRoot` 也会因此判断失准。这一条**在这里挡住**,
|
|
4886
|
+
* 不靠调用方记得。
|
|
4887
|
+
*/
|
|
4888
|
+
declare function packPlugin(plan: PackPlan, destDir: string): Promise<PackOutcome>;
|
|
4889
|
+
|
|
4536
4890
|
/**
|
|
4537
4891
|
* 「这个插件里有什么」—— 扫一个插件目录,数出**六类**扩展物(方案 32,
|
|
4538
4892
|
* 方案 44 PR-3 补上第六类 MCP server)。
|
|
@@ -4705,16 +5059,22 @@ declare function scanPluginDir(dir: string, pluginName: string): PluginInventory
|
|
|
4705
5059
|
/**
|
|
4706
5060
|
* 插件是从哪装来的。
|
|
4707
5061
|
*
|
|
4708
|
-
* `marketplace`
|
|
5062
|
+
* `marketplace` 不是第六种传输方式 —— 它最终仍然落到这五种之一,
|
|
4709
5063
|
* 记成独立一档是为了 `epoch plugin list` 能说出「这是从哪个市场装的」,
|
|
4710
5064
|
* 以及 `update` 时知道该回哪个市场重新解析 `source`。
|
|
5065
|
+
*
|
|
5066
|
+
* ⚠️ `host` 是 2026-09-08 加的第五档:**字节由宿主去取**(它有登录会话,
|
|
5067
|
+
* 我们没有)。判据在 `source.ts` 的 `host:` 那一支上。
|
|
5068
|
+
* 它是一档**真的传输方式**而不是 `archive` 的变体:`archive` 那一档的字节
|
|
5069
|
+
* 我们自己下,这一档我们一个网络请求都不发。
|
|
4711
5070
|
*/
|
|
4712
|
-
type PluginSourceType = 'local' | 'git' | 'npm' | 'archive';
|
|
5071
|
+
type PluginSourceType = 'local' | 'git' | 'npm' | 'archive' | 'host';
|
|
4713
5072
|
declare const RecordSchema$1: z.ZodObject<{
|
|
4714
5073
|
name: z.ZodString;
|
|
4715
5074
|
version: z.ZodString;
|
|
4716
5075
|
source: z.ZodString;
|
|
4717
5076
|
sourceType: z.ZodEnum<{
|
|
5077
|
+
host: "host";
|
|
4718
5078
|
local: "local";
|
|
4719
5079
|
git: "git";
|
|
4720
5080
|
npm: "npm";
|
|
@@ -4781,10 +5141,30 @@ interface ResolvedSource {
|
|
|
4781
5141
|
type: PluginSourceType;
|
|
4782
5142
|
/** 用户敲的原文,原样进记录 —— `epoch plugin update` 要照它重来一遍 */
|
|
4783
5143
|
raw: string;
|
|
4784
|
-
/**
|
|
5144
|
+
/**
|
|
5145
|
+
* git 用 clone 地址、npm 用包名、archive 用 URL **或一条本地压缩包路径**、
|
|
5146
|
+
* local 用绝对路径、host 用**宿主自己认得的那串**(我们不解析它)。
|
|
5147
|
+
*/
|
|
4785
5148
|
target: string;
|
|
4786
5149
|
/** archive 专用:`#sha256=…` 里那串十六进制(小写) */
|
|
4787
5150
|
sha256?: string;
|
|
5151
|
+
/**
|
|
5152
|
+
* archive 专用:`target` 是**本机一个压缩包文件**,不是一条 URL(2026-09-08)。
|
|
5153
|
+
*
|
|
5154
|
+
* ## ⚠️ 为什么它是 `archive` 的一格,而不是 `local` 的一格
|
|
5155
|
+
*
|
|
5156
|
+
* `local` 的语义是「**软链**到用户的源码目录,改完重启即生效」——
|
|
5157
|
+
* 那是写插件时用的。一个 `.zip` 文件软链过去之后,
|
|
5158
|
+
* `readPluginManifest` 会去一个**文件**里找 `epoch-plugin.json`,
|
|
5159
|
+
* 读不出来,而报错是「这个目录不是 epoch 插件」(指着一个 zip)。
|
|
5160
|
+
*
|
|
5161
|
+
* 2026-09-08 之前 `resolveSource('/tmp/x.zip')` 正是落到 `local` 那一支的 ——
|
|
5162
|
+
* 也就是说「装一个本地压缩包」这件事**做不到,而且报错指向错的地方**。
|
|
5163
|
+
*
|
|
5164
|
+
* 归到 `archive` 是因为落地方式一致(解包 + 拷贝,不是软链),
|
|
5165
|
+
* 差别只在「字节从哪来」:一条 URL 要下载,这一档直接读文件。
|
|
5166
|
+
*/
|
|
5167
|
+
localFile?: true;
|
|
4788
5168
|
/**
|
|
4789
5169
|
* git 专用:插件在仓库里的子目录,来自 `#subdir=…`。
|
|
4790
5170
|
*
|
|
@@ -4800,22 +5180,42 @@ interface ResolvedSource {
|
|
|
4800
5180
|
* 判定顺序有讲究:`git+https://` 必须排在裸 `https://` 前面,
|
|
4801
5181
|
* 而 `.zip` 结尾的 https 必须排在「其余 https 一律当 git」前面 —— 否则
|
|
4802
5182
|
* `https://x/plugin.zip` 会被 clone。
|
|
5183
|
+
*
|
|
5184
|
+
* ## ⚠️ 一条 https 地址**没有压缩包后缀就会被 clone**,这不是 bug 是这张表的形状
|
|
5185
|
+
*
|
|
5186
|
+
* `isArchiveUrl` 去掉 query 之后要求 `.zip` / `.tgz` / `.tar.gz` 结尾。所以一条
|
|
5187
|
+
* **下载端点**形态的地址(`https://host/api/download?version_id=9`)会落到最后
|
|
5188
|
+
* 那一支、被当成 git 仓库去 clone —— 而报错是一句 git 的话,跟「这是个 zip」
|
|
5189
|
+
* 毫无关系。
|
|
5190
|
+
*
|
|
5191
|
+
* 这一条 2026-09-08 撞到过(盘古的 `download_url` 正是这个形状)。**处置不是
|
|
5192
|
+
* 放宽后缀判断**(那会把一条真的 git 地址判成压缩包),而是让宿主用
|
|
5193
|
+
* `host:` 那一档 —— 那条路上地址由宿主自己认、字节也由宿主自己取。
|
|
4803
5194
|
*/
|
|
4804
5195
|
declare function resolveSource(raw: string): ResolvedSource | undefined;
|
|
4805
5196
|
|
|
4806
5197
|
/**
|
|
4807
|
-
* 插件安装 ——
|
|
5198
|
+
* 插件安装 —— 六种 source 到 `~/.epoch/plugins/<name>/`(方案 32,后两行 2026-09-08)。
|
|
4808
5199
|
*
|
|
4809
|
-
* | 形式 | 落地方式
|
|
4810
|
-
* | ------------------------------------- |
|
|
4811
|
-
* | `./local/path
|
|
4812
|
-
* | `github:owner/repo` / `git+https://…` | `git clone --depth 1`
|
|
4813
|
-
* | `npm:package-name` | `npm pack` + 解包
|
|
4814
|
-
* | `https://…/plugin.zip` | 下载 + 解压,可选 `#sha256=…`
|
|
5200
|
+
* | 形式 | 落地方式 | 谁去取字节 |
|
|
5201
|
+
* | ------------------------------------- | ------------------------------- | ---------- |
|
|
5202
|
+
* | `./local/path`(目录) | **软链**(开发插件时用) | — |
|
|
5203
|
+
* | `github:owner/repo` / `git+https://…` | `git clone --depth 1` | 我们 |
|
|
5204
|
+
* | `npm:package-name` | `npm pack` + 解包 | 我们 |
|
|
5205
|
+
* | `https://…/plugin.zip` | 下载 + 解压,可选 `#sha256=…` | 我们 |
|
|
5206
|
+
* | `./local/plugin.zip`(**文件**) | 直接解压 | — |
|
|
5207
|
+
* | `host:<宿主自己的编码>` | 解压 | **宿主** |
|
|
4815
5208
|
*
|
|
4816
5209
|
* 「用户敲的那串 → 上面哪一行」的解析在 [source.ts](./source.ts):它是这条链上
|
|
4817
5210
|
* 唯一的纯函数,也是参数注入的唯一闸门,所以单独一个文件、单独一张用例表。
|
|
4818
5211
|
*
|
|
5212
|
+
* ## ⚠️ 最后一行是这张表上唯一一档「**我们不发网络请求**」
|
|
5213
|
+
*
|
|
5214
|
+
* 有些包要登录会话才下得到(嵌入宿主的私有插件仓库),而这一层的下载是一次
|
|
5215
|
+
* **裸 fetch,一个凭据都不带** —— 那是刻意的立场(判据在 `marketplace.ts` 文件头
|
|
5216
|
+
* 「为什么不直接支持鉴权」)。`host:` 把取字节整个交给宿主:它有会话、
|
|
5217
|
+
* 它自己校验摘要,交回来一个本地包。判据在 {@link InstallOptions.fetchFromHost} 上。
|
|
5218
|
+
*
|
|
4819
5219
|
* ## 装到临时目录、验完再搬过去
|
|
4820
5220
|
*
|
|
4821
5221
|
* 每一种来源都先落到 `~/.epoch/plugins/.staging-<uuid>/`,读清单、校验名字、
|
|
@@ -4874,6 +5274,33 @@ interface InstallOptions {
|
|
|
4874
5274
|
confirm?: (preview: InstallPreview) => Promise<boolean>;
|
|
4875
5275
|
/** 进度提示(clone / 下载)。不给就静默 —— 库不替宿主决定往哪儿写 */
|
|
4876
5276
|
onProgress?: (message: string) => void;
|
|
5277
|
+
/**
|
|
5278
|
+
* 取一个 `host:` 来源的包 —— **由宿主去下,我们一个网络请求都不发**(2026-09-08)。
|
|
5279
|
+
*
|
|
5280
|
+
* `source.target` 是宿主写在自己那份市场目录里的那串(我们不解析它,
|
|
5281
|
+
* 判据在 `source.ts` 的 `host:` 那一支上);宿主拿它去自己的接口下包、
|
|
5282
|
+
* **自己校验摘要**,然后把一个本地压缩包的路径交回来。
|
|
5283
|
+
*
|
|
5284
|
+
* ⚠️ **不给它 = `host:` 那一档装不了**(`fetchInto` 回一句拒绝)。
|
|
5285
|
+
* 这不是降级路径:那些包我们压根没有凭据去取,
|
|
5286
|
+
* 硬造一次裸 fetch 只会拿到一个 401 的 HTML 然后当成压缩包解。
|
|
5287
|
+
*
|
|
5288
|
+
* ⚠️ **摘要校验在宿主那一侧,这一层不重做**:我们看不见那份目录里的 sha256
|
|
5289
|
+
* (它是宿主的私有编码的一部分),而两处各校一次的话,
|
|
5290
|
+
* 「谁没校」这个问题会有两个答案。宿主那侧不校就是宿主的漏 —— 它的文档该写这条。
|
|
5291
|
+
*/
|
|
5292
|
+
fetchFromHost?: (input: {
|
|
5293
|
+
/** `host:` 后面那串,原样 */
|
|
5294
|
+
target: string;
|
|
5295
|
+
/** 我们准备好的一个**空临时目录**,包放这儿。用完由我们清掉 */
|
|
5296
|
+
destDir: string;
|
|
5297
|
+
}) => Promise<{
|
|
5298
|
+
ok: true;
|
|
5299
|
+
archivePath: string;
|
|
5300
|
+
} | {
|
|
5301
|
+
ok: false;
|
|
5302
|
+
reason?: string;
|
|
5303
|
+
}>;
|
|
4877
5304
|
}
|
|
4878
5305
|
/** 安装前预览(§2.8)。宿主拿它画那张「将安装什么」的表 */
|
|
4879
5306
|
interface InstallPreview {
|
|
@@ -5062,18 +5489,39 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
|
|
|
5062
5489
|
/**
|
|
5063
5490
|
* 插件市场 —— 加市场 / 搜 / 从市场装(方案 32)。
|
|
5064
5491
|
*
|
|
5065
|
-
* 市场 = **一个 `epoch-marketplace.json
|
|
5492
|
+
* 市场 = **一个 `epoch-marketplace.json`**,没有服务端、没有账号:
|
|
5066
5493
|
*
|
|
5067
5494
|
* ```json
|
|
5068
5495
|
* {
|
|
5069
5496
|
* "name": "acme",
|
|
5070
5497
|
* "owner": { "name": "Acme Inc." },
|
|
5071
5498
|
* "plugins": [
|
|
5072
|
-
* {
|
|
5499
|
+
* {
|
|
5500
|
+
* "name": "toolkit",
|
|
5501
|
+
* "description": "…",
|
|
5502
|
+
* "source": "./plugins/toolkit",
|
|
5503
|
+
* "category": "dev",
|
|
5504
|
+
* "author": { "name": "张三" },
|
|
5505
|
+
* "downloads": 1240,
|
|
5506
|
+
* "likes": 87
|
|
5507
|
+
* }
|
|
5073
5508
|
* ]
|
|
5074
5509
|
* }
|
|
5075
5510
|
* ```
|
|
5076
5511
|
*
|
|
5512
|
+
* ⚠️ `downloads` / `likes` 是**市场那一侧数的**,而且**冻在加市场那一刻**
|
|
5513
|
+
* (目录是快照,见下面第二节)—— 判据在那两格自己的注释上。
|
|
5514
|
+
*
|
|
5515
|
+
* ## ⚠️ 「没有上传接口」这句话 2026-09-08 改了半句
|
|
5516
|
+
*
|
|
5517
|
+
* 原话是「没有服务端、没有账号、**没有上传接口**、没有审核」。改的是第三句 ——
|
|
5518
|
+
* 而**改的是主语不是事实**:**我们**仍然没有服务端、没有上传接口,一个字节都不收。
|
|
5519
|
+
* 变的是嵌入宿主那一侧多了一条出口(`HostMarketplaces.upload` 那个回调),
|
|
5520
|
+
* epoch 只负责把一条本地目录打成 `.tar.gz` 交给它([pack.ts](./pack.ts))。
|
|
5521
|
+
*
|
|
5522
|
+
* 于是目录条目上多了一格 `author` —— 一个用户上传的市场里,「清单是谁放的」
|
|
5523
|
+
* (`owner`)和「这一条是谁写的」(`author`)从第二条开始就不相等了。
|
|
5524
|
+
*
|
|
5077
5525
|
* ## 目录是**缓存下来的**,不是每次现拉
|
|
5078
5526
|
*
|
|
5079
5527
|
* `epoch plugin search` 要能在飞机上跑。加市场那一刻把整份目录存进
|
|
@@ -5104,6 +5552,23 @@ declare const EntrySchema: z.ZodObject<{
|
|
|
5104
5552
|
source: z.ZodString;
|
|
5105
5553
|
category: z.ZodOptional<z.ZodString>;
|
|
5106
5554
|
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5555
|
+
author: z.ZodOptional<z.ZodObject<{
|
|
5556
|
+
name: z.ZodString;
|
|
5557
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5558
|
+
url: z.ZodOptional<z.ZodString>;
|
|
5559
|
+
}, z.core.$strip>>;
|
|
5560
|
+
downloads: z.ZodOptional<z.ZodNumber>;
|
|
5561
|
+
likes: z.ZodOptional<z.ZodNumber>;
|
|
5562
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
5563
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
5564
|
+
version: z.ZodOptional<z.ZodString>;
|
|
5565
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
5566
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
5567
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
5568
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
5569
|
+
private: "private";
|
|
5570
|
+
public: "public";
|
|
5571
|
+
}>>;
|
|
5107
5572
|
}, z.core.$strip>;
|
|
5108
5573
|
declare const CatalogSchema: z.ZodObject<{
|
|
5109
5574
|
name: z.ZodString;
|
|
@@ -5118,6 +5583,23 @@ declare const CatalogSchema: z.ZodObject<{
|
|
|
5118
5583
|
source: z.ZodString;
|
|
5119
5584
|
category: z.ZodOptional<z.ZodString>;
|
|
5120
5585
|
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5586
|
+
author: z.ZodOptional<z.ZodObject<{
|
|
5587
|
+
name: z.ZodString;
|
|
5588
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5589
|
+
url: z.ZodOptional<z.ZodString>;
|
|
5590
|
+
}, z.core.$strip>>;
|
|
5591
|
+
downloads: z.ZodOptional<z.ZodNumber>;
|
|
5592
|
+
likes: z.ZodOptional<z.ZodNumber>;
|
|
5593
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
5594
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
5595
|
+
version: z.ZodOptional<z.ZodString>;
|
|
5596
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
5597
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
5598
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
5599
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
5600
|
+
private: "private";
|
|
5601
|
+
public: "public";
|
|
5602
|
+
}>>;
|
|
5121
5603
|
}, z.core.$strip>>;
|
|
5122
5604
|
}, z.core.$strip>;
|
|
5123
5605
|
declare const RecordSchema: z.ZodObject<{
|
|
@@ -5137,6 +5619,23 @@ declare const RecordSchema: z.ZodObject<{
|
|
|
5137
5619
|
source: z.ZodString;
|
|
5138
5620
|
category: z.ZodOptional<z.ZodString>;
|
|
5139
5621
|
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5622
|
+
author: z.ZodOptional<z.ZodObject<{
|
|
5623
|
+
name: z.ZodString;
|
|
5624
|
+
email: z.ZodOptional<z.ZodString>;
|
|
5625
|
+
url: z.ZodOptional<z.ZodString>;
|
|
5626
|
+
}, z.core.$strip>>;
|
|
5627
|
+
downloads: z.ZodOptional<z.ZodNumber>;
|
|
5628
|
+
likes: z.ZodOptional<z.ZodNumber>;
|
|
5629
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
5630
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
5631
|
+
version: z.ZodOptional<z.ZodString>;
|
|
5632
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
5633
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
5634
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
5635
|
+
visibility: z.ZodOptional<z.ZodEnum<{
|
|
5636
|
+
private: "private";
|
|
5637
|
+
public: "public";
|
|
5638
|
+
}>>;
|
|
5140
5639
|
}, z.core.$strip>>;
|
|
5141
5640
|
}, z.core.$strip>;
|
|
5142
5641
|
}, z.core.$strip>;
|
|
@@ -5970,9 +6469,10 @@ interface SystemPromptParams {
|
|
|
5970
6469
|
*
|
|
5971
6470
|
* ## ⚠️ 删了它**不等于** system prompt 不再依赖工具表
|
|
5972
6471
|
*
|
|
5973
|
-
* `PromptBuilder.projectBlock()`
|
|
6472
|
+
* `PromptBuilder.projectBlock()` 里还有五个按工具存在与否开的策略块
|
|
5974
6473
|
* (`isOpenWorldTool` / `enter_plan_mode` / `lsp_diagnostics` /
|
|
5975
|
-
* `ask_user_question
|
|
6474
|
+
* `ask_user_question` / `todo`,五个是 2026-09-08 才算齐的)——
|
|
6475
|
+
* 所以 `loop.ts` 那条**工具名指纹**照样是必须的 ——
|
|
5976
6476
|
* 工具表变了 system prompt 仍然可能要跟着变,只是依赖变少了。
|
|
5977
6477
|
* 判据和一条会红的门禁在 `__tests__/prompt-tool-prose.test.ts`。
|
|
5978
6478
|
*/
|
|
@@ -7247,6 +7747,19 @@ interface GenerateInput {
|
|
|
7247
7747
|
* SDK 只负责单次「请求 → 拿到 tool-call 或文本」。
|
|
7248
7748
|
*/
|
|
7249
7749
|
maxSteps?: number;
|
|
7750
|
+
/**
|
|
7751
|
+
* 中止这一次出站请求,原样交给 AI SDK 的 `abortSignal`。
|
|
7752
|
+
*
|
|
7753
|
+
* ⚠️ **这一格以前整个不存在**,而它的缺席不是「少一个便利功能」:
|
|
7754
|
+
* 一次请求发出去之后没有任何东西能停下它,于是模型进复读环时用户按停止
|
|
7755
|
+
* 没有反应,`repetition-detector` 判出来之后也只能停止读取、出站请求照跑。
|
|
7756
|
+
* 判据全文在 `agent/types.ts` 的 `ProviderGenerateInput.signal` 上。
|
|
7757
|
+
*
|
|
7758
|
+
* 重试那一层**刻意不管它**:signal 一旦 abort,`streamText` 抛的是
|
|
7759
|
+
* `AbortError`,而重试的判据是「这家挂了要不要换一家」—— 用户按了停止
|
|
7760
|
+
* 之后换一家再发一次是最不该做的事。
|
|
7761
|
+
*/
|
|
7762
|
+
signal?: AbortSignal;
|
|
7250
7763
|
/**
|
|
7251
7764
|
* 这一次用哪个 provider(方案 19)。不给 = 配置里的主 provider。
|
|
7252
7765
|
*
|
|
@@ -7436,6 +7949,23 @@ interface ProviderGenerateInput {
|
|
|
7436
7949
|
system?: string;
|
|
7437
7950
|
maxTokens?: number;
|
|
7438
7951
|
maxSteps?: number;
|
|
7952
|
+
/**
|
|
7953
|
+
* 中止这一次**出站请求**。
|
|
7954
|
+
*
|
|
7955
|
+
* ## 为什么必须到这一层
|
|
7956
|
+
*
|
|
7957
|
+
* `RunInput.signal` 一直存在,但 `AgentLoop` 只在**轮次之间**看它,
|
|
7958
|
+
* 这一格以前压根不存在 —— 于是一次请求发出去之后就没有任何东西能停下它。
|
|
7959
|
+
* 后果有两个,都实测过:
|
|
7960
|
+
* 1. 模型进了复读环,用户按停止**没有反应**,得等它把整个输出预算
|
|
7961
|
+
* (某些模型这一格是 384K)吐完或者 provider 自己断;
|
|
7962
|
+
* 2. `repetition-detector` 判出复读之后 `break` 出去只是「我们不再读」,
|
|
7963
|
+
* 出站请求还在跑、token 还在计 —— 检测器等于白做。
|
|
7964
|
+
*
|
|
7965
|
+
* 真 `AbortSignal`(不是 `RunInput.signal` 那个只要 `aborted` 布尔的鸭子类型):
|
|
7966
|
+
* 它要原样交给 AI SDK 的 `abortSignal`,那边需要 `addEventListener`。
|
|
7967
|
+
*/
|
|
7968
|
+
signal?: AbortSignal;
|
|
7439
7969
|
}
|
|
7440
7970
|
interface ProviderGenerateOutput {
|
|
7441
7971
|
text: string;
|
|
@@ -7481,6 +8011,17 @@ interface ProviderGenerateOutput {
|
|
|
7481
8011
|
* 缺席规则同 `usage`:一条都没有时整个缺席,不是空数组。
|
|
7482
8012
|
*/
|
|
7483
8013
|
warnings?: ProviderWarning[];
|
|
8014
|
+
/**
|
|
8015
|
+
* `finishReason === 'looping'` 时给用户看的那句话里要填的数
|
|
8016
|
+
* (「最后 N 个字符里只有约 X% 的片段不重复」)。
|
|
8017
|
+
*
|
|
8018
|
+
* 为什么要一格而不是让循环自己算:判定发生在 `turn.ts`,它掐掉之后
|
|
8019
|
+
* 检测器就跟着那次请求一起没了,循环手上只有已经产出的那段文本 ——
|
|
8020
|
+
* 而那段文本的比例**不等于**开火那一刻窗口里的比例(窗口只看尾巴)。
|
|
8021
|
+
*
|
|
8022
|
+
* 其余 finishReason 下缺席(缺席规则同 `usage`)。
|
|
8023
|
+
*/
|
|
8024
|
+
loopingInfo?: string;
|
|
7484
8025
|
}
|
|
7485
8026
|
/** AgentLoop 需要的 provider 能力 */
|
|
7486
8027
|
interface AgentProvider {
|
|
@@ -7959,6 +8500,33 @@ interface AgentConfig {
|
|
|
7959
8500
|
* 会红的门禁:`runtime/__tests__/compliance-wiring.test.ts`。
|
|
7960
8501
|
*/
|
|
7961
8502
|
compliance?: ComplianceEngine;
|
|
8503
|
+
/**
|
|
8504
|
+
* 「这个会话还有多少项 TODO 没做完」的读点(2026-09-08,收工闸门那一半)。
|
|
8505
|
+
*
|
|
8506
|
+
* 给了之后,模型不再调工具、清单里还有没做完的条目时,循环会注一句
|
|
8507
|
+
* 「还有 N 项没做完」把它踢回去(每 run 最多一次)。不给 = 没有这道闸门,
|
|
8508
|
+
* 行为与改动前逐字节相同 —— 插入宿主和全部既有用例走的都是那一条。
|
|
8509
|
+
*
|
|
8510
|
+
* ## 给**函数**不给数,理由同 `approvedPlan` / `role`
|
|
8511
|
+
*
|
|
8512
|
+
* 这个数在一次 run 里**每一步都在变**(模型每做完一条就 `todo` 替换一次),
|
|
8513
|
+
* 快照等于永远拿到「run 开始那一刻」的清单 —— 而那一刻常常还没落任何条目。
|
|
8514
|
+
* 真正该读它的是「模型想收工的那一轮」,只有现问才拿得到。
|
|
8515
|
+
*
|
|
8516
|
+
* ## `sessionId` 走入参,不走闭包
|
|
8517
|
+
*
|
|
8518
|
+
* 子 agent 是**另一个** sessionId(`delegate_task` 派出去的那个任务自己记一笔,
|
|
8519
|
+
* 见 `tools/builtin/delegate.ts`)。闭包的话,派活的父会话有清单、子任务那一侧
|
|
8520
|
+
* 读到的也是**父的**清单 —— 而子任务确实只被派了几件事,它若拿「父还有 97
|
|
8521
|
+
* 件事没完」来给自己收工,就是最糟的一种假结案。判据同
|
|
8522
|
+
* `backgroundTasks` 那句(闭包会把「这个会话」和「读到的会话」劈开)。
|
|
8523
|
+
*
|
|
8524
|
+
* ⚠️ **装配层的每一处 `new AgentLoop` 都要填**,子 agent 那条也要 ——
|
|
8525
|
+
* 漏填一处的表现是「主会话被闸门护住了、派出去的子任务照样做 3 个就收工」,
|
|
8526
|
+
* 而这两条路在今天都会被批成行径是「智能体偷懒」。会红的门禁:
|
|
8527
|
+
* `runtime/__tests__/todo-gate-wiring.test.ts`。
|
|
8528
|
+
*/
|
|
8529
|
+
pendingTodos?: (sessionId: string) => number;
|
|
7962
8530
|
}
|
|
7963
8531
|
/** 历史里的一条。`parts` 存在时 `content` 是它的文本投影(见 EpochMessage) */
|
|
7964
8532
|
interface HistoryEntry {
|
|
@@ -16651,4 +17219,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
|
|
|
16651
17219
|
*/
|
|
16652
17220
|
declare function codeModeWorkerPath(): string | undefined;
|
|
16653
17221
|
|
|
16654
|
-
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, 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, 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 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 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, 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, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistParts, persistToolResults, persistedUsage, 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, 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 };
|
|
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 };
|