@epoch-agent/protocol 0.2.0 → 0.3.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/README.md CHANGED
@@ -26,6 +26,7 @@
26
26
  | `question.ts` | 结构化提问的请求 / 答复(**不过权限层** —— 提问不是审批) |
27
27
  | `hook.ts` | Hook 类型与 trigger |
28
28
  | `config.ts` | 配置形状 |
29
+ | `sidebar-menu.ts` | 宿主自定义的那几行侧栏菜单:一项长什么样,以及点下去那条 `postMessage` 的 `type`。**只有 Web UI 读它**,但契约得住这儿(`EpochConfig` 和 `WireConfigResponse` 都引它) |
29
30
  | `context.ts` | 上下文预算的构成(`/context` 那张账目:每一段花了多少) |
30
31
  | `task.ts` | 后台任务的形状(宿主要展示它们:状态栏计数、`/tasks`、Web 那一栏) |
31
32
  | `keybindings.ts` | 键位的**值域**(动作全集 + `KeyChord` + 与 `"ctrl+l"` 写法互转)。默认表在 tui |
package/dist/index.d.ts CHANGED
@@ -1198,6 +1198,142 @@ interface ActiveAgentRole {
1198
1198
  source?: AgentRoleSource;
1199
1199
  }
1200
1200
 
1201
+ /**
1202
+ * 内容合规的**契约值** —— 类别与动作。
1203
+ *
1204
+ * 引擎在 core 的 `compliance/`,这里只有那两个字符串联合。放 protocol 是因为
1205
+ * 它们跨了包,而且跨的方式是「同一个字面量在四个地方出现」:
1206
+ *
1207
+ * 1. 用户配置的键名(`compliance.actions.sexual`,schema 在 core/config);
1208
+ * 2. 词库文件名(`~/.epoch/compliance/sexual.txt`);
1209
+ * 3. 遥测属性值(`epoch.compliance.category`);
1210
+ * 4. 界面上那句提示要翻成人话(catalog key `compliance.category.sexual`)。
1211
+ *
1212
+ * 也就是说改一个字面量会同时改掉用户的配置文件、他的词库文件名和看板上的
1213
+ * 一条曲线。这种东西只能有一份,而 protocol 是唯一所有人都能依赖的地方。
1214
+ */
1215
+ /**
1216
+ * 类别。
1217
+ *
1218
+ * 分类的粒度决定了「能不能分档处置」:色情和歧视必须能配不同的动作,
1219
+ * 否则要么一起断线(歧视词误伤代价太大),要么一起放行(色情不该只是告警)。
1220
+ *
1221
+ * 每一类的收词判据和默认档位写在 core 的 `compliance/lexicon/<类别>.ts` 文件头 ——
1222
+ * 那里是唯一该讲「为什么是这一档」的地方。
1223
+ */
1224
+ declare const COMPLIANCE_CATEGORIES: readonly ["sexual", "political", "hate", "violence", "illegal", "self_harm", "privacy"];
1225
+ type ComplianceCategory = (typeof COMPLIANCE_CATEGORIES)[number];
1226
+ /**
1227
+ * 命中之后干什么。
1228
+ *
1229
+ * `off` 是**类别级**的开关,不是一个动作 —— 配成 `off` 的类别连扫都不扫,
1230
+ * 于是它既不出现在判定里,也不进遥测。这和「扫了但不处置」(`warn`)
1231
+ * 是两件事:后者看板上有曲线,前者没有。
1232
+ */
1233
+ declare const COMPLIANCE_ACTIONS: readonly ["block", "mask", "warn", "off"];
1234
+ type ComplianceAction = (typeof COMPLIANCE_ACTIONS)[number];
1235
+
1236
+ /**
1237
+ * 宿主自定义的那几行侧栏菜单(2026-09-02)。
1238
+ *
1239
+ * 形状和口径逐字照 `EpochConfig.brand`(决定 19):**宿主装配期预置的一个配置项,
1240
+ * 界面上没有写端点**,`GET /api/config` 原样下发、没配就不带这个键。
1241
+ * 为什么是配置项而不是 `createWebServer()` 的参数,全文在那个字段上
1242
+ * (一句话:走 `epoch web --json` 起子进程的宿主没有构造函数可传)。
1243
+ *
1244
+ * ## 点下去发生什么:往父窗口发一条 `postMessage`,**不跳页**
1245
+ *
1246
+ * 这是这一格和 `brand` 唯一的形状差别 —— 品牌是一个字符串,菜单是一个**动作**,
1247
+ * 而动作要有个落点。三条路里选了这一条:
1248
+ *
1249
+ * | 落点 | 为什么不 |
1250
+ * | -------------------------- | ------------------------------------------------------------------------ |
1251
+ * | 每项配一个 `href`,画成 `<a>` | 同标签页跳走会**丢掉输入框里没发出去的那句话**(草稿只在内存里,判据在 web 的 `composer/draft.ts`);开新标签页在 webview 里又常常被拦掉,那就是「点了没反应」(决定 20 ①) |
1252
+ * | 我们这边执行一段宿主给的脚本 | 配置文件里的字符串当代码跑,等于把 `~/.epoch/config.yaml` 变成一条执行入口 |
1253
+ * | **发一条消息,宿主自己决定** | 宿主本来就握着这张页所在的窗口 —— 它想跳页、想开抽屉、想弹自己的原生框都行 |
1254
+ *
1255
+ * 于是这一格里**没有 URL**:一项只有 `id`(宿主自己认的那个码)和 `label`
1256
+ * (屏幕上那几个字)。少一个字段的代价是宿主必须自己接一句监听,
1257
+ * 换来的是「点下去会怎样」这件事完全在宿主手里,我们一处都猜不着。
1258
+ *
1259
+ * ## 宿主那一侧怎么接
1260
+ *
1261
+ * 两种嵌法都是同一条 `message` 事件,因为我们发的时候用的是 `window.parent`
1262
+ * ——它在**没有父窗口**时就等于 `window` 自己(DOM 规范),于是:
1263
+ *
1264
+ * ```js
1265
+ * // ① iframe / webview 里嵌:监听装在外层那份文档上
1266
+ * // ② Electron 这类「这张页就是顶层文档」的嵌法:监听由 preload 装在同一个 window 上
1267
+ * window.addEventListener('message', (e) => {
1268
+ * if (e.data?.type !== 'epoch:sidebar-menu') return;
1269
+ * openMyOwnPage(e.data.id);
1270
+ * });
1271
+ * ```
1272
+ *
1273
+ * ⚠️ **判 `type` 那一句不能省**:同一个 window 上跑着的别人(devtools 扩展、
1274
+ * 打包器的热更新通道)也在发 `message`。那个字面量的真源是
1275
+ * {@link SIDEBAR_MENU_MESSAGE_TYPE},别在宿主那边手抄第二遍。
1276
+ *
1277
+ * ⚠️ **`targetOrigin` 我们发的是 `'*'`,而这不是漏了一道校验。** 这条消息的全部
1278
+ * 内容是**宿主自己写进自己配置文件的那个 `id`** —— 里面没有 token、没有会话 id、
1279
+ * 没有任何一个字是从别处读来的。收窄成一个可配的 origin 只会多一个键,
1280
+ * 而它唯一的效果是让宿主更容易把自己的监听配错(同 core 那条
1281
+ * 「没有消费方的配置项就是死键」)。反过来的方向照旧守着:**我们不监听
1282
+ * `message`**,所以宿主发什么进来都改不动这张页的任何状态。
1283
+ */
1284
+ /**
1285
+ * 侧栏菜单里的一项。
1286
+ *
1287
+ * ⚠️ 三个字段都是**宿主的话**,一个都不过 i18n catalog —— 同侧栏底下那几条启动
1288
+ * 诊断的 `detail`:它们的内容随宿主而变,没有有限的码可以枚举。用户把界面切成
1289
+ * 英文之后这几行**仍然是宿主给的那份文案**,那是预期形态不是漏翻。
1290
+ */
1291
+ interface SidebarMenuItem {
1292
+ /**
1293
+ * 宿主自己认的那个码 —— 点下去原样回给它({@link SidebarMenuMessage.id})。
1294
+ *
1295
+ * ⚠️ **一份菜单里不许重复**(core 的 schema 拦这一条):重了的话宿主收到消息
1296
+ * 也分不出用户按的是哪一行,而屏幕上那两行长得完全不一样。
1297
+ *
1298
+ * 它**不是**给人看的,所以不必好读;给人看的是 {@link label}。
1299
+ */
1300
+ id: string;
1301
+ /** 屏幕上那几个字。空串是配错了(不要这一项就别写它),core 的 schema 会拦 */
1302
+ label: string;
1303
+ /**
1304
+ * 行首那枚图标的名字。**不给不等于没有图标** —— 那一行会落一枚默认的
1305
+ * (一个朝外的箭头,「点下去离开这一屏」)。
1306
+ *
1307
+ * ⚠️ **这一句 2026-09-02 改过口径**:原来是「不给就不画图标」,而那一版
1308
+ * 拍照拍出来是「有 / 没有 / 没有 / 设置有」的**参差一列** —— 中间那两行的字
1309
+ * 悬在空处,读成「掉了图标」。判据在 web 的 `HOST_ICON_FALLBACK` 上:
1310
+ * 一列图标要么整列有、要么整列没有。
1311
+ *
1312
+ * ⚠️ 类型是 `string` 而不是一个联合:图标名是**第一方 Web UI 自己那张精灵图**的
1313
+ * 私有词表(`web/src/icons.tsx`),把它写进契约等于对宿主承诺那三十几个名字
1314
+ * 一个都不改。所以认哪几个名字由 web 那一层说了算(一张**白名单**,判据在
1315
+ * `shell/host-menu.tsx` 上),**认不出来的当没给** —— 落那枚默认的,
1316
+ * 不画一个空框,也不整份配置退默认值。
1317
+ */
1318
+ icon?: string;
1319
+ }
1320
+ /**
1321
+ * 那条 `postMessage` 的 `type`。**宿主和我们共用这一个字面量**,两边都别手抄。
1322
+ *
1323
+ * 带 `epoch:` 前缀是为了在一条本来就热闹的通道上认出自己的消息(见文件头那条 ⚠️)。
1324
+ */
1325
+ declare const SIDEBAR_MENU_MESSAGE_TYPE = "epoch:sidebar-menu";
1326
+ /**
1327
+ * 点了某一行之后发出去的那条消息。
1328
+ *
1329
+ * ⚠️ **只有 `id`,不带 `label`**:标签是宿主自己配的,它手上已经有;而多带一份
1330
+ * 就是多一份会漂的副本 —— 宿主改了配置、这条消息里那句话还是上一版的。
1331
+ */
1332
+ interface SidebarMenuMessage {
1333
+ type: typeof SIDEBAR_MENU_MESSAGE_TYPE;
1334
+ id: string;
1335
+ }
1336
+
1201
1337
  /**
1202
1338
  * 配置契约。
1203
1339
  *
@@ -1539,6 +1675,57 @@ interface EpochConfig {
1539
1675
  /** 一次返回几条,缺省 5。上限 20 —— 再多也超出模型能有效读的范围 */
1540
1676
  maxResults?: number;
1541
1677
  };
1678
+ /**
1679
+ * 内容合规过滤(core 的 `compliance/`)。
1680
+ *
1681
+ * ## 整段缺省 = **开着,但只拦用户输入**
1682
+ *
1683
+ * 这个仓库里绝大多数能力是「没配就没有」(`search` / `telemetry` / `statusLine`)。
1684
+ * 合规反过来:默认关等于「装了但没生效」,而那种状态和压根没做这个功能在
1685
+ * 外部看起来一模一样 —— 一个部署方会以为自己有一道闸门。
1686
+ *
1687
+ * ⚠️ **但缺省只拦输入侧**(`scope.output` 缺省 `false`,2026-09-01 的口径)。
1688
+ * 模型输出那一侧代码全在、一行配置就能开,缺省关掉的两条理由都是量出来的:
1689
+ * 它是误伤的大头(`block` 档会**直接终止这一轮回答**,而模型输出里一半是代码
1690
+ * 和技术叙述),以及它要收流式延迟(句子级 holdback,每个用户每轮都在付)。
1691
+ *
1692
+ * 输入侧的代价小得多:拦错了是用户自己刚敲的那一句,他当场看得见、改一下重发。
1693
+ *
1694
+ * 剩下的误伤靠两条压住:内置词表刻意窄(只收「几乎没有正当技术用途」的词),
1695
+ * 以及**默认跳过代码**(围栏块与行内 code)。判据分别在
1696
+ * core 的 `compliance/lexicon/sexual.ts` 和 `compliance/types.ts`。
1697
+ *
1698
+ * ## 它明确做不到什么
1699
+ *
1700
+ * 判不了语义(换个说法就绕过去了)、管不到模型生成的工具入参
1701
+ * (`scope.toolArgs`,默认关)、管不到工具 / 联网读回来的内容。
1702
+ * 这三条是知情的缺口,全文在 `compliance/types.ts` 的文件头。
1703
+ *
1704
+ * 每一格缺省时**逐键**退回 core 的 `DEFAULT_COMPLIANCE_SETTINGS`:
1705
+ * 只写一行 `actions.hate` 不会把其余六个类别一起清空。
1706
+ */
1707
+ compliance?: {
1708
+ /** 缺省 `true` */
1709
+ enabled?: boolean;
1710
+ /** 拦哪几条通道。缺省:**输入开、输出关**、工具入参关(见上面那段 ⚠️) */
1711
+ scope?: {
1712
+ output?: boolean;
1713
+ input?: boolean;
1714
+ toolArgs?: boolean;
1715
+ };
1716
+ /** 围栏块和行内 code 里的内容不判。缺省 `true` */
1717
+ skipCodeBlocks?: boolean;
1718
+ /** 缓冲区上限,缺省 400。超过就强制判一次,不为了等一个句号憋住整段 */
1719
+ maxHoldChars?: number;
1720
+ /**
1721
+ * 类别 → 动作。缺省:色情 / 涉政 `block`,歧视 `mask`,
1722
+ * 暴恐 / 违法 / 自残 `warn`,个人敏感信息 `off`。
1723
+ *
1724
+ * `off` 是**连扫都不扫**(不进判定、不进遥测),和「扫了但不处置」
1725
+ * (`warn`)是两件事。
1726
+ */
1727
+ actions?: Partial<Record<ComplianceCategory, ComplianceAction>>;
1728
+ };
1542
1729
  /**
1543
1730
  * 会话检索(方案 48)。整段缺省 = 两个工具照常注册,**只是不跨工作区**。
1544
1731
  *
@@ -1623,6 +1810,23 @@ interface EpochConfig {
1623
1810
  * 因为侧栏那一行还要装搜索框。
1624
1811
  */
1625
1812
  brand?: string;
1813
+ /**
1814
+ * 宿主自定义的那几行侧栏菜单(2026-09-02)。**缺省 = 侧栏上一行都不多**。
1815
+ *
1816
+ * 形状、口径、以及「点下去往父窗口发一条 `postMessage`」那条判据,全文在
1817
+ * [sidebar-menu.ts](./sidebar-menu.ts) 的文件头 —— 这儿只记它和 {@link brand}
1818
+ * 的**关系**:两个键是同一类东西(宿主装配期按下的事实、只读、`GET /api/config`
1819
+ * 原样下发、没配就不带那个键),所以它们并排放在顶层,而不是塞进 `display`
1820
+ * (那一段收的是**用户**的显示偏好)。
1821
+ *
1822
+ * ⚠️ **空数组是配错了,不是「不要菜单」** —— 不要就别写这个键,同 `brand`
1823
+ * 那条「空串是配错了」。core 的 schema 会为它产出一条带字段路径的 warn 诊断。
1824
+ *
1825
+ * ⚠️ **不设条数上限**,判据同 `brand` 的「不设长度上限」:为「菜单有点长」判一次
1826
+ * 校验失败,代价是宿主**整份配置**(含模型和 key)退默认值。装不下由界面自己
1827
+ * 兜(web 那一格滚动),不由校验兜。
1828
+ */
1829
+ sidebarMenu?: readonly SidebarMenuItem[];
1626
1830
  /**
1627
1831
  * `~/.epoch/artifacts/` 的保留策略(方案 47 PR-4)。**缺省 = 内置默认**
1628
1832
  * (7 天 / 512MB)—— 整段不配和显式写这两个默认值,行为逐字节相同。
@@ -2301,6 +2505,15 @@ declare const METRIC: {
2301
2505
  /** 同一 provider 内模型级降级的次数(方案 26 #10/#11),属性带 from/to */
2302
2506
  readonly MODEL_FALLBACK: "epoch.model.fallback.count";
2303
2507
  readonly CONTEXT_COMPACTION: "epoch.context.compaction.count";
2508
+ /**
2509
+ * 内容合规闸门命中的次数。属性 `category`(类别)/ `action`(block / mask / warn)
2510
+ * / `channel`(`output` 还是 `input`)。
2511
+ *
2512
+ * ⚠️ **命中的原文和词条本身永不进遥测** —— 那等于我们自己把违规内容抄一遍
2513
+ * 送出门(判据在 core 的 telemetry/sanitize.ts 开头)。看板上要的是
2514
+ * 「哪一类在涨」,不是「涨的是哪句话」。
2515
+ */
2516
+ readonly COMPLIANCE_HIT: "epoch.compliance.hit.count";
2304
2517
  readonly STARTUP_DURATION: "epoch.startup.duration";
2305
2518
  };
2306
2519
  /**
@@ -2509,8 +2722,20 @@ type FinishReason =
2509
2722
  | 'stalled'
2510
2723
  /** 被宿主中止 */
2511
2724
  | 'aborted'
2512
- /** 模型安全策略拒答 */
2725
+ /** 模型安全策略拒答 —— 是 **provider** 拒答,不是我们拦的 */
2513
2726
  | 'content-filter'
2727
+ /**
2728
+ * 我们自己的内容合规闸门拦下了(core 的 `compliance/`)。
2729
+ *
2730
+ * ⚠️ **刻意不复用 `content-filter`。** 那个值的含义是「provider 拒答了」,
2731
+ * 处置和说法都不一样:那一档用户能做的是换个说法再问,这一档是内容触了
2732
+ * 部署方配的合规红线(词表 + 类别档位),换说法不一定有用,而且该看的是
2733
+ * 「哪个类别」。混成一个值之后,界面上只能给出一句同时对两种情况都不准的话。
2734
+ *
2735
+ * 输入侧被拦下时也是这个值 —— 那一次**请求根本没发出去**(`usage` 全零),
2736
+ * 与输出侧被拦下的区别在文本里说清,不在这个枚举里分叉。
2737
+ */
2738
+ | 'compliance'
2514
2739
  /** 触达成本或 token 预算上限 */
