@dosu/cli 0.53.0 → 0.53.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.
Files changed (2) hide show
  1. package/bin/dosu.js +70 -18
  2. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -5018,7 +5018,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
5018
5018
  function getVersionString() {
5019
5019
  return `v${VERSION}`;
5020
5020
  }
5021
- var VERSION = "0.53.0", INSTALL_CHANNEL = "npm";
5021
+ var VERSION = "0.53.1", INSTALL_CHANNEL = "npm";
5022
5022
 
5023
5023
  // src/debug/logger.ts
5024
5024
  import {
@@ -73567,7 +73567,7 @@ var init_settings = __esm(() => {
73567
73567
  });
73568
73568
 
73569
73569
  // src/telemetry/debug-id.ts
73570
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "e98d2bf5-99f8-402d-6475-6e2164756e21";
73570
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "5776df20-501e-ff5f-6475-6e2164756e21";
73571
73571
 
73572
73572
  // src/telemetry/telemetry.ts
73573
73573
  import { randomUUID as randomUUID4 } from "node:crypto";
@@ -74538,7 +74538,7 @@ var init_cline_cli = __esm(() => {
74538
74538
 
74539
74539
  // src/mcp/providers/codex.ts
74540
74540
  import { existsSync as existsSync20, readFileSync as readFileSync20 } from "node:fs";
74541
- import { join as join27 } from "node:path";
74541
+ import { dirname as dirname9, join as join27 } from "node:path";
74542
74542
  function codexHome2() {
74543
74543
  return process.env.CODEX_HOME ?? expandHome("~/.codex");
74544
74544
  }
@@ -74578,19 +74578,24 @@ ${envEntries}
74578
74578
  content += section;
74579
74579
  writeTOML(path3, content);
74580
74580
  }
74581
+ function sectionName(line) {
74582
+ const header = line.trim();
74583
+ const match = header.match(/^\[\[([^\]]*)]]\s*(?:#.*)?$/) ?? header.match(/^\[([^\]]*)]\s*(?:#.*)?$/);
74584
+ return match ? match[1].trim() : null;
74585
+ }
74586
+ function isDosuSection(name) {
74587
+ return name === "mcp_servers.dosu" || name.startsWith("mcp_servers.dosu.");
74588
+ }
74581
74589
  function removeDosuFromTOML(content) {
74582
- const lines = content.split(`
74583
- `);
74584
74590
  const result = [];
74585
74591
  let inDosuSection = false;
74586
- for (const line of lines) {
74587
- const trimmed = line.trim();
74588
- if (trimmed.match(/^\[mcp_servers\.dosu(\..*)?]$/)) {
74589
- inDosuSection = true;
74590
- continue;
74591
- }
74592
- if (inDosuSection && trimmed.startsWith("[")) {
74593
- inDosuSection = false;
74592
+ for (const line of content.split(`
74593
+ `)) {
74594
+ const name = sectionName(line);
74595
+ if (name !== null) {
74596
+ inDosuSection = isDosuSection(name);
74597
+ if (inDosuSection)
74598
+ continue;
74594
74599
  }
74595
74600
  if (!inDosuSection) {
74596
74601
  result.push(line);
@@ -74599,7 +74604,45 @@ function removeDosuFromTOML(content) {
74599
74604
  return result.join(`
74600
74605
  `);
74601
74606
  }
74602
- var CodexProvider = () => ({
74607
+ function hasRemoteHTTPForm(content) {
74608
+ let inDosuRoot = false;
74609
+ for (const line of content.split(`
74610
+ `)) {
74611
+ const name = sectionName(line);
74612
+ if (name !== null) {
74613
+ if (name === "mcp_servers.dosu.http_headers")
74614
+ return true;
74615
+ inDosuRoot = name === "mcp_servers.dosu";
74616
+ continue;
74617
+ }
74618
+ if (inDosuRoot && REMOTE_HTTP_KEY.test(line.trim()))
74619
+ return true;
74620
+ }
74621
+ return false;
74622
+ }
74623
+ function projectConfigPaths() {
74624
+ const cwd = process.cwd();
74625
+ const chain = [];
74626
+ for (let dir = cwd;; ) {
74627
+ chain.push(dir);
74628
+ if (existsSync20(join27(dir, ".git")))
74629
+ break;
74630
+ const parent = dirname9(dir);
74631
+ if (parent === dir)
74632
+ return [join27(cwd, ".codex", "config.toml")];
74633
+ dir = parent;
74634
+ }
74635
+ return chain.reverse().map((dir) => join27(dir, ".codex", "config.toml"));
74636
+ }
74637
+ function pruneLegacyRemoteEntry(path3) {
74638
+ if (!existsSync20(path3))
74639
+ return;
74640
+ const content = readTOML(path3);
74641
+ if (!hasRemoteHTTPForm(content))
74642
+ return;
74643
+ writeTOML(path3, removeDosuFromTOML(content));
74644
+ }
74645
+ var REMOTE_HTTP_KEY, CodexProvider = () => ({
74603
74646
  name: () => "Codex (CLI + Desktop)",
74604
74647
  id: () => "codex",
74605
74648
  supportsLocal: () => true,
@@ -74614,7 +74657,15 @@ var CodexProvider = () => ({
74614
74657
  install(cfg, global2) {
74615
74658
  if (cfg.mode !== MODE_OSS && !cfg.active_account?.target?.deployment_id)
74616
74659
  throw new Error("deployment ID is required");
74617
- installDosuToTOML(getConfigPath2(global2), cfg);
74660
+ if (!global2 && hasRemoteHTTPForm(readTOML(getConfigPath2(true)))) {
74661
+ throw new Error("the global Codex config still holds the legacy remote-HTTP Dosu entry, which Codex would " + "merge with a project-local entry and reject. Migrate it first with " + "`dosu mcp add codex --global`, then re-run this.");
74662
+ }
74663
+ const written = getConfigPath2(global2);
74664
+ installDosuToTOML(written, cfg);
74665
+ for (const path3 of projectConfigPaths()) {
74666
+ if (path3 !== written)
74667
+ pruneLegacyRemoteEntry(path3);
74668
+ }
74618
74669
  },
74619
74670
  remove(global2) {
74620
74671
  const path3 = getConfigPath2(global2);
@@ -74627,6 +74678,7 @@ var init_codex = __esm(() => {
74627
74678
  init_config();
74628
74679
  init_config_helpers();
74629
74680
  init_detect();
74681
+ REMOTE_HTTP_KEY = /^(url|type|bearer_token_env_var)\s*=/;
74630
74682
  });
74631
74683
 
74632
74684
  // src/mcp/providers/copilot.ts
@@ -75144,7 +75196,7 @@ var init_update_check = __esm(() => {
75144
75196
  // src/rules/installer.ts
75145
75197
  import { existsSync as existsSync23, mkdirSync as mkdirSync13, readFileSync as readFileSync22, unlinkSync as unlinkSync4, writeFileSync as writeFileSync14 } from "node:fs";
75146
75198
  import { homedir as homedir10 } from "node:os";
75147
- import { dirname as dirname9, join as join38 } from "node:path";
75199
+ import { dirname as dirname10, join as join38 } from "node:path";
75148
75200
  function claudeConfigDir() {
75149
75201
  return process.env.CLAUDE_CONFIG_DIR || join38(homedir10(), ".claude");
75150
75202
  }
@@ -75175,7 +75227,7 @@ async function fetchDosuRule(fetchImpl = globalThis.fetch) {
75175
75227
  return normalizeRule(FALLBACK_DOSU_RULE);
75176
75228
  }
75177
75229
  function ensureParent(path3) {
75178
- mkdirSync13(dirname9(path3), { recursive: true });
75230
+ mkdirSync13(dirname10(path3), { recursive: true });
75179
75231
  }
75180
75232
  function writeIfChanged(path3, content) {
75181
75233
  if (!existsSync23(path3)) {
@@ -84936,4 +84988,4 @@ execute().catch((err) => {
84936
84988
  process.exit(1);
84937
84989
  });
84938
84990
 
84939
- //# debugId=e98d2bf5-99f8-402d-6475-6e2164756e21
84991
+ //# debugId=5776df20-501e-ff5f-6475-6e2164756e21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosu/cli",
3
- "version": "0.53.0",
3
+ "version": "0.53.1",
4
4
  "type": "module",
5
5
  "description": "Dosu CLI - Manage MCP servers for AI tools",
6
6
  "license": "MIT",