@epoch-agent/core 0.18.0 → 0.20.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, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, ProviderType, EpochMessage, JsonSchema, ModelSelection, BackgroundTaskInfo, EpochToolCall, Telemetry, HookManager as HookManager$1, Lang, PermissionManager as PermissionManager$1, ApprovalRequest, ApprovalReply, AgentRoleScope, AgentRoleSource, EpochUserContent, EpochContentPart, AgentRole, PermissionLevel, PlanProposal, ScheduleDefinition, DiagnosticSink, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, ContextBreakdown, WireMcpConnector, 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, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, NoticeCode, ProviderType, EpochMessage, JsonSchema, ModelSelection, BackgroundTaskInfo, EpochToolCall, Telemetry, HookManager as HookManager$1, Lang, PermissionManager as PermissionManager$1, ApprovalRequest, ApprovalReply, AgentRoleScope, AgentRoleSource, EpochUserContent, EpochContentPart, AgentRole, PermissionLevel, PlanProposal, ScheduleDefinition, DiagnosticSink, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, ContextBreakdown, WireMcpConnector, 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';
@@ -1983,6 +1983,7 @@ interface BudgetStatus {
1983
1983
  * `5bbf3c8c` 删掉 —— 今天面向用户那半边在
1984
1984
  * [TOOLS.md](../../../../docs/TOOLS.md) 的「待办、目标、记忆、沙箱、委托」一节。)
1985
1985
  */
1986
+
1986
1987
  type MemoryTarget = 'memory' | 'user';
1987
1988
  /** 配额信息 */
1988
1989
  interface BudgetInfo {
@@ -2027,6 +2028,26 @@ interface MemoryEntry {
2027
2028
  updatedAt: Date;
2028
2029
  accessCount: number;
2029
2030
  lastAccessedAt: Date;
2031
+ /**
2032
+ * 命中注入模式(2026-09-28)。
2033
+ *
2034
+ * **原文照留、只遮渲染**:这一行的 `content` 还是用户写的那份,
2035
+ * `flushToDisk()` 也照旧把它写回文件 —— 变的只是四条模型通道
2036
+ * (索引块 / `prefetch` / `search` / `read`)把它换成占位符。
2037
+ * 判据全文在 `MemoryManager.blockedPlaceholder()` 上。
2038
+ */
2039
+ blocked: boolean;
2040
+ }
2041
+ /**
2042
+ * 后台攒下来的一条「给用户看一眼」的通知(2026-09-28)。
2043
+ *
2044
+ * `code` 的取值真源在 protocol 的 `NoticeCode`,这里只挑出记忆这一族的两条 ——
2045
+ * **不重抄那份联合**(判据同 `Diagnostic.module`:契约不是文案)。
2046
+ * 发射方是 `AgentLoop`(在下一轮开头),承载它的那一帧是 `AgentEvent['notice']`。
2047
+ */
2048
+ interface MemoryNotice {
2049
+ code: Extract<NoticeCode, 'memory-blocked' | 'memory-quota'>;
2050
+ text: string;
2030
2051
  }
2031
2052
  interface MemoryConfig {
2032
2053
  /** `MEMORY.md` 能存多少字符。**存储**配额,不进 prompt,抬它几乎不花钱 */
@@ -2064,6 +2085,28 @@ interface MemoryManager$1 {
2064
2085
  memory: BudgetInfo;
2065
2086
  user: BudgetInfo;
2066
2087
  };
2088
+ /**
2089
+ * 取走后台攒下来的通知({@link MemoryNotice}),**出队即清空**(2026-09-28)。
2090
+ *
2091
+ * 发射方是 `AgentLoop`:它每一轮开头发完 `run-start` 之后取一次,把每一条
2092
+ * 折成一帧 `notice` —— 和 `skill-learned` 那一帧同一处(判据在
2093
+ * `loop.ts` 的 `maybeLearn()` 上)。攒的那一步在 `reloadFromDisk()` 里,
2094
+ * 也就是这个会话第一次建 system prompt 时,所以同一轮就发得出去。
2095
+ *
2096
+ * ⚠️ **实现里那句「出队即清空」是有代价的**:被预算闸门拦下的那一轮取不到它,
2097
+ * 于是它留到下一轮 —— 这是对的(那一轮压根没有上下文送出去,
2098
+ * 说「有东西没进上下文」是句空话);但**宿主自己调这个方法**就等于把话吃掉。
2099
+ *
2100
+ * ## ⚠️ 它是**可选**方法,而且是刻意可选的(2026-09-28 当天改的)
2101
+ *
2102
+ * 通知是**尽力而为的旁路**:没实现就等于这个宿主不收那两句话,而模型那一侧的
2103
+ * 遮罩、文件那一侧的原文照旧。让它必填换来的不是安全,是把一批已经存在的宿主
2104
+ * 桩打崩 —— 本仓自己的用例就是这么暴露的:`prompt-rebuild-signature.test.ts`
2105
+ * 那个桩写成 `{ initialize, prefetch, sync } as unknown as MemoryManager`,
2106
+ * 必填的话 `loop.ts` 那一行当场抛 `takeNotices is not a function`,
2107
+ * **整轮跑不动**。拿一轮的可用性去换一句话,代价不成比例。
2108
+ */
2109
+ takeNotices?(): MemoryNotice[];
2067
2110
  reloadFromDisk(): Promise<void>;
2068
2111
  flushToDisk(): Promise<void>;
2069
2112
  close(): void;
@@ -8237,11 +8280,27 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
8237
8280
 
8238
8281
  /** 市场清单的文件名,同插件清单一样放在根 */
8239
8282
  declare const MARKETPLACE_FILE = "epoch-marketplace.json";
8240
- declare const EntrySchema: z.ZodObject<{
8283
+ /**
8284
+ * 条目**解析之后**的形状 —— {@link EntryShape} 走完「分类那一格归一化成数组」的那一份。
8285
+ *
8286
+ * ## ⚠️ 归一化做在**边界上**,不是让每个消费者各自 `?? []`
8287
+ *
8288
+ * 分类那一格写进文件里有两种形状(字符串 / 数组,判据在它那一格上),而下游三处
8289
+ * 消费者(core 的检索面、server 的网线投影、CLI 的打印)要的是同一个结论。
8290
+ * 让它们各自处理那个联合类型的下场是**漏掉一处**:漏掉的那一处不是报错,
8291
+ * 是"那一条少归了几类"—— 屏幕上少一个桶里的一条,一个字不报。
8292
+ *
8293
+ * ⚠️ **空数组和缺席在归一化之后是同一件事**(都没写分类),所以这儿把 `[]`
8294
+ * 也收掉:下游只需要认一种「没有分类」的形状(判据同 `uploadChoiceHas` 那条
8295
+ * 「全仓只有一处判闭集」)。
8296
+ * ⚠️ 返回的是**新数组**(`[...category]`)而不是原来那个引用:解析产物会被缓存
8297
+ * 下来、也可能被下游就地改动,共享一个数组的话,改一处会改到别人手里那一份。
8298
+ */
8299
+ declare const EntrySchema: z.ZodPipe<z.ZodObject<{
8241
8300
  name: z.ZodString;
8242
8301
  description: z.ZodOptional<z.ZodString>;
8243
8302
  source: z.ZodString;
8244
- category: z.ZodOptional<z.ZodString>;
8303
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8245
8304
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8246
8305
  author: z.ZodOptional<z.ZodObject<{
8247
8306
  name: z.ZodString;
@@ -8266,7 +8325,49 @@ declare const EntrySchema: z.ZodObject<{
8266
8325
  reviewing: "reviewing";
8267
8326
  offline: "offline";
8268
8327
  }>>>;
8269
- }, z.core.$strip>;
8328
+ }, z.core.$strip>, z.ZodTransform<{
8329
+ category?: string[] | undefined;
8330
+ name: string;
8331
+ source: string;
8332
+ description?: string | undefined;
8333
+ keywords?: string[] | undefined;
8334
+ author?: {
8335
+ name: string;
8336
+ email?: string | undefined;
8337
+ url?: string | undefined;
8338
+ } | undefined;
8339
+ downloads?: number | undefined;
8340
+ likes?: number | undefined;
8341
+ displayName?: string | undefined;
8342
+ icon?: string | undefined;
8343
+ version?: string | undefined;
8344
+ changelog?: string | undefined;
8345
+ size?: number | undefined;
8346
+ homepage?: string | undefined;
8347
+ visibility?: "private" | "public" | undefined;
8348
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8349
+ }, {
8350
+ name: string;
8351
+ source: string;
8352
+ description?: string | undefined;
8353
+ category?: string | string[] | undefined;
8354
+ keywords?: string[] | undefined;
8355
+ author?: {
8356
+ name: string;
8357
+ email?: string | undefined;
8358
+ url?: string | undefined;
8359
+ } | undefined;
8360
+ downloads?: number | undefined;
8361
+ likes?: number | undefined;
8362
+ displayName?: string | undefined;
8363
+ icon?: string | undefined;
8364
+ version?: string | undefined;
8365
+ changelog?: string | undefined;
8366
+ size?: number | undefined;
8367
+ homepage?: string | undefined;
8368
+ visibility?: "private" | "public" | undefined;
8369
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8370
+ }>>;
8270
8371
  /**
8271
8372
  * 市场说了算的那几格「要不要印在屏幕上」(2026-09-10)。
8272
8373
  *
@@ -8298,8 +8399,9 @@ declare const DisplaySchema: z.ZodObject<{
8298
8399
  *
8299
8400
  * ## ⚠️ 条目那一侧引用的是**裸 id**,不是一条 `办公/表格` 那样的路径
8300
8401
  *
8301
- * 也就是说 {@link EntrySchema} 的 `category` **一个字都没改** —— 它今天是什么形状
8302
- * 明天还是什么形状,变的只是「那串字符现在可以被这棵树放进层级里」。两条判据:
8402
+ * 也就是说 {@link EntrySchema} 的 `category` 里装的**仍旧是一串 id**(2026-09-28 起
8403
+ * 是**好几个** id),不是一条 `办公/表格` 那样的路径 —— 变的只是「那些字符现在
8404
+ * 可以被这棵树放进层级里」。两条判据:
8303
8405
  *
8304
8406
  * 1. **存量目录加一棵树不用动任何一条插件。** 一份写着 `category: "dev"` 的目录,
8305
8407
  * 只要在顶上补一个 `{ "id": "dev", "label": "开发" }`,那一批条目当场归位。
@@ -8331,11 +8433,11 @@ declare const CatalogSchema: z.ZodObject<{
8331
8433
  fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
8332
8434
  }, z.core.$strip>>;
8333
8435
  categories: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodType<MarketplaceCategoryInput, unknown, z.core.$ZodTypeInternals<MarketplaceCategoryInput, unknown>>>>>;
8334
- plugins: z.ZodArray<z.ZodObject<{
8436
+ plugins: z.ZodArray<z.ZodPipe<z.ZodObject<{
8335
8437
  name: z.ZodString;
8336
8438
  description: z.ZodOptional<z.ZodString>;
8337
8439
  source: z.ZodString;
8338
- category: z.ZodOptional<z.ZodString>;
8440
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8339
8441
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8340
8442
  author: z.ZodOptional<z.ZodObject<{
8341
8443
  name: z.ZodString;
@@ -8360,7 +8462,49 @@ declare const CatalogSchema: z.ZodObject<{
8360
8462
  reviewing: "reviewing";
8361
8463
  offline: "offline";
8362
8464
  }>>>;
8363
- }, z.core.$strip>>;
8465
+ }, z.core.$strip>, z.ZodTransform<{
8466
+ category?: string[] | undefined;
8467
+ name: string;
8468
+ source: string;
8469
+ description?: string | undefined;
8470
+ keywords?: string[] | undefined;
8471
+ author?: {
8472
+ name: string;
8473
+ email?: string | undefined;
8474
+ url?: string | undefined;
8475
+ } | undefined;
8476
+ downloads?: number | undefined;
8477
+ likes?: number | undefined;
8478
+ displayName?: string | undefined;
8479
+ icon?: string | undefined;
8480
+ version?: string | undefined;
8481
+ changelog?: string | undefined;
8482
+ size?: number | undefined;
8483
+ homepage?: string | undefined;
8484
+ visibility?: "private" | "public" | undefined;
8485
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8486
+ }, {
8487
+ name: string;
8488
+ source: string;
8489
+ description?: string | undefined;
8490
+ category?: string | string[] | undefined;
8491
+ keywords?: string[] | undefined;
8492
+ author?: {
8493
+ name: string;
8494
+ email?: string | undefined;
8495
+ url?: string | undefined;
8496
+ } | undefined;
8497
+ downloads?: number | undefined;
8498
+ likes?: number | undefined;
8499
+ displayName?: string | undefined;
8500
+ icon?: string | undefined;
8501
+ version?: string | undefined;
8502
+ changelog?: string | undefined;
8503
+ size?: number | undefined;
8504
+ homepage?: string | undefined;
8505
+ visibility?: "private" | "public" | undefined;
8506
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8507
+ }>>>;
8364
8508
  }, z.core.$strip>;
8365
8509
  declare const RecordSchema: z.ZodObject<{
8366
8510
  name: z.ZodString;
@@ -8377,11 +8521,11 @@ declare const RecordSchema: z.ZodObject<{
8377
8521
  fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
8378
8522
  }, z.core.$strip>>;
8379
8523
  categories: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodType<MarketplaceCategoryInput, unknown, z.core.$ZodTypeInternals<MarketplaceCategoryInput, unknown>>>>>;
8380
- plugins: z.ZodArray<z.ZodObject<{
8524
+ plugins: z.ZodArray<z.ZodPipe<z.ZodObject<{
8381
8525
  name: z.ZodString;
8382
8526
  description: z.ZodOptional<z.ZodString>;
8383
8527
  source: z.ZodString;
8384
- category: z.ZodOptional<z.ZodString>;
8528
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8385
8529
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8386
8530
  author: z.ZodOptional<z.ZodObject<{
8387
8531
  name: z.ZodString;
@@ -8406,7 +8550,49 @@ declare const RecordSchema: z.ZodObject<{
8406
8550
  reviewing: "reviewing";
8407
8551
  offline: "offline";
8408
8552
  }>>>;
8409
- }, z.core.$strip>>;
8553
+ }, z.core.$strip>, z.ZodTransform<{
8554
+ category?: string[] | undefined;
8555
+ name: string;
8556
+ source: string;
8557
+ description?: string | undefined;
8558
+ keywords?: string[] | undefined;
8559
+ author?: {
8560
+ name: string;
8561
+ email?: string | undefined;
8562
+ url?: string | undefined;
8563
+ } | undefined;
8564
+ downloads?: number | undefined;
8565
+ likes?: number | undefined;
8566
+ displayName?: string | undefined;
8567
+ icon?: string | undefined;
8568
+ version?: string | undefined;
8569
+ changelog?: string | undefined;
8570
+ size?: number | undefined;
8571
+ homepage?: string | undefined;
8572
+ visibility?: "private" | "public" | undefined;
8573
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8574
+ }, {
8575
+ name: string;
8576
+ source: string;
8577
+ description?: string | undefined;
8578
+ category?: string | string[] | undefined;
8579
+ keywords?: string[] | undefined;
8580
+ author?: {
8581
+ name: string;
8582
+ email?: string | undefined;
8583
+ url?: string | undefined;
8584
+ } | undefined;
8585
+ downloads?: number | undefined;
8586
+ likes?: number | undefined;
8587
+ displayName?: string | undefined;
8588
+ icon?: string | undefined;
8589
+ version?: string | undefined;
8590
+ changelog?: string | undefined;
8591
+ size?: number | undefined;
8592
+ homepage?: string | undefined;
8593
+ visibility?: "private" | "public" | undefined;
8594
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8595
+ }>>>;
8410
8596
  }, z.core.$strip>;
8411
8597
  }, z.core.$strip>;
8412
8598
  type MarketplaceEntry = z.infer<typeof EntrySchema>;
@@ -12530,13 +12716,43 @@ declare class MemoryManager {
12530
12716
  * 什么都没干 —— 才是它要拦的。
12531
12717
  */
12532
12718
  private consolidationFailures;
12533
- /** 上次审查发现的问题(由 MemoryReviewer 写入) */
12719
+ /**
12720
+ * 加载 / 写入时发现的问题。
12721
+ *
12722
+ * ⚠️ **写入者是 `classifyEntry()`(注入命中)与 `add()` / `replace()`(写前拒绝),
12723
+ * 不是那个后台审查器** —— 2026-09-28 之前这一行的 JSDoc 写的是「由
12724
+ * MemoryReviewer 写入」,而那个类从来没有碰过它(它写的是自己那份 `issues`),
12725
+ * 那是一句假话。审查器本身在这同一天删掉了:它的三类结论一个出口都没有。
12726
+ */
12534
12727
  reviewIssues: Array<{
12535
12728
  type: string;
12536
12729
  severity: string;
12537
12730
  message: string;
12538
12731
  suggestion?: string;
12539
12732
  }>;
12733
+ /**
12734
+ * 攒着要发给用户的通知({@link MemoryNotice})。出队的是
12735
+ * {@link takeNotices},发射方是 `AgentLoop` 下一轮开头那一帧 `notice`。
12736
+ *
12737
+ * 为什么是「攒着等下一轮」而不是当场发:这一层是个普通类,**没有一条能
12738
+ * `yield` 的流**(`AgentEvent` 要由生成器吐出去,而它手上一个都没有)——
12739
+ * 所以只能是 loop 每一轮开头来问一次,和 `SkillLearner` 那条路同一个形状,
12740
+ * 判据在 `loop.ts` 的 `maybeLearn()` 上。
12741
+ */
12742
+ private notices;
12743
+ /**
12744
+ * 「注入命中」与「配额告警」这两句话**每个进程只说一次**。
12745
+ *
12746
+ * 判据来自参考实现(Hermes 的 `AgentNotice.key` 是一次性闩):`reloadFromDisk()`
12747
+ * 每次会话开头都跑,不闩的话用户每个会话都会重看同一句「有 2 条被隔离」——
12748
+ * 而**重复的通知等于训练用户忽略通知**。这一条不是省事,是让那一帧保持有效。
12749
+ *
12750
+ * ⚠️ 代价说清楚:一个长期驻留的进程里,会话中途新出现的命中不会再说第二遍
12751
+ * (模型那一侧仍然看得到占位符,用户去翻文件也看得到)。要更细的粒度就得
12752
+ * 把闩挂到「计数变了」上,那是另一笔改动。
12753
+ */
12754
+ private notifiedBlocked;
12755
+ private notifiedQuota;
12540
12756
  /**
12541
12757
  * @param config 三个配额,来自 `EpochConfig.memory`(runtime 的 `services.ts` 递进来)。
12542
12758
  * **按字段合并到默认值上**,不是整份替换 —— 用户只在 yaml 里写了
@@ -12553,6 +12769,48 @@ declare class MemoryManager {
12553
12769
  sync(_userMessage: string, _assistantResponse: string): Promise<void>;
12554
12770
  finalize(): Promise<void>;
12555
12771
  reloadFromDisk(): Promise<void>;
12772
+ /**
12773
+ * 命中注入模式的那一条**回给模型**长什么样。
12774
+ *
12775
+ * 三条决定,每条都有出处:
12776
+ *
12777
+ * 1. **是占位符不是原文** —— 这一层的全部意义。原文还在 `MEMORY.md` 里、
12778
+ * 还在数据库里,只是不进模型;
12779
+ * 2. **带处置指引** —— 模型看得见「这里有一条」,才可能替用户清掉它。
12780
+ * 参考实现 [Hermes `tools/memory_tool_store.py`] 的占位符就写着
12781
+ * 「use memory(action=remove) to delete the original」,这一步是它买的。
12782
+ * (id 不在这句里,在**印它的那一行**上:索引行本来就是
12783
+ * `- <id> [target] <摘要>`,摘要位换成了这句话)
12784
+ * 3. **说得出命中的是哪条模式** —— 用户排查「为什么这条没进上下文」时,
12785
+ * 「role injection」比「疑似注入」有用得多(原始出处是同一个文件的
12786
+ * `first_threat_message()`)。
12787
+ */
12788
+ private blockedPlaceholder;
12789
+ /**
12790
+ * 写前拒绝那一条:内容**根本不进文件**。
12791
+ *
12792
+ * `done: true` 是刻意的 —— 重试同一段内容没有意义,要改的是话本身,
12793
+ * 不是时机(`done: false` + `consolidateHint` 那一档说的是「腾点地方再试」)。
12794
+ */
12795
+ private refuseInjection;
12796
+ /**
12797
+ * 取走攒着的通知({@link notices})。**出队即清空** —— 发射方是 loop,
12798
+ * 一次取走一次发完;被预算闸门拦下的那一轮压根走不到发射那一步,
12799
+ * 于是它原样留到下一轮(判据同 `loop.ts` 里 `learnedSkills` 那一段)。
12800
+ */
12801
+ takeNotices(): MemoryNotice[];
12802
+ /**
12803
+ * 配额到线了没有 —— 到线就在下一轮开头说一句。
12804
+ *
12805
+ * ⚠️ **它替代的是那个 5 分钟的后台定时器**(`MemoryReviewer`,2026-09-28 删):
12806
+ * 阈值一个字没改({@link QUOTA_WARN_PCT}),改的是「什么时候算」——
12807
+ * 会话开头算一次,没有常驻定时器,也不再算那些没人看的重复 / 矛盾报告。
12808
+ *
12809
+ * ⚠️ 只报 `memory` 那一档:`user` 那份配额只有它的三分之一,而用户画像满了
12810
+ * 时的处置与项目知识完全不同(前者要合并、后者多半该删)—— 一句话说不清两件事,
12811
+ * 说不清就别硬塞进同一帧。
12812
+ */
12813
+ private checkQuota;
12556
12814
  /**
12557
12815
  * 重建 短 id → 条目 的映射。
12558
12816
  *
@@ -12610,9 +12868,25 @@ declare class MemoryManager {
12610
12868
  * 它更靠前(判据在 {@link renderIndexBlock} 的排序那一段)。
12611
12869
  */
12612
12870
  read(ids: readonly string[]): Promise<MemoryReadResult>;
12613
- /** 获取所有条目(供后台审查使用) */
12871
+ /**
12872
+ * 获取所有条目 —— **给人看的那一份,原文照给**。
12873
+ *
12874
+ * ## 为什么它和四条模型通道不一样
12875
+ *
12876
+ * 命中注入模式的条目在模型那侧是占位符,在这一份里是**原文**:用户得看得见,
12877
+ * 才谈得上把它删掉。参考实现的判据在这个类型上写着(Hermes
12878
+ * `tools/memory_tool_store.py`:「live lists keep the raw text so the user can
12879
+ * see and remove poisoned entries」)。
12880
+ *
12881
+ * `target` 是 2026-09-28 加的:用户侧的删除入口(`buildMemoryControl.remove`)
12882
+ * 原来**拿不到条目记在哪个库**,于是把 target 硬编码成 `'memory'` ——
12883
+ * 删一条 `user` 级记忆时底层回 `false`、而界面上写着「已删除」
12884
+ * (实测:条目还在)。`blocked` 一起带出来是给界面留一个标记的位置。
12885
+ */
12614
12886
  getAllEntries(): Array<{
12615
12887
  content: string;
12888
+ target: MemoryTarget;
12889
+ blocked: boolean;
12616
12890
  }>;
12617
12891
  /**
12618
12892
  * 语义检索。
@@ -12674,13 +12948,26 @@ declare class MemoryManager {
12674
12948
  */
12675
12949
  private readFile;
12676
12950
  /**
12677
- * 注入扫描。
12951
+ * 一条从盘上读来的条目该怎么进库 —— **命中注入模式的原文照留,只打标记**。
12952
+ *
12953
+ * ## ⚠️ 2026-09-28 改过,改的是「命中之后拿它怎么办」
12678
12954
  *
12679
- * 命中注入模式的条目丢弃(返回空串,由调用方过滤掉);
12680
- * 超长条目**截断**而不是整条替换成 [BLOCKED] —— 1000 字符对一条正常的
12681
- * 项目约定来说并不宽裕,原来的做法会把合法长条目直接吞掉。
12955
+ * 原来是:命中 → 返回空串 → 调用方过滤掉 → 下一次 `flushToDisk()` 把
12956
+ * `MEMORY.md` 重写成不含它的版本 —— 也就是说**用户手写的记忆被我们悄悄删掉**,
12957
+ * 唯一记录进了一个没有任何读者的数组。实测:三条里两条消失。
12958
+ *
12959
+ * 现在是:命中 → **原文一个字节不动**(照旧进库、照旧写回文件),只把
12960
+ * `blocked` 标上;四条模型通道(索引块 / `prefetch` / `search` / `read`)
12961
+ * 把它换成 {@link blockedPlaceholder}。参考实现的判据
12962
+ * [Hermes `tools/memory_tool_store.py`]:「Threat hits are replaced by a
12963
+ * `[BLOCKED: …]` placeholder in the **SNAPSHOT only**; live lists keep the raw
12964
+ * text so the user can see and remove poisoned entries (**dropping them
12965
+ * silently would hide the attack**).」—— 既不能喂给模型,也不能瞒着人。
12966
+ *
12967
+ * ⚠️ 为什么命中那一档**不截断**:截断会跟着落盘,那就又改了用户的文件。
12968
+ * 它反正不进 prompt(占位符替掉了它),长度不花任何人的钱。
12682
12969
  */
12683
- private scanInjection;
12970
+ private classifyEntry;
12684
12971
  /**
12685
12972
  * 一条条目在索引里长什么样。摘要取**首行**并截断到
12686
12973
  * {@link INDEX_SUMMARY_CHARS}。
@@ -12748,44 +13035,6 @@ declare class MemoryManager {
12748
13035
  private buildConsolidateHint;
12749
13036
  }
12750
13037
 
12751
- /**
12752
- * 记忆后台审查器 [Hermes background_review.py]。
12753
- *
12754
- * 后台线程定期扫描记忆条目,检测:
12755
- * - 重复/高度相似条目
12756
- * - 矛盾条目(如 "用户用 pnpm" vs "用户用 npm")
12757
- * - 配额告警(> 90%)
12758
- */
12759
-
12760
- /** 审查发现的问题 */
12761
- interface ReviewIssue {
12762
- type: 'duplicate' | 'contradiction' | 'quota_warning';
12763
- severity: 'low' | 'medium' | 'high';
12764
- message: string;
12765
- entries?: string[];
12766
- suggestion?: string;
12767
- }
12768
- declare class MemoryReviewer {
12769
- private manager;
12770
- private timer;
12771
- private issues;
12772
- private interval;
12773
- constructor(manager: MemoryManager, interval?: number);
12774
- /** 启动后台审查 [Hermes spawn_background_review_thread] */
12775
- start(): void;
12776
- /** 停止后台审查 */
12777
- stop(): void;
12778
- /** 获取最近发现的问题 */
12779
- getIssues(): ReviewIssue[];
12780
- /** 清除已知问题 */
12781
- clearIssues(): void;
12782
- /** 手动触发一次扫描 */
12783
- scanForIssues(): Promise<ReviewIssue[]>;
12784
- private checkDuplicates;
12785
- private checkContradictions;
12786
- private checkQuota;
12787
- }
12788
-
12789
13038
  /**
12790
13039
  * FTS5 索引的体检与空间回收(方案 48 PR-4 / 2026-08-21 那一笔)。
12791
13040
  *
@@ -18339,6 +18588,23 @@ declare class SkillSystem implements SkillSystem$1 {
18339
18588
  * 用「resolve 之后还在不在里面」而不是再抄一遍那条正则:两处各一份正则迟早
18340
18589
  * 只改一处,而路径包含判定对**所有**逃逸写法(`..`、绝对路径、分隔符、
18341
18590
  * Windows 的 `C:\`)都是对的。
18591
+ *
18592
+ * ## ⚠️ 目录名取的是 **frontmatter 里的 `name`**,不是参数那个(2026-09-28)
18593
+ *
18594
+ * 索引一个技能时取的名字是 `fm.name ?? 目录名`([scan.ts](scan.ts) 的 `loadOne`),
18595
+ * 也就是说**文件夹叫什么,不影响它进索引之后叫什么**。这里原来按参数建目录,
18596
+ * 两边于是能写岔,而唯一全自动的调用方(`SkillLearner`,名字由 LLM 生成)
18597
+ * 没有门面那两道检查。后果是实测出来的:learner 回
18598
+ * `{ created: true, skillName: 'deploy-site' }`,索引里却是 `Deploy Site` ——
18599
+ * 那条唯一对用户可见的通知说的是一个查不到的名字;而 `skills.has(name)`
18600
+ * 这道去重闸按参数名查、**永远不命中**,同一个话题可以反复学、每次都把上一个
18601
+ * 目录静默覆盖掉。
18602
+ *
18603
+ * 选**对齐**而不是拒,判据同导入那条路的 `renameStaged()`:learner 是一次性的
18604
+ * fire-and-forget(`agent/loop.ts` 的 `maybeLearn()`),拒了这次纠正就白学,
18605
+ * 而 `LearningSkipReason` 那个码今天没有出口。对齐之后「通知里说的名字」就是
18606
+ * 「索引里的名字」。模型侧门面(`skill-write.ts` 的 `checkFrontmatter`)
18607
+ * 本来就要求两者一字不差,所以这条对它是 no-op。
18342
18608
  */
18343
18609
  create(name: string, content: string, category?: string): Promise<string>;
18344
18610
  edit(name: string, content: string): Promise<void>;
@@ -18346,6 +18612,42 @@ declare class SkillSystem implements SkillSystem$1 {
18346
18612
  delete(name: string, _absorbedInto?: string): Promise<string>;
18347
18613
  writeFile(name: string, filePath: string, content: string): Promise<void>;
18348
18614
  removeFile(name: string, filePath: string): Promise<void>;
18615
+ /**
18616
+ * 把一个技能目录下的相对路径解析成绝对路径,**结果必须落在技能目录里**。
18617
+ *
18618
+ * ## 为什么这一道在这儿,不只在门面上
18619
+ *
18620
+ * 判据是「断言要落在会说谎的那一层」—— 会说谎的是这个产地。门面
18621
+ * (`skill-write.ts`)另有一条**字符集**检查,为的是给模型一句说得清的话,
18622
+ * 那一条不是这一条的替代:今天已经有三个调用方(`skill_write_file` /
18623
+ * `skill_patch`,以及将来可能接上的 `removeFile` 转出)。
18624
+ *
18625
+ * ## 为什么是 `base + sep` 而不是裸 `base`(2026-09-02 修)
18626
+ *
18627
+ * 裸前缀比较把**兄弟目录**判成「在里面」:`references/../../foo-evil/x` 解析出来
18628
+ * 是 `<skills>/general/foo-evil/x`,它确实以 `<skills>/general/foo` 开头。
18629
+ * 用「resolve 之后还在不在里面」而不是再抄一遍字符集正则:路径包含判定对
18630
+ * **所有**逃逸写法(`..`、绝对路径、分隔符、Windows 的 `C:\`)都是对的。
18631
+ *
18632
+ * ## 为什么还要 realpath(2026-09-28 补)
18633
+ *
18634
+ * 词法过了不等于落地还在里面:技能目录里放一个 `references/x -> /etc/hosts`
18635
+ * 的软链,写下去就出了目录。**两侧都 realpath 之后再比一次** —— 只 realpath
18636
+ * 一侧会把「`~/.epoch/skills` 本身是软链」这种完全合法的布局判成逃逸。
18637
+ * 目标不存在时 realpath 它最近的已存在祖先,再把剩下的段拼回去。
18638
+ * 参考实现是同一个共识的两份:[Hermes `tools/path_security.py::validate_within_dir`]
18639
+ * (resolve 后 `relative_to`)与 [Codex `ext/memories/src/local.rs::resolve_scoped_path`]
18640
+ * (逐组件拒 `ParentDir`/`RootDir` + 每步拒软链)。
18641
+ *
18642
+ * ⚠️ **两条已知边界**,写下来免得下一个人以为它盖全了:
18643
+ *
18644
+ * 1. **悬空软链**(`references/x -> /tmp/不存在`)过得了这一道 —— 目标不存在时
18645
+ * 我们 realpath 的是它的父目录。要造出这种软链得先有技能目录的写权限
18646
+ * (模型走 `terminal`、或者用户自己),那时它本来就能直接改那些文件;
18647
+ * 2. **hard link** 与**检查/写入之间的 TOCTOU** 同理,都不在威胁模型里 ——
18648
+ * Codex 在 [`core/src/safety.rs`] 的同一处也留了这条自觉。
18649
+ */
18650
+ private resolveInsideSkill;
18349
18651
  /**
18350
18652
  * 取一个**可写**的技能,否则抛。
18351
18653
  *
@@ -18795,8 +19097,17 @@ type LearningSkipReason =
18795
19097
  | 'invalid-json'
18796
19098
  /** JSON 合法但缺 `name` 或 `content` */
18797
19099
  | 'missing-name-or-content'
18798
- /** 有 content 但没有 YAML frontmatter,写下去也是一份读不出来的 SKILL.md */
19100
+ /** content 的 frontmatter 里没有 `name:`(或压根没有 frontmatter)。
19101
+ * ⚠️ 2026-09-28 之前这一档判的是 `content.includes('---')` —— 一个**子串**检查:
19102
+ * 正文里任何一个 `---` 都能骗过它,而真正没 frontmatter 的那份写下去之后
19103
+ * 进索引是「目录名 + 空描述」,模型从此选不中它 */
18799
19104
  | 'missing-frontmatter'
19105
+ /** frontmatter 的 `description` 是空的。判据同模型侧的 `skill_create`:
19106
+ * 索引里只进那一行,空的等于这条技能不可被发现,而没有任何地方会报 */
19107
+ | 'missing-description'
19108
+ /** 名字(或分类)当不了目录名 —— 分隔符、`..`、`:`、控制字符、结尾的点/空格。
19109
+ * 判据复用导入那条路的 {@link skillSegmentIssue},不再写第三条正则 */
19110
+ | 'invalid-name'
18800
19111
  /** 前面都过了,落盘那一步失败,细节在 `error` 里 */
18801
19112
  | 'create-failed';
18802
19113
  /**
@@ -20166,4 +20477,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
20166
20477
  */
20167
20478
  declare function codeModeWorkerPath(): string | undefined;
20168
20479
 
20169
- 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 ImportMessage, type ImportNode, type ImportPartsResult, type ImportSessionInput, type ImportSessionMeta, type ImportSessionResult, 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 MarketplaceCategory, 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 PersistFailureKind, 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_FORM_BUDGET_USD, 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, classifyPersistFailure, 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, displayAllows, 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, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, 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, persistFailureCode, 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 };
20480
+ 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 ImportMessage, type ImportNode, type ImportPartsResult, type ImportSessionInput, type ImportSessionMeta, type ImportSessionResult, 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 MarketplaceCategory, type MarketplaceDisplay, type MarketplaceDisplayField, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MarketplaceStatus, type MemoryConfig, type MemoryEntry, MemoryManager, type MemoryNotice, 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 PersistFailureKind, 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 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_FORM_BUDGET_USD, 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, classifyPersistFailure, 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, displayAllows, 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, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, 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, persistFailureCode, 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 };