2515
2740
  | 'budget-exceeded'
2516
2741
  /** 异常终止(详情见前一个 error 事件) */
@@ -2781,7 +3006,43 @@ type NoticeCode =
2781
3006
  * (`maybeLearn()` 紧接着就是 `yield finish('stop'); return;`)。发在这里还有
2782
3007
  * 第二层意思:那一轮正是这条技能**真的进了 system prompt** 的那一轮。
2783
3008
  */
2784
- 'skill-learned';
3009
+ 'skill-learned'
3010
+ /**
3011
+ * provider **把用户发的图片丢了**,而请求已经发出去、已经计费(2026-09-01)。
3012
+ *
3013
+ * 和 `agent_run.images_unsupported` 那条错误分得很清,两者别混:
3014
+ *
3015
+ * | | 谁判的 | 什么时候 | 钱 |
3016
+ * | --- | --- | --- | --- |
3017
+ * | `images_unsupported`(`error` 帧) | **我们**(闸门 1 的输入侧) | 发请求**之前** | 没花 |
3018
+ * | 这一条(`notice` 帧) | **provider 自己报的 warning** | 请求回来之后 | **已经花了** |
3019
+ *
3020
+ * 也就是说走到这一帧意味着闸门 1 判「这个模型认图」,而 provider 那侧不认。
3021
+ * 2026-09-01 那次事故就是这一格:`@ai-sdk/deepseek@3.0.20` 静默丢弃图片,
3022
+ * 模型对着一张不存在的图回答「我只看到一个占位符」,而屏幕上一个字都没有。
3023
+ *
3024
+ * ⚠️ **一次 run 只发一帧**,不是每轮一帧:带图的那条用户消息在这一次 run 的
3025
+ * 每一轮都会重发,逐轮报的话一次多工具调用的对话会刷出十几行同样的话。
3026
+ */
3027
+ | 'images-dropped'
3028
+ /**
3029
+ * 内容合规的输入闸门**改写了用户刚发的那句话**(`mask` 档,2026-09-01)。
3030
+ *
3031
+ * ## 没有这一帧的话,这件事是**静默**的
3032
+ *
3033
+ * `mask` 档不拒绝、也不报错:它把命中处换成 `*` 之后照常发出去。而屏幕上那条
3034
+ * 用户气泡显示的是**用户自己敲的原文**(宿主回显的是输入框里那份),
3035
+ * 模型收到的是打过码的那份 —— 两边不一样,且没有任何东西说过这件事。
3036
+ *
3037
+ * 实测过:`帮我翻译一下黑鬼这个词` 发出去变成 `帮我翻译一下**这个词`。
3038
+ * 用户看着自己那句完整的话,收到一个答非所问的回复,**没有任何线索**。
3039
+ * 这一帧就是那个线索。
3040
+ *
3041
+ * ⚠️ 和 `block` 那一档分得很清:那一档请求根本没发,走的是
3042
+ * `finish: 'compliance'` + 一句正文,用户当场知道发生了什么。
3043
+ * 这一档请求照发,所以只欠一句旁白。
3044
+ */
3045
+ | 'compliance-masked';
2785
3046
  type AgentEventType = AgentEvent['type'];
2786
3047
  /** 取出某个具体事件的类型,例如 AgentEventOf<'tool-call'> */
2787
3048
  type AgentEventOf<T extends AgentEventType> = Extract<AgentEvent, {
@@ -3721,13 +3982,36 @@ declare function sessionPartSummary(part: EpochSessionPart): string;
3721
3982
  * | 谁要 | 用哪一份 | 为什么 |
3722
3983
  * | ---- | -------- | ------ |
3723
3984
  * | 模型(`sdk-adapter.ts` / `agent/loop.ts` / `runtime/agent-session.ts`) | **这一个** | 模型输入契约 + eval 指纹,跟着 locale 变就漂(§33.2) |
3985
+ * | ↳ 其中 `agent/loop.ts` 拼**给模型的文本部件**那一次 | 这一个 + `{ imagesCarriedAsParts: true }` | 图片另有真部件带着,占位符会变成一句假话(判据见 {@link ContentToTextOptions}) |
3724
3986
  * | `messages.content` 那一列(存盘 / 压缩 / 审计 / FTS) | **这一个** | 一条落库的记录跟着 `EPOCH_LANGUAGE` 变语言,等于把同一段会话的历史劈成两半 |
3725
3987
  * | 界面(tui 的历史项、web 的气泡) | `contentToDisplayText(content, t)` | 那一份走 catalog 的 `message_part.*`,住在两个宿主里 |
3726
3988
  *
3727
3989
  * 界面那一份**落在宿主层**而不是这儿,判据同 §34.6 给 `view` 那 1 处的做法
3728
3990
  * (兜底文案挪给渲染端):这个包的依赖白名单是空的,`t()` 只能由有它的那一层调。
3729
3991
  */
3730
- declare function contentToText(content: EpochUserContent): string;
3992
+ interface ContentToTextOptions {
3993
+ /**
3994
+ * 这一条消息的图片**是不是另有真部件带着**(`EpochMessage.parts` 里那份
3995
+ * base64,最终变成 provider 的原生图片部件)。
3996
+ *
3997
+ * 默认 `false` —— 也就是改造前的行为,落库那一列要的正是它:那一行
3998
+ * `[图片 image/png]` 是**这一轮带过一张图**的唯一记录(`parts` 列另存,
3999
+ * 但 FTS / 预览 / 标题只看 content)。
4000
+ *
4001
+ * `true` 时图片那一支整个**不折占位符**。判据是那句占位符的含义 ——
4002
+ * 「这里本来有张图,但你看不到」。图真的在旁边时它就成了一句假话,而且是
4003
+ * 会被照着信的那种:2026-09-01 实测,`@ai-sdk/deepseek@3.0.20` 把图片
4004
+ * 静默丢了之后,模型读到的就是这一行,于是它逐字回答「我只看到
4005
+ * 「[图片 image/jpeg]」这个占位符,图片没有传到我这边」。**升级 SDK 让图片
4006
+ * 真的送达之后,这一行反而成了唯一还在撒谎的地方。**
4007
+ *
4008
+ * ⚠️ 只关图片那一支。`file` / `session` 的占位符**照旧**:它们说的是
4009
+ * 「内容没附上」(`omitted` / `not-restored`),那句话在任何情况下都是真的,
4010
+ * 而且是模型唯一能知道「有个东西没给我」的途径。
4011
+ */
4012
+ imagesCarriedAsParts?: boolean;
4013
+ }
4014
+ declare function contentToText(content: EpochUserContent, opts?: ContentToTextOptions): string;
3731
4015
  /**
3732
4016
  * 「上一轮实际动过手」在**给模型的**历史里长什么样(2026-08-28)。
3733
4017
  *
@@ -5540,6 +5824,21 @@ interface WireConfigResponse {
5540
5824
  * 界面上改不了它 —— 那是宿主的事,不是用户的事。
5541
5825
  */
5542
5826
  brand?: string;
5827
+ /**
5828
+ * 宿主自定义的那几行侧栏菜单 —— **宿主没配就没有这个键**(2026-09-02)。
5829
+ *
5830
+ * 和 {@link brand} 同一个形状、同一个理由,连搭在这条端点上的理由都一样:
5831
+ * 侧栏首屏就要画它,为一份可选的静态清单另开一个端点等于让每个客户端多一次往返。
5832
+ * 它**只读** —— 那是宿主装配期的事,界面上没有、也不会有改它的入口。
5833
+ *
5834
+ * 来源是 `EpochConfig.sidebarMenu`;每一项的字段含义、以及点下去发出去的那条
5835
+ * `postMessage` 的契约,全文在 [sidebar-menu.ts](./sidebar-menu.ts) 的文件头。
5836
+ *
5837
+ * ⚠️ **原样转发,服务端一个字都不改**:`label` 不翻译(它是宿主的话,
5838
+ * 同诊断的 `detail`),`icon` 认不认得出来也不在这一层判 —— 那张白名单是
5839
+ * 第一方 Web UI 自己的事,而这条端点也服务着自己画前端的宿主(EMBEDDING §10)。
5840
+ */
5841
+ sidebarMenu?: readonly SidebarMenuItem[];
5543
5842
  /**
5544
5843
  * 自动压缩那条线(决定 8 的第三个时刻,2026-08-16)。形状与三条判据见
5545
5844
  * {@link WireCompressionLine}。
@@ -5585,6 +5884,33 @@ interface WireConfigResponse {
5585
5884
  * 端点要么复用一个名字不对的字段,要么再加一格,而两格迟早对不上。
5586
5885
  */
5587
5886
  lanExposed: boolean;
5887
+ /**
5888
+ * 这个服务进程**能不能替浏览器弹一个系统目录选择框**(2026-09-01)。
5889
+ *
5890
+ * 真源是 `server/src/workspace/native-pick.ts` 的 `resolveNativeDirPicker()`,
5891
+ * 装配时算一次(那是一个纯函数,判据和它继承的那个盲区都写在它上面)。
5892
+ *
5893
+ * ## 为什么浏览器要知道它
5894
+ *
5895
+ * 因为「打开本地文件夹」那一项**有两种实现**,而选哪一种只有服务端答得出:
5896
+ * 为真时那一下走 `POST /api/workspaces/pick`(框弹在服务进程那台机器的屏幕上,
5897
+ * 而那台机器此刻就是用户面前这一台);为假时走自绘那一屏
5898
+ * (`GET /api/workspaces/dirs` + `session/dir-picker.tsx`)。
5899
+ *
5900
+ * ⚠️ **界面这一格是给人的那道闸,服务端那一道才是给网线的**:`POST
5901
+ * /api/workspaces/pick` 在这一格为假时一律 **403 `native-picker-unavailable`**,
5902
+ * 一个子进程都不起。判据逐字同 {@link lanExposed} —— 它是一个客户端自己改得动
5903
+ * 的布尔,别把服务端那道摘掉让这一格单独扛。
5904
+ *
5905
+ * ⚠️ **必填,而且不知道时该当 `false`**(客户端那一侧的 `?? false`):
5906
+ * 往保守那一侧落 —— 猜错成 `true` 的表现是用户点下去吃一个 403,
5907
+ * 猜错成 `false` 的表现只是他看到自绘那一屏,而那一屏在任何机器上都能用。
5908
+ *
5909
+ * ⚠️ 它**不是**「这台机器有没有图形界面」那种通用事实,别拿它去关别的东西:
5910
+ * 它是四件事的合取(回环绑定 + 非 SSH + 平台在支持列表里 + 这条路真的实现了),
5911
+ * 而其中第一条是一句**关于浏览器在哪儿**的推断。
5912
+ */
5913
+ nativeDirPicker: boolean;
5588
5914
  }
5589
5915
  declare const WIRE_CONFIG_FIELDS: WireFields<WireConfigResponse>;
5590
5916
  /**
@@ -6351,6 +6677,34 @@ declare const WIRE_SESSION_REFERENCE_FIELDS: WireFields<WireSessionReference>;
6351
6677
  */
6352
6678
  type WireFileReference = Omit<EpochFilePart, 'type' | 'text'>;
6353
6679
  declare const WIRE_FILE_REFERENCE_FIELDS: WireFields<WireFileReference>;
6680
+ /**
6681
+ * 用户附的一张图**在网线上的样子**(2026-09-01)。
6682
+ *
6683
+ * ## 为什么它和上面两份不一样:**这一格不摘,它就是引用本身**
6684
+ *
6685
+ * `WireSessionReference` / `WireFileReference` 摘的是 `text`(内容),因为内容对
6686
+ * 浏览器没用。图片反过来 —— 界面要的**就是**那张图。所以这里只摘 `type`
6687
+ * (在这儿是恒等式),`image` 原样留着。
6688
+ *
6689
+ * ⚠️ **但 `image` 在这条线上永远是一个「引用」,不是 base64**,三种形态:
6690
+ *
6691
+ * | 从哪来 | `image` 装的是 | 谁换算成 `<img src>` |
6692
+ * | --- | --- | --- |
6693
+ * | 回放(`GET /messages`) | **服务端绝对路径** | 前端,`artifactSrc()` 那几行 |
6694
+ * | 远端图(用户贴的 http 图) | 原样 `http(s)://…` | 直接用 |
6695
+ * | 刚发出去那一条(本地乐观回显) | `data:image/…;base64,…` | 直接用 |
6696
+ *
6697
+ * 前两种由 `restoreParts({ inlineImages: false })` 保证(判据逐字在
6698
+ * `core/src/session/payload.ts` 的 `RestorePartsOptions` 上:那一支「**不能**直接
6699
+ * 喂给 provider」,反过来说它正是给界面的那一支)。第三种压根没上过网线 ——
6700
+ * 浏览器自己刚读的那个文件(`composer/attach.tsx` 里 `readAsDataUrl`)。
6701
+ *
6702
+ * **服务端绝不在这条线上发 base64。** 几百 KB 逐字符走 SSE 会把流塞住,
6703
+ * 这条硬规矩和 `ToolArtifact.data` 那一条是同一条(全文在
6704
+ * `web/src/api/artifacts.ts` 的文件头)。
6705
+ */
6706
+ type WireImageReference = Omit<EpochImagePart, 'type'>;
6707
+ declare const WIRE_IMAGE_REFERENCE_FIELDS: WireFields<WireImageReference>;
6354
6708
  declare const WIRE_SEND_MESSAGE_RESPONSE_FIELDS: WireFields<WireSendMessageResponse>;
6355
6709
  /** `aborted: false` 表示这一轮本来就没在跑,不是失败 */
