@epoch-agent/core 0.4.0 → 0.6.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 +2 -2
- package/dist/index.d.ts +235 -4
- package/dist/index.js +8078 -7560
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -33,11 +33,11 @@ Agent 引擎。ReAct 循环、Provider 路由、权限、记忆、技能、Hook
|
|
|
33
33
|
| `agent-role/` | agent 角色定义、注册与工具作用域收窄(子 agent 和**顶层会话**两条来路走同一个 `roleScopedProvider`);`createRoleScope` 把它包成**可变槽** —— 身份行和工具表从同一个变量读,好让「这一条消息换个专家」有地方落。⚠️ 2026-08-18 起这里多了一条**写**的路(`create.ts`,全仓第一条建角色的路):它和读口共用同一份 frontmatter schema、同一个解析器,写完**先读回来验一遍**再落盘。那道「什么样的客户端才准写」的闸门**不在这儿**,在 `@epoch-agent/server`(判据见那个文件头第三节) |
|
|
34
34
|
| `extensions/` | 项目级扩展:自定义斜杠命令的发现 / 加载 / 插值 / 按轮次收窄工具表;三种扩展物共用的 frontmatter 解析 |
|
|
35
35
|
| `plugin/` | 插件:清单校验、四种来源的安装、安装记录(带跨进程锁)、市场、加载成「六类扩展物的来源」(`PLUGIN_LAYOUT` 那七个约定子路径)。见 [docs/PLUGINS.md](../../docs/PLUGINS.md) |
|
|
36
|
-
| `tools/` | `ToolRegistry` + `builtin/` 下那批内置工具(`todo` / `memory` / `goal` / `code_exec` / `run_code` / `delegate_task` / `ask_user_question` / `skill_view` / **技能写入那四个** / `tool_search` / plan 模式那两个 / 会话检索那**四个**)。**清单与边界的唯一真源是 [docs/TOOLS.md](../../docs/TOOLS.md)** —— 这里不再抄一个会过期的条数(原来写的「13 个」漏了 `tool_search`)
|
|
36
|
+
| `tools/` | `ToolRegistry` + `builtin/` 下那批内置工具(`todo` / `memory` / `goal` / `code_exec` / `run_code` / `delegate_task` / `ask_user_question` / `skill_view` / **技能写入那四个** / `tool_search` / `schedule_draft` / plan 模式那两个 / 会话检索那**四个**)。**清单与边界的唯一真源是 [docs/TOOLS.md](../../docs/TOOLS.md)** —— 这里不再抄一个会过期的条数(原来写的「13 个」漏了 `tool_search`) |
|
|
37
37
|
| `code-mode/` | `run_code` 的 worker 运行时(方案 51):线程入口、宿主 ↔ worker 的工具绑定协议、四道上限、只读闸门。⚠️ **和 `sandbox/` 是两回事,隔离模型正好相反** —— 那一个的边界是沙箱,这一个的边界是权限管线(子调用通道本身在 `agent/tool-executor.ts`)。**默认关**,`tools.mode: both` 才注册那个工具 |
|
|
38
38
|
| `checkpoint/` | 写类工具动手前的文件快照 + 回退(两阶段原子、不覆盖手工改动)。见 [docs/CHECKPOINTS.md](../../docs/CHECKPOINTS.md) |
|
|
39
39
|
| `tracker/` | 待办追踪的 SQLite 表 |
|
|
40
|
-
| `schedule/` | 定时任务(方案 45):store / 单实例锁 / 触发器算术 / 保存期校验 / 录像与留存 / 注册器 / `doctor`,外加 `os/` 下的两个 OS 后端(`schtasks` / `launchd
|
|
40
|
+
| `schedule/` | 定时任务(方案 45):store / 单实例锁 / 触发器算术 / 保存期校验 / 录像与留存 / 注册器 / `doctor`,外加 `os/` 下的两个 OS 后端(`schtasks` / `launchd`)和 `draft.ts`(对话里那份草稿的解析与判定,**不是写入路**)。**不含执行器** —— 跑一次要 `buildRuntime()`,那在 [runtime](../runtime) 的 `fireSchedule()` |
|
|
41
41
|
| `cost/` | 计价表、预算守卫、花费状态。缓存命中单独计价,口径见 `pricing.ts` 文件头 |
|
|
42
42
|
| `compat/` | 竞品词汇表。今天只有 `claude-tool-names.ts`(Claude Code 工具名 ↔ 我们的,双向从同一份数据推出来)—— 放在 `hook/` 之外是因为方案 50 §八 点名的第二个消费者(兼容它的权限规则)不住在 hook 里 |
|
|
43
43
|
| `trust/` | 工作区信任判定与闸门 |
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolProvider, EpochTool, EpochPlugin, ToolExposure, EpochSkill, HookType, EpochHook, PluginContext, QuestionRequest, QuestionAnswer, AgentRole, PermissionLevel, PermissionManager as PermissionManager$1, PlanProposal, ApprovalRequest, ApprovalReply, DiagnosticSink, AgentRoleSource, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, BackgroundTaskInfo, ContextBreakdown, EpochMessage, AgentRoleScope, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, ProviderType, JsonSchema, ModelSelection, EpochToolCall, Telemetry, HookManager as HookManager$1, EpochUserContent, EpochContentPart, AgentEvent, SelectionContext, SetSelectionResult, PermissionRuleLists, KeybindingTable, Diagnostic, KeybindingReport, FileOmitReason, SessionOmitReason, EpochToolResult, EpochTurnFacts, LocalizedDetail, OperationType, RuleValue, Operation, ApprovalOutcome, PermissionDecision, ScheduleTrigger, ScheduleAllowlist,
|
|
1
|
+
import { ToolProvider, EpochTool, EpochPlugin, ToolExposure, EpochSkill, HookType, EpochHook, PluginContext, QuestionRequest, QuestionAnswer, AgentRole, PermissionLevel, PermissionManager as PermissionManager$1, PlanProposal, ApprovalRequest, ApprovalReply, ScheduleDefinition, DiagnosticSink, AgentRoleSource, CustomCommandDef, ModelRef, ExpandedCommand, CustomCommandSource, BackgroundTaskInfo, ContextBreakdown, EpochMessage, AgentRoleScope, ComplianceCategory, ComplianceAction, ToolArtifactInput, ToolArtifact, TrustLevel, TrustManager as TrustManager$1, TokenUsage, EpochConfig, BudgetBreach, ProviderType, JsonSchema, ModelSelection, EpochToolCall, Telemetry, HookManager as HookManager$1, EpochUserContent, EpochContentPart, AgentEvent, SelectionContext, SetSelectionResult, PermissionRuleLists, KeybindingTable, Diagnostic, KeybindingReport, FileOmitReason, SessionOmitReason, EpochToolResult, EpochTurnFacts, LocalizedDetail, OperationType, RuleValue, Operation, ApprovalOutcome, PermissionDecision, ScheduleTrigger, ScheduleAllowlist, ScheduleBackendKind, ScheduleRunStatus, ScheduleRun, SchedulePendingApproval, ScheduleDraft, ScheduleWideningKind, WireAgentEvent, WireAgentEnvelope, ScheduleRunnerSpec, HookEvent, LogFn, HookRegistration, HookHandler, HookContext, VerifyResult, Lang, EpochFilePart, EpochSessionPart, MentionSet, EpochImagePart, DecidedTrustLevel, TrustScope, TrustRecord } from '@epoch-agent/protocol';
|
|
2
2
|
export { API_KEY_ENV_VARS, AgentEvent, AgentEventOf, AgentEventType, ApprovalAnswer, ApprovalOutcome, ApprovalReply, ApprovalRequest, BudgetBreach, COMPLIANCE_ACTIONS, COMPLIANCE_CATEGORIES, ComplianceAction, ComplianceCategory, DecidedTrustLevel, EpochConfig, EpochHook, EpochPlugin, EpochSkill, EpochTool, FinishReason, HookContext, HookEvent, HookHandler, HookRegistration, HookType, HookManager as IHookManager, PermissionManager as IPermissionManager, TrustManager as ITrustManager, JsonSchema, MAX_ATTACH_BYTES, MAX_ATTACH_FILES, MAX_ATTACH_TOTAL_BYTES, MAX_SESSION_ATTACH_BYTES, MAX_SESSION_REFS, OPERATION_TYPES, Operation, OperationType, PERMISSION_LEVELS, PLAN_OUTCOMES, PROVIDER_INFOS, PROVIDER_TYPES, PermissionDecision, PermissionLevel, PlanApprovalOutcome, PlanProposal, PluginContext, ProviderInfo, ProviderType, TokenUsage, ToolContext, ToolDefinition, ToolExposure, ToolResult, TrustLevel, TrustRecord, TrustScope, VerifyResult, apiKeyEnvVar, extractAllMentions, extractMentions, extractSessionMentions, getProviderInfo, isOperationType, isPermissionLevel, isPlanOutcome, isProviderType, normalizeApproval } from '@epoch-agent/protocol';
|
|
3
3
|
import { IsolationBackend, SqliteDatabase, ParseIssue, ShellFlavor } from '@epoch-agent/infra';
|
|
4
4
|
export { BubblewrapOptions, DangerMatch, IS_WINDOWS, IsolationBackend, IsolationOptions, LogLevel, SeatbeltOptions, WINDOWS_HIDE_FLAGS, buildBwrapArgs, buildProfile, checkDangerousCommand, checkObfuscation, createLogger, detectBackend, getDefaultShell, getPythonCommand, isInWorkspace, isReadOnlyCommand, isolate, maskApiKey, probeBubblewrap, probeSeatbelt, complianceDir as resolveComplianceDir, policiesDir as resolvePoliciesDir, setLogLevel } from '@epoch-agent/infra';
|
|
@@ -1845,6 +1845,65 @@ interface PlanModeDeps {
|
|
|
1845
1845
|
*/
|
|
1846
1846
|
declare function createPlanModeTools(deps: PlanModeDeps): EpochTool[];
|
|
1847
1847
|
|
|
1848
|
+
/**
|
|
1849
|
+
* `schedule_draft` —— 在对话里**起草**一条定时任务,交给人去审。
|
|
1850
|
+
*
|
|
1851
|
+
* ## 它不是写入路,而这句话是整份设计的地基
|
|
1852
|
+
*
|
|
1853
|
+
* 定时任务今天有两条写入路,两条的主语都是人:`epoch schedule add`,和自动化
|
|
1854
|
+
* 面板那张表单。这个工具**没有加第三条** —— 它只产出一份草稿,落库仍然是那两条:
|
|
1855
|
+
* 人在卡片上点「审阅并保存」走的是同一个 `POST /api/schedules`,人粘贴命令行
|
|
1856
|
+
* 走的是同一个 `epoch schedule add`。
|
|
1857
|
+
*
|
|
1858
|
+
* 理由和 `goal.ts` 那条「模型改不了完成判据」同源,但更硬一档:一条定时任务是
|
|
1859
|
+
* **无人值守**的授权(方案 45 §3 整节),而无人值守的授权只能由人给。
|
|
1860
|
+
* 形状上照的是 plan 模式的先例 —— 可以提议(`exit_plan_mode`),生效要人批一次。
|
|
1861
|
+
*
|
|
1862
|
+
* ## ⚠️ 它**不阻塞**,而这一条和 `exit_plan_mode` 是反的
|
|
1863
|
+
*
|
|
1864
|
+
* 计划审批挂起是对的:那一刻模型的下一步取决于批不批。这里不是 ——
|
|
1865
|
+
* 草稿交出去之后模型该干的活已经干完了,而人要做的事是**打开另一块面板、
|
|
1866
|
+
* 在一张开放式表单上改清单**,那不是四选一,可能是十分钟,也可能是明天。
|
|
1867
|
+
* 把引擎挂在那儿等的后果很具体:用户中途去看别的、把面板关了,那一轮就吊死。
|
|
1868
|
+
*
|
|
1869
|
+
* 所以草稿的落点是**会话记录本身**:那次工具调用的入参就是草稿,web 从工具流里
|
|
1870
|
+
* 把它读回来渲染成一张卡片(`web/src/thread/rows.ts`,照 `todo` 的先例)。
|
|
1871
|
+
* 它因此天然活过刷新、活过重启,也不需要一张「待处理草稿」表。
|
|
1872
|
+
*
|
|
1873
|
+
* ## 三个 action 的分工
|
|
1874
|
+
*
|
|
1875
|
+
* | action | 干什么 |
|
|
1876
|
+
* | -------- | --------------------------------------------------- |
|
|
1877
|
+
* | `list` | 看一眼现有任务。**`update` 的前提** —— id 猜不出来 |
|
|
1878
|
+
* | `create` | 起草一条新的 |
|
|
1879
|
+
* | `update` | 提议改一条已有的 |
|
|
1880
|
+
*
|
|
1881
|
+
* `list` 和另外两个住在同一个工具里而不是拆成两个,是因为**工具表的字每轮都付**
|
|
1882
|
+
* (`toolTableTokens` 量得出来):拆成两个要多写一遍参数壳子和一遍「这是干什么的」。
|
|
1883
|
+
*
|
|
1884
|
+
* ## 权限归类是 `file_read`
|
|
1885
|
+
*
|
|
1886
|
+
* 它不碰用户的文件、不联网、不起进程,读的是引擎自己那张 schedules 表,
|
|
1887
|
+
* 写的东西一个字节都没有。归成 `file_read` 才能在 `plan` 级别下被调用 ——
|
|
1888
|
+
* 归成别的等于「进了只读调研模式就再也提不了建议」,而调研阶段恰恰最容易看出
|
|
1889
|
+
* 「这件事该每天自动做一遍」。与 `todo` / `goal` / plan 模式那几个同一套理由,
|
|
1890
|
+
* 见 operation-type.ts 的 `INTERNAL_TOOLS`。
|
|
1891
|
+
*
|
|
1892
|
+
* ## ⚠️ 这个文件在 `SKIP_FILES` 里,别往里加界面文案
|
|
1893
|
+
*
|
|
1894
|
+
* 整份是**给模型读的措辞**(工具描述 + 工具输出),判据逐字同 `goal.ts`。
|
|
1895
|
+
* 卡片上那些字在 `locales/*.yaml` 的 `web.ui.thread.draft_*` 下。
|
|
1896
|
+
*/
|
|
1897
|
+
|
|
1898
|
+
interface ScheduleDraftDeps {
|
|
1899
|
+
/** 现有任务。**读的那一侧**,`ScheduleControl.list` 直接传进来 */
|
|
1900
|
+
list: () => ScheduleDefinition[];
|
|
1901
|
+
get: (id: string) => ScheduleDefinition | undefined;
|
|
1902
|
+
/** `~/.epoch`。校验那一侧判「工作区不许指到家目录」用 */
|
|
1903
|
+
homeDir: string;
|
|
1904
|
+
}
|
|
1905
|
+
declare function createScheduleDraftTool(deps: ScheduleDraftDeps): EpochTool;
|
|
1906
|
+
|
|
1848
1907
|
/**
|
|
1849
1908
|
* 「哪些历史会话,这一段会话能读」—— **全仓唯一一份判定**(方案 48 §四)。
|
|
1850
1909
|
*
|
|
@@ -7563,6 +7622,13 @@ interface AgentConfig {
|
|
|
7563
7622
|
* 和 `LogFn` 同一条规矩:库不替宿主决定往哪儿发数据,真 SDK 的装配在 runtime。
|
|
7564
7623
|
*/
|
|
7565
7624
|
telemetry?: Telemetry;
|
|
7625
|
+
/**
|
|
7626
|
+
* 一条用户消息底下最多几次模型请求。**`0` = 不设上限**,也是缺省
|
|
7627
|
+
* (判据全文在 infra 的 `DEFAULT_MAX_TURNS` / `UNLIMITED_TURNS` 上)。
|
|
7628
|
+
*
|
|
7629
|
+
* `undefined` 和 `0` 在这一格上**同义**(都落到 `DEFAULT_MAX_TURNS`),
|
|
7630
|
+
* 两者的区别只在 `RunInput.maxTurns` 那一格上才成立 —— 见那儿。
|
|
7631
|
+
*/
|
|
7566
7632
|
maxTurns?: number;
|
|
7567
7633
|
/**
|
|
7568
7634
|
* 工作目录。
|
|
@@ -7909,6 +7975,11 @@ interface RunInput {
|
|
|
7909
7975
|
*
|
|
7910
7976
|
* 是 per-call 而不是改配置:长驻宿主(`--input-format stream-json`)一个进程
|
|
7911
7977
|
* 服务很多次调用,把「这一次最多跑几轮」写进进程级配置就没法逐次收紧了。
|
|
7978
|
+
*
|
|
7979
|
+
* ⚠️ **这一格上 `undefined` 和 `0` 是两个意思**(2026-09-06):`undefined` =
|
|
7980
|
+
* 「这次没给,跟配置走」,`0` = 「这次不限轮次」(`--max-turns 0`,压过一个
|
|
7981
|
+
* 配置里设了上限的会话)。所以消费它的那一行必须是 `??` 而不是 `||` ——
|
|
7982
|
+
* 判据在 `loop.ts` 的 `runTurns()` 上。
|
|
7912
7983
|
*/
|
|
7913
7984
|
maxTurns?: number;
|
|
7914
7985
|
/**
|
|
@@ -9824,6 +9895,25 @@ declare const EpochConfigSchema: z.ZodObject<{
|
|
|
9824
9895
|
prompt: z.ZodString;
|
|
9825
9896
|
icon: z.ZodOptional<z.ZodString>;
|
|
9826
9897
|
}, z.core.$strip>>>;
|
|
9898
|
+
blankGreeting: z.ZodOptional<z.ZodObject<{
|
|
9899
|
+
eyebrow: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
9900
|
+
zh: "zh";
|
|
9901
|
+
en: "en";
|
|
9902
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
9903
|
+
title: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
9904
|
+
zh: "zh";
|
|
9905
|
+
en: "en";
|
|
9906
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
9907
|
+
subtitle: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
9908
|
+
zh: "zh";
|
|
9909
|
+
en: "en";
|
|
9910
|
+
}> & z.core.$partial, z.ZodString>>;
|
|
9911
|
+
hidden: z.ZodOptional<z.ZodBoolean>;
|
|
9912
|
+
}, z.core.$strip>>;
|
|
9913
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
9914
|
+
label: z.ZodString;
|
|
9915
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
9916
|
+
}, z.core.$strip>>;
|
|
9827
9917
|
}, z.core.$strip>;
|
|
9828
9918
|
/**
|
|
9829
9919
|
* 全默认配置 —— 从 schema 派生,不是第二份字面量。
|
|
@@ -12968,8 +13058,27 @@ type UpdateScheduleInput = Partial<Omit<CreateScheduleInput, 'maxBudgetUsd'>> &
|
|
|
12968
13058
|
* `maxBudgetUsd` **不在这里**,那是刻意的 —— 它没有缺省值。
|
|
12969
13059
|
*/
|
|
12970
13060
|
declare const SCHEDULE_DEFAULTS: {
|
|
12971
|
-
/**
|
|
12972
|
-
|
|
13061
|
+
/**
|
|
13062
|
+
* 和交互缺省**同一个常量**(2026-09-04,原来这儿是自己的一个 `20`)。
|
|
13063
|
+
*
|
|
13064
|
+
* 那个 20 的理由写的是「无人看着的一轮不该比有人看着的更长」。它不成立了 ——
|
|
13065
|
+
* 它当初拦的是「跑飞了没人按 Esc」,而这一层真正拦住那件事的是 `maxBudgetUsd`:
|
|
13066
|
+
* 它在这套功能里**必填**(所以它不在这份缺省里),而钱是比轮次准的尺子。
|
|
13067
|
+
* 用轮次替它把无人值守的活压到 20,拦掉的绝大多数不是跑飞,是「这个任务本来
|
|
13068
|
+
* 就要 60 轮」—— 而那种失败要等到第二天 9 点才看得见(同下面
|
|
13069
|
+
* `SCHEDULE_DEFAULT_ALLOWLIST` 那节的判据)。
|
|
13070
|
+
*
|
|
13071
|
+
* ⚠️ 这一份是**没有配置在手时的兜底**。真正拿着用户那格 `maxTurns` 的地方是
|
|
13072
|
+
* `server/src/schedule/handlers.ts` 的 `defaultsOf()` —— 表单预填走它,
|
|
13073
|
+
* 所以用户把设置里那个数改成 500,新建任务那一格就预填 500。
|
|
13074
|
+
*
|
|
13075
|
+
* ⚠️ **2026-09-06 起这个缺省是「不设上限」**(`UNLIMITED_TURNS`),因为上面那条
|
|
13076
|
+
* 判据跟着交互缺省一起走到了头:既然轮次拦掉的绝大多数不是跑飞,那把它当无人
|
|
13077
|
+
* 值守的兜底闸门就是**拿错了尺子**。这条路上兜住跑飞的仍然是 `maxBudgetUsd`
|
|
13078
|
+
* (必填,所以它不在这份缺省里)和 `timeoutMs`。要一道轮次闸门的人在新建任务
|
|
13079
|
+
* 那一格自己填一个数。
|
|
13080
|
+
*/
|
|
13081
|
+
readonly maxTurns: 0;
|
|
12973
13082
|
/** 15 分钟。唯一能拦住「一条命令挂住了」的那把尺子 */
|
|
12974
13083
|
readonly timeoutMs: number;
|
|
12975
13084
|
};
|
|
@@ -13263,6 +13372,25 @@ interface ValidateScheduleInput {
|
|
|
13263
13372
|
* 「没确认」,反过来的话一个忘了传这个字段的调用方会静默绕过第 3 条约束。
|
|
13264
13373
|
*/
|
|
13265
13374
|
bypassAcknowledged?: boolean;
|
|
13375
|
+
/**
|
|
13376
|
+
* 预算那一格**还没轮到填** —— 只有一个调用方给它:模型交上来的草稿
|
|
13377
|
+
* (`schedule/draft.ts`)。给了 `true` 时跳过 `budget-missing` 那一条,
|
|
13378
|
+
* 别的一条都不跳。
|
|
13379
|
+
*
|
|
13380
|
+
* ## ⚠️ 这不是「放宽了预算必填」
|
|
13381
|
+
*
|
|
13382
|
+
* 必填那条约束的**对象是保存那一刻**,而草稿压根到不了那一刻:它没有 id、
|
|
13383
|
+
* 落不了库,唯一的下一步是摆到人眼前(判据在 protocol 的
|
|
13384
|
+
* `ScheduleDraft` 文件头那张表第二行)。所以草稿里没有这一格是**结构**,
|
|
13385
|
+
* 这个开关只是让校验别去报一条「你没填一个你还填不了的东西」——
|
|
13386
|
+
* 那句话交给模型,它会开始猜一个数。
|
|
13387
|
+
*
|
|
13388
|
+
* 两条写入路(`ScheduleControl.create` / `epoch schedule add` / 表单)
|
|
13389
|
+
* **一个都不许传它**。传了的后果是一条没有预算上限的任务真的落了库,
|
|
13390
|
+
* 而那正是「一觉醒来 40 美元」。`__tests__/schedule-draft.test.ts` 里
|
|
13391
|
+
* 钉着「三条写入路上没有这个字段」。
|
|
13392
|
+
*/
|
|
13393
|
+
budgetPending?: boolean;
|
|
13266
13394
|
/** 判「工作区不许指到家目录」用。给的是 `~/.epoch` 那个数据目录 */
|
|
13267
13395
|
homeDir: string;
|
|
13268
13396
|
now?: number;
|
|
@@ -13286,6 +13414,83 @@ declare function validateSchedule(input: ValidateScheduleInput): ScheduleValidat
|
|
|
13286
13414
|
*/
|
|
13287
13415
|
declare function needsAllowlist(permission: PermissionLevel): boolean;
|
|
13288
13416
|
|
|
13417
|
+
/**
|
|
13418
|
+
* 草稿这一侧的三件纯函数活:**解析**模型发来的入参、算出这次提案**放宽**了什么、
|
|
13419
|
+
* 拼一条人能粘贴的命令行。
|
|
13420
|
+
*
|
|
13421
|
+
* 工具本体在 [tools/builtin/schedule-draft.ts](../tools/builtin/schedule-draft.js),
|
|
13422
|
+
* 那边只做分派和收尾;判定全在这儿,为的是能对着纯函数写用例。
|
|
13423
|
+
* 形状的契约在 [protocol/src/schedule-draft.ts](../../../protocol/src/schedule-draft.ts)。
|
|
13424
|
+
*
|
|
13425
|
+
* ## ⚠️ 整份的读者是**模型**,所以这里的中文不进 catalog
|
|
13426
|
+
*
|
|
13427
|
+
* 三个出口(拒绝的理由、提案摘要、那条命令行)全都回给模型,由模型再用用户
|
|
13428
|
+
* 那一侧的语言说出来。判据逐字同 `tools/builtin/goal.ts` 那条 —— 换用户界面语言
|
|
13429
|
+
* 不该换模型看到的东西。这个文件因此在 `scripts/i18n-scan.mjs` 的 `SKIP_FILES` 里,
|
|
13430
|
+
* **别往里加界面文案**:卡片上那些字在 `locales/*.yaml` 的 `web.ui.thread.draft_*` 下。
|
|
13431
|
+
*
|
|
13432
|
+
* ## 为什么每一条拒绝都自带「下一步怎么改」
|
|
13433
|
+
*
|
|
13434
|
+
* 同 `goal.ts` 那条账:`tool-executor.ts` 在 `success: false` 时把工具自己的
|
|
13435
|
+
* `output` 整个丢掉、只印 `error.message`。所以那半句必须长在拒绝理由里 ——
|
|
13436
|
+
* 少了它,模型会原样再发一次,每次烧一轮。
|
|
13437
|
+
*/
|
|
13438
|
+
|
|
13439
|
+
/**
|
|
13440
|
+
* 「解出来了 / 这一格不对」。
|
|
13441
|
+
*
|
|
13442
|
+
* 写成判别联合而不是 `T | string`:草稿里好几格**本身就是字符串**
|
|
13443
|
+
* (`name` / `permission`),`typeof x === 'string'` 判不出它是值还是理由 ——
|
|
13444
|
+
* 那种写法能编译过,然后在 `permission: 'default'` 上把一个合法值当成错误。
|
|
13445
|
+
*/
|
|
13446
|
+
type Parsed<T> = {
|
|
13447
|
+
ok: true;
|
|
13448
|
+
value: T;
|
|
13449
|
+
} | {
|
|
13450
|
+
ok: false;
|
|
13451
|
+
message: string;
|
|
13452
|
+
};
|
|
13453
|
+
/** 解析结果。失败那一支的 `message` 直接给模型看 */
|
|
13454
|
+
type DraftParse = Parsed<ScheduleDraft>;
|
|
13455
|
+
/**
|
|
13456
|
+
* 触发器。
|
|
13457
|
+
*
|
|
13458
|
+
* ⚠️ **`everyMinutes` 只收 `SCHEDULE_INTERVAL_MINUTES` 里那些值**,而这一条要在
|
|
13459
|
+
* 这儿就拦住、不能等 `validateTrigger`:模型很容易写一个 `7`,而那个值在两个平台
|
|
13460
|
+
* 上的行为不一致(判据在协议那个常量上)。拦在这儿的好处是回给它的话能带上全集,
|
|
13461
|
+
* 它下一轮就改对了。
|
|
13462
|
+
*/
|
|
13463
|
+
declare function parseTrigger(v: unknown): Parsed<ScheduleTrigger>;
|
|
13464
|
+
/**
|
|
13465
|
+
* 把模型那一坨入参解析成一份草稿。
|
|
13466
|
+
*
|
|
13467
|
+
* `note` 两支都必填,理由在协议那个字段上:一条凭空出现在对话里的定时任务,
|
|
13468
|
+
* 用户第一个问题一定是「你为什么觉得我需要它」。
|
|
13469
|
+
*/
|
|
13470
|
+
declare function parseScheduleDraft(raw: unknown): DraftParse;
|
|
13471
|
+
/**
|
|
13472
|
+
* 这次提案**放宽**了什么。
|
|
13473
|
+
*
|
|
13474
|
+
* 三类都是授权面变大的方向(判据在 `ScheduleWideningKind` 上)。新建那一支的
|
|
13475
|
+
* 基线是**引擎那份缺省档**(`default`)而不是「空」—— 拿空当基线的话每一条新任务
|
|
13476
|
+
* 都会被标成「放宽了」,而一枚恒亮的警示标等于没有警示标。
|
|
13477
|
+
*/
|
|
13478
|
+
declare function draftWidening(draft: ScheduleDraft, current?: ScheduleDefinition): ScheduleWideningKind[];
|
|
13479
|
+
/**
|
|
13480
|
+
* 那条能粘贴的命令行 —— **只有 `create` 拼得出来**。
|
|
13481
|
+
*
|
|
13482
|
+
* `update` 回 `undefined`,而这不是偷懒:`epoch schedule` 底下没有改字段的子命令
|
|
13483
|
+
* (只有 `add` / `show` / `enable` / `disable` / `rm` / `run` / `logs` /
|
|
13484
|
+
* `fire` / `doctor`),编一条 `epoch schedule update` 出来的后果是用户照着跑然后
|
|
13485
|
+
* 看见「未知命令」。那一支的真话是「改一条已有任务今天只有界面那条路」,
|
|
13486
|
+
* 由工具输出说出来。
|
|
13487
|
+
*
|
|
13488
|
+
* ⚠️ **`--budget` 那一格是个占位符,不是一个数。** 草稿没有预算(协议文件头那张表
|
|
13489
|
+
* 第二行),而 `epoch schedule add` 缺 `--budget` 会当场拒绝 —— 于是这条命令行和
|
|
13490
|
+
* 表单那条路落在同一处摩擦上:人必须自己填一个数才跑得起来。
|
|
13491
|
+
*/
|
|
13492
|
+
declare function draftCommandLine(draft: ScheduleDraft): string | undefined;
|
|
13493
|
+
|
|
13289
13494
|
/**
|
|
13290
13495
|
* 运行记录 = 一份 `WireEnvelope` 录像(方案 45 §4.3)。
|
|
13291
13496
|
*
|
|
@@ -14374,6 +14579,32 @@ declare class HookManager implements HookManager$1 {
|
|
|
14374
14579
|
} | null>;
|
|
14375
14580
|
trigger(type: HookType, event: HookEvent, ctx: HookContext): Promise<void>;
|
|
14376
14581
|
triggerTransform<T>(type: HookType, event: HookEvent, ctx: HookContext): Promise<T | null>;
|
|
14582
|
+
/**
|
|
14583
|
+
* ## ⚠️ 这个方法**必须**同时读 `commandHooks`(2026-09-04 补的那一半)
|
|
14584
|
+
*
|
|
14585
|
+
* 它原来是三个分发方法里唯一不读配置文件那一半的:
|
|
14586
|
+
*
|
|
14587
|
+
* | 方法 | 读 `this.hooks` | 读 `this.commandHooks` |
|
|
14588
|
+
* | ---- | :--: | :--: |
|
|
14589
|
+
* | {@link trigger} | ✅ | ✅ |
|
|
14590
|
+
* | {@link triggerCommandHooks} | ❌ | ✅ |
|
|
14591
|
+
* | 这一个(改之前) | ✅ | **❌** |
|
|
14592
|
+
*
|
|
14593
|
+
* 而 `verify:stop` **只**走这一条路。两条路当时都是死的:配置文件那一半没人读,
|
|
14594
|
+
* 进程内注册那一半对嵌入宿主也够不着(`BuildRuntimeOptions` 没有 hooks 字段、
|
|
14595
|
+
* `EpochRuntime` 上没有 `hookManager`)。于是「模型说完就停」那唯一一道闸
|
|
14596
|
+
* 对所有人都是关着的,而且**零诊断**:配置合法、`parseHooksConfig` 收下了它、
|
|
14597
|
+
* `issues` 是空的、`commandHooks` map 里真的有它 —— 只是没有任何一处会去读。
|
|
14598
|
+
* 写了它的人拿不到任何反馈,只会以为「配了但模型不听」。
|
|
14599
|
+
*
|
|
14600
|
+
* ## 这里是 `await`,不是 `trigger` 那种 fire-and-forget
|
|
14601
|
+
*
|
|
14602
|
+
* 表决要参与判断(`AgentLoop` 据此决定要不要再跑一轮),所以必须等。
|
|
14603
|
+
* 超时用的是**每条 hook 自己的** `config.timeout`(`runCommandHook` 里缺省
|
|
14604
|
+
* 30 秒),不是上面那个给 JS hook 的 {@link HOOK_TIMEOUT_MS} 5 秒 ——
|
|
14605
|
+
* 那 5 秒对一条要跑测试或跑 lint 的 `verify:stop` 明显偏紧,
|
|
14606
|
+
* 而 `HookEntrySchema` 里本来就有 `timeout` 这一格。
|
|
14607
|
+
*/
|
|
14377
14608
|
triggerVerify(type: HookType, event: HookEvent, ctx: HookContext): Promise<VerifyResult[]>;
|
|
14378
14609
|
private getSorted;
|
|
14379
14610
|
}
|
|
@@ -16303,4 +16534,4 @@ declare function resolveCodeModeWorker(baseDir: string, exists?: typeof existsSy
|
|
|
16303
16534
|
*/
|
|
16304
16535
|
declare function codeModeWorkerPath(): string | undefined;
|
|
16305
16536
|
|
|
16306
|
-
export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_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, 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_GOAL_MAX_ROUNDS, DEFAULT_MAX_HOLD_CHARS, type DelegateArgs, type DelegateConfig, DelegateManager, type DelegateTaskResult, type DiagnoseOptions, type DiscoverOutcome, type DiscoveredFile, type DoctorReport, EMPTY_RULES, EPOCH_DISK_LEDGER, EpochConfigSchema, type ExpandOptions, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_NAME_PATTERN, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, POLICY_DECISIONS, PROJECT_AGENTS_SUBDIR, PROVIDER_NO_CREDENTIAL, type PermissionAuditCode, type PermissionAuditEntry, type PermissionAuditOutcome, type PermissionAuditScope, type PermissionAuditSnapshot, PermissionManager, type PersistedBudget, type PersistedPart, type PlanApprovalFn, type PlanEnterResult, type PlanModeDeps, PlanModeState, type PlanSettlement, type PluginArtifacts, type PluginCommandDir, type PluginCounts, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginSettingsFile, type PluginSourceType, type PluginStateReadOutcome, PluginStore, type PolicyDirSpec, type PolicyDirsSummary, type PolicyLoadOutcome, type PolicyRule, PolicyRuleSchema, type ProjectContext, ProviderError, ProviderRouter, type ProviderStreamChunk, type ProviderToolCall$1 as ProviderToolCall, type ProviderWarning, type PruneResult, type QuestionAskFn, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, type ReadMessagesInput, type ReadMessagesOutput, type RecentWorkspace, RecentWorkspaces, type RecordRunInput, type RecorderOptions, type RecoveryAction, type RegisterInput, type RegisterOutcome, type RegistrarOptions, type RegistrationPatch, type RepairOutcome, type ResolveMentionsOptions, type ResolveReferenceInput, type ResolveSettingsOptions, type ResolvedCompression, type ResolvedReference, type ResolvedSource, type ResponseFormat, type RestorePartsOptions, type ReviewIssue, type RewindAction, type RewindDrift, type RewindFilePlan, type RewindOptions, type RewindOutcome, type RewindPreview, type RoleCreateFailure, type RoleCreateInput, type RoleCreateOptions, type RoleCreateOutcome, type RoleLoadOutcome, type RoleLoadSummary, type RoleMergeNotice, type RoleMergeResult, type RoleScope, type RuleMatch, type RuleSuggestion, type RuleVerdict, type RunCodeFailure, type RunCodeInput, type RunCodeOutcome, type RunCodeToolDeps, type RunEstimateInput, type RunInput, type RunResult, SANDBOX_COVERS, SANDBOX_EXCLUDES, SCALAR_KEYS, SCHEDULE_DEFAULTS, SCHEDULE_DEFAULT_ALLOWLIST, SCHEDULE_ISSUE_CODES, SCHTASKS_FOLDER, SESSION_MESSAGES_READ_TOOL, SESSION_MESSAGES_SEARCH_TOOL, SESSION_QUERY_TOOLS, SESSION_SEARCH_TOOL, SESSION_TRACE_TOOL, SETTINGS_LAYER_ORDER, SETTING_WRITE_APPLY, 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 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 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 SettingChain, type SettingFutile, type SettingLayer, type SettingStep, type SettingValue, type SettingValueKind, type SettingWriteFailure, type SettingWriteKey, type SettingWriteLayer, type SettingWriteOutcome, type SettingWriteRequest, type SettingWriteTarget, type SettingWriteTargetsOptions, type SettingsFile, SettingsFileError, SettingsFileSchema, type SettingsLayer, type SettingsResolution, type ShadowFinding, type ShadowKind, type Skill, type SkillDirSource, type SkillDirSpec, type SkillDirsSummary, type SkillImportConflict, type SkillImportDone, type SkillImportEntry, type SkillImportFailure, type SkillImportForm, type SkillImportOptions, type SkillImportPreview, type SkillImportResult, type SkillIndexEntry, type SkillIndexOptions, type SkillIndexResidency, type SkillIndexStats, SkillLearner, type SkillLearningProvider, type SkillMeta, type SkillStats, SkillSystem, type SkillSystemOptions, type SkillViewDeps, type SkillWriteDeps, type SubAgentRunner, type SubTask, type SubToolCaller, type SummarizeOutput, type SurfaceMessage, type SystemPromptParams, type SystemPromptSegments, TOOL_SEARCH_TOOL, TaskNoticeTracker, type TodoItem, type ToolCall, type ToolConflict, type ToolGate, type ToolNameFidelity, type ToolNameLookup, ToolRegistry, type ToolRevealState, type ToolScope, type ToolSearchDeps, type ToolTableCost, type TraceInput, type TraceNode, TrackerDB, type TrustDecision, type TrustGate, type TrustGateOptions, TrustManager, type TurnRecord, type TurnTiming, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, checkEpochVersion, checkFtsHealth, checkShadowing, classifyProviderError, clearModelCache, codeModeWorkerPath, commandNameFromRelPath, compileRuleLists, compressionOptions, computeCost, computeCostMicros, countRules, createAllowAllGate, createAllowAllImportGate, createAskQuestionTool, createCodeExecTool, createDelegateTool, createDenyAllGate, createDenyAllImportGate, createGoalTool, createImportGate, createMemoryTool, createPlanModeTools, createRoleFile, createRoleScope, createRunCodeTool, 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, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasPromptCaching, hasProviderCredentials, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, microsToUsd, modelListCandidates, needsAllowlist, nextFallbackModel, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, openArtifact, originOf, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelList, parseRoleDefinition, parseSkillFrontmatter, pendingImageTokens, persistParts, persistToolResults, persistedUsage, previewSkillImport, pruneArtifacts, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeSessionArtifacts, renderImportTree, renderProjectContext, renderSdkDeclaration, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolveProjectRoot, resolveScheduleBackend, resolveSessionReference, resolveSessionVisibility, resolveSettings, resolveSkillDirs, resolveSource, resolveWorkspace, restoreParts, revealScopedProvider, roleScopedProvider, roleSourceLabel, ruleCovers, ruleFromString, ruleToString, runCode, runCommand, sanitizeArgNames, sanitizeCommand, sanitizeFtsQuery, sanitizePath, sanitizeToolOutput, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, 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 };
|
|
16537
|
+
export { AGENT_ROLE_DIAG_MODULE, ARTIFACT_MAX_TOTAL_BYTES, ARTIFACT_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, 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_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, FTS_TABLES, FTS_TRIGGERS, type FallbackEvent, type FileSlots, type FileSourceKind, type ForkInput, type FrontmatterParse, type FrontmatterSplit, type FtsHealth, type FtsReclaim, type FtsSpace, type FtsTableHealth, GOAL_BLOCK_CODES, type GateAxis, type GateVerdict, type GenerateInput, type GenerateOutput, type Goal, type GoalBlockReason, type GoalClear, type GoalPhase, type GoalPromptView, type GoalRefusal, type GoalRoundResult, GoalService, GoalStore, type GoalToolDeps, type GoalWrite, HEADLESS_AUDIT_CODES, type HeadlessPolicy, type HookConfigEntry, HookManager, type HookManagerOptions, type HookMatcher, type HookSourceKind, type HookSourceStatus, type HookSourcesOptions, type HookSourcesSummary, type HooksParseOutcome, type MemoryManager$1 as IMemoryManager, INSTRUCTION_BUDGET_CHARS, INSTRUCTION_FILES, type SessionManager$1 as ISessionManager, type SkillSystem$1 as ISkillSystem, ImageLoadError, type ImageSize, type ImportDecision, type ImportGate, type ImportNode, type ImportSkipReason, ImportTrustStore, type InstallOptions, type InstallOutcome, type InstallPreview, type InstructionScan, type InstructionSource, type IsolationReason, type IsolationReport, type JsonSchemaDocument, LAUNCHD_LABEL_PREFIX, LOCK_HEARTBEAT_MS, LOCK_STALE_MS, type LayerOutcome, type LayerScalars, type LayerStatus, type LearningContext, type LearningResult, type LearningSkipReason, type LexiconLoadOutcome, type LifecycleOutcome, type ListCandidatesInput, type ListSessionsInput, type ListSessionsOutput, type LoadCommandsOptions, type LoadConfigOptions, type LoadKeybindingsOptions, type LoadKeybindingsResult, type LoadRolesOptions, type LoadedPlugin, type LockHolder, MARKETPLACE_FILE, MAX_AUDIT_ENTRIES, MAX_COMMAND_DEPTH, MAX_GOAL_MAX_ROUNDS, MAX_IMPORT_DEPTH, MAX_OBJECTIVE_CHARS, MAX_REASON_CHARS, MAX_RECENT_WORKSPACES, MODEL_GIVE_UP_THRESHOLD, MULTIMODAL_DEFAULTS, type ManagedPolicy, ManagedPolicyError, type ManagedSettings, ManagedSettingsSchema, type MarketplaceCatalog, type MarketplaceEntry, type MarketplaceOutcome, type MarketplaceRecord, type MemoryConfig, type MemoryEntry, MemoryManager, MemoryReviewer, type MemorySearchResult, type MemoryTarget, type MemoryWriteResult, type MentionPart, type MentionResolution, type Message, type MessageHit, type MessageRecord, type MessageSurface, type ModelCapability, ModelFailureTracker, type ModelMetaEntry, type ModelPricing, type MultimodalPolicy, NOMINAL_TOTAL_BYTES, NO_REVEALED_TOOLS, type NonInteractiveProbe, type OsTaskSnapshot, type OutputGuard, PERMISSION_AUDIT_CODES, PLUGIN_LAYOUT, PLUGIN_MANIFEST_FILE, PLUGIN_NAME_PATTERN, PLUGIN_ROOT_ENV, PLUGIN_ROOT_TOKEN, POLICY_DECISIONS, PROJECT_AGENTS_SUBDIR, PROVIDER_NO_CREDENTIAL, type PermissionAuditCode, type PermissionAuditEntry, type PermissionAuditOutcome, type PermissionAuditScope, type PermissionAuditSnapshot, PermissionManager, type PersistedBudget, type PersistedPart, type PlanApprovalFn, type PlanEnterResult, type PlanModeDeps, PlanModeState, type PlanSettlement, type PluginArtifacts, type PluginCommandDir, type PluginCounts, type PluginHookFile, type PluginInventory, type PluginLoadOptions, type PluginManifest, type PluginPathRef, type PluginRecord, type PluginSettingsFile, type PluginSourceType, type PluginStateReadOutcome, PluginStore, type PolicyDirSpec, type PolicyDirsSummary, type PolicyLoadOutcome, type PolicyRule, PolicyRuleSchema, type ProjectContext, ProviderError, ProviderRouter, type ProviderStreamChunk, type ProviderToolCall$1 as ProviderToolCall, type ProviderWarning, type PruneResult, type QuestionAskFn, RECORDING_KEEP_RUNS, RECORDING_MAX_BYTES, ROLE_FRONTMATTER_SCHEMA, RUN_CODE_TOOL, type ReadMessagesInput, type ReadMessagesOutput, type RecentWorkspace, RecentWorkspaces, type RecordRunInput, type RecorderOptions, type RecoveryAction, type RegisterInput, type RegisterOutcome, type RegistrarOptions, type RegistrationPatch, type RepairOutcome, type ResolveMentionsOptions, type ResolveReferenceInput, type ResolveSettingsOptions, type ResolvedCompression, type ResolvedReference, type ResolvedSource, type ResponseFormat, type RestorePartsOptions, type ReviewIssue, type RewindAction, type RewindDrift, type RewindFilePlan, type RewindOptions, type RewindOutcome, type RewindPreview, type RoleCreateFailure, type RoleCreateInput, type RoleCreateOptions, type RoleCreateOutcome, type RoleLoadOutcome, type RoleLoadSummary, type RoleMergeNotice, type RoleMergeResult, type RoleScope, type RuleMatch, type RuleSuggestion, type RuleVerdict, type RunCodeFailure, type RunCodeInput, type RunCodeOutcome, type RunCodeToolDeps, type RunEstimateInput, type RunInput, type RunResult, SANDBOX_COVERS, SANDBOX_EXCLUDES, SCALAR_KEYS, SCHEDULE_DEFAULTS, SCHEDULE_DEFAULT_ALLOWLIST, SCHEDULE_ISSUE_CODES, SCHTASKS_FOLDER, SESSION_MESSAGES_READ_TOOL, SESSION_MESSAGES_SEARCH_TOOL, SESSION_QUERY_TOOLS, SESSION_SEARCH_TOOL, SESSION_TRACE_TOOL, SETTINGS_LAYER_ORDER, SETTING_WRITE_APPLY, 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 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 SettingChain, type SettingFutile, type SettingLayer, type SettingStep, type SettingValue, type SettingValueKind, type SettingWriteFailure, type SettingWriteKey, type SettingWriteLayer, type SettingWriteOutcome, type SettingWriteRequest, type SettingWriteTarget, type SettingWriteTargetsOptions, type SettingsFile, SettingsFileError, SettingsFileSchema, type SettingsLayer, type SettingsResolution, type ShadowFinding, type ShadowKind, type Skill, type SkillDirSource, type SkillDirSpec, type SkillDirsSummary, type SkillImportConflict, type SkillImportDone, type SkillImportEntry, type SkillImportFailure, type SkillImportForm, type SkillImportOptions, type SkillImportPreview, type SkillImportResult, type SkillIndexEntry, type SkillIndexOptions, type SkillIndexResidency, type SkillIndexStats, SkillLearner, type SkillLearningProvider, type SkillMeta, type SkillStats, SkillSystem, type SkillSystemOptions, type SkillViewDeps, type SkillWriteDeps, type SubAgentRunner, type SubTask, type SubToolCaller, type SummarizeOutput, type SurfaceMessage, type SystemPromptParams, type SystemPromptSegments, TOOL_SEARCH_TOOL, TaskNoticeTracker, type TodoItem, type ToolCall, type ToolConflict, type ToolGate, type ToolNameFidelity, type ToolNameLookup, ToolRegistry, type ToolRevealState, type ToolScope, type ToolSearchDeps, type ToolTableCost, type TraceInput, type TraceNode, TrackerDB, type TrustDecision, type TrustGate, type TrustGateOptions, TrustManager, type TurnRecord, type TurnTiming, type UpdateScheduleInput, type UtilityModelInfo, type ValidateScheduleInput, type VersionCheck, Workspace, type WorkspaceFiles, type WorkspaceIssue, type WorkspaceIssueKind, acquireScheduleLock, addMarketplace, addUsage, admitArtifact, admitArtifacts, affectedPaths, artifactLaunchArgv, artifactOpenRefusal, assertLevelAllowed, blockedRoleTools, buildContextBreakdown, buildFireArgv, buildFtsMatchQuery, buildSchemaExports, buildSystemPrompt, buildTrigramMatchQuery, builtinRoles, checkEpochVersion, checkFtsHealth, checkShadowing, classifyProviderError, clearModelCache, codeModeWorkerPath, commandNameFromRelPath, compileRuleLists, compressionOptions, computeCost, computeCostMicros, 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, draftCommandLine, draftWidening, escapeRuleContent, estimateImageTokens, estimateRunTokens, estimateTokens, evaluateSelection, expandCommand, expandImports, explainSetting, findInstructionFiles, findProjectInstructions, findRole, formatBytes, formatSkillIndex, formatUsd, gateForTool, getCapability, getConfigIssues, getConfigOrigins, getImportGate, getTrustGate, hasPromptCaching, hasProviderCredentials, imageFromBase64, imageFromPath, imagePartTokens, importSkills, installPlugin, instructionDirs, instructionNotices, intervalSlots, inventoryTotal, isBlockCode, isCodeModeDeferred, isEmptyRules, isGoalPhase, isNonInteractive, isReadOnlySubCall, isSettingWriteLayer, isValidPluginName, isWithinWindow, isWritableSettingKey, labelSlug, layerRank, listSessionCandidates, listWorkspaceFiles, loadCommandDefinitions, loadCommandFile, loadCommands, loadConfig, loadHookSources, loadKeybindings, loadLexiconDir, loadLexiconFiles, loadPlugins, loadPolicyFiles, loadPolicyRules, loadRoleDefinitions, loadRoleDir, loadedImports, localDateString, managedSwitchNotes, mapClaudeToolName, mapEpochToolName, mapOperationType, matchPreauthorization, matchRuleLists, matchesHook, mentionsPluginRoot, mergeHeadlessPolicy, mergeRoles, microsToUsd, modelListCandidates, needsAllowlist, nextFallbackModel, nextRunAt, noConfigOrigins, noManagedPolicy, noPlugins, openArtifact, originOf, parseClaudeSettingsHooks, parseClock, parseDate, parseFrontmatter, parseHooksConfig, parseHooksConfigVerbose, parseImportLine, parseModelList, parseRoleDefinition, parseScheduleDraft, parseSkillFrontmatter, parseTrigger, pendingImageTokens, persistParts, persistToolResults, persistedUsage, previewSkillImport, pruneArtifacts, pruneRecordings, pruneSchedules, readImageSize, readMarketplaces, readPluginManifest, readPluginRecords, readProviderKeyEnv, readRecording, readSessionSurface, reclaimFtsSpace, redactLine, refreshOpenRouterMetadata, removeMarketplace, removeSessionArtifacts, renderImportTree, renderProjectContext, renderSdkDeclaration, repairSchedules, resolveArtifactRetention, resolveCodeModeWorker, resolveComplianceDirs, resolveEntrySource, resolveInWorkspace, resolveMarketplaceRef, resolveMentions, resolveMultimodalPolicy, resolvePolicyDirs, resolveProjectRoot, resolveScheduleBackend, resolveSessionReference, resolveSessionVisibility, resolveSettings, resolveSkillDirs, resolveSource, resolveWorkspace, restoreParts, revealScopedProvider, roleScopedProvider, roleSourceLabel, ruleCovers, ruleFromString, ruleToString, runCode, runCommand, sanitizeArgNames, sanitizeCommand, sanitizeFtsQuery, sanitizePath, sanitizeToolOutput, scanInstructions, scanPluginDir, scanSkillDirs, searchMarketplaces, setImportGate, setPluginEnabled, setTrustGate, settingValueChoices, settingValueKind, 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 };
|