@epoch-agent/core 0.10.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ToolProvider, EpochTool, EpochPlugin, ToolExposure, EpochSkill, HookType, EpochHook, PluginContext, QuestionRequest, QuestionAnswer, AgentRole, PermissionLevel, PermissionManager as PermissionManager$1, PlanProposal, ApprovalRequest, ApprovalReply, ScheduleDefinition, DiagnosticSink, AgentRoleSource, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, BackgroundTaskInfo, ContextBreakdown, EpochMessage, AgentRoleScope, Lang, WireMcpConnector, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, ProviderType, JsonSchema, ModelSelection, EpochToolCall, Telemetry, HookManager as HookManager$1, EpochUserContent, EpochContentPart, AgentEvent, SelectionContext, SetSelectionResult, MoneyDigits, CurrencyDisplay, PermissionRuleLists, KeybindingTable, Diagnostic, KeybindingReport, FileOmitReason, SessionOmitReason, EpochToolResult, EpochTurnFacts, LocalizedDetail, OperationType, RuleValue, Operation, ApprovalOutcome, PermissionDecision, ScheduleTrigger, ScheduleAllowlist, ScheduleBackendKind, ScheduleRunStatus, ScheduleRun, SchedulePendingApproval, ScheduleDraft, ScheduleWideningKind, WireAgentEvent, WireAgentEnvelope, ScheduleRunnerSpec, HookEvent, LogFn, HookRegistration, HookHandler, HookContext, VerifyResult, EpochFilePart, EpochSessionPart, MentionSet, EpochImagePart, TrustExecGrant, DecidedTrustLevel, TrustScope, TrustGrant, TrustRecord } from '@epoch-agent/protocol';
1
+ import { ToolProvider, EpochTool, EpochPlugin, ToolExposure, EpochSkill, HookType, EpochHook, PluginContext, QuestionRequest, QuestionAnswer, AgentRole, PermissionLevel, PermissionManager as PermissionManager$1, PlanProposal, ApprovalRequest, ApprovalReply, ScheduleDefinition, DiagnosticSink, AgentRoleSource, Lang, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, BackgroundTaskInfo, ContextBreakdown, EpochMessage, AgentRoleScope, WireMcpConnector, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, ProviderType, JsonSchema, ModelSelection, EpochToolCall, Telemetry, HookManager as HookManager$1, EpochUserContent, EpochContentPart, AgentEvent, SelectionContext, SetSelectionResult, MoneyDigits, CurrencyDisplay, PermissionRuleLists, KeybindingTable, Diagnostic, KeybindingReport, FileOmitReason, SessionOmitReason, EpochToolResult, EpochTurnFacts, LocalizedDetail, OperationType, RuleValue, Operation, ApprovalOutcome, PermissionDecision, ScheduleTrigger, ScheduleAllowlist, ScheduleBackendKind, ScheduleRunStatus, ScheduleRun, SchedulePendingApproval, ScheduleDraft, ScheduleWideningKind, WireAgentEvent, WireAgentEnvelope, ScheduleRunnerSpec, HookEvent, LogFn, HookRegistration, HookHandler, HookContext, VerifyResult, EpochFilePart, EpochSessionPart, MentionSet, EpochImagePart, TrustExecGrant, DecidedTrustLevel, TrustScope, TrustGrant, TrustRecord } from '@epoch-agent/protocol';
2
2
  export { API_KEY_ENV_VARS, AgentEvent, AgentEventOf, AgentEventType, ApprovalAnswer, ApprovalOutcome, ApprovalReply, ApprovalRequest, BudgetBreach, COMPLIANCE_ACTIONS, COMPLIANCE_CATEGORIES, ComplianceAction, ComplianceCategory, DecidedTrustLevel, EpochConfig, EpochHook, EpochPlugin, EpochSkill, EpochTool, FinishReason, HookContext, HookEvent, HookHandler, HookRegistration, HookType, HookManager as IHookManager, PermissionManager as IPermissionManager, TrustManager as ITrustManager, JsonSchema, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, OPERATION_TYPES, Operation, OperationType, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, PermissionDecision, PermissionLevel, PlanApprovalOutcome, PlanProposal, PluginContext, ProviderInfo, ProviderType, TokenUsage, ToolContext, ToolDefinition, ToolExposure, ToolResult, TrustExecGrant, TrustGrant, TrustLevel, TrustRecord, TrustScope, TrustTier, VerifyResult, apiKeyEnvVar, extractAllMentions, extractMentions, extractSessionMentions, getProviderInfo, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, normalizeApproval } from '@epoch-agent/protocol';
3
3
  import { IsolationBackend, SqliteDatabase, ParseIssue, ShellFlavor } from '@epoch-agent/infra';
4
4
  export { BubblewrapOptions, DangerMatch, IS_WINDOWS, IsolationBackend, IsolationOptions, LogLevel, SeatbeltOptions, WINDOWS_HIDE_FLAGS, buildBwrapArgs, buildProfile, checkDangerousCommand, checkObfuscation, createLogger, detectBackend, getDefaultShell, getPythonCommand, isInWorkspace, isReadOnlyCommand, isolate, maskApiKey, probeBubblewrap, probeSeatbelt, complianceDir as resolveComplianceDir, policiesDir as resolvePoliciesDir, setLogLevel } from '@epoch-agent/infra';
