@epoch-agent/core 2.6.1 → 2.8.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
@@ -388,6 +388,12 @@ artifacts 的 512MB 从此**出自同一张表**。在这之前两个数字各
388
388
  - **这条迁移跑不成也要让人接着用。** 它是全仓唯一一条单独 `migrate()`、单独兜住的
389
389
  迁移(重建索引要在 WAL 里写下整份新索引,盘快满时会失败)——
390
390
  失败就退回旧 schema 接着跑,`epoch doctor` 会说「索引还是老形态」,下次启动再试
391
+ - **两张表是**合并**用的,不是主备。** `messages_fts`(`porter unicode61`,整词 /
392
+ 词干)的结果在前,`messages_fts_trigram`(三字符滑窗,中文靠它)只往后补漏,
393
+ 按 `messages.id` 去重 —— 判据在 [session/fts.ts](src/session/fts.ts) 的
394
+ `mergeRankedRows`。⚠️ 写成「porter 没结果才查 trigram」会**静默丢结果**:中文
395
+ 只有被标点切成独立整词时 porter 才认得出,同一批候选里有一处被切开了,另外
396
+ 那几处就再也搜不到(2026-10-22 修的就是这个)
391
397
  - **`count(*) FROM messages_fts` 在这种表上数的是内容表**,别拿它当「索引里有多少
392
398
  份」(那条判据会变成同义反复)。`fts-health.ts` 数的是 `_docsize` 影子表
