diff --git a/src/codex-models.ts b/src/codex-models.ts index 45ee8b588e..02d49f1ab2 100644 --- a/src/codex-models.ts +++ b/src/codex-models.ts @@ -89,7 +89,7 @@ function positiveWindow(value: unknown): number | undefined { /** #5243: which surface produced a codex-aligned window — named in the clamp * log so "window clamped" stops claiming client metadata when no client * metadata existed. */ -export type CodexWindowSource = +type CodexWindowSource = | "client-metadata" | "codex-catalog" | "codex-models-cache" diff --git a/src/pack-install.ts b/src/pack-install.ts index a70844c1a8..0124feab4c 100644 --- a/src/pack-install.ts +++ b/src/pack-install.ts @@ -31,7 +31,7 @@ export const PACK_ENTRY_FILE = "bili-pack.json"; const NPM_TIMEOUT_MS = 120_000; -export interface PackInstallOptions { +interface PackInstallOptions { /** Target `./.billion-context/packs/` instead of the user-dir default. */ project?: boolean; /** Replace an existing pack file (refused otherwise). */ @@ -114,7 +114,8 @@ export function installPackFromNpm(spec: string, options: PackInstallOptions = { const err = error as { stderr?: unknown; message?: string }; stderr = typeof err.stderr === "string" ? err.stderr : ""; if (/ENOENT/.test(String(err.message))) throw new Error("npm was not found on PATH"); - const tail = stderr.trim().split("\n").slice(-3).join(" ").slice(0, 300); + const lines = stderr.trim().split("\n"); + const tail = lines.slice(Math.max(0, lines.length - 3)).join(" ").slice(0, 300); throw new Error(`npm install ${trimmed} failed${tail ? `: ${tail}` : ""}`); } diff --git a/website/config-reference/compress.yaml b/website/config-reference/compress.yaml index 25a7896f63..80500ba6ae 100644 --- a/website/config-reference/compress.yaml +++ b/website/config-reference/compress.yaml @@ -164,13 +164,13 @@ entries: site_en: "\"off\" | \"warn\" | \"repair\" (default repair): reconcile folded state when the client rewinds or rewrites history between turns." site_zh: "\"off\" | \"warn\" | \"repair\"(默认 repair):客户端在轮次之间回退或改写历史时校准已折叠状态。" - key: compress.promptPack - type: "string (builtin: \"default\", \"lean\")" + type: "string (builtin: \"default\", \"lean\", \"chat\")" default: "builtin \"default\"" group: compress id: cw.ppk render: compress-row - desc_en: "Compression prompt pack, resolved project pack → user pack → builtin; not gated by acknowledgePromptsRisk." - desc_zh: "压缩提示词包,按 项目包 → 用户包 → 内置 解析;不受 acknowledgePromptsRisk 门控。" + desc_en: "Compression prompt pack, resolved project pack → user pack → shipped pack → builtin; not gated by acknowledgePromptsRisk." + desc_zh: "压缩提示词包,按 项目包 → 用户包 → 随包附带(chat)→ 内置 解析;不受 acknowledgePromptsRisk 门控。" site_en: "Compression prompt pack, resolved project pack → user pack → builtin. Builtins: \"default\" and \"lean\" (one-line tool descriptions). Not gated by acknowledgePromptsRisk." site_zh: "压缩提示词包,按 项目包 → 用户包 → 内置 解析。内置:\"default\" 与 \"lean\"(单行工具描述)。不受 acknowledgePromptsRisk 门控。" - key: compress.tiers diff --git a/website/docs/index.html b/website/docs/index.html index cfbe6e24b1..e4a692997c 100644 --- a/website/docs/index.html +++ b/website/docs/index.html @@ -195,7 +195,7 @@

compress — every knob

maxSummaryLengthnumberHard cap, in characters, on one generated summary (kernel default 20000): longer replies are rejected whole by the kernel check or the external-summary executor. External summarizers receive this exact cap in their instructions (#3635); 0 disables the cap. minSummaryLengthnumberFloor, in characters, for generated summaries (kernel default 50): shorter replies are rejected whole; 0 disables the floor. External summarizers are held to the same floor (#3635). reconcile"off" | "warn" | "repair""off" | "warn" | "repair" (default repair): reconcile folded state when the client rewinds or rewrites history between turns. - promptPackstring (builtin: "default", "lean")Compression prompt pack, resolved project pack → user pack → builtin. Builtins: "default" and "lean" (one-line tool descriptions). Not gated by acknowledgePromptsRisk. + promptPackstring (builtin: "default", "lean", "chat")Compression prompt pack, resolved project pack → user pack → builtin. Builtins: "default" and "lean" (one-line tool descriptions). Not gated by acknowledgePromptsRisk. tiersbooleanOn by default: tiered T1→T3 distillation spreads folding cost across generations. protectedToolsstring[]Hard exclusion across all history: results of listed tools never fold (use with care). protectedLatestToolsstring[]Protects only the LATEST instance of cumulative-snapshot tools whose newest result supersedes older ones (e.g. todo lists).