zidane 6.2.7 → 6.2.11
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/dist/{acp-B_8CI9-1.js → acp-DuEMbOoQ.js} +4 -4
- package/dist/{acp-B_8CI9-1.js.map → acp-DuEMbOoQ.js.map} +1 -1
- package/dist/acp-cli.js +7 -7
- package/dist/acp.d.ts +1 -1
- package/dist/acp.js +1 -1
- package/dist/{agent-DPO6GKX5.js → agent-6iGNP46b.js} +5 -5
- package/dist/{agent-DPO6GKX5.js.map → agent-6iGNP46b.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{anthropic-J2tBjcSQ.js → anthropic-BD-lwEKp.js} +3 -3
- package/dist/{anthropic-J2tBjcSQ.js.map → anthropic-BD-lwEKp.js.map} +1 -1
- package/dist/{auth-Cexpxjfa.js → auth-BH6G59RL.js} +8 -8
- package/dist/auth-BH6G59RL.js.map +1 -0
- package/dist/chat/pure.d.ts +3 -3
- package/dist/chat.d.ts +14 -5
- package/dist/chat.d.ts.map +1 -1
- package/dist/chat.js +3 -3
- package/dist/contexts/daytona.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +1 -1
- 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-CNyYEOy0.d.ts → index-BFNt9GAs.d.ts} +59 -7
- package/dist/index-BFNt9GAs.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/{login-Bp_tRj_e.js → login-B5nMPF8w.js} +3 -3
- package/dist/{login-Bp_tRj_e.js.map → login-B5nMPF8w.js.map} +1 -1
- package/dist/{mcp-CkHUripi.js → mcp-BCaN_Gyg.js} +140 -29
- package/dist/mcp-BCaN_Gyg.js.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{messages-DEPX32kc.js → messages-BDpXLFoe.js} +2 -2
- package/dist/{messages-DEPX32kc.js.map → messages-BDpXLFoe.js.map} +1 -1
- package/dist/{openai-compat-LGAsBush.js → openai-compat-J_JZ7qsw.js} +1 -19
- package/dist/openai-compat-J_JZ7qsw.js.map +1 -0
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/arcee.js +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/baseten.js +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/cerebras.js +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/local.js +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai-compat.js +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openai.js +548 -1
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/xai.js +1 -1
- package/dist/{providers-BM6VuE_i.js → providers-CclOzGxc.js} +3 -3
- package/dist/{providers-BM6VuE_i.js.map → providers-CclOzGxc.js.map} +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +5 -5
- package/dist/restate.d.ts +1 -1
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/{session-Dc1v4Otm.js → session-CIXE-Bzp.js} +2 -2
- package/dist/{session-Dc1v4Otm.js.map → session-CIXE-Bzp.js.map} +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/session.js +2 -2
- package/dist/{skills-BlmY7QhV.js → skills-CDpejYOf.js} +168 -44
- package/dist/skills-CDpejYOf.js.map +1 -0
- package/dist/skills.d.ts +2 -2
- package/dist/skills.js +1 -1
- package/dist/{tool-formatters-B7oWiy5m.d.ts → tool-formatters-B_zQsYfa.d.ts} +2 -2
- package/dist/{tool-formatters-B7oWiy5m.d.ts.map → tool-formatters-B_zQsYfa.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-BUZ915pM.d.ts → transcript-anchors-2wafjV-s.d.ts} +9 -2
- package/dist/{transcript-anchors-BUZ915pM.d.ts.map → transcript-anchors-2wafjV-s.d.ts.map} +1 -1
- package/dist/{transcript-anchors-DtOaKu4d.js → transcript-anchors-B_kUHJ16.js} +225 -10
- package/dist/transcript-anchors-B_kUHJ16.js.map +1 -0
- package/dist/tui.d.ts +12 -7
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +356 -70
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-2Ou_DkbC.d.ts → turn-operations-DVA52KMG.d.ts} +3 -3
- package/dist/{turn-operations-2Ou_DkbC.d.ts.map → turn-operations-DVA52KMG.d.ts.map} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{xai-BYAyEPiJ.js → xai-D-wALLuZ.js} +2 -2
- package/dist/{xai-BYAyEPiJ.js.map → xai-D-wALLuZ.js.map} +1 -1
- package/package.json +2 -2
- package/dist/auth-Cexpxjfa.js.map +0 -1
- package/dist/index-CNyYEOy0.d.ts.map +0 -1
- package/dist/mcp-CkHUripi.js.map +0 -1
- package/dist/openai-BcmYm0t4.js +0 -579
- package/dist/openai-BcmYm0t4.js.map +0 -1
- package/dist/openai-compat-LGAsBush.js.map +0 -1
- package/dist/skills-BlmY7QhV.js.map +0 -1
- package/dist/transcript-anchors-DtOaKu4d.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { l as toolResultToText } from "./types-BIarq1qE.js";
|
|
2
|
-
import { Ct as readFile$1, Ft as resolveStorageDirs, Gt as mergeKeybindings, Jt as readKeybindingsRaw, Mt as glob, Nt as edit, R as EMPTY_EXTENSION_REGISTRY, Tt as multiEdit, Yt as resolveExtensionKeybindings, Z as buildExtensionPreset, ft as waitTask, jt as grep, kt as listFiles, mt as createSpawnTool, ot as composePresets, st as definePreset, ut as writeFile$1, xt as shell, yt as shellKill } from "./agent-
|
|
3
|
-
import { c as previewLine, i as fmtTokens, l as shortId } from "./format-BF745pLL.js";
|
|
2
|
+
import { Ct as readFile$1, Ft as resolveStorageDirs, Gt as mergeKeybindings, Jt as readKeybindingsRaw, Mt as glob, Nt as edit, R as EMPTY_EXTENSION_REGISTRY, Tt as multiEdit, Yt as resolveExtensionKeybindings, Z as buildExtensionPreset, ft as waitTask, jt as grep, kt as listFiles, mt as createSpawnTool, ot as composePresets, st as definePreset, ut as writeFile$1, xt as shell, yt as shellKill } from "./agent-6iGNP46b.js";
|
|
3
|
+
import { a as formatDuration, c as previewLine, i as fmtTokens, l as shortId } from "./format-BF745pLL.js";
|
|
4
4
|
import { l as errorMessage } from "./errors-DJUxZg9b.js";
|
|
5
5
|
import { M as findGitRoot$1, i as discoverSkills, j as projectUserPaths } from "./resolve-HtxmBWs9.js";
|
|
6
6
|
import { t as writeFileAtomic } from "./atomic-write-B7zr1ddF.js";
|
|
7
7
|
import { r as formatTokenUsage } from "./stats-DAKBEKjc.js";
|
|
8
8
|
import { joinSystemPrompt } from "./prompt.js";
|
|
9
|
-
import { a as normalizeMcpServers, n as connectMcpServers } from "./mcp-
|
|
9
|
+
import { a as normalizeMcpServers, n as connectMcpServers } from "./mcp-BCaN_Gyg.js";
|
|
10
10
|
import { i as findActiveTriggers, n as collectReferences, o as mergeSuggestions, t as applyInsert } from "./completion-core-BRo86R_L.js";
|
|
11
11
|
import { r as fetchUrl } from "./fetch-url-_5WKWpbQ.js";
|
|
12
12
|
import { webSearch } from "./tools/web-search.js";
|
|
13
|
-
import { C as restoreModelOptions, l as BUILTIN_PROVIDERS, n as applyApiKeyEnv, r as credentialsPath, t as detectAuth, v as modelSupportsReasoning, y as modelsForDescriptor } from "./auth-
|
|
13
|
+
import { C as restoreModelOptions, l as BUILTIN_PROVIDERS, n as applyApiKeyEnv, r as credentialsPath, t as detectAuth, v as modelSupportsReasoning, y as modelsForDescriptor } from "./auth-BH6G59RL.js";
|
|
14
14
|
import { ct as chatReferenceTokensFromText, nt as parseEditOutcomesFromResult, p as ownerOf, q as extractEditPayload, u as capTranscriptEvents } from "./turn-operations-CXjRaltC.js";
|
|
15
15
|
import { createRequire } from "node:module";
|
|
16
16
|
import { dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
@@ -246,6 +246,26 @@ function eventsFromTurns(turns, runs = []) {
|
|
|
246
246
|
}
|
|
247
247
|
return chain;
|
|
248
248
|
};
|
|
249
|
+
const childRunsOf = /* @__PURE__ */ new Map();
|
|
250
|
+
for (const run of runById.values()) {
|
|
251
|
+
if (!run.parentRunId) continue;
|
|
252
|
+
const siblings = childRunsOf.get(run.parentRunId) ?? [];
|
|
253
|
+
siblings.push(run);
|
|
254
|
+
childRunsOf.set(run.parentRunId, siblings);
|
|
255
|
+
}
|
|
256
|
+
const subtreeCost = (root) => {
|
|
257
|
+
let total = 0;
|
|
258
|
+
const queue = [root];
|
|
259
|
+
const seen = /* @__PURE__ */ new Set();
|
|
260
|
+
while (queue.length > 0) {
|
|
261
|
+
const run = queue.pop();
|
|
262
|
+
if (seen.has(run.id)) continue;
|
|
263
|
+
seen.add(run.id);
|
|
264
|
+
total += run.cost ?? run.turnUsage?.reduce((sum, u) => sum + (u.cost ?? 0), 0) ?? 0;
|
|
265
|
+
queue.push(...childRunsOf.get(run.id) ?? []);
|
|
266
|
+
}
|
|
267
|
+
return total;
|
|
268
|
+
};
|
|
249
269
|
const events = [];
|
|
250
270
|
/** Currently-open child runs, root-of-tree first, innermost last. */
|
|
251
271
|
const openStack = [];
|
|
@@ -259,9 +279,12 @@ function eventsFromTurns(turns, runs = []) {
|
|
|
259
279
|
totalCacheRead: run.totalUsage?.cacheRead ?? 0,
|
|
260
280
|
totalCacheCreation: run.totalUsage?.cacheCreation ?? 0
|
|
261
281
|
});
|
|
282
|
+
const elapsed = run.endedAt !== void 0 ? ` · ${formatDuration(run.endedAt - run.startedAt)}` : "";
|
|
283
|
+
const cost = subtreeCost(run);
|
|
284
|
+
const segments = `${elapsed}${cost > 0 ? ` · $${cost.toFixed(cost < .01 ? 4 : 2)}` : ""}`;
|
|
262
285
|
events.push({
|
|
263
286
|
kind: "spawn-end",
|
|
264
|
-
text: `${tag} ${usage}`,
|
|
287
|
+
text: segments ? `${tag}${segments} · ${usage}` : `${tag} ${usage}`,
|
|
265
288
|
childId: labelFor(run.id),
|
|
266
289
|
depth: run.depth ?? 1
|
|
267
290
|
});
|
|
@@ -5036,6 +5059,7 @@ const DEFAULT_SETTINGS = {
|
|
|
5036
5059
|
showFullShellOutput: false,
|
|
5037
5060
|
safeMode: true,
|
|
5038
5061
|
loadProjectExtensions: false,
|
|
5062
|
+
importForeignConfigs: false,
|
|
5039
5063
|
hideSubagentOutput: true,
|
|
5040
5064
|
subagentModels: true,
|
|
5041
5065
|
theme: DEFAULT_THEME.id,
|
|
@@ -5175,6 +5199,12 @@ const SETTINGS_TOGGLES = [
|
|
|
5175
5199
|
label: "Load project extensions",
|
|
5176
5200
|
description: "run extensions under <project>/.zidane/extensions — off by default (they execute arbitrary local code)"
|
|
5177
5201
|
},
|
|
5202
|
+
{
|
|
5203
|
+
category: "agent",
|
|
5204
|
+
key: "importForeignConfigs",
|
|
5205
|
+
label: "Import configurations from other agents",
|
|
5206
|
+
description: "discover MCP servers + skills from Claude Code, Codex, and Pi configs (project + user) — imported stdio servers execute commands from files zidane does not own"
|
|
5207
|
+
},
|
|
5178
5208
|
{
|
|
5179
5209
|
category: "agent",
|
|
5180
5210
|
key: "attachmentsEnabled",
|
|
@@ -7082,6 +7112,174 @@ function isCachedEntry(value) {
|
|
|
7082
7112
|
return true;
|
|
7083
7113
|
}
|
|
7084
7114
|
//#endregion
|
|
7115
|
+
//#region src/chat/foreign-configs.ts
|
|
7116
|
+
function roots(opts) {
|
|
7117
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
7118
|
+
return {
|
|
7119
|
+
projectRoot: findGitRoot$1(cwd) ?? cwd,
|
|
7120
|
+
home: opts.home ?? homedir()
|
|
7121
|
+
};
|
|
7122
|
+
}
|
|
7123
|
+
/**
|
|
7124
|
+
* MCP config files other agents maintain, project entries first.
|
|
7125
|
+
* Returned regardless of existence — callers `existsSync`-filter, same
|
|
7126
|
+
* contract as `defaultMcpsConfigPaths`.
|
|
7127
|
+
*/
|
|
7128
|
+
function foreignMcpConfigFiles(opts = {}) {
|
|
7129
|
+
const { projectRoot, home } = roots(opts);
|
|
7130
|
+
return [
|
|
7131
|
+
{
|
|
7132
|
+
path: resolve(projectRoot, ".mcp.json"),
|
|
7133
|
+
source: "project",
|
|
7134
|
+
format: "json"
|
|
7135
|
+
},
|
|
7136
|
+
{
|
|
7137
|
+
path: resolve(home, ".claude.json"),
|
|
7138
|
+
source: "project",
|
|
7139
|
+
format: "claude-project-state"
|
|
7140
|
+
},
|
|
7141
|
+
{
|
|
7142
|
+
path: resolve(projectRoot, ".pi/mcps.json"),
|
|
7143
|
+
source: "project",
|
|
7144
|
+
format: "json"
|
|
7145
|
+
},
|
|
7146
|
+
{
|
|
7147
|
+
path: resolve(projectRoot, ".pi/mcp.json"),
|
|
7148
|
+
source: "project",
|
|
7149
|
+
format: "json"
|
|
7150
|
+
},
|
|
7151
|
+
{
|
|
7152
|
+
path: resolve(home, ".claude.json"),
|
|
7153
|
+
source: "user",
|
|
7154
|
+
format: "claude-user-state"
|
|
7155
|
+
},
|
|
7156
|
+
{
|
|
7157
|
+
path: resolve(home, ".codex/config.toml"),
|
|
7158
|
+
source: "user",
|
|
7159
|
+
format: "codex-toml"
|
|
7160
|
+
},
|
|
7161
|
+
{
|
|
7162
|
+
path: resolve(home, ".pi/agent/mcps.json"),
|
|
7163
|
+
source: "user",
|
|
7164
|
+
format: "json"
|
|
7165
|
+
},
|
|
7166
|
+
{
|
|
7167
|
+
path: resolve(home, ".pi/agent/mcp.json"),
|
|
7168
|
+
source: "user",
|
|
7169
|
+
format: "json"
|
|
7170
|
+
}
|
|
7171
|
+
];
|
|
7172
|
+
}
|
|
7173
|
+
/**
|
|
7174
|
+
* Skill directories other agents maintain, project entries first. Feed
|
|
7175
|
+
* directly into `discoverSkills` — the SKILL.md format is shared across
|
|
7176
|
+
* the ecosystem, so foreign skills parse with the same lenient loader.
|
|
7177
|
+
*/
|
|
7178
|
+
function foreignSkillScanPaths(opts = {}) {
|
|
7179
|
+
const { projectRoot, home } = roots(opts);
|
|
7180
|
+
return [
|
|
7181
|
+
{
|
|
7182
|
+
path: resolve(projectRoot, ".claude/skills"),
|
|
7183
|
+
source: "project"
|
|
7184
|
+
},
|
|
7185
|
+
{
|
|
7186
|
+
path: resolve(projectRoot, ".codex/skills"),
|
|
7187
|
+
source: "project"
|
|
7188
|
+
},
|
|
7189
|
+
{
|
|
7190
|
+
path: resolve(projectRoot, ".pi/skills"),
|
|
7191
|
+
source: "project"
|
|
7192
|
+
},
|
|
7193
|
+
{
|
|
7194
|
+
path: resolve(home, ".claude/skills"),
|
|
7195
|
+
source: "user"
|
|
7196
|
+
},
|
|
7197
|
+
{
|
|
7198
|
+
path: resolve(home, ".codex/skills"),
|
|
7199
|
+
source: "user"
|
|
7200
|
+
},
|
|
7201
|
+
{
|
|
7202
|
+
path: resolve(home, ".pi/agent/skills"),
|
|
7203
|
+
source: "user"
|
|
7204
|
+
}
|
|
7205
|
+
];
|
|
7206
|
+
}
|
|
7207
|
+
/**
|
|
7208
|
+
* Parse the two foreign-only formats. The `json` format is NOT handled
|
|
7209
|
+
* here — callers route it through the shared `parseMcpsFile` (keeping
|
|
7210
|
+
* whitespace sanitizing + error hints in one place, and avoiding an
|
|
7211
|
+
* import cycle with `mcps-discovery`).
|
|
7212
|
+
*/
|
|
7213
|
+
function parseForeignMcpConfig(text, format, opts = {}) {
|
|
7214
|
+
if (format === "codex-toml") return parseCodexToml(text);
|
|
7215
|
+
if (format === "claude-project-state") return parseClaudeProjectState(text, opts.projectRoot);
|
|
7216
|
+
return parseClaudeUserState(text);
|
|
7217
|
+
}
|
|
7218
|
+
/**
|
|
7219
|
+
* `~/.claude.json` → `projects["<abs project root>"].mcpServers` — the
|
|
7220
|
+
* per-project servers `claude mcp add` writes in its default "local"
|
|
7221
|
+
* scope. Exact-match on the resolved project root: Claude keys by the
|
|
7222
|
+
* directory it was launched from, which for repo work is the git root
|
|
7223
|
+
* we resolve to.
|
|
7224
|
+
*/
|
|
7225
|
+
function parseClaudeProjectState(text, projectRoot) {
|
|
7226
|
+
if (!projectRoot) return [];
|
|
7227
|
+
const raw = JSON.parse(text);
|
|
7228
|
+
const projects = raw && typeof raw === "object" ? raw.projects : void 0;
|
|
7229
|
+
if (!projects || typeof projects !== "object") return [];
|
|
7230
|
+
return normalizeForeignEntries(projects[projectRoot]?.mcpServers);
|
|
7231
|
+
}
|
|
7232
|
+
/**
|
|
7233
|
+
* `~/.claude.json` — Claude Code's user-state file. Import ONLY the
|
|
7234
|
+
* `mcpServers` map; absent/malformed key means "nothing to import"
|
|
7235
|
+
* rather than an error, since the file legitimately exists without it.
|
|
7236
|
+
*/
|
|
7237
|
+
function parseClaudeUserState(text) {
|
|
7238
|
+
const raw = JSON.parse(text);
|
|
7239
|
+
return normalizeForeignEntries(raw && typeof raw === "object" ? raw.mcpServers : void 0);
|
|
7240
|
+
}
|
|
7241
|
+
/**
|
|
7242
|
+
* Normalize a name-keyed server map ENTRY BY ENTRY, skipping the ones
|
|
7243
|
+
* `normalizeMcpServers` rejects (no inferrable transport, exotic shapes).
|
|
7244
|
+
* Whole-file normalization would let one bad entry drop every server in
|
|
7245
|
+
* a file the user doesn't own — and can't fix from zidane.
|
|
7246
|
+
*/
|
|
7247
|
+
function normalizeForeignEntries(servers) {
|
|
7248
|
+
if (!servers || typeof servers !== "object" || Array.isArray(servers)) return [];
|
|
7249
|
+
const out = [];
|
|
7250
|
+
for (const [name, entry] of Object.entries(servers)) try {
|
|
7251
|
+
out.push(...normalizeMcpServers({ [name]: entry }));
|
|
7252
|
+
} catch {}
|
|
7253
|
+
return out;
|
|
7254
|
+
}
|
|
7255
|
+
/**
|
|
7256
|
+
* `~/.codex/config.toml` — `[mcp_servers.<name>]` tables. TOML parsing
|
|
7257
|
+
* rides Bun's built-in parser; on a non-Bun host the Codex import is
|
|
7258
|
+
* silently unavailable (returns `[]`) rather than pulling in a TOML
|
|
7259
|
+
* dependency for one optional file. Only the fields our config
|
|
7260
|
+
* understands are forwarded — Codex-specific extras
|
|
7261
|
+
* (`startup_timeout_ms`, …) are dropped before normalization.
|
|
7262
|
+
*/
|
|
7263
|
+
function parseCodexToml(text) {
|
|
7264
|
+
const toml = globalThis.Bun?.TOML;
|
|
7265
|
+
if (!toml) return [];
|
|
7266
|
+
const parsed = toml.parse(text);
|
|
7267
|
+
const tables = parsed && typeof parsed === "object" ? parsed.mcp_servers : void 0;
|
|
7268
|
+
if (!tables || typeof tables !== "object" || Array.isArray(tables)) return [];
|
|
7269
|
+
const map = {};
|
|
7270
|
+
for (const [name, entry] of Object.entries(tables)) {
|
|
7271
|
+
if (!entry || typeof entry !== "object") continue;
|
|
7272
|
+
const raw = entry;
|
|
7273
|
+
map[name] = {
|
|
7274
|
+
...raw.command !== void 0 ? { command: raw.command } : {},
|
|
7275
|
+
...raw.args !== void 0 ? { args: raw.args } : {},
|
|
7276
|
+
...raw.env !== void 0 ? { env: raw.env } : {},
|
|
7277
|
+
...raw.url !== void 0 ? { url: raw.url } : {}
|
|
7278
|
+
};
|
|
7279
|
+
}
|
|
7280
|
+
return normalizeForeignEntries(map);
|
|
7281
|
+
}
|
|
7282
|
+
//#endregion
|
|
7085
7283
|
//#region src/chat/mcps-discovery.ts
|
|
7086
7284
|
/**
|
|
7087
7285
|
* File names searched in each of the four project/user roots. Order
|
|
@@ -7259,14 +7457,16 @@ function isEntryDisabled(entry) {
|
|
|
7259
7457
|
* log line is also emitted for ops visibility.
|
|
7260
7458
|
*/
|
|
7261
7459
|
function discoverProjectMcps(opts = {}) {
|
|
7262
|
-
const paths =
|
|
7460
|
+
const paths = mcpsDiscoveryPaths(opts).filter((p) => existsSync(p.path));
|
|
7461
|
+
const projectRoot = findGitRoot$1(opts.cwd ?? process.cwd()) ?? opts.cwd ?? process.cwd();
|
|
7263
7462
|
const seen = /* @__PURE__ */ new Set();
|
|
7264
7463
|
const servers = [];
|
|
7265
7464
|
const errors = [];
|
|
7266
|
-
for (const { path, source } of paths) {
|
|
7465
|
+
for (const { path, source, format } of paths) {
|
|
7267
7466
|
let configs;
|
|
7268
7467
|
try {
|
|
7269
|
-
|
|
7468
|
+
const text = readFileSync(path, "utf8");
|
|
7469
|
+
configs = format === "json" ? parseMcpsFile(text) : parseForeignMcpConfig(text, format, { projectRoot });
|
|
7270
7470
|
} catch (err) {
|
|
7271
7471
|
const message = errorMessage(err);
|
|
7272
7472
|
errors.push({
|
|
@@ -7293,6 +7493,19 @@ function discoverProjectMcps(opts = {}) {
|
|
|
7293
7493
|
};
|
|
7294
7494
|
}
|
|
7295
7495
|
/**
|
|
7496
|
+
* Full path list a discovery pass reads, formats attached — native
|
|
7497
|
+
* `mcp(s).json` locations first (they win name collisions), then the
|
|
7498
|
+
* foreign-agent files when enabled.
|
|
7499
|
+
*/
|
|
7500
|
+
function mcpsDiscoveryPaths(opts = {}) {
|
|
7501
|
+
const native = defaultMcpsConfigPaths(opts).map((p) => ({
|
|
7502
|
+
...p,
|
|
7503
|
+
format: "json"
|
|
7504
|
+
}));
|
|
7505
|
+
if (!opts.foreignAgents) return native;
|
|
7506
|
+
return [...native, ...foreignMcpConfigFiles(opts)];
|
|
7507
|
+
}
|
|
7508
|
+
/**
|
|
7296
7509
|
* Map a user-toggled enable list onto the `mcpServers` array the agent
|
|
7297
7510
|
* receives. Conventions match `buildSkillsConfig`:
|
|
7298
7511
|
*
|
|
@@ -8340,10 +8553,12 @@ function aggregateUsage(runs) {
|
|
|
8340
8553
|
* `discoverSkills` itself skips missing dirs without error.
|
|
8341
8554
|
*/
|
|
8342
8555
|
function defaultSkillScanPaths(opts = {}) {
|
|
8343
|
-
|
|
8556
|
+
const native = projectUserPaths({
|
|
8344
8557
|
subPath: "skills",
|
|
8345
8558
|
...opts
|
|
8346
8559
|
});
|
|
8560
|
+
if (!opts.foreignAgents) return native;
|
|
8561
|
+
return [...native, ...foreignSkillScanPaths(opts)];
|
|
8347
8562
|
}
|
|
8348
8563
|
/**
|
|
8349
8564
|
* Discover every skill reachable from the default scan paths. Returns
|
|
@@ -8823,4 +9038,4 @@ function computeTurnAnchors(items) {
|
|
|
8823
9038
|
//#endregion
|
|
8824
9039
|
export { useMcpAuthState as $, buildPlanSystem as $n, restoreChainFallbacks as $t, runOAuthLogin as A, TODOWRITE_TOOL as An, DEFAULT_THEME as At, saveMcpToolsCache as B, setTodosForRun as Bn, createDiscoverySlot as Bt, projectsFilePath as C, DEFAULT_PERSIST_EXCLUDE_TOOLS as Cn, SETTINGS_CHOICES as Ct, formatPathForCwd as D, singleAgentRegistry as Dn, clampFps as Dt, writeProjects as E, resolveAgentId as En, SettingsProvider as Et, parseMcpsFile as F, getTodosForRun as Fn, GRUVBOX_LIGHT as Ft, buildVisibleMcpRows as G, IDENTITY_PREFIX as Gn, useConfig as Gt, buildToolToggle as H, ACTIONS_WITH_CARE_DOCTRINE as Hn, useDiscovery as Ht, clearMcpToolsCache as I, isTodoTool as In, CATPPUCCIN_FRAPPE as It, createFileMcpCredentialStore as J, PLAN_MODE_DOCTRINE as Jn, buildRunModel as Jt, indexOfServerRow as K, INTERACTION_GUIDANCE as Kn, resolveConfig as Kt, loadMcpToolsCache as L, pickActiveRunId as Ln, CATPPUCCIN_LATTE as Lt, buildMcpServers as M, TODO_WRITE_COUNTS_METADATA_KEY as Mn, resolveTheme as Mt, defaultMcpsConfigPaths as N, createTodoTools as Nn, VAPORWAVE_THEME as Nt, fetchOAuthRedirect as O, TODOREAD_TOOL as On, useSettings as Ot, discoverProjectMcps as P, getArchivedTodosForRun as Pn, GRUVBOX_DARK as Pt, useMcpAuthDispatch as Q, buildBuildSystem as Qn, providerKeySetChanged as Qt, mcpToolsCachePath as R, pruneTodosByRun as Rn, CATPPUCCIN_MACCHIATO as Rt, matchesSafelistEntry as S, DEFAULT_BUDGET_EXCLUDE_TOOLS as Sn, SETTINGS_CATEGORIES as St, suggestSafelistEntries as T, accentColor as Tn, SETTINGS_TOGGLES as Tt, useMcpToolToggleMap as U, COMMUNICATION_DOCTRINE as Un, useDiscoveryOptional as Ut, subscribeMcpToolsCache as V, useActiveTodos as Vn, DiscoveryProvider as Vt, useMcpToolToggleSet as W, DOING_TASKS_DOCTRINE as Wn, ConfigProvider as Wt, patchMcpCredential as X, SUBAGENT_GUIDANCE as Xn, chainsEqual as Xt, mcpCredentialsPath as Y, PLAN_MODE_DOCTRINE_NO_PROMPTS as Yn, chainPositionOf as Yt, McpAuthProvider as Z, TOKEN_DISCIPLINE_DOCTRINE as Zn, filterChainFallbacks as Zt, useSafeModeQueue as _, discoverAgentsMd as _n, toolCallPreview as _r, buildHints as _t, useSurfaces as a, bootTick as an, createStateStore as ar, buildResumedToolResultsTurn as at, getSafelist as b, BUILTIN_AGENTS as bn, usageByModel as br, useEnabledToggleSet as bt, useStreamBuffer as c, checkForUpdate as cn, lastContextSizeFromTurns as cr, makeRequestInteraction as ct, discoverProjectSkills as d, detectPackageManager as dn, marginTopFor as dr, useInteractionsActions as dt, sanitizeModelChain as en, envSection as er, getMcpAuthStatus as et, renderSession as f, parseSemver as fn, saveState as fr, useInteractionsQueue as ft, useSafeModeActions as g, chatAutoCompactBehavior as gn, titleFromTurns as gr, truncateTrailing as gt, SafeModeProvider as h, resolvePlatformPackage as hn, sumRunCosts as hr, hintsLength as ht, useSelectStyle as i, bootProfileEnabled as in, compactSummaryEvent as ir, PRESENT_PLAN_TOOL as it, supportsOAuth as j, TODO_STATUS_GLYPHS as jn, resolveChipColor as jt, oauthUsesManualCodePaste as k, TODOS_METADATA_KEY as kn, BUILTIN_THEMES as kt, buildSkillsConfig as l, compareSemver as ln, listSessionMeta as lr, pendingInteractionsFromTurns as lt, writeSessionExport as m, performSelfUpdate as mn, stripSpawnTokensLine as mr, clipHintsToWidth as mt, ThemeProvider as n, useCompletion as nn, createChatTurnsReadTool as nr, ASK_USER_TOOL as nt, useSyntaxStyles as o, buildUpdateHint as on, deriveSessionTitle as or, createInteractionTools as ot, resolveSessionExportTarget as p, performInPlaceSelfUpdate as pn, serverToolResultSummary as pr, EMPTY_HINTS as pt, parentServerName as q, INTERACTION_GUIDANCE_NO_PROMPTS as qn, resolveStoragePaths as qt, useColors as r, tryOpenBrowser as rn, DEFAULT_SESSION_TITLE as rr, InteractionsProvider as rt, useTheme as s, useUpdateCheck as sn, eventsFromTurns as sr, isInteractionTool as st, computeTurnAnchors as t, toggleChainEntry as tn, chatReferenceTokensForPrompt as tr, reduceMcpAuth as tt, defaultSkillScanPaths as u, detectLibc as un, loadState as ur, serializeInteractionResponse as ut, IMPLICITLY_SAFE_TOOLS as v, renderAgentsMdBlock as vn, toolResultText as vr, shortChord as vt, readProjects as w, PLAN_AGENT as wn, SETTINGS_INPUTS as wt, isOnSafelist as x, DEFAULT_AGENT_ID as xn, DEFAULT_SETTINGS as xt, addToSafelist as y, BUILD_AGENT as yn, updateToolEventOutcomes as yr, listProjectFiles as yt, refreshMcpToolsCatalog as z, selectActiveTodos as zn, CATPPUCCIN_MOCHA as zt };
|
|
8825
9040
|
|
|
8826
|
-
//# sourceMappingURL=transcript-anchors-
|
|
9041
|
+
//# sourceMappingURL=transcript-anchors-B_kUHJ16.js.map
|