zidane 7.0.31 → 7.1.1
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 +21 -2
- package/dist/{acp-m3TLCY_C.js → acp-B5UfEhMd.js} +4 -4
- package/dist/{acp-m3TLCY_C.js.map → acp-B5UfEhMd.js.map} +1 -1
- package/dist/acp-cli.js +6 -6
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-9gf8ZlBR.js → agent-_xxElOgH.js} +307 -33
- package/dist/agent-_xxElOgH.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{anthropic-B4UmPm4H.js → anthropic-DPPs3wjJ.js} +111 -7
- package/dist/anthropic-DPPs3wjJ.js.map +1 -0
- package/dist/{approvals-DaCEPCTV.js → approvals-u2T19Dc-.js} +297 -95
- package/dist/approvals-u2T19Dc-.js.map +1 -0
- package/dist/{auth-CJogE9q7.js → auth-HRKkOErn.js} +3 -3
- package/dist/{auth-CJogE9q7.js.map → auth-HRKkOErn.js.map} +1 -1
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat/pure.js +1 -1
- package/dist/chat.d.ts +6 -6
- package/dist/chat.js +8 -8
- package/dist/contexts/daytona.d.ts +3 -3
- package/dist/contexts/docker.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +2 -2
- package/dist/contexts/sandbox.d.ts +1 -1
- package/dist/{contexts-BSFQVclW.js → contexts-CRE9pw07.js} +544 -17
- package/dist/contexts-CRE9pw07.js.map +1 -0
- package/dist/contexts.d.ts +4 -4
- package/dist/contexts.js +2 -2
- package/dist/daemon-cli.js +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +3 -3
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +3 -3
- package/dist/{index-B6FkK6ZN.d.ts → index-C37_ppWv.d.ts} +2 -2
- package/dist/index-C37_ppWv.d.ts.map +1 -0
- package/dist/{index-JkEO3MBV.d.ts → index-D3TTaaQ5.d.ts} +39 -7
- package/dist/index-D3TTaaQ5.d.ts.map +1 -0
- package/dist/{index-hd4zLhp8.d.ts → index-DZhrTn-v.d.ts} +307 -16
- package/dist/index-DZhrTn-v.d.ts.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +8 -8
- package/dist/{ipc-BtN5SIc0.js → ipc-DwauKEE-.js} +3 -3
- package/dist/{ipc-BtN5SIc0.js.map → ipc-DwauKEE-.js.map} +1 -1
- package/dist/ipc.d.ts +5 -5
- package/dist/ipc.js +3 -3
- package/dist/{types-U-rIVUDw.d.ts → isolation-Kfoof0MM.d.ts} +93 -2
- package/dist/isolation-Kfoof0MM.d.ts.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/{plugins-B531Tz5b.js → plugins-gbI7SBA6.js} +3 -3
- package/dist/{plugins-B531Tz5b.js.map → plugins-gbI7SBA6.js.map} +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +2 -2
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers.d.ts +2 -2
- package/dist/providers.js +1 -1
- package/dist/restate.d.ts +2 -2
- package/dist/restate.js +1 -1
- package/dist/{sandbox-CDl9tfTo.d.ts → sandbox-BH0WQkXn.d.ts} +2 -2
- package/dist/{sandbox-CDl9tfTo.d.ts.map → sandbox-BH0WQkXn.d.ts.map} +1 -1
- package/dist/{server-ktOMu5gk.js → server-DvPnPSZb.js} +8 -8
- package/dist/{server-ktOMu5gk.js.map → server-DvPnPSZb.js.map} +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session/sqlite.d.ts.map +1 -1
- package/dist/session/sqlite.js +7 -0
- package/dist/session/sqlite.js.map +1 -1
- package/dist/{session-CVy-2mAy.js → session-BqRP1hS7.js} +33 -3
- package/dist/session-BqRP1hS7.js.map +1 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +1 -1
- package/dist/{skills-PJyiSRCp.js → skills-BC3dodWp.js} +2 -2
- package/dist/{skills-PJyiSRCp.js.map → skills-BC3dodWp.js.map} +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +1 -1
- package/dist/{src-CjkY6fBj.js → src-CkNQKFKr.js} +3 -3
- package/dist/{src-CjkY6fBj.js.map → src-CkNQKFKr.js.map} +1 -1
- package/dist/{tool-formatters-C4QIFCNa.d.ts → tool-formatters-C5s88MUd.d.ts} +2 -2
- package/dist/{tool-formatters-C4QIFCNa.d.ts.map → tool-formatters-C5s88MUd.d.ts.map} +1 -1
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1 -1
- package/dist/{transcript-anchors-Bbn1HX5D.d.ts → transcript-anchors-DxofXw_y.d.ts} +3 -3
- package/dist/transcript-anchors-DxofXw_y.d.ts.map +1 -0
- package/dist/tui.d.ts +21 -28
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +200 -74
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-BgqpLlOG.js → turn-operations-6JDu2ewy.js} +24 -2
- package/dist/{turn-operations-BgqpLlOG.js.map → turn-operations-6JDu2ewy.js.map} +1 -1
- package/dist/{turn-operations-BhHCpCkP.d.ts → turn-operations-BaQnxzhr.d.ts} +14 -4
- package/dist/{turn-operations-BhHCpCkP.d.ts.map → turn-operations-BaQnxzhr.d.ts.map} +1 -1
- package/dist/types-CWgENVLY.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/docs/ARCHITECTURE.md +13 -3
- package/docs/CHAT.md +9 -0
- package/docs/EXECUTION_CONTEXT.md +64 -3
- package/docs/INTERACTIONS.md +14 -2
- package/docs/SKILL.md +31 -1
- package/docs/TUI.md +6 -5
- package/package.json +1 -1
- package/dist/agent-9gf8ZlBR.js.map +0 -1
- package/dist/anthropic-B4UmPm4H.js.map +0 -1
- package/dist/approvals-DaCEPCTV.js.map +0 -1
- package/dist/contexts-BSFQVclW.js.map +0 -1
- package/dist/index-B6FkK6ZN.d.ts.map +0 -1
- package/dist/index-JkEO3MBV.d.ts.map +0 -1
- package/dist/index-hd4zLhp8.d.ts.map +0 -1
- package/dist/session-CVy-2mAy.js.map +0 -1
- package/dist/transcript-anchors-Bbn1HX5D.d.ts.map +0 -1
- package/dist/types-U-rIVUDw.d.ts.map +0 -1
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
import { n as __require } from "./rolldown-runtime-BhDjJH2R.js";
|
|
2
2
|
import { n as THINKING_LEVELS, u as toolResultToText } from "./types-CWgENVLY.js";
|
|
3
|
-
import {
|
|
4
|
-
import { F as parseCommandInvocation, M as commandBlocksToContent, P as executeCommand, c as SKILL_EDIT_METADATA_KEY, g as readSkillEditMarker, j as commandBlockToEvent, l as ZIDANE_EXTENSION_SKILL_NAME, m as extensionDirForCwd, s as EXTENSION_EDIT_METADATA_KEY, u as ZIDANE_SKILL_EDIT_SKILL_NAME, v as withZidaneExtensionSkill, w as generateStructuredData, y as withZidaneSkillEditSkill } from "./src-
|
|
3
|
+
import { $n as effectiveContextWindow, A as buildPostCompactAttachments, Bn as artifactKindLabel, Bt as multiEdit, D as resolvePersistDir, E as resolveMcpWarningsDir, Et as waitTask, It as shell, Jn as renderArtifactRow, Jt as edit, Kt as grep, M as selectFilesFromSession, Ot as createSpawnTool, P as compactConversation, Pt as shellKill, Qn as OUTPUT_RESERVE_TOKENS, Rt as readFile$1, S as migrateSessionArtifactDirs, Tn as createDebugLog, Wt as listFiles, Xt as artifacts_default, Z as EMPTY_EXTENSION_REGISTRY, bt as composePresets, cn as mergeKeybindings, dn as readKeybindingsRaw, dt as composeExtensionPreset, f as applyCompactSummaryCutoff, fn as resolveExtensionKeybindings, g as unwrapCallTool, in as formatBindingForDisplay, k as resolveTasksDir, kt as isSpawnTool, lt as buildExtensionPreset, mt as filterRegistryPlugins, q as summaryToTurn, qt as glob, t as createAgent, wt as writeFile$1, xt as definePreset } from "./agent-_xxElOgH.js";
|
|
4
|
+
import { F as parseCommandInvocation, M as commandBlocksToContent, P as executeCommand, c as SKILL_EDIT_METADATA_KEY, g as readSkillEditMarker, j as commandBlockToEvent, l as ZIDANE_EXTENSION_SKILL_NAME, m as extensionDirForCwd, s as EXTENSION_EDIT_METADATA_KEY, u as ZIDANE_SKILL_EDIT_SKILL_NAME, v as withZidaneExtensionSkill, w as generateStructuredData, y as withZidaneSkillEditSkill } from "./src-CkNQKFKr.js";
|
|
5
5
|
import { a as formatDuration, c as previewLine, i as fmtTokens, l as shortId, s as formatTaskSummary, t as ageString } from "./format-BF745pLL.js";
|
|
6
|
-
import { r as createProcessContext } from "./contexts-
|
|
6
|
+
import { a as DEFAULT_UNREADABLE_DIRS, c as resolveUnreadableDirs, l as resolveWritableRoots, o as isolationAvailability, r as createProcessContext, s as parseAllowWriteSetting, u as resolveWritableRootsAsync } from "./contexts-CRE9pw07.js";
|
|
7
7
|
import { u as errorMessage$1 } from "./errors-DKiMrOKq.js";
|
|
8
|
-
import { L as projectUserPaths, R as findGitRoot$1, x as discoverSkills } from "./skills-
|
|
8
|
+
import { L as projectUserPaths, R as findGitRoot$1, x as discoverSkills } from "./skills-BC3dodWp.js";
|
|
9
9
|
import { t as writeFileAtomic } from "./atomic-write-B7zr1ddF.js";
|
|
10
|
-
import { n as defaultPluginDataRoot, p as resolveStorageDirs, r as loadAgentPlugin } from "./plugins-
|
|
10
|
+
import { n as defaultPluginDataRoot, p as resolveStorageDirs, r as loadAgentPlugin } from "./plugins-gbI7SBA6.js";
|
|
11
11
|
import { r as createLogger, t as consoleSink } from "./logger--C1VQjwJ.js";
|
|
12
12
|
import { h as McpOAuthProvider, l as normalizeMcpServers, n as connectMcpServers, s as nonOwningMcpView } from "./mcp-CgNd-f3F.js";
|
|
13
13
|
import { appendDynamicSection, joinSystemPrompt, splitSystemPrompt } from "./prompt.js";
|
|
14
|
-
import { o as loadSession, t as createSession } from "./session-
|
|
14
|
+
import { l as withExtensionSession, o as loadSession, t as createSession } from "./session-BqRP1hS7.js";
|
|
15
15
|
import { n as flattenTurns, r as formatTokenUsage } from "./stats-DAKBEKjc.js";
|
|
16
16
|
import { i as installCacheBreakLogger } from "./cache-telemetry-ehVdWsg2.js";
|
|
17
17
|
import { i as findActiveTriggers, n as collectReferences, o as mergeSuggestions, t as applyInsert } from "./completion-core-BRo86R_L.js";
|
|
18
|
-
import {
|
|
18
|
+
import { h as sanitizeProviderDiagnosticMetadata, n as THINKING_BINDING_SETTING_ENV } from "./anthropic-DPPs3wjJ.js";
|
|
19
19
|
import { r as fetchUrl } from "./fetch-url-ma-5_p0p.js";
|
|
20
20
|
import { webSearch } from "./tools/web-search.js";
|
|
21
|
-
import { A as chunkMarkdownForRender, At as
|
|
22
|
-
import { T as restoreModelOptions, b as modelSupportsReasoning, d as BUILTIN_PROVIDERS, f as anthropicDescriptor, g as getContextWindow, h as enabledModelOptions, i as readCredentials, m as credKeyOf, n as applyApiKeyEnv, r as credentialsPath, t as detectAuth, x as modelsForDescriptor } from "./auth-
|
|
21
|
+
import { $t as formatRunReceiptLine, A as chunkMarkdownForRender, At as MAIN_PLAYBOOK_FRAGMENT, Bt as renderProjectsBriefing, Ct as promptTurnRefs, Ft as WORKER_REPORT_FRAGMENT, I as cacheBreakChip, It as artifactsFromTurns, L as cacheBreakNoticeText, Lt as isMainSession, Mt as ORCHESTRATED_BY_KEY, Pt as SESSION_ROLE_KEY, Rt as orchestratedBy, Sn as stripEditOutcomesAnnotation, Tn as chatReferenceTokensFromText, Vt as renderSessionEventXml, W as buildRunModel, Wt as sessionEventLabel, Y as filterChainFallbacks, bn as resolveApprovalForPayload, fn as previewEditPayload, gn as buildEditOutcomesAnnotation, jt as MAIN_SESSION_TITLE, m as ownerOf, nn as hasRunReceipt, rn as runReceiptFromRun, tt as restoreChainFallbacks, u as capTranscriptEvents, un as extractEditPayload, vn as mergeApprovalAndBodyOutcomes, xn as rewriteMultiEditHeader, yn as parseEditOutcomesFromResult, zt as parseSessionEventXml } from "./turn-operations-6JDu2ewy.js";
|
|
22
|
+
import { T as restoreModelOptions, b as modelSupportsReasoning, d as BUILTIN_PROVIDERS, f as anthropicDescriptor, g as getContextWindow, h as enabledModelOptions, i as readCredentials, m as credKeyOf, n as applyApiKeyEnv, r as credentialsPath, t as detectAuth, x as modelsForDescriptor } from "./auth-HRKkOErn.js";
|
|
23
23
|
import { basename, delimiter, dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
24
24
|
import { Buffer } from "node:buffer";
|
|
25
25
|
import { chmodSync, closeSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, watch, writeFileSync } from "node:fs";
|
|
26
|
+
import { homedir, tmpdir } from "node:os";
|
|
26
27
|
import { readFile, readdir, stat, writeFile } from "node:fs/promises";
|
|
27
28
|
import { spawn } from "node:child_process";
|
|
28
|
-
import { homedir, tmpdir } from "node:os";
|
|
29
29
|
import { createHash, randomUUID } from "node:crypto";
|
|
30
30
|
import { Fzf } from "fzf";
|
|
31
31
|
import { createGunzip } from "node:zlib";
|
|
32
32
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
33
33
|
import { Writable } from "node:stream";
|
|
34
34
|
import { jsx } from "react/jsx-runtime";
|
|
35
|
+
import process$1 from "node:process";
|
|
35
36
|
//#region src/chat/store.ts
|
|
36
37
|
function ensureStateDir(path) {
|
|
37
38
|
const dir = dirname(path);
|
|
@@ -611,7 +612,8 @@ function eventsFromTurns(turns, runs = []) {
|
|
|
611
612
|
...tag
|
|
612
613
|
});
|
|
613
614
|
} else if (block.type === "tool_call") {
|
|
614
|
-
|
|
615
|
+
const { name, input } = unwrapCallTool(block.name, block.input) ?? block;
|
|
616
|
+
let edit = extractEditPayload(name, input);
|
|
615
617
|
if (edit) {
|
|
616
618
|
const resultText = resultByCallId.get(block.id);
|
|
617
619
|
if (resultText) {
|
|
@@ -624,9 +626,9 @@ function eventsFromTurns(turns, runs = []) {
|
|
|
624
626
|
}
|
|
625
627
|
events.push({
|
|
626
628
|
kind: "tool",
|
|
627
|
-
text: toolCallPreview(
|
|
628
|
-
tool:
|
|
629
|
-
input
|
|
629
|
+
text: toolCallPreview(name, input),
|
|
630
|
+
tool: name,
|
|
631
|
+
input,
|
|
630
632
|
...edit ? { edit } : {},
|
|
631
633
|
callId: block.id,
|
|
632
634
|
...tag
|
|
@@ -2306,6 +2308,7 @@ function discoveryDedupHash(input) {
|
|
|
2306
2308
|
const SHARED_BEHAVIOR = {
|
|
2307
2309
|
compactStrategy: "tail",
|
|
2308
2310
|
compactThreshold: 128 * 1024,
|
|
2311
|
+
compactThresholdWindowFraction: .25,
|
|
2309
2312
|
compactKeepTurns: 8,
|
|
2310
2313
|
elideStaleReads: "notice",
|
|
2311
2314
|
mediaKeepTurns: 8,
|
|
@@ -2815,6 +2818,23 @@ function chatAutoCompactBehavior(opts) {
|
|
|
2815
2818
|
releaseReplacedTurns: true
|
|
2816
2819
|
};
|
|
2817
2820
|
}
|
|
2821
|
+
/**
|
|
2822
|
+
* The per-run window knobs a chat host spreads into `agent.run`'s `behavior`:
|
|
2823
|
+
* the auto-compaction config from {@link chatAutoCompactBehavior} PLUS the
|
|
2824
|
+
* picked model's raw window as `behavior.contextWindow`, so window-relative
|
|
2825
|
+
* wire budgets (`compactThresholdWindowFraction`) see the window even when the
|
|
2826
|
+
* user has auto-compaction switched off. Both hosts go through this so they
|
|
2827
|
+
* cannot drift: the TUI and the GUI/daemon engine hand the loop the same
|
|
2828
|
+
* shape for the same settings.
|
|
2829
|
+
*/
|
|
2830
|
+
function chatWindowBehavior(opts) {
|
|
2831
|
+
const autoCompact = chatAutoCompactBehavior(opts);
|
|
2832
|
+
const contextWindow = typeof opts.rawContextWindow === "number" && Number.isFinite(opts.rawContextWindow) && opts.rawContextWindow > 0 ? opts.rawContextWindow : void 0;
|
|
2833
|
+
return {
|
|
2834
|
+
autoCompact,
|
|
2835
|
+
...contextWindow !== void 0 ? { contextWindow } : {}
|
|
2836
|
+
};
|
|
2837
|
+
}
|
|
2818
2838
|
//#endregion
|
|
2819
2839
|
//#region src/chat/auto-update.ts
|
|
2820
2840
|
const OPT_OUT_VARS$1 = [
|
|
@@ -7789,6 +7809,10 @@ const DEFAULT_SETTINGS = {
|
|
|
7789
7809
|
showAllProjects: false,
|
|
7790
7810
|
resumeLastSession: true,
|
|
7791
7811
|
persistToolResults: true,
|
|
7812
|
+
stableToolList: false,
|
|
7813
|
+
sandbox: false,
|
|
7814
|
+
sandboxNetwork: "allow",
|
|
7815
|
+
sandboxAllowWrite: "",
|
|
7792
7816
|
autoCompact: true,
|
|
7793
7817
|
autoCompactThreshold: .8,
|
|
7794
7818
|
resumeOnMaxTokens: false,
|
|
@@ -7798,6 +7822,7 @@ const DEFAULT_SETTINGS = {
|
|
|
7798
7822
|
maxCostUsd: 0,
|
|
7799
7823
|
maxTotalTokens: 0,
|
|
7800
7824
|
maxWallMinutes: 0,
|
|
7825
|
+
thinkingBinding: "drop_block",
|
|
7801
7826
|
showEditDiffs: true,
|
|
7802
7827
|
editDiffDisplay: "full",
|
|
7803
7828
|
showCompactionSummary: false,
|
|
@@ -7928,6 +7953,18 @@ const SETTINGS_TOGGLES = [
|
|
|
7928
7953
|
label: "Persist large tool results",
|
|
7929
7954
|
description: "write >8 KiB tool outputs to disk and inline a preview"
|
|
7930
7955
|
},
|
|
7956
|
+
{
|
|
7957
|
+
category: "agent",
|
|
7958
|
+
key: "stableToolList",
|
|
7959
|
+
label: "Stable tool list (call_tool)",
|
|
7960
|
+
description: "invoke MCP tools surfaced by tool_search through `call_tool` instead of adding them to the model's tool list, so tool discovery never breaks the prompt cache. Anthropic always works this way (replayed thinking is bound to the tool list); this toggle affects other providers (next session activation)"
|
|
7961
|
+
},
|
|
7962
|
+
{
|
|
7963
|
+
category: "agent",
|
|
7964
|
+
key: "sandbox",
|
|
7965
|
+
label: "Sandbox shell commands",
|
|
7966
|
+
description: "run the model's shell commands under the OS sandbox (macOS Seatbelt / Linux bwrap): writes limited to the project, temp dirs and \"Sandbox writable paths\", credential dirs hidden; write_file/edit follow the same roots. Does not cover ! commands, MCP servers or fetch_url. Fails closed when the sandbox is unavailable (next session activation)"
|
|
7967
|
+
},
|
|
7931
7968
|
{
|
|
7932
7969
|
category: "agent",
|
|
7933
7970
|
key: "loadProjectExtensions",
|
|
@@ -8125,6 +8162,19 @@ const SETTINGS_CHOICES = [
|
|
|
8125
8162
|
}
|
|
8126
8163
|
]
|
|
8127
8164
|
},
|
|
8165
|
+
{
|
|
8166
|
+
category: "agent",
|
|
8167
|
+
key: "sandboxNetwork",
|
|
8168
|
+
label: "Sandbox network",
|
|
8169
|
+
description: "network access for sandboxed shell commands (allow keeps bun install / git fetch / gh working; deny blocks all sockets, the only way to stop exfiltration of readable files). Needs \"Sandbox shell commands\"",
|
|
8170
|
+
options: [{
|
|
8171
|
+
value: "allow",
|
|
8172
|
+
label: "Allow"
|
|
8173
|
+
}, {
|
|
8174
|
+
value: "deny",
|
|
8175
|
+
label: "Deny"
|
|
8176
|
+
}]
|
|
8177
|
+
},
|
|
8128
8178
|
{
|
|
8129
8179
|
category: "agent",
|
|
8130
8180
|
key: "autoCompactThreshold",
|
|
@@ -8345,6 +8395,26 @@ const SETTINGS_CHOICES = [
|
|
|
8345
8395
|
}
|
|
8346
8396
|
]
|
|
8347
8397
|
},
|
|
8398
|
+
{
|
|
8399
|
+
category: "agent",
|
|
8400
|
+
key: "thinkingBinding",
|
|
8401
|
+
label: "Preserved thinking (Anthropic only)",
|
|
8402
|
+
description: "when earlier reasoning no longer matches the conversation prefix: drop it server-side and continue, fail the run with the API error (no retry, history untouched — for debugging), or let the account default decide. Applies on the next run",
|
|
8403
|
+
options: [
|
|
8404
|
+
{
|
|
8405
|
+
value: "drop_block",
|
|
8406
|
+
label: "Drop silently"
|
|
8407
|
+
},
|
|
8408
|
+
{
|
|
8409
|
+
value: "error",
|
|
8410
|
+
label: "Fail the run"
|
|
8411
|
+
},
|
|
8412
|
+
{
|
|
8413
|
+
value: "off",
|
|
8414
|
+
label: "Account default"
|
|
8415
|
+
}
|
|
8416
|
+
]
|
|
8417
|
+
},
|
|
8348
8418
|
{
|
|
8349
8419
|
category: "ui",
|
|
8350
8420
|
key: "toolCallDisplay",
|
|
@@ -8467,6 +8537,13 @@ const SETTINGS_CHOICES = [
|
|
|
8467
8537
|
}
|
|
8468
8538
|
];
|
|
8469
8539
|
const SETTINGS_INPUTS = [
|
|
8540
|
+
{
|
|
8541
|
+
category: "agent",
|
|
8542
|
+
key: "sandboxAllowWrite",
|
|
8543
|
+
label: "Sandbox writable paths",
|
|
8544
|
+
description: "extra directories sandboxed shell commands may write to, comma-separated, ~ expanded (the project, temp dirs and a worktree's git dir are always writable). Needs \"Sandbox shell commands\"",
|
|
8545
|
+
placeholder: "~/.cache, ~/.bun/install/cache"
|
|
8546
|
+
},
|
|
8470
8547
|
{
|
|
8471
8548
|
category: "ui",
|
|
8472
8549
|
key: "sessionIcon",
|
|
@@ -8791,7 +8868,7 @@ function buildHints(options) {
|
|
|
8791
8868
|
label: "select"
|
|
8792
8869
|
},
|
|
8793
8870
|
{
|
|
8794
|
-
key:
|
|
8871
|
+
key: formatBindingForDisplay(keybindings.abortRun),
|
|
8795
8872
|
label: "abort run"
|
|
8796
8873
|
}
|
|
8797
8874
|
]);
|
|
@@ -8805,7 +8882,7 @@ function buildHints(options) {
|
|
|
8805
8882
|
label: "select"
|
|
8806
8883
|
},
|
|
8807
8884
|
{
|
|
8808
|
-
key:
|
|
8885
|
+
key: formatBindingForDisplay(keybindings.abortRun),
|
|
8809
8886
|
label: "abort run"
|
|
8810
8887
|
}
|
|
8811
8888
|
]);
|
|
@@ -8830,9 +8907,13 @@ function buildHints(options) {
|
|
|
8830
8907
|
label: inFlightToolCount === 1 ? "cancel" : `cancel (${inFlightToolCount})`
|
|
8831
8908
|
});
|
|
8832
8909
|
baseBusyHints.push({
|
|
8833
|
-
key:
|
|
8910
|
+
key: formatBindingForDisplay(keybindings.abortRun),
|
|
8834
8911
|
label: "abort"
|
|
8835
8912
|
});
|
|
8913
|
+
baseBusyHints.push({
|
|
8914
|
+
key: "esc",
|
|
8915
|
+
label: "sessions"
|
|
8916
|
+
});
|
|
8836
8917
|
return withTodos(baseBusyHints);
|
|
8837
8918
|
}
|
|
8838
8919
|
if (screen === "auth") return [
|
|
@@ -9347,6 +9428,109 @@ function runEndNotice(reason) {
|
|
|
9347
9428
|
}
|
|
9348
9429
|
}
|
|
9349
9430
|
//#endregion
|
|
9431
|
+
//#region src/chat/mcp-credentials.ts
|
|
9432
|
+
const FILE_MODE = 384;
|
|
9433
|
+
function mcpCredentialsPath(dataDir) {
|
|
9434
|
+
return resolve(dataDir, "mcp-credentials.json");
|
|
9435
|
+
}
|
|
9436
|
+
function readAll(dataDir) {
|
|
9437
|
+
const path = mcpCredentialsPath(dataDir);
|
|
9438
|
+
if (!existsSync(path)) return {};
|
|
9439
|
+
try {
|
|
9440
|
+
const raw = readFileSync(path, "utf-8");
|
|
9441
|
+
const parsed = JSON.parse(raw);
|
|
9442
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
9443
|
+
return parsed;
|
|
9444
|
+
} catch {
|
|
9445
|
+
return {};
|
|
9446
|
+
}
|
|
9447
|
+
}
|
|
9448
|
+
function writeAll(dataDir, all) {
|
|
9449
|
+
writeFileAtomic(mcpCredentialsPath(dataDir), `${JSON.stringify(all, null, 2)}\n`, {
|
|
9450
|
+
ensureDir: true,
|
|
9451
|
+
mode: FILE_MODE
|
|
9452
|
+
});
|
|
9453
|
+
}
|
|
9454
|
+
/**
|
|
9455
|
+
* Build a file-backed `McpCredentialStore`. All per-server reads / writes
|
|
9456
|
+
* funnel through the single `mcp-credentials.json` file — this keeps
|
|
9457
|
+
* concurrent flows for different servers from clobbering each other since
|
|
9458
|
+
* each save reads-modifies-writes the full file atomically.
|
|
9459
|
+
*
|
|
9460
|
+
* Two flows for the same server name CAN race (last write wins). MCP OAuth
|
|
9461
|
+
* flows are user-driven and serial in practice (one login modal at a time),
|
|
9462
|
+
* so this is acceptable; a per-server file split + cross-process lock would
|
|
9463
|
+
* be required to handle a multi-process scenario.
|
|
9464
|
+
*/
|
|
9465
|
+
function createFileMcpCredentialStore(dataDir) {
|
|
9466
|
+
return {
|
|
9467
|
+
load(name) {
|
|
9468
|
+
return readAll(dataDir)[name];
|
|
9469
|
+
},
|
|
9470
|
+
save(name, entry) {
|
|
9471
|
+
const all = readAll(dataDir);
|
|
9472
|
+
all[name] = entry;
|
|
9473
|
+
writeAll(dataDir, all);
|
|
9474
|
+
},
|
|
9475
|
+
delete(name) {
|
|
9476
|
+
const all = readAll(dataDir);
|
|
9477
|
+
if (!(name in all)) return;
|
|
9478
|
+
delete all[name];
|
|
9479
|
+
writeAll(dataDir, all);
|
|
9480
|
+
}
|
|
9481
|
+
};
|
|
9482
|
+
}
|
|
9483
|
+
/**
|
|
9484
|
+
* Convenience patches for individual sub-fields. The provider class uses
|
|
9485
|
+
* these so a `saveTokens` call doesn't have to round-trip `clientInformation`
|
|
9486
|
+
* + `discoveryState` it never touched.
|
|
9487
|
+
*/
|
|
9488
|
+
function patchMcpCredential(store, name, patch) {
|
|
9489
|
+
const existing = store.load(name) ?? {};
|
|
9490
|
+
store.save(name, {
|
|
9491
|
+
...existing,
|
|
9492
|
+
...patch
|
|
9493
|
+
});
|
|
9494
|
+
}
|
|
9495
|
+
//#endregion
|
|
9496
|
+
//#region src/chat/sandbox-settings.ts
|
|
9497
|
+
const OFF = {
|
|
9498
|
+
isolation: void 0,
|
|
9499
|
+
warning: void 0
|
|
9500
|
+
};
|
|
9501
|
+
/**
|
|
9502
|
+
* Credential paths hidden from sandboxed commands: the home-relative
|
|
9503
|
+
* defaults plus zidane's provider and MCP credential files at the host's
|
|
9504
|
+
* actual data dir. Exported for tests; hosts go through the resolvers.
|
|
9505
|
+
*/
|
|
9506
|
+
function sandboxUnreadableDirs(dataDir) {
|
|
9507
|
+
const dirs = resolveUnreadableDirs(DEFAULT_UNREADABLE_DIRS);
|
|
9508
|
+
if (dataDir) dirs.push(credentialsPath(dataDir), mcpCredentialsPath(dataDir));
|
|
9509
|
+
return [...new Set(dirs)];
|
|
9510
|
+
}
|
|
9511
|
+
function finish(settings, writableRoots, options) {
|
|
9512
|
+
const isolation = {
|
|
9513
|
+
writableRoots,
|
|
9514
|
+
network: settings.sandboxNetwork ?? "allow",
|
|
9515
|
+
unreadableDirs: sandboxUnreadableDirs(options.dataDir)
|
|
9516
|
+
};
|
|
9517
|
+
const availability = isolationAvailability();
|
|
9518
|
+
return {
|
|
9519
|
+
isolation,
|
|
9520
|
+
warning: availability.ok ? void 0 : `"Sandbox shell commands" is on but cannot be enforced: ${availability.reason}. Shell commands will be refused until you fix this or turn the setting off.`
|
|
9521
|
+
};
|
|
9522
|
+
}
|
|
9523
|
+
/** Sync form — in-process TUI (`buildAgent` is synchronous). */
|
|
9524
|
+
function resolveSandboxFromSettings(settings, cwd, options = {}) {
|
|
9525
|
+
if (!settings.sandbox) return OFF;
|
|
9526
|
+
return finish(settings, resolveWritableRoots(cwd, { extra: parseAllowWriteSetting(settings.sandboxAllowWrite ?? "", cwd) }), options);
|
|
9527
|
+
}
|
|
9528
|
+
/** Async form — daemon host; the git worktree probe must not block the shared loop. */
|
|
9529
|
+
async function resolveSandboxFromSettingsAsync(settings, cwd, options = {}) {
|
|
9530
|
+
if (!settings.sandbox) return OFF;
|
|
9531
|
+
return finish(settings, await resolveWritableRootsAsync(cwd, { extra: parseAllowWriteSetting(settings.sandboxAllowWrite ?? "", cwd) }), options);
|
|
9532
|
+
}
|
|
9533
|
+
//#endregion
|
|
9350
9534
|
//#region src/chat/model-chain-metadata.ts
|
|
9351
9535
|
/**
|
|
9352
9536
|
* Assemble the `metadata.modelChain` value for a model pick — the full
|
|
@@ -9429,6 +9613,27 @@ async function createMainSession(store) {
|
|
|
9429
9613
|
return id;
|
|
9430
9614
|
}
|
|
9431
9615
|
//#endregion
|
|
9616
|
+
//#region src/chat/thinking-binding.ts
|
|
9617
|
+
/**
|
|
9618
|
+
* Publish the user's `thinkingBinding` setting to the Anthropic provider.
|
|
9619
|
+
*
|
|
9620
|
+
* The chat runtimes build `anthropic()` through a no-arg factory, so the
|
|
9621
|
+
* setting travels through the environment: the provider resolves
|
|
9622
|
+
* `param > ZIDANE_THINKING_BINDING (shell) > ZIDANE_THINKING_BINDING_SETTING
|
|
9623
|
+
* (this) > 'drop_block'` on every request. Writing a DISTINCT variable keeps
|
|
9624
|
+
* the shell override authoritative without any launch-time capture — a host
|
|
9625
|
+
* or window created later in the same process cannot read this write back
|
|
9626
|
+
* as a shell value.
|
|
9627
|
+
*
|
|
9628
|
+
* Called by every runtime that starts runs: the chat host's send path
|
|
9629
|
+
* (daemon, GUI) and the in-process TUI on setting change. Process-global by
|
|
9630
|
+
* nature; matches settings being shared across windows today. Inert on
|
|
9631
|
+
* non-Anthropic providers.
|
|
9632
|
+
*/
|
|
9633
|
+
function applyThinkingBindingSetting(value) {
|
|
9634
|
+
process$1.env[THINKING_BINDING_SETTING_ENV] = value ?? "drop_block";
|
|
9635
|
+
}
|
|
9636
|
+
//#endregion
|
|
9432
9637
|
//#region src/chat/builtin-commands.ts
|
|
9433
9638
|
function createBuiltinCommands(opts) {
|
|
9434
9639
|
const commands = [{
|
|
@@ -9783,6 +9988,12 @@ function createCommandModule(deps) {
|
|
|
9783
9988
|
const sessionId = opts.sessionId;
|
|
9784
9989
|
const controller = new AbortController();
|
|
9785
9990
|
run.commandAbort = controller;
|
|
9991
|
+
const dispatchRunId = randomUUID();
|
|
9992
|
+
broadcast({
|
|
9993
|
+
kind: "run:start",
|
|
9994
|
+
sessionId,
|
|
9995
|
+
runId: dispatchRunId
|
|
9996
|
+
});
|
|
9786
9997
|
const requestInteraction = interactions.requestInteractionFor(sessionId);
|
|
9787
9998
|
const requestCommandInteraction = (request) => {
|
|
9788
9999
|
if (controller.signal.aborted) return Promise.reject(/* @__PURE__ */ new Error("command aborted"));
|
|
@@ -10104,7 +10315,7 @@ function createCommandModule(deps) {
|
|
|
10104
10315
|
separateNextEmit = true;
|
|
10105
10316
|
}
|
|
10106
10317
|
};
|
|
10107
|
-
const execute = () => executeCommand(command, ctx);
|
|
10318
|
+
const execute = () => withExtensionSession(session, () => executeCommand(command, ctx));
|
|
10108
10319
|
const executeScoped = env.hostRuntime ? () => env.hostRuntime.runWith(sessionHostRuntime(run, env, { appendNote: (blocks) => blocks.forEach(emitBlock) }), execute) : execute;
|
|
10109
10320
|
try {
|
|
10110
10321
|
if (session.turns.length > 0) emitEvent({
|
|
@@ -10131,7 +10342,7 @@ function createCommandModule(deps) {
|
|
|
10131
10342
|
}
|
|
10132
10343
|
return {
|
|
10133
10344
|
ran: true,
|
|
10134
|
-
runId:
|
|
10345
|
+
runId: dispatchRunId
|
|
10135
10346
|
};
|
|
10136
10347
|
}
|
|
10137
10348
|
return {
|
|
@@ -10672,7 +10883,7 @@ function createOrchestration(deps) {
|
|
|
10672
10883
|
const capped = Math.max(1, Math.min(limit, 50));
|
|
10673
10884
|
return data.turns.filter((t) => t.role === "user" || t.role === "assistant").slice(-capped).map((t) => {
|
|
10674
10885
|
const text = t.content.filter((b) => b.type === "text").map((b) => b.text).join("\n").trim();
|
|
10675
|
-
const tools = t.content.filter((b) => b.type === "tool_call").map((b) => b.name);
|
|
10886
|
+
const tools = t.content.filter((b) => b.type === "tool_call").map((b) => unwrapCallTool(b.name, b.input)?.name ?? b.name);
|
|
10676
10887
|
const body = text || (tools.length ? `[tool calls: ${tools.join(", ")}]` : "[no text]");
|
|
10677
10888
|
return `${t.role}: ${truncate(body, 1200)}`;
|
|
10678
10889
|
}).join("\n\n");
|
|
@@ -11591,6 +11802,7 @@ function createChatHost(env) {
|
|
|
11591
11802
|
persistThreshold: 0,
|
|
11592
11803
|
persistDir
|
|
11593
11804
|
};
|
|
11805
|
+
const sandbox = await resolveSandboxFromSettingsAsync(settings, cwd, { dataDir: env.userDataDir() });
|
|
11594
11806
|
const providerKey = readSessionProvider(data.metadata, providers);
|
|
11595
11807
|
const providerDescriptor = providerDescriptorFor(providers, providerKey);
|
|
11596
11808
|
const modelOverride = readSessionModel(data.metadata, providers);
|
|
@@ -11648,6 +11860,10 @@ function createChatHost(env) {
|
|
|
11648
11860
|
const agentBehavior = {
|
|
11649
11861
|
...composedPreset.behavior,
|
|
11650
11862
|
...persistBehavior,
|
|
11863
|
+
...settings.stableToolList ? { toolSearch: {
|
|
11864
|
+
...composedPreset.behavior?.toolSearch ?? {},
|
|
11865
|
+
mode: "dispatch"
|
|
11866
|
+
} } : {},
|
|
11651
11867
|
tasksDir
|
|
11652
11868
|
};
|
|
11653
11869
|
const agent = createAgent({
|
|
@@ -11657,7 +11873,10 @@ function createChatHost(env) {
|
|
|
11657
11873
|
...system ? { system } : {},
|
|
11658
11874
|
session,
|
|
11659
11875
|
artifacts: artifactsEnabled,
|
|
11660
|
-
execution: createProcessContext({
|
|
11876
|
+
execution: createProcessContext({
|
|
11877
|
+
cwd,
|
|
11878
|
+
...sandbox.isolation ? { isolation: sandbox.isolation } : {}
|
|
11879
|
+
}),
|
|
11661
11880
|
skills: finalSkills,
|
|
11662
11881
|
mcpServers: dedupByName([
|
|
11663
11882
|
...mcpServers,
|
|
@@ -11681,12 +11900,43 @@ function createChatHost(env) {
|
|
|
11681
11900
|
});
|
|
11682
11901
|
});
|
|
11683
11902
|
installCacheBreakLogger(agent.hooks, { log: (line) => hostDebug("cache-break", line) });
|
|
11903
|
+
let pendingCacheNotice = null;
|
|
11684
11904
|
agent.hooks.hook("cache:break", (info) => {
|
|
11685
11905
|
broadcast({
|
|
11686
11906
|
kind: "cache:break",
|
|
11687
11907
|
sessionId,
|
|
11688
11908
|
info
|
|
11689
11909
|
});
|
|
11910
|
+
pendingCacheNotice = info;
|
|
11911
|
+
});
|
|
11912
|
+
agent.hooks.hook("session:turns", () => {
|
|
11913
|
+
const info = pendingCacheNotice;
|
|
11914
|
+
if (!info) return;
|
|
11915
|
+
pendingCacheNotice = null;
|
|
11916
|
+
const session = agent.session;
|
|
11917
|
+
if (!session) return;
|
|
11918
|
+
const chip = cacheBreakChip(info);
|
|
11919
|
+
const text = cacheBreakNoticeText(info);
|
|
11920
|
+
const notice = {
|
|
11921
|
+
severity: chip.tone === "warn" ? "warn" : "info",
|
|
11922
|
+
label: "cache"
|
|
11923
|
+
};
|
|
11924
|
+
const turnId = randomUUID();
|
|
11925
|
+
session.appendTurns([{
|
|
11926
|
+
id: turnId,
|
|
11927
|
+
role: "command",
|
|
11928
|
+
createdAt: Date.now(),
|
|
11929
|
+
content: noticeTurnContent(notice, text)
|
|
11930
|
+
}]).then(() => broadcast({
|
|
11931
|
+
kind: "event",
|
|
11932
|
+
sessionId,
|
|
11933
|
+
event: {
|
|
11934
|
+
kind: "info",
|
|
11935
|
+
text,
|
|
11936
|
+
notice,
|
|
11937
|
+
turnId
|
|
11938
|
+
}
|
|
11939
|
+
})).catch((err) => hostDebug("cache-break", `notice persist failed: ${String(err)}`));
|
|
11690
11940
|
});
|
|
11691
11941
|
broadcast({
|
|
11692
11942
|
kind: "system-md",
|
|
@@ -11694,6 +11944,18 @@ function createChatHost(env) {
|
|
|
11694
11944
|
file: builtInSystem?.systemFile ?? null,
|
|
11695
11945
|
shadowed: builtInSystem?.shadowedSystemFiles ?? []
|
|
11696
11946
|
});
|
|
11947
|
+
if (sandbox.warning) broadcast({
|
|
11948
|
+
kind: "event",
|
|
11949
|
+
sessionId,
|
|
11950
|
+
event: {
|
|
11951
|
+
kind: "info",
|
|
11952
|
+
text: sandbox.warning,
|
|
11953
|
+
notice: {
|
|
11954
|
+
severity: "warn",
|
|
11955
|
+
label: "sandbox"
|
|
11956
|
+
}
|
|
11957
|
+
}
|
|
11958
|
+
});
|
|
11697
11959
|
const spawnCandidate = (composedPreset.tools ?? {}).spawn;
|
|
11698
11960
|
const commandSeam = spawnCandidate && isSpawnTool(spawnCandidate) ? {
|
|
11699
11961
|
spawnTool: spawnCandidate,
|
|
@@ -12625,6 +12887,7 @@ function createChatHost(env) {
|
|
|
12625
12887
|
async function preparePrompt(opts, internal, trackSettlement) {
|
|
12626
12888
|
const generation = teardownGeneration;
|
|
12627
12889
|
const settings = env.readSettings();
|
|
12890
|
+
applyThinkingBindingSetting(settings.thinkingBinding);
|
|
12628
12891
|
const run = await ensureAgent(opts.sessionId);
|
|
12629
12892
|
assertDispatchOpen(generation);
|
|
12630
12893
|
if (run.agent.isRunning) throw new Error(`Session "${opts.sessionId}" already has a run in flight. Use steer/followUp (or pushQueued) to feed the active run.`);
|
|
@@ -12707,14 +12970,14 @@ function createChatHost(env) {
|
|
|
12707
12970
|
encoding: "base64",
|
|
12708
12971
|
...a.name ? { name: a.name } : {}
|
|
12709
12972
|
})] : opts.prompt;
|
|
12710
|
-
const autoCompactDescriptor = BUILTIN_PROVIDERS[run.providerKey] ?? BUILTIN_PROVIDERS.anthropic;
|
|
12711
12973
|
const sendRuntime = await env.runtimeConfig(run.cwd);
|
|
12974
|
+
const autoCompactDescriptor = sendRuntime.providers[run.providerKey] ?? BUILTIN_PROVIDERS[run.providerKey] ?? BUILTIN_PROVIDERS.anthropic;
|
|
12712
12975
|
assertDispatchOpen(generation);
|
|
12713
12976
|
const summarizer = resolveCompactionSummarizer(settings.compactionModel, (key) => buildProvider(sendRuntime.providers, key), {
|
|
12714
12977
|
providerKey: run.providerKey,
|
|
12715
12978
|
model: modelOverride ?? run.model
|
|
12716
12979
|
});
|
|
12717
|
-
const
|
|
12980
|
+
const windowRun = chatWindowBehavior({
|
|
12718
12981
|
enabled: settings.autoCompact,
|
|
12719
12982
|
threshold: settings.autoCompactThreshold,
|
|
12720
12983
|
rawContextWindow: getContextWindow(autoCompactDescriptor, modelOverride ?? run.model),
|
|
@@ -12733,7 +12996,7 @@ function createChatHost(env) {
|
|
|
12733
12996
|
system: systemNudge && run.system ? `${run.system}\n\n${systemNudge}` : systemNudge,
|
|
12734
12997
|
signal: run.controller.signal,
|
|
12735
12998
|
behavior: {
|
|
12736
|
-
|
|
12999
|
+
...windowRun,
|
|
12737
13000
|
...caps
|
|
12738
13001
|
},
|
|
12739
13002
|
...run.rules && !systemNudge ? { contextSections: run.rules } : {},
|
|
@@ -13172,7 +13435,8 @@ function createChatHost(env) {
|
|
|
13172
13435
|
for (const [key, value] of Object.entries(patch)) if (value === void 0) delete data.metadata[key];
|
|
13173
13436
|
else data.metadata[key] = value;
|
|
13174
13437
|
if (opts.bumpUpdatedAt !== false) data.updatedAt = Date.now();
|
|
13175
|
-
await env.store.
|
|
13438
|
+
if (env.store.saveMeta) await env.store.saveMeta(data);
|
|
13439
|
+
else await env.store.save(data);
|
|
13176
13440
|
},
|
|
13177
13441
|
async setSessionModel(sessionId, pick) {
|
|
13178
13442
|
await host.patchSessionMeta(sessionId, {
|
|
@@ -13436,10 +13700,13 @@ function serializeInteractionResponse(response) {
|
|
|
13436
13700
|
const picked = value.map((v) => String(v).trim()).filter((v) => v.length > 0);
|
|
13437
13701
|
if (picked.length > 0) answers[id] = picked;
|
|
13438
13702
|
}
|
|
13439
|
-
|
|
13703
|
+
const body = {
|
|
13440
13704
|
...automatic,
|
|
13441
13705
|
answers
|
|
13442
|
-
}
|
|
13706
|
+
};
|
|
13707
|
+
const instructions = response.instructions?.trim();
|
|
13708
|
+
if (instructions) body.instructions = instructions;
|
|
13709
|
+
return JSON.stringify(body);
|
|
13443
13710
|
}
|
|
13444
13711
|
/**
|
|
13445
13712
|
* Build a protocol-valid user `SessionTurn` that closes a batch of
|
|
@@ -13665,7 +13932,7 @@ function createInteractionTools(opts) {
|
|
|
13665
13932
|
};
|
|
13666
13933
|
}
|
|
13667
13934
|
const PLAN_DESCRIPTION = "Present a multi-step plan to the user for approval BEFORE executing it. Use this when you have a concrete proposal that materially changes the workspace and want explicit confirmation. The user can approve, reject, or request revisions; revisions come back as a comment alongside a `revise` decision.";
|
|
13668
|
-
const QUESTION_DESCRIPTION = "Ask the user one or more clarifying questions and pause until they answer. Batch related questions into a single call instead of asking one at a time — every call pauses the conversation. Each question carries a `type`: `text` (single line), `textarea` (multi-line), `select` (one of `choices`), or `confirm` (yes/no). Use sparingly: only when explicit user input materially changes the next steps.";
|
|
13935
|
+
const QUESTION_DESCRIPTION = "Ask the user one or more clarifying questions and pause until they answer. Batch related questions into a single call instead of asking one at a time — every call pauses the conversation. Each question carries a `type`: `text` (single line), `textarea` (multi-line), `select` (one of `choices`), or `confirm` (yes/no). Use sparingly: only when explicit user input materially changes the next steps. The response may carry `instructions`: free text the user added alongside their answers. It refines or overrides the questions and is authoritative.";
|
|
13669
13936
|
function createPlanTool({ requestInteraction, shouldSkipInteractions }) {
|
|
13670
13937
|
return {
|
|
13671
13938
|
spec: {
|
|
@@ -13989,71 +14256,6 @@ function useMcpAuthDispatch() {
|
|
|
13989
14256
|
return dispatch;
|
|
13990
14257
|
}
|
|
13991
14258
|
//#endregion
|
|
13992
|
-
//#region src/chat/mcp-credentials.ts
|
|
13993
|
-
const FILE_MODE = 384;
|
|
13994
|
-
function mcpCredentialsPath(dataDir) {
|
|
13995
|
-
return resolve(dataDir, "mcp-credentials.json");
|
|
13996
|
-
}
|
|
13997
|
-
function readAll(dataDir) {
|
|
13998
|
-
const path = mcpCredentialsPath(dataDir);
|
|
13999
|
-
if (!existsSync(path)) return {};
|
|
14000
|
-
try {
|
|
14001
|
-
const raw = readFileSync(path, "utf-8");
|
|
14002
|
-
const parsed = JSON.parse(raw);
|
|
14003
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
14004
|
-
return parsed;
|
|
14005
|
-
} catch {
|
|
14006
|
-
return {};
|
|
14007
|
-
}
|
|
14008
|
-
}
|
|
14009
|
-
function writeAll(dataDir, all) {
|
|
14010
|
-
writeFileAtomic(mcpCredentialsPath(dataDir), `${JSON.stringify(all, null, 2)}\n`, {
|
|
14011
|
-
ensureDir: true,
|
|
14012
|
-
mode: FILE_MODE
|
|
14013
|
-
});
|
|
14014
|
-
}
|
|
14015
|
-
/**
|
|
14016
|
-
* Build a file-backed `McpCredentialStore`. All per-server reads / writes
|
|
14017
|
-
* funnel through the single `mcp-credentials.json` file — this keeps
|
|
14018
|
-
* concurrent flows for different servers from clobbering each other since
|
|
14019
|
-
* each save reads-modifies-writes the full file atomically.
|
|
14020
|
-
*
|
|
14021
|
-
* Two flows for the same server name CAN race (last write wins). MCP OAuth
|
|
14022
|
-
* flows are user-driven and serial in practice (one login modal at a time),
|
|
14023
|
-
* so this is acceptable; a per-server file split + cross-process lock would
|
|
14024
|
-
* be required to handle a multi-process scenario.
|
|
14025
|
-
*/
|
|
14026
|
-
function createFileMcpCredentialStore(dataDir) {
|
|
14027
|
-
return {
|
|
14028
|
-
load(name) {
|
|
14029
|
-
return readAll(dataDir)[name];
|
|
14030
|
-
},
|
|
14031
|
-
save(name, entry) {
|
|
14032
|
-
const all = readAll(dataDir);
|
|
14033
|
-
all[name] = entry;
|
|
14034
|
-
writeAll(dataDir, all);
|
|
14035
|
-
},
|
|
14036
|
-
delete(name) {
|
|
14037
|
-
const all = readAll(dataDir);
|
|
14038
|
-
if (!(name in all)) return;
|
|
14039
|
-
delete all[name];
|
|
14040
|
-
writeAll(dataDir, all);
|
|
14041
|
-
}
|
|
14042
|
-
};
|
|
14043
|
-
}
|
|
14044
|
-
/**
|
|
14045
|
-
* Convenience patches for individual sub-fields. The provider class uses
|
|
14046
|
-
* these so a `saveTokens` call doesn't have to round-trip `clientInformation`
|
|
14047
|
-
* + `discoveryState` it never touched.
|
|
14048
|
-
*/
|
|
14049
|
-
function patchMcpCredential(store, name, patch) {
|
|
14050
|
-
const existing = store.load(name) ?? {};
|
|
14051
|
-
store.save(name, {
|
|
14052
|
-
...existing,
|
|
14053
|
-
...patch
|
|
14054
|
-
});
|
|
14055
|
-
}
|
|
14056
|
-
//#endregion
|
|
14057
14259
|
//#region src/chat/mcp-rows.ts
|
|
14058
14260
|
/**
|
|
14059
14261
|
* Flatten a server catalog plus the per-server expanded set into the
|
|
@@ -17015,6 +17217,6 @@ function createApprovalHub(options) {
|
|
|
17015
17217
|
};
|
|
17016
17218
|
}
|
|
17017
17219
|
//#endregion
|
|
17018
|
-
export { supportsOAuth as $,
|
|
17220
|
+
export { supportsOAuth as $, defaultMcpsConfigPaths as $n, getTodosForRun as $r, parsePluginScanPathEnv as $t, useSafeModeQueue as A, listSessionMeta as Ai, CATPPUCCIN_MOCHA as An, chatWindowBehavior as Ar, useInteractionsActions as At, USAGE_CACHE_TTL_MS as B, toolResultText as Bi, resolveStoragePaths as Bn, PLAN_AGENT as Br, serializePreview as Bt, resolveSessionExportTarget as C, DEFAULT_SESSION_TITLE as Ci, resolveTheme as Cn, detectLibc as Cr, createAutomaticInteractionResponse as Ct, scopeCwd as D, eventsFromTurns as Di, CATPPUCCIN_FRAPPE as Dn, performSelfUpdate as Dr, makeRequestInteraction as Dt, resolveSessionCwd as E, deriveSessionTitle as Ei, GRUVBOX_LIGHT as En, performInPlaceSelfUpdate as Er, isModelInteraction as Et, matchesSafelistEntry as F, serverToolResultSummary as Fi, useDiscovery as Fn, BUILD_AGENT as Fr, installProviderDiagnosticHook as Ft, usageChecksOptedOut as G, countClaudeSessionFiles as Gn, TODOREAD_TOOL as Gr, sessionModelFallbacks as Gt, fetchAllProviderUsage as H, usageByModel as Hi, createArtifactsCompletionProvider as Hn, resolveAgentId as Hr, applyThinkingBindingSetting as Ht, projectsFilePath as I, stripSpawnTokensLine as Ii, useDiscoveryOptional as In, BUILTIN_AGENTS as Ir, createInteractionHub as It, fetchOAuthRedirect as J, mcpsWritePath as Jn, TODO_STATUS_GLYPHS as Jr, mcpCredentialsPath as Jt, usageSourceFor as K, hasClaudeCodeSetup as Kn, TODOS_METADATA_KEY as Kr, resolveSandboxFromSettings as Kt, readProjects as L, sumRunCosts as Li, ConfigProvider as Ln, DEFAULT_AGENT_ID as Lr, extractEditPayloadForGate as Lt, addToSafelist as M, marginTopFor as Mi, quoteForShell as Mn, summarizeArtifactCounts as Mr, STALE_RUN_MARKER_MS as Mt, getSafelist as N, noticeTurnContent as Ni, createDiscoverySlot as Nn, discoverAgentsMd as Nr, createChatHost as Nt, SafeModeProvider as O, getSessionMeta as Oi, CATPPUCCIN_LATTE as On, resolvePlatformPackage as Or, pendingInteractionsFromTurns as Ot, isOnSafelist as P, saveState as Pi, DiscoveryProvider as Pn, renderAgentsMdBlock as Pr, toTodosSnapshot as Pt, runOAuthLogin as Q, dedupMcpServersByName as Qn, getArchivedTodosForRun as Qr, discoverProjectPlugins as Qt, suggestSafelistEntries as R, titleFromTurns as Ri, useConfig as Rn, DEFAULT_BUDGET_EXCLUDE_TOOLS as Rr, readFileSafe as Rt, renderSession as S, createChatTurnsReadTool as Si, resolveChipColor as Sn, compareSemver as Sr, buildResumedToolResultsTurn as St, folderlessCwd as T, createStateStore as Ti, GRUVBOX_DARK as Tn, parseSemver as Tr, isInteractionTool as Tt, fetchProviderUsage as U, scoreArtifacts as Un, singleAgentRegistry as Ur, createMainSession as Ut, clearProviderUsageCache as V, updateToolEventOutcomes as Vi, ARTIFACTS_COMPLETION_PROVIDER_ID as Vn, accentColor as Vr, createBuiltinCommands as Vt, providerUsageSupported as W, useCompletion as Wn, DEFAULT_MAX_TODO_ITEMS as Wr, modelChainMetadata as Wt, redirectUriFromAuthUrl as X, upsertMcpServer as Xn, applyTodosSnapshot as Xr, runEndNotice as Xt, normalizeRedirectPaste as Y, removeMcpServer as Yn, TODO_WRITE_COUNTS_METADATA_KEY as Yr, patchMcpCredential as Yt, oauthUsesManualCodePaste as Z, buildMcpServers as Zn, createTodoTools as Zr, buildPluginContributions as Zt, buildSpawnEndEvent as _, TOKEN_DISCIPLINE_DOCTRINE as _i, clampFps as _n, watchInstalledVersion as _r, ASK_USER_TOOL as _t, renderActiveTodoAnchor as a, setTodosForRun as ai, hintsLength as an, bootTick as ar, subscribeMcpToolsCache as at, defaultSkillScanPaths as b, envSection as bi, BUILTIN_THEMES as bn, checkForUpdate as br, InteractionsProvider as bt, useSelectStyle as c, ACTIONS_WITH_CARE_DOCTRINE as ci, shortChord as cn, buildUpdateHint as cr, useMcpToolToggleSet as ct, useTheme as d, IDENTITY_PREFIX as di, DEFAULT_SETTINGS as dn, UPDATE_APPLIED_MARKER as dr, parentServerName as dt, isTodoTool as ei, attachMcpWarnLog as en, discoverProjectMcps as er, clearMcpToolsCache as et, discoverSystemMd as f, INTERACTION_GUIDANCE as fi, SETTINGS_CATEGORIES as fn, hasUpdateAppliedMarker as fr, McpAuthProvider as ft, useStreamBuffer as g, SUBAGENT_GUIDANCE as gi, SettingsProvider as gn, useRestartRequired as gr, reduceMcpAuth as gt, userSystemMdPath as h, PLAN_MODE_DOCTRINE_NO_PROMPTS as hi, SETTINGS_TOGGLES as hn, updateAppliedMarkerPath as hr, getMcpAuthStatus as ht, createActiveTodoAnchorHooks as i, selectActiveTodos as ii, clipHintsToWidth as in, bootProfileEnabled as ir, saveMcpToolsCache as it, IMPLICITLY_SAFE_TOOLS as j, loadState as ji, parseEditorCommand as jn, groupArtifacts as jr, useInteractionsQueue as jt, useSafeModeActions as k, lastContextSizeFromTurns as ki, CATPPUCCIN_MACCHIATO as kn, chatAutoCompactBehavior as kr, serializeInteractionResponse as kt, useSurfaces as l, COMMUNICATION_DOCTRINE as li, listProjectFiles as ln, useUpdateCheck as lr, buildVisibleMcpRows as lt, userScopeOverridesLoad as m, PLAN_MODE_DOCTRINE as mi, SETTINGS_INPUTS as mn, readUpdateAppliedMarker as mr, useMcpAuthState as mt, createMemoryApprovalsStore as n, pruneTodosByRun as ni, runCompaction as nn, tryOpenBrowser as nr, mcpToolsCachePath as nt, ThemeProvider as o, todoProgressLabel as oi, truncateTrailing as on, upgradeInstalledPackages as or, buildToolToggle as ot, renderSystemMdSeed as p, INTERACTION_GUIDANCE_NO_PROMPTS as pi, SETTINGS_CHOICES as pn, probeInstalledVersion as pr, useMcpAuthDispatch as pt, formatPathForCwd as q, importFromClaudeCode as qn, TODOWRITE_TOOL as qr, createFileMcpCredentialStore as qt, computeTurnAnchors as r, sanitizeTodoItems as ri, EMPTY_HINTS as rn, tryRevealPath as rr, refreshMcpToolsCatalog as rt, useColors as s, useActiveTodos as si, buildHints as sn, buildRestartHint as sr, useMcpToolToggleMap as st, createApprovalHub as t, pickActiveRunId as ti, EditOutcomeLedger as tn, parseMcpsFile as tr, loadMcpToolsCache as tt, useSyntaxStyles as u, DOING_TASKS_DOCTRINE as ui, useEnabledToggleSet as un, runUpdateCommand as ur, indexOfServerRow as ut, buildSpawnStartEvent as v, buildBuildSystem as vi, enforceSettingsInvariants as vn, writeUpdateAppliedMarker as vr, AUTOMATIC_INTERACTION_INSTRUCTION as vt, writeSessionExport as w, compactSummaryEvent as wi, VAPORWAVE_THEME as wn, detectPackageManager as wr, createInteractionTools as wt, discoverProjectSkills as x, chatReferenceTokensForPrompt as xi, DEFAULT_THEME as xn, checkTarballAvailable as xr, PRESENT_PLAN_TOOL as xt, buildSkillsConfig as y, buildPlanSystem as yi, useSettings as yn, findInstalledCompanion as yr, HOST_INTERACTION_ID_PREFIX as yt, writeProjects as z, toolCallPreview as zi, resolveConfig as zn, DEFAULT_PERSIST_EXCLUDE_TOOLS as zr, resolveCwdPath as zt };
|
|
17019
17221
|
|
|
17020
|
-
//# sourceMappingURL=approvals-
|
|
17222
|
+
//# sourceMappingURL=approvals-u2T19Dc-.js.map
|