context-mode 2.0.0-next.11 → 2.0.0-next.13
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/SHA256SUMS +14 -14
- package/cli.mjs +89 -23
- package/copilot/plugin.json +1 -1
- package/gemini-extension.json +1 -1
- package/hook.mjs +88 -84
- package/opencode/plugin.js +383 -157
- package/package.json +1 -1
- package/pi/index.js +434 -195
- package/qwen-extension.json +1 -1
- package/run.mjs +42 -12
- package/search.mjs +42 -12
- package/server.mjs +211 -101
package/SHA256SUMS
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
caf41a11a88c72a7f8d959e0a53d29c6dab6058f22f61b9386b49d0f2b4c39fe .claude-plugin/marketplace.json
|
|
2
|
+
f09b0b9c8c3bdc83dfecaa0b310d4a61f1914fd46af7499359614c70d0b9f8c7 .claude-plugin/plugin.json
|
|
3
3
|
187503e1455560d4ab5a72e3b8cd2f274abd4ccc5faa60dd66c37e44bb5f10c2 .codex-plugin/hooks.json
|
|
4
4
|
4edea851775bc3f0418f8d9cf6ead74f2767c3a9e3b8c05749eacb78ebb3b896 .codex-plugin/mcp.json
|
|
5
|
-
|
|
5
|
+
393cd17a6c8e8db563ab3f8675a9650e8605e4b7e6d30bf2d167dee03ad77f84 .codex-plugin/plugin.json
|
|
6
6
|
1773e40a89384dd1af9023ba533da1908f3e2435dbaaa7cc941edf0514148313 claude-code/skills/ctx-doctor/SKILL.md
|
|
7
7
|
34fffb9c76d69c551f07036230bec0fbaca7a69177a5a47f89ddb9a9990a1fa2 claude-code/skills/ctx-stats/SKILL.md
|
|
8
8
|
d8f835d2f2b3eb70c5902f8707e7c5857977cec9e20ace76c499378a04e178e0 claude-code/skills/ctx-upgrade/SKILL.md
|
|
9
|
-
|
|
9
|
+
61803853b497ff84e47d12e3c45adb7c31674896ec30943a62be181333560428 cli.mjs
|
|
10
10
|
83c297020ed0c592fc68c9c482546a6999d41df5d06d8a329498f10edb1bd38e codex/skills/ctx-doctor/SKILL.md
|
|
11
11
|
adc2c374f699d3698110920bb48411965de09fc6e7232ce59c913f6d58c0d738 codex/skills/ctx-stats/SKILL.md
|
|
12
12
|
5c12cdd19a5e3ed7d9ba3a47b24d03864a28d36cf7006876284ee07cd4221ec4 codex/skills/ctx-upgrade/SKILL.md
|
|
13
|
-
|
|
13
|
+
2ccaa645b7c1c1110cb435b1f36cd14f949989fd19738d3fcd44aa2c5bcdeb2e copilot/plugin.json
|
|
14
14
|
832bf0d31c37a448f3904bc41c7df071777aec2f8fce9d667f1fcf5b03a52a91 fixtures/hook-roundtrip.json
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
13696ff6df8a8b35297c54ef7288b39aa685987e8e6457d020236b22bef615da gemini-extension.json
|
|
16
|
+
fb7358e764e8f0b9a9d0f3052abce4c7a96f314335f22b02794a1e5494040dae hook.mjs
|
|
17
17
|
1f8d8650d2b38737522cab6b875878e8baf84a74acf98cd924c7af22852d873f hooks/claude-code.json
|
|
18
18
|
2524a0eb52683b65c65943c5097db513e9845ba14e84324b39e9a8ea2bb43193 hooks/codex.json
|
|
19
19
|
b656fed2b754ebcfd4c156bee81d5879c21a8083fc0d6b8e3241462b63a214b6 hooks/copilot-cli.json
|
|
@@ -22,16 +22,16 @@ f336d1db67de49e641687bbd41ba1a9424e31dfe2377b2284bf44358288ebd8b hooks/kiro.jso
|
|
|
22
22
|
017c9cc3997dd53231b8548b1a1609fddc51177af53501565a4f334602039860 hooks/qwen.json
|
|
23
23
|
33f69267645338d0dc392ce551dcd7c69a0b508113469d6ea637d3f34239ef1d hooks/vscode.json
|
|
24
24
|
085630bccf2073ac9a62be24ef91dfc47d106092dc82c822db70890b7d3ae1c0 hooks/zcode.json
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
3588020b66bde478d81b20b7ffee3157dee426f5bb50f828559de444f2b8fc64 opencode/plugin.js
|
|
26
|
+
2d58f0cd3fbf34c96b888ec43255f129c637ac1e4d774db38c080d7ff7b9e8f6 package.json
|
|
27
|
+
3c0a3af1f4836f768198b6e8254697f9183957455e5a31b768259cc17964e691 pi/index.js
|
|
28
28
|
8712881622c9905aa4836af50d903042d34a91506264e459bc7839331f6f0192 pi/skills/ctx-doctor/SKILL.md
|
|
29
29
|
8d6e8e2a82eb079bddc60727f52d9f9a6e0bf9e15391357fed82ee76ab5fe76c pi/skills/ctx-stats/SKILL.md
|
|
30
30
|
db6f9c006bc864a7271f1eeffb1e316ebb537a3414f1c22f8b9de0a896e8e3c5 pi/skills/ctx-upgrade/SKILL.md
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
cef61dd24e9b804faae6ddd3c8a959b081393f1cd6f4991ba4a46a313906d38e qwen-extension.json
|
|
32
|
+
b408612e309a93e3eeade62a23ccc740856da20bfd508a4456d8f44bc4dfa980 run.mjs
|
|
33
|
+
b408612e309a93e3eeade62a23ccc740856da20bfd508a4456d8f44bc4dfa980 search.mjs
|
|
34
|
+
8c7504cd6083dcfcf56e8eec129c692da404905b8e432d3116a29e0b9971217e server.mjs
|
|
35
35
|
e5503a22a6238901484d123efc11d2d933aa9a54c6ac2018812cfa65ec4e53e3 skills/ctx-doctor/SKILL.md
|
|
36
36
|
1044587a1906c69f2467c089a25e19819a290ea5728389bd1f086c6dfc0d0c51 skills/ctx-stats/SKILL.md
|
|
37
37
|
c1cac75b7506ee0d06089ce611ac6dc9314cf12435da318ce88ad50e2c5debbf skills/ctx-upgrade/SKILL.md
|
package/cli.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as __cmRequire}from"node:module";if(typeof process.getBuiltinModule!=="function")process.getBuiltinModule=(id)=>__cmRequire(import.meta.url)(id);
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -87,7 +88,7 @@ var require_src = __commonJS({
|
|
|
87
88
|
|
|
88
89
|
// src/entries/cli.ts
|
|
89
90
|
import { spawn as spawn2 } from "node:child_process";
|
|
90
|
-
import { readFileSync as readFileSync6, realpathSync as
|
|
91
|
+
import { readFileSync as readFileSync6, realpathSync as realpathSync6 } from "node:fs";
|
|
91
92
|
import path8 from "node:path";
|
|
92
93
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
93
94
|
|
|
@@ -255,6 +256,24 @@ var DENY_WHAT = Object.freeze({
|
|
|
255
256
|
webfetch: "WebFetch"
|
|
256
257
|
});
|
|
257
258
|
var DENY_WEBFETCH_TOOLS = Object.freeze(["ctx_index", "ctx_search"]);
|
|
259
|
+
var HOOK_FAIL_TOOL_KEYS = Object.freeze(["tool_name", "toolName", "tool"]);
|
|
260
|
+
var HOOK_FAIL_EVENT_KEYS = Object.freeze(["hook_event_name", "hookEventName", "type"]);
|
|
261
|
+
var HOOK_FAIL_INPUT_KEYS = Object.freeze(["tool_input", "toolArgs", "input", "args"]);
|
|
262
|
+
var HOOK_FAIL_CWD_KEYS = Object.freeze(["cwd", "directory"]);
|
|
263
|
+
var HOOK_FAIL_PRE_EVENTS = Object.freeze(["pretooluse", "beforetool", "tool_call", "execute.before", "tool.execute.before"]);
|
|
264
|
+
var HOOK_FAULT_STAGES = Object.freeze(["decode", "project", "policy", "store", "encode"]);
|
|
265
|
+
var HOOK_FAIL_TOOLS = Object.freeze({
|
|
266
|
+
shell: Object.freeze(["Bash", "bash", "shell"]),
|
|
267
|
+
read: Object.freeze(["Read", "read_file"]),
|
|
268
|
+
grep: Object.freeze(["Grep", "grep_search"]),
|
|
269
|
+
fetch: Object.freeze(["WebFetch", "web_fetch", "fetch"])
|
|
270
|
+
});
|
|
271
|
+
var HOOK_FAIL_REDIRECT = Object.freeze({
|
|
272
|
+
read: "Read the file in parts with offset and limit, or process it with ctx_execute(language, code); only what you print comes back.",
|
|
273
|
+
shell: "Run the command with ctx_execute(language, code) or ctx_batch instead; only the part that matches your intent comes back.",
|
|
274
|
+
grep: "Search with ctx_execute(language, code), or index the files with ctx_index and query them with ctx_search.",
|
|
275
|
+
fetch: "Index the URL with ctx_index and query it with ctx_search."
|
|
276
|
+
});
|
|
258
277
|
var BOUNDED_COMMANDS = Object.freeze(["pwd", "whoami", "uname", "id", "realpath", "ln"]);
|
|
259
278
|
var BOUNDED_GIT_SUBCOMMANDS = Object.freeze(["status"]);
|
|
260
279
|
var VERSION_PROBE_FLAGS = Object.freeze(["--version", "-v"]);
|
|
@@ -385,12 +404,13 @@ var V1_STATUSLINE_COMMAND = "context-mode statusline";
|
|
|
385
404
|
var V1_PI_PACKAGE = "npm:context-mode";
|
|
386
405
|
var V1_OPENCODE_PLUGIN_SPEC = "context-mode";
|
|
387
406
|
var V1_TMP_PREFIX = "context-mode-";
|
|
388
|
-
var
|
|
407
|
+
var V1_TOML_SECTION_ROOT = "mcp_servers";
|
|
389
408
|
var V1_HOOKS_DIR_NAME = "hooks";
|
|
390
409
|
var SETTINGS_FILE = "settings.json";
|
|
391
410
|
var CLAUDE_USER_CONFIG_FILE = ".claude.json";
|
|
392
411
|
var HOOKS_JSON_FILE = "hooks.json";
|
|
393
412
|
var CLAUDE_CONFIG_DIR_ENV = "CLAUDE_CONFIG_DIR";
|
|
413
|
+
var CODEX_HOME_ENV = "CODEX_HOME";
|
|
394
414
|
var COPILOT_HOME_ENV = "COPILOT_HOME";
|
|
395
415
|
var KIRO_HOME_ENV = "KIRO_HOME";
|
|
396
416
|
var OPENCODE_CONFIG_DIR_ENV = "OPENCODE_CONFIG_DIR";
|
|
@@ -452,12 +472,19 @@ var V1_REASON = Object.freeze({
|
|
|
452
472
|
});
|
|
453
473
|
var UPGRADE_REPORT_ONLY_REASONS = Object.freeze([V1_REASON.statusLine, V1_REASON.vscodeMcp, V1_REASON.dataDirShared, V1_REASON.tmpFile, V1_REASON.kiroSteering]);
|
|
454
474
|
var OPENCODE_TOOL_PREFIX = SERVER_KEY + "_";
|
|
475
|
+
var SERVER_ENTRY_FILE = "server.mjs";
|
|
476
|
+
var VSCODE_WORKSPACE_VAR = "${workspaceFolder}";
|
|
477
|
+
var OPENCODE_PLUGIN_PATH = Object.freeze(["opencode", "plugin.js"]);
|
|
478
|
+
var HOST_NODE_COMMAND = "node";
|
|
479
|
+
var EXE_SUFFIX = ".exe";
|
|
455
480
|
var ATOMIC_RENAME_RETRIES = 5;
|
|
456
481
|
var ATOMIC_RENAME_DELAY_MS = 50;
|
|
457
482
|
var ATOMIC_RENAME_BUSY_CODES = ["EPERM", "EBUSY", "EACCES"];
|
|
458
483
|
var ATOMIC_TMP_PREFIX = ".";
|
|
459
484
|
var ATOMIC_TMP_MARK = ".cm-tmp-";
|
|
460
485
|
var JSON_INDENT_UNIT = " ";
|
|
486
|
+
var MCP_COMMAND_FIELD = "command";
|
|
487
|
+
var MCP_ARGS_FIELD = "args";
|
|
461
488
|
var ZCODE_MCP_FEATURE_KEY = Object.freeze(["features", "mcp"]);
|
|
462
489
|
var CODEX_OMIT_TOOLS_FROM_FIELD = "omit_tools_from";
|
|
463
490
|
var CODEX_OMIT_DEFERRED = Object.freeze(["deferred"]);
|
|
@@ -4471,6 +4498,10 @@ function homeDirOf(env, platform = process.platform) {
|
|
|
4471
4498
|
if (set2(env.HOME)) return env.HOME;
|
|
4472
4499
|
return set2(env.USERPROFILE) ? env.USERPROFILE : null;
|
|
4473
4500
|
}
|
|
4501
|
+
function codexDirOf(env, home) {
|
|
4502
|
+
const dir = env[CODEX_HOME_ENV];
|
|
4503
|
+
return dir !== void 0 && dir !== "" ? dir : join2(home, ...AGENT_HOME_DIR.codex);
|
|
4504
|
+
}
|
|
4474
4505
|
function copilotDirOf(env, home) {
|
|
4475
4506
|
const dir = env[COPILOT_HOME_ENV];
|
|
4476
4507
|
return dir !== void 0 && dir !== "" ? dir : join2(home, ...AGENT_HOME_DIR["copilot-cli"]);
|
|
@@ -4513,14 +4544,6 @@ function ownMcpFileOf(agent, file, env, home) {
|
|
|
4513
4544
|
// src/setup/registry.ts
|
|
4514
4545
|
import path3 from "node:path";
|
|
4515
4546
|
|
|
4516
|
-
// src/core/ops/doctor-config.ts
|
|
4517
|
-
import { join as join6 } from "node:path";
|
|
4518
|
-
|
|
4519
|
-
// src/core/ops/detect-v1.ts
|
|
4520
|
-
import { existsSync as existsSync3, opendirSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
4521
|
-
import { tmpdir } from "node:os";
|
|
4522
|
-
import { join as join4 } from "node:path";
|
|
4523
|
-
|
|
4524
4547
|
// src/core/ops/host-config.ts
|
|
4525
4548
|
import { existsSync as existsSync2, readFileSync } from "node:fs";
|
|
4526
4549
|
import { dirname as dirname2, join as join3 } from "node:path";
|
|
@@ -6831,9 +6854,6 @@ function scanToml(text2) {
|
|
|
6831
6854
|
function tomlTableSpans(text2) {
|
|
6832
6855
|
return scanToml(text2).tables;
|
|
6833
6856
|
}
|
|
6834
|
-
function tomlHeaderText(path9) {
|
|
6835
|
-
return "[" + path9.map(tomlHeaderKey).join(".") + "]";
|
|
6836
|
-
}
|
|
6837
6857
|
function parseHostConfig(agent, path9, text2, format) {
|
|
6838
6858
|
try {
|
|
6839
6859
|
return format === "toml" ? scanToml(text2).value : scanJson(text2, format).value;
|
|
@@ -6999,6 +7019,19 @@ function setText(agent, path9, text2, format, key, value) {
|
|
|
6999
7019
|
throw new CtxError("CONFIG_PARSE_FAILED", { agent, path: path9, format });
|
|
7000
7020
|
}
|
|
7001
7021
|
}
|
|
7022
|
+
function isNodeCommand(command) {
|
|
7023
|
+
if (typeof command !== "string") return false;
|
|
7024
|
+
let at = -1;
|
|
7025
|
+
for (const sep2 of V1_PATH_SEPS) at = Math.max(at, command.lastIndexOf(sep2));
|
|
7026
|
+
const exe = command.slice(at + 1).toLowerCase();
|
|
7027
|
+
return exe === HOST_NODE_COMMAND || exe === HOST_NODE_COMMAND + EXE_SUFFIX;
|
|
7028
|
+
}
|
|
7029
|
+
function ownMcpValue(agent, node, server) {
|
|
7030
|
+
const mcp = OWN_MCP_ENTRY[agent];
|
|
7031
|
+
if (mcp === void 0) return void 0;
|
|
7032
|
+
const tail = agent === "vscode" ? [WORKSPACE_FOLDER_FLAG, VSCODE_WORKSPACE_VAR] : [];
|
|
7033
|
+
return { ...mcp.fields, [MCP_COMMAND_FIELD]: node, [MCP_ARGS_FIELD]: [server, AGENT_ARG, agent, ...tail] };
|
|
7034
|
+
}
|
|
7002
7035
|
function applyEdits(agent, path9, text2, format, wanted) {
|
|
7003
7036
|
const parsed = parseHostConfig(agent, path9, text2, format);
|
|
7004
7037
|
let out2 = text2;
|
|
@@ -7015,7 +7048,13 @@ function editHostConfigText(agent, path9, text2, format, wanted) {
|
|
|
7015
7048
|
return applyEdits(agent, path9, text2, format, wanted);
|
|
7016
7049
|
}
|
|
7017
7050
|
|
|
7051
|
+
// src/core/ops/doctor-config.ts
|
|
7052
|
+
import { join as join6 } from "node:path";
|
|
7053
|
+
|
|
7018
7054
|
// src/core/ops/detect-v1.ts
|
|
7055
|
+
import { existsSync as existsSync3, opendirSync, readdirSync as readdirSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
7056
|
+
import { tmpdir } from "node:os";
|
|
7057
|
+
import { join as join4 } from "node:path";
|
|
7019
7058
|
var isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
7020
7059
|
var keyPath = (...parts) => parts.join(".");
|
|
7021
7060
|
var finding = (file, path9, reason) => ({ file, path: path9, reason });
|
|
@@ -7077,6 +7116,21 @@ function readTomlTables(file) {
|
|
|
7077
7116
|
return [];
|
|
7078
7117
|
}
|
|
7079
7118
|
}
|
|
7119
|
+
function readTomlValue(file) {
|
|
7120
|
+
try {
|
|
7121
|
+
return parseHostConfig("codex", file, readText(file), "toml");
|
|
7122
|
+
} catch {
|
|
7123
|
+
return {};
|
|
7124
|
+
}
|
|
7125
|
+
}
|
|
7126
|
+
function isV2McpTable(v) {
|
|
7127
|
+
if (!isObj(v) || !isNodeCommand(v[MCP_COMMAND_FIELD])) return false;
|
|
7128
|
+
const first = Array.isArray(v[MCP_ARGS_FIELD]) ? v[MCP_ARGS_FIELD][0] : void 0;
|
|
7129
|
+
if (typeof first !== "string") return false;
|
|
7130
|
+
let at = -1;
|
|
7131
|
+
for (const sep2 of V1_PATH_SEPS) at = Math.max(at, first.lastIndexOf(sep2));
|
|
7132
|
+
return first.slice(at + 1) === SERVER_ENTRY_FILE;
|
|
7133
|
+
}
|
|
7080
7134
|
var listOf = (v) => Array.isArray(v) ? v : [];
|
|
7081
7135
|
var commandOf = (v) => isObj(v) && typeof v.command === "string" ? v.command : null;
|
|
7082
7136
|
function nestedCommands(doc) {
|
|
@@ -7150,8 +7204,11 @@ function scanCodex(agentHome, out2) {
|
|
|
7150
7204
|
}
|
|
7151
7205
|
}
|
|
7152
7206
|
const tomlFile = join4(agentHome, CONFIG_TOML_FILE);
|
|
7207
|
+
const config = readTomlValue(tomlFile);
|
|
7153
7208
|
for (const span of readTomlTables(tomlFile)) {
|
|
7154
|
-
if (
|
|
7209
|
+
if (span.path[0] !== V1_TOML_SECTION_ROOT || span.path[1] !== SERVER_KEY) continue;
|
|
7210
|
+
if (span.path.length === 2 && isV2McpTable(hostConfigValueAt(config, span.path))) continue;
|
|
7211
|
+
out2.push(finding(tomlFile, span.header.trim(), V1_REASON.codexToml));
|
|
7155
7212
|
}
|
|
7156
7213
|
dataDir(join4(agentHome, V1_DATA_DIR_NAME), V1_REASON.dataDir, out2);
|
|
7157
7214
|
}
|
|
@@ -7263,7 +7320,7 @@ function scanAll(home, tmp, out2) {
|
|
|
7263
7320
|
function detectV1(agent, home, scope = {}) {
|
|
7264
7321
|
const out2 = [];
|
|
7265
7322
|
const project = scope.project;
|
|
7266
|
-
const agentHome = agent === "claude-code" && scope.claudeDir !== void 0 ? scope.claudeDir : agent === "copilot-cli" && scope.copilotDir !== void 0 ? scope.copilotDir : agent === "kiro" && scope.kiroDir !== void 0 ? scope.kiroDir : agent === "opencode" && scope.opencodeDir !== void 0 ? scope.opencodeDir : join4(home, ...AGENT_HOME_DIR[agent]);
|
|
7323
|
+
const agentHome = agent === "claude-code" && scope.claudeDir !== void 0 ? scope.claudeDir : agent === "codex" && scope.codexDir !== void 0 ? scope.codexDir : agent === "copilot-cli" && scope.copilotDir !== void 0 ? scope.copilotDir : agent === "kiro" && scope.kiroDir !== void 0 ? scope.kiroDir : agent === "opencode" && scope.opencodeDir !== void 0 ? scope.opencodeDir : join4(home, ...AGENT_HOME_DIR[agent]);
|
|
7267
7324
|
switch (agent) {
|
|
7268
7325
|
case "claude-code":
|
|
7269
7326
|
scanClaudeCode(home, agentHome, out2);
|
|
@@ -7394,7 +7451,6 @@ function configEdits(c3) {
|
|
|
7394
7451
|
}
|
|
7395
7452
|
var COMMAND_SKILLS = Object.freeze(["ctx-doctor", "ctx-stats", "ctx-upgrade"]);
|
|
7396
7453
|
var SKILL_FILE = "SKILL.md";
|
|
7397
|
-
var OPENCODE_PLUGIN = ["opencode", "plugin.js"];
|
|
7398
7454
|
var CODEX_CONFIG_FILE = "config.toml";
|
|
7399
7455
|
var CODEX_HOME_ENV2 = "CODEX_HOME";
|
|
7400
7456
|
var CODEX_DIR = ".codex";
|
|
@@ -7459,16 +7515,14 @@ function golden(row, home) {
|
|
|
7459
7515
|
tool_input: { command: "true" }
|
|
7460
7516
|
};
|
|
7461
7517
|
}
|
|
7462
|
-
var VSCODE_WORKSPACE_VAR = "${workspaceFolder}";
|
|
7463
7518
|
function configFor(ctx, id) {
|
|
7464
7519
|
const [node, server, flag, agent] = serverCmd(ctx, id);
|
|
7465
7520
|
const own2 = OWN_MCP_ENTRY[id];
|
|
7466
7521
|
if (own2) {
|
|
7467
7522
|
const file = id === "vscode" ? ownMcpFileOf(id, own2.file, ctx.env, ctx.home) : agentPath(ctx, id, own2.file);
|
|
7468
7523
|
const format = file.endsWith(".toml") ? "toml" : id === "vscode" ? "jsonc" : "json";
|
|
7469
|
-
const args = id === "vscode" ? [server, flag, agent, WORKSPACE_FOLDER_FLAG, VSCODE_WORKSPACE_VAR] : [server, flag, agent];
|
|
7470
7524
|
const also = own2.also?.map(([k, v]) => [k, v]);
|
|
7471
|
-
return { file, format, key: own2.key, value:
|
|
7525
|
+
return { file, format, key: own2.key, value: ownMcpValue(id, node, server), ...also ? { also } : {} };
|
|
7472
7526
|
}
|
|
7473
7527
|
if (id === "opencode") {
|
|
7474
7528
|
return {
|
|
@@ -7545,7 +7599,7 @@ function hookInstallFor(ctx, row, command) {
|
|
|
7545
7599
|
kind: "plugin-list",
|
|
7546
7600
|
file: path3.join(opencodeDirOf(ctx.env, ctx.home), OPENCODE_BASE_CONFIG_FILE),
|
|
7547
7601
|
key: ["plugin"],
|
|
7548
|
-
entry: path3.join(ctx.pkgDir, ...
|
|
7602
|
+
entry: path3.join(ctx.pkgDir, ...OPENCODE_PLUGIN_PATH)
|
|
7549
7603
|
};
|
|
7550
7604
|
}
|
|
7551
7605
|
return { kind: "package", via: ch.path };
|
|
@@ -8532,7 +8586,7 @@ async function setupRow(row, ctx, run, dryRun) {
|
|
|
8532
8586
|
return { ...res, status: "FAIL", reason: e.message };
|
|
8533
8587
|
}
|
|
8534
8588
|
const configEdited = (file) => plan.edits.some((e) => e.file === file && e.changes.some((c3) => !isTrust(row, c3)));
|
|
8535
|
-
res.v1 = detectV1(row.id, ctx.home, { claudeDir: claudeDirOf(ctx.env, ctx.home), copilotDir: copilotDirOf(ctx.env, ctx.home), kiroDir: kiroDirOf(ctx.env, ctx.home), opencodeDir: opencodeDirOf(ctx.env, ctx.home) }).filter((f2) => !(row.config && f2.file === row.config.file && !configEdited(f2.file)));
|
|
8589
|
+
res.v1 = detectV1(row.id, ctx.home, { claudeDir: claudeDirOf(ctx.env, ctx.home), codexDir: codexDirOf(ctx.env, ctx.home), copilotDir: copilotDirOf(ctx.env, ctx.home), kiroDir: kiroDirOf(ctx.env, ctx.home), opencodeDir: opencodeDirOf(ctx.env, ctx.home) }).filter((f2) => !(row.config && f2.file === row.config.file && !configEdited(f2.file)));
|
|
8536
8590
|
res.changes = [...plan.edits.flatMap((e) => e.changes), ...[...plan.cli, ...plan.refresh].map((args) => ({ command: [row.cli.bin, ...args] }))];
|
|
8537
8591
|
if (dryRun) return res;
|
|
8538
8592
|
try {
|
|
@@ -9129,6 +9183,18 @@ Run context-mode ${cmd} --help.`);
|
|
|
9129
9183
|
}
|
|
9130
9184
|
}
|
|
9131
9185
|
|
|
9186
|
+
// src/entries/is-entry.ts
|
|
9187
|
+
import { realpathSync as realpathSync5 } from "node:fs";
|
|
9188
|
+
function isEntry(main2, argv1, self) {
|
|
9189
|
+
if (main2 !== void 0) return main2;
|
|
9190
|
+
if (argv1 === void 0 || argv1 === "") return false;
|
|
9191
|
+
try {
|
|
9192
|
+
return realpathSync5(argv1) === realpathSync5(self);
|
|
9193
|
+
} catch {
|
|
9194
|
+
return false;
|
|
9195
|
+
}
|
|
9196
|
+
}
|
|
9197
|
+
|
|
9132
9198
|
// src/entries/cli.ts
|
|
9133
9199
|
var EXIT_OK2 = 0;
|
|
9134
9200
|
var EXIT_FAIL2 = 1;
|
|
@@ -9174,7 +9240,7 @@ function route(argv, version) {
|
|
|
9174
9240
|
` };
|
|
9175
9241
|
}
|
|
9176
9242
|
function main() {
|
|
9177
|
-
const dir = path8.dirname(
|
|
9243
|
+
const dir = path8.dirname(realpathSync6(fileURLToPath2(import.meta.url)));
|
|
9178
9244
|
let version = "";
|
|
9179
9245
|
try {
|
|
9180
9246
|
version = String(JSON.parse(readFileSync6(path8.join(dir, PACKAGE_FILE), "utf8")).version);
|
|
@@ -9213,7 +9279,7 @@ function main() {
|
|
|
9213
9279
|
process.exitCode = signal === "SIGINT" ? EXIT_SIGINT2 : code ?? EXIT_FAIL2;
|
|
9214
9280
|
});
|
|
9215
9281
|
}
|
|
9216
|
-
if (import.meta.main) main();
|
|
9282
|
+
if (isEntry(import.meta.main, process.argv[1], fileURLToPath2(import.meta.url))) main();
|
|
9217
9283
|
export {
|
|
9218
9284
|
HELP2 as HELP,
|
|
9219
9285
|
V1_PLATFORM_AGENT,
|
package/copilot/plugin.json
CHANGED
package/gemini-extension.json
CHANGED