@@ -3730,6 +3730,110 @@ interface RoleCreateOptions {
3730
3730
  */
3731
3731
  declare function createRoleFile(input: RoleCreateInput, opts: RoleCreateOptions): RoleCreateOutcome;
3732
3732
 
3733
+ /**
3734
+ * 删掉一份用户级角色定义文件 —— [create.ts](./create.ts) 的反向那一条。
3735
+ *
3736
+ * ```
3737
+ * removeRoleFile('reviewer', {dir})
3738
+ * → ~/.epoch/agents/<那一份>.md 没了 (或者一句「为什么一个字节都没删」)
3739
+ * ```
3740
+ *
3741
+ * 起因和技能那条逐字相同:**能加就得能删**。能力页身份那一栏 2026-08-18 长出了
3742
+ * 「新建」,而拿掉一个建错的身份得让用户自己去 `~/.epoch/agents/` 里翻目录 ——
3743
+ * 而那一份里的 `description` 是**无条件进每一轮** `delegate_task` 工具描述的
3744
+ * (判据在 protocol 的 `wire-agent-role.ts` 文件头第一节)。
3745
+ *
3746
+ * ## 一、⚠️ 落点靠**读口解析出来的 `name`** 找,不是 `join(dir, name + '.md')`
3747
+ *
3748
+ * 这是这一层唯一守得住、也唯一会说谎的那一道。
3749
+ *
3750
+ * [loader.ts](./loader.ts) 里那行逐字写着「没写 name 就用文件名(`explore.md` →
3751
+ * `explore`)」—— **反过来说,写了 `name` 的那一份,文件叫什么都行**。
3752
+ * `my-helper.md` 里写一句 `name: reviewer`,界面上那一行就叫 `reviewer`,
3753
+ * 而盘上没有任何一个 `reviewer.md`。
3754
+ *
3755
+ * 于是按名字拼路径有两种错法,**两种都不会报错**:
3756
+ *
3757
+ * | 盘上 | 拼出来的 `reviewer.md` | 结果 |
3758
+ * | ---- | ---------------------- | ---- |
3759
+ * | 只有 `my-helper.md`(`name: reviewer`) | 不存在 | 删不掉一份界面上明明列着的身份 |
3760
+ * | 还有一个 `reviewer.md`(`name: 别的`) | 存在 | **删掉了另一个身份**,而屏幕上说「已删除 reviewer」 |
3761
+ *
3762
+ * 所以这里扫目录 → 逐份走**读口自己那份解析器**(`parseRoleDefinition`,
3763
+ * 不碰 fs,`create.ts` 落盘前用的也是它)→ 按**解析出来的 name** 匹配。
3764
+ * 精神同 `create.ts` 第二节那条「写下去的一定读得回来」:**不猜,问读口**。
3765
+ *
3766
+ * ## 二、匹配到两份就一个字节都不删
3767
+ *
3768
+ * 同一个目录里两份 md 都写着 `name: reviewer` 是合法的(loader 不拦,
3769
+ * 后读到的那份赢)。这时候「删掉 reviewer」没有唯一答案:
3770
+ *
3771
+ * - 删生效的那一份 → 另一份浮上来,界面上那一行**还在**,看着像没删掉;
3772
+ * - 两份都删 → 删掉了一份用户没提过的文件。
3773
+ *
3774
+ * 所以报 `ambiguous` 并把那几条路径列出来,让用户自己去目录里处理。
3775
+ * 这一档**极罕见**,但它的两种错法都是静默的,而「不动」是唯一可恢复的那一支。
3776
+ *
3777
+ * ## 三、⚠️ 「这个名字是不是用户级的」不在这一层判
3778
+ *
3779
+ * 那要查**合并之后那张表**(内置 / 插件 / 宿主 / 项目四层这一层都够不着),
3780
+ * 落点在 `runtime/src/role-write.ts`。判据同 `create.ts` 第三节那条撞名:
3781
+ * 谁知道答案谁回答,不知道的那一层不许猜一个。
3782
+ *
3783
+ * 这一层守的是另外两样,**每一样都只有它守得住**:落点是解析出来的那一份、
3784
+ * 以及落点唯一。
3785
+ */
3786
+
3787
+ /**
3788
+ * 一次删除为什么没成。
3789
+ *
3790
+ * - `not-found` —— 这个目录里没有哪一份定义着这个名字。**它和「界面上那一行
3791
+ * 是别的层来的」不是同一件事**,后者由调用方先拦(见文件头第三节);
3792
+ * - `ambiguous` —— 两份以上都叫这个名字,一个字节都没删(文件头第二节);
3793
+ * - `failed` —— 真的删不动(权限 / 只读盘)。分出来是因为下一步不同:
3794
+ * 前两档改的是「删哪一个」,这一档得去那个目录那儿看一眼。
3795
+ */
3796
+ type RoleRemoveFailure = 'not-found' | 'ambiguous' | 'failed';
3797
+ /**
3798
+ * 删掉之后的结局。
3799
+ *
3800
+ * ⚠️ `path` 是**刚被销毁的那一份**,不是拿名字拼出来的 —— 不可撤销的动作,
3801
+ * 回执得说得出销毁的是盘上哪一处(判据同 `SkillSystem.delete` 为什么改成回
3802
+ * 一个 string)。而在这条路上它还多一层意思:文件名可以和身份名不一样,
3803
+ * 用户看到的那条路径是他**唯一**能核对「我删的是不是那一份」的东西。
3804
+ */
3805
+ type RoleRemoveOutcome = {
3806
+ ok: true;
3807
+ path: string;
3808
+ } | {
3809
+ ok: false;
3810
+ reason: RoleRemoveFailure;
3811
+ detail: string;
3812
+ };
3813
+ interface RoleRemoveOptions {
3814
+ /**
3815
+ * 在哪个目录里找。**调用方给,这一层不去算** —— 判据逐字同
3816
+ * `RoleCreateOptions.dir`:`EPOCH_HOME` / profile 两档下它不是 `~/.epoch/agents`。
3817
+ */
3818
+ dir: string;
3819
+ /**
3820
+ * 三句 `detail` 用哪个语言说(方案 58)。不给 = 进程语言。
3821
+ *
3822
+ * ⚠️ **必须能从网线那一侧递进来**:这三句(找不到 / 两份都叫这个 / 删不动)
3823
+ * 全在这一层渲染,而它们会原样上屏。不透这一格的话,英文界面上按一次删除
3824
+ * 拿到的是一句中文 —— 这条病 2026-08-18 在导入那一屏上实测见过一次。
3825
+ */
3826
+ lang?: Lang;
3827
+ }
3828
+ /**
3829
+ * 按身份名删掉那一份定义文件。
3830
+ *
3831
+ * 目录不存在 = 这台机器上一个用户级身份都没有,走 `not-found` 那一支 ——
3832
+ * 和「目录在、里头没有这一份」是同一句话,因为用户的下一步一样
3833
+ * (判据同 `loadRoleDir` 里「目录不存在不是错误」那一条)。
3834
+ */
3835
+ declare function removeRoleFile(name: string, opts: RoleRemoveOptions): RoleRemoveOutcome;
3836
+
3733
3837
  /**
3734
3838
  * 角色作用域 —— 把一个角色收窄成它自己的 `ToolProvider`。
3735
3839
  *
@@ -4484,10 +4588,24 @@ declare function loadPlugins(opts: PluginLoadOptions): PluginArtifacts;
4484
4588
  * "version": "1.0.0",
4485
4589
  * "description": "团队约定的三条命令",
4486
4590
  * "author": { "name": "…", "email": "…" },
4487
- * "epochVersion": ">=0.6.0"
4591
+ * "epochVersion": ">=0.6.0",
4592
+ * "displayName": "淘宝批量改价",
4593
+ * "category": "office",
4594
+ * "visibility": "private"
4488
4595
  * }
4489
4596
  * ```
4490
4597
  *
4598
+ * ## 两族格子,别混着读
4599
+ *
4600
+ * | 族 | 谁读它 |
4601
+ * | ----------------------------------------------- | ---------------------------------------- |
4602
+ * | `name` / `version` / `epochVersion` / `author` | **epoch 自己** —— 装不装得上、叫什么 |
4603
+ * | `displayName` / `category` / `icon` / `visibility` / `changelog` | **上传那一屏的预填**,epoch 一个字不读 |
4604
+ * | `description` / `homepage` / `keywords` | 两边都读 |
4605
+ *
4606
+ * 第二族 2026-09-15 加的,判据在它们自己那几格上。要紧的一条:它们是**预填**,
4607
+ * 用户在那一屏上改得动,改了之后发出去的是改后的 —— 包里这一份原地不动。
4608
+ *
4491
4609
  * 文件名放在**插件根**,不学竞品的 `.claude-plugin/` 子目录 —— 多一层目录没带来
4492
4610
  * 任何好处,而「插件根下有没有 `epoch-plugin.json`」是判定「这是不是一个插件」
4493
4611
  * 最省事的问法。
@@ -4550,6 +4668,17 @@ declare const PluginAuthorSchema: z.ZodObject<{
4550
4668
  email: z.ZodOptional<z.ZodString>;
4551
4669
  url: z.ZodOptional<z.ZodString>;
4552
4670
  }, z.core.$strip>;
4671
+ /**
4672
+ * 「谁装得到」的两档。
4673
+ *
4674
+ * ⚠️ **导出它,因为三处要用同一份名单**:这份清单的 {@link ManifestSchema}、
4675
+ * 市场目录条目的 `EntrySchema`(`marketplace.ts`),以及 runtime 那一层把用户
4676
+ * 填的值收窄成这两档的那一处。各写一份字面量的话,它们分家的那天没有任何东西
4677
+ * 会红 —— 而分家的表现是一个在清单里合法的 `visibility` 到了上传那一屏上被
4678
+ * 当成认不得的值落回 `private`。
4679
+ */
4680
+ declare const PLUGIN_VISIBILITY: readonly ["private", "public"];
4681
+ type PluginVisibility = (typeof PLUGIN_VISIBILITY)[number];
4553
4682
  declare const ManifestSchema: z.ZodObject<{
4554
4683
  name: z.ZodString;
4555
4684
  version: z.ZodString;
@@ -4562,7 +4691,24 @@ declare const ManifestSchema: z.ZodObject<{
4562
4691
  epochVersion: z.ZodOptional<z.ZodString>;
4563
4692
  homepage: z.ZodOptional<z.ZodString>;
4564
4693
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
4694
+ displayName: z.ZodOptional<z.ZodString>;
4695
+ category: z.ZodOptional<z.ZodString>;
4696
+ icon: z.ZodOptional<z.ZodString>;
4697
+ changelog: z.ZodOptional<z.ZodString>;
4698
+ visibility: z.ZodCatch<z.ZodOptional<z.ZodEnum<{
4699
+ private: "private";
4700
+ public: "public";
4701
+ }>>>;
4565
4702
  }, z.core.$strip>;
4703
+ /**
4704
+ * 认识的顶层键,用来产出「未知配置项」提示。
4705
+ *
4706
+ * ⚠️ **导出它是为了让那道合并点门禁扫得到**:`PLUGIN_UPLOAD_FIELDS` 里每一格
4707
+ * 都必须在这份名单里(判据在上面那段注释上)。加第八格上传字段而忘了在清单里
4708
+ * 开一格的表现是「作者按文档写了、上传页还是空的」——
4709
+ * 一条会红的用例比一句叮嘱可靠。
4710
+ */
4711
+ declare const PLUGIN_MANIFEST_KEYS: readonly string[];
4566
4712
  type PluginAuthor = z.infer<typeof PluginAuthorSchema>;
4567
4713
  type PluginManifest = z.infer<typeof ManifestSchema>;
4568
4714
  interface ManifestReadOutcome {
@@ -7859,6 +8005,26 @@ interface CompressResult {
7859
8005
  * 让别人的实现编译不过不成比例。缺省按 `false` 读。
7860
8006
  */
7861
8007
  summarySkipped?: boolean;
8008
+ /**
8009
+ * 这一次**原样带过去**的头 / 尾各几条(方案 64 PR-1)。
8010
+ *
8011
+ * `messages` 的形状是 `head + 摘要一条 + tail`,而这两个数说的就是那个
8012
+ * `head.length` 和 `tail.length`。存在的理由是**落库那一步要知道切在哪儿**:
8013
+ * 归档侧要把「中间那一段」标成 `active = 0, compacted = 1` 并在原地插一条摘要行,
8014
+ * 而它手上只有库里的行、没有压缩器的边界(`determineBoundaries` 是按 token
8015
+ * 算的,落库那一层再算一遍必然对不上 —— 判据全文在方案 64 §4.1 第 1 条)。
8016
+ *
8017
+ * ⚠️ **只在能数准的时候给**。清理孤立对(`droppedOrphans > 0`)之后
8018
+ * head / tail 里可能被删掉过消息,那时这两个数和 `messages` 对不上,
8019
+ * **一律不给**。消费侧的规矩是「拿不到就不落库」,
8020
+ * **不是**猜一个数去切 —— 切错了归档掉的就是错的那一段(方案 64 §4.4)。
8021
+ *
8022
+ * 可选(不是必填),理由逐字同上面的 `summarySkipped`:`ContextEngine`
8023
+ * 是嵌入宿主也能自己实现的接口。
8024
+ */
8025
+ carriedHead?: number;
8026
+ /** 同 {@link carriedHead},结尾那一侧 */
8027
+ carriedTail?: number;
7862
8028
  /**
7863
8029
  * 生成这份摘要花掉的 token 与模型 —— **压缩器自己不记账**,交给调用方
7864
8030
  * (AgentLoop 手上才有那次 run 的预算闸门)。summarize 没回 usage 时缺省。
@@ -8623,6 +8789,18 @@ interface AgentConfig {
8623
8789
  workDir?: string;
8624
8790
  /** 模型上下文窗口(用于压缩判定)。默认 128k。 */
8625
8791
  contextLength?: number;
8792
+ /**
8793
+ * 单次模型请求的输出上限,原样递给 provider 的 `maxOutputTokens`。
8794
+ *
8795
+ * **缺省 = 整格不发**,由各家服务端自己的默认值兜底 —— 行为与这一格加进来
8796
+ * 之前逐字节相同。判据全文(以及「为什么不默认套用能力表里那个数」)在
8797
+ * `config/schema.ts` 的同名字段上。
8798
+ *
8799
+ * ⚠️ 别和 `budget.maxTokens` 弄混:那个是**整个会话**的成本闸门
8800
+ * (`cost/budget-guard.ts`),这个是**单次请求**能生成多长。两者量纲不同,
8801
+ * 而它们同名的那半个词已经让人查错过一次方向。
8802
+ */
8803
+ maxOutputTokens?: number;
8626
8804
  /**
8627
8805
  * 预先算好的项目上下文(含工作区信任判定和已加载的指令文件)。
8628
8806
  *
@@ -9039,6 +9217,47 @@ interface RunInput {
9039
9217
  * 伪造的 0;代价是 DB 里的数字口径是「至少这么多」,见 `SessionMeta` 的说明。
9040
9218
  */
9041
9219
  onTurnUsage?: (usage: TokenUsage) => void;
9220
+ /**
9221
+ * 跑到一半时用户插进来的话从哪儿取(2026-09-16)。
9222
+ *
9223
+ * 不给就是今天的行为:这一轮跑完才轮到下一条消息。
9224
+ */
9225
+ steer?: SteerSource;
9226
+ }
9227
+ /**
9228
+ * 「正在跑的这一轮里,用户又说话了吗」——**由宿主实现,引擎只来拉**。
9229
+ *
9230
+ * ## 为什么是回调而不是让 core 自己持有队列
9231
+ *
9232
+ * 队列的主人是宿主,而且**每个宿主的队列规矩都不一样**:`SessionHub` 的队列
9233
+ * 有容量上限、有「所有标签页都断了就丢掉」那条规矩(判据在它的 `drainQueue()`
9234
+ * 上);TUI 的 `queueRef` 两条都没有。把队列搬进 core 就等于把这些规矩也搬进来,
9235
+ * 而 core 够不着「还有没有人在场」这种问题。
9236
+ *
9237
+ * 分层上也只有这一条路走得通:`core` 只许依赖 `protocol` + `infra`
9238
+ * (`check:layers` 守着),它**认不得** `SessionHub`。样板是同一个接口上的
9239
+ * {@link RunInput.onTurnUsage} —— 也是「引擎逐轮回头找宿主」的形状。
9240
+ *
9241
+ * ## 两个方法问的不是同一件事
9242
+ *
9243
+ * `pending()` 只问「该不该多跑一圈」,**不取走**;`take()` 才取。分开是因为
9244
+ * 这一轮已经到 `maxTurns` 时,引擎要的是「知道有,但别取」—— 取走了却不跑,
9245
+ * 那句话就凭空蒸发了(宿主的队列里已经没有它,而引擎也没把它拌进上下文)。
9246
+ * 不取走的话它原样留在队列里,由宿主原来那条「一轮跑完接上下一条」的路接走。
9247
+ *
9248
+ * codex 的同一对方法叫 `has_pending_input()` / `get_pending_input()`
9249
+ * (`codex-rs/core/src/session/turn.rs`),分开的理由逐字相同。
9250
+ */
9251
+ interface SteerSource {
9252
+ /** 有没有人插了话。**不取走** */
9253
+ pending(): boolean;
9254
+ /**
9255
+ * 取走全部待插入的内容,按用户发送的先后。取完之后 {@link pending} 为 `false`。
9256
+ *
9257
+ * 一次取干净而不是一条一条取:两条消息之间没有模型的回答,分两轮送进去
9258
+ * 等于让模型对着第一句先答一遍 —— 而用户连发两条时想要的是「一起看」。
9259
+ */
9260
+ take(): EpochUserContent[];
9042
9261
  }
9043
9262
  interface RunResult {
9044
9263
  response: string;
@@ -9173,6 +9392,32 @@ declare class AgentLoop {
9173
9392
  private rateOf;
9174
9393
  /** 是否已被中止(内部 + 外部 signal 合并判断) */
9175
9394
  private isAborted;
9395
+ /**
9396
+ * 把用户插进来的话取走,拌进 `messages`,并**逐条**发一帧回执
9397
+ * (2026-09-16,判据全文在 `SteerSource` 和 protocol 的 `steer` 事件上)。
9398
+ *
9399
+ * ## 一条消息一帧,不合并
9400
+ *
9401
+ * 合并成一条的话,模型看到的是一段拼起来的文本、而宿主落盘和上屏的是两条 ——
9402
+ * 两侧从此对不上。这个仓库对这种分叉的态度写在 `AgentSession.reloadHistory`
9403
+ * 上(「屏幕上和模型看到的对不上」)。1:1 就没有这个问题。
9404
+ *
9405
+ * 连着两条 `role:'user'` 是这个文件里**已有**的形状 —— 上面那条任务通知在
9406
+ * 第一轮就会紧跟在用户消息后面。
9407
+ *
9408
+ * ## 事件在 push **之后**发
9409
+ *
9410
+ * 这一帧的含义是「模型下一次请求会看见这句话」(protocol 那条注释的原话)。
9411
+ * 先发后 push 的话,中间任何一次抛出都会让那句承诺变成假话 —— 宿主已经把它
9412
+ * 写进库、画上屏,而它根本没进上下文。
9413
+ *
9414
+ * ## `content` 是文本投影,`parts` 才喂模型
9415
+ *
9416
+ * 同这个文件里用户那条消息的装法:`contentToText()` 出来的那份进 `content`
9417
+ * (压缩器 / 审计 / 落盘只看它),原始部件整个挂 `parts`。**base64 绝不进
9418
+ * `content`** —— 它会一路进 sessions.db。
9419
+ */
9420
+ private drainSteer;
9176
9421
  /**
9177
9422
  * 当前上下文预算的构成(方案 25 §2.5 的 `/context`)。
9178
9423
  *
@@ -9277,6 +9522,9 @@ declare class AgentLoop {
9277
9522
  usage?: TokenUsage;
9278
9523
  model?: string;
9279
9524
  ran: boolean;
9525
+ /** 见 {@link CompressResult.carriedHead} —— 落库那一步要用(方案 64 PR-1) */
9526
+ carriedHead?: number;
9527
+ carriedTail?: number;
9280
9528
  }>;
9281
9529
  /**
9282
9530
  * 真正压一次。调用方负责决定「该不该压」。
@@ -9334,6 +9582,34 @@ interface ModelCapability {
9334
9582
  * 缺席 = `false` = 「这个答案是查到的,不用再探」。
9335
9583
  */
9336
9584
  imagesUnknown?: boolean;
9585
+ /**
9586
+ * **`contextLength` 那个数是兜底的,不是查到的**(2026-09-15)。
9587
+ *
9588
+ * ## 它修的是一个**静默失效的配置项**
9589
+ *
9590
+ * `EpochConfig.contextLength` 的定位一直写着「元数据查不到时的回落」
9591
+ * (`agent-session.ts` 的 `autoCompact` 上逐字这么说)。而「查不到」在代码里
9592
+ * 的唯一表达是 `resolveModelCapability` 那个 `catch` —— 它只在这个函数**抛异常**
9593
+ * 时才走,而这个函数的设计恰恰是**永不抛**:第 3 层兜底回一个写死的
9594
+ * `DEFAULT_CONTEXT_LENGTH`。
9595
+ *
9596
+ * 于是那条 `catch` 几乎永远走不到,**用户配的 `contextLength` 静默不生效**。
9597
+ * 2026-09-15 端到端验收实测:配 `4000`,量出来是 `200000`。
9598
+ *
9599
+ * 后果不是「少一个旋钮」:压缩阈值按 200k 算,一个真窗口只有 8k 的自建模型
9600
+ * 会一路聊到撞窗口才报错,而用户明明配对了。这正是仓库那条铁律要防的
9601
+ * ——**一个配了、却不生效的开关,比压根没有这个开关坏得多**。
9602
+ *
9603
+ * ## 为什么是多一格布尔,而不是把 `contextLength` 改成可空
9604
+ *
9605
+ * 判据逐字同上面那个 `imagesUnknown`:可空(或三态)意味着每个读它的人都得
9606
+ * 先判一次,而漏判的那一处会拿到 `undefined` 去做算术 —— `NaN` 比一个偏大的
9607
+ * 默认值坏得多(阈值算出 `NaN`,`isContextNearlyFull` 恒假,压缩**整个不跑**)。
9608
+ * 多一格布尔的话,漏读的那一处行为和这一轮之前逐字节相同。
9609
+ *
9610
+ * 缺席 = `false` = 「这个数是查到的」(静态表或磁盘缓存)。
9611
+ */
9612
+ contextLengthUnknown?: boolean;
9337
9613
  supportsStreaming: boolean;
9338
9614
  supportsPromptCaching: boolean;
9339
9615
  supportsReasoning: boolean;
@@ -11148,6 +11424,7 @@ declare const EpochConfigSchema: z.ZodObject<{
11148
11424
  }>>;
11149
11425
  maxTurns: z.ZodDefault<z.ZodInt>;
11150
11426
  contextLength: z.ZodDefault<z.ZodInt>;
11427
+ maxOutputTokens: z.ZodOptional<z.ZodInt>;
11151
11428
  homeDir: z.ZodDefault<z.ZodString>;
11152
11429
  dbPath: z.ZodDefault<z.ZodString>;
11153
11430
  permission: z.ZodDefault<z.ZodEnum<{
@@ -11225,6 +11502,11 @@ declare const EpochConfigSchema: z.ZodObject<{
11225
11502
  maxAgeDays: z.ZodDefault<z.ZodInt>;
11226
11503
  maxTotalBytes: z.ZodDefault<z.ZodInt>;
11227
11504
  }, z.core.$strip>>;
11505
+ sessions: z.ZodPrefault<z.ZodObject<{
11506
+ autoPrune: z.ZodDefault<z.ZodBoolean>;
11507
+ retentionDays: z.ZodDefault<z.ZodInt>;
11508
+ vacuumAfterPrune: z.ZodDefault<z.ZodBoolean>;
11509
+ }, z.core.$strip>>;
11228
11510
  budget: z.ZodOptional<z.ZodObject<{
11229
11511
  maxCostUsd: z.ZodOptional<z.ZodNumber>;
11230
11512
  maxTokens: z.ZodOptional<z.ZodInt>;
@@ -11280,9 +11562,11 @@ declare const EpochConfigSchema: z.ZodObject<{
11280
11562
  }, z.core.$strip>>;
11281
11563
  search: z.ZodOptional<z.ZodObject<{
11282
11564
  provider: z.ZodOptional<z.ZodEnum<{
11565
+ native: "native";
11283
11566
  tavily: "tavily";
11284
11567
  brave: "brave";
11285
11568
  searxng: "searxng";
11569
+ keyless: "keyless";
11286
11570
  }>>;
11287
11571
  baseUrl: z.ZodOptional<z.ZodString>;
11288
11572
  maxResults: z.ZodOptional<z.ZodInt>;
@@ -11574,7 +11858,7 @@ declare function isSettingWriteLayer(value: string): value is SettingWriteLayer;
11574
11858
  * 安全中心指两件事(「新会话从哪一档起」vs「这个会话此刻哪一档」),
11575
11859
  * 而那正是决定 20 ④ 拆开的那个歧义 —— 记住上一次那一档没有把这个歧义请回来。
11576
11860
  */
11577
- declare const SETTING_WRITE_KEYS: readonly ["model", "maxTurns", "models.utility", "fallback.model", "contextLength", "compression.enabled", "compression.threshold", "memory.memoryCharLimit", "memory.userCharLimit", "memory.indexCharLimit", "budget.maxCostUsd", "budget.maxTokens", "budget.warnAtPercent", "budget.onUnknownPricing", "permission"];
11861
+ declare const SETTING_WRITE_KEYS: readonly ["model", "maxTurns", "models.utility", "fallback.model", "contextLength", "maxOutputTokens", "compression.enabled", "compression.threshold", "memory.memoryCharLimit", "memory.userCharLimit", "memory.indexCharLimit", "budget.maxCostUsd", "budget.maxTokens", "budget.warnAtPercent", "budget.onUnknownPricing", "sessions.autoPrune", "sessions.retentionDays", "sessions.vacuumAfterPrune", "permission"];
11578
11862
  type SettingWriteKey = (typeof SETTING_WRITE_KEYS)[number];
11579
11863
  /** 这个键写得进去吗。名单就是 {@link SETTING_WRITE_KEYS} 本身,别在别处抄一份字面量 */
11580
11864
  declare function isWritableSettingKey(value: string): value is SettingWriteKey;
@@ -12926,6 +13210,20 @@ interface SessionMeta {
12926
13210
  * ⚠️ 它**只许往前走**(写侧一律 `max()`)。见 `SessionDB.insertMessage`。
12927
13211
  */
12928
13212
  updatedAt: Date;
13213
+ /**
13214
+ * 「这一轮开着」的标记 —— 在飞那一轮的**首条消息 id**(会话库 v13,2026-09-16)。
13215
+ *
13216
+ * 轮开始那一刻立起来,收尾时擦掉。所以读到一个非空值只有两种可能:那一轮**此刻
13217
+ * 真在跑**,或者**它没能收尾**(进程被杀 / 崩了 / 机器睡了)。两者由「这个进程
13218
+ * 手上有没有它」区分,而那个问题只有宿主答得出,不是这一层的事。
13219
+ *
13220
+ * ⚠️ 它存在的理由是**没有任何代码来得及跑**的那一档:`kill -9` 之后收尾逻辑
13221
+ * 一行都不执行,所以「中断了」只能在开始那一刻先写下来。判据全文在
13222
+ * `sessions-open-turn-from` 那条迁移上。
13223
+ *
13224
+ * 缺席 = 这段会话没有开着的轮(正常态),以及 v13 之前的所有老库。
13225
+ */
13226
+ openTurnFrom?: number | null;
12929
13227
  endedAt?: Date;
12930
13228
  endReason?: string;
12931
13229
  }
@@ -13114,9 +13412,14 @@ interface SessionManager$1 {
13114
13412
  endSession(id: string, reason?: string): void;
13115
13413
  list(input?: ListSessionsInput): ListSessionsOutput;
13116
13414
  search(input: SearchInput): SearchOutput;
13117
- appendMessage(sessionId: string, msg: AppendMessageInput): void;
13415
+ /** @returns 这条消息的 DB id(按步增量落盘要它,见实现处) */
13416
+ appendMessage(sessionId: string, msg: AppendMessageInput): number;
13118
13417
  /** 累加一轮模型请求的真实用量(方案 42 PR-0)。口径见 `SessionMeta` 的五个 token 列 */
13119
13418
  recordUsage(sessionId: string, usage: TokenUsage): void;
13419
+ /** 把这一轮的账 / 收尾原因挂到已经写下去的那一行上(按步增量落盘,2026-09-16) */
13420
+ attachTurnFacts(sessionId: string, messageId: number, input: Pick<AppendMessageInput, 'turnFacts' | 'finishReason'>): void;
13421
+ /** 立起 / 擦掉「这一轮开着」的标记。见 `SessionMeta.openTurnFrom` */
13422
+ setOpenTurn(sessionId: string, from: number | null): void;
13120
13423
  markObserved(sessionId: string, messageId: number): void;
13121
13424
  /** 最后一条消息的 id(方案 27:检查点开轮时记的水位线) */
13122
13425
  lastMessageId(sessionId: string): number;
@@ -13239,6 +13542,64 @@ declare class SessionManager implements SessionManager$1 {
13239
13542
  updateMeta(id: string, patch: Partial<SessionMeta>): void;
13240
13543
  archive(id: string): void;
13241
13544
  unarchive(id: string): void;
13545
+ /**
13546
+ * 按保留期清理会选中谁(方案 64 PR-4)。**只查不删。**
13547
+ *
13548
+ * 三条选择规则(只删已结束的 / `pinned` 豁免 / 归档的照删)逐条照 hermes,
13549
+ * 判据全文在 {@link SessionDB.pruneCandidates} 上 —— 那三条是安全边界,
13550
+ * 别在调用侧另加一层过滤。
13551
+ */
13552
+ pruneCandidates(input: {
13553
+ olderThanMs: number;
13554
+ archived?: boolean;
13555
+ includePinned?: boolean;
13556
+ }): SessionMeta[];
13557
+ /** 同一个窗口里还有几段**开着**的会话(被那道 `ended_at` 闸挡下的)。只为看得见 */
13558
+ openPruneMatches(input: {
13559
+ olderThanMs: number;
13560
+ includePinned?: boolean;
13561
+ }): number;
13562
+ /** `VACUUM` 能还回来的比例。判据在 {@link SessionDB.freelistRatio} 上 */
13563
+ freelistRatio(): number;
13564
+ /**
13565
+ * 开机时的自动维护(方案 64 PR-4)—— **形状照 hermes 的
13566
+ * `maybe_auto_prune_and_vacuum`**,包括它那条最要紧的性质:**从不抛**。
13567
+ *
13568
+ * ## 「从不抛」是这个方法的第一条约束,不是兜底
13569
+ *
13570
+ * hermes 那句注释逐字是 `Maintenance must never block startup.`
13571
+ * 这里同理:它跑在每次启动的路径上,而清理失败(盘满、库被别的进程独占、
13572
+ * 迁移还没跑完)**一条都不该让 agent 起不来**。所以整个身子包在 try 里,
13573
+ * 失败时如实回一个 `{ error }`,由调用方决定要不要印一行诊断。
13574
+ *
13575
+ * ## 三道节流,各自挡一件事
13576
+ *
13577
+ * | 闸 | 挡的是 |
13578
+ * | ------------------------- | --------------------------------------------- |
13579
+ * | `autoPrune: false`(缺省)| **它整个不跑** —— 判据在 `SessionsSchema` 上 |
13580
+ * | 24 小时 | 每次启动都全表扫一遍(开发时一天启动几十次) |
13581
+ * | VACUUM 的 30 天 + 25% | 一次小清理在密实的大库上触发整库重写 |
13582
+ *
13583
+ * ⚠️ **第一道和后两道不是一回事**:关掉 `autoPrune` 之后手动那条
13584
+ * (`epoch sessions prune`)照常能用,那条路上一道节流都没有 ——
13585
+ * 给用户亲手敲的命令加「你上周刚跑过」说不通。
13586
+ */
13587
+ maybeAutoPrune(opts: {
13588
+ enabled: boolean;
13589
+ retentionDays: number;
13590
+ vacuum: boolean;
13591
+ /** 至多多久跑一次。缺省 24 小时,同 hermes 的 `min_interval_hours: 24` */
13592
+ minIntervalMs?: number;
13593
+ /** VACUUM 自己那道时间节流。缺省 30 天,同 hermes 的 `min_vacuum_interval_days: 30` */
13594
+ minVacuumIntervalMs?: number;
13595
+ /** 注入时钟,用例要拨快 25 小时而不是真等 */
13596
+ now?: () => number;
13597
+ }): {
13598
+ skipped: boolean;
13599
+ pruned: number;
13600
+ vacuumed: boolean;
13601
+ error?: string;
13602
+ };
13242
13603
  /**
13243
13604
  * 真删一段会话(方案 30 §2.2)。**不可撤销**,调用方要先跟用户确认过。
13244
13605
  *
@@ -13267,9 +13628,24 @@ declare class SessionManager implements SessionManager$1 {
13267
13628
  delete(id: string): boolean;
13268
13629
  /** 标记会话结束,记录结束时间和原因 */
13269
13630
  endSession(id: string, reason?: SessionMeta['endReason']): void;
13631
+ /**
13632
+ * @returns 这条消息的 DB id。按步增量落盘(2026-09-16)之后两处要它:
13633
+ * 「在飞那一轮从哪条起」的水位线,以及收尾时把这一轮的账挂到**最后一条
13634
+ * assistant 行**上(`attachTurnFacts`)。老调用方忽略返回值即可。
13635
+ */
13270
13636
  appendMessage(sessionId: string, msg: AppendMessageInput & {
13271
13637
  tokenCount?: number;
13272
- }): void;
13638
+ }): number;
13639
+ /**
13640
+ * 把这一轮的账和收尾原因挂到已经写下去的那一行上。口径与「为什么需要一条
13641
+ * UPDATE」全文在 {@link SessionDB.attachTurnFacts} 上,这一层只是转发。
13642
+ */
13643
+ attachTurnFacts(sessionId: string, messageId: number, input: Pick<AppendMessageInput, 'turnFacts' | 'finishReason'>): void;
13644
+ /**
13645
+ * 立起 / 擦掉「这一轮开着」的标记。判据在 {@link SessionMeta.openTurnFrom} 上,
13646
+ * 一句话:**留着的是异常,清掉的才是正常**。
13647
+ */
13648
+ setOpenTurn(sessionId: string, from: number | null): void;
13273
13649
  /**
13274
13650
  * 累加一轮模型请求的真实用量(方案 42 PR-0)。
13275
13651
  *
@@ -13301,6 +13677,22 @@ declare class SessionManager implements SessionManager$1 {
13301
13677
  * 那不是摘要,是残缺的原文,句子往往截在一半,喂回模型比不给更糟。
13302
13678
  */
13303
13679
  compact(sessionId: string, summarize?: (transcript: string) => Promise<string | null>): Promise<CompactionResult>;
13680
+ /**
13681
+ * 把引擎刚压完的那一次落进库里(方案 64 PR-1)。判据全文在
13682
+ * {@link SessionDB.archiveAndCompact} 上 —— 这一层只是转发,**一个数都不算**。
13683
+ *
13684
+ * 和上面那个 {@link compact} 的分工:那个自己数边界、自己调摘要模型,
13685
+ * 是「你来替我压一次」;这个收的是**已经压完的结果**,是「记下我刚压的那次」。
13686
+ */
13687
+ archiveAndCompact(sessionId: string, input: {
13688
+ summary: string;
13689
+ headCount: number;
13690
+ tailCount: number;
13691
+ watermark: number;
13692
+ }): {
13693
+ archived: number;
13694
+ summaryId: number;
13695
+ } | null;
13304
13696
  /** 有 LLM 就用 LLM,失败则返回 null 让调用方退回大纲 */
13305
13697
  private buildSummary;
13306
13698
  fork(input: ForkInput): Session;
@@ -13643,6 +14035,12 @@ declare class RecentWorkspaces {
13643
14035
  * 让宿主给一个友好名(「我的工作台」),而用户第一次真的在那个目录里干活时
13644
14036
  * 就会走到这个方法 —— 不沿用的话,那个名字在第一次使用的当场就被
13645
14037
  * `basename()` 顶掉了,宿主预置的效果只存在到用户点它之前。
14038
+ *
14039
+ * ⚠️ **比路径走 `samePath()` 而不是 `===`**(2026-09-15 补,判据全文在 infra 的
14040
+ * `samePath` 上)。`resolve()` 不统一盘符大小写,而两种写法在 Windows 上同时流通 ——
14041
+ * 字符串相等的话,「已经在清单里就提到最前」这句话在 `d:\ws` / `D:\ws` 之间不成立:
14042
+ * 同一个项目会在「最近使用」里留下**两行**,而上面那条「沿用已经记着的名字」
14043
+ * 也跟着失效(宿主预置的友好名被 `basename()` 顶掉)。
13646
14044
  */
13647
14045
  remember(dir: string, now: number, name?: string): void;
13648
14046
  /** 从清单里去掉一条。不在清单里是空操作(不写盘) */
@@ -13659,6 +14057,109 @@ declare class RecentWorkspaces {
13659
14057
  private save;
13660
14058
  }
13661
14059
 
14060
+ /**
14061
+ * 「这个项目上次停在哪段会话」的记录(2026-09-14)。
14062
+ *
14063
+ * Web 首屏原来恒是一段刚 `randomUUID()` 出来的空会话 —— 每起一次 `epoch web`
14064
+ * 都要自己去侧栏里把昨天那段翻出来。这份记录让首屏落回**上次停留的那一段**。
14065
+ *
14066
+ * ## 口径是「最后停留」,不是「最近说过话」
14067
+ *
14068
+ * 后者已经有了(`SessionManager.getLatestByCwd()`,`epoch -c` 用的就是它),
14069
+ * 而它答不出这一个问题:翻开一段旧会话看了半天、一个字没发就关掉 ——
14070
+ * 按「最近说过话」接回来的是另一段。所以这份记录由**界面在切会话那一刻**写,
14071
+ * 不从会话库里推。
14072
+ *
14073
+ * ## 三条照抄 {@link RecentWorkspaces}(同一类东西,同一套策略)
14074
+ *
14075
+ * 1. **本机文件,不是服务**(方案 42 §三那条范围闸门):落在 `~/.epoch/last-sessions.json`,
14076
+ * 路径由 infra 的 `lastSessionsPath()` 给。
14077
+ * 2. **写失败不抛。** 记不下来的代价是下次启动开一段新的 —— 让它去挡住主路径
14078
+ * (切会话)是拿次要功能换主要功能。失败原因收进 {@link writeErrors}。
14079
+ * 3. **有上限,且是 LRU。** 一台机器上的项目数没有天然边界,不给配额它就只增不减。
14080
+ *
14081
+ * ## 一处和 `RecentWorkspaces` **不同**:结构对不上时不出声
14082
+ *
14083
+ * 那一份的 load 会为「顶层不是对象 / 版本不认 / 不是数组 / 有几条非法」各留一句诊断。
14084
+ * 这一份只为**真的 I/O 失败**留话,结构问题一律当「还没记过」静静吞掉,判据是
14085
+ * **两者的失败面不一样**:那一份失败了,界面上的「最近使用」菜单会**空着**,
14086
+ * 用户看得见一个本该有东西的地方没东西;这一份失败了,用户得到的是一段新对话 ——
14087
+ * 和「这个项目第一次用」逐字同形,而那本来就是最常见的正常情况。
14088
+ * 为一个和正常情况长得一样的结果在每次启动时印一行黄字,只会教人忽略诊断。
14089
+ *
14090
+ * ⚠️ 那两句留下来的话存的是**闭包不是字符串**,理由逐字同 `workspace/recent.ts`
14091
+ * 的文件头末节:它们要被装配层倒进启动诊断,而启动诊断得能按**这一次请求**的
14092
+ * 语言重放一遍(`GET /api/config?lang=`)。
14093
+ */
14094
+
14095
+ /** 记录里的一行 */
14096
+ interface LastOpenSession {
14097
+ /** 项目根,绝对路径(已 `resolve()`)。同 `sessions.cwd` 的口径 */
14098
+ root: string;
14099
+ /** 这个项目上次停留的会话 id */
14100
+ sessionId: string;
14101
+ /** 记下这一笔的时间(epoch 毫秒)。只用来排 LRU */
14102
+ at: number;
14103
+ }
14104
+ /**
14105
+ * 最多记几个项目。
14106
+ *
14107
+ * 20 同 `MAX_RECENT_WORKSPACES`,而这里的判据不是「菜单里翻得到」(这份记录
14108
+ * 界面上一行都不显示),是**一个人同时在推进的项目数量级**。超了丢最久没碰的
14109
+ * 那个:丢掉的后果是那个项目下次启动开一段新对话,而那个项目本来也几个月没开了。
14110
+ */
14111
+ declare const MAX_LAST_OPEN_SESSIONS = 20;
14112
+ declare class LastOpenSessions {
14113
+ private readonly filePath;
14114
+ private entries;
14115
+ /**
14116
+ * 读取时真的发生了 I/O 失败(文件在、但读不动)。空数组 = 读取正常。
14117
+ *
14118
+ * ⚠️ **结构问题不进这里**,判据在文件头最后一节。每一项是一个还没渲染的闭包。
14119
+ */
14120
+ readonly loadErrors: LocalizedDetail[];
14121
+ /** 写入失败的原因。见文件头第 2 条 —— 写不进去不抛,但也不装作写进去了 */
14122
+ readonly writeErrors: LocalizedDetail[];
14123
+ constructor(filePath?: string);
14124
+ /**
14125
+ * 这个项目上次停在哪段会话;没记过 `null`。
14126
+ *
14127
+ * ⚠️ **它不保证那段会话还在。** 这份文件和会话库是两回事(用户可以在界面上
14128
+ * 删掉一段会话,也可以直接删掉整个 `sessions.db`),存在性由调用方按
14129
+ * **自己那条 404 判据**去查 —— 让这个类去查会话库,等于给「这段会话还在不在」
14130
+ * 造第二个说法。
14131
+ *
14132
+ * ⚠️ **比路径走 `samePath()` 而不是 `===`**(2026-09-15 真机实测补的,判据
14133
+ * 全文在 infra 的 `samePath` 上)。`resolve()` **不统一盘符大小写**,而两种写法
14134
+ * 在 Windows 上同时流通(`process.cwd()` 回 `D:\…`,git bash 的 `$PWD` 是 `d:\…`)——
14135
+ * 字符串相等的话,同一个项目换个大小写报进来就查不到,表现是**首屏又开了一段
14136
+ * 空会话**,和「这个项目第一次用」逐字同形,没人反推得回盘符上去。
14137
+ */
14138
+ get(root: string): string | null;
14139
+ /**
14140
+ * 记一笔「这个项目此刻停在这段会话上」。同一个项目只留最新的一条。
14141
+ *
14142
+ * `now` 由调用方给:这个类不读挂钟,于是用例能断言 LRU 顺序而不用 sleep
14143
+ * (同 `RecentWorkspaces.remember` 那条理由)。
14144
+ *
14145
+ * **值没变就不写盘**:界面每切一次会话报一次,而 React 的 effect 会为
14146
+ * 语言切换之类的事重跑 —— 不比一下的话,一次纯展示层的重渲染会变成一次磁盘写。
14147
+ */
14148
+ remember(root: string, sessionId: string, now: number): void;
14149
+ /** 划掉一个项目的记录。没记过是空操作(不写盘) */
14150
+ forget(root: string): void;
14151
+ private load;
14152
+ /** JSON → 记录。认不出来的一律当没记过,一个字都不说(判据在文件头末节) */
14153
+ private adopt;
14154
+ /**
14155
+ * 原子写入:先写同目录的临时文件再 rename。判据逐字同 `RecentWorkspaces.save()` ——
14156
+ * 写到一半崩溃只会留下一个 `.tmp`,而不是半个 JSON。
14157
+ *
14158
+ * 权限 0o600:这份文件是一张「这台机器上有哪些项目、各自聊到哪段」的清单。
14159
+ */
14160
+ private save;
14161
+ }
14162
+
13662
14163
  /**
13663
14164
  * Policy Engine 类型定义 — 简单策略规则。
13664
14165
  */
@@ -14408,6 +14909,21 @@ declare class PermissionManager implements PermissionManager$1 {
14408
14909
  *
14409
14910
  * 走到这儿的 ask 是规则表判的,所以它和 {@link approvalCacheActive} 同一个答案;
14410
14911
  * 底线那条路不经过这里(它的答复一律记得住)。
14912
+ *
14913
+ * ## ⚠️ 2026-09-16 起它**今天没有产出点**了 —— 留着是有理由的
14914
+ *
14915
+ * `false` 那一侧只在 `bypass` 下出现,而那一档的规则 ask 现在整族塌成放行
14916
+ * ({@link ruleAskActive}),于是走不到这里。`bypass` 下唯一还会弹的是底线的
14917
+ * tier-2 危险命令,而那条路**查缓存**({@link settleUnaskable} 第 3 条),
14918
+ * 它的答复记得住、本来就不经过这个方法。
14919
+ *
14920
+ * 不顺手把 `rememberable` 整条管线拆掉(协议字段 + CLI / TUI / web 三处分支),
14921
+ * 是因为它说的事**没有过时**:「这条判定路径不查缓存,所以那两个出口是空头
14922
+ * 支票」。哪天再长出一条这样的路径(比如某一档只塌一半),它拿来即用;
14923
+ * 而重新发明它的成本是三个宿主各画一遍那两个不该画的出口。
14924
+ *
14925
+ * ⚠️ 所以**别把这个方法删成 `return {}`**:那会让上面那句判据消失,
14926
+ * 下一个人加路径时不会知道这里本来就该问一句。
14411
14927
  */
14412
14928
  private rememberFlag;
14413
14929
  /**
@@ -14460,6 +14976,14 @@ declare class PermissionManager implements PermissionManager$1 {
14460
14976
  * 它们是**配置文件里写下来的策略**,不是弹窗答案,`bypass` 说的是「别问我」
14461
14977
  * 而不是「作废我写下的规则」。
14462
14978
  *
14979
+ * ## ⚠️ 2026-09-16:上一段最后那半句**只对 `deny` 成立**,`ask` 这一族塌了
14980
+ *
14981
+ * 「别问我」和「作废我写下的规则」之间还有第三种东西:一条 `ask` 规则写下来的
14982
+ * 内容**就是「问我」**,所以在这一档下兑现它和作废它是同一件事。塌的判据全文
14983
+ * 在 {@link ruleAskActive} 上(连同「为什么 deny 不跟着塌」)。
14984
+ *
14985
+ * ⚠️ 这不和上一段矛盾,两段管的是同一张表的两个桶:**deny 拦,ask 放**。
14986
+ *
14463
14987
  * ⚠️ **别把这一条推广到别的档位。** `auto` / `default` 下缓存照旧要查:
14464
14988
  * 那几档本来就会弹窗,而缓存存在的全部理由就是别把同一个问题问第二遍。
14465
14989
  *
@@ -14624,7 +15148,8 @@ declare function ruleToString(value: RuleValue): string;
14624
15148
  *
14625
15149
  * 1. **规则轴** —— 三张列表里有没有一条**不带括号**的规则罩着这个工具。
14626
15150
  * 不带括号 = 整个工具、无条件(`RuleValue.content` 的 JSDoc),所以它是
14627
- * 唯一一种「不看参数就能定」的规则;
15151
+ * 唯一一种「不看参数就能定」的规则。
15152
+ * ⚠️ 这一轴**要先看档位**:`bypass` 下 `ask` 桶整个不算数({@link effectiveRules});
14628
15153
  * 2. **档位轴** —— 没有规则命中时 {@link decideByLevel} 怎么判。五档里只有
14629
15154
  * `plan` 和 `bypass` 对所有类型都定得死,其余几档有一半要看参数;
14630
15155
  * 3. **沙箱轴** —— `code_exec` 那一格由 OS 级隔离在与不在拍板,不由档位。
@@ -15173,6 +15698,14 @@ type AcquireResult = {
15173
15698
  ok: false;
15174
15699
  holder: LockHolder | undefined;
15175
15700
  };
15701
+ /** 一条正在跑的任务({@link listRunningSchedules} 的一行) */
15702
+ interface RunningSchedule {
15703
+ scheduleId: string;
15704
+ /** 抢到锁那一刻 —— 界面上那个走秒的数拿它减出来 */
15705
+ startedAt: number;
15706
+ pid: number;
15707
+ host: string;
15708
+ }
15176
15709
  /**
15177
15710
  * 抢一把锁。抢不到时把当前持有者一起回去 —— 记 `skipped-overlap` 那条运行记录
15178
15711
  * 的 `reason` 要写清楚是被谁挡的,否则用户看到的只是「跳过了」。
@@ -15180,6 +15713,23 @@ type AcquireResult = {
15180
15713
  * @param clock 可注入的时钟。用例要造「心跳刚好差一毫秒过期」这种边界
15181
15714
  */
15182
15715
  declare function acquireScheduleLock(db: SqliteDatabase, scheduleId: string, clock?: () => number): AcquireResult;
15716
+ /**
15717
+ * 现在有哪几条任务在跑(2026-09-15)。
15718
+ *
15719
+ * ## 它是「界面上那个转子」的唯一真源,而这不是随手挑的
15720
+ *
15721
+ * 一次到点触发跑在**另一个进程**里(OS 调度器起的执行器),服务进程完全不知道它
15722
+ * 存在 —— SSE 上没有素材。而**手点「先跑一次」和到点触发跑的是同一段执行器、
15723
+ * 抢的是同一把锁**,所以这张表是唯一一处两种来源都记账的地方。
15724
+ *
15725
+ * 换句话说:不查这张表的话,界面只画得出「你在这个标签页里按的那一下」。
15726
+ *
15727
+ * ⚠️ **只读,绝不写。** 过期的行留给下一次 `acquireScheduleLock` 去夺 ——
15728
+ * 一个读端点顺手删别人的锁,是「查询有副作用」里最难查的那一种。
15729
+ *
15730
+ * @param clock 可注入的时钟,同 {@link acquireScheduleLock}
15731
+ */
15732
+ declare function listRunningSchedules(db: SqliteDatabase, clock?: () => number): RunningSchedule[];
15183
15733
 
15184
15734
  /**
15185
15735
  * 触发器的校验、下一次触发时刻、以及生效区间(方案 45 §2.1)。
@@ -15499,6 +16049,45 @@ declare function pruneRecordings(dir: string, opts?: {
15499
16049
  maxBytes?: number;
15500
16050
  keep?: string;
15501
16051
  }): PruneResult;
16052
+ /**
16053
+ * 整个删掉一个任务的录像目录 —— **任务本身被删掉时**调(2026-09-15)。
16054
+ *
16055
+ * ## 和 {@link pruneRecordings} 的分工
16056
+ *
16057
+ * 那一条是**活着的任务**的留存上限(留最近 20 次 / 64 MB),由执行器每轮跑完时调;
16058
+ * 这一条是**任务没了**之后的收尾,一份不留。
16059
+ *
16060
+ * ## 为什么删,而不是「留着」
16061
+ *
16062
+ * 2026-09-15 之前两条删除路径都把它留着,而「留着」在两个意义上都不成立:
16063
+ *
16064
+ * 1. **看不到。** 录像按 run 行上的 `logPath` 找,而 `schedule_runs` 的外键挂着
16065
+ * `ON DELETE CASCADE`(见 `store.ts` 建表那一段)—— 任务一删那些行跟着没,
16066
+ * 于是磁盘上的文件再也没有任何入口指得到它;
16067
+ * 2. **也不释放。** 上面那条留存上限是**跑完时**按任务目录清的,而删掉的任务
16068
+ * 再也不会跑,那个目录就此原地躺着。`doctor --prune` 也不管它 ——
16069
+ * 那一条只撤 OS 侧的孤儿注册。
16070
+ *
16071
+ * CLI 那侧原来还多一句「录像留在 `<dir>/`,要清自己删」,判据写的是
16072
+ * 「一条被误删的任务至少还能从录像里看出它当时在干什么」。那条判据**站不住**:
16073
+ * 级联已经把状态、花费、轮次、欠条全带走了,剩下的是一堆没有索引、没有任务名的
16074
+ * 裸 ndjson。为那个留一个永远不会被回收的目录,代价大于收益。
16075
+ *
16076
+ * ## ⚠️ 删的是录像目录,**调用方别把工作区传进来**
16077
+ *
16078
+ * `~/.epoch/automation/logs/<id>/`(录像)和 `~/.epoch/automation/<id>/`(工作区)
16079
+ * 只差一层,而后者装的是这条任务**跑出来的东西** —— 报告、改过的文件,那是用户的。
16080
+ * 删任务是「以后别再跑了」,不是「把它干过的活也抹掉」。这一条写在这儿是因为
16081
+ * 两个路径长得太像,而删错那个不可逆。
16082
+ *
16083
+ * ## ⚠️ 失败不抛
16084
+ *
16085
+ * 调用方走到这一步时库里那行**已经删掉了**,任务在任何界面上都不存在了。这时候
16086
+ * 抛出去会让它以为「没删成」而去重试一件已经做完的事。而失败有真实成因:
16087
+ * Windows 上正被执行器写着的那个 `.ndjson` 删不动(EBUSY)—— 那时剩一个孤儿目录,
16088
+ * 代价是磁盘上几十 MB,比一句假的「删除失败」轻。
16089
+ */
16090
+ declare function removeRecordings(dir: string): void;
15502
16091
  /**
15503
16092
  * 读回一份录像。坏行**跳过**而不是让整份读不出来 ——
15504
16093
  * NDJSON 按行分帧,跳一行不会失步(同 headless 那条输入路径的处置)。
@@ -15898,6 +16487,30 @@ declare class ScheduleRegistrar {
15898
16487
  * 中间那个窗口里到点了也不会跑),**启用时先改库**(OS 那边启用成功但库里
15899
16488
  * 还写着停用的话,执行器第 1 步会看到 `enabled: false` 然后干净地退 0 ——
15900
16489
  * 表现成「明明启用了却不跑」)。
16490
+ *
16491
+ * ## 🔴 启用 = 「让它到点能跑」,所以 OS 那侧不在就**当场补注册**
16492
+ *
16493
+ * 这一条 2026-09-15 补的,用户那句话点破的:「不能启用就直接能用吗」。
16494
+ *
16495
+ * 在那之前,一条**没注册进 OS** 的任务(`osTaskId` 是空的:当初 `npx` 形态被
16496
+ * 拒过、嵌入宿主当时没给无界面入口、或者用户自己清过 `LaunchAgents`)点「启用」
16497
+ * 只会改库里那一位,然后回一句 `ok: true` —— 界面显示已启用,而它到点根本
16498
+ * 不会被唤起。让用户去「编辑里再保存一次」来触发注册是**实现视角**:保存表单
16499
+ * 会顺带 `register()`,纯属这条路径的巧合,用户没有任何理由知道。
16500
+ *
16501
+ * 所以启用这一支现在有两级兜底,都落在 {@link register} 上(它会重写 plist /
16502
+ * `/F` 覆盖,然后按 `enabled` 把开关摆正):
16503
+ *
16504
+ * 1. 压根没注册过(`osTaskId` 为空)→ 直接注册;
16505
+ * 2. 注册过但翻不动(典型是 `plist-missing`:那个文件被人删了)→ 重新注册。
16506
+ *
16507
+ * ⚠️ **递给 `register()` 的那一份要把 `enabled` 改成 `true`**:它读的是参数上
16508
+ * 那一格(`toRegisterInput`),而调用方手里的 `def` 是**翻之前**那一份 ——
16509
+ * 原样递过去等于刚注册完又立刻把它 disable 掉。
16510
+ *
16511
+ * 停用那一支不这么办,而且刻意不对称:停用**永远写得下库**(`if (!enabled)`
16512
+ * 那一行在 OS 之后无条件执行),而执行器第 1 步读的就是它 —— 所以 OS 那边失败
16513
+ * 顶多留个壳,「到点不会再跑」仍然成立。启用没有这种兜底,它必须真的成。
15901
16514
  */
15902
16515
  setEnabled(def: ScheduleDefinition, enabled: boolean): Promise<RegisterOutcome>;
15903
16516
  /**
@@ -17099,6 +17712,30 @@ declare class SkillSystem implements SkillSystem$1 {
17099
17712
  *
17100
17713
  * 单个字段坏掉也只丢那个字段(`.catch(undefined)`),不影响同一份里的其余字段 ——
17101
17714
  * 一个写歪的 `prerequisites` 不该把 `description` 一起带走。
17715
+ *
17716
+ * ## 不认识的字段:**默认闭嘴**(2026-09-15 改)
17717
+ *
17718
+ * 原来这里是一张闭集白名单,凡是不在表上的顶层键都报一条「未知配置项」进启动
17719
+ * 诊断。那条规矩把一件正常的事变成了告警:Agent Skills 规范自己的允许集是
17720
+ * `name` / `description` / `license` / `allowed-tools` / `metadata` /
17721
+ * `compatibility`,跟我们这 7 个只对得上 3 个,而 `~/.claude/skills` 正是
17722
+ * `skill-import` 那一屏写死的头号来源(见 [import-source.ts](./import-source.ts)
17723
+ * 文件头,那一轮刚把目录布局这一半打通)。于是**导入一份完全合法的别家技能,
17724
+ * 之后每次启动都要挨几行黄字**,而它们一个都不需要用户做任何事。
17725
+ *
17726
+ * 规范原文就是这么要求运行时的:「spec-compliant runtimes ignore frontmatter
17727
+ * keys they do not recognize」。那张闭集表是 Anthropic 给**写技能的人**用的
17728
+ * 校验器(skill-creator 的 `quick_validate.py`),不是给运行时用的 —— 我们抄的
17729
+ * 时候站错了边。
17730
+ *
17731
+ * 所以改成 {@link suggestKey}:**只报看着像拼错的**。`cli_version` /
17732
+ * `license` / `when_to_use` 这些静默忽略,`descriptoin` 照样报。留着这道网是
17733
+ * 因为 `description` 拼错的代价很具体 —— 技能带着空描述加载、从此不会被模型
17734
+ * 选中,而屏幕上一个字都没有。理由全文在 `misspelledKeyIssues` 上。
17735
+ *
17736
+ * ⚠️ 近似匹配的语料**只有下面 schema 里那 7 个**,刻意不含 `license` /
17737
+ * `allowed-tools` / `compatibility`:我们读了也不用它们,对一个不起作用的字段说
17738
+ * 「是不是想写 license」等于承诺它有效果。拼错一个反正会被忽略的字段,后果是零。
17102
17739
  */
17103
17740
 
17104
17741
  interface SkillFrontmatter {
@@ -18867,4 +19504,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
18867
19504
  */
18868
19505
  declare function codeModeWorkerPath(): string | undefined;
18869
19506
 
18870
- export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_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, type AttachmentRetention, BLOCKED_TOOLS, type BackendOptions, type BackendOutcome, type BackgroundTaskSource, type BaseOrigin, type BaseSlot, type BeginTurnInput, type BreakdownInput, BudgetGuard, type BudgetGuardOptions, type BudgetInfo, type BudgetLevel, type BudgetOptions, type BudgetStatus, BudgetStore, type BudgetStoreOptions, type BuildFireArgvInput, type BuildIndexOptions, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, type CachedApproval, type CachedDecision, type CheckpointCapture, type CheckpointFile, CheckpointManager, type CheckpointManagerOptions, type CheckpointManifest, CheckpointStore, type CheckpointStoreOptions, type CheckpointSummary, type ClaudeHooksParseOptions, type CodeModeLimits, type CodeRequest, type CodeResult, CodeSandbox, type CommandHookConfig, type CommandHookResult, type CommandLoadOutcome, type CommandLoadSummary, type CommandResult, type CommandRunner, type CompactionResult, type CompiledRules, type ComplianceDirSpec, type ComplianceDirsSummary, ComplianceEngine, type ComplianceEngineInput, type ComplianceGate, type ComplianceHit, type ComplianceRule, type ComplianceRuleSource, type ComplianceSettings, type ComplianceVerdict, type CompressConfig, type CompressResult, type ConfigMigration, type ConfigOrigins, ContextCompressor, type ContextEngine, type CreateScheduleInput, type CreateSessionInput, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, type DelegateArgs, type DelegateConfig, DelegateManager, type DelegateTaskResult, type DiagnoseOptions, type DiscoverOutcome, type DiscoveredFile, type DoctorReport, type DraftParse, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, type ExpandOptions, type ExtractOutcome, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_DISPLAY_FIELDS, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceDisplay, type MarketplaceDisplayField, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MarketplaceStatus, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PACK_EXCLUDES, PACK_MAX_BYTES, PACK_MAX_FILES, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_NAME_PATTERN, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, POLICY_DECISIONS, PROBE_VERSION, 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 PricingAt, type PricingOverride, type ProjectContext, type ProjectExtensionInventory, 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_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 SelfConnector, type SelfIndexInput, type SelfSettings, 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 SettingApplyFacts, 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, computeExecHash, 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, displayCurrency, draftCommandLine, draftWidening, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, extractArchive, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, 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, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeSessionArtifacts, removeSessionAttachments, renderImportTree, renderProjectContext, renderSdkDeclaration, renderSelfIndex, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolvePricingAt, 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, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, 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 };
19507
+ export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_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, type AttachmentRetention, BLOCKED_TOOLS, type BackendOptions, type BackendOutcome, type BackgroundTaskSource, type BaseOrigin, type BaseSlot, type BeginTurnInput, type BreakdownInput, BudgetGuard, type BudgetGuardOptions, type BudgetInfo, type BudgetLevel, type BudgetOptions, type BudgetStatus, BudgetStore, type BudgetStoreOptions, type BuildFireArgvInput, type BuildIndexOptions, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, type CachedApproval, type CachedDecision, type CheckpointCapture, type CheckpointFile, CheckpointManager, type CheckpointManagerOptions, type CheckpointManifest, CheckpointStore, type CheckpointStoreOptions, type CheckpointSummary, type ClaudeHooksParseOptions, type CodeModeLimits, type CodeRequest, type CodeResult, CodeSandbox, type CommandHookConfig, type CommandHookResult, type CommandLoadOutcome, type CommandLoadSummary, type CommandResult, type CommandRunner, type CompactionResult, type CompiledRules, type ComplianceDirSpec, type ComplianceDirsSummary, ComplianceEngine, type ComplianceEngineInput, type ComplianceGate, type ComplianceHit, type ComplianceRule, type ComplianceRuleSource, type ComplianceSettings, type ComplianceVerdict, type CompressConfig, type CompressResult, type ConfigMigration, type ConfigOrigins, ContextCompressor, type ContextEngine, type CreateScheduleInput, type CreateSessionInput, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, type DelegateArgs, type DelegateConfig, DelegateManager, type DelegateTaskResult, type DiagnoseOptions, type DiscoverOutcome, type DiscoveredFile, type DoctorReport, type DraftParse, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, type ExpandOptions, type ExtractOutcome, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LastOpenSession, LastOpenSessions, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_DISPLAY_FIELDS, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_LAST_OPEN_SESSIONS, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceDisplay, type MarketplaceDisplayField, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MarketplaceStatus, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PACK_EXCLUDES, PACK_MAX_BYTES, PACK_MAX_FILES, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_MANIFEST_KEYS, PLUGIN_NAME_PATTERN, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, PLUGIN_VISIBILITY, POLICY_DECISIONS, PROBE_VERSION, 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 PluginVisibility, type PolicyDirSpec, type PolicyDirsSummary, type PolicyLoadOutcome, type PolicyRule, PolicyRuleSchema, type PricingAt, type PricingOverride, type ProjectContext, type ProjectExtensionInventory, 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 RoleRemoveFailure, type RoleRemoveOptions, type RoleRemoveOutcome, type RoleScope, type RuleMatch, type RuleSuggestion, type RuleVerdict, type RunCodeFailure, type RunCodeInput, type RunCodeOutcome, type RunCodeToolDeps, type RunEstimateInput, type RunInput, type RunResult, type RunningSchedule, 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_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 SelfConnector, type SelfIndexInput, type SelfSettings, 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 SettingApplyFacts, 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 SteerSource, 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, computeExecHash, 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, displayCurrency, draftCommandLine, draftWidening, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, extractArchive, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listRunningSchedules, 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, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeRecordings, removeRoleFile, removeSessionArtifacts, removeSessionAttachments, renderImportTree, renderProjectContext, renderSdkDeclaration, renderSelfIndex, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolvePricingAt, 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, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, 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 };