393
399
  - **删掉的字节要靠 `reclaimFtsSpace()` 收**(`optimize` + `VACUUM`,同在
package/dist/index.d.ts CHANGED
@@ -5879,9 +5879,11 @@ declare class SessionQueries {
5879
5879
  * 在这一步只需要判断「哪段会话值得进去看」。真要看细节,下一步是
5880
5880
  * `session_messages_search`。
5881
5881
  *
5882
- * 两张 FTS 索引的分工照搬 `SessionDB.search()`:先走 `porter unicode61`
5883
- * 那张,一条都没有再退到 trigram。**中文靠的就是 trigram** —— unicode61
5884
- * 会把一整串中文切成一个 token,「前导」搜不到「前导导致的」。
5882
+ * 两张 FTS 索引的分工照搬 `SessionDB.search()`:**合并,不是 fallback**
5883
+ * (2026-10-22 起;判据在 [fts.ts](./fts.ts) 的 `mergeRankedRows`)。
5884
+ * **中文靠的就是 trigram** —— unicode61 会把一整串中文切成一个 token,
5885
+ * 「前导」搜不到「前导导致的」;而只要同一批候选里有一处中文被标点切成独立整词,
5886
+ * porter 就非空,旧写法于是把 trigram 的答案整个丢掉。
5885
5887
  */
5886
5888
  searchSessions(input: SearchSessionsInput): SessionHit[];
5887
5889
  /**
@@ -5950,6 +5952,18 @@ declare class SessionQueries {
5950
5952
  * ⚠️ **没有 `AND m.active = 1`,而且不许加**(见文件头)。
5951
5953
  */
5952
5954
  private contentRows;
5955
+ /**
5956
+ * 两张 FTS 索引的结果**合并**成一份候选 —— 这一族里唯一一处「先查哪张、怎么拼」。
5957
+ *
5958
+ * 抽出来是因为跨会话({@link contentRows})与会话内({@link messageRows})那两条
5959
+ * SQL 除了 `WHERE` 和参数之外逐字相同,而「是不是 fallback」这件事**必须两边一样**
5960
+ * —— 只改一边,模型会看到「同一次检索里跨会话找得到、钻进那段会话反而找不到」。
5961
+ *
5962
+ * 顺序与去重的判据在 [fts.ts](./fts.ts) 的 `mergeRankedRows`,这里只负责三件事:
5963
+ * 拼 MATCH 表达式、在 {@link belowTrigramFloor} 时干脆不查 trigram(那张索引对
5964
+ * <3 字符的词恒空)、把 `limit` 一起递进去。
5965
+ */
5966
+ private rankedRows;
5953
5967
  /**
5954
5968
  * 标题命中。走 `LIKE` 而不是 FTS —— 标题不在任何全文索引里
5955
5969
  * (两张 FTS 表的内容源都是 `messages.content`)。
@@ -8600,9 +8614,14 @@ declare function extractArchive(archive: string, dest: string): Promise<ExtractO
8600
8614
  * 不会是用户自己的东西 —— 虚拟环境那一档不成立,所以它走 {@link isVirtualenv}。
8601
8615
  */
8602
8616
  declare const PACK_EXCLUDES: readonly string[];
8603
- /** 默认容量上限。超了拒 —— 一个 2GB 的包交给宿主回调不是「慢一点」,是把它打挂 */
8604
- declare const PACK_MAX_BYTES: number;
8605
- declare const PACK_MAX_FILES = 2000;
8617
+ /**
8618
+ * 调用方自己给的收窄条件。**不给就是不收窄。**
8619
+ *
8620
+ * ⚠️ 2026-10-22 去掉了原来那对默认上限(`PACK_MAX_BYTES` 50 MB /
8621
+ * `PACK_MAX_FILES` 2000):它们真正拦住的不是「谁把仓库根目录当插件打包」
8622
+ * (那种目录本来就会被 `PACK_EXCLUDES` 和清单校验挡掉),而是一个自己带
8623
+ * 视频 / 模型权重的插件作者。要收窄的调用方仍然显式传这两格。
8624
+ */
8606
8625
  interface PackLimits {
8607
8626
  maxBytes?: number;
8608
8627
  maxFiles?: number;
@@ -8789,7 +8808,15 @@ interface PluginInventory {
8789
8808
  issues: ParseIssue[];
8790
8809
  }
8791
8810
  /**
8792
- * **六类**扩展物的总数。0 表示这个插件装了等于没装,值得在预览里说一句。
8811
+ * **六类**扩展物的总数。
8812
+ *
8813
+ * ⚠️ **0 不等于「这个插件什么都没带」**(2026-10-23 改)。它只说明六类
8814
+ * (命令 / 角色 / 技能 / hook / deny / MCP)里一条都没有 —— 而清单里合法的还有
8815
+ * `panel`(插件自带一块嵌进输入框上方的页)和 `appearance`(外观预设)这两格,
8816
+ * 它们不在这六类里。所以 0 的用法只有两种:当作**六类这一面的**空判据,
8817
+ * 或者判两套扫描路的口径是否一致(见下)。**别拿它推「装了等于没装」** ——
8818
+ * 那句话曾经出现在 web 的卡片和 CLI 的 `plugin list` 上,2026-10-23 拿掉了,
8819
+ * 起因是一份只带面板的主题插件被它说成了空的。
8793
8820
  *
8794
8821
  * ## ⚠️ 这个数必须等于 `LoadedPlugin.counts` 六格之和
8795
8822
  *
@@ -9535,6 +9562,31 @@ type LifecycleOutcome = {
9535
9562
  ok: false;
9536
9563
  reason: string;
9537
9564
  };
9565
+ /**
9566
+ * 启用 / 停用的结局。**比 {@link LifecycleOutcome} 多一格 `changed`**(2026-10-23)。
9567
+ *
9568
+ * ## 为什么要这一格
9569
+ *
9570
+ * 停用 / 启用**只有真变了才该让上层立「重启后生效」那格闩**。点一个本来就停用的
9571
+ * 插件,`epoch plugin disable` 会回一句「本来就是停用状态」,盘上一个字节都没动
9572
+ * —— 那时要是照样把 `pendingRestart` 立起来,宿主会弹一条「插件改动还没生效」
9573
+ * 的重启通知,而实际上什么都没变。
9574
+ *
9575
+ * 判据在 `setPluginEnabled` 的 `hit.enabled !== enabled`:那一格本来就算出来了,
9576
+ * 只是以前只拿它选文案。这一轮把它递出去,让「要不要立闩」和「该说哪句话」
9577
+ * 用**同一个**答案 —— 分成两处判的话,它们分叉的那天屏幕上是一句真话配一个假动作。
9578
+ *
9579
+ * ⚠️ **uninstall / update 照旧用 `LifecycleOutcome`**:它们没有「本来就是这个状态」
9580
+ * 这一档,多一格 `changed` 恒为 true,等于给调用方多一个永远不需要看的字段。
9581
+ */
9582
+ type ToggleOutcome = {
9583
+ ok: true;
9584
+ message: string;
9585
+ changed: boolean;
9586
+ } | {
9587
+ ok: false;
9588
+ reason: string;
9589
+ };
9538
9590
  /**
9539
9591
  * 卸载:删记录,**软链只删链、不删用户的源码目录**(验收 #15)。
9540
9592
  *
@@ -9551,7 +9603,7 @@ declare function uninstallPlugin(name: string, opts: LifecycleOptions): Promise<
9551
9603
  * 停用之后扩展物全部消失、目录还在 —— 这正是它和 `uninstall` 的分工:
9552
9604
  * 「这个插件今天碍事」和「我不要它了」是两件事,前者不该付出重装的代价。
9553
9605
  */
9554
- declare function setPluginEnabled(name: string, enabled: boolean, opts: LifecycleOptions): Promise<LifecycleOutcome>;
9606
+ declare function setPluginEnabled(name: string, enabled: boolean, opts: LifecycleOptions): Promise<ToggleOutcome>;
9555
9607
  /**
9556
9608
  * 更新:按记录里的 `source` 重来一遍。
9557
9609
  *
@@ -13747,6 +13799,7 @@ declare const EpochConfigSchema: z.ZodObject<{
13747
13799
  user: z.ZodOptional<z.ZodObject<{
13748
13800
  label: z.ZodString;
13749
13801
  icon: z.ZodOptional<z.ZodString>;
13802
+ avatar: z.ZodOptional<z.ZodString>;
13750
13803
  }, z.core.$strip>>;
13751
13804
  settingsHidden: z.ZodOptional<z.ZodArray<z.ZodString>>;
13752
13805
  settingsPanes: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -21854,4 +21907,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
21854
21907
  */
21855
21908
  declare function codeModeWorkerPath(): string | undefined;
21856
21909
 
21857
- export { ABOUT_DESC_MAX_CHARS, ABOUT_README_MAX_CHARS, AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_RETENTION_DEFAULTS, type AcquireResult, type ActivePlugin, type AgentConfig, AgentLoop, type AgentProvider, type AgentSite, type AgentSiteRef, AppearanceStore, type AppendMessageInput, ApprovalCache, type ApprovalDecision, 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, type EntryProbeCode, type EntryProbeResult, 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 ImportGoal, type ImportMessage, type ImportNode, type ImportPartsResult, type ImportSessionInput, type ImportSessionMeta, type ImportSessionResult, type ImportSkipReason, type ImportTodo, ImportTrustStore, type InstallDependency, type InstallOptions, type InstallOutcome, type InstallPreview, type InstallStep, 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_ENTRIES_FILE, 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, type MemoryImportRecord, type MemoryImportResult, MemoryManager, type MemoryManagerOptions, type MemoryNotice, type MemoryRemoval, 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_ICON_MAX_BYTES, 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 PluginAbout, type PluginArtifacts, type PluginAuthor, PluginAuthorSchema, type PluginCommandDir, type PluginCounts, type PluginDoc, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginScope, 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_ASSET_DIRS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_FILE, 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 ScheduleImportInput, 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, UNSETTABLE_USER_KEYS, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, approvalEntryFor, approvalRootFor, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, capabilityOfRef, 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, createPluginScope, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, discoverySpec, 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, grantedPathsFor, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, hasUsableModel, imageFromBase64, imageFromPath, imagePartTokens, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, isValidInterval, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listEntryModels, listRunningSchedules, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadModelEntries, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelEntriesPath, modelListCandidates, needsAllowlist, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, normalizeModelEntry, normalizeTrigger, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelEntry, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistFailureCode, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readEntryKey, readImageSize, readMarketplaces, readPluginAbout, readPluginIcon, readPluginManifest, readPluginRecords, 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, saveModelEntries, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, testModelEntry, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, unsetUserSetting, updateMarketplace, updatePlugin, usdToMicros, validateSchedule, validateTrigger, validateWindow, withGoalCompression, withGoalPrompt, workspaceDisplayPath, writeSettingValue };
21910
+ export { ABOUT_DESC_MAX_CHARS, ABOUT_README_MAX_CHARS, AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_RETENTION_DEFAULTS, ATTACHMENT_MAX_TOTAL_BYTES, ATTACHMENT_RETENTION_DEFAULTS, type AcquireResult, type ActivePlugin, type AgentConfig, AgentLoop, type AgentProvider, type AgentSite, type AgentSiteRef, AppearanceStore, type AppendMessageInput, ApprovalCache, type ApprovalDecision, 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, type EntryProbeCode, type EntryProbeResult, 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 ImportGoal, type ImportMessage, type ImportNode, type ImportPartsResult, type ImportSessionInput, type ImportSessionMeta, type ImportSessionResult, type ImportSkipReason, type ImportTodo, ImportTrustStore, type InstallDependency, type InstallOptions, type InstallOutcome, type InstallPreview, type InstallStep, 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_ENTRIES_FILE, 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, type MemoryImportRecord, type MemoryImportResult, MemoryManager, type MemoryManagerOptions, type MemoryNotice, type MemoryRemoval, 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, PERMISSION_AUDIT_CODES, PLUGIN_ICON_MAX_BYTES, 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 PluginAbout, type PluginArtifacts, type PluginAuthor, PluginAuthorSchema, type PluginCommandDir, type PluginCounts, type PluginDoc, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginScope, 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_ASSET_DIRS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_FILE, 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 ScheduleImportInput, 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 ToggleOutcome, 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, UNSETTABLE_USER_KEYS, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, approvalEntryFor, approvalRootFor, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, capabilityOfRef, 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, createPluginScope, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, discoverySpec, 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, grantedPathsFor, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, hasUsableModel, imageFromBase64, imageFromPath, imagePartTokens, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, isValidInterval, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listEntryModels, listRunningSchedules, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadModelEntries, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelEntriesPath, modelListCandidates, needsAllowlist, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, normalizeModelEntry, normalizeTrigger, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelEntry, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistFailureCode, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readEntryKey, readImageSize, readMarketplaces, readPluginAbout, readPluginIcon, readPluginManifest, readPluginRecords, 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, saveModelEntries, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, testModelEntry, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, unsetUserSetting, updateMarketplace, updatePlugin, usdToMicros, validateSchedule, validateTrigger, validateWindow, withGoalCompression, withGoalPrompt, workspaceDisplayPath, writeSettingValue };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { REASONING_EFFORTS, MODEL_ENTRY_PROTOCOLS, PROVIDER_TYPES, isModelEntryI
2
2
  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';
3
3
  import { existsSync, statSync, readdirSync, readFileSync, mkdirSync, writeFileSync, rmSync, renameSync, realpathSync, symlinkSync, cpSync, lstatSync, unlinkSync, rmdirSync, mkdtempSync, copyFileSync, openSync, writeSync, closeSync, readSync } from 'fs';
4
4
  import { homedir, platform, tmpdir, hostname } from 'os';
5
- import { join, dirname, resolve, relative, isAbsolute, extname, sep, basename } from 'path';
5
+ import { join, dirname, resolve, relative, isAbsolute, extname, sep, basename, delimiter } from 'path';
6
6
  import { execFile, execSync, execFileSync, spawn } from 'child_process';
7
7
  import { createLogger, dbPath, resolveHomeDir, DEFAULT_MAX_TURNS, PROJECT_DIR_NAME, guardSpawn, t, suggestKey, misspelledKeyIssues, openDatabase, migrate, releaseDatabase, parseLenient, issueDetails, splitWords, unknownKeyIssues, checkpointsDir, expandPath, pluginsDir, projectHooksPath, projectClaudeSettingsPath, projectClaudeLocalSettingsPath, projectSettingsPath, projectLocalSettingsPath, projectPoliciesDir, trustedImportsPath, canProbeGit, budgetStatePath, artifactsDir, isInWorkspace, UNLIMITED_TURNS, turnLimitOf, configPath, managedSettingsPath, listStoredSecretNames, maskApiKey, unsetSectionField, setSectionField, countCodePoints, headCodePoints, attachmentsDir, workspacesPath, samePath, lastSessionsPath, appearancePath, automationLogsDir, projectComplianceDir, projectSkillsDir, trustPath, projectCommandsDir, detectBackend, EXEC_PATH_AS_NODE_ENV, isolate, createStreamDecoder, parseShellCommand, writeArtifact, getSecretValues, envPath, checkDangerousCommand, checkObfuscation, keepHeadAndTail, normalizeForMatch, isReadOnlyCommand, CODE_EXEC_ROOTS, tailCodePoints } from '@epoch-agent/infra';
8
8
  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';
@@ -2569,7 +2569,7 @@ function narrow(outcome) {
2569
2569
  function createEnterTool(deps) {
2570
2570
  return {
2571
2571
  name: "enter_plan_mode",
2572
- description: "\u8FDB\u5165 plan \u6A21\u5F0F\uFF1A\u63A5\u4E0B\u6765\u53EA\u8BFB\u5730\u8C03\u7814\uFF08\u4E0D\u5199\u6587\u4EF6\u3001\u4E0D\u6267\u884C\u547D\u4EE4\u3001\u4E0D\u8054\u7F51\uFF09\uFF0C\u8C03\u7814\u5B8C\u7528 exit_plan_mode \u4EA4\u4E00\u4EFD\u8BA1\u5212\u7ED9\u7528\u6237\u6279\u3002\u4EFB\u52A1\u8981\u52A8\u4E09\u4E2A\u4EE5\u4E0A\u6587\u4EF6\u3001\u6709\u591A\u79CD\u5408\u7406\u5B9E\u73B0\u8DEF\u5F84\u3001\u8981\u52A0/\u6539\u4F9D\u8D56\u3001\u8981\u52A8\u8DE8\u5305\u5951\u7EA6\uFF0C\u6216\u8005\u7528\u6237\u7684\u63CF\u8FF0\u6709\u6B67\u4E49\u4E14\u6B67\u4E49\u4F1A\u6539\u53D8\u5B9E\u73B0\u65F6\uFF0C\u5148\u8C03\u5B83\u3002\u5355\u6587\u4EF6\u5C0F\u6539\u52A8\u3001\u53EA\u6709\u4E00\u79CD\u660E\u663E\u505A\u6CD5\u3001\u6539\u6587\u6848\u4FEE typo \u4E0D\u8981\u7528\u3002",
2572
+ description: "\u8FDB\u5165 plan \u6A21\u5F0F\uFF1A\u63A5\u4E0B\u6765\u53EA\u8BFB\uFF08\u4E0D\u5199\u6587\u4EF6\u3001\u4E0D\u6267\u884C\u547D\u4EE4\u3001\u4E0D\u8054\u7F51\uFF09\uFF0C\u8C03\u7814\u5B8C\u7528 exit_plan_mode \u4EA4\u4E00\u4EFD\u8BA1\u5212\u7ED9\u7528\u6237\u6279\u3002**\u5148\u628A\u8303\u56F4\u6478\u5230\u80FD\u5199\u51FA\u8BA1\u5212\u4E86\u518D\u8C03\u5B83** \u2014\u2014 plan \u7EA7\u522B\u4E0B\u5DE5\u4F5C\u533A\u5916\u7684\u8BFB\u53D6\u8981\u7528\u6237\u9010\u4E2A\u6279\u51C6\uFF0C\u5927\u8303\u56F4\u8C03\u7814\u653E\u8FDB\u53BB\u4F1A\u53D8\u6210\u4E00\u4E32\u786E\u8BA4\u6846\uFF1B\u8FDB plan \u4E4B\u540E\u53EA\u505A\u5B9A\u70B9\u6838\u5B9E\u3002\u4EFB\u52A1\u8981\u52A8\u4E09\u4E2A\u4EE5\u4E0A\u6587\u4EF6\u3001\u6709\u591A\u79CD\u5408\u7406\u5B9E\u73B0\u8DEF\u5F84\u3001\u8981\u52A0/\u6539\u4F9D\u8D56\u3001\u8981\u52A8\u8DE8\u5305\u5951\u7EA6\uFF0C\u6216\u8005\u7528\u6237\u7684\u63CF\u8FF0\u6709\u6B67\u4E49\u4E14\u6B67\u4E49\u4F1A\u6539\u53D8\u5B9E\u73B0\u65F6\uFF0C\u624D\u503C\u5F97\u51FA\u8BA1\u5212\u3002\u5355\u6587\u4EF6\u5C0F\u6539\u52A8\u3001\u53EA\u6709\u4E00\u79CD\u660E\u663E\u505A\u6CD5\u3001\u6539\u6587\u6848\u4FEE typo \u4E0D\u8981\u7528\u3002",
2573
2573
  parameters: {
2574
2574
  type: "object",
2575
2575
  properties: {
@@ -3914,6 +3914,21 @@ function buildFtsMatchQuery(safeQuery) {
3914
3914
  function buildTrigramMatchQuery(safeQuery) {
3915
3915
  return safeQuery.split(/\s+/).filter(Boolean).map((word) => `"${word}"`).join(" ");
3916
3916
  }
3917
+ function mergeRankedRows(primary, secondary, limit) {
3918
+ const merged = [];
3919
+ const seen = /* @__PURE__ */ new Set();
3920
+ for (const row of primary) {
3921
+ seen.add(row.id);
3922
+ merged.push(row);
3923
+ if (merged.length >= limit) return merged;
3924
+ }
3925
+ for (const row of secondary) {
3926
+ if (seen.has(row.id)) continue;
3927
+ merged.push(row);
3928
+ if (merged.length >= limit) return merged;
3929
+ }
3930
+ return merged;
3931
+ }
3917
3932
  var TRIGRAM_MIN_CHARS = 3;
3918
3933
  function belowTrigramFloor(safeQuery) {
3919
3934
  const words = safeQuery.split(/\s+/).filter(Boolean);
@@ -4141,9 +4156,19 @@ var SessionQueries = class {
4141
4156
  ORDER BY rank
4142
4157
  LIMIT @limit`;
4143
4158
  const limitRows = limit * CANDIDATE_FACTOR;
4144
- const fts = this.db.prepare(sql("messages_fts")).all({ ...visParams, query: buildFtsMatchQuery(safe), limit: limitRows });
4145
- if (fts.length > 0) return fts;
4146
- return this.db.prepare(sql("messages_fts_trigram")).all({ ...visParams, query: buildTrigramMatchQuery(safe), limit: limitRows });
4159
+ return this.rankedRows(sql, safe, { ...visParams, limit: limitRows }, limitRows);
4160
+ }
4161
+ rankedRows(sql, safe, params, limit) {
4162
+ const porter = this.db.prepare(sql("messages_fts")).all({
4163
+ ...params,
4164
+ query: buildFtsMatchQuery(safe)
4165
+ });
4166
+ if (belowTrigramFloor(safe)) return porter;
4167
+ const trigram = this.db.prepare(sql("messages_fts_trigram")).all({
4168
+ ...params,
4169
+ query: buildTrigramMatchQuery(safe)
4170
+ });
4171
+ return mergeRankedRows(porter, trigram, limit);
4147
4172
  }
4148
4173
  titleRows(safe, limit, visClause, visParams) {
4149
4174
  return this.db.prepare(
@@ -4190,9 +4215,7 @@ var SessionQueries = class {
4190
4215
  WHERE ${table} MATCH @query AND m.session_id = @sid
4191
4216
  ORDER BY rank
4192
4217
  LIMIT @limit`;
4193
- const fts = this.db.prepare(sql("messages_fts")).all({ query: buildFtsMatchQuery(safe), sid: sessionId, limit });
4194
- if (fts.length > 0) return fts;
4195
- return this.db.prepare(sql("messages_fts_trigram")).all({ query: buildTrigramMatchQuery(safe), sid: sessionId, limit });
4218
+ return this.rankedRows(sql, safe, { sid: sessionId, limit }, limit);
4196
4219
  }
4197
4220
  };
4198
4221
  // src/tools/builtin/session-list.ts
@@ -7293,8 +7316,6 @@ var SECRET_LOOKING = [
7293
7316
  /\.key$/i,
7294
7317
  /^id_(rsa|dsa|ecdsa|ed25519)$/i
7295
7318
  ];
7296
- var PACK_MAX_BYTES = 50 * 1024 * 1024;
7297
- var PACK_MAX_FILES = 2e3;
7298
7319
  function planPack(dir, limits = {}) {
7299
7320
  const read = readPluginManifest(dir);
7300
7321
  if (!read.manifest) {
@@ -7302,8 +7323,8 @@ function planPack(dir, limits = {}) {
7302
7323
  return { ok: false, reason: t("plugin_pack.not_a_plugin", { detail: `
7303
7324
  ${detail}` }) };
7304
7325
  }
7305
- const maxFiles = limits.maxFiles ?? PACK_MAX_FILES;
7306
- const maxBytes = limits.maxBytes ?? PACK_MAX_BYTES;
7326
+ const maxFiles = limits.maxFiles ?? Number.POSITIVE_INFINITY;
7327
+ const maxBytes = limits.maxBytes ?? Number.POSITIVE_INFINITY;
7307
7328
  const files = [];
7308
7329
  const skippedLinks = [];
7309
7330
  let totalBytes = 0;
@@ -8466,7 +8487,8 @@ async function setPluginEnabled(name, enabled, opts) {
8466
8487
  const verb = enabled ? t("plugin_lifecycle.verb_enable") : t("plugin_lifecycle.verb_disable");
8467
8488
  return {
8468
8489
  ok: true,
8469
- message: changed ? t("plugin_lifecycle.toggled", { verb, name }) : t("plugin_lifecycle.already", { name, verb })
8490
+ message: changed ? t("plugin_lifecycle.toggled", { verb, name }) : t("plugin_lifecycle.already", { name, verb }),
8491
+ changed
8470
8492
  };
8471
8493
  }
8472
8494
  async function updatePlugin(name, opts) {
@@ -11475,13 +11497,18 @@ var COMMAND_APPROVAL_POLICY = [
11475
11497
  ].join("\n");
11476
11498
  var PLAN_MODE_POLICY = [
11477
11499
  "<plan_mode>",
11478
- "\u9047\u5230\u5927\u4EFB\u52A1\u65F6\u5148\u8C03 `enter_plan_mode` \u53EA\u8BFB\u5730\u8C03\u7814\uFF0C\u518D\u7528 `exit_plan_mode` \u628A\u8BA1\u5212\u4EA4\u7ED9\u7528\u6237\u6279\u3002",
11500
+ "\u9047\u5230\u5927\u4EFB\u52A1\u65F6\uFF0C\u5148\u628A\u8303\u56F4\u6478\u6E05\u695A \u2014\u2014 \u8BFB\u6587\u4EF6\u3001\u641C\u7D22\u3001\u5217\u76EE\u5F55\uFF0C\u8FD9\u4E9B\u5728\u4F60\u73B0\u5728\u7684\u6743\u9650\u7EA7\u522B\u4E0B\u5C31\u80FD\u505A\u3002",
11501
+ "\u6478\u5230\u300C\u8981\u6539\u54EA\u4E9B\u6587\u4EF6\u3001\u52A8\u54EA\u51E0\u5904\u300D\u5FC3\u91CC\u6709\u6570\u4E86\uFF0C\u518D\u8C03 `enter_plan_mode` \u51FA\u8BA1\u5212\uFF0C",
11502
+ "\u7528 `exit_plan_mode` \u628A\u5B83\u4EA4\u7ED9\u7528\u6237\u6279\u3002",
11479
11503
  "\u7F16\u7801\u4EFB\u52A1\u6700\u8D35\u7684\u5931\u8D25\u4E0D\u662F\u5199\u9519\u4E00\u884C\uFF0C\u662F\u65B9\u5411\u7406\u89E3\u9519\u4E86\u7136\u540E\u5E72\u4E86\u4E8C\u5341\u5206\u949F\u3002",
11480
11504
  "**\u8BE5\u5148\u51FA\u8BA1\u5212**\uFF1A\u9884\u8BA1\u8981\u6539 3 \u4E2A\u4EE5\u4E0A\u6587\u4EF6 \xB7 \u6709\u591A\u79CD\u5408\u7406\u5B9E\u73B0\u8DEF\u5F84 \xB7 \u8981\u65B0\u589E\u6216\u6539\u52A8\u4F9D\u8D56 \xB7",
11481
11505
  "\u8981\u52A8\u8DE8\u5305\u5951\u7EA6 \xB7 \u7528\u6237\u7684\u63CF\u8FF0\u6709\u6B67\u4E49\u4E14\u6B67\u4E49\u4F1A\u6539\u53D8\u5B9E\u73B0\u3002",
11482
11506
  "**\u4E0D\u8BE5\u51FA\u8BA1\u5212**\uFF1A\u5355\u6587\u4EF6\u6539\u52A8 \xB7 \u53EA\u6709\u4E00\u79CD\u660E\u663E\u505A\u6CD5 \xB7 \u6539\u6587\u6848\u4FEE typo \xB7 \u52A0\u4E00\u6761\u6D4B\u8BD5\u3002",
11507
+ "\u26A0\uFE0F **\u522B\u4E00\u4E0A\u6765\u5C31\u8FDB plan \u6A21\u5F0F\u518D\u5F00\u59CB\u8C03\u7814**\uFF1Aplan \u7EA7\u522B\u4E0B\u5DE5\u4F5C\u533A\u5916\u7684\u8BFB\u53D6\u8981\u7528\u6237\u9010\u4E2A\u6279\u51C6\uFF0C",
11508
+ "\u628A\u5927\u8303\u56F4\u8C03\u7814\u653E\u8FDB\u53BB\uFF0C\u7B49\u4E8E\u8BA9\u4ED6\u4E3A\u6BCF\u4E00\u6B21\u7FFB\u76EE\u5F55\u70B9\u4E00\u6B21\u786E\u8BA4\u6846\u3002",
11509
+ "\u8FDB plan \u4E4B\u540E\u53EA\u505A**\u5B9A\u70B9\u6838\u5B9E**\uFF08\u67D0\u4E2A\u884C\u53F7\u3001\u67D0\u4E2A\u5951\u7EA6\u3001\u67D0\u6761\u7528\u4F8B\uFF09\uFF0C\u4E0D\u8981\u518D\u4ECE\u5934\u626B\u4E00\u904D\u3002",
11483
11510
  "\u5728 plan \u6A21\u5F0F\u91CC\u5199\u6587\u4EF6\u3001\u6267\u884C\u547D\u4EE4\u3001\u8054\u7F51\u3001\u8DD1\u4EE3\u7801\u90FD\u4F1A\u88AB\u62D2 \u2014\u2014 \u90A3\u4E0D\u662F\u6545\u969C\uFF0C\u662F\u8FD9\u4E2A\u6A21\u5F0F\u7684\u5B9A\u4E49\u3002",
11484
- "\u7167\u5E38\u80FD\u7528\u7684\u662F**\u53EA\u8BFB**\u90A3\u4E00\u6863\uFF1A\u8BFB\u6587\u4EF6\u3001\u641C\u7D22\u3001\u5217\u76EE\u5F55\u3001\u8BFB\u6280\u80FD\u6B63\u6587\u3001\u7FFB\u4F1A\u8BDD\u5386\u53F2\u3002\u7528\u5B83\u4EEC\u628A\u65B9\u6848\u6478\u624E\u5B9E\u3002",
11511
+ "\u7167\u5E38\u80FD\u7528\u7684\u662F**\u53EA\u8BFB**\u90A3\u4E00\u6863\uFF1A\u8BFB\u6587\u4EF6\u3001\u641C\u7D22\u3001\u5217\u76EE\u5F55\u3001\u8BFB\u6280\u80FD\u6B63\u6587\u3001\u7FFB\u4F1A\u8BDD\u5386\u53F2\u3002\u7528\u5B83\u505A\u4E0A\u9762\u8BF4\u7684\u5B9A\u70B9\u6838\u5B9E\u3002",
11485
11512
  "\u26A0\uFE0F \u4EA4\u4E00\u4EFD\u8BA1\u5212**\u6362\u4E0D\u6765**\u5199\u6743\u9650\uFF1A\u7528\u6237\u672C\u6765\u5C31\u5728 plan \u6863\u65F6\uFF0C\u300C\u6279\u51C6\u5E76\u6267\u884C\u300D\u90A3\u4E2A\u51FA\u53E3\u538B\u6839\u4E0D\u7ED9\uFF08\u6743\u9650\u53EA\u56E0\u7528\u6237\u81EA\u5DF1\u7684\u52A8\u4F5C\u653E\u5BBD\uFF09\u3002",
11486
11513
  "\u7528\u6237\u5728\u8FD9\u4E2A\u6A21\u5F0F\u91CC\u50AC\u4F60\u52A8\u624B\u3001\u6216\u8005\u7528\u7948\u4F7F\u53E5\u8981\u6C42\u6267\u884C\uFF0C**\u90FD\u4E0D\u7B97\u6388\u6743** \u2014\u2014 \u90A3\u662F\u8BA9\u4F60\u628A\u300C\u600E\u4E48\u6267\u884C\u300D\u5199\u6E05\u695A\uFF0C\u4E0D\u662F\u8BA9\u4F60\u53BB\u6267\u884C\u3002\u6743\u9650\u6863\u53EA\u4F1A\u56E0\u4E3A\u4ED6\u81EA\u5DF1\u7684\u52A8\u4F5C\u6539\u53D8\u3002",
11487
11514
  "</plan_mode>"
@@ -13486,7 +13513,8 @@ var BlankGreetingSchema = z.object({
13486
13513
  });
13487
13514
  var HostUserSchema = z.object({
13488
13515
  label: z.string().min(1),
13489
- icon: z.string().min(1).optional()
13516
+ icon: z.string().min(1).optional(),
13517
+ avatar: z.string().min(1).optional()
13490
13518
  });
13491
13519
  var ArtifactsSchema = z.object({
13492
13520
  maxAgeDays: z.int().positive().max(3650).default(ARTIFACT_RETENTION_DEFAULTS.maxAgeDays),
@@ -18389,57 +18417,25 @@ var SessionDB = class {
18389
18417
  searchContent(query, limit) {
18390
18418
  const safeQuery = sanitizeFtsQuery(query);
18391
18419
  if (!safeQuery) return [];
18392
- const ftsQuery = buildFtsMatchQuery(safeQuery);
18393
- const ftsRows = this.db.prepare(
18394
- `
18420
+ const sql = (table) => `
18395
18421
  SELECT m.*, s.title as session_title
18396
- FROM messages_fts f
18397
- JOIN messages m ON f.rowid = m.id
18398
- JOIN sessions s ON m.session_id = s.id
18399
- WHERE messages_fts MATCH @query AND s.archived = 0
18400
- ORDER BY rank
18401
- LIMIT @limit
18402
- `
18403
- ).all({
18404
- query: ftsQuery,
18405
- limit: limit * 3
18406
- });
18407
- if (ftsRows.length === 0) {
18408
- const trigramRows = this.db.prepare(
18409
- `
18410
- SELECT m.*, s.title as session_title
18411
- FROM messages_fts_trigram f
18422
+ FROM ${table} f
18412
18423
  JOIN messages m ON f.rowid = m.id
18413
18424
  JOIN sessions s ON m.session_id = s.id
18414
- WHERE messages_fts_trigram MATCH @query AND s.archived = 0
18415
- ORDER BY rank
18416
- LIMIT @limit
18417
- `
18418
- ).all({ query: buildTrigramMatchQuery(safeQuery), limit: limit * 3 });
18419
- const seen2 = /* @__PURE__ */ new Set();
18420
- const results2 = [];
18421
- for (const r of trigramRows) {
18422
- const sid = r["session_id"];
18423
- if (seen2.has(sid)) continue;
18424
- seen2.add(sid);
18425
- if (results2.length >= limit) break;
18426
- results2.push({
18427
- session: this.getSessionMeta(sid),
18428
- matches: [
18429
- {
18430
- messageIndex: r["id"],
18431
- snippet: String(r["content"] ?? "").slice(0, 200),
18432
- score: 1
18433
- }
18434
- ],
18435
- score: 1
18436
- });
18437
- }
18438
- return results2;
18439
- }
18425
+ WHERE ${table} MATCH @query AND s.archived = 0
18426
+ ORDER BY rank
18427
+ LIMIT @limit`;
18428
+ const candidates2 = limit * 3;
18429
+ const rowsFor = (table, match) => this.db.prepare(sql(table)).all({ query: match, limit: candidates2 });
18430
+ const porter = rowsFor("messages_fts", buildFtsMatchQuery(safeQuery));
18431
+ const rows = belowTrigramFloor(safeQuery) ? porter : mergeRankedRows(
18432
+ porter,
18433
+ rowsFor("messages_fts_trigram", buildTrigramMatchQuery(safeQuery)),
18434
+ candidates2
18435
+ );
18440
18436
  const seen = /* @__PURE__ */ new Set();
18441
18437
  const results = [];
18442
- for (const r of ftsRows) {
18438
+ for (const r of rows) {
18443
18439
  const sid = r["session_id"];
18444
18440
  if (seen.has(sid)) continue;
18445
18441
  seen.add(sid);
@@ -18448,7 +18444,7 @@ var SessionDB = class {
18448
18444
  session: this.getSessionMeta(sid),
18449
18445
  matches: [
18450
18446
  {
18451
- messageIndex: r["id"],
18447
+ messageIndex: r.id,
18452
18448
  snippet: String(r["content"] ?? "").slice(0, 200),
18453
18449
  score: 1
18454
18450
  }
@@ -25463,6 +25459,15 @@ var MAX_OUTPUT = 1e5;
25463
25459
  var MAX_MEMORY = 512;
25464
25460
  var TRUNCATE_HEAD = 2e3;
25465
25461
  var TRUNCATE_TAIL = 2e3;
25462
+ function resolveExecutable(name) {
25463
+ if (IS_WINDOWS || name.includes("/") || name.includes("\\")) return name;
25464
+ for (const dir of (process.env["PATH"] ?? "").split(delimiter)) {
25465
+ if (!dir) continue;
25466
+ const candidate = join(dir, name);
25467
+ if (existsSync(candidate)) return candidate;
25468
+ }
25469
+ return name;
25470
+ }
25466
25471
  var CodeSandbox = class {
25467
25472
  sandboxDir;
25468
25473
  readableDirs;
@@ -25535,7 +25540,7 @@ var CodeSandbox = class {
25535
25540
  const tmpFile = join(this.sandboxDir, "code.py");
25536
25541
  writeFileSync(tmpFile, code, "utf-8");
25537
25542
  return {
25538
- command: IS_WINDOWS ? "python" : "python3",
25543
+ command: resolveExecutable(IS_WINDOWS ? "python" : "python3"),
25539
25544
  args: ["-I", tmpFile]
25540
25545
  };
25541
25546
  }
@@ -25708,4 +25713,4 @@ function trunc(stdout, stderr) {
25708
25713
  * `--tree` 的命令帮助里,让用户自己知道 `--tree` 意味着什么。
25709
25714
  */
25710
25715
 
25711
- export { ABOUT_DESC_MAX_CHARS, ABOUT_README_MAX_CHARS, 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_ENTRIES_FILE, 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_ICON_MAX_BYTES, 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_ASSET_DIRS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_FILE, 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, UNSETTABLE_USER_KEYS, Workspace, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, approvalEntryFor, approvalRootFor, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, capabilityOfRef, 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, createPluginScope, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, discoverySpec, 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, grantedPathsFor, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, hasUsableModel, imageFromBase64, imageFromPath, imagePartTokens, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, isValidInterval, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listEntryModels, listRunningSchedules, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadModelEntries, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelEntriesPath, modelListCandidates, needsAllowlist, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, normalizeModelEntry, normalizeTrigger, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelEntry, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistFailureCode, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readEntryKey, readImageSize, readMarketplaces, readPluginAbout, readPluginIcon, readPluginManifest, readPluginRecords, 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, saveModelEntries, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, testModelEntry, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, unsetUserSetting, updateMarketplace, updatePlugin, usdToMicros, validateSchedule, validateTrigger, validateWindow, withGoalCompression, withGoalPrompt, workspaceDisplayPath, writeSettingValue };
25716
+ export { ABOUT_DESC_MAX_CHARS, ABOUT_README_MAX_CHARS, 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_ENTRIES_FILE, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, ManagedPolicyError, ManagedSettingsSchema, MemoryManager, ModelFailureTracker, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, PACK_EXCLUDES, PERMISSION_AUDIT_CODES, PLUGIN_ICON_MAX_BYTES, 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_ASSET_DIRS, SKILL_CREATE_TOOL, SKILL_EDIT_TOOL, SKILL_FILE, 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, UNSETTABLE_USER_KEYS, Workspace, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, approvalEntryFor, approvalRootFor, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, capabilityOfRef, 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, createPluginScope, createRoleFile, createRoleScope, createRunCodeTool, createScheduleDraftTool, createSessionMessagesReadTool, createSessionMessagesSearchTool, createSessionSearchTool, createSessionSearchTools, createSessionTraceTool, createSkillViewTool, createSkillWriteTools, createTodoTool, createToolRevealState, createToolScope, createToolSearchTool, createTrustGate, currentEpochVersion, decideImport, decideTrust, defaultConfig, describeArtifactRefusal, describeBackgroundTask, describeHeadlessPolicy, describeIsolation, describeJsonError, diagnoseSchedules, discoverMarkdown, discoverModels, discoverProject, discoverySpec, 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, grantedPathsFor, hasDedicatedExecContent, hasExecTierContent, hasPromptCaching, hasProviderCredentials, hasReadTierContent, hasUsableModel, imageFromBase64, imageFromPath, imagePartTokens, importParts, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryProjectExtensions, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isTransientPersistFailure, isValidInterval, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listEntryModels, listRunningSchedules, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadModelEntries, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, mergeSchedulePatch, microsToUsd, modelEntriesPath, modelListCandidates, needsAllowlist, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, normalizeModelEntry, normalizeTrigger, openArtifact, originOf, packFileName, packPlugin, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelEntry, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistFailureCode, persistParts, persistToolResults, persistedUsage, planPack, previewSkillImport, pricingFor, projectEntryForDisplay, pruneArtifacts, pruneAttachments, pruneRecordings, pruneSchedules, readEntryKey, readImageSize, readMarketplaces, readPluginAbout, readPluginIcon, readPluginManifest, readPluginRecords, 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, saveModelEntries, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setDisplayCurrency, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, settingWriteApply, settingWriteLayers, settingWriteTargets, skillIndexDescription, skillIndexResidency, skillIndexStats, sniffMediaType, splitFrontmatter, staticToolProvider, stripArtifactData, substitutePluginRoot, suggestRuleFromApproval, systemOpenArgv, systemPromptSegments, testModelEntry, toPosix, toolDefinitionTokens, toolMatches, toolTableTokens, totalTokens, traceSession, triggerPeriodMs, unescapeRuleContent, uninstallPlugin, unknownRoleSkills, unknownRoleTools, unloadedInstructionFiles, unsetUserSetting, 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": "2.6.1",
3
+ "version": "2.8.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": "2.6.1",
31
- "@epoch-agent/protocol": "2.6.1"
30
+ "@epoch-agent/infra": "2.8.0",
31
+ "@epoch-agent/protocol": "2.8.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@ai-sdk/alibaba": "^2.0.69",