@epoch-agent/core 0.20.1 → 0.21.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/README.md CHANGED
@@ -60,6 +60,19 @@ A 的预算上、把文件快照落进 A 的检查点目录。
60
60
  **这不是破坏性改动**:参数少的函数可以赋给参数多的函数类型,所以单会话调用方
61
61
  (CLI / TUI / 用例)写 `(req) => …` 照旧编译得过,一行不用改。
62
62
 
63
+ **`ask_user_question` 的页面位只收本机回环,而这不是抄设置页那条口径**(2026-09-29)。
64
+ 参数里多了一格 `questions[].page = { url, label? }` —— 插件在本机起一张页、
65
+ 而那个选择用选项说不清时,模型把地址放进这一格,带界面的宿主会把它嵌在那一问旁边。
66
+ ⚠️ **闸在 `parseQuestion` 里**(`new URL` parse 得动 + scheme 是 http/https +
67
+ host 是 `127.0.0.1` / `localhost`),而它**和 `EpochConfig.settingsPanes` 那一个
68
+ 量的一样宽、口径相反**:那一边的 url 是**用户自己写的 `config.yaml`**,所以
69
+ 「给什么嵌什么」站得住;这一格来自**模型参数**,而模型的上下文里有工具输出和网页
70
+ —— 那是可注入的。判据全文在 [protocol 的 question.ts](../protocol/src/question.ts) 文件头。
71
+
72
+ **坏 page 只丢那一格,不拒整条提问。** 同 `icon` 那条「认不出来的当没给」:
73
+ `page` 是锦上添花,而选项是必填的 —— 为它把整问打回,用户看到的是「这个问题根本
74
+ 没弹出来」,代价和收益完全不成比例。
75
+
63
76
  **`AgentConfig.site` 是「在哪儿干活」的现读出口,给了它 `workDir` /
64
77
  `projectContext` 就不再被读。**(迟绑,2026-08-20)循环内部只认 `site()` 这一个真源,
65
78
  不存在「workDir 是新的、projectContext 还是旧的」这种状态。不给时它按那两格折一个
package/dist/index.d.ts CHANGED
@@ -11578,7 +11578,9 @@ declare function explainSetting(key: string, base: BaseSlot, file?: FileSlots):
11578
11578
  * 3. ${ENV_VAR} 模板展开(递归,最多 10 层)
11579
11579
  * 3.5 SecretStore(系统钥匙串,装配层预取后注入 —— 见 `readProviderKeyEnv`)
11580
11580
  * 4. .env 文件(secrets)
11581
- * 5. process.env 直接覆盖(最高优先级)
11581
+ * 5. process.env 直接覆盖(最高优先级)—— `EPOCH_PROVIDER` / `EPOCH_BASE_URL`
11582
+ * 这两个例外:它们**读一次、落两次**(第 3.5~4 层取 secrets 的前后各一次),
11583
+ * 理由见 `readProviderOverride` / `applyProviderOverride`
11582
11584
  * 6. 损坏回退(last-known-good → 默认值)
11583
11585
  * 7. 损坏备份(config.yaml.corrupt.<ts>.bak)
11584
11586
  * 8. 缓存(mtime + size + env_snapshot)
@@ -14987,6 +14989,126 @@ declare class LastOpenSessions {
14987
14989
  private save;
14988
14990
  }
14989
14991
 
14992
+ /**
14993
+ * 界面外观偏好(主题 / 语言)的落盘(2026-09-29)。`~/.epoch/appearance.json`。
14994
+ *
14995
+ * ## 它治的是什么
14996
+ *
14997
+ * 在这之前 `epoch.theme` / `epoch.lang` **只**写在浏览器的 `localStorage` 里
14998
+ * ([web/src/prefs.ts](../../web/src/prefs.ts)),而 localStorage 按 origin 隔离。
14999
+ * 嵌入宿主按 [EMBEDDING.md §9](../../../docs/EMBEDDING.md) 的建议用 `port: 0` 时,
15000
+ * 每次启动都是一个新的 `http://127.0.0.1:<新端口>` —— 上次那份读不到。
15001
+ * 症状:设置里选了深色,关掉再开又回到「跟随系统」(升级必然重启一次,
15002
+ * 所以它在升级那里最显眼)。这份文件就是那条跨重启、跨 origin 的路。
15003
+ *
15004
+ * ## 为什么不是 `config.yaml` 里的 `display.*`
15005
+ *
15006
+ * 这一条是**逐条核对过**的,不是「JSON 更顺手」:
15007
+ *
15008
+ * 1. **`display.language` 的值域是 `LANGS`(`zh|en`),没有 `system`。**
15009
+ * 而外观那一格是三档(`system | zh | en`)—— 写一个 `system` 进去会让
15010
+ * `parseLenient` 产出一条 `config-invalid`,然后**整份配置退默认值**
15011
+ * (provider 和 apiKey 一起没)。本机实测:`display.language: dracula` /
15012
+ * `system` / 空串三种写法都是 `apiKey: ""` + `model: gpt-4o-mini`。
15013
+ * 2. **写盘那条链刻意没有「删键」**([core/config/write.ts](./config/write.ts) 文件头
15014
+ * 第三节 + protocol 的 `WireSettingsWriteRequest`)。而「选回跟随系统」如果
15015
+ * 要复用 `display.language`,就只能靠删键 —— 因为「键不写」是它唯一表达得出
15016
+ * 「跟随系统」的形状。
15017
+ * 3. **那个形状本身也表达不了三档。** 宿主每次启动都带自己的初值(`ui`),
15018
+ * 而「键不写 = 跟随系统」和「键不写 = 用户从没选过」逐字同形 ⇒ 用户显式选的
15019
+ * 「跟随系统」会被宿主初值盖掉 —— 正是这一轮要修的那个症状换个方向。
15020
+ * 4. 它还会顺手改掉 CLI / TUI 的语言(`cli/src/language.ts` 读的就是
15021
+ * `display.language`)。那在 EMBEDDING 里是**刻意分开的两件事**
15022
+ * (「界面初值」vs「进程语言」,两张表都在 §9),不该被一个界面偏好偷偷合并。
15023
+ *
15024
+ * 所以这份偏好住自己那一格:三档**原样**存(`system` 也在盘上,因此「没选过」
15025
+ * 和「选了跟随系统」是两件事),值域自由,一个字节都不碰 `config.yaml`。
15026
+ *
15027
+ * ## 值域谁说了算:**这一层不说**
15028
+ *
15029
+ * 这个类只做「把两条字符串存下来、读回去」,不判字面值。判定在两处,而且都在
15030
+ * 消费侧:
15031
+ *
15032
+ * - **写入口**:`POST /api/appearance` 用 server `bind.ts` 的两个 guard
15033
+ * (`isUiThemePref` / `isUiLangPref`)挡 —— 那正是宿主初值走的那一道关,
15034
+ * 两处合一处就不会出现「宿主给的认得出、盘上存回来的认不出」。
15035
+ * - **消费侧**:第一方界面那段内联脚本对 query 的坏值策略本来就是
15036
+ * 「认不出来当没给」(`index.html` 里的 `allowed`)。
15037
+ *
15038
+ * 所以手改出来的 `"theme": "dracula"` 是一个**惰性**的坏值:它读得出来、
15039
+ * 用不上、也不报错,逐字同 `prefs.ts` 的 `readPref` 那条
15040
+ * 「认不出来的值 = 当没设,不写回、不清理」。在这一层再抄一份值域,
15041
+ * 只会多一个「四份字面量」的走散点。
15042
+ *
15043
+ * ## 三条照抄 {@link RecentWorkspaces} / {@link LastOpenSessions}(同一类东西)
15044
+ *
15045
+ * 1. **本机文件,不是服务**(方案 42 §三那条范围闸门)。
15046
+ * 2. **写失败不抛。** 记不下来的代价是下次启动回到默认外观 —— 它不该把
15047
+ * 「切主题」这个主路径顶掉(判据同上,那一份是「切会话」)。
15048
+ * 3. **原子写 + 0o600**:那是这台机器上这个人挑了哪个主题,不是组内共享的东西。
15049
+ * 写到一半崩溃只会留下一个 `.tmp`,而不是半个 JSON。
15050
+ *
15051
+ * ⚠️ **只为真的 I/O 失败出声**(结构问题一律当「还没选过」,静静吞掉)——
15052
+ * 判据逐字同 `LastOpenSessions` 的文件头末节:一份读不出来的偏好和一份
15053
+ * 「他还没选过」在界面上长得一模一样,为它在每次启动时印一行黄字,
15054
+ * 只会教人忽略诊断。
15055
+ */
15056
+
15057
+ /**
15058
+ * 盘上那一份偏好。
15059
+ *
15060
+ * **两个键都缺席 = 用户从没选过**(宿主给的初值这时才生效);写了一个字面值
15061
+ * (包括 `'system'`)就是用户自己选过的那一档,此后宿主给的初值不再覆盖它。
15062
+ * 这一条是整份文件存在的理由,判据在文件头。
15063
+ *
15064
+ * ⚠️ 类型是 `string` 而不是那三档的联合,理由见文件头「值域谁说了算」——
15065
+ * 这一层不做值域判断,于是它也不该在类型上装作自己做过。
15066
+ */
15067
+ interface StoredAppearance {
15068
+ /** 主题偏好(`system | light | dark`)。缺席 = 没选过 */
15069
+ theme?: string;
15070
+ /** 语言偏好(`system | zh | en`)。缺席 = 没选过 */
15071
+ lang?: string;
15072
+ }
15073
+ declare class AppearanceStore {
15074
+ private readonly filePath;
15075
+ private prefs;
15076
+ /**
15077
+ * 读取时真的发生了 I/O 失败(文件在、但读不动)。空数组 = 读取正常。
15078
+ *
15079
+ * ⚠️ **结构问题不进这里**,判据在文件头最后一段。每一项是一个还没渲染的闭包
15080
+ * (理由逐字同 `RecentWorkspaces` 的文件头末节:它要进启动诊断,而诊断得能按
15081
+ * 这一次请求的语言重放一遍,在装配期渲染成字符串等于把进程语言钉死在里面)。
15082
+ */
15083
+ readonly loadErrors: LocalizedDetail[];
15084
+ /** 写入失败的原因。见文件头第 2 条 —— 写不进去不抛,但也不装作写进去了 */
15085
+ readonly writeErrors: LocalizedDetail[];
15086
+ constructor(filePath?: string);
15087
+ /** 盘上现在那一份。返回副本 —— 调用方改它不该改到存储 */
15088
+ get(): StoredAppearance;
15089
+ /**
15090
+ * 写一次。**只覆盖 `patch` 里真的给了的那几格**,其余原样留着。
15091
+ *
15092
+ * 空串和 `undefined` 一个待遇(当没给):这个文件里那两个键的语义是
15093
+ * 「用户选过哪一档」,而空串不是任何一档 —— 写一个空的 `theme` 下去,
15094
+ * 下一次读出来要么当没选过(对),要么变成一个要另写一条判据的第四种状态。
15095
+ *
15096
+ * **值没变就不写盘**:界面切一次主题报一次,而 React 那边同一件事可能报两遍
15097
+ * (同 `LastOpenSessions.remember` 那条理由)。
15098
+ */
15099
+ set(patch: StoredAppearance): void;
15100
+ private load;
15101
+ /** JSON → 偏好。认不出来的一律当没选过,一个字都不说(判据在文件头末段) */
15102
+ private adopt;
15103
+ /**
15104
+ * 原子写入:先写同目录的临时文件再 rename。判据逐字同 `RecentWorkspaces.save()`。
15105
+ *
15106
+ * 权限 0o600:这份文件说的是这个人挑了深色还是浅色、界面说中文还是英文 ——
15107
+ * 它一个秘密都没有,但它也没有任何理由让同机的别人读。
15108
+ */
15109
+ private save;
15110
+ }
15111
+
14990
15112
  /**
14991
15113
  * Policy Engine 类型定义 — 简单策略规则。
14992
15114
  */