6356
6710
  interface WireAbortResponse {
@@ -7142,8 +7496,8 @@ interface WireWorkspaceDirEntry {
7142
7496
  }
7143
7497
  declare const WIRE_WORKSPACE_DIR_ENTRY_FIELDS: WireFields<WireWorkspaceDirEntry>;
7144
7498
  /**
7145
- * `GET /api/workspaces/dirs[?path=<abs>][&hidden=1]` —— 一层子目录,或者不带 `path`
7146
- * 时的**起点锚**。
7499
+ * `GET /api/workspaces/dirs[?path=<abs>][&at=home][&hidden=1]` —— 一层子目录,
7500
+ * 或者不带 `path` 时的**起点锚**。
7147
7501
  *
7148
7502
  * ## 一个形状盖两发,而这不是偷懒
7149
7503
  *
@@ -7157,6 +7511,21 @@ declare const WIRE_WORKSPACE_DIR_ENTRY_FIELDS: WireFields<WireWorkspaceDirEntry>
7157
7511
  *
7158
7512
  * 那是这类 picker 唯一一个必然会被骂的地方。所以不带 `path` 时给的是三组
7159
7513
  * 「你多半想去的地方」,而不是文件系统根。
7514
+ *
7515
+ * ## `?at=home`:**「home 那一层」这件事只有服务端知道**(2026-09-01)
7516
+ *
7517
+ * 这一格是加法,**不带参数那一发的语义一个字没改**(照旧是锚屏)。它存在的理由
7518
+ * 很具体:界面这一轮要「打开就落在一个真目录上」(锚屏没有父级,于是打开那一屏
7519
+ * 上「往上一层」根本画不出来,用户得先点进一层才翻得上去 —— 用户报的就是这件事)。
7520
+ * 而浏览器**算不出**服务端那台机器的 home:`about.homeDir` 是 `~/.epoch` 不是它,
7521
+ * 锚屏里那一行倒是它,但那要多一次往返、而且得靠 `group === 'home'` 认。
7522
+ *
7523
+ * 于是这一发 = 「按 `path` 列 home 那一层」,回的东西和带 `path` 那一发**逐字同型**
7524
+ * (`path` 是那条绝对路径、`parent` 是 `/Users` 之类)—— 它不是第三种响应。
7525
+ *
7526
+ * ⚠️ **`path` 和 `at` 同时给时以 `path` 为准**:`at` 是「我不知道那条路径,你替我
7527
+ * 算一个」,而 `path` 是「我知道」。反过来(`at` 压 `path`)会让「记住上次逛到
7528
+ * 哪一层」那条路悄悄失效 —— 那一格恰好两个参数都会带上。
7160
7529
  */
7161
7530
  interface WireWorkspaceDirsResponse {
7162
7531
  /**
@@ -7256,6 +7625,35 @@ interface WireCreateWorkspaceResponse {
7256
7625
  entry: WireWorkspaceDirEntry;
7257
7626
  }
7258
7627
  declare const WIRE_CREATE_WORKSPACE_RESPONSE_FIELDS: WireFields<WireCreateWorkspaceResponse>;
7628
+ /**
7629
+ * `POST /api/workspaces/pick` —— 用户在那个系统框里选了什么。
7630
+ *
7631
+ * ## 取消是**真的一档**,不是空路径
7632
+ *
7633
+ * 判别联合而不是 `{ path: string | null }`:这两档下一步动作完全不同 ——
7634
+ * 选了就去绑,取消了**什么都不做**(连一句错都不该说)。写成可空字符串的话,
7635
+ * 迟早有一处把空串当成「选了根目录」,而那正是这条路上最贵的一次误判。
7636
+ *
7637
+ * ⚠️ **`path` 一律是服务端那台机器上的绝对路径**,浏览器只转手不解析 ——
7638
+ * 它接着会被原样发回 `POST /api/sessions/:id/workspace`(那儿才有校验和信任闸门)。
7639
+ *
7640
+ * ## 三种失败,三个不同的码
7641
+ *
7642
+ * | 码 | 什么时候 | 界面下一步 |
7643
+ * | --------------------------------- | ------------------------------------------ | --------------------- |
7644
+ * | 403 `native-picker-unavailable` | {@link WireConfigResponse.nativeDirPicker} 为假 | 回落自绘那一屏 |
7645
+ * | 409 `native-picker-busy` | 已经有一个框开着(同一进程只许一个) | 让用户去处理那个框 |
7646
+ * | 500 `native-picker-failed` | 起不来 / 命令出错,原话转发 | 回落自绘那一屏 |
7647
+ *
7648
+ * ⚠️ 409 那一档存在的理由不是洁癖:两个框叠在一台机器的屏幕上,用户答的那一个
7649
+ * 未必是浏览器还等着的那一个 —— 而先回来的那一发会把另一发的答案顶掉。
7650
+ */
7651
+ type WirePickDirectoryResponse = {
7652
+ path: string;
7653
+ canceled?: false;
7654
+ } | {
7655
+ canceled: true;
7656
+ };
7259
7657
  /**
7260
7658
  * `GET /api/sessions/:id/context` —— **这一段会话**此刻的预算构成。
7261
7659
  *
@@ -7929,6 +8327,58 @@ interface WireSkillImportResponse {
7929
8327
  reason: WireSkillImportFailure | null;
7930
8328
  }
7931
8329
  declare const WIRE_SKILL_IMPORT_FIELDS: WireFields<WireSkillImportResponse>;
8330
+ /**
8331
+ * 删不成的原因。**四档,各对一个不同的下一步**,判据同
8332
+ * {@link WireSkillSummary.residency} 那三档:合成一个 `ok:false` 之后界面说得出
8333
+ * 「没删掉」,说不出去哪儿改。
8334
+ *
8335
+ * | 值 | 出了什么事 | 用户的下一步 |
8336
+ * | ----------- | ----------------------------------------- | ---------------------------------- |
8337
+ * | `missing` | 这一程技能系统压根没起来 | 去看启动诊断里 Skill 那几条 |
8338
+ * | `not-found` | 服务端这张表里没有这个名字 | 刷新 —— 手上这一屏和盘上走散了 |
8339
+ * | `readonly` | 它是项目 / 插件 / 宿主级的,不归我们删 | 按回执里那句去仓库 / 插件那边处理 |
8340
+ * | `failed` | 真去删了,文件系统那一下没成(权限、占用)| 看回执里的原话 |
8341
+ *
8342
+ * ⚠️ **`readonly` 不是「你没权限」**,是「删错地方了」:项目级技能跟着用户的
8343
+ * 仓库走、插件级下一次 `epoch plugin update` 会重新装回来、宿主级住在应用包里。
8344
+ * 那三句话由 core 现渲染(`skill_load.readonly_*`),一字不改地放进 {@link
8345
+ * WireSkillRemoveResponse.detail} —— 每一句里都写着「那该去哪儿改」。
8346
+ */
8347
+ type WireSkillRemoveFailure = 'missing' | 'not-found' | 'readonly' | 'failed';
8348
+ /**
8349
+ * `POST /api/skills/remove` —— 删掉一个**用户级**技能。
8350
+ *
8351
+ * ## ⚠️ 这一条没有 preview → confirm 两段,而那不是不一致
8352
+ *
8353
+ * 导入那两段防的是「你确认的和真装上的不是同一份」(装进来的那段文字会无条件
8354
+ * 进往后每一轮的 system prompt)。删除没有「装上什么」这个问题 —— 它的风险在
8355
+ * 另一头:**不可撤销**。所以闸门也在另一头:界面上那一次确认(防**人**点错)
8356
+ * 加这一份回执里的 {@link path}(说清刚刚销毁的是盘上哪一处)。判据逐字同
8357
+ * `POST /api/plugins/uninstall`。
8358
+ *
8359
+ * ## ⚠️ 它只删得掉用户级那一档
8360
+ *
8361
+ * 真闸门在 core 的 `requireWritable()`(项目 / 插件 / 宿主三档各自抛一句带出路
8362
+ * 的话),不在界面上那个「这一行画不画删除按钮」的判断上 —— 后者是**观感**,
8363
+ * 前者才是拦得住 `curl` 的那一道。
8364
+ */
8365
+ interface WireSkillRemoveResponse {
8366
+ ok: boolean;
8367
+ /** 真被删掉的那个技能名。没删成时是空串 */
8368
+ name: string;
8369
+ /**
8370
+ * 刚刚被递归删掉的那个目录(`<技能目录>/<分类>/<名字>`)。没删成时 `null`。
8371
+ *
8372
+ * ⚠️ **这一格是这条路上的回执,不是调试信息**:删除不可撤销,而「我到底
8373
+ * 销毁了什么」只有服务端答得出(同名的目录在这台机器上可能不止一处)。
8374
+ * 界面上要把它印出来 —— 用户拿它去备份里找回来,或者照着原路再导一次。
8375
+ */
8376
+ path: string | null;
8377
+ /** 没成时那句为什么(含 `readonly` 那三句 core 的原话);成了是 `null` */
8378
+ detail: string | null;
8379
+ reason: WireSkillRemoveFailure | null;
8380
+ }
8381
+ declare const WIRE_SKILL_REMOVE_FIELDS: WireFields<WireSkillRemoveResponse>;
7932
8382
 
7933
8383
  /**
7934
8384
  * `POST /api/roles` 的请求体 —— 稿子上有、身份那一栏一直没有的那张「新建」。
@@ -9365,11 +9815,50 @@ declare const WIRE_PERMISSION_SET_REQUEST_FIELDS: WireFields<WirePermissionSetRe
9365
9815
  * 同 `WirePlanModeResponse`:用户要的结果已经成立了。回 409 的话,
9366
9816
  * 两个标签页里靠后按的那一个会收到一条描述「一件已经如愿的事」的错误。
9367
9817
  */
9818
+ /**
9819
+ * 「记住这一档」为什么没记成(2026-08-31)。
9820
+ *
9821
+ * 换档成功之后,这一档会被记成**新会话的起点**:进程里当场生效,同时写进
9822
+ * `~/.epoch/config.yaml` 的 ② 用户级。盘上那一半可能写不成,而**换档那一半
9823
+ * 已经成了** —— 两件事的结局必须分开报,合成一个布尔的话,界面只能在
9824
+ * 「这一发全成了」和「这一发全砸了」之间二选一,而真实情况两者都不是。
9825
+ *
9826
+ * 是**码不是句子**,判据同 {@link WireBlockedLevel.reason} / 文件头那张
9827
+ * 「中文不下网线」的表:句子在两份 catalog 里,这条路只答一个词。
9828
+ *
9829
+ * | 码 | 现场 | 用户的下一步 |
9830
+ * | ---------------- | ------------------------------------------------- | ------------------------ |
9831
+ * | `no-user-config` | 这个进程说不出用户级配置在哪个文件 | 基本只出现在嵌入宿主里 |
9832
+ * | `unwritable` | 文件在,但那份 yaml 的写法这条路认不出来,不敢覆盖 | 自己去编辑那一行(带路径)|
9833
+ * | `io` | 写盘本身失败(只读盘 / 权限) | 同上 |
9834
+ * | `env-pinned` | `EPOCH_PERMISSION` 压着,写进去下次启动也不生效 | 去掉那个环境变量 |
9835
+ *
9836
+ * ⚠️ **没有「企业托管挡下」这一档,那不是遗漏**:托管那道闸挡的是**换档本身**
9837
+ * (`disableBypassPermissionsMode`,`SessionPermissions.setLevel` 第 1 步),
9838
+ * 走到「记不记」这一步时它已经放行了。给它编一个码等于留一条没有用户的分支。
9839
+ *
9840
+ * ⚠️ `env-pinned` 那一档也**不是**「写失败了」—— 文件真的写进去了。它说的是
9841
+ * 「写了但这台机器上不会生效」,而用户的下一步完全不同,所以不能和 `io` 合并。
9842
+ */
9843
+ type WirePermissionRememberFailure = 'no-user-config' | 'unwritable' | 'io' | 'env-pinned';
9368
9844
  interface WirePermissionSetResponse {
9369
9845
  /** 换成了吗。`false` = 被挡下,级别**一个字没动**(见 {@link refused}) */
9370
9846
  ok: boolean;
9371
9847
  /** 挡下的理由;`ok: true` 时整个不带这个键 */
9372
9848
  refused?: WireBlockedLevel['reason'];
9849
+ /**
9850
+ * **没记住**的时候才有这个键(2026-08-31)。记住了 = 整个不带,
9851
+ * 判据同 {@link refused}:这条路只在有话要说时说话。
9852
+ *
9853
+ * ⚠️ 它**不影响 {@link ok}**:换档成了就是 `ok:true`,哪怕这一格在。
9854
+ * 反过来 `ok:false` 时这一格永远不在 —— 级别一个字没动,也就没有
9855
+ * 「要记住的那一档」。
9856
+ */
9857
+ notRemembered?: {
9858
+ reason: WirePermissionRememberFailure;
9859
+ /** 本来要写的那个文件。`no-user-config` 那一档说不出路径,于是整个不带 */
9860
+ path?: string;
9861
+ };
9373
9862
  /**
9374
9863
  * 这一发真的改变了级别吗。`false` = 本来就是这一档,什么都没做。
9375
9864
  *
@@ -9384,6 +9873,8 @@ interface WirePermissionSetResponse {
9384
9873
  * ⚠️ **`refused` 不在这份清单里,那是对的**:{@link wireFields} 只收必填键
9385
9874
  * (它的 `RequiredKeys` 判据是「`Pick<T,K>` 能不能被空对象满足」)。
9386
9875
  * `ok: true` 那一支整个不带这个键 —— 写进清单等于要求成功的响应也带上它。
9876
+ *
9877
+ * ⚠️ `notRemembered`(2026-08-31)同理不在这里:记住了就整个不带。
9387
9878
  */
9388
9879
  declare const WIRE_PERMISSION_SET_RESPONSE_FIELDS: WireFields<WirePermissionSetResponse>;
9389
9880
 
@@ -9412,7 +9903,9 @@ declare const WIRE_PERMISSION_SET_RESPONSE_FIELDS: WireFields<WirePermissionSetR
9412
9903
  * 不是一条随敲随传的流
9413
9904
  * 2. **写 ② 用户级或 ④ 项目本地**({@link WireSettingWriteLayer}),而且
9414
9905
  * **「写进去会不会生效」在读响应里就带着**({@link WireSettingWrite.futile})——
9415
- * 这是整份契约里最要紧的一个字段,理由见它自己的 JSDoc
9906
+ * 这是整份契约里最要紧的一个字段,理由见它自己的 JSDoc
9907
+ * ⚠️ 2026-08-31 起**哪几档由键决定**:只有 `SettingsFileSchema` 白名单里那两个
9908
+ * 标量给得出 ④,其余可写键的 `writes` 里只有 ② 一档(`settingWriteLayers()`)
9416
9909
  * 3. **写完要重启进程**({@link WireSettingApply})
9417
9910
  *
9418
9911
  * ⚠️ 读响应里那些 `value` **写完不会变**,而那不是 bug:这个进程装配时读过一次
@@ -9475,21 +9968,31 @@ type WireSettingLayer = 'builtin' | 'user' | 'env' | 'project' | 'projectLocal'
9475
9968
  * **服务端不 join 成字符串**:分隔符是排版不是文字,两份 catalog 里未必一样,
9476
9969
  * 而拼一次就等于把一个界面决定钉死在网线上。
9477
9970
  *
9478
- * ## `boolean` 从 2026-08-16 起真的会出现,在那之前它是个**没有用户的成员**
9971
+ * ## `boolean` 从 2026-08-16 起真的会出现,2026-08-31 起还**写得进去**
9479
9972
  *
9480
9973
  * 第一个布尔行是 `compression.enabled`(设计稿「设置 › 记忆与上下文」那个
9481
- * 「快满时自动压缩」)。记下来是因为它改变了界面那一侧的一条既有假设:
9482
- * `config.tsx` 的 `valueKindOf()` 只分 `'number' | 'string'`,而它是**给写控件
9483
- * 挑输入框类型**用的 —— 布尔行今天走不到那儿(`compression.*` 不在
9484
- * `SettingsFileSchema` 白名单里,`writes` 是空数组,一个写控件都不画),
9485
- * 所以那个函数**不用**跟着长第三档。
9974
+ * 「快满时自动压缩」)。它刚出现时只读,于是这里记着一句「界面那个
9975
+ * `valueKindOf()` 不用长第三档」;两张名单拆开之后(core `config/write.ts`
9976
+ * 文件头第二节)它有铅笔了,那一档跟着长了出来。
9486
9977
  *
9487
- * ⚠️ 哪天真有一个布尔键进了白名单,要动的是 `valueKindOf()`
9488
- * `parseDraft()` 两处,而不是在这儿再加一个 `kind` 字段 —— 判据在
9489
- * `valueKindOf()` 自己的 JSDoc 上(「再发一个 `kind` 过来,就是给同一个问题
9490
- * 第二个答案」)。
9978
+ * ⚠️ 那条「别再发一个 `kind` 字段过来」的老规矩**同一轮作废了**,而作废的
9979
+ * 理由不是嫌麻烦:它的前提是「值的类型能从值本身看出来」,而
9980
+ * `budget.*` 四个键**一个默认值都没有** —— 屏幕上是「未设置」、链条上是空的,
9981
+ * 那时按值猜类型只会猜成字符串,然后把 `"10"` 发给一个 `z.number()`。
9982
+ * 现在类型由 {@link WireSettingRow.valueKind} 明说,真源在 core 的
9983
+ * `settingValueKind()`(从 schema 上认,不另立一张表)。
9491
9984
  */
9492
9985
  type WireSettingValue = string | number | boolean | readonly string[];
9986
+ /**
9987
+ * 写控件的形态。**只有三档,因为这条路只画得出「改一个标量」** ——
9988
+ * 数组不在里面(`fallback.providers` 是一条有序的链,不是一个输入框,
9989
+ * 判据在 core 的 `SETTING_WRITE_KEYS` 上)。
9990
+ *
9991
+ * 枚举也归 `string`,候选另走 {@link WireSettingRow.choices}:多一档
9992
+ * `'enum'` 的话,「是不是枚举」在载荷上就有了两个答案(那一档和那个数组),
9993
+ * 而它们分叉的那天,界面会照着一个空候选画一个点不出东西的分段器。
9994
+ */
9995
+ type WireSettingValueKind = 'string' | 'number' | 'boolean';
9493
9996
  /**
9494
9997
  * 这条路**写得进去**的层,低 → 高。
9495
9998
  *
@@ -9593,6 +10096,9 @@ interface WireSettingRow {
9593
10096
  * 只放行 `permissions` / `model` / `maxTurns` 三个键,别的键 ③④⑤∞ 碰不到 ——
9594
10097
  * 给它们画一条六层链条,等于告诉用户「这一行也可能被项目级压回去」,
9595
10098
  * 而他会照着这个暗示去 `.epoch/settings.json` 里写一个永远不生效的键。
10099
+ *
10100
+ * ⚠️⚠️ **空链条 ≠ 这一行改不了**,2026-08-31 起这两件事分开了:链条空说的是
10101
+ * 「没有项目级这回事」,能不能改看下面的 {@link writes}。
9596
10102
  */
9597
10103
  chain: readonly WireSettingStep[];
9598
10104
  /** 这个键能不能被 ③④⑤∞ 覆盖 */
@@ -9601,17 +10107,38 @@ interface WireSettingRow {
9601
10107
  * 这一行**这个界面**能写进哪几层,以及写进去会不会真的生效。
9602
10108
  * 一层都写不了时是空数组,界面据此一个写控件都不画(决定 20 ①)。
9603
10109
  *
9604
- * ⚠️ 它和上面那个 `overridable` **今天恰好同真同假,但不是一件事**:
9605
- * `overridable` 说的是「③④⑤∞ 能不能覆盖这个键」(`SettingsFileSchema` 的
9606
- * 白名单),这一个说的是「这张界面能不能替你写它」。两者分叉的第一天已经
9607
- * 看得见 —— `permissions` 在白名单里、却永远不会有这个界面上的写控件
9608
- * (它走并集不走覆盖,入口在安全中心)。合成一个字段的话,那一天
9609
- * 「这一行为什么没有链条」和「这一行为什么改不了」会共用一个答案。
10110
+ * ⚠️ 它和上面那个 `overridable` **不是一件事,而且从 2026-08-31 起真的分叉了**
10111
+ * (在那之前它们恰好同真同假,那句「恰好」是这条注释原来的原话):
10112
+ *
10113
+ * - `overridable` 说的是「**别人的仓库**能不能覆盖这个键」(`SettingsFileSchema`)
10114
+ * - 这一个说的是「**这张界面**能不能替你改你自己的用户级配置」
10115
+ * (core 的 `SETTING_WRITE_KEYS`)
10116
+ *
10117
+ * 于是今天两个方向的分叉都看得见:`permissions` 在白名单里、永远没有写控件
10118
+ * (走并集不走覆盖,入口在安全中心);`budget.*` / `compression.*` 不在白名单里、
10119
+ * 却有铅笔 —— 只是它们的 `writes` 里**只有 ② 用户级一档**。判据全文在 core 的
10120
+ * `config/write.ts` 文件头第二节。
9610
10121
  *
9611
- * 空数组的三种成因见 core 的 `settingWriteTargets()`:不在白名单、
10122
+ * 空数组的三种成因见 core 的 `settingWriteTargets()`:不在可写名单、
9612
10123
  * 赢在企业托管层、或者来源分不出(`unknown`,说不出会不会被压回去)。
9613
10124
  */
9614
10125
  writes: readonly WireSettingWrite[];
10126
+ /**
10127
+ * 界面该给这一行画哪种输入控件。**`writes` 非空时必有,空时必无。**
10128
+ *
10129
+ * 判据(含「为什么这不违反上面那条别发 `kind` 的老规矩」)在 core 的
10130
+ * `settingValueKind()` 上,一句话版:`budget.*` 那四行没有默认值,
10131
+ * 屏幕上是「未设置」、链条上是空的,按值猜类型只会猜成字符串。
10132
+ */
10133
+ valueKind?: WireSettingValueKind;
10134
+ /**
10135
+ * 这一行只有这几个值可选(`budget.onUnknownPricing` 的 `block` / `warn`)。
10136
+ * **不是枚举时整个不带这个键**,界面画输入框。
10137
+ *
10138
+ * 候选由 schema 说了算(core 的 `settingValueChoices()`)。让界面自己写死一份
10139
+ * 的话,schema 哪天多一档,那一档在文档里存在、在界面上点不出来。
10140
+ */
10141
+ choices?: readonly string[];
9615
10142
  }
9616
10143
  declare const WIRE_SETTING_ROW_FIELDS: WireFields<WireSettingRow>;
9617
10144
  interface WireSettingsResponse {
@@ -9678,7 +10205,8 @@ interface WireSettingsWriteRequest {
9678
10205
  *
9679
10206
  * **服务端会按这个键自己的值域再校验一遍**(`maxTurns` 是正整数这类),
9680
10207
  * 界面那一侧的检查只是为了早说一句,不是判定。数组和对象一律拒 ——
9681
- * 今天两个可写键都是标量。
10208
+ * 可写的键**全是标量**,判据在 core 的 `SETTING_WRITE_KEYS` 上
10209
+ * (`fallback.providers` 那条链因此没有铅笔)。
9682
10210
  */
9683
10211
  value: WireSettingValue;
9684
10212
  }
@@ -9898,6 +10426,20 @@ interface WireProviderOption {
9898
10426
  * 而「没配 key」这句话对它是假的。
9899
10427
  */
9900
10428
  hasKey: boolean;
10429
+ /**
10430
+ * 这台机器上那把 key 长什么样 —— **已脱敏**(`maskApiKey`),没配 / 不需要时是 `null`。
10431
+ *
10432
+ * ⚠️ **这一格是「已配置」的可核对形态,不是凭据。** 只有 `hasKey: true` 的话,
10433
+ * 用户在设置页看到的是一个空的密码框加一句「已配置」—— 而他此刻真正想知道的是
10434
+ * **哪一把**(换了机器、翻过 profile、上周贴过两次),而那个问题
10435
+ * 一个布尔答不了。走的是 `WireProviderSummary.apiKeyHint`(TUI 的 `/model` 印的那份)
10436
+ * 同一个函数,先例在那儿。
10437
+ *
10438
+ * ⚠️ 而它**不许放宽成裸 key**:[§6.4 的第一条「绝不」](../../../docs/verify/VERIFY_RECORD-20-web.md)
10439
+ * 是「API key 下发到浏览器」—— devtools 直接就能读。脱敏在**服务端**做,
10440
+ * 不是发全的让浏览器自己截(那样 key 已经过了网线)。
10441
+ */
10442
+ keyHint: string | null;
9901
10443
  }
9902
10444
  declare const WIRE_PROVIDER_OPTION_FIELDS: WireFields<WireProviderOption>;
9903
10445
  /** `GET /api/providers` 的响应 */
@@ -9999,6 +10541,82 @@ interface WireProviderModelsResponse {
9999
10541
  suggestions: WireModelSuggestions;
10000
10542
  }
10001
10543
  declare const WIRE_PROVIDER_MODELS_FIELDS: WireFields<WireProviderModelsResponse>;
10544
+ /**
10545
+ * `POST /api/providers/:type/key` 的请求体 —— **在这台机器上配一把 key**(2026-08-31)。
10546
+ *
10547
+ * ## 为什么 Web UI 上需要它
10548
+ *
10549
+ * 在这条端点之前,浏览器上「没配 key」这一档能说的只有一句
10550
+ * 「设一个 `MOONSHOT_API_KEY`,或者跑 `epoch model`」—— 也就是**把用户赶回终端**。
10551
+ * 而 `epoch web` 的整个前提是那台机器就在用户手上(回环 + 一次性 token,
10552
+ * 见 `auth.ts` 的文件头),所以「替他把 key 写进他自己的钥匙串」不是越权,
10553
+ * 是这一屏本来就欠的那一步。
10554
+ *
10555
+ * ## ⚠️ 这一发是**单向**的:key 上得去,下不来
10556
+ *
10557
+ * 请求体里有裸 key,响应体里**没有**(只有 {@link WireProviderKeyResponse.keyHint}
10558
+ * 那份脱敏串)。§6.4 第一条「绝不」管的是**下行**,这一条一个字都没松。
10559
+ *
10560
+ * ## 落点由服务端决定,不由请求说
10561
+ *
10562
+ * 请求体里**没有**「写进钥匙串还是写进 .env」这样的字段:那是
10563
+ * `SecretStore` 的降级链(钥匙串 → DPAPI → libsecret → 明文 0600)自己的事,
10564
+ * 而它的判据(「降级必须响亮」,方案 3.3)在 infra。让浏览器点一个后端,
10565
+ * 等于把那条链抄成了第二份,还允许用户主动挑一个更不安全的。
10566
+ * 实际落到哪儿由响应回声,见 {@link WireProviderKeyResponse.backend}。
10567
+ */
10568
+ interface WireProviderKeyRequest {
10569
+ /**
10570
+ * 那把 key 的原文。**必填、且不许是空串**。
10571
+ *
10572
+ * ⚠️ 空串**不当成「删掉这把 key」**,回 400。这一屏上「清空输入框再按保存」和
10573
+ * 「我要撤销这把 key」长得一模一样,而它们的后果差很远 —— 真要删的那天单开一个
10574
+ * 说得出自己在删的动作(`DELETE`),别让一个保存按钮兼职。
10575
+ */
10576
+ apiKey: string;
10577
+ }
10578
+ /**
10579
+ * `POST /api/providers/:type/key` 的响应 —— **写在哪儿、加没加密**。
10580
+ *
10581
+ * ⚠️ **这里一个中文字都不发**,判据逐字同这一组另外两条(`providers.ts` 文件头第 4 节):
10582
+ * `SecretStore.detail` 是一句现成的中文,照抄过来能省浏览器一份 catalog ——
10583
+ * 但那句话是按**服务进程的 locale** 渲染的,而一台 `epoch web` 后面可能同时坐着
10584
+ * 两种语言的人(方案 58)。所以下发的是 {@link backend} 这个**码**,措辞在浏览器那侧。
10585
+ */
10586
+ interface WireProviderKeyResponse {
10587
+ /** 配的是哪一家。回声一遍,同 `WireModelSuggestions.provider` */
10588
+ provider: ProviderType;
10589
+ /**
10590
+ * 写完之后这家配好了没有。
10591
+ *
10592
+ * **恒 `true`**,而它照旧下发:这一格是浏览器那张 provider 单子里同名字段的
10593
+ * 新值(那张单子取一次就不再取,见 `web/src/model/catalog.ts` 的 `asked`),
10594
+ * 让调用方去推「写成功 = 现在有了」,就是把服务端的结论在下游重算一遍。
10595
+ */
10596
+ hasKey: boolean;
10597
+ /** 脱敏后的那把 key(`maskApiKey`)。同 {@link WireProviderOption.keyHint},**不是原文** */
10598
+ keyHint: string;
10599
+ /**
10600
+ * 真的落到哪个后端了 —— `keychain` / `dpapi` / `libsecret` / `plaintext`。
10601
+ *
10602
+ * ⚠️ **必须回显**:方案 3.3「降级必须响亮」在写入侧的对应物就是这一格
10603
+ * (`cli/src/files/env-file.ts` 的 `writeProviderKey` 文件头逐字写着
10604
+ * 「我的 key 进了钥匙串还是明文文件,是用户有权当场知道的事」)。
10605
+ * 值域刻意是 `string` 而不是一个联合:后端清单是 infra 那一侧的事,
10606
+ * 在契约里再钉一张表就是第二份名单。
10607
+ */
10608
+ backend: string;
10609
+ /** 这个后端加密不加密。`plaintext` 那一档是 false,界面据此把那句话说重一点 */
10610
+ encrypted: boolean;
10611
+ /**
10612
+ * 明文降级时那个文件在哪儿;没降级就是 `null`。
10613
+ *
10614
+ * 只有这一档给路径,是因为只有这一档用户**有下一步可做**(去 `chmod`、
10615
+ * 去把它加进 `.gitignore`、或者干脆去修钥匙串)。钥匙串那一档给路径没有意义。
10616
+ */
10617
+ envPath: string | null;
10618
+ }
10619
+ declare const WIRE_PROVIDER_KEY_FIELDS: WireFields<WireProviderKeyResponse>;
10002
10620
 
10003
10621
  /**
10004
10622
  * 「不看参数」这一问的答案。**四档,`depends` 是其中一个真答案**(见文件头)。
@@ -10191,6 +10809,184 @@ interface WireArtifactsResponse {
10191
10809
  }
10192
10810
  declare const WIRE_ARTIFACTS_FIELDS: WireFields<WireArtifactsResponse>;
10193
10811
 
10812
+ /**
10813
+ * 「站内看一眼工作区里的这个文件」的载荷契约 —— 四条端点共用:
10814
+ *
10815
+ * ```
10816
+ * GET /api/sessions/:id/file-stat?path=…&path=… 这几条路径存在吗、是什么、画得出来吗
10817
+ * GET /api/sessions/:id/file?path=… 文本正文
10818
+ * GET /api/sessions/:id/file-bytes?path=… 字节(图片 / PDF / 媒体)
10819
+ * POST /api/sessions/:id/file-open 交给系统默认应用(同机才有)
10820
+ * ```
10821
+ *
10822
+ * ## 这一份存在的理由:把「路径」变成能点的东西
10823
+ *
10824
+ * 在它之前,模型正文和工具卡里的路径全是纯文本 —— 用户看见「我写到了
10825
+ * `src/foo.ts`」,只能自己复制走。而**画一个点了没反应的东西比不画更糟**
10826
+ * ([决定 20](../../../design/web-ui/README.md) ①),所以「可点」这件事必须先有
10827
+ * 一个能回答「这条路径今天还在不在」的端点,那就是 `file-stat`。
10828
+ *
10829
+ * ## ⚠️ 这不是一个新开的「读任意文件」的洞
10830
+ *
10831
+ * `web/src/inspector/preview.tsx` 的文件头曾经写着「**不新开一个读文件的端点**」,
10832
+ * 理由是「权限层拦不到它 —— 用户写的 `deny file_read(.env*)` 是给工具用的规则,
10833
+ * 一个 REST 端点不走工具执行器」。**那条理由今天不成立了**:
10834
+ * `runtime/src/workspace-files.ts` 的 `readFile()` 做的正是「边界 + 权限 +
10835
+ * 二进制,一趟走完」,而且权限判定用的就是 `toolName: 'file_read'` ——
10836
+ * 同一本审批缓存账本。`@文件` 提及那条路已经在用它把工作区文件递给浏览器。
10837
+ *
10838
+ * 也就是说这四条端点**没有比模型自己那条路更宽**:模型读不到的,浏览器也读不到。
10839
+ * 这一条是这份契约的全部安全性质,改这里之前先回去读那个函数。
10840
+ *
10841
+ * ## 三条口径
10842
+ *
10843
+ * 1. **路径原样回来**({@link WireFileStat.path})。浏览器一发问一批路径,
10844
+ * 回来要对号入座;服务端把绝对路径归一化成工作区相对路径之后,
10845
+ * 回一个和问的时候不一样的字符串,浏览器就对不上了。
10846
+ * 2. **拒绝有码,而不是一个笼统的 404**({@link WireFileRefusal})。
10847
+ * 「被权限拦了」和「这个文件没了」和「它在工作区外面」是三句不同的话,
10848
+ * 而界面上要说的正是那句不同的话。
10849
+ * 3. **超出一发上限的那几条照数回来**({@link WireFileStatResponse.overLimit}),
10850
+ * 不悄悄丢。沉默截断是这个仓库反复在骂的病。
10851
+ */
10852
+ /**
10853
+ * 一发 `file-stat` 最多问多少条路径。
10854
+ *
10855
+ * 服务端和浏览器**都**要用它:前者据此截断并回 `overLimit`,后者据此分批。
10856
+ * 32 的取法是「一条模型正文里合理会出现几条路径」——再多的多半是误判
10857
+ * (散文里的斜杠),而那种情况下我们本来就不该把整篇都画成链接。
10858
+ */
10859
+ declare const WIRE_FILE_STAT_MAX = 32;
10860
+ /**
10861
+ * 浏览器拿这一档决定「这个文件画成什么」。
10862
+ *
10863
+ * **不是 MIME**,是「用哪个 HTML 元素」:`text` 进 `<pre>`、`image` 进 `<img>`、
10864
+ * `pdf` 进 `<iframe>`、`audio` / `video` 各进自己那个标签、`opaque` 画一张元信息卡。
10865
+ * 直接发 MIME 的话,每个消费方都要自己再分一次档 —— 而分档的判据
10866
+ * (哪些类型给 inline)是**安全判断**,不该在浏览器里重做一遍。
10867
+ */
10868
+ type WireFileKind = 'text' | 'image' | 'pdf' | 'audio' | 'video' | 'opaque';
10869
+ /**
10870
+ * 看不了的理由。
10871
+ *
10872
+ * `denied` 一个码盖住两件事(跑出工作区 / 权限不放行),**这是故意的**:
10873
+ * 分开说等于告诉浏览器「这个路径存在,只是你没权限」,那是一条信息泄露 ——
10874
+ * 口径逐字同 runtime 那一侧的 `FileReadOutcome`(那儿也是同一个码)。
10875
+ */
10876
+ type WireFileRefusal = 'denied'
10877
+ /** 路径解析得了,但那儿今天没有东西 */
10878
+ | 'missing'
10879
+ /** 是个目录 / 设备 / 管道 —— 存在,但不是「一个文件」 */
10880
+ | 'not-a-file'
10881
+ /** 大到不值得从这条路看(阈值在服务端,见 `server/src/workspace/file-view.ts`) */
10882
+ | 'too-large'
10883
+ /** 读得到,但读的时候出错了(权限位、正在被写、盘掉了) */
10884
+ | 'unreadable';
10885
+ /** `file-stat` 里能看的那一档 */
10886
+ interface WireFileStatOk {
10887
+ /** **原样**回请求里那个字符串(判据见文件头第 1 条) */
10888
+ path: string;
10889
+ ok: true;
10890
+ kind: WireFileKind;
10891
+ /** 文件的原始字节数。元信息那行印它,浏览器也拿它决定要不要直接放弃拉正文 */
10892
+ bytes: number;
10893
+ /** 最后修改时间(epoch 毫秒)。元信息那行那句「它是不是我以为的那一版」 */
10894
+ mtimeMs: number;
10895
+ /**
10896
+ * 能不能交给系统默认应用打开。
10897
+ *
10898
+ * ⚠️ **这是一个服务端算出来的结论,浏览器不许自己按扩展名再算一遍**:
10899
+ * 它同时含着「扩展名在白名单里」和「浏览器和服务在同一台机器上」两件事,
10900
+ * 后者浏览器根本无从判断(`--host 0.0.0.0` 时那个按钮弹在别人屏幕上)。
10901
+ */
10902
+ openable: boolean;
10903
+ }
10904
+ declare const WIRE_FILE_STAT_OK_FIELDS: WireFields<WireFileStatOk>;
10905
+ /** `file-stat` 里看不了的那一档 */
10906
+ interface WireFileStatRefused {
10907
+ path: string;
10908
+ ok: false;
10909
+ refusal: WireFileRefusal;
10910
+ }
10911
+ declare const WIRE_FILE_STAT_REFUSED_FIELDS: WireFields<WireFileStatRefused>;
10912
+ /**
10913
+ * 一条路径的答案。
10914
+ *
10915
+ * 联合而不是「一个对象带一堆可选字段」:可选字段那种写法下,
10916
+ * 「`ok` 是 true 但 `kind` 没给」是个编译得过的状态,而它在界面上的表现是
10917
+ * 一张什么都画不出来的卡。
10918
+ */
10919
+ type WireFileStat = WireFileStatOk | WireFileStatRefused;
10920
+ /** `GET /api/sessions/:id/file-stat` 的响应体 */
10921
+ interface WireFileStatResponse {
10922
+ /** 逐条一个答案,**顺序同请求**(浏览器可以按下标对,也可以按 `path` 对) */
10923
+ files: readonly WireFileStat[];
10924
+ /**
10925
+ * 请求里超出 {@link WIRE_FILE_STAT_MAX} 那几条的条数(判据见文件头第 3 条)。
10926
+ * 一条都没超时是 0,**不是省略** —— 省略的话浏览器分不出「没超」和「旧版服务端」。
10927
+ */
10928
+ overLimit: number;
10929
+ /**
10930
+ * 相对路径是相对哪个根算的。这个会话没绑工作区时 `null`。
10931
+ *
10932
+ * 理由同 `WireArtifactsResponse.root`:预览那一屏要显示完整路径,
10933
+ * 而让浏览器去别的端点凑这个值,会在「两次请求之间换了工作区」时
10934
+ * 拼出一条从来不存在的路径。
10935
+ */
10936
+ root: string | null;
10937
+ }
10938
+ declare const WIRE_FILE_STAT_RESPONSE_FIELDS: WireFields<WireFileStatResponse>;
10939
+ /**
10940
+ * `GET /api/sessions/:id/file` 的响应体 —— 文本正文。
10941
+ *
10942
+ * **只回文本那一档**:图片 / PDF / 媒体走 `file-bytes`(那条路回的是字节流,
10943
+ * 不是 JSON),`opaque` 那一档压根不该来问这条。
10944
+ */
10945
+ interface WireFileTextResponse {
10946
+ /** 原样回请求里那个字符串(判据同 {@link WireFileStat.path}) */
10947
+ path: string;
10948
+ /** 正文。**服务端不截**:截断是显示层的事(`web/src/inspector/content.ts`) */
10949
+ text: string;
10950
+ /** 文件的原始字节数。和 `text` 的长度**不一定相等**(UTF-8、以及末尾换行) */
10951
+ bytes: number;
10952
+ }
10953
+ declare const WIRE_FILE_TEXT_RESPONSE_FIELDS: WireFields<WireFileTextResponse>;
10954
+ /**
10955
+ * 交给系统默认应用打开,为什么没打开。
10956
+ *
10957
+ * 前五档和 {@link WireFileRefusal} 同名同义(同一道闸),后两档是这条路独有的。
10958
+ */
10959
+ type WireFileOpenRefusal = WireFileRefusal
10960
+ /**
10961
+ * 扩展名不在白名单里。
10962
+ *
10963
+ * ⚠️ 白名单**只收「站内渲染不了、而系统应用打得开」的那些**(Office / PDF /
10964
+ * 媒体)。代码和文本一律走站内查看 —— 顺带绕开 Windows 上 `.js` / `.vbs` /
10965
+ * `.wsf` 被 Windows Script Host **执行**那颗雷(`open` / `xdg-open` /
10966
+ * `FileProtocolHandler` 本质都是 ShellExecute,判据全文在
10967
+ * `core/src/context/artifact-open.ts` 的文件头)。
10968
+ */
10969
+ | 'extension-not-allowed'
10970
+ /**
10971
+ * 浏览器和服务不在同一台机器上。
10972
+ *
10973
+ * 那一档下框会弹在**服务进程那台机器**的屏幕上 —— 要么没人看见,要么弹在
10974
+ * 别人屏幕上。判据复用 `server/src/workspace/native-pick.ts` 的那一条。
10975
+ */
10976
+ | 'not-same-machine'
10977
+ /** 闸门全过了,但那个 `spawn` 没起来 */
10978
+ | 'launch-failed';
10979
+ /** `POST /api/sessions/:id/file-open` 的响应体 */
10980
+ interface WireFileOpenResponse {
10981
+ /** 起起来了没有。**它只说「命令发出去了」**,不说用户屏幕上真的出现了窗口 */
10982
+ ok: boolean;
10983
+ /** 没起来的理由。`ok` 为 true 时不出现 */
10984
+ refusal?: WireFileOpenRefusal;
10985
+ /** 那句给用户看的话(服务端按 `?lang=` 渲染好)。`ok` 为 true 时不出现 */
10986
+ message?: string;
10987
+ }
10988
+ declare const WIRE_FILE_OPEN_RESPONSE_FIELDS: WireFields<WireFileOpenResponse>;
10989
+
10194
10990
  /**
10195
10991
  * 一条校验不通过的原因码。**真源在 core,这是网线上那一份**,见文件头。
10196
10992
  *
@@ -11147,4 +11943,4 @@ declare const SECRET_SERVICE = "epoch-agent";
11147
11943
  */
11148
11944
  declare const MCP_DATA_KEY_NAME = "mcp-auth-data-key";
11149
11945
 
11150
- export { ACTION_CONTEXTS, AGENT_ROLE_NAME_PATTERN, API_KEY_ENV_VARS, APPROVAL_OUTCOMES, type ActiveAgentRole, type AgentEvent, type AgentEventOf, type AgentEventType, type AgentRole, type AgentRoleScope, type AgentRoleSource, type ApprovalAnswer, type ApprovalOutcome, type ApprovalReply, type ApprovalRequest, type ArtifactKind, type AttributeValue, type Attributes, type BackgroundTaskInfo, type BackgroundTaskKind, type BackgroundTaskStatus, type BoundKey, type BudgetBreach, COMMAND_NAME_PATTERN, type Catalogs, type ContextBreakdown, type ContextSegment, type CustomCommandDef, type CustomCommandSource, DEFAULT_AGENT_ROLE, DEFAULT_LANG, type DecidedTrustLevel, type Diagnostic, DiagnosticSink, type DiagnosticStatus, type EpochConfig, type EpochContentPart, type EpochFilePart, type EpochHook, type EpochImagePart, type EpochMessage, type EpochMessageRole, type EpochPlugin, type EpochSessionPart, type EpochSkill, type EpochTextPart, type EpochTool, type EpochToolCall, type EpochToolResult, type EpochTurnFacts, type EpochUserContent, type ExpandedCommand, type FileOmitReason, type FinishReason, type FixableApproval, type FlatCatalog, GEN_AI, HEADLESS_INPUT_EVENT_TYPES, HEADLESS_INPUT_FORMATS, HEADLESS_OUTPUT_FORMATS, HEADLESS_PROTOCOL_VERSION, type HeadlessEnvelope, type HeadlessEvent, type HeadlessInit, type HeadlessInputEvent, type HeadlessInputEventType, type HeadlessInputFormat, type HeadlessLifecycleEvent, type HeadlessOutputFormat, type HeadlessResult, type HeadlessResultReason, type HookContext, type HookEvent, type HookHandler, type HookManager, type HookRegistration, type HookType, type JsonSchema, KEY_ACTIONS, type KeyAction, type KeyChord, type KeyContext, type KeySequence, type KeybindingReport, type KeybindingSource, type KeybindingTable, LANGS, type Lang, type LocalizedDetail, type LogFn, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_HEADER_CHARS, MAX_OPTIONS, MAX_QUESTIONS, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, MCP_DATA_KEY_NAME, METRIC, MIN_OPTIONS, type MentionSet, type ModelRef, type ModelSelection, type ModelSelectionOrigin, NOOP_TELEMETRY, type NoticeCode, OPERATION_TYPES, type Operation, type OperationType, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, type PermissionDecision, type PermissionLevel, type PermissionManager, type PermissionRuleLists, type PlanApprovalOutcome, type PlanProposal, type PluginContext, type ProviderInfo, type ProviderType, type QuestionAnswer, type QuestionItem, type QuestionOption, type QuestionRequest, RESERVED_CHORDS, RESERVED_COMMAND_NAMES, type RejectReason, type RejectedKey, type RuleValue, SCHEDULE_INTERVAL_MINUTES, SCHEDULE_RUN_STATUSES, SCHEDULE_TEMPLATES, SEARCH_API_KEY_ENV, SEARCH_PROVIDER_TYPES, SECRET_SERVICE, SEQUENCE_CONTEXTS, SESSION_MENTION_PREFIX, SESSION_REFERENCE_ERROR_CODES, SHELL_KINDS, SIMULTANEOUS_CONTEXTS, SYSTEM_NOTE_PREFIX, type ScheduleAllowlist, type ScheduleBackendKind, type ScheduleCycle, type ScheduleDefinition, type SchedulePendingApproval, type SchedulePendingItem, type ScheduleRun, type ScheduleRunStatus, type ScheduleRunnerSpec, type ScheduleTemplate, type ScheduleTemplateId, type ScheduleTrigger, type ScheduleTriggerKind, type ScheduleWeekday, type SearchProviderType, type SecretBackendId, type SecretStore, type SelectionContext, type SelectionRejection, type SelectionWarning, type SessionAttachKind, type SessionAttachResult, type SessionOmitReason, type SessionSurfaceMessage, type SessionSurfaceView, type SetSelectionResult, type ShellKind, type SpanLike, type SubToolCall, type SubToolCallResult, type Telemetry, type TokenUsage, type ToolAnnotations, type ToolArtifact, type ToolArtifactInput, type ToolContext, type ToolDefinition, ToolExposure, type ToolProvider, type ToolResult, type Translate, type TranslateVars, type TrustLevel, type TrustManager, type TrustRecord, type TrustScope, type VerifyResult, WIRE_ABORT_FIELDS, WIRE_ABOUT_FIELDS, WIRE_AGENT_ROLE_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_REQUEST_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_RESPONSE_FIELDS, WIRE_APPROVAL_LIST_FIELDS, WIRE_APPROVAL_ROW_FIELDS, WIRE_ARTIFACTS_FIELDS, WIRE_AUDIT_LOG_FIELDS, WIRE_AUDIT_ROW_FIELDS, WIRE_AUTH_COOKIE, WIRE_AUTH_COOKIE_ATTRS, WIRE_AUTH_TOKEN_PARAM, WIRE_BACKGROUND_TASK_FIELDS, WIRE_BLOCKED_GOALS_FIELDS, WIRE_BLOCKED_GOAL_FIELDS, WIRE_BLOCKED_LEVEL_FIELDS, WIRE_BUILTIN_CONNECTOR_FIELDS, WIRE_CACHED_APPROVAL_FIELDS, WIRE_CAPABILITIES_FIELDS, WIRE_CAPABILITY_PROJECT_FIELDS, WIRE_CHECKPOINT_LIST_FIELDS, WIRE_CHECKPOINT_SUMMARY_FIELDS, WIRE_COMMANDS_FIELDS, WIRE_COMMAND_EXPANSION_FIELDS, WIRE_COMPACT_FIELDS, WIRE_COMPRESSION_LINE_FIELDS, WIRE_CONFIG_FIELDS, WIRE_CONTEXT_FIELDS, WIRE_CREATE_SESSION_FIELDS, WIRE_CREATE_WORKSPACE_FIELDS, WIRE_CREATE_WORKSPACE_RESPONSE_FIELDS, WIRE_CUSTOM_COMMAND_FIELDS, WIRE_DELETE_SESSION_FIELDS, WIRE_DIFF_FILE_FIELDS, WIRE_ERROR_FIELDS, WIRE_FILE_CANDIDATES_FIELDS, WIRE_FILE_CANDIDATE_FIELDS, WIRE_FILE_CHANGE_FIELDS, WIRE_FILE_REFERENCE_FIELDS, WIRE_GOAL_ACTIONS, WIRE_GOAL_BLOCK_FIELDS, WIRE_GOAL_CLEAR_FIELDS, WIRE_GOAL_CREATE_FIELDS, WIRE_GOAL_FIELDS, WIRE_GOAL_LIMITS_FIELDS, WIRE_GOAL_PHASES, WIRE_GOAL_REFUSALS, WIRE_GOAL_RESPONSE_FIELDS, WIRE_GOAL_WRITE_FIELDS, WIRE_HEALTH_FIELDS, WIRE_KNOWN_WORKSPACE_FIELDS, WIRE_LANG_PARAM, WIRE_MANAGED_LOCK_FIELDS, WIRE_MCP_ADD_FIELDS, WIRE_MCP_ADD_RESPONSE_FIELDS, WIRE_MCP_APPLY_ENTRY_FIELDS, WIRE_MCP_APPLY_RESPONSE_FIELDS, WIRE_MCP_CONFIG_APPLY_FIELDS, WIRE_MCP_CONFIG_FIELDS, WIRE_MCP_CONFIG_ISSUE_FIELDS, WIRE_MCP_CONFIG_SAVE_FIELDS, WIRE_MCP_CONFIG_SAVE_RESPONSE_FIELDS, WIRE_MCP_CONNECTOR_FIELDS, WIRE_MCP_RECONNECT_FIELDS, WIRE_MESSAGE_LIST_FIELDS, WIRE_MODEL_FIELDS, WIRE_MODEL_SELECTION_FIELDS, WIRE_MODEL_SET_FIELDS, WIRE_MODEL_SUGGESTIONS_FIELDS, WIRE_PATCH_SESSION_FIELDS, WIRE_PATCH_SESSION_RESPONSE_FIELDS, WIRE_PERMISSION_RULE_FIELDS, WIRE_PERMISSION_SET_REQUEST_FIELDS, WIRE_PERMISSION_SET_RESPONSE_FIELDS, WIRE_PERMISSION_SHADOW_FIELDS, WIRE_PERMISSION_STATE_FIELDS, WIRE_PERMISSION_STATUS_FIELDS, WIRE_PLAN_ACTIONS, WIRE_PLAN_FIELDS, WIRE_PLAN_MODE_REQUEST_FIELDS, WIRE_PLAN_MODE_RESPONSE_FIELDS, WIRE_PLAN_MODE_STATE_FIELDS, WIRE_PLUGINS_FIELDS, WIRE_PLUGIN_ACTION_FIELDS, WIRE_PLUGIN_INSTALL_FIELDS, WIRE_PLUGIN_NAME_FIELDS, WIRE_PLUGIN_PREVIEW_FIELDS, WIRE_PLUGIN_PREVIEW_RESPONSE_FIELDS, WIRE_PLUGIN_UPDATE_FIELDS, WIRE_POLICY_DIR_FIELDS, WIRE_POLICY_STATUS_FIELDS, WIRE_PROVIDERS_FIELDS, WIRE_PROVIDER_MODELS_FIELDS, WIRE_PROVIDER_OPTION_FIELDS, WIRE_QUESTION_LIST_FIELDS, WIRE_QUESTION_ROW_FIELDS, WIRE_RESPOND_APPROVAL_FIELDS, WIRE_RESPOND_APPROVAL_RESPONSE_FIELDS, WIRE_RESPOND_QUESTION_FIELDS, WIRE_RESPOND_QUESTION_RESPONSE_FIELDS, WIRE_REWIND_FILE_PLAN_FIELDS, WIRE_REWIND_OUTCOME_FIELDS, WIRE_REWIND_PREVIEW_FIELDS, WIRE_REWIND_REQUEST_FIELDS, WIRE_REWIND_RESPONSE_FIELDS, WIRE_REWIND_SCOPES, WIRE_ROLE_ADD_FIELDS, WIRE_ROLE_ADD_RESPONSE_FIELDS, WIRE_SANDBOX_STATUS_FIELDS, WIRE_SCHEDULE_CAPABILITY_FIELDS, WIRE_SCHEDULE_CREATE_FIELDS, WIRE_SCHEDULE_DEFAULTS_FIELDS, WIRE_SCHEDULE_DELETE_FIELDS, WIRE_SCHEDULE_FIELDS, WIRE_SCHEDULE_FIX_FIELDS, WIRE_SCHEDULE_FIX_REQUEST_FIELDS, WIRE_SCHEDULE_ISSUE_CODES, WIRE_SCHEDULE_LIST_FIELDS, WIRE_SCHEDULE_PENDING_FIELDS, WIRE_SCHEDULE_RECORDING_FIELDS, WIRE_SCHEDULE_ROW_FIELDS, WIRE_SCHEDULE_RUNS_FIELDS, WIRE_SCHEDULE_RUN_FIELDS, WIRE_SCHEDULE_SAVE_FIELDS, WIRE_SECURITY_FIELDS, WIRE_SECURITY_WORKSPACE_FIELDS, WIRE_SEND_MESSAGE_FIELDS, WIRE_SEND_MESSAGE_RESPONSE_FIELDS, WIRE_SESSION_CANDIDATES_FIELDS, WIRE_SESSION_CANDIDATE_FIELDS, WIRE_SESSION_FINISH_FIELDS, WIRE_SESSION_LIST_FIELDS, WIRE_SESSION_REFERENCE_FIELDS, WIRE_SESSION_RESPONSE_FIELDS, WIRE_SESSION_SUMMARY_FIELDS, WIRE_SESSION_WORKSPACE_FIELDS, WIRE_SESSION_WORKSPACE_RESPONSE_FIELDS, WIRE_SETTINGS_FIELDS, WIRE_SETTINGS_WRITE_FIELDS, WIRE_SETTINGS_WRITE_REQUEST_FIELDS, WIRE_SETTING_ROW_FIELDS, WIRE_SETTING_STEP_FIELDS, WIRE_SETTING_WRITE_FIELDS, WIRE_SETTING_WRITE_LAYERS, WIRE_SKILL_BODY_FIELDS, WIRE_SKILL_FIELDS, WIRE_SKILL_IMPORT_FIELDS, WIRE_SKILL_IMPORT_PREVIEW_FIELDS, WIRE_TASKS_FIELDS, WIRE_TOOLS_FIELDS, WIRE_TOOL_GATE_FIELDS, WIRE_TOOL_ROW_FIELDS, WIRE_WORKSPACE_DIFF_FIELDS, WIRE_WORKSPACE_DIRS_FIELDS, WIRE_WORKSPACE_DIR_ENTRY_FIELDS, WIRE_WORKSPACE_REF_FIELDS, type WireAbortResponse, type WireAbout, type WireAgentEnvelope, type WireAgentEvent, type WireAgentRoleSummary, type WireApprovalCacheRevokeRequest, type WireApprovalCacheRevokeResponse, type WireApprovalListResponse, type WireApprovalRequest, type WireArtifactsResponse, type WireAuditCode, type WireAuditLog, type WireAuditOutcome, type WireAuditRow, type WireAuthDenyReason, type WireAuthDenyStatus, type WireAuthGuard, type WireAuthRequestView, type WireAuthVerdict, type WireBackgroundTask, type WireBindWorkspaceRequest, type WireBlockedGoal, type WireBlockedGoalsResponse, type WireBlockedLevel, type WireBuiltinConnector, type WireCachedApproval, type WireCachedDecision, type WireCapabilitiesResponse, type WireCapabilityProject, type WireCheckpointListResponse, type WireCheckpointSummary, type WireCommandExpansion, type WireCommandsResponse, type WireCompactRequest, type WireCompactResponse, type WireCompressionLine, type WireConfigResponse, type WireContextResponse, type WireCreateSessionRequest, type WireCreateSessionResponse, type WireCreateWorkspaceRequest, type WireCreateWorkspaceResponse, type WireCustomCommand, type WireDeleteSessionResponse, type WireDiffFile, type WireDiffNote, type WireDiffOmitReason, type WireDiffSource, type WireDiffStatus, type WireEnvelope, type WireErrorResponse, type WireEvent, type WireFields, type WireFileCandidate, type WireFileCandidatesResponse, type WireFileChange, type WireFileReference, type WireFixture, type WireFixtureCase, type WireGoal, type WireGoalBlock, type WireGoalClearResponse, type WireGoalCreateRequest, type WireGoalLimits, type WireGoalPhase, type WireGoalRefusal, type WireGoalResponse, type WireGoalUpdateRequest, type WireGoalWriteResponse, type WireHealthResponse, type WireHubEnvelope, type WireHubEvent, type WireKnownWorkspace, type WireManagedLock, type WireMcpAddRequest, type WireMcpAddResponse, type WireMcpApplyAction, type WireMcpApplyEntry, type WireMcpApplyResponse, type WireMcpConfigApplyRequest, type WireMcpConfigIssue, type WireMcpConfigResponse, type WireMcpConfigSaveRequest, type WireMcpConfigSaveResponse, type WireMcpConnector, type WireMcpReconnectResponse, type WireMessageListResponse, type WireModelCaveat, type WireModelProbeStatus, type WireModelRejection, type WireModelResponse, type WireModelSelection, type WireModelSetRequest, type WireModelSetResponse, type WireModelSource, type WireModelSuggestions, type WirePatchSessionRequest, type WirePatchSessionResponse, type WirePermissionRuleRow, type WirePermissionSetRequest, type WirePermissionSetResponse, type WirePermissionShadow, type WirePermissionState, type WirePermissionStatus, type WirePlanAction, type WirePlanModeRequest, type WirePlanModeResponse, type WirePlanModeState, type WirePlanResponse, type WirePluginActionResponse, type WirePluginCounts, type WirePluginEntry, type WirePluginHit, type WirePluginHookTally, type WirePluginInstallRequest, type WirePluginNameRequest, type WirePluginPreview, type WirePluginPreviewRequest, type WirePluginPreviewResponse, type WirePluginRefuseReason, type WirePluginSourceType, type WirePluginUpdateRequest, type WirePluginsResponse, type WirePolicyDir, type WirePolicyStatus, type WireProviderModelsRequest, type WireProviderModelsResponse, type WireProviderOption, type WireProviderSummary, type WireProvidersResponse, type WireQuestionListResponse, type WireQuestionRequest, type WireReplayMessage, type WireResetReason, type WireRespondApprovalRequest, type WireRespondApprovalResponse, type WireRespondQuestionRequest, type WireRespondQuestionResponse, type WireRewindAction, type WireRewindDrift, type WireRewindFilePlan, type WireRewindOutcome, type WireRewindPreview, type WireRewindRequest, type WireRewindResponse, type WireRewindScope, type WireRoleAddRequest, type WireRoleAddResponse, type WireSandboxReason, type WireSandboxStatus, type WireScheduleCapability, type WireScheduleCreateRequest, type WireScheduleDefaults, type WireScheduleDeleteResponse, type WireScheduleFixRequest, type WireScheduleFixResponse, type WireScheduleIssue, type WireScheduleIssueCode, type WireScheduleListResponse, type WireSchedulePendingResponse, type WireScheduleRecordingResponse, type WireScheduleRegisterRefusal, type WireScheduleRegisterWarning, type WireScheduleRegistration, type WireScheduleResponse, type WireScheduleRow, type WireScheduleRunResponse, type WireScheduleRunsResponse, type WireScheduleSaveResponse, type WireScheduleUpdateRequest, type WireSecurityResponse, type WireSecurityWorkspace, type WireSendMessageRequest, type WireSendMessageResponse, type WireSessionCandidate, type WireSessionCandidatesResponse, type WireSessionFinish, type WireSessionListResponse, type WireSessionReference, type WireSessionResponse, type WireSessionSummary, type WireSessionWorkspace, type WireSessionWorkspaceResponse, type WireSettingApply, type WireSettingFutile, type WireSettingLayer, type WireSettingRow, type WireSettingStep, type WireSettingValue, type WireSettingWrite, type WireSettingWriteLayer, type WireSettingsResponse, type WireSettingsWriteRequest, type WireSettingsWriteResponse, type WireSkillBodyResponse, type WireSkillImportConflict, type WireSkillImportEntry, type WireSkillImportFailure, type WireSkillImportForm, type WireSkillImportIssue, type WireSkillImportPreviewResponse, type WireSkillImportResponse, type WireSkillSummary, type WireSummaryWorkspace, type WireTaggedEvent, type WireTasksResponse, type WireToolGate, type WireToolGateAxis, type WireToolRow, type WireToolSummary, type WireToolVerdict, type WireToolsResponse, type WireTurnState, type WireWorkspaceBinding, type WireWorkspaceDiffResponse, type WireWorkspaceDirEntry, type WireWorkspaceDirsResponse, type WireWorkspaceRef, apiKeyEnvVar, assertNeverPart, assistantTurnText, attachSessionSurface, chordId, collectPendingApprovals, compressionThresholdTokens, conformsToWire, contentToText, diagnosticToLine, extractAllMentions, extractMentions, extractSessionMentions, filePartSummary, flattenCatalog, getProviderInfo, hasFailure, isApprovalOutcome, isContextNearlyFull, isHeadlessInputFormat, isHeadlessLifecycleEvent, isHeadlessOutputFormat, isKeyAction, isLang, isMentionableFilePath, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, isQuestionAnswerMap, isSearchProviderType, isValidAgentRoleName, isValidCommandName, isWireGoalPhase, isWireHubEvent, isWirePlanAction, isWireRewindScope, isWireSettingWriteLayer, makeTranslate, normalizeApproval, packSessionSurface, parseChord, parseModelRef, parseSequence, perAction, placeholdersOf, promptTokens, sequenceId, sessionPartSummary, stripSystemNote, systemNote, tableOf, totalUsageTokens, translatorFor, turnDigest, unfixedRules, utf8ByteLength, wireFields };
11946
+ export { ACTION_CONTEXTS, AGENT_ROLE_NAME_PATTERN, API_KEY_ENV_VARS, APPROVAL_OUTCOMES, type ActiveAgentRole, type AgentEvent, type AgentEventOf, type AgentEventType, type AgentRole, type AgentRoleScope, type AgentRoleSource, type ApprovalAnswer, type ApprovalOutcome, type ApprovalReply, type ApprovalRequest, type ArtifactKind, type AttributeValue, type Attributes, type BackgroundTaskInfo, type BackgroundTaskKind, type BackgroundTaskStatus, type BoundKey, type BudgetBreach, COMMAND_NAME_PATTERN, COMPLIANCE_ACTIONS, COMPLIANCE_CATEGORIES, type Catalogs, type ComplianceAction, type ComplianceCategory, type ContextBreakdown, type ContextSegment, type CustomCommandDef, type CustomCommandSource, DEFAULT_AGENT_ROLE, DEFAULT_LANG, type DecidedTrustLevel, type Diagnostic, DiagnosticSink, type DiagnosticStatus, type EpochConfig, type EpochContentPart, type EpochFilePart, type EpochHook, type EpochImagePart, type EpochMessage, type EpochMessageRole, type EpochPlugin, type EpochSessionPart, type EpochSkill, type EpochTextPart, type EpochTool, type EpochToolCall, type EpochToolResult, type EpochTurnFacts, type EpochUserContent, type ExpandedCommand, type FileOmitReason, type FinishReason, type FixableApproval, type FlatCatalog, GEN_AI, HEADLESS_INPUT_EVENT_TYPES, HEADLESS_INPUT_FORMATS, HEADLESS_OUTPUT_FORMATS, HEADLESS_PROTOCOL_VERSION, type HeadlessEnvelope, type HeadlessEvent, type HeadlessInit, type HeadlessInputEvent, type HeadlessInputEventType, type HeadlessInputFormat, type HeadlessLifecycleEvent, type HeadlessOutputFormat, type HeadlessResult, type HeadlessResultReason, type HookContext, type HookEvent, type HookHandler, type HookManager, type HookRegistration, type HookType, type JsonSchema, KEY_ACTIONS, type KeyAction, type KeyChord, type KeyContext, type KeySequence, type KeybindingReport, type KeybindingSource, type KeybindingTable, LANGS, type Lang, type LocalizedDetail, type LogFn, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_HEADER_CHARS, MAX_OPTIONS, MAX_QUESTIONS, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, MCP_DATA_KEY_NAME, METRIC, MIN_OPTIONS, type MentionSet, type ModelRef, type ModelSelection, type ModelSelectionOrigin, NOOP_TELEMETRY, type NoticeCode, OPERATION_TYPES, type Operation, type OperationType, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, type PermissionDecision, type PermissionLevel, type PermissionManager, type PermissionRuleLists, type PlanApprovalOutcome, type PlanProposal, type PluginContext, type ProviderInfo, type ProviderType, type QuestionAnswer, type QuestionItem, type QuestionOption, type QuestionRequest, RESERVED_CHORDS, RESERVED_COMMAND_NAMES, type RejectReason, type RejectedKey, type RuleValue, SCHEDULE_INTERVAL_MINUTES, SCHEDULE_RUN_STATUSES, SCHEDULE_TEMPLATES, SEARCH_API_KEY_ENV, SEARCH_PROVIDER_TYPES, SECRET_SERVICE, SEQUENCE_CONTEXTS, SESSION_MENTION_PREFIX, SESSION_REFERENCE_ERROR_CODES, SHELL_KINDS, SIDEBAR_MENU_MESSAGE_TYPE, SIMULTANEOUS_CONTEXTS, SYSTEM_NOTE_PREFIX, type ScheduleAllowlist, type ScheduleBackendKind, type ScheduleCycle, type ScheduleDefinition, type SchedulePendingApproval, type SchedulePendingItem, type ScheduleRun, type ScheduleRunStatus, type ScheduleRunnerSpec, type ScheduleTemplate, type ScheduleTemplateId, type ScheduleTrigger, type ScheduleTriggerKind, type ScheduleWeekday, type SearchProviderType, type SecretBackendId, type SecretStore, type SelectionContext, type SelectionRejection, type SelectionWarning, type SessionAttachKind, type SessionAttachResult, type SessionOmitReason, type SessionSurfaceMessage, type SessionSurfaceView, type SetSelectionResult, type ShellKind, type SidebarMenuItem, type SidebarMenuMessage, type SpanLike, type SubToolCall, type SubToolCallResult, type Telemetry, type TokenUsage, type ToolAnnotations, type ToolArtifact, type ToolArtifactInput, type ToolContext, type ToolDefinition, ToolExposure, type ToolProvider, type ToolResult, type Translate, type TranslateVars, type TrustLevel, type TrustManager, type TrustRecord, type TrustScope, type VerifyResult, WIRE_ABORT_FIELDS, WIRE_ABOUT_FIELDS, WIRE_AGENT_ROLE_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_REQUEST_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_RESPONSE_FIELDS, WIRE_APPROVAL_LIST_FIELDS, WIRE_APPROVAL_ROW_FIELDS, WIRE_ARTIFACTS_FIELDS, WIRE_AUDIT_LOG_FIELDS, WIRE_AUDIT_ROW_FIELDS, WIRE_AUTH_COOKIE, WIRE_AUTH_COOKIE_ATTRS, WIRE_AUTH_TOKEN_PARAM, WIRE_BACKGROUND_TASK_FIELDS, WIRE_BLOCKED_GOALS_FIELDS, WIRE_BLOCKED_GOAL_FIELDS, WIRE_BLOCKED_LEVEL_FIELDS, WIRE_BUILTIN_CONNECTOR_FIELDS, WIRE_CACHED_APPROVAL_FIELDS, WIRE_CAPABILITIES_FIELDS, WIRE_CAPABILITY_PROJECT_FIELDS, WIRE_CHECKPOINT_LIST_FIELDS, WIRE_CHECKPOINT_SUMMARY_FIELDS, WIRE_COMMANDS_FIELDS, WIRE_COMMAND_EXPANSION_FIELDS, WIRE_COMPACT_FIELDS, WIRE_COMPRESSION_LINE_FIELDS, WIRE_CONFIG_FIELDS, WIRE_CONTEXT_FIELDS, WIRE_CREATE_SESSION_FIELDS, WIRE_CREATE_WORKSPACE_FIELDS, WIRE_CREATE_WORKSPACE_RESPONSE_FIELDS, WIRE_CUSTOM_COMMAND_FIELDS, WIRE_DELETE_SESSION_FIELDS, WIRE_DIFF_FILE_FIELDS, WIRE_ERROR_FIELDS, WIRE_FILE_CANDIDATES_FIELDS, WIRE_FILE_CANDIDATE_FIELDS, WIRE_FILE_CHANGE_FIELDS, WIRE_FILE_OPEN_RESPONSE_FIELDS, WIRE_FILE_REFERENCE_FIELDS, WIRE_FILE_STAT_MAX, WIRE_FILE_STAT_OK_FIELDS, WIRE_FILE_STAT_REFUSED_FIELDS, WIRE_FILE_STAT_RESPONSE_FIELDS, WIRE_FILE_TEXT_RESPONSE_FIELDS, WIRE_GOAL_ACTIONS, WIRE_GOAL_BLOCK_FIELDS, WIRE_GOAL_CLEAR_FIELDS, WIRE_GOAL_CREATE_FIELDS, WIRE_GOAL_FIELDS, WIRE_GOAL_LIMITS_FIELDS, WIRE_GOAL_PHASES, WIRE_GOAL_REFUSALS, WIRE_GOAL_RESPONSE_FIELDS, WIRE_GOAL_WRITE_FIELDS, WIRE_HEALTH_FIELDS, WIRE_IMAGE_REFERENCE_FIELDS, WIRE_KNOWN_WORKSPACE_FIELDS, WIRE_LANG_PARAM, WIRE_MANAGED_LOCK_FIELDS, WIRE_MCP_ADD_FIELDS, WIRE_MCP_ADD_RESPONSE_FIELDS, WIRE_MCP_APPLY_ENTRY_FIELDS, WIRE_MCP_APPLY_RESPONSE_FIELDS, WIRE_MCP_CONFIG_APPLY_FIELDS, WIRE_MCP_CONFIG_FIELDS, WIRE_MCP_CONFIG_ISSUE_FIELDS, WIRE_MCP_CONFIG_SAVE_FIELDS, WIRE_MCP_CONFIG_SAVE_RESPONSE_FIELDS, WIRE_MCP_CONNECTOR_FIELDS, WIRE_MCP_RECONNECT_FIELDS, WIRE_MESSAGE_LIST_FIELDS, WIRE_MODEL_FIELDS, WIRE_MODEL_SELECTION_FIELDS, WIRE_MODEL_SET_FIELDS, WIRE_MODEL_SUGGESTIONS_FIELDS, WIRE_PATCH_SESSION_FIELDS, WIRE_PATCH_SESSION_RESPONSE_FIELDS, WIRE_PERMISSION_RULE_FIELDS, WIRE_PERMISSION_SET_REQUEST_FIELDS, WIRE_PERMISSION_SET_RESPONSE_FIELDS, WIRE_PERMISSION_SHADOW_FIELDS, WIRE_PERMISSION_STATE_FIELDS, WIRE_PERMISSION_STATUS_FIELDS, WIRE_PLAN_ACTIONS, WIRE_PLAN_FIELDS, WIRE_PLAN_MODE_REQUEST_FIELDS, WIRE_PLAN_MODE_RESPONSE_FIELDS, WIRE_PLAN_MODE_STATE_FIELDS, WIRE_PLUGINS_FIELDS, WIRE_PLUGIN_ACTION_FIELDS, WIRE_PLUGIN_INSTALL_FIELDS, WIRE_PLUGIN_NAME_FIELDS, WIRE_PLUGIN_PREVIEW_FIELDS, WIRE_PLUGIN_PREVIEW_RESPONSE_FIELDS, WIRE_PLUGIN_UPDATE_FIELDS, WIRE_POLICY_DIR_FIELDS, WIRE_POLICY_STATUS_FIELDS, WIRE_PROVIDERS_FIELDS, WIRE_PROVIDER_KEY_FIELDS, WIRE_PROVIDER_MODELS_FIELDS, WIRE_PROVIDER_OPTION_FIELDS, WIRE_QUESTION_LIST_FIELDS, WIRE_QUESTION_ROW_FIELDS, WIRE_RESPOND_APPROVAL_FIELDS, WIRE_RESPOND_APPROVAL_RESPONSE_FIELDS, WIRE_RESPOND_QUESTION_FIELDS, WIRE_RESPOND_QUESTION_RESPONSE_FIELDS, WIRE_REWIND_FILE_PLAN_FIELDS, WIRE_REWIND_OUTCOME_FIELDS, WIRE_REWIND_PREVIEW_FIELDS, WIRE_REWIND_REQUEST_FIELDS, WIRE_REWIND_RESPONSE_FIELDS, WIRE_REWIND_SCOPES, WIRE_ROLE_ADD_FIELDS, WIRE_ROLE_ADD_RESPONSE_FIELDS, WIRE_SANDBOX_STATUS_FIELDS, WIRE_SCHEDULE_CAPABILITY_FIELDS, WIRE_SCHEDULE_CREATE_FIELDS, WIRE_SCHEDULE_DEFAULTS_FIELDS, WIRE_SCHEDULE_DELETE_FIELDS, WIRE_SCHEDULE_FIELDS, WIRE_SCHEDULE_FIX_FIELDS, WIRE_SCHEDULE_FIX_REQUEST_FIELDS, WIRE_SCHEDULE_ISSUE_CODES, WIRE_SCHEDULE_LIST_FIELDS, WIRE_SCHEDULE_PENDING_FIELDS, WIRE_SCHEDULE_RECORDING_FIELDS, WIRE_SCHEDULE_ROW_FIELDS, WIRE_SCHEDULE_RUNS_FIELDS, WIRE_SCHEDULE_RUN_FIELDS, WIRE_SCHEDULE_SAVE_FIELDS, WIRE_SECURITY_FIELDS, WIRE_SECURITY_WORKSPACE_FIELDS, WIRE_SEND_MESSAGE_FIELDS, WIRE_SEND_MESSAGE_RESPONSE_FIELDS, WIRE_SESSION_CANDIDATES_FIELDS, WIRE_SESSION_CANDIDATE_FIELDS, WIRE_SESSION_FINISH_FIELDS, WIRE_SESSION_LIST_FIELDS, WIRE_SESSION_REFERENCE_FIELDS, WIRE_SESSION_RESPONSE_FIELDS, WIRE_SESSION_SUMMARY_FIELDS, WIRE_SESSION_WORKSPACE_FIELDS, WIRE_SESSION_WORKSPACE_RESPONSE_FIELDS, WIRE_SETTINGS_FIELDS, WIRE_SETTINGS_WRITE_FIELDS, WIRE_SETTINGS_WRITE_REQUEST_FIELDS, WIRE_SETTING_ROW_FIELDS, WIRE_SETTING_STEP_FIELDS, WIRE_SETTING_WRITE_FIELDS, WIRE_SETTING_WRITE_LAYERS, WIRE_SKILL_BODY_FIELDS, WIRE_SKILL_FIELDS, WIRE_SKILL_IMPORT_FIELDS, WIRE_SKILL_IMPORT_PREVIEW_FIELDS, WIRE_SKILL_REMOVE_FIELDS, WIRE_TASKS_FIELDS, WIRE_TOOLS_FIELDS, WIRE_TOOL_GATE_FIELDS, WIRE_TOOL_ROW_FIELDS, WIRE_WORKSPACE_DIFF_FIELDS, WIRE_WORKSPACE_DIRS_FIELDS, WIRE_WORKSPACE_DIR_ENTRY_FIELDS, WIRE_WORKSPACE_REF_FIELDS, type WireAbortResponse, type WireAbout, type WireAgentEnvelope, type WireAgentEvent, type WireAgentRoleSummary, type WireApprovalCacheRevokeRequest, type WireApprovalCacheRevokeResponse, type WireApprovalListResponse, type WireApprovalRequest, type WireArtifactsResponse, type WireAuditCode, type WireAuditLog, type WireAuditOutcome, type WireAuditRow, type WireAuthDenyReason, type WireAuthDenyStatus, type WireAuthGuard, type WireAuthRequestView, type WireAuthVerdict, type WireBackgroundTask, type WireBindWorkspaceRequest, type WireBlockedGoal, type WireBlockedGoalsResponse, type WireBlockedLevel, type WireBuiltinConnector, type WireCachedApproval, type WireCachedDecision, type WireCapabilitiesResponse, type WireCapabilityProject, type WireCheckpointListResponse, type WireCheckpointSummary, type WireCommandExpansion, type WireCommandsResponse, type WireCompactRequest, type WireCompactResponse, type WireCompressionLine, type WireConfigResponse, type WireContextResponse, type WireCreateSessionRequest, type WireCreateSessionResponse, type WireCreateWorkspaceRequest, type WireCreateWorkspaceResponse, type WireCustomCommand, type WireDeleteSessionResponse, type WireDiffFile, type WireDiffNote, type WireDiffOmitReason, type WireDiffSource, type WireDiffStatus, type WireEnvelope, type WireErrorResponse, type WireEvent, type WireFields, type WireFileCandidate, type WireFileCandidatesResponse, type WireFileChange, type WireFileKind, type WireFileOpenRefusal, type WireFileOpenResponse, type WireFileReference, type WireFileRefusal, type WireFileStat, type WireFileStatOk, type WireFileStatRefused, type WireFileStatResponse, type WireFileTextResponse, type WireFixture, type WireFixtureCase, type WireGoal, type WireGoalBlock, type WireGoalClearResponse, type WireGoalCreateRequest, type WireGoalLimits, type WireGoalPhase, type WireGoalRefusal, type WireGoalResponse, type WireGoalUpdateRequest, type WireGoalWriteResponse, type WireHealthResponse, type WireHubEnvelope, type WireHubEvent, type WireImageReference, type WireKnownWorkspace, type WireManagedLock, type WireMcpAddRequest, type WireMcpAddResponse, type WireMcpApplyAction, type WireMcpApplyEntry, type WireMcpApplyResponse, type WireMcpConfigApplyRequest, type WireMcpConfigIssue, type WireMcpConfigResponse, type WireMcpConfigSaveRequest, type WireMcpConfigSaveResponse, type WireMcpConnector, type WireMcpReconnectResponse, type WireMessageListResponse, type WireModelCaveat, type WireModelProbeStatus, type WireModelRejection, type WireModelResponse, type WireModelSelection, type WireModelSetRequest, type WireModelSetResponse, type WireModelSource, type WireModelSuggestions, type WirePatchSessionRequest, type WirePatchSessionResponse, type WirePermissionRememberFailure, type WirePermissionRuleRow, type WirePermissionSetRequest, type WirePermissionSetResponse, type WirePermissionShadow, type WirePermissionState, type WirePermissionStatus, type WirePickDirectoryResponse, type WirePlanAction, type WirePlanModeRequest, type WirePlanModeResponse, type WirePlanModeState, type WirePlanResponse, type WirePluginActionResponse, type WirePluginCounts, type WirePluginEntry, type WirePluginHit, type WirePluginHookTally, type WirePluginInstallRequest, type WirePluginNameRequest, type WirePluginPreview, type WirePluginPreviewRequest, type WirePluginPreviewResponse, type WirePluginRefuseReason, type WirePluginSourceType, type WirePluginUpdateRequest, type WirePluginsResponse, type WirePolicyDir, type WirePolicyStatus, type WireProviderKeyRequest, type WireProviderKeyResponse, type WireProviderModelsRequest, type WireProviderModelsResponse, type WireProviderOption, type WireProviderSummary, type WireProvidersResponse, type WireQuestionListResponse, type WireQuestionRequest, type WireReplayMessage, type WireResetReason, type WireRespondApprovalRequest, type WireRespondApprovalResponse, type WireRespondQuestionRequest, type WireRespondQuestionResponse, type WireRewindAction, type WireRewindDrift, type WireRewindFilePlan, type WireRewindOutcome, type WireRewindPreview, type WireRewindRequest, type WireRewindResponse, type WireRewindScope, type WireRoleAddRequest, type WireRoleAddResponse, type WireSandboxReason, type WireSandboxStatus, type WireScheduleCapability, type WireScheduleCreateRequest, type WireScheduleDefaults, type WireScheduleDeleteResponse, type WireScheduleFixRequest, type WireScheduleFixResponse, type WireScheduleIssue, type WireScheduleIssueCode, type WireScheduleListResponse, type WireSchedulePendingResponse, type WireScheduleRecordingResponse, type WireScheduleRegisterRefusal, type WireScheduleRegisterWarning, type WireScheduleRegistration, type WireScheduleResponse, type WireScheduleRow, type WireScheduleRunResponse, type WireScheduleRunsResponse, type WireScheduleSaveResponse, type WireScheduleUpdateRequest, type WireSecurityResponse, type WireSecurityWorkspace, type WireSendMessageRequest, type WireSendMessageResponse, type WireSessionCandidate, type WireSessionCandidatesResponse, type WireSessionFinish, type WireSessionListResponse, type WireSessionReference, type WireSessionResponse, type WireSessionSummary, type WireSessionWorkspace, type WireSessionWorkspaceResponse, type WireSettingApply, type WireSettingFutile, type WireSettingLayer, type WireSettingRow, type WireSettingStep, type WireSettingValue, type WireSettingValueKind, type WireSettingWrite, type WireSettingWriteLayer, type WireSettingsResponse, type WireSettingsWriteRequest, type WireSettingsWriteResponse, type WireSkillBodyResponse, type WireSkillImportConflict, type WireSkillImportEntry, type WireSkillImportFailure, type WireSkillImportForm, type WireSkillImportIssue, type WireSkillImportPreviewResponse, type WireSkillImportResponse, type WireSkillRemoveFailure, type WireSkillRemoveResponse, type WireSkillSummary, type WireSummaryWorkspace, type WireTaggedEvent, type WireTasksResponse, type WireToolGate, type WireToolGateAxis, type WireToolRow, type WireToolSummary, type WireToolVerdict, type WireToolsResponse, type WireTurnState, type WireWorkspaceBinding, type WireWorkspaceDiffResponse, type WireWorkspaceDirEntry, type WireWorkspaceDirsResponse, type WireWorkspaceRef, apiKeyEnvVar, assertNeverPart, assistantTurnText, attachSessionSurface, chordId, collectPendingApprovals, compressionThresholdTokens, conformsToWire, contentToText, diagnosticToLine, extractAllMentions, extractMentions, extractSessionMentions, filePartSummary, flattenCatalog, getProviderInfo, hasFailure, isApprovalOutcome, isContextNearlyFull, isHeadlessInputFormat, isHeadlessLifecycleEvent, isHeadlessOutputFormat, isKeyAction, isLang, isMentionableFilePath, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, isQuestionAnswerMap, isSearchProviderType, isValidAgentRoleName, isValidCommandName, isWireGoalPhase, isWireHubEvent, isWirePlanAction, isWireRewindScope, isWireSettingWriteLayer, makeTranslate, normalizeApproval, packSessionSurface, parseChord, parseModelRef, parseSequence, perAction, placeholdersOf, promptTokens, sequenceId, sessionPartSummary, stripSystemNote, systemNote, tableOf, totalUsageTokens, translatorFor, turnDigest, unfixedRules, utf8ByteLength, wireFields };
package/dist/index.js CHANGED
@@ -338,6 +338,7 @@ var METRIC = {
338
338
  MODEL_SWITCH: "epoch.model.switch.count",
339
339
  MODEL_FALLBACK: "epoch.model.fallback.count",
340
340
  CONTEXT_COMPACTION: "epoch.context.compaction.count",
341
+ COMPLIANCE_HIT: "epoch.compliance.hit.count",
341
342
  STARTUP_DURATION: "epoch.startup.duration"
342
343
  };
343
344
  var NOOP_SPAN = {
@@ -558,15 +559,17 @@ function sessionPartSummary(part) {
558
559
  const truncated = part.truncatedTo === void 0 ? "" : `, truncated to ${part.truncatedTo} bytes`;
559
560
  return `${head}${counted}${truncated}]`;
560
561
  }
561
- function contentToText(content) {
562
+ function contentToText(content, opts = {}) {
562
563
  if (typeof content === "string") return content;
563
564
  return content.map((p) => {
564
565
  if (p.type === "text") return p.text;
565
566
  if (p.type === "file") return filePartSummary(p);
566
567
  if (p.type === "session") return sessionPartSummary(p);
567
- if (p.type === "image") return `[\u56FE\u7247 ${p.mediaType ?? "\u672A\u77E5\u7C7B\u578B"}]`;
568
+ if (p.type === "image") {
569
+ return opts.imagesCarriedAsParts ? void 0 : `[\u56FE\u7247 ${p.mediaType ?? "\u672A\u77E5\u7C7B\u578B"}]`;
570
+ }
568
571
  return assertNeverPart(p);
569
- }).join("\n");
572
+ }).filter((line) => line !== void 0).join("\n");
570
573
  }
571
574
  var TURN_DIGEST_MAX_TOOLS = 8;
572
575
  function turnDigest(results) {
@@ -832,7 +835,8 @@ var WIRE_CONFIG_FIELDS = wireFields()({
832
835
  tools: true,
833
836
  diagnostics: true,
834
837
  about: true,
835
- lanExposed: true
838
+ lanExposed: true,
839
+ nativeDirPicker: true
836
840
  });
837
841
  var WIRE_SESSION_SUMMARY_FIELDS = wireFields()({
838
842
  id: true,
@@ -891,6 +895,9 @@ var WIRE_SESSION_REFERENCE_FIELDS = wireFields()({
891
895
  var WIRE_FILE_REFERENCE_FIELDS = wireFields()({
892
896
  path: true
893
897
  });
898
+ var WIRE_IMAGE_REFERENCE_FIELDS = wireFields()({
899
+ image: true
900
+ });
894
901
  var WIRE_SEND_MESSAGE_RESPONSE_FIELDS = wireFields()({
895
902
  accepted: true,
896
903
  queued: true
@@ -1135,6 +1142,13 @@ var WIRE_SKILL_IMPORT_FIELDS = wireFields()({
1135
1142
  detail: true,
1136
1143
  reason: true
1137
1144
  });
1145
+ var WIRE_SKILL_REMOVE_FIELDS = wireFields()({
1146
+ ok: true,
1147
+ name: true,
1148
+ path: true,
1149
+ detail: true,
1150
+ reason: true
1151
+ });
1138
1152
  // src/wire-agent-role.ts
1139
1153
  var WIRE_ROLE_ADD_FIELDS = wireFields()({
1140
1154
  name: true,
@@ -1377,7 +1391,8 @@ var WIRE_PROVIDER_OPTION_FIELDS = wireFields()({
1377
1391
  type: true,
1378
1392
  label: true,
1379
1393
  envVar: true,
1380
- hasKey: true
1394
+ hasKey: true,
1395
+ keyHint: true
1381
1396
  });
1382
1397
  var WIRE_PROVIDERS_FIELDS = wireFields()({
1383
1398
  providers: true
@@ -1391,6 +1406,14 @@ var WIRE_MODEL_SUGGESTIONS_FIELDS = wireFields()({
1391
1406
  var WIRE_PROVIDER_MODELS_FIELDS = wireFields()({
1392
1407
  suggestions: true
1393
1408
  });
1409
+ var WIRE_PROVIDER_KEY_FIELDS = wireFields()({
1410
+ provider: true,
1411
+ hasKey: true,
1412
+ keyHint: true,
1413
+ backend: true,
1414
+ encrypted: true,
1415
+ envPath: true
1416
+ });
1394
1417
  // src/wire-tools.ts
1395
1418
  var WIRE_TOOL_GATE_FIELDS = wireFields()({
1396
1419
  verdict: true,
@@ -1419,6 +1442,34 @@ var WIRE_ARTIFACTS_FIELDS = wireFields()({
1419
1442
  changes: true,
1420
1443
  root: true
1421
1444
  });
1445
+ // src/wire-file-view.ts
1446
+ var WIRE_FILE_STAT_MAX = 32;
1447
+ var WIRE_FILE_STAT_OK_FIELDS = wireFields()({
1448
+ path: true,
1449
+ ok: true,
1450
+ kind: true,
1451
+ bytes: true,
1452
+ mtimeMs: true,
1453
+ openable: true
1454
+ });
1455
+ var WIRE_FILE_STAT_REFUSED_FIELDS = wireFields()({
1456
+ path: true,
1457
+ ok: true,
1458
+ refusal: true
1459
+ });
1460
+ var WIRE_FILE_STAT_RESPONSE_FIELDS = wireFields()({
1461
+ files: true,
1462
+ overLimit: true,
1463
+ root: true
1464
+ });
1465
+ var WIRE_FILE_TEXT_RESPONSE_FIELDS = wireFields()({
1466
+ path: true,
1467
+ text: true,
1468
+ bytes: true
1469
+ });
1470
+ var WIRE_FILE_OPEN_RESPONSE_FIELDS = wireFields()({
1471
+ ok: true
1472
+ });
1422
1473
  // src/wire-schedule.ts
1423
1474
  var WIRE_SCHEDULE_ISSUE_CODES = [
1424
1475
  "name-empty",
@@ -1589,6 +1640,19 @@ var WIRE_FILE_CANDIDATES_FIELDS = wireFields()({
1589
1640
  unmentionable: true,
1590
1641
  truncated: true
1591
1642
  });
1643
+ // src/sidebar-menu.ts
1644
+ var SIDEBAR_MENU_MESSAGE_TYPE = "epoch:sidebar-menu";
1645
+ // src/compliance.ts
1646
+ var COMPLIANCE_CATEGORIES = [
1647
+ "sexual",
1648
+ "political",
1649
+ "hate",
1650
+ "violence",
1651
+ "illegal",
1652
+ "self_harm",
1653
+ "privacy"
1654
+ ];
1655
+ var COMPLIANCE_ACTIONS = ["block", "mask", "warn", "off"];
1592
1656
  // src/secret.ts
1593
1657
  var SECRET_SERVICE = "epoch-agent";
1594
1658
  var MCP_DATA_KEY_NAME = "mcp-auth-data-key";
@@ -1633,4 +1697,4 @@ function translatorFor(catalogs, lang) {
1633
1697
  return (key, vars) => translate(lang, key, vars);
1634
1698
  }
1635
1699
 
1636
- export { ACTION_CONTEXTS, AGENT_ROLE_NAME_PATTERN, API_KEY_ENV_VARS, APPROVAL_OUTCOMES, COMMAND_NAME_PATTERN, DEFAULT_AGENT_ROLE, DEFAULT_LANG, DiagnosticSink, GEN_AI, HEADLESS_INPUT_EVENT_TYPES, HEADLESS_INPUT_FORMATS, HEADLESS_OUTPUT_FORMATS, HEADLESS_PROTOCOL_VERSION, KEY_ACTIONS, LANGS, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_HEADER_CHARS, MAX_OPTIONS, MAX_QUESTIONS, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, MCP_DATA_KEY_NAME, METRIC, MIN_OPTIONS, NOOP_TELEMETRY, OPERATION_TYPES, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, RESERVED_CHORDS, RESERVED_COMMAND_NAMES, SCHEDULE_INTERVAL_MINUTES, SCHEDULE_RUN_STATUSES, SCHEDULE_TEMPLATES, SEARCH_API_KEY_ENV, SEARCH_PROVIDER_TYPES, SECRET_SERVICE, SEQUENCE_CONTEXTS, SESSION_MENTION_PREFIX, SESSION_REFERENCE_ERROR_CODES, SHELL_KINDS, SIMULTANEOUS_CONTEXTS, SYSTEM_NOTE_PREFIX, ToolExposure, WIRE_ABORT_FIELDS, WIRE_ABOUT_FIELDS, WIRE_AGENT_ROLE_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_REQUEST_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_RESPONSE_FIELDS, WIRE_APPROVAL_LIST_FIELDS, WIRE_APPROVAL_ROW_FIELDS, WIRE_ARTIFACTS_FIELDS, WIRE_AUDIT_LOG_FIELDS, WIRE_AUDIT_ROW_FIELDS, WIRE_AUTH_COOKIE, WIRE_AUTH_COOKIE_ATTRS, WIRE_AUTH_TOKEN_PARAM, WIRE_BACKGROUND_TASK_FIELDS, WIRE_BLOCKED_GOALS_FIELDS, WIRE_BLOCKED_GOAL_FIELDS, WIRE_BLOCKED_LEVEL_FIELDS, WIRE_BUILTIN_CONNECTOR_FIELDS, WIRE_CACHED_APPROVAL_FIELDS, WIRE_CAPABILITIES_FIELDS, WIRE_CAPABILITY_PROJECT_FIELDS, WIRE_CHECKPOINT_LIST_FIELDS, WIRE_CHECKPOINT_SUMMARY_FIELDS, WIRE_COMMANDS_FIELDS, WIRE_COMMAND_EXPANSION_FIELDS, WIRE_COMPACT_FIELDS, WIRE_COMPRESSION_LINE_FIELDS, WIRE_CONFIG_FIELDS, WIRE_CONTEXT_FIELDS, WIRE_CREATE_SESSION_FIELDS, WIRE_CREATE_WORKSPACE_FIELDS, WIRE_CREATE_WORKSPACE_RESPONSE_FIELDS, WIRE_CUSTOM_COMMAND_FIELDS, WIRE_DELETE_SESSION_FIELDS, WIRE_DIFF_FILE_FIELDS, WIRE_ERROR_FIELDS, WIRE_FILE_CANDIDATES_FIELDS, WIRE_FILE_CANDIDATE_FIELDS, WIRE_FILE_CHANGE_FIELDS, WIRE_FILE_REFERENCE_FIELDS, WIRE_GOAL_ACTIONS, WIRE_GOAL_BLOCK_FIELDS, WIRE_GOAL_CLEAR_FIELDS, WIRE_GOAL_CREATE_FIELDS, WIRE_GOAL_FIELDS, WIRE_GOAL_LIMITS_FIELDS, WIRE_GOAL_PHASES, WIRE_GOAL_REFUSALS, WIRE_GOAL_RESPONSE_FIELDS, WIRE_GOAL_WRITE_FIELDS, WIRE_HEALTH_FIELDS, WIRE_KNOWN_WORKSPACE_FIELDS, WIRE_LANG_PARAM, WIRE_MANAGED_LOCK_FIELDS, WIRE_MCP_ADD_FIELDS, WIRE_MCP_ADD_RESPONSE_FIELDS, WIRE_MCP_APPLY_ENTRY_FIELDS, WIRE_MCP_APPLY_RESPONSE_FIELDS, WIRE_MCP_CONFIG_APPLY_FIELDS, WIRE_MCP_CONFIG_FIELDS, WIRE_MCP_CONFIG_ISSUE_FIELDS, WIRE_MCP_CONFIG_SAVE_FIELDS, WIRE_MCP_CONFIG_SAVE_RESPONSE_FIELDS, WIRE_MCP_CONNECTOR_FIELDS, WIRE_MCP_RECONNECT_FIELDS, WIRE_MESSAGE_LIST_FIELDS, WIRE_MODEL_FIELDS, WIRE_MODEL_SELECTION_FIELDS, WIRE_MODEL_SET_FIELDS, WIRE_MODEL_SUGGESTIONS_FIELDS, WIRE_PATCH_SESSION_FIELDS, WIRE_PATCH_SESSION_RESPONSE_FIELDS, WIRE_PERMISSION_RULE_FIELDS, WIRE_PERMISSION_SET_REQUEST_FIELDS, WIRE_PERMISSION_SET_RESPONSE_FIELDS, WIRE_PERMISSION_SHADOW_FIELDS, WIRE_PERMISSION_STATE_FIELDS, WIRE_PERMISSION_STATUS_FIELDS, WIRE_PLAN_ACTIONS, WIRE_PLAN_FIELDS, WIRE_PLAN_MODE_REQUEST_FIELDS, WIRE_PLAN_MODE_RESPONSE_FIELDS, WIRE_PLAN_MODE_STATE_FIELDS, WIRE_PLUGINS_FIELDS, WIRE_PLUGIN_ACTION_FIELDS, WIRE_PLUGIN_INSTALL_FIELDS, WIRE_PLUGIN_NAME_FIELDS, WIRE_PLUGIN_PREVIEW_FIELDS, WIRE_PLUGIN_PREVIEW_RESPONSE_FIELDS, WIRE_PLUGIN_UPDATE_FIELDS, WIRE_POLICY_DIR_FIELDS, WIRE_POLICY_STATUS_FIELDS, WIRE_PROVIDERS_FIELDS, WIRE_PROVIDER_MODELS_FIELDS, WIRE_PROVIDER_OPTION_FIELDS, WIRE_QUESTION_LIST_FIELDS, WIRE_QUESTION_ROW_FIELDS, WIRE_RESPOND_APPROVAL_FIELDS, WIRE_RESPOND_APPROVAL_RESPONSE_FIELDS, WIRE_RESPOND_QUESTION_FIELDS, WIRE_RESPOND_QUESTION_RESPONSE_FIELDS, WIRE_REWIND_FILE_PLAN_FIELDS, WIRE_REWIND_OUTCOME_FIELDS, WIRE_REWIND_PREVIEW_FIELDS, WIRE_REWIND_REQUEST_FIELDS, WIRE_REWIND_RESPONSE_FIELDS, WIRE_REWIND_SCOPES, WIRE_ROLE_ADD_FIELDS, WIRE_ROLE_ADD_RESPONSE_FIELDS, WIRE_SANDBOX_STATUS_FIELDS, WIRE_SCHEDULE_CAPABILITY_FIELDS, WIRE_SCHEDULE_CREATE_FIELDS, WIRE_SCHEDULE_DEFAULTS_FIELDS, WIRE_SCHEDULE_DELETE_FIELDS, WIRE_SCHEDULE_FIELDS, WIRE_SCHEDULE_FIX_FIELDS, WIRE_SCHEDULE_FIX_REQUEST_FIELDS, WIRE_SCHEDULE_ISSUE_CODES, WIRE_SCHEDULE_LIST_FIELDS, WIRE_SCHEDULE_PENDING_FIELDS, WIRE_SCHEDULE_RECORDING_FIELDS, WIRE_SCHEDULE_ROW_FIELDS, WIRE_SCHEDULE_RUNS_FIELDS, WIRE_SCHEDULE_RUN_FIELDS, WIRE_SCHEDULE_SAVE_FIELDS, WIRE_SECURITY_FIELDS, WIRE_SECURITY_WORKSPACE_FIELDS, WIRE_SEND_MESSAGE_FIELDS, WIRE_SEND_MESSAGE_RESPONSE_FIELDS, WIRE_SESSION_CANDIDATES_FIELDS, WIRE_SESSION_CANDIDATE_FIELDS, WIRE_SESSION_FINISH_FIELDS, WIRE_SESSION_LIST_FIELDS, WIRE_SESSION_REFERENCE_FIELDS, WIRE_SESSION_RESPONSE_FIELDS, WIRE_SESSION_SUMMARY_FIELDS, WIRE_SESSION_WORKSPACE_FIELDS, WIRE_SESSION_WORKSPACE_RESPONSE_FIELDS, WIRE_SETTINGS_FIELDS, WIRE_SETTINGS_WRITE_FIELDS, WIRE_SETTINGS_WRITE_REQUEST_FIELDS, WIRE_SETTING_ROW_FIELDS, WIRE_SETTING_STEP_FIELDS, WIRE_SETTING_WRITE_FIELDS, WIRE_SETTING_WRITE_LAYERS, WIRE_SKILL_BODY_FIELDS, WIRE_SKILL_FIELDS, WIRE_SKILL_IMPORT_FIELDS, WIRE_SKILL_IMPORT_PREVIEW_FIELDS, WIRE_TASKS_FIELDS, WIRE_TOOLS_FIELDS, WIRE_TOOL_GATE_FIELDS, WIRE_TOOL_ROW_FIELDS, WIRE_WORKSPACE_DIFF_FIELDS, WIRE_WORKSPACE_DIRS_FIELDS, WIRE_WORKSPACE_DIR_ENTRY_FIELDS, WIRE_WORKSPACE_REF_FIELDS, apiKeyEnvVar, assertNeverPart, assistantTurnText, attachSessionSurface, chordId, collectPendingApprovals, compressionThresholdTokens, conformsToWire, contentToText, diagnosticToLine, extractAllMentions, extractMentions, extractSessionMentions, filePartSummary, flattenCatalog, getProviderInfo, hasFailure, isApprovalOutcome, isContextNearlyFull, isHeadlessInputFormat, isHeadlessLifecycleEvent, isHeadlessOutputFormat, isKeyAction, isLang, isMentionableFilePath, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, isQuestionAnswerMap, isSearchProviderType, isValidAgentRoleName, isValidCommandName, isWireGoalPhase, isWireHubEvent, isWirePlanAction, isWireRewindScope, isWireSettingWriteLayer, makeTranslate, normalizeApproval, packSessionSurface, parseChord, parseModelRef, parseSequence, perAction, placeholdersOf, promptTokens, sequenceId, sessionPartSummary, stripSystemNote, systemNote, tableOf, totalUsageTokens, translatorFor, turnDigest, unfixedRules, utf8ByteLength, wireFields };
1700
+ export { ACTION_CONTEXTS, AGENT_ROLE_NAME_PATTERN, API_KEY_ENV_VARS, APPROVAL_OUTCOMES, COMMAND_NAME_PATTERN, COMPLIANCE_ACTIONS, COMPLIANCE_CATEGORIES, DEFAULT_AGENT_ROLE, DEFAULT_LANG, DiagnosticSink, GEN_AI, HEADLESS_INPUT_EVENT_TYPES, HEADLESS_INPUT_FORMATS, HEADLESS_OUTPUT_FORMATS, HEADLESS_PROTOCOL_VERSION, KEY_ACTIONS, LANGS, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_HEADER_CHARS, MAX_OPTIONS, MAX_QUESTIONS, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, MCP_DATA_KEY_NAME, METRIC, MIN_OPTIONS, NOOP_TELEMETRY, OPERATION_TYPES, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, RESERVED_CHORDS, RESERVED_COMMAND_NAMES, SCHEDULE_INTERVAL_MINUTES, SCHEDULE_RUN_STATUSES, SCHEDULE_TEMPLATES, SEARCH_API_KEY_ENV, SEARCH_PROVIDER_TYPES, SECRET_SERVICE, SEQUENCE_CONTEXTS, SESSION_MENTION_PREFIX, SESSION_REFERENCE_ERROR_CODES, SHELL_KINDS, SIDEBAR_MENU_MESSAGE_TYPE, SIMULTANEOUS_CONTEXTS, SYSTEM_NOTE_PREFIX, ToolExposure, WIRE_ABORT_FIELDS, WIRE_ABOUT_FIELDS, WIRE_AGENT_ROLE_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_REQUEST_FIELDS, WIRE_APPROVAL_CACHE_REVOKE_RESPONSE_FIELDS, WIRE_APPROVAL_LIST_FIELDS, WIRE_APPROVAL_ROW_FIELDS, WIRE_ARTIFACTS_FIELDS, WIRE_AUDIT_LOG_FIELDS, WIRE_AUDIT_ROW_FIELDS, WIRE_AUTH_COOKIE, WIRE_AUTH_COOKIE_ATTRS, WIRE_AUTH_TOKEN_PARAM, WIRE_BACKGROUND_TASK_FIELDS, WIRE_BLOCKED_GOALS_FIELDS, WIRE_BLOCKED_GOAL_FIELDS, WIRE_BLOCKED_LEVEL_FIELDS, WIRE_BUILTIN_CONNECTOR_FIELDS, WIRE_CACHED_APPROVAL_FIELDS, WIRE_CAPABILITIES_FIELDS, WIRE_CAPABILITY_PROJECT_FIELDS, WIRE_CHECKPOINT_LIST_FIELDS, WIRE_CHECKPOINT_SUMMARY_FIELDS, WIRE_COMMANDS_FIELDS, WIRE_COMMAND_EXPANSION_FIELDS, WIRE_COMPACT_FIELDS, WIRE_COMPRESSION_LINE_FIELDS, WIRE_CONFIG_FIELDS, WIRE_CONTEXT_FIELDS, WIRE_CREATE_SESSION_FIELDS, WIRE_CREATE_WORKSPACE_FIELDS, WIRE_CREATE_WORKSPACE_RESPONSE_FIELDS, WIRE_CUSTOM_COMMAND_FIELDS, WIRE_DELETE_SESSION_FIELDS, WIRE_DIFF_FILE_FIELDS, WIRE_ERROR_FIELDS, WIRE_FILE_CANDIDATES_FIELDS, WIRE_FILE_CANDIDATE_FIELDS, WIRE_FILE_CHANGE_FIELDS, WIRE_FILE_OPEN_RESPONSE_FIELDS, WIRE_FILE_REFERENCE_FIELDS, WIRE_FILE_STAT_MAX, WIRE_FILE_STAT_OK_FIELDS, WIRE_FILE_STAT_REFUSED_FIELDS, WIRE_FILE_STAT_RESPONSE_FIELDS, WIRE_FILE_TEXT_RESPONSE_FIELDS, WIRE_GOAL_ACTIONS, WIRE_GOAL_BLOCK_FIELDS, WIRE_GOAL_CLEAR_FIELDS, WIRE_GOAL_CREATE_FIELDS, WIRE_GOAL_FIELDS, WIRE_GOAL_LIMITS_FIELDS, WIRE_GOAL_PHASES, WIRE_GOAL_REFUSALS, WIRE_GOAL_RESPONSE_FIELDS, WIRE_GOAL_WRITE_FIELDS, WIRE_HEALTH_FIELDS, WIRE_IMAGE_REFERENCE_FIELDS, WIRE_KNOWN_WORKSPACE_FIELDS, WIRE_LANG_PARAM, WIRE_MANAGED_LOCK_FIELDS, WIRE_MCP_ADD_FIELDS, WIRE_MCP_ADD_RESPONSE_FIELDS, WIRE_MCP_APPLY_ENTRY_FIELDS, WIRE_MCP_APPLY_RESPONSE_FIELDS, WIRE_MCP_CONFIG_APPLY_FIELDS, WIRE_MCP_CONFIG_FIELDS, WIRE_MCP_CONFIG_ISSUE_FIELDS, WIRE_MCP_CONFIG_SAVE_FIELDS, WIRE_MCP_CONFIG_SAVE_RESPONSE_FIELDS, WIRE_MCP_CONNECTOR_FIELDS, WIRE_MCP_RECONNECT_FIELDS, WIRE_MESSAGE_LIST_FIELDS, WIRE_MODEL_FIELDS, WIRE_MODEL_SELECTION_FIELDS, WIRE_MODEL_SET_FIELDS, WIRE_MODEL_SUGGESTIONS_FIELDS, WIRE_PATCH_SESSION_FIELDS, WIRE_PATCH_SESSION_RESPONSE_FIELDS, WIRE_PERMISSION_RULE_FIELDS, WIRE_PERMISSION_SET_REQUEST_FIELDS, WIRE_PERMISSION_SET_RESPONSE_FIELDS, WIRE_PERMISSION_SHADOW_FIELDS, WIRE_PERMISSION_STATE_FIELDS, WIRE_PERMISSION_STATUS_FIELDS, WIRE_PLAN_ACTIONS, WIRE_PLAN_FIELDS, WIRE_PLAN_MODE_REQUEST_FIELDS, WIRE_PLAN_MODE_RESPONSE_FIELDS, WIRE_PLAN_MODE_STATE_FIELDS, WIRE_PLUGINS_FIELDS, WIRE_PLUGIN_ACTION_FIELDS, WIRE_PLUGIN_INSTALL_FIELDS, WIRE_PLUGIN_NAME_FIELDS, WIRE_PLUGIN_PREVIEW_FIELDS, WIRE_PLUGIN_PREVIEW_RESPONSE_FIELDS, WIRE_PLUGIN_UPDATE_FIELDS, WIRE_POLICY_DIR_FIELDS, WIRE_POLICY_STATUS_FIELDS, WIRE_PROVIDERS_FIELDS, WIRE_PROVIDER_KEY_FIELDS, WIRE_PROVIDER_MODELS_FIELDS, WIRE_PROVIDER_OPTION_FIELDS, WIRE_QUESTION_LIST_FIELDS, WIRE_QUESTION_ROW_FIELDS, WIRE_RESPOND_APPROVAL_FIELDS, WIRE_RESPOND_APPROVAL_RESPONSE_FIELDS, WIRE_RESPOND_QUESTION_FIELDS, WIRE_RESPOND_QUESTION_RESPONSE_FIELDS, WIRE_REWIND_FILE_PLAN_FIELDS, WIRE_REWIND_OUTCOME_FIELDS, WIRE_REWIND_PREVIEW_FIELDS, WIRE_REWIND_REQUEST_FIELDS, WIRE_REWIND_RESPONSE_FIELDS, WIRE_REWIND_SCOPES, WIRE_ROLE_ADD_FIELDS, WIRE_ROLE_ADD_RESPONSE_FIELDS, WIRE_SANDBOX_STATUS_FIELDS, WIRE_SCHEDULE_CAPABILITY_FIELDS, WIRE_SCHEDULE_CREATE_FIELDS, WIRE_SCHEDULE_DEFAULTS_FIELDS, WIRE_SCHEDULE_DELETE_FIELDS, WIRE_SCHEDULE_FIELDS, WIRE_SCHEDULE_FIX_FIELDS, WIRE_SCHEDULE_FIX_REQUEST_FIELDS, WIRE_SCHEDULE_ISSUE_CODES, WIRE_SCHEDULE_LIST_FIELDS, WIRE_SCHEDULE_PENDING_FIELDS, WIRE_SCHEDULE_RECORDING_FIELDS, WIRE_SCHEDULE_ROW_FIELDS, WIRE_SCHEDULE_RUNS_FIELDS, WIRE_SCHEDULE_RUN_FIELDS, WIRE_SCHEDULE_SAVE_FIELDS, WIRE_SECURITY_FIELDS, WIRE_SECURITY_WORKSPACE_FIELDS, WIRE_SEND_MESSAGE_FIELDS, WIRE_SEND_MESSAGE_RESPONSE_FIELDS, WIRE_SESSION_CANDIDATES_FIELDS, WIRE_SESSION_CANDIDATE_FIELDS, WIRE_SESSION_FINISH_FIELDS, WIRE_SESSION_LIST_FIELDS, WIRE_SESSION_REFERENCE_FIELDS, WIRE_SESSION_RESPONSE_FIELDS, WIRE_SESSION_SUMMARY_FIELDS, WIRE_SESSION_WORKSPACE_FIELDS, WIRE_SESSION_WORKSPACE_RESPONSE_FIELDS, WIRE_SETTINGS_FIELDS, WIRE_SETTINGS_WRITE_FIELDS, WIRE_SETTINGS_WRITE_REQUEST_FIELDS, WIRE_SETTING_ROW_FIELDS, WIRE_SETTING_STEP_FIELDS, WIRE_SETTING_WRITE_FIELDS, WIRE_SETTING_WRITE_LAYERS, WIRE_SKILL_BODY_FIELDS, WIRE_SKILL_FIELDS, WIRE_SKILL_IMPORT_FIELDS, WIRE_SKILL_IMPORT_PREVIEW_FIELDS, WIRE_SKILL_REMOVE_FIELDS, WIRE_TASKS_FIELDS, WIRE_TOOLS_FIELDS, WIRE_TOOL_GATE_FIELDS, WIRE_TOOL_ROW_FIELDS, WIRE_WORKSPACE_DIFF_FIELDS, WIRE_WORKSPACE_DIRS_FIELDS, WIRE_WORKSPACE_DIR_ENTRY_FIELDS, WIRE_WORKSPACE_REF_FIELDS, apiKeyEnvVar, assertNeverPart, assistantTurnText, attachSessionSurface, chordId, collectPendingApprovals, compressionThresholdTokens, conformsToWire, contentToText, diagnosticToLine, extractAllMentions, extractMentions, extractSessionMentions, filePartSummary, flattenCatalog, getProviderInfo, hasFailure, isApprovalOutcome, isContextNearlyFull, isHeadlessInputFormat, isHeadlessLifecycleEvent, isHeadlessOutputFormat, isKeyAction, isLang, isMentionableFilePath, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, isQuestionAnswerMap, isSearchProviderType, isValidAgentRoleName, isValidCommandName, isWireGoalPhase, isWireHubEvent, isWirePlanAction, isWireRewindScope, isWireSettingWriteLayer, makeTranslate, normalizeApproval, packSessionSurface, parseChord, parseModelRef, parseSequence, perAction, placeholdersOf, promptTokens, sequenceId, sessionPartSummary, stripSystemNote, systemNote, tableOf, totalUsageTokens, translatorFor, turnDigest, unfixedRules, utf8ByteLength, wireFields };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/protocol",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "epoch-agent 契约层:工具 / 事件 / 权限 / 插件的类型定义,零运行时依赖",
6
6
  "repository": {