@dosu/cli 0.52.2 → 0.52.3
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/bin/dosu.js +171 -140
- package/package.json +1 -1
package/bin/dosu.js
CHANGED
|
@@ -5000,7 +5000,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
|
|
|
5000
5000
|
function getVersionString() {
|
|
5001
5001
|
return `v${VERSION}`;
|
|
5002
5002
|
}
|
|
5003
|
-
var VERSION = "0.52.
|
|
5003
|
+
var VERSION = "0.52.3", INSTALL_CHANNEL = "npm";
|
|
5004
5004
|
|
|
5005
5005
|
// src/debug/logger.ts
|
|
5006
5006
|
import {
|
|
@@ -10226,6 +10226,14 @@ function mcpURL(deploymentID) {
|
|
|
10226
10226
|
function mcpBaseURL() {
|
|
10227
10227
|
return `${getBackendURL()}/v1/mcp`;
|
|
10228
10228
|
}
|
|
10229
|
+
function mcpEndpoint(cfg) {
|
|
10230
|
+
if (cfg.mode === MODE_OSS)
|
|
10231
|
+
return mcpBaseURL();
|
|
10232
|
+
const deploymentID = cfg.active_account?.target?.deployment_id;
|
|
10233
|
+
if (!deploymentID)
|
|
10234
|
+
throw new Error("deployment ID is required");
|
|
10235
|
+
return mcpURL(deploymentID);
|
|
10236
|
+
}
|
|
10229
10237
|
function mcpHeaders(apiKey) {
|
|
10230
10238
|
if (!apiKey) {
|
|
10231
10239
|
throw new Error("API key is required. Run 'dosu setup' to create one.");
|
|
@@ -10252,18 +10260,23 @@ function mcpRemoteServer(url, apiKey) {
|
|
|
10252
10260
|
};
|
|
10253
10261
|
}
|
|
10254
10262
|
function loadJSONConfig(path3) {
|
|
10263
|
+
try {
|
|
10264
|
+
return readJSONConfig(path3);
|
|
10265
|
+
} catch {
|
|
10266
|
+
return {};
|
|
10267
|
+
}
|
|
10268
|
+
}
|
|
10269
|
+
function readJSONConfig(path3) {
|
|
10255
10270
|
if (!existsSync7(path3))
|
|
10256
10271
|
return {};
|
|
10257
|
-
|
|
10258
|
-
if (!
|
|
10272
|
+
const raw = readFileSync8(path3, "utf-8").trim();
|
|
10273
|
+
if (!raw)
|
|
10259
10274
|
return {};
|
|
10260
|
-
if (path3.endsWith(".jsonc")) {
|
|
10261
|
-
data = stripJSONComments(data);
|
|
10262
|
-
}
|
|
10263
10275
|
try {
|
|
10264
|
-
return JSON.parse(
|
|
10265
|
-
} catch {
|
|
10266
|
-
|
|
10276
|
+
return JSON.parse(stripTrailingCommas(stripJSONComments(raw)));
|
|
10277
|
+
} catch (err) {
|
|
10278
|
+
const detail = err.message;
|
|
10279
|
+
throw new Error(`Could not parse ${path3} as JSON (${detail}). Fix the file and retry.`);
|
|
10267
10280
|
}
|
|
10268
10281
|
}
|
|
10269
10282
|
function stripJSONComments(data) {
|
|
@@ -10271,25 +10284,7 @@ function stripJSONComments(data) {
|
|
|
10271
10284
|
let i2 = 0;
|
|
10272
10285
|
while (i2 < data.length) {
|
|
10273
10286
|
if (data[i2] === '"') {
|
|
10274
|
-
|
|
10275
|
-
i2++;
|
|
10276
|
-
while (i2 < data.length && data[i2] !== '"') {
|
|
10277
|
-
if (data[i2] === "\\") {
|
|
10278
|
-
result.push(data[i2]);
|
|
10279
|
-
i2++;
|
|
10280
|
-
if (i2 < data.length) {
|
|
10281
|
-
result.push(data[i2]);
|
|
10282
|
-
i2++;
|
|
10283
|
-
}
|
|
10284
|
-
continue;
|
|
10285
|
-
}
|
|
10286
|
-
result.push(data[i2]);
|
|
10287
|
-
i2++;
|
|
10288
|
-
}
|
|
10289
|
-
if (i2 < data.length) {
|
|
10290
|
-
result.push(data[i2]);
|
|
10291
|
-
i2++;
|
|
10292
|
-
}
|
|
10287
|
+
i2 = copyStringLiteral(data, i2, result);
|
|
10293
10288
|
continue;
|
|
10294
10289
|
}
|
|
10295
10290
|
if (i2 + 1 < data.length && data[i2] === "/" && data[i2 + 1] === "/") {
|
|
@@ -10303,10 +10298,46 @@ function stripJSONComments(data) {
|
|
|
10303
10298
|
i2 += 2;
|
|
10304
10299
|
while (i2 + 1 < data.length && !(data[i2] === "*" && data[i2 + 1] === "/"))
|
|
10305
10300
|
i2++;
|
|
10306
|
-
|
|
10307
|
-
|
|
10301
|
+
i2 = i2 + 1 < data.length ? i2 + 2 : data.length;
|
|
10302
|
+
continue;
|
|
10303
|
+
}
|
|
10304
|
+
result.push(data[i2]);
|
|
10305
|
+
i2++;
|
|
10306
|
+
}
|
|
10307
|
+
return result.join("");
|
|
10308
|
+
}
|
|
10309
|
+
function copyStringLiteral(data, start, out) {
|
|
10310
|
+
let i2 = start + 1;
|
|
10311
|
+
out.push('"');
|
|
10312
|
+
while (i2 < data.length && data[i2] !== '"') {
|
|
10313
|
+
out.push(data[i2]);
|
|
10314
|
+
if (data[i2] === "\\" && i2 + 1 < data.length)
|
|
10315
|
+
out.push(data[++i2]);
|
|
10316
|
+
i2++;
|
|
10317
|
+
}
|
|
10318
|
+
if (i2 < data.length) {
|
|
10319
|
+
out.push('"');
|
|
10320
|
+
i2++;
|
|
10321
|
+
}
|
|
10322
|
+
return i2;
|
|
10323
|
+
}
|
|
10324
|
+
function stripTrailingCommas(data) {
|
|
10325
|
+
const result = [];
|
|
10326
|
+
let i2 = 0;
|
|
10327
|
+
while (i2 < data.length) {
|
|
10328
|
+
if (data[i2] === '"') {
|
|
10329
|
+
i2 = copyStringLiteral(data, i2, result);
|
|
10308
10330
|
continue;
|
|
10309
10331
|
}
|
|
10332
|
+
if (data[i2] === ",") {
|
|
10333
|
+
let j = i2 + 1;
|
|
10334
|
+
while (j < data.length && /\s/.test(data[j]))
|
|
10335
|
+
j++;
|
|
10336
|
+
if (data[j] === "}" || data[j] === "]") {
|
|
10337
|
+
i2++;
|
|
10338
|
+
continue;
|
|
10339
|
+
}
|
|
10340
|
+
}
|
|
10310
10341
|
result.push(data[i2]);
|
|
10311
10342
|
i2++;
|
|
10312
10343
|
}
|
|
@@ -10330,7 +10361,7 @@ function isJSONKeyConfigured(configPath, topLevelKey) {
|
|
|
10330
10361
|
return "dosu" in section;
|
|
10331
10362
|
}
|
|
10332
10363
|
function installJSONServer(configPath, topKey, server) {
|
|
10333
|
-
const jsonCfg =
|
|
10364
|
+
const jsonCfg = readJSONConfig(configPath);
|
|
10334
10365
|
let section = jsonCfg[topKey];
|
|
10335
10366
|
if (typeof section !== "object" || section === null) {
|
|
10336
10367
|
section = {};
|
|
@@ -10342,18 +10373,19 @@ function installJSONServer(configPath, topKey, server) {
|
|
|
10342
10373
|
function removeJSONServer(configPath, topKey) {
|
|
10343
10374
|
let jsonCfg;
|
|
10344
10375
|
try {
|
|
10345
|
-
jsonCfg =
|
|
10376
|
+
jsonCfg = readJSONConfig(configPath);
|
|
10346
10377
|
} catch {
|
|
10347
10378
|
return;
|
|
10348
10379
|
}
|
|
10349
10380
|
const section = jsonCfg[topKey];
|
|
10350
|
-
if (typeof section
|
|
10351
|
-
|
|
10352
|
-
|
|
10381
|
+
if (typeof section !== "object" || section === null || !("dosu" in section))
|
|
10382
|
+
return;
|
|
10383
|
+
delete section.dosu;
|
|
10353
10384
|
saveJSONConfig(configPath, jsonCfg);
|
|
10354
10385
|
}
|
|
10355
10386
|
var import_write_file_atomic, writeFileAtomic, MCP_REMOTE_VERSION = "0.1.38";
|
|
10356
10387
|
var init_config_helpers = __esm(() => {
|
|
10388
|
+
init_config();
|
|
10357
10389
|
import_write_file_atomic = __toESM(require_lib(), 1);
|
|
10358
10390
|
writeFileAtomic = import_write_file_atomic.default;
|
|
10359
10391
|
});
|
|
@@ -10404,16 +10436,6 @@ var init_detect = () => {};
|
|
|
10404
10436
|
|
|
10405
10437
|
// src/mcp/providers/base.ts
|
|
10406
10438
|
function createJSONProvider(opts) {
|
|
10407
|
-
const defaultBuildServer = (cfg) => ({
|
|
10408
|
-
type: "http",
|
|
10409
|
-
url: mcpURL(cfg.active_account.target.deployment_id),
|
|
10410
|
-
headers: mcpHeaders(cfg.active_account?.target?.api_key)
|
|
10411
|
-
});
|
|
10412
|
-
const defaultBuildOSSServer = (cfg) => ({
|
|
10413
|
-
type: "http",
|
|
10414
|
-
url: mcpBaseURL(),
|
|
10415
|
-
headers: mcpHeaders(cfg.active_account?.target?.api_key)
|
|
10416
|
-
});
|
|
10417
10439
|
const buildServer = opts.buildServer ?? defaultBuildServer;
|
|
10418
10440
|
return {
|
|
10419
10441
|
name: () => opts.providerName,
|
|
@@ -10425,8 +10447,10 @@ function createJSONProvider(opts) {
|
|
|
10425
10447
|
globalConfigPath: () => expandHome(opts.globalPath),
|
|
10426
10448
|
isConfigured: () => isJSONKeyConfigured(expandHome(opts.globalPath), opts.topKey),
|
|
10427
10449
|
install(cfg, global) {
|
|
10428
|
-
|
|
10429
|
-
|
|
10450
|
+
const endpoint = {
|
|
10451
|
+
url: mcpEndpoint(cfg),
|
|
10452
|
+
headers: mcpHeaders(cfg.active_account?.target?.api_key)
|
|
10453
|
+
};
|
|
10430
10454
|
let configPath;
|
|
10431
10455
|
if (global) {
|
|
10432
10456
|
configPath = expandHome(opts.globalPath);
|
|
@@ -10435,8 +10459,7 @@ function createJSONProvider(opts) {
|
|
|
10435
10459
|
} else {
|
|
10436
10460
|
throw new Error(`${opts.providerName} does not support local installation`);
|
|
10437
10461
|
}
|
|
10438
|
-
|
|
10439
|
-
installJSONServer(configPath, opts.topKey, serverBuilder(cfg));
|
|
10462
|
+
installJSONServer(configPath, opts.topKey, buildServer(endpoint, cfg));
|
|
10440
10463
|
},
|
|
10441
10464
|
remove(global) {
|
|
10442
10465
|
let configPath;
|
|
@@ -10451,8 +10474,12 @@ function createJSONProvider(opts) {
|
|
|
10451
10474
|
}
|
|
10452
10475
|
};
|
|
10453
10476
|
}
|
|
10477
|
+
var defaultBuildServer = ({ url, headers }) => ({
|
|
10478
|
+
type: "http",
|
|
10479
|
+
url,
|
|
10480
|
+
headers
|
|
10481
|
+
});
|
|
10454
10482
|
var init_base = __esm(() => {
|
|
10455
|
-
init_config();
|
|
10456
10483
|
init_config_helpers();
|
|
10457
10484
|
init_detect();
|
|
10458
10485
|
});
|
|
@@ -10466,13 +10493,12 @@ var AntigravityProvider = () => createJSONProvider({
|
|
|
10466
10493
|
paths: ["~/.gemini"],
|
|
10467
10494
|
globalPath: "~/.gemini/antigravity/mcp_config.json",
|
|
10468
10495
|
topKey: "mcpServers",
|
|
10469
|
-
buildServer: (
|
|
10470
|
-
serverUrl:
|
|
10471
|
-
headers
|
|
10496
|
+
buildServer: ({ url, headers }) => ({
|
|
10497
|
+
serverUrl: url,
|
|
10498
|
+
headers
|
|
10472
10499
|
})
|
|
10473
10500
|
});
|
|
10474
10501
|
var init_antigravity = __esm(() => {
|
|
10475
|
-
init_config_helpers();
|
|
10476
10502
|
init_base();
|
|
10477
10503
|
});
|
|
10478
10504
|
|
|
@@ -10509,9 +10535,7 @@ var ClaudeDesktopProvider = () => ({
|
|
|
10509
10535
|
install(cfg, global) {
|
|
10510
10536
|
if (!global)
|
|
10511
10537
|
throw new Error("Claude Desktop does not support local installation");
|
|
10512
|
-
|
|
10513
|
-
throw new Error("deployment ID is required");
|
|
10514
|
-
const url = cfg.mode === MODE_OSS ? mcpBaseURL() : mcpURL(cfg.active_account.target.deployment_id);
|
|
10538
|
+
const url = mcpEndpoint(cfg);
|
|
10515
10539
|
const npx = findNpx();
|
|
10516
10540
|
const remote = mcpRemoteServer(url, cfg.active_account?.target?.api_key);
|
|
10517
10541
|
installJSONServer(configPath(), "mcpServers", {
|
|
@@ -10527,7 +10551,6 @@ var ClaudeDesktopProvider = () => ({
|
|
|
10527
10551
|
}
|
|
10528
10552
|
});
|
|
10529
10553
|
var init_claude_desktop = __esm(() => {
|
|
10530
|
-
init_config();
|
|
10531
10554
|
init_config_helpers();
|
|
10532
10555
|
init_detect();
|
|
10533
10556
|
});
|
|
@@ -10542,15 +10565,14 @@ var extensionDir = () => join11(appSupportDir(), "Code", "User", "globalStorage"
|
|
|
10542
10565
|
paths: [extensionDir()],
|
|
10543
10566
|
globalPath: join11(extensionDir(), "settings", "cline_mcp_settings.json"),
|
|
10544
10567
|
topKey: "mcpServers",
|
|
10545
|
-
buildServer: (
|
|
10546
|
-
url
|
|
10568
|
+
buildServer: ({ url, headers }) => ({
|
|
10569
|
+
url,
|
|
10547
10570
|
type: "streamableHttp",
|
|
10548
10571
|
disabled: false,
|
|
10549
|
-
headers
|
|
10572
|
+
headers
|
|
10550
10573
|
})
|
|
10551
10574
|
});
|
|
10552
10575
|
var init_cline = __esm(() => {
|
|
10553
|
-
init_config_helpers();
|
|
10554
10576
|
init_detect();
|
|
10555
10577
|
init_base();
|
|
10556
10578
|
});
|
|
@@ -10568,15 +10590,14 @@ var ClineCliProvider = () => createJSONProvider({
|
|
|
10568
10590
|
paths: [clineDir()],
|
|
10569
10591
|
globalPath: join12(clineDir(), "data", "settings", "cline_mcp_settings.json"),
|
|
10570
10592
|
topKey: "mcpServers",
|
|
10571
|
-
buildServer: (
|
|
10572
|
-
url
|
|
10593
|
+
buildServer: ({ url, headers }) => ({
|
|
10594
|
+
url,
|
|
10573
10595
|
type: "streamableHttp",
|
|
10574
10596
|
disabled: false,
|
|
10575
|
-
headers
|
|
10597
|
+
headers
|
|
10576
10598
|
})
|
|
10577
10599
|
});
|
|
10578
10600
|
var init_cline_cli = __esm(() => {
|
|
10579
|
-
init_config_helpers();
|
|
10580
10601
|
init_detect();
|
|
10581
10602
|
init_base();
|
|
10582
10603
|
});
|
|
@@ -10600,13 +10621,6 @@ function readTOML(path3) {
|
|
|
10600
10621
|
function writeTOML(path3, content) {
|
|
10601
10622
|
writeSecureFile(path3, content);
|
|
10602
10623
|
}
|
|
10603
|
-
function mcpEndpoint(cfg) {
|
|
10604
|
-
if (cfg.mode === MODE_OSS)
|
|
10605
|
-
return mcpBaseURL();
|
|
10606
|
-
if (!cfg.active_account?.target?.deployment_id)
|
|
10607
|
-
throw new Error("deployment ID is required");
|
|
10608
|
-
return mcpURL(cfg.active_account?.target?.deployment_id);
|
|
10609
|
-
}
|
|
10610
10624
|
function tomlString(value) {
|
|
10611
10625
|
return `"${value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
10612
10626
|
}
|
|
@@ -10689,13 +10703,6 @@ function globalPath() {
|
|
|
10689
10703
|
}
|
|
10690
10704
|
return expandHome("~/.copilot/mcp-config.json");
|
|
10691
10705
|
}
|
|
10692
|
-
function mcpEndpoint2(cfg) {
|
|
10693
|
-
if (cfg.mode === MODE_OSS)
|
|
10694
|
-
return mcpBaseURL();
|
|
10695
|
-
if (!cfg.active_account?.target?.deployment_id)
|
|
10696
|
-
throw new Error("deployment ID is required");
|
|
10697
|
-
return mcpURL(cfg.active_account?.target?.deployment_id);
|
|
10698
|
-
}
|
|
10699
10706
|
var CopilotProvider = () => ({
|
|
10700
10707
|
name: () => "GitHub Copilot CLI",
|
|
10701
10708
|
id: () => "copilot",
|
|
@@ -10706,7 +10713,7 @@ var CopilotProvider = () => ({
|
|
|
10706
10713
|
globalConfigPath: () => globalPath(),
|
|
10707
10714
|
isConfigured: () => isJSONKeyConfigured(globalPath(), "mcpServers"),
|
|
10708
10715
|
install(cfg, global) {
|
|
10709
|
-
const url =
|
|
10716
|
+
const url = mcpEndpoint(cfg);
|
|
10710
10717
|
if (global) {
|
|
10711
10718
|
const server = {
|
|
10712
10719
|
type: "http",
|
|
@@ -10735,7 +10742,6 @@ var CopilotProvider = () => ({
|
|
|
10735
10742
|
}
|
|
10736
10743
|
});
|
|
10737
10744
|
var init_copilot = __esm(() => {
|
|
10738
|
-
init_config();
|
|
10739
10745
|
init_config_helpers();
|
|
10740
10746
|
init_detect();
|
|
10741
10747
|
});
|
|
@@ -10750,14 +10756,13 @@ var CursorProvider = () => createJSONProvider({
|
|
|
10750
10756
|
paths: ["~/.cursor"],
|
|
10751
10757
|
globalPath: "~/.cursor/mcp.json",
|
|
10752
10758
|
topKey: "mcpServers",
|
|
10753
|
-
buildServer: (
|
|
10754
|
-
url
|
|
10755
|
-
headers
|
|
10759
|
+
buildServer: ({ url, headers }) => ({
|
|
10760
|
+
url,
|
|
10761
|
+
headers
|
|
10756
10762
|
}),
|
|
10757
10763
|
localConfigPath: (cwd) => join15(cwd, ".cursor", "mcp.json")
|
|
10758
10764
|
});
|
|
10759
10765
|
var init_cursor = __esm(() => {
|
|
10760
|
-
init_config_helpers();
|
|
10761
10766
|
init_base();
|
|
10762
10767
|
});
|
|
10763
10768
|
|
|
@@ -10794,13 +10799,6 @@ var init_gemini = __esm(() => {
|
|
|
10794
10799
|
});
|
|
10795
10800
|
|
|
10796
10801
|
// src/mcp/providers/manual.ts
|
|
10797
|
-
function mcpEndpoint3(cfg) {
|
|
10798
|
-
if (cfg.mode === MODE_OSS)
|
|
10799
|
-
return mcpBaseURL();
|
|
10800
|
-
if (!cfg.active_account?.target?.deployment_id)
|
|
10801
|
-
throw new Error("deployment ID is required");
|
|
10802
|
-
return mcpURL(cfg.active_account?.target?.deployment_id);
|
|
10803
|
-
}
|
|
10804
10802
|
function maskSecret(secret) {
|
|
10805
10803
|
if (secret.length <= 8)
|
|
10806
10804
|
return "[hidden]";
|
|
@@ -10812,7 +10810,7 @@ var ManualProvider = () => ({
|
|
|
10812
10810
|
id: () => "manual",
|
|
10813
10811
|
supportsLocal: () => false,
|
|
10814
10812
|
install(cfg, _global, opts = {}) {
|
|
10815
|
-
const url =
|
|
10813
|
+
const url = mcpEndpoint(cfg);
|
|
10816
10814
|
const apiKey = mcpHeaders(cfg.active_account?.target?.api_key)["X-Dosu-API-Key"];
|
|
10817
10815
|
const headerValue = opts.showSecret ? apiKey : maskSecret(apiKey);
|
|
10818
10816
|
console.log("Use these details to configure the Dosu MCP server in your client:");
|
|
@@ -10832,7 +10830,6 @@ To remove the Dosu MCP server, manually delete the configuration from your clien
|
|
|
10832
10830
|
}
|
|
10833
10831
|
});
|
|
10834
10832
|
var init_manual = __esm(() => {
|
|
10835
|
-
init_config();
|
|
10836
10833
|
init_config_helpers();
|
|
10837
10834
|
});
|
|
10838
10835
|
|
|
@@ -10848,13 +10845,6 @@ function resolveGlobalConfigPath() {
|
|
|
10848
10845
|
return jsoncPath;
|
|
10849
10846
|
return jsonPath;
|
|
10850
10847
|
}
|
|
10851
|
-
function mcpEndpoint4(cfg) {
|
|
10852
|
-
if (cfg.mode === MODE_OSS)
|
|
10853
|
-
return mcpBaseURL();
|
|
10854
|
-
if (!cfg.active_account?.target?.deployment_id)
|
|
10855
|
-
throw new Error("deployment ID is required");
|
|
10856
|
-
return mcpURL(cfg.active_account?.target?.deployment_id);
|
|
10857
|
-
}
|
|
10858
10848
|
var MCPorterProvider = () => ({
|
|
10859
10849
|
name: () => "MCPorter",
|
|
10860
10850
|
id: () => "mcporter",
|
|
@@ -10868,7 +10858,7 @@ var MCPorterProvider = () => ({
|
|
|
10868
10858
|
const configPath2 = global ? resolveGlobalConfigPath() : join18(process.cwd(), "config", "mcporter.json");
|
|
10869
10859
|
const server = {
|
|
10870
10860
|
type: "http",
|
|
10871
|
-
url:
|
|
10861
|
+
url: mcpEndpoint(cfg),
|
|
10872
10862
|
headers: mcpHeaders(cfg.active_account.target.api_key)
|
|
10873
10863
|
};
|
|
10874
10864
|
installJSONServer(configPath2, "mcpServers", server);
|
|
@@ -10879,7 +10869,6 @@ var MCPorterProvider = () => ({
|
|
|
10879
10869
|
}
|
|
10880
10870
|
});
|
|
10881
10871
|
var init_mcporter = __esm(() => {
|
|
10882
|
-
init_config();
|
|
10883
10872
|
init_config_helpers();
|
|
10884
10873
|
init_detect();
|
|
10885
10874
|
});
|
|
@@ -10894,16 +10883,15 @@ var OpenCodeProvider = () => createJSONProvider({
|
|
|
10894
10883
|
paths: ["~/.config/opencode"],
|
|
10895
10884
|
globalPath: "~/.config/opencode/opencode.json",
|
|
10896
10885
|
topKey: "mcp",
|
|
10897
|
-
buildServer: (
|
|
10886
|
+
buildServer: ({ url, headers }) => ({
|
|
10898
10887
|
type: "remote",
|
|
10899
|
-
url
|
|
10888
|
+
url,
|
|
10900
10889
|
enabled: true,
|
|
10901
|
-
headers
|
|
10890
|
+
headers
|
|
10902
10891
|
}),
|
|
10903
10892
|
localConfigPath: (cwd) => join19(cwd, "opencode.json")
|
|
10904
10893
|
});
|
|
10905
10894
|
var init_opencode = __esm(() => {
|
|
10906
|
-
init_config_helpers();
|
|
10907
10895
|
init_base();
|
|
10908
10896
|
});
|
|
10909
10897
|
|
|
@@ -10941,30 +10929,73 @@ var init_windsurf = __esm(() => {
|
|
|
10941
10929
|
});
|
|
10942
10930
|
|
|
10943
10931
|
// src/mcp/providers/zed.ts
|
|
10944
|
-
import {
|
|
10932
|
+
import { rmSync as rmSync2 } from "node:fs";
|
|
10933
|
+
import { homedir as homedir4, platform as platform3 } from "node:os";
|
|
10945
10934
|
import { join as join22 } from "node:path";
|
|
10946
10935
|
function zedConfigDir() {
|
|
10947
10936
|
const os2 = platform3();
|
|
10948
|
-
if (os2 === "
|
|
10937
|
+
if (os2 === "win32")
|
|
10949
10938
|
return join22(appSupportDir(), "Zed");
|
|
10939
|
+
if (os2 === "darwin")
|
|
10940
|
+
return join22(homedir4(), ".config", "zed");
|
|
10950
10941
|
return join22(appSupportDir(), "zed");
|
|
10951
10942
|
}
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
}
|
|
10943
|
+
function zedDataDir() {
|
|
10944
|
+
const os2 = platform3();
|
|
10945
|
+
if (os2 === "darwin")
|
|
10946
|
+
return join22(appSupportDir(), "Zed");
|
|
10947
|
+
if (os2 === "win32")
|
|
10948
|
+
return join22(process.env.LOCALAPPDATA ?? "", "Zed");
|
|
10949
|
+
return join22(process.env.XDG_DATA_HOME ?? join22(homedir4(), ".local", "share"), "zed");
|
|
10950
|
+
}
|
|
10951
|
+
function legacyDarwinSettingsPath() {
|
|
10952
|
+
return platform3() === "darwin" ? join22(appSupportDir(), "Zed", "settings.json") : null;
|
|
10953
|
+
}
|
|
10954
|
+
function removeLegacyDosuEntry(path3) {
|
|
10955
|
+
let cfg;
|
|
10956
|
+
try {
|
|
10957
|
+
cfg = readJSONConfig(path3);
|
|
10958
|
+
} catch {
|
|
10959
|
+
return;
|
|
10960
|
+
}
|
|
10961
|
+
const servers = cfg.context_servers;
|
|
10962
|
+
if (typeof servers !== "object" || servers === null || !("dosu" in servers))
|
|
10963
|
+
return;
|
|
10964
|
+
delete servers.dosu;
|
|
10965
|
+
const nothingElse = Object.keys(cfg).length === 1 && Object.keys(servers).length === 0;
|
|
10966
|
+
if (nothingElse)
|
|
10967
|
+
rmSync2(path3, { force: true });
|
|
10968
|
+
else
|
|
10969
|
+
saveJSONConfig(path3, cfg);
|
|
10970
|
+
}
|
|
10971
|
+
var ZedProvider = (legacyPath = legacyDarwinSettingsPath()) => {
|
|
10972
|
+
const provider = createJSONProvider({
|
|
10973
|
+
providerName: "Zed",
|
|
10974
|
+
providerID: "zed",
|
|
10975
|
+
local: true,
|
|
10976
|
+
priorityValue: 10,
|
|
10977
|
+
paths: [zedConfigDir(), zedDataDir()],
|
|
10978
|
+
globalPath: join22(zedConfigDir(), "settings.json"),
|
|
10979
|
+
topKey: "context_servers",
|
|
10980
|
+
buildServer: ({ url, headers }) => ({ url, headers }),
|
|
10981
|
+
localConfigPath: (cwd) => join22(cwd, ".zed", "settings.json")
|
|
10982
|
+
});
|
|
10983
|
+
if (!legacyPath)
|
|
10984
|
+
return provider;
|
|
10985
|
+
return {
|
|
10986
|
+
...provider,
|
|
10987
|
+
install(cfg, global) {
|
|
10988
|
+
provider.install(cfg, global);
|
|
10989
|
+
if (global)
|
|
10990
|
+
removeLegacyDosuEntry(legacyPath);
|
|
10991
|
+
},
|
|
10992
|
+
remove(global) {
|
|
10993
|
+
provider.remove(global);
|
|
10994
|
+
if (global)
|
|
10995
|
+
removeLegacyDosuEntry(legacyPath);
|
|
10996
|
+
}
|
|
10997
|
+
};
|
|
10998
|
+
};
|
|
10968
10999
|
var init_zed = __esm(() => {
|
|
10969
11000
|
init_config_helpers();
|
|
10970
11001
|
init_detect();
|
|
@@ -11023,13 +11054,13 @@ var init_providers = __esm(() => {
|
|
|
11023
11054
|
|
|
11024
11055
|
// src/rules/installer.ts
|
|
11025
11056
|
import { existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync10, unlinkSync as unlinkSync2, writeFileSync as writeFileSync7 } from "node:fs";
|
|
11026
|
-
import { homedir as
|
|
11057
|
+
import { homedir as homedir5 } from "node:os";
|
|
11027
11058
|
import { dirname as dirname4, join as join23 } from "node:path";
|
|
11028
11059
|
function claudeConfigDir() {
|
|
11029
|
-
return process.env.CLAUDE_CONFIG_DIR || join23(
|
|
11060
|
+
return process.env.CLAUDE_CONFIG_DIR || join23(homedir5(), ".claude");
|
|
11030
11061
|
}
|
|
11031
11062
|
function codexHome2() {
|
|
11032
|
-
return process.env.CODEX_HOME || join23(
|
|
11063
|
+
return process.env.CODEX_HOME || join23(homedir5(), ".codex");
|
|
11033
11064
|
}
|
|
11034
11065
|
function isRuleAgent(agent) {
|
|
11035
11066
|
return Object.hasOwn(RULE_TARGETS, agent);
|
|
@@ -11175,7 +11206,7 @@ var init_installer = __esm(() => {
|
|
|
11175
11206
|
},
|
|
11176
11207
|
cursor: {
|
|
11177
11208
|
kind: "file",
|
|
11178
|
-
path: () => join23(
|
|
11209
|
+
path: () => join23(homedir5(), ".cursor", "rules", "dosu.mdc"),
|
|
11179
11210
|
cursorFrontmatter: true
|
|
11180
11211
|
},
|
|
11181
11212
|
codex: {
|
|
@@ -11184,15 +11215,15 @@ var init_installer = __esm(() => {
|
|
|
11184
11215
|
},
|
|
11185
11216
|
opencode: {
|
|
11186
11217
|
kind: "section",
|
|
11187
|
-
path: () => join23(
|
|
11218
|
+
path: () => join23(homedir5(), ".config", "opencode", "AGENTS.md")
|
|
11188
11219
|
},
|
|
11189
11220
|
gemini: {
|
|
11190
11221
|
kind: "section",
|
|
11191
|
-
path: () => join23(
|
|
11222
|
+
path: () => join23(homedir5(), ".gemini", "GEMINI.md")
|
|
11192
11223
|
},
|
|
11193
11224
|
antigravity: {
|
|
11194
11225
|
kind: "section",
|
|
11195
|
-
path: () => join23(
|
|
11226
|
+
path: () => join23(homedir5(), ".gemini", "GEMINI.md")
|
|
11196
11227
|
}
|
|
11197
11228
|
};
|
|
11198
11229
|
});
|
|
@@ -11444,7 +11475,7 @@ var init_settings = __esm(() => {
|
|
|
11444
11475
|
});
|
|
11445
11476
|
|
|
11446
11477
|
// src/telemetry/debug-id.ts
|
|
11447
|
-
var BUNDLE_DEBUG_ID_PLACEHOLDER = "
|
|
11478
|
+
var BUNDLE_DEBUG_ID_PLACEHOLDER = "222d1353-0757-fab1-6475-6e2164756e21";
|
|
11448
11479
|
|
|
11449
11480
|
// src/telemetry/telemetry.ts
|
|
11450
11481
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
@@ -12497,7 +12528,7 @@ var init_agent_kickoff = __esm(() => {
|
|
|
12497
12528
|
|
|
12498
12529
|
// src/setup/logs-handoff.ts
|
|
12499
12530
|
import { existsSync as existsSync15, readdirSync, statSync as statSync3 } from "node:fs";
|
|
12500
|
-
import { homedir as
|
|
12531
|
+
import { homedir as homedir6 } from "node:os";
|
|
12501
12532
|
import { join as join26 } from "node:path";
|
|
12502
12533
|
function countJsonlFiles(root, cap = COUNT_CAP) {
|
|
12503
12534
|
if (!existsSync15(root))
|
|
@@ -12527,7 +12558,7 @@ function countJsonlFiles(root, cap = COUNT_CAP) {
|
|
|
12527
12558
|
}
|
|
12528
12559
|
return { count, capped: false };
|
|
12529
12560
|
}
|
|
12530
|
-
function detectLogSources(home = process.env.HOME ||
|
|
12561
|
+
function detectLogSources(home = process.env.HOME || homedir6()) {
|
|
12531
12562
|
const roots = {
|
|
12532
12563
|
cursor: join26(home, ".cursor", "projects"),
|
|
12533
12564
|
claude: join26(home, ".claude", "projects"),
|
|
@@ -17498,7 +17529,7 @@ init_skill();
|
|
|
17498
17529
|
var import_picocolors26 = __toESM(require_picocolors(), 1);
|
|
17499
17530
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
17500
17531
|
import { realpathSync } from "node:fs";
|
|
17501
|
-
import { homedir as
|
|
17532
|
+
import { homedir as homedir7 } from "node:os";
|
|
17502
17533
|
import { posix, win32 } from "node:path";
|
|
17503
17534
|
var PACKAGE_NAME = "@dosu/cli";
|
|
17504
17535
|
var LATEST_PACKAGE = `${PACKAGE_NAME}@latest`;
|
|
@@ -17575,7 +17606,7 @@ function packageRoots(manager, platform4, comSpec, env, cwd) {
|
|
|
17575
17606
|
manager === "npm" ? path3.join(lines[0], "@dosu", "cli") : path3.join(lines[0], "node_modules", "@dosu", "cli")
|
|
17576
17607
|
];
|
|
17577
17608
|
}
|
|
17578
|
-
function owningPackageManager(entrypoint, platform4, comSpec, env = process.env, cwd =
|
|
17609
|
+
function owningPackageManager(entrypoint, platform4, comSpec, env = process.env, cwd = homedir7()) {
|
|
17579
17610
|
const path3 = platform4 === "win32" ? win32 : posix;
|
|
17580
17611
|
if (!entrypoint || !path3.isAbsolute(entrypoint))
|
|
17581
17612
|
return null;
|
|
@@ -17628,7 +17659,7 @@ Or install Dosu globally with your package manager:`);
|
|
|
17628
17659
|
function runUpgrade(channel = INSTALL_CHANNEL, options = {}) {
|
|
17629
17660
|
const platform4 = options.platform ?? process.platform;
|
|
17630
17661
|
const env = options.env ?? process.env;
|
|
17631
|
-
const cwd = options.cwd ??
|
|
17662
|
+
const cwd = options.cwd ?? homedir7();
|
|
17632
17663
|
let manager = null;
|
|
17633
17664
|
if (channel === "npm") {
|
|
17634
17665
|
if (isNpxInvocation(channel, env)) {
|
|
@@ -18350,4 +18381,4 @@ execute().catch((err) => {
|
|
|
18350
18381
|
process.exit(1);
|
|
18351
18382
|
});
|
|
18352
18383
|
|
|
18353
|
-
//# debugId=
|
|
18384
|
+
//# debugId=222d1353-0757-fab1-6475-6e2164756e21
|