@@ -20477,4 +20599,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
20477
20599
  */
20478
20600
  declare function codeModeWorkerPath(): string | undefined;
20479
20601
 
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 };
20602
+ 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, AppearanceStore, 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 StoredAppearance, 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 };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync, statSync, readdirSync, readFileSync, mkdirSync, writeFileSy
2
2
  import { homedir, platform, tmpdir, hostname } from 'os';
3
3
  import { join, dirname, resolve, relative, isAbsolute, sep, extname, basename } from 'path';
4
4
  import { execFile, execSync, execFileSync, spawn } from 'child_process';
5
- import { createLogger, dbPath, resolveHomeDir, DEFAULT_MAX_TURNS, PROJECT_DIR_NAME, guardSpawn, t, suggestKey, misspelledKeyIssues, openDatabase, migrate, releaseDatabase, parseLenient, issueDetails, splitWords, unknownKeyIssues, checkpointsDir, pluginsDir, projectHooksPath, projectClaudeSettingsPath, projectClaudeLocalSettingsPath, projectSettingsPath, projectLocalSettingsPath, projectPoliciesDir, trustedImportsPath, canProbeGit, budgetStatePath, artifactsDir, UNLIMITED_TURNS, turnLimitOf, configPath, managedSettingsPath, getSecretValues, listStoredSecretNames, maskApiKey, setSectionField, countCodePoints, headCodePoints, attachmentsDir, isInWorkspace, workspacesPath, samePath, lastSessionsPath, automationLogsDir, projectComplianceDir, projectSkillsDir, trustPath, projectCommandsDir, detectBackend, EXEC_PATH_AS_NODE_ENV, isolate, createStreamDecoder, parseShellCommand, writeArtifact, envPath, checkDangerousCommand, checkObfuscation, keepHeadAndTail, normalizeForMatch, isReadOnlyCommand, CODE_EXEC_ROOTS, tailCodePoints } from '@epoch-agent/infra';
5
+ import { createLogger, dbPath, resolveHomeDir, DEFAULT_MAX_TURNS, PROJECT_DIR_NAME, guardSpawn, t, suggestKey, misspelledKeyIssues, openDatabase, migrate, releaseDatabase, parseLenient, issueDetails, splitWords, unknownKeyIssues, checkpointsDir, pluginsDir, projectHooksPath, projectClaudeSettingsPath, projectClaudeLocalSettingsPath, projectSettingsPath, projectLocalSettingsPath, projectPoliciesDir, trustedImportsPath, canProbeGit, budgetStatePath, artifactsDir, UNLIMITED_TURNS, turnLimitOf, configPath, managedSettingsPath, getSecretValues, listStoredSecretNames, maskApiKey, setSectionField, countCodePoints, headCodePoints, attachmentsDir, isInWorkspace, workspacesPath, samePath, lastSessionsPath, appearancePath, automationLogsDir, projectComplianceDir, projectSkillsDir, trustPath, projectCommandsDir, detectBackend, EXEC_PATH_AS_NODE_ENV, isolate, createStreamDecoder, parseShellCommand, writeArtifact, envPath, checkDangerousCommand, checkObfuscation, keepHeadAndTail, normalizeForMatch, isReadOnlyCommand, CODE_EXEC_ROOTS, tailCodePoints } from '@epoch-agent/infra';
6
6
  export { IS_WINDOWS, 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';
7
7
  import { PROVIDER_TYPES, OPERATION_TYPES as OPERATION_TYPES$1, COMPLIANCE_CATEGORIES, COMPLIANCE_ACTIONS, SEARCH_PROVIDER_TYPES, CURRENCIES, LANGS, isSettingsPaneId, SETTINGS_PANE_IDS, PERMISSION_LEVELS, SHELL_KINDS, ToolExposure, MAX_OPTIONS, MIN_OPTIONS, MAX_HEADER_CHARS, MAX_QUESTIONS, SCHEDULE_INTERVAL_MINUTES, isPermissionLevel, SCHEDULE_DRAFT_TOOL, isValidAgentRoleName, DEFAULT_AGENT_ROLE, isValidCommandName, RESERVED_COMMAND_NAMES, parseModelRef, isWirePluginArchiveName, systemNote, formatMoney, totalUsageTokens, NOOP_TELEMETRY, METRIC, contentToText, GEN_AI, isPromptOversize, promptTokens, apiKeyEnvVar, PROVIDER_INFOS, isProviderType, API_KEY_ENV_VARS, KEY_ACTIONS, tableOf, perAction, isKeyAction, parseSequence, RESERVED_CHORDS, chordId, sequenceId, ACTION_CONTEXTS, SEQUENCE_CONTEXTS, assertNeverPart, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_SESSION_REFS, utf8ByteLength, truncateToBudget, attachSessionSurface, isContextNearlyFull, isOperationType, normalizeApproval, imagePartOmittedSummary, MAX_ATTACH_BYTES, SIMULTANEOUS_CONTEXTS, SESSION_REFERENCE_ERROR_CODES, filePartSummary, sessionPartSummary } from '@epoch-agent/protocol';
8
8
  export { API_KEY_ENV_VARS, COMPLIANCE_ACTIONS, COMPLIANCE_CATEGORIES, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, OPERATION_TYPES, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, ToolExposure, apiKeyEnvVar, extractAllMentions, extractMentions, extractSessionMentions, getProviderInfo, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, normalizeApproval } from '@epoch-agent/protocol';
@@ -274,7 +274,7 @@ function createLaunchdBackend(opts = {}) {
274
274
  mkdirSync(input.logDir, { recursive: true });
275
275
  writeFileSync(path, renderPlist(label, input), "utf-8");
276
276
  } catch (err) {
277
- return { ok: false, detail: `plist-write-failed: ${describe8(err)}` };
277
+ return { ok: false, detail: `plist-write-failed: ${describe9(err)}` };
278
278
  }
279
279
  await run("launchctl", ["bootout", `${guiDomain()}/${label}`]);
280
280
  const toggle = await backend.setEnabled(label, input.enabled);
@@ -290,7 +290,7 @@ function createLaunchdBackend(opts = {}) {
290
290
  try {
291
291
  rmSync(plistPath(label), { force: true });
292
292
  } catch (err) {
293
- return { ok: false, detail: `plist-remove-failed: ${describe8(err)}` };
293
+ return { ok: false, detail: `plist-remove-failed: ${describe9(err)}` };
294
294
  }
295
295
  return { ok: true };
296
296
  },
@@ -447,7 +447,7 @@ function detailOf2(what, res) {
447
447
  const msg = (res.stderr || res.stdout).trim();
448
448
  return `${what} exit ${res.code}${msg ? `: ${msg}` : ""}`;
449
449
  }
450
- function describe8(err) {
450
+ function describe9(err) {
451
451
  return err instanceof Error ? err.message : String(err);
452
452
  }
453
453
  var LAUNCHD_LABEL_PREFIX;
@@ -650,7 +650,7 @@ var ToolRegistry = class {
650
650
  this.addTool(tool, source);
651
651
  }
652
652
  registerTools(tools, source = "builtin") {
653
- for (const t80 of tools) this.addTool(t80, source);
653
+ for (const t81 of tools) this.addTool(t81, source);
654
654
  }
655
655
  addTool(tool, source) {
656
656
  const existing = this.tools.get(tool.name);
@@ -699,14 +699,14 @@ var ToolRegistry = class {
699
699
  return isCodeModeDeferred(tool) ? ToolExposure.Deferred : declared;
700
700
  }
701
701
  exposed() {
702
- return this.list().filter((t80) => this.exposureOf(t80) === ToolExposure.Direct);
702
+ return this.list().filter((t81) => this.exposureOf(t81) === ToolExposure.Direct);
703
703
  }
704
704
  byExposure(exposure) {
705
- return this.list().filter((t80) => this.exposureOf(t80) === exposure);
705
+ return this.list().filter((t81) => this.exposureOf(t81) === exposure);
706
706
  }
707
707
  codeModeDeclared() {
708
708
  if (!this.codeMode) return [];
709
- return this.list().filter((t80) => isCodeModeDeferred(t80));
709
+ return this.list().filter((t81) => isCodeModeDeferred(t81));
710
710
  }
711
711
  sourceOf(name) {
712
712
  return this.tools.get(name)?.source;
@@ -755,7 +755,7 @@ var ToolRegistry = class {
755
755
  function staticToolProvider(tools) {
756
756
  return {
757
757
  list: () => tools,
758
- get: (name) => tools.find((t80) => t80.name === name)
758
+ get: (name) => tools.find((t81) => t81.name === name)
759
759
  };
760
760
  }
761
761
  var log = createLogger("tokenizer");
@@ -861,6 +861,21 @@ function parseOption(raw) {
861
861
  const description = typeof raw["description"] === "string" ? raw["description"].trim() : "";
862
862
  return { label, description };
863
863
  }
864
+ function parsePage(raw) {
865
+ if (!isRecord(raw)) return void 0;
866
+ const rawUrl = typeof raw["url"] === "string" ? raw["url"].trim() : "";
867
+ if (!rawUrl) return void 0;
868
+ let url;
869
+ try {
870
+ url = new URL(rawUrl);
871
+ } catch {
872
+ return void 0;
873
+ }
874
+ if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
875
+ if (url.hostname !== "127.0.0.1" && url.hostname !== "localhost") return void 0;
876
+ const label = typeof raw["label"] === "string" ? raw["label"].trim() : "";
877
+ return label ? { url: rawUrl, label } : { url: rawUrl };
878
+ }
864
879
  function parseQuestion(raw, at) {
865
880
  if (!isRecord(raw)) return `questions[${at}] \u4E0D\u662F\u5BF9\u8C61`;
866
881
  const question = typeof raw["question"] === "string" ? raw["question"].trim() : "";
@@ -878,11 +893,13 @@ function parseQuestion(raw, at) {
878
893
  if (options.length < MIN_OPTIONS || options.length > MAX_OPTIONS) {
879
894
  return `questions[${at}] \u6709 ${options.length} \u4E2A\u9009\u9879\uFF0C\u8981 ${MIN_OPTIONS}\u2013${MAX_OPTIONS} \u4E2A\u3002**\u4E0D\u8981**\u81EA\u5DF1\u52A0\u300C\u5176\u4ED6\u300D\u9009\u9879 \u2014\u2014 \u81EA\u7531\u8F93\u5165\u7531\u754C\u9762\u81EA\u52A8\u63D0\u4F9B`;
880
895
  }
896
+ const page = parsePage(raw["page"]);
881
897
  return {
882
898
  question,
883
899
  header,
884
900
  options,
885
- multiSelect: raw["multiSelect"] === true
901
+ multiSelect: raw["multiSelect"] === true,
902
+ ...page ? { page } : {}
886
903
  };
887
904
  }
888
905
  function parseQuestions(raw) {
@@ -957,7 +974,19 @@ var PARAMETERS = {
957
974
  required: ["label", "description"]
958
975
  }
959
976
  },
960
- multiSelect: { type: "boolean", description: "\u80FD\u4E0D\u80FD\u591A\u9009\u3002\u9ED8\u8BA4 false" }
977
+ multiSelect: { type: "boolean", description: "\u80FD\u4E0D\u80FD\u591A\u9009\u3002\u9ED8\u8BA4 false" },
978
+ page: {
979
+ type: "object",
980
+ description: "\u8FD9\u4E00\u95EE\u8FD8\u53EF\u4EE5\u5D4C\u4E00\u5F20\u63D2\u4EF6\u9875\u9762\uFF08\u53EA\u5728\u5E26\u754C\u9762\u7684\u5BBF\u4E3B\u91CC\u6709 \u2014\u2014 \u7EC8\u7AEF\u91CC\u4F1A\u88AB\u8BF4\u6210\u4E00\u53E5\u8BDD\uFF0C\u7528\u6237\u81EA\u5DF1\u5F00\uFF09\u3002\u26A0\uFE0F url \u53EA\u6536\u672C\u673A\u56DE\u73AF\uFF08127.0.0.1 / localhost\uFF09\uFF0C\u522B\u7684\u4F1A\u88AB\u4E22\u6389",
981
+ properties: {
982
+ url: {
983
+ type: "string",
984
+ description: "\u90A3\u4E00\u9875\u7684\u5730\u5740\uFF0C\u5F62\u5982 http://127.0.0.1:52341/confirm?t=\u2026"
985
+ },
986
+ label: { type: "string", description: "\u9875\u9762\u4E0A\u90A3\u51E0\u4E2A\u5B57\u3002\u4E0D\u7ED9\u5C31\u7528\u4E00\u53E5\u901A\u7528\u6587\u6848" }
987
+ },
988
+ required: ["url"]
989
+ }
961
990
  },
962
991
  required: ["question", "header", "options", "multiSelect"]
963
992
  }
@@ -972,7 +1001,10 @@ var DESCRIPTION = [
972
1001
  "**\u6709\u660E\u663E\u9ED8\u8BA4\u7B54\u6848\u65F6\u4E0D\u8981\u95EE**\uFF0C\u76F4\u63A5\u505A\u5E76\u8BF4\u660E \u2014\u2014 \u4ED3\u5E93\u91CC\u5DF2\u7ECF\u6709 vitest.config \u7684\u65F6\u5019",
973
1002
  "\u300C\u7528\u54EA\u4E2A\u6D4B\u8BD5\u6846\u67B6\u300D\u4E0D\u662F\u4E00\u4E2A\u95EE\u9898\u3002",
974
1003
  "\u4E0D\u8981\u7528\u5B83\u95EE\u300C\u6211\u7684\u65B9\u6848\u884C\u4E0D\u884C\u300D\uFF08\u90A3\u662F exit_plan_mode\uFF09\uFF0C\u4E5F\u4E0D\u8981\u7528\u5B83\u6C47\u62A5\u8FDB\u5EA6\u3002",
975
- "\u9009\u9879\u91CC**\u4E0D\u8981**\u81EA\u5DF1\u653E\u300C\u5176\u4ED6\u300D\uFF1A\u754C\u9762\u4F1A\u81EA\u52A8\u63D0\u4F9B\u81EA\u7531\u8F93\u5165\u3002"
1004
+ "\u9009\u9879\u91CC**\u4E0D\u8981**\u81EA\u5DF1\u653E\u300C\u5176\u4ED6\u300D\uFF1A\u754C\u9762\u4F1A\u81EA\u52A8\u63D0\u4F9B\u81EA\u7531\u8F93\u5165\u3002",
1005
+ "\u26A0\uFE0F \u63D2\u4EF6\u7684\u5DE5\u5177\u7ED9\u4E86\u4F60\u4E00\u4E2A**\u672C\u673A\u5730\u5740**\u3001\u800C\u90A3\u4E2A\u9009\u62E9\u7528\u51E0\u4E2A\u9009\u9879\u8BF4\u4E0D\u6E05\u65F6\uFF08\u51E0\u5341\u5F20\u56FE\u91CC\u6311\u4E00\u5F20\u3001",
1006
+ "\u4E00\u5F20\u8868\u91CC\u5708\u51E0\u884C\uFF09\uFF0C\u628A\u5730\u5740\u653E\u8FDB `questions[].page` \u2014\u2014 \u7528\u6237\u4F1A\u5728\u5F39\u7A97\u91CC\u76F4\u63A5\u770B\u5230\u90A3\u4E00\u9875\u3002",
1007
+ "\u5B83**\u9644\u52A0\u5728\u9009\u9879\u4E4B\u5916**\uFF0C\u9009\u9879\u7167\u65E7\u8981\u7ED9\uFF1A\u7EC8\u7AEF\u91CC\u753B\u4E0D\u51FA\u9875\u9762\uFF0C\u90A3\u65F6\u7528\u6237\u770B\u5230\u7684\u53EA\u6709\u4F60\u5199\u7684\u9009\u9879\u3002"
976
1008
  ].join("");
977
1009
  function createAskQuestionTool(deps) {
978
1010
  return {
@@ -1388,7 +1420,7 @@ var DelegateManager = class {
1388
1420
  }
1389
1421
  normalizeTasks(args) {
1390
1422
  if (args.tasks && args.tasks.length > 0) {
1391
- return args.role ? args.tasks.map((t80) => ({ ...t80, role: t80.role ?? args.role })) : args.tasks;
1423
+ return args.role ? args.tasks.map((t81) => ({ ...t81, role: t81.role ?? args.role })) : args.tasks;
1392
1424
  }
1393
1425
  if (args.goal) return [{ goal: args.goal, ...args.role ? { role: args.role } : {} }];
1394
1426
  return [];
@@ -1398,7 +1430,7 @@ var DelegateManager = class {
1398
1430
  for (let i = 0; i < tasks.length; i += maxConcurrent) {
1399
1431
  const batch = tasks.slice(i, i + maxConcurrent);
1400
1432
  const batchResults = await Promise.allSettled(
1401
- batch.map((t80) => this.runSingleTask(t80, parentSessionId, signal))
1433
+ batch.map((t81) => this.runSingleTask(t81, parentSessionId, signal))
1402
1434
  );
1403
1435
  for (const r of batchResults) {
1404
1436
  if (r.status === "fulfilled") {
@@ -1556,21 +1588,21 @@ function createDelegateTool(runner, config, roles) {
1556
1588
  operation: "command",
1557
1589
  describeTarget: (args) => {
1558
1590
  const tasks = Array.isArray(args["tasks"]) ? args["tasks"] : [];
1559
- const goals = tasks.map((t80) => String(t80["goal"] ?? ""));
1591
+ const goals = tasks.map((t81) => String(t81["goal"] ?? ""));
1560
1592
  const single = typeof args["goal"] === "string" ? args["goal"] : "";
1561
1593
  return [...goals, single].filter(Boolean).join(" | ");
1562
1594
  },
1563
1595
  async execute(args, ctx) {
1564
1596
  const start = Date.now();
1565
1597
  const rawTasks = Array.isArray(args["tasks"]) ? args["tasks"] : void 0;
1566
- const tasks = rawTasks?.map((t80) => {
1567
- const o = t80;
1598
+ const tasks = rawTasks?.map((t81) => {
1599
+ const o = t81;
1568
1600
  return {
1569
1601
  goal: String(o["goal"] ?? "").trim(),
1570
1602
  context: String(o["context"] ?? ""),
1571
1603
  ...typeof o["role"] === "string" && o["role"].trim() ? { role: o["role"].trim() } : {}
1572
1604
  };
1573
- }).filter((t80) => t80.goal.length > 0);
1605
+ }).filter((t81) => t81.goal.length > 0);
1574
1606
  const goal = typeof args["goal"] === "string" ? args["goal"].trim() : "";
1575
1607
  const topRole = typeof args["role"] === "string" ? args["role"].trim() : "";
1576
1608
  if ((!tasks || tasks.length === 0) && !goal) {
@@ -1586,7 +1618,7 @@ function createDelegateTool(runner, config, roles) {
1586
1618
  };
1587
1619
  }
1588
1620
  const known = listRoles();
1589
- const requested = [...(tasks ?? []).map((t80) => t80.role), topRole].filter(
1621
+ const requested = [...(tasks ?? []).map((t81) => t81.role), topRole].filter(
1590
1622
  (r) => Boolean(r)
1591
1623
  );
1592
1624
  const unknown = [...new Set(requested)].filter((r) => !known.some((k) => k.name === r));
@@ -1760,8 +1792,8 @@ function createGoalTool(deps) {
1760
1792
  }
1761
1793
  var VALID_TARGETS = ["memory", "user"];
1762
1794
  var VALID_ACTIONS = ["add", "replace", "remove", "search", "read", "budget"];
1763
- function isValidTarget(t80) {
1764
- return typeof t80 === "string" && VALID_TARGETS.includes(t80);
1795
+ function isValidTarget(t81) {
1796
+ return typeof t81 === "string" && VALID_TARGETS.includes(t81);
1765
1797
  }
1766
1798
  function isValidAction(a) {
1767
1799
  return VALID_ACTIONS.includes(a);
@@ -4915,7 +4947,7 @@ function available(tools) {
4915
4947
  if (tools.length === 0) {
4916
4948
  return "No deferred tools in this session \u2014 every tool is already in your tool list.";
4917
4949
  }
4918
- const names = tools.map((t80) => t80.name).sort();
4950
+ const names = tools.map((t81) => t81.name).sort();
4919
4951
  const shown = names.slice(0, MAX_LISTED);
4920
4952
  const rest = names.length - shown.length;
4921
4953
  return `Searchable tools: ${shown.join(", ")}${rest > 0 ? ` (\u2026and ${rest} more)` : ""}.`;
@@ -5035,15 +5067,15 @@ var TrackerDB = class {
5035
5067
  );
5036
5068
  this.db.transaction(() => {
5037
5069
  this.db.prepare("DELETE FROM todos WHERE session_id = ?").run(sessionId);
5038
- for (const t80 of todos) {
5070
+ for (const t81 of todos) {
5039
5071
  insertStmt.run({
5040
- id: t80.id,
5072
+ id: t81.id,
5041
5073
  session_id: sessionId,
5042
- content: t80.content,
5043
- status: t80.status,
5044
- reason: t80.reason || null,
5045
- created_at: t80.created_at,
5046
- updated_at: t80.updated_at
5074
+ content: t81.content,
5075
+ status: t81.status,
5076
+ reason: t81.reason || null,
5077
+ created_at: t81.created_at,
5078
+ updated_at: t81.updated_at
5047
5079
  });
5048
5080
  }
5049
5081
  })();
@@ -5065,9 +5097,9 @@ function formatTodoList(todos, pendingCount) {
5065
5097
  cancelled: "\u5DF2\u53D6\u6D88"
5066
5098
  };
5067
5099
  lines.push(`[todo] \u72B6\u6001\u6C47\u603B: ${pendingCount} \u4E2A\u5F85\u5B8C\u6210`);
5068
- for (const t80 of todos) {
5069
- const label = statusLabel[t80.status] || t80.status;
5070
- lines.push(`- [${label}] ${t80.content}${t80.reason ? ` \u2014\u2014 ${t80.reason}` : ""}`);
5100
+ for (const t81 of todos) {
5101
+ const label = statusLabel[t81.status] || t81.status;
5102
+ lines.push(`- [${label}] ${t81.content}${t81.reason ? ` \u2014\u2014 ${t81.reason}` : ""}`);
5071
5103
  }
5072
5104
  return lines.join("\n");
5073
5105
  }
@@ -5141,14 +5173,14 @@ function createTodoTool(db) {
5141
5173
  };
5142
5174
  }
5143
5175
  const now = (/* @__PURE__ */ new Date()).toISOString();
5144
- const existing = new Map(db.listBySession(ctx.sessionId).map((t80) => [t80.id, t80]));
5145
- const todos = rawTodos.map((t80) => {
5146
- const prev = t80.id ? existing.get(t80.id) : void 0;
5147
- const status = isValidStatus(t80.status) ? t80.status : "pending";
5148
- const reason9 = normalizeReason(status, t80.reason);
5176
+ const existing = new Map(db.listBySession(ctx.sessionId).map((t81) => [t81.id, t81]));
5177
+ const todos = rawTodos.map((t81) => {
5178
+ const prev = t81.id ? existing.get(t81.id) : void 0;
5179
+ const status = isValidStatus(t81.status) ? t81.status : "pending";
5180
+ const reason9 = normalizeReason(status, t81.reason);
5149
5181
  return {
5150
- id: t80.id || generateShortId(),
5151
- content: String(t80.content || "").slice(0, 500),
5182
+ id: t81.id || generateShortId(),
5183
+ content: String(t81.content || "").slice(0, 500),
5152
5184
  status,
5153
5185
  ...reason9 ? { reason: reason9 } : {},
5154
5186
  created_at: prev?.created_at || now,
@@ -5156,7 +5188,7 @@ function createTodoTool(db) {
5156
5188
  };
5157
5189
  });
5158
5190
  db.replaceAll(ctx.sessionId, todos);
5159
- const pendingCount = todos.filter((t80) => isOpenTodo(t80.status)).length;
5191
+ const pendingCount = todos.filter((t81) => isOpenTodo(t81.status)).length;
5160
5192
  return {
5161
5193
  success: true,
5162
5194
  output: formatTodoList(todos, pendingCount),
@@ -5491,7 +5523,7 @@ function intersectNames(base, incoming) {
5491
5523
  if (!base) return incoming ? [...incoming] : void 0;
5492
5524
  if (!incoming) return [...base];
5493
5525
  const baseSet = new Set(base);
5494
- return incoming.filter((t80) => baseSet.has(t80));
5526
+ return incoming.filter((t81) => baseSet.has(t81));
5495
5527
  }
5496
5528
  function findRole(roles, name) {
5497
5529
  return roles.find((r) => r.name === name);
@@ -5635,7 +5667,7 @@ function roleScopedProvider(base, role, blocked) {
5635
5667
  return allow ? allow.has(name) : true;
5636
5668
  };
5637
5669
  return {
5638
- list: () => base.list().filter((t80) => permitted(t80.name)),
5670
+ list: () => base.list().filter((t81) => permitted(t81.name)),
5639
5671
  get: (name) => permitted(name) ? base.get(name) : void 0
5640
5672
  };
5641
5673
  }
@@ -5662,7 +5694,7 @@ function createRoleScope(base, sessionRole, blocked) {
5662
5694
  }
5663
5695
  function unknownRoleTools(base, role, blocked) {
5664
5696
  if (!role?.tools) return [];
5665
- const available2 = new Set(base.list().map((t80) => t80.name));
5697
+ const available2 = new Set(base.list().map((t81) => t81.name));
5666
5698
  const blockedSet = new Set(blocked);
5667
5699
  return role.tools.filter((name) => !available2.has(name) && !blockedSet.has(name));
5668
5700
  }
@@ -5998,7 +6030,7 @@ function createToolScope(base) {
5998
6030
  const permitted = (name) => allow ? allow.has(name) : true;
5999
6031
  return {
6000
6032
  provider: {
6001
- list: () => base.list().filter((t80) => permitted(t80.name)),
6033
+ list: () => base.list().filter((t81) => permitted(t81.name)),
6002
6034
  get: (name) => permitted(name) ? base.get(name) : void 0
6003
6035
  },
6004
6036
  enter: (next) => {
@@ -6168,7 +6200,7 @@ function scanHooks(dir, issues) {
6168
6200
  return [...parsed.entries].map(([type, list]) => ({
6169
6201
  type,
6170
6202
  count: list.reduce((sum, entry) => sum + entry.hooks.length, 0)
6171
- })).filter((t80) => t80.count > 0).sort((a, b) => a.type.localeCompare(b.type));
6203
+ })).filter((t81) => t81.count > 0).sort((a, b) => a.type.localeCompare(b.type));
6172
6204
  }
6173
6205
  function scanMcp(dir, plugin, issues) {
6174
6206
  const path = join(dir, PLUGIN_LAYOUT.mcp);
@@ -7931,14 +7963,14 @@ var CheckpointStore = class {
7931
7963
  }
7932
7964
  async enforceTotalSize(protectSession, protectTurnIndex) {
7933
7965
  const turns = await this.collectTurns();
7934
- let total = turns.reduce((sum, t80) => sum + t80.bytes, 0);
7966
+ let total = turns.reduce((sum, t81) => sum + t81.bytes, 0);
7935
7967
  if (total <= this.maxTotalBytes) return;
7936
7968
  turns.sort((a, b) => a.createdAt - b.createdAt);
7937
- for (const t80 of turns) {
7969
+ for (const t81 of turns) {
7938
7970
  if (total <= this.maxTotalBytes) return;
7939
- if (t80.sessionId === protectSession && t80.turnIndex === protectTurnIndex) continue;
7940
- await this.removeTurn(t80.sessionId, t80.turnIndex);
7941
- total -= t80.bytes;
7971
+ if (t81.sessionId === protectSession && t81.turnIndex === protectTurnIndex) continue;
7972
+ await this.removeTurn(t81.sessionId, t81.turnIndex);
7973
+ total -= t81.bytes;
7942
7974
  }
7943
7975
  }
7944
7976
  async collectTurns() {
@@ -10739,11 +10771,11 @@ var PromptBuilder = class {
10739
10771
  memoryInitialized = false;
10740
10772
  projectBlock(tools) {
10741
10773
  const permLevel = this.deps.permissionManager?.getLevel() || "default";
10742
- const hasPlanTool = tools.some((t80) => t80.name === "enter_plan_mode");
10743
- const hasLspTool = tools.some((t80) => t80.name === "lsp_diagnostics");
10744
- const hasAskTool = tools.some((t80) => t80.name === "ask_user_question");
10745
- const hasTodoTool = tools.some((t80) => t80.name === "todo");
10746
- const hasTerminal = tools.some((t80) => t80.name === "terminal");
10774
+ const hasPlanTool = tools.some((t81) => t81.name === "enter_plan_mode");
10775
+ const hasLspTool = tools.some((t81) => t81.name === "lsp_diagnostics");
10776
+ const hasAskTool = tools.some((t81) => t81.name === "ask_user_question");
10777
+ const hasTodoTool = tools.some((t81) => t81.name === "todo");
10778
+ const hasTerminal = tools.some((t81) => t81.name === "terminal");
10747
10779
  const needsCommandApproval = hasTerminal && permLevel === "default";
10748
10780
  const plan = this.deps.approvedPlan?.()?.trim();
10749
10781
  const codeSdk = renderSdkDeclaration(this.deps.codeModeTools?.() ?? []);
@@ -11433,8 +11465,8 @@ function imageParts(content) {
11433
11465
  return typeof content === "string" ? [] : content.filter((p) => p.type === "image");
11434
11466
  }
11435
11467
  function toolSignatureOf(config, tools) {
11436
- const direct = tools.map((t80) => t80.name).join("\0");
11437
- const declared = (config.codeModeTools?.() ?? []).map((t80) => t80.name).join("\0");
11468
+ const direct = tools.map((t81) => t81.name).join("\0");
11469
+ const declared = (config.codeModeTools?.() ?? []).map((t81) => t81.name).join("\0");
11438
11470
  return declared ? `${direct}|${declared}` : direct;
11439
11471
  }
11440
11472
  function modelSignatureOf(info) {
@@ -12982,8 +13014,10 @@ function _loadImpl(overrideHomeDir) {
12982
13014
  return cached.config;
12983
13015
  }
12984
13016
  const config = parseRawConfig(read.raw, issues, track);
12985
- const pinned = applyProviderOverride(config, issues, track);
13017
+ const override = readProviderOverride(issues);
13018
+ const pinned = applyProviderOverride(config, track, override);
12986
13019
  const secretSource = applySecretsFromEnv(config, homeDir, track);
13020
+ if (pinned) applyProviderOverride(config, track, override);
12987
13021
  applyEnvOverrides(config, issues, track);
12988
13022
  if (secretSource === "config-file" && !pinned) detectProviderFromKey(config);
12989
13023
  if (overrideHomeDir) {
@@ -13054,19 +13088,30 @@ function applySecretsFromEnv(config, homeDir, track) {
13054
13088
  }
13055
13089
  return "config-file";
13056
13090
  }
13057
- function applyProviderOverride(config, issues, track) {
13058
- const raw = process.env.EPOCH_BASE_URL;
13059
- if (raw) {
13060
- config.provider.baseUrl = raw;
13061
- track.env.add("provider.baseUrl");
13091
+ function readProviderOverride(issues) {
13092
+ const override = {};
13093
+ const baseUrl = process.env.EPOCH_BASE_URL;
13094
+ if (baseUrl) {
13095
+ override.baseUrl = baseUrl;
13096
+ override.type = "openai-compatible";
13062
13097
  }
13063
13098
  const type = process.env.EPOCH_PROVIDER;
13064
- if (!type) return false;
13065
- if (!isProviderType(type)) {
13066
- issues.push(envIssue("EPOCH_PROVIDER", type, PROVIDER_TYPES.join(" / ")));
13067
- return false;
13099
+ if (type) {
13100
+ if (isProviderType(type)) {
13101
+ override.type ??= type;
13102
+ } else {
13103
+ issues.push(envIssue("EPOCH_PROVIDER", type, PROVIDER_TYPES.join(" / ")));
13104
+ }
13068
13105
  }
13069
- config.provider.type = type;
13106
+ return override;
13107
+ }
13108
+ function applyProviderOverride(config, track, override) {
13109
+ if (override.baseUrl) {
13110
+ config.provider.baseUrl = override.baseUrl;
13111
+ track.env.add("provider.baseUrl");
13112
+ }
13113
+ if (!override.type) return false;
13114
+ config.provider.type = override.type;
13070
13115
  track.env.add("provider.type");
13071
13116
  return true;
13072
13117
  }
@@ -15079,11 +15124,11 @@ function buildSearchQuery(query) {
15079
15124
  }
15080
15125
  const latinPart = cleaned.replace(CJK_RUN, " ");
15081
15126
  for (const w of latinPart.split(/\s+/)) {
15082
- const t80 = w.trim();
15083
- if (t80.length >= 2) terms.add(t80);
15127
+ const t81 = w.trim();
15128
+ if (t81.length >= 2) terms.add(t81);
15084
15129
  }
15085
15130
  if (terms.size === 0) return null;
15086
- return [...terms].map((t80) => `"${t80.replace(/"/g, "")}"`).join(" OR ");
15131
+ return [...terms].map((t81) => `"${t81.replace(/"/g, "")}"`).join(" OR ");
15087
15132
  }
15088
15133
  // src/memory/db.ts
15089
15134
  var NS2 = "memory";
@@ -17102,7 +17147,7 @@ function checkFtsHealth(db) {
17102
17147
  messages,
17103
17148
  tables,
17104
17149
  missingTriggers,
17105
- healthy: missingTriggers.length === 0 && tables.every((t80) => t80.error === null && t80.drift === null && t80.rows === messages),
17150
+ healthy: missingTriggers.length === 0 && tables.every((t81) => t81.error === null && t81.drift === null && t81.rows === messages),
17106
17151
  indexBytes: indexBytesOf(db),
17107
17152
  space: spaceOf(db)
17108
17153
  };
@@ -18196,6 +18241,72 @@ function isLastOpenSession(value) {
18196
18241
  const v = value;
18197
18242
  return typeof v["root"] === "string" && v["root"].length > 0 && typeof v["sessionId"] === "string" && v["sessionId"].length > 0 && typeof v["at"] === "number";
18198
18243
  }
18244
+ var FILE_VERSION4 = 1;
18245
+ function describe8(err) {
18246
+ return err instanceof Error ? err.message : String(err);
18247
+ }
18248
+ var AppearanceStore = class {
18249
+ constructor(filePath = appearancePath()) {
18250
+ this.filePath = filePath;
18251
+ this.load();
18252
+ }
18253
+ filePath;
18254
+ prefs = {};
18255
+ loadErrors = [];
18256
+ writeErrors = [];
18257
+ get() {
18258
+ return { ...this.prefs };
18259
+ }
18260
+ set(patch) {
18261
+ const next = { ...this.prefs };
18262
+ for (const key of ["theme", "lang"]) {
18263
+ const value = patch[key];
18264
+ if (typeof value === "string" && value.length > 0) next[key] = value;
18265
+ }
18266
+ if (next.theme === this.prefs.theme && next.lang === this.prefs.lang) return;
18267
+ this.prefs = next;
18268
+ this.save();
18269
+ }
18270
+ load() {
18271
+ this.prefs = {};
18272
+ if (!existsSync(this.filePath)) return;
18273
+ let parsed;
18274
+ try {
18275
+ parsed = JSON.parse(readFileSync(this.filePath, "utf-8"));
18276
+ } catch (err) {
18277
+ this.loadErrors.push(
18278
+ (lang) => t("appearance.unreadable", { path: this.filePath, reason: describe8(err) }, lang)
18279
+ );
18280
+ return;
18281
+ }
18282
+ this.adopt(parsed);
18283
+ }
18284
+ adopt(parsed) {
18285
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return;
18286
+ const file = parsed;
18287
+ if (file.version !== FILE_VERSION4) return;
18288
+ if (typeof file.theme === "string" && file.theme.length > 0) this.prefs.theme = file.theme;
18289
+ if (typeof file.lang === "string" && file.lang.length > 0) this.prefs.lang = file.lang;
18290
+ }
18291
+ save() {
18292
+ const body2 = JSON.stringify(
18293
+ { version: FILE_VERSION4, ...this.prefs },
18294
+ null,
18295
+ 2
18296
+ );
18297
+ const tmp = `${this.filePath}.${process.pid}.tmp`;
18298
+ try {
18299
+ mkdirSync(dirname(this.filePath), { recursive: true });
18300
+ writeFileSync(tmp, body2, { encoding: "utf-8", mode: 384 });
18301
+ renameSync(tmp, this.filePath);
18302
+ } catch (err) {
18303
+ rmSync(tmp, { force: true });
18304
+ this.writeErrors.push(
18305
+ (lang) => t("appearance.write_failed", { path: this.filePath, reason: describe8(err) }, lang)
18306
+ );
18307
+ }
18308
+ }
18309
+ };
18199
18310
  function ruleAskActive(level) {
18200
18311
  return level !== "bypass";
18201
18312
  }
@@ -18446,11 +18557,11 @@ var ApprovalCache = class {
18446
18557
  return !rel.startsWith("..") && !isAbsolute(rel);
18447
18558
  }
18448
18559
  normalizeTarget(target) {
18449
- const t80 = target.trim();
18450
- if (!t80) return "";
18451
- const unix = t80.replace(/\\/g, "/");
18560
+ const t81 = target.trim();
18561
+ if (!t81) return "";
18562
+ const unix = t81.replace(/\\/g, "/");
18452
18563
  if (unix.startsWith("/") || /^[A-Za-z]:\//.test(unix)) return resolve(unix);
18453
- return t80;
18564
+ return t81;
18454
18565
  }
18455
18566
  load() {
18456
18567
  try {
@@ -18553,9 +18664,9 @@ function createSharedPermissionState(cache) {
18553
18664
  };
18554
18665
  }
18555
18666
  function cacheKeyFor(raw) {
18556
- const t80 = raw.trim();
18557
- if (!t80) return null;
18558
- return t80.slice(0, 500);
18667
+ const t81 = raw.trim();
18668
+ if (!t81) return null;
18669
+ return t81.slice(0, 500);
18559
18670
  }
18560
18671
  // src/permission/manager.ts
18561
18672
  var log3 = createLogger("permission");
@@ -20985,7 +21096,7 @@ var HookManager = class {
20985
21096
  return { blocked: true, reason: result.rejectReason || t("hook_load.rejected") };
20986
21097
  }
20987
21098
  } catch (err) {
20988
- this.log("warn", `[HookManager] ${type} \u7684 command hook \u6267\u884C\u5F02\u5E38: ${describe9(err)}`, {
21099
+ this.log("warn", `[HookManager] ${type} \u7684 command hook \u6267\u884C\u5F02\u5E38: ${describe10(err)}`, {
20989
21100
  hookType: type,
20990
21101
  command: config.command
20991
21102
  });
@@ -21003,7 +21114,7 @@ var HookManager = class {
21003
21114
  (_, reject2) => setTimeout(() => reject2(new Error("Hook timeout")), HOOK_TIMEOUT_MS)
21004
21115
  )
21005
21116
  ]).catch((err) => {
21006
- this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe9(err)}`, {
21117
+ this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe10(err)}`, {
21007
21118
  hookType: type,
21008
21119
  plugin: reg.plugin
21009
21120
  });
@@ -21015,7 +21126,7 @@ var HookManager = class {
21015
21126
  if (!matchesHook(entry.matcher, event)) continue;
21016
21127
  for (const config of entry.configs) {
21017
21128
  runCommandHook(config, event, ctx.workDir).then((result) => reportIfNeverRan(this.log, type, config, result)).catch((err) => {
21018
- this.log("warn", `[HookManager] ${type} \u7684 command hook \u5F02\u6B65\u5F02\u5E38: ${describe9(err)}`, {
21129
+ this.log("warn", `[HookManager] ${type} \u7684 command hook \u5F02\u6B65\u5F02\u5E38: ${describe10(err)}`, {
21019
21130
  hookType: type,
21020
21131
  command: config.command
21021
21132
  });
@@ -21036,7 +21147,7 @@ var HookManager = class {
21036
21147
  ]);
21037
21148
  if (result !== null && result !== void 0) return result;
21038
21149
  } catch (err) {
21039
- this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe9(err)}`, {
21150
+ this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe10(err)}`, {
21040
21151
  hookType: type,
21041
21152
  plugin: reg.plugin
21042
21153
  });
@@ -21057,7 +21168,7 @@ var HookManager = class {
21057
21168
  ]);
21058
21169
  if (result) results.push(result);
21059
21170
  } catch (err) {
21060
- this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe9(err)}`, {
21171
+ this.log("warn", `[HookManager] ${type} (${reg.plugin}) \u5931\u8D25: ${describe10(err)}`, {
21061
21172
  hookType: type,
21062
21173
  plugin: reg.plugin
21063
21174
  });
@@ -21074,7 +21185,7 @@ var HookManager = class {
21074
21185
  const verdict = verdictOf2(result);
21075
21186
  if (verdict) results.push(verdict);
21076
21187
  } catch (err) {
21077
- this.log("warn", `[HookManager] ${type} \u7684 command hook \u6267\u884C\u5F02\u5E38: ${describe9(err)}`, {
21188
+ this.log("warn", `[HookManager] ${type} \u7684 command hook \u6267\u884C\u5F02\u5E38: ${describe10(err)}`, {
21078
21189
  hookType: type,
21079
21190
  command: config.command
21080
21191
  });
@@ -21090,7 +21201,7 @@ var HookManager = class {
21090
21201
  return [...list].sort((a, b) => a.priority - b.priority);
21091
21202
  }
21092
21203
  };
21093
- function describe9(err) {
21204
+ function describe10(err) {
21094
21205
  return err instanceof Error ? err.message : String(err);
21095
21206
  }
21096
21207
  function verdictOf2(result) {
@@ -22413,7 +22524,7 @@ async function withStaged(source, opts, fn) {
22413
22524
  shape = existsSync(join(unpacked, SKILL_FILE)) ? "skill-dir" : "tree";
22414
22525
  }
22415
22526
  const staged = stageImport(root, staging, shape, opts.lang);
22416
- const preview3 = describe10(source, form, staged.skills, staged.issues, opts.existing, opts.lang);
22527
+ const preview3 = describe11(source, form, staged.skills, staged.issues, opts.existing, opts.lang);
22417
22528
  if (preview3.skills.length === 0) {
22418
22529
  const detail = t("skill.import_empty", { path: source }, opts.lang);
22419
22530
  return { ok: false, reason: "empty", detail, issues: preview3.issues };
@@ -22424,7 +22535,7 @@ async function withStaged(source, opts, fn) {
22424
22535
  rmSync(unpacked, { recursive: true, force: true });
22425
22536
  }
22426
22537
  }
22427
- function describe10(source, form, staged, issues, existing, lang) {
22538
+ function describe11(source, form, staged, issues, existing, lang) {
22428
22539
  const byName = new Map(existing.map((s) => [s.name, s.scope]));
22429
22540
  const entries2 = [];
22430
22541
  const taken = /* @__PURE__ */ new Set();
@@ -23273,10 +23384,10 @@ ${extra}` : withGoal;
23273
23384
  return messages.reduce((sum, m) => sum + estimateTokens(m.content), 0);
23274
23385
  }
23275
23386
  };
23276
- var FILE_VERSION4 = 1;
23387
+ var FILE_VERSION5 = 1;
23277
23388
  var LEVELS = ["trusted", "untrusted"];
23278
23389
  var SCOPES = ["directory", "directory-tree"];
23279
- function describe11(err) {
23390
+ function describe12(err) {
23280
23391
  return err instanceof Error ? err.message : String(err);
23281
23392
  }
23282
23393
  function covers(base, target, scope) {
@@ -23350,7 +23461,7 @@ var TrustManager = class {
23350
23461
  raw = readFileSync(this.filePath, "utf-8");
23351
23462
  } catch (err) {
23352
23463
  this.loadErrors.push(
23353
- t("trust_gate.record_read_failed", { path: this.filePath, reason: describe11(err) })
23464
+ t("trust_gate.record_read_failed", { path: this.filePath, reason: describe12(err) })
23354
23465
  );
23355
23466
  return;
23356
23467
  }
@@ -23359,7 +23470,7 @@ var TrustManager = class {
23359
23470
  parsed = JSON.parse(raw);
23360
23471
  } catch (err) {
23361
23472
  this.loadErrors.push(
23362
- t("trust_gate.record_bad_json", { path: this.filePath, reason: describe11(err) })
23473
+ t("trust_gate.record_bad_json", { path: this.filePath, reason: describe12(err) })
23363
23474
  );
23364
23475
  return;
23365
23476
  }
@@ -23371,12 +23482,12 @@ var TrustManager = class {
23371
23482
  return;
23372
23483
  }
23373
23484
  const file = parsed;
23374
- if (file.version !== FILE_VERSION4) {
23485
+ if (file.version !== FILE_VERSION5) {
23375
23486
  this.loadErrors.push(
23376
23487
  t("trust_gate.record_bad_version", {
23377
23488
  path: this.filePath,
23378
23489
  found: String(file.version),
23379
- expected: FILE_VERSION4
23490
+ expected: FILE_VERSION5
23380
23491
  })
23381
23492
  );
23382
23493
  return;
@@ -23397,7 +23508,7 @@ var TrustManager = class {
23397
23508
  save() {
23398
23509
  mkdirSync(dirname(this.filePath), { recursive: true });
23399
23510
  const body2 = JSON.stringify(
23400
- { version: FILE_VERSION4, records: this.records },
23511
+ { version: FILE_VERSION5, records: this.records },
23401
23512
  null,
23402
23513
  2
23403
23514
  );
@@ -23408,7 +23519,7 @@ var TrustManager = class {
23408
23519
  } catch (err) {
23409
23520
  rmSync(tmp, { force: true });
23410
23521
  throw new Error(
23411
- t("trust_gate.record_write_failed", { path: this.filePath, reason: describe11(err) })
23522
+ t("trust_gate.record_write_failed", { path: this.filePath, reason: describe12(err) })
23412
23523
  );
23413
23524
  }
23414
23525
  }
@@ -23797,4 +23908,4 @@ function trunc(stdout, stderr) {
23797
23908
  * `--tree` 的命令帮助里,让用户自己知道 `--tree` 意味着什么。
23798
23909
  */
23799
23910
 
23800
- export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_RETENTION_DEFAULTS, AgentLoop, ApprovalCache, BLOCKED_TOOLS, BudgetGuard, BudgetStore, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, CheckpointManager, CheckpointStore, CodeSandbox, ComplianceEngine, ContextCompressor, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, DelegateManager, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, FTS_TABLES, FTS_TRIGGERS, GOAL_BLOCK_CODES, GoalService, GoalStore, HEADLESS_AUDIT_CODES, HookManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, ImageLoadError, ImportTrustStore, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, LastOpenSessions, 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, ManagedPolicyError, ManagedSettingsSchema, MemoryManager, ModelFailureTracker, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, 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, PermissionManager, PlanModeState, PluginAuthorSchema, PluginStore, PolicyRuleSchema, ProviderError, ProviderRouter, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, RecentWorkspaces, 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, ScheduleRecorder, ScheduleRegistrar, ScheduleStore, SessionManager, SessionQueries, SessionReferences, SettingsFileError, SettingsFileSchema, SkillLearner, SkillSystem, TOOL_SEARCH_TOOL, TaskNoticeTracker, ToolRegistry, TrackerDB, TrustManager, Workspace, 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, runCommand2 as 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 };
23911
+ export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_RETENTION_DEFAULTS, AgentLoop, AppearanceStore, ApprovalCache, BLOCKED_TOOLS, BudgetGuard, BudgetStore, CHECKPOINT_MAX_TOTAL_BYTES, CLAUDE_EVENT_NAMES, CLAUDE_TOOL_NAMES, CODE_MODE_LIMITS, CODE_MODE_SDK_TAG, CONFIG_KEYS, CURRENT_CONFIG_VERSION, CheckpointManager, CheckpointStore, CodeSandbox, ComplianceEngine, ContextCompressor, DEFAULT_COMPLIANCE_ACTIONS, DEFAULT_COMPLIANCE_SETTINGS, DEFAULT_COMPRESSION_THRESHOLD, DEFAULT_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, DelegateManager, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, FTS_TABLES, FTS_TRIGGERS, GOAL_BLOCK_CODES, GoalService, GoalStore, HEADLESS_AUDIT_CODES, HookManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, ImageLoadError, ImportTrustStore, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, LastOpenSessions, 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, ManagedPolicyError, ManagedSettingsSchema, MemoryManager, ModelFailureTracker, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, 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, PermissionManager, PlanModeState, PluginAuthorSchema, PluginStore, PolicyRuleSchema, ProviderError, ProviderRouter, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, RecentWorkspaces, 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, ScheduleRecorder, ScheduleRegistrar, ScheduleStore, SessionManager, SessionQueries, SessionReferences, SettingsFileError, SettingsFileSchema, SkillLearner, SkillSystem, TOOL_SEARCH_TOOL, TaskNoticeTracker, ToolRegistry, TrackerDB, TrustManager, Workspace, 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, runCommand2 as 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/core",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "private": false,
5
5
  "description": "epoch-agent 核心引擎:ReAct 循环、Provider 路由、工具调度、记忆管理",
6
6
  "repository": {
@@ -27,8 +27,8 @@
27
27
  "gpt-tokenizer": "^3.4.0",
28
28
  "js-yaml": "^5.2.3",
29
29
  "zod": "^4.4.3",
30
- "@epoch-agent/infra": "0.20.1",
31
- "@epoch-agent/protocol": "0.20.1"
30
+ "@epoch-agent/infra": "0.21.0",
31
+ "@epoch-agent/protocol": "0.21.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@ai-sdk/amazon-bedrock": "^5.0.40",