@dosu/cli 0.67.0-beta.2 → 0.67.0-beta.4

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 (3) hide show
  1. package/README.md +6 -11
  2. package/bin/dosu.js +212 -501
  3. package/package.json +1 -1
package/bin/dosu.js CHANGED
@@ -450,7 +450,7 @@ function isNpxInvocation(channel = INSTALL_CHANNEL, env = process.env) {
450
450
  function getVersionString() {
451
451
  return `v${VERSION}`;
452
452
  }
453
- var VERSION = "0.67.0-beta.2", INSTALL_CHANNEL = "npm";
453
+ var VERSION = "0.67.0-beta.4", INSTALL_CHANNEL = "npm";
454
454
 
455
455
  // src/debug/logger.ts
456
456
  import {
@@ -602,22 +602,6 @@ function expandHome(path) {
602
602
  return path;
603
603
  return join3(homedir2(), path.slice(1));
604
604
  }
605
- function appSupportDir() {
606
- switch (platform()) {
607
- case "darwin": {
608
- return join3(homedir2(), "Library", "Application Support");
609
- }
610
- case "win32": {
611
- return process.env.APPDATA ?? "";
612
- }
613
- default: {
614
- const xdg = process.env.XDG_CONFIG_HOME;
615
- if (xdg)
616
- return xdg;
617
- return join3(homedir2(), ".config");
618
- }
619
- }
620
- }
621
605
  function allOnPath(name) {
622
606
  return (process.env.PATH ?? "").split(delimiter).filter(Boolean).map((dir) => join3(dir, name)).filter((candidate) => existsSync3(candidate));
623
607
  }
@@ -9415,18 +9399,26 @@ function groupedAgent(options) {
9415
9399
  }
9416
9400
  function cursorAgent() {
9417
9401
  const configPath = () => expandHome("~/.cursor/hooks.json");
9402
+ const has = (event) => hasCursorHook(readHookConfig(configPath()), event);
9418
9403
  return {
9419
9404
  id: () => "cursor",
9420
9405
  name: () => "Cursor",
9421
9406
  isInstalled: () => isInstalled(["~/.cursor"]),
9422
9407
  configPath,
9423
- isEnabled: () => hasCursorHook(readHookConfig(configPath()), CURSOR_EVENT),
9408
+ isEnabled: () => has(CURSOR_EVENT),
9424
9409
  enable: () => {
9425
- writeHookConfig(configPath(), addCursorHook(readHookConfig(configPath()), CURSOR_EVENT));
9410
+ let config = readHookConfig(configPath());
9411
+ config = addCursorHook(config, CURSOR_EVENT);
9412
+ config = addCursorHook(config, CURSOR_END_EVENT);
9413
+ writeHookConfig(configPath(), config);
9426
9414
  },
9427
9415
  disable: () => {
9428
- writeHookConfig(configPath(), removeCursorHook(readHookConfig(configPath()), CURSOR_EVENT));
9429
- }
9416
+ let config = readHookConfig(configPath());
9417
+ config = removeCursorHook(config, CURSOR_EVENT);
9418
+ config = removeCursorHook(config, CURSOR_END_EVENT);
9419
+ writeHookConfig(configPath(), config);
9420
+ },
9421
+ statusNote: () => has(CURSOR_END_EVENT) ? "" : "The sessionEnd hook is missing, so sessions ship only once quiet; 'dosu knowledge hooks enable cursor' adds it."
9430
9422
  };
9431
9423
  }
9432
9424
  function claudeAgent() {
@@ -9503,7 +9495,7 @@ function refreshEnabledHooks() {
9503
9495
  }
9504
9496
  return refreshed;
9505
9497
  }
9506
- var CURSOR_EVENT = "stop";
9498
+ var CURSOR_EVENT = "stop", CURSOR_END_EVENT = "sessionEnd";
9507
9499
  var init_agents2 = __esm(() => {
9508
9500
  init_logger();
9509
9501
  init_agents();
@@ -16200,76 +16192,6 @@ var init_ask = __esm(() => {
16200
16192
  import_picocolors7 = __toESM(require_picocolors(), 1);
16201
16193
  });
16202
16194
 
16203
- // src/setup/styles.ts
16204
- import { stripVTControlCharacters as stripVTControlCharacters4 } from "node:util";
16205
- function hasTruecolor() {
16206
- return /truecolor|24bit/i.test(process.env.COLORTERM ?? "");
16207
- }
16208
- function brand(msg) {
16209
- if (!import_picocolors8.default.isColorSupported)
16210
- return msg;
16211
- return hasTruecolor() ? `${BRAND_FG}${msg}${RESET_FG}` : import_picocolors8.default.green(msg);
16212
- }
16213
- function brandBadge(msg) {
16214
- if (!import_picocolors8.default.isColorSupported)
16215
- return `[ ${msg} ]`;
16216
- const label = import_picocolors8.default.bold(` ${msg} `);
16217
- return hasTruecolor() ? `${BRAND_BG}${INK_FG}${label}${RESET_FG}${RESET_BG}` : import_picocolors8.default.bgGreen(import_picocolors8.default.black(label));
16218
- }
16219
- function dim(msg) {
16220
- return import_picocolors8.default.dim(msg);
16221
- }
16222
- function formatSetupSummary(title, items, marker = IconAdd) {
16223
- const styled = marker === IconRemove ? import_picocolors8.default.red(marker) : brand(marker);
16224
- const lines = items.map((item) => {
16225
- const path = `${item.path}${item.status ? ` (${item.status})` : ""}`;
16226
- return item.label ? `${styled} ${item.label}
16227
- ${dim(path)}` : `${styled} ${dim(path)}`;
16228
- });
16229
- return `${title}
16230
- ${lines.join(`
16231
- `)}`;
16232
- }
16233
- function browserFallbackHint(url) {
16234
- return dim(`If your browser doesn't open automatically, visit:
16235
- ${url}`);
16236
- }
16237
- function info(msg) {
16238
- return import_picocolors8.default.cyan(msg);
16239
- }
16240
- function visibleWidth(text) {
16241
- return stripVTControlCharacters4(text).length;
16242
- }
16243
- function wrapLog(text, columns = process.stdout.columns || 80) {
16244
- const width = Math.max(20, columns - LOG_GUTTER);
16245
- const out = [];
16246
- for (const paragraph of text.split(`
16247
- `)) {
16248
- if (visibleWidth(paragraph) <= width) {
16249
- out.push(paragraph);
16250
- continue;
16251
- }
16252
- let line = "";
16253
- for (const word of paragraph.split(" ")) {
16254
- if (line === "") {
16255
- line = word;
16256
- } else if (visibleWidth(line) + 1 + visibleWidth(word) <= width) {
16257
- line = `${line} ${word}`;
16258
- } else {
16259
- out.push(line);
16260
- line = word;
16261
- }
16262
- }
16263
- out.push(line);
16264
- }
16265
- return out.join(`
16266
- `);
16267
- }
16268
- var import_picocolors8, IconAdd = "✔", IconRemove = "-", BRAND_FG = "\x1B[38;2;82;164;15m", BRAND_BG = "\x1B[48;2;82;164;15m", INK_FG = "\x1B[38;2;14;14;14m", RESET_FG = "\x1B[39m", RESET_BG = "\x1B[49m", LOG_GUTTER = 4;
16269
- var init_styles = __esm(() => {
16270
- import_picocolors8 = __toESM(require_picocolors(), 1);
16271
- });
16272
-
16273
16195
  // src/tui/layout.ts
16274
16196
  function contentWidth(columns = process.stdout.columns ?? 80) {
16275
16197
  return Math.min(columns, CONTENT_WIDTH);
@@ -16289,9 +16211,9 @@ function breadcrumb(segments, width = contentWidth()) {
16289
16211
  const trailWidth = head.reduce((total, segment) => total + segment.length + 3, 0);
16290
16212
  const room = Math.max(8, width - trailWidth);
16291
16213
  const clipped = leaf.length <= room ? leaf : `${leaf.slice(0, room - 1)}…`;
16292
- return head.map((segment) => import_picocolors9.default.dim(`${segment} › `)).join("") + import_picocolors9.default.bold(clipped);
16214
+ return head.map((segment) => import_picocolors8.default.dim(`${segment} › `)).join("") + import_picocolors8.default.bold(clipped);
16293
16215
  }
16294
- function visibleWidth2(text) {
16216
+ function visibleWidth(text) {
16295
16217
  return text.replace(ANSI_PATTERN2, "").length;
16296
16218
  }
16297
16219
  function tabStrip(labels, active, width, { spread = true } = {}) {
@@ -16302,8 +16224,8 @@ function tabStrip(labels, active, width, { spread = true } = {}) {
16302
16224
  for (const [id, label] of labels) {
16303
16225
  const left = Math.floor((cellW - label.length) / 2);
16304
16226
  const cell = " ".repeat(left) + label + " ".repeat(cellW - label.length - left);
16305
- row += id === active ? brand(import_picocolors9.default.bold(cell)) : import_picocolors9.default.dim(cell);
16306
- rule += id === active ? brand("━".repeat(cellW)) : import_picocolors9.default.dim("─".repeat(cellW));
16227
+ row += id === active ? brand(import_picocolors8.default.bold(cell)) : import_picocolors8.default.dim(cell);
16228
+ rule += id === active ? brand("━".repeat(cellW)) : import_picocolors8.default.dim("─".repeat(cellW));
16307
16229
  }
16308
16230
  return [row, rule];
16309
16231
  }
@@ -16326,18 +16248,18 @@ function tabStrip(labels, active, width, { spread = true } = {}) {
16326
16248
  if (id === active) {
16327
16249
  activeStart = col;
16328
16250
  activeLen = label.length;
16329
- row += brand(import_picocolors9.default.bold(label));
16251
+ row += brand(import_picocolors8.default.bold(label));
16330
16252
  } else {
16331
- row += import_picocolors9.default.dim(label);
16253
+ row += import_picocolors8.default.dim(label);
16332
16254
  }
16333
16255
  col += label.length;
16334
16256
  });
16335
16257
  const tail = Math.max(0, width - activeStart - activeLen);
16336
- const rule = import_picocolors9.default.dim("─".repeat(activeStart)) + brand("━".repeat(activeLen)) + import_picocolors9.default.dim("─".repeat(tail));
16258
+ const rule = import_picocolors8.default.dim("─".repeat(activeStart)) + brand("━".repeat(activeLen)) + import_picocolors8.default.dim("─".repeat(tail));
16337
16259
  return [row, rule];
16338
16260
  }
16339
16261
  function centerBlock(lines, width) {
16340
- const blockWidth = Math.max(...lines.map(visibleWidth2));
16262
+ const blockWidth = Math.max(...lines.map(visibleWidth));
16341
16263
  const pad = " ".repeat(Math.max(0, Math.floor((width - blockWidth) / 2)));
16342
16264
  return lines.map((line) => pad + line);
16343
16265
  }
@@ -16392,10 +16314,10 @@ function installCenteredLayout(stream = process.stdout) {
16392
16314
  active = false;
16393
16315
  };
16394
16316
  }
16395
- var import_picocolors9, ESC2, CONTENT_WIDTH = 64, TOKEN_PATTERN, COLUMN_RESET_FINALS, active = false, ANSI_PATTERN2, TAB_CELL_PAD = 2;
16317
+ var import_picocolors8, ESC2, CONTENT_WIDTH = 64, TOKEN_PATTERN, COLUMN_RESET_FINALS, active = false, ANSI_PATTERN2, TAB_CELL_PAD = 2;
16396
16318
  var init_layout = __esm(() => {
16397
16319
  init_styles();
16398
- import_picocolors9 = __toESM(require_picocolors(), 1);
16320
+ import_picocolors8 = __toESM(require_picocolors(), 1);
16399
16321
  ESC2 = String.fromCharCode(27);
16400
16322
  TOKEN_PATTERN = new RegExp(`(\r
16401
16323
  |\r|
@@ -16404,6 +16326,73 @@ var init_layout = __esm(() => {
16404
16326
  ANSI_PATTERN2 = new RegExp(`${ESC2}\\[[0-9;?]*[A-Za-z]`, "g");
16405
16327
  });
16406
16328
 
16329
+ // src/setup/styles.ts
16330
+ function hasTruecolor() {
16331
+ return /truecolor|24bit/i.test(process.env.COLORTERM ?? "");
16332
+ }
16333
+ function brand(msg) {
16334
+ if (!import_picocolors9.default.isColorSupported)
16335
+ return msg;
16336
+ return hasTruecolor() ? `${BRAND_FG}${msg}${RESET_FG}` : import_picocolors9.default.green(msg);
16337
+ }
16338
+ function brandBadge(msg) {
16339
+ if (!import_picocolors9.default.isColorSupported)
16340
+ return `[ ${msg} ]`;
16341
+ const label = import_picocolors9.default.bold(` ${msg} `);
16342
+ return hasTruecolor() ? `${BRAND_BG}${INK_FG}${label}${RESET_FG}${RESET_BG}` : import_picocolors9.default.bgGreen(import_picocolors9.default.black(label));
16343
+ }
16344
+ function dim(msg) {
16345
+ return import_picocolors9.default.dim(msg);
16346
+ }
16347
+ function formatSetupSummary(title, items, marker = IconAdd) {
16348
+ const styled = marker === IconRemove ? import_picocolors9.default.red(marker) : brand(marker);
16349
+ const lines = items.map((item) => {
16350
+ const path = `${item.path}${item.status ? ` (${item.status})` : ""}`;
16351
+ return item.label ? `${styled} ${item.label}
16352
+ ${dim(path)}` : `${styled} ${dim(path)}`;
16353
+ });
16354
+ return `${title}
16355
+ ${lines.join(`
16356
+ `)}`;
16357
+ }
16358
+ function browserFallbackHint(url) {
16359
+ return dim(`If your browser doesn't open automatically, visit:
16360
+ ${url}`);
16361
+ }
16362
+ function info(msg) {
16363
+ return import_picocolors9.default.cyan(msg);
16364
+ }
16365
+ function wrapLog(text, columns = process.stdout.columns || 80) {
16366
+ const width = Math.max(20, contentWidth(columns) - LOG_GUTTER);
16367
+ const out = [];
16368
+ for (const paragraph of text.split(`
16369
+ `)) {
16370
+ if (visibleWidth(paragraph) <= width) {
16371
+ out.push(paragraph);
16372
+ continue;
16373
+ }
16374
+ let line = "";
16375
+ for (const word of paragraph.split(" ")) {
16376
+ if (line === "") {
16377
+ line = word;
16378
+ } else if (visibleWidth(line) + 1 + visibleWidth(word) <= width) {
16379
+ line = `${line} ${word}`;
16380
+ } else {
16381
+ out.push(line);
16382
+ line = word;
16383
+ }
16384
+ }
16385
+ out.push(line);
16386
+ }
16387
+ return out.join(`
16388
+ `);
16389
+ }
16390
+ var import_picocolors9, IconAdd = "✔", IconRemove = "-", BRAND_FG = "\x1B[38;2;82;164;15m", BRAND_BG = "\x1B[48;2;82;164;15m", INK_FG = "\x1B[38;2;14;14;14m", RESET_FG = "\x1B[39m", RESET_BG = "\x1B[49m", LOG_GUTTER = 4;
16391
+ var init_styles = __esm(() => {
16392
+ init_layout();
16393
+ import_picocolors9 = __toESM(require_picocolors(), 1);
16394
+ });
16395
+
16407
16396
  // src/tui/menu.ts
16408
16397
  function parseKeys(chunk) {
16409
16398
  const keys = [];
@@ -16441,9 +16430,9 @@ function reduceMenuKey(key, selected, count) {
16441
16430
  return { type: "none" };
16442
16431
  }
16443
16432
  function renderMenuFrame(message, options, selected) {
16444
- const labelWidth = Math.max(...options.map((option) => visibleWidth2(option.label)));
16433
+ const labelWidth = Math.max(...options.map((option) => visibleWidth(option.label)));
16445
16434
  const rows = options.map((option, index) => {
16446
- const label = option.label + " ".repeat(labelWidth - visibleWidth2(option.label));
16435
+ const label = option.label + " ".repeat(labelWidth - visibleWidth(option.label));
16447
16436
  const hint = option.hint ? ` ${import_picocolors10.default.dim(option.hint)}` : "";
16448
16437
  return index === selected ? `${brand(POINTER)} ${import_picocolors10.default.bold(label)}${hint}` : ` ${import_picocolors10.default.dim(label)}${hint}`;
16449
16438
  });
@@ -18360,7 +18349,7 @@ async function stepConnectGitHubRepo(cfg, detected = detectGitRepo(), opts = {})
18360
18349
  }
18361
18350
  repos = refresh.repos;
18362
18351
  if (!refresh.foundNew) {
18363
- log2.warn("GitHub may still be syncing. Pick 'Refresh list' in a moment to re-check; sync usually completes within a minute.");
18352
+ log2.warn(wrapLog("GitHub may still be syncing. Pick 'Refresh list' in a moment to re-check; sync usually completes within a minute."));
18364
18353
  }
18365
18354
  continue;
18366
18355
  }
@@ -19820,14 +19809,18 @@ function recordCapturedSession(key, update, configDir = getConfigDir(), now = ne
19820
19809
  return false;
19821
19810
  }
19822
19811
  }
19812
+ function cursorSessionId(hook) {
19813
+ const id = typeof hook.transcript_path === "string" && hook.transcript_path.endsWith(".jsonl") ? basename7(hook.transcript_path, ".jsonl") : hook.conversation_id;
19814
+ return typeof id === "string" ? id : null;
19815
+ }
19823
19816
  function captureCursorStop(payload, deps = {}) {
19824
19817
  if (typeof payload !== "object" || payload === null)
19825
19818
  return false;
19826
19819
  const hook = payload;
19827
19820
  if (hook.cursor_version === undefined)
19828
19821
  return false;
19829
- const id = typeof hook.transcript_path === "string" && hook.transcript_path.endsWith(".jsonl") ? basename7(hook.transcript_path, ".jsonl") : hook.conversation_id;
19830
- if (typeof id !== "string")
19822
+ const id = cursorSessionId(hook);
19823
+ if (id === null)
19831
19824
  return false;
19832
19825
  const roots = hook.workspace_roots;
19833
19826
  const dir = Array.isArray(roots) && typeof roots[0] === "string" ? roots[0] : undefined;
@@ -19908,6 +19901,17 @@ function piSessionShutdown(hook) {
19908
19901
  return null;
19909
19902
  return { harness: "pi", id, path };
19910
19903
  }
19904
+ function cursorSessionEnd(hook) {
19905
+ if (hook.hook_event_name !== "sessionEnd" || hook.cursor_version === undefined)
19906
+ return null;
19907
+ const path = hook.transcript_path;
19908
+ if (typeof path !== "string" || !path.startsWith("/") || !path.endsWith(".jsonl"))
19909
+ return null;
19910
+ const id = basename7(path, ".jsonl");
19911
+ if (!SAFE_SEGMENT.test(id))
19912
+ return null;
19913
+ return { harness: "cursor", id, path };
19914
+ }
19911
19915
  function endedSessionOf(payload) {
19912
19916
  if (typeof payload !== "object" || payload === null)
19913
19917
  return null;
@@ -19961,6 +19965,7 @@ var init_capture = __esm(() => {
19961
19965
  END_EVENT_READERS = [
19962
19966
  claudeSessionEnd,
19963
19967
  codexSessionEnd,
19968
+ cursorSessionEnd,
19964
19969
  piSessionShutdown
19965
19970
  ];
19966
19971
  ENDED_VALUE = /^([a-z]+):([A-Za-z0-9._-]+)(?:=(\/.*))?$/s;
@@ -22218,7 +22223,7 @@ var init_backlog = __esm(() => {
22218
22223
  });
22219
22224
 
22220
22225
  // src/telemetry/debug-id.ts
22221
- var BUNDLE_DEBUG_ID_PLACEHOLDER = "c8a0f0e8-7cd4-1cd4-6475-6e2164756e21";
22226
+ var BUNDLE_DEBUG_ID_PLACEHOLDER = "dabff5ff-72af-9bac-6475-6e2164756e21";
22222
22227
 
22223
22228
  // src/telemetry/telemetry.ts
22224
22229
  import { randomUUID as randomUUID2 } from "node:crypto";
@@ -27061,8 +27066,6 @@ function linkedSkillsDir(agent) {
27061
27066
  const claudeConfigDir = process.env.CLAUDE_CONFIG_DIR?.trim() || join24(homedir9(), ".claude");
27062
27067
  return join24(claudeConfigDir, "skills");
27063
27068
  }
27064
- if (agent === "windsurf")
27065
- return join24(homedir9(), ".codeium", "windsurf", "skills");
27066
27069
  return null;
27067
27070
  }
27068
27071
  function skillInstallTargetForProvider(providerID) {
@@ -27213,7 +27216,10 @@ function removeSkills() {
27213
27216
  const names = new Set([...BUNDLED_SKILLS.map((skill) => skill.name), ...legacy]);
27214
27217
  const dirs = [
27215
27218
  universalSkillsDir(),
27216
- ...new Set(SUPPORTED_SKILL_AGENTS.map(linkedSkillsDir).filter((dir) => !!dir))
27219
+ ...new Set([
27220
+ ...SUPPORTED_SKILL_AGENTS.map(linkedSkillsDir).filter((dir) => !!dir),
27221
+ ...LEGACY_LINKED_SKILLS_DIRS.map((dir) => dir())
27222
+ ])
27217
27223
  ];
27218
27224
  const removed = [];
27219
27225
  for (const dir of dirs) {
@@ -27279,7 +27285,7 @@ Failed to update skill.`));
27279
27285
  });
27280
27286
  return cmd;
27281
27287
  }
27282
- var import_picocolors31, SKILL_NAME = "dosu", LEGACY_SKILL_SOURCE = "dosu-ai/dosu-skill", INSTALL_STATE_FILENAME = "skill-install.json", LEGACY_CACHE_FILENAME = "skill-update-check.json", SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER;
27288
+ var import_picocolors31, SKILL_NAME = "dosu", LEGACY_SKILL_SOURCE = "dosu-ai/dosu-skill", INSTALL_STATE_FILENAME = "skill-install.json", LEGACY_CACHE_FILENAME = "skill-update-check.json", SUPPORTED_SKILL_AGENTS, SKILL_AGENT_BY_PROVIDER, LEGACY_LINKED_SKILLS_DIRS;
27283
27289
  var init_skill = __esm(() => {
27284
27290
  init_commander();
27285
27291
  init_config();
@@ -27291,27 +27297,20 @@ var init_skill = __esm(() => {
27291
27297
  "cursor",
27292
27298
  "gemini-cli",
27293
27299
  "codex",
27294
- "windsurf",
27295
- "zed",
27296
- "cline",
27297
27300
  "github-copilot",
27298
- "opencode",
27299
- "antigravity"
27301
+ "opencode"
27300
27302
  ];
27301
27303
  SKILL_AGENT_BY_PROVIDER = {
27302
27304
  claude: "claude-code",
27303
27305
  cursor: "cursor",
27304
- vscode: "github-copilot",
27305
27306
  gemini: "gemini-cli",
27306
27307
  codex: "codex",
27307
- windsurf: "windsurf",
27308
- zed: "zed",
27309
- cline: "cline",
27310
- "cline-cli": "cline",
27311
27308
  copilot: "github-copilot",
27312
- opencode: "opencode",
27313
- antigravity: "antigravity"
27309
+ opencode: "opencode"
27314
27310
  };
27311
+ LEGACY_LINKED_SKILLS_DIRS = [
27312
+ () => join24(homedir9(), ".codeium", "windsurf", "skills")
27313
+ ];
27315
27314
  });
27316
27315
 
27317
27316
  // src/commands/sources.ts
@@ -28141,24 +28140,6 @@ var init_base = __esm(() => {
28141
28140
  init_shape();
28142
28141
  });
28143
28142
 
28144
- // src/mcp/providers/antigravity.ts
28145
- var AntigravityProvider = () => createJSONProvider({
28146
- providerName: "Antigravity",
28147
- providerID: "antigravity",
28148
- local: false,
28149
- priorityValue: 15,
28150
- paths: ["~/.gemini"],
28151
- globalPath: "~/.gemini/antigravity/mcp_config.json",
28152
- topKey: "mcpServers",
28153
- buildServer: ({ url, headers }) => ({
28154
- serverUrl: url,
28155
- headers
28156
- })
28157
- });
28158
- var init_antigravity = __esm(() => {
28159
- init_base();
28160
- });
28161
-
28162
28143
  // src/mcp/providers/claude.ts
28163
28144
  import { join as join26 } from "node:path";
28164
28145
  var ClaudeProvider = () => ({
@@ -28182,111 +28163,16 @@ var init_claude = __esm(() => {
28182
28163
  init_base();
28183
28164
  });
28184
28165
 
28185
- // src/mcp/providers/claude-desktop.ts
28186
- import { join as join27 } from "node:path";
28187
- function configPath2() {
28188
- return join27(appSupportDir(), "Claude", "claude_desktop_config.json");
28189
- }
28190
- var ClaudeDesktopProvider = () => ({
28191
- name: () => "Claude Desktop",
28192
- id: () => "claude-desktop",
28193
- supportsLocal: () => false,
28194
- priority: () => 2,
28195
- detectPaths: () => [join27(appSupportDir(), "Claude")],
28196
- isInstalled: () => isInstalled([join27(appSupportDir(), "Claude")]),
28197
- globalConfigPath: () => configPath2(),
28198
- isConfigured: () => isJSONKeyConfigured(configPath2(), "mcpServers"),
28199
- isCurrent: (cfg) => {
28200
- const proxy = proxyCommandShape("claude-desktop");
28201
- return entryHasShape(proxy ? stdioServer(proxy) : npxRemoteEntry(shapeEndpoint(cfg), ANY, ANY, ANY), readJSONServer(configPath2(), "mcpServers"));
28202
- },
28203
- install(cfg, global) {
28204
- if (!global)
28205
- throw new Error("Claude Desktop does not support local installation");
28206
- const url = mcpEndpoint(cfg);
28207
- const proxy = proxyCommand("claude-desktop");
28208
- if (proxy) {
28209
- mcpHeaders(cfg.active_account?.target?.api_key);
28210
- installJSONServer(configPath2(), "mcpServers", stdioServer(proxy));
28211
- return;
28212
- }
28213
- const npx = findNpx();
28214
- installJSONServer(configPath2(), "mcpServers", npxRemoteEntry(url, cfg.active_account?.target?.api_key, npx, launcherPathEnv(npx)));
28215
- },
28216
- remove(global) {
28217
- if (!global)
28218
- throw new Error("Claude Desktop does not support local removal");
28219
- removeJSONServer(configPath2(), "mcpServers");
28220
- }
28221
- });
28222
- var init_claude_desktop = __esm(() => {
28223
- init_config_helpers();
28224
- init_detect();
28225
- init_proxy_entry();
28226
- init_shape();
28227
- });
28228
-
28229
- // src/mcp/providers/cline.ts
28230
- import { join as join28 } from "node:path";
28231
- var extensionDir = () => join28(appSupportDir(), "Code", "User", "globalStorage", "saoudrizwan.claude-dev"), ClineProvider = () => createJSONProvider({
28232
- providerName: "Cline",
28233
- providerID: "cline",
28234
- local: false,
28235
- priorityValue: 11,
28236
- paths: [extensionDir()],
28237
- globalPath: join28(extensionDir(), "settings", "cline_mcp_settings.json"),
28238
- topKey: "mcpServers",
28239
- buildStdioServer: (proxy) => ({ type: "stdio", ...stdioServer(proxy), disabled: false }),
28240
- buildServer: ({ url, headers }) => ({
28241
- url,
28242
- type: "streamableHttp",
28243
- disabled: false,
28244
- headers
28245
- })
28246
- });
28247
- var init_cline = __esm(() => {
28248
- init_detect();
28249
- init_proxy_entry();
28250
- init_base();
28251
- });
28252
-
28253
- // src/mcp/providers/cline-cli.ts
28254
- import { join as join29 } from "node:path";
28255
- function clineDir() {
28256
- return process.env.CLINE_DIR ?? expandHome("~/.cline");
28257
- }
28258
- var ClineCliProvider = () => createJSONProvider({
28259
- providerName: "Cline CLI",
28260
- providerID: "cline-cli",
28261
- local: false,
28262
- priorityValue: 12,
28263
- paths: [clineDir()],
28264
- globalPath: join29(clineDir(), "data", "settings", "cline_mcp_settings.json"),
28265
- topKey: "mcpServers",
28266
- buildStdioServer: (proxy) => ({ type: "stdio", ...stdioServer(proxy), disabled: false }),
28267
- buildServer: ({ url, headers }) => ({
28268
- url,
28269
- type: "streamableHttp",
28270
- disabled: false,
28271
- headers
28272
- })
28273
- });
28274
- var init_cline_cli = __esm(() => {
28275
- init_detect();
28276
- init_proxy_entry();
28277
- init_base();
28278
- });
28279
-
28280
28166
  // src/mcp/providers/codex.ts
28281
28167
  import { existsSync as existsSync22, readFileSync as readFileSync30 } from "node:fs";
28282
- import { dirname as dirname9, join as join30 } from "node:path";
28168
+ import { dirname as dirname9, join as join27 } from "node:path";
28283
28169
  function codexHome4() {
28284
28170
  return process.env.CODEX_HOME || expandHome("~/.codex");
28285
28171
  }
28286
28172
  function getConfigPath2(global) {
28287
28173
  if (global)
28288
- return join30(codexHome4(), "config.toml");
28289
- return join30(process.cwd(), ".codex", "config.toml");
28174
+ return join27(codexHome4(), "config.toml");
28175
+ return join27(process.cwd(), ".codex", "config.toml");
28290
28176
  }
28291
28177
  function readTOML(path) {
28292
28178
  if (!existsSync22(path))
@@ -28486,14 +28372,14 @@ function projectConfigPaths() {
28486
28372
  const chain = [];
28487
28373
  for (let dir = cwd;; ) {
28488
28374
  chain.push(dir);
28489
- if (existsSync22(join30(dir, ".git")))
28375
+ if (existsSync22(join27(dir, ".git")))
28490
28376
  break;
28491
28377
  const parent = dirname9(dir);
28492
28378
  if (parent === dir)
28493
- return [join30(cwd, ".codex", "config.toml")];
28379
+ return [join27(cwd, ".codex", "config.toml")];
28494
28380
  dir = parent;
28495
28381
  }
28496
- return chain.reverse().map((dir) => join30(dir, ".codex", "config.toml"));
28382
+ return chain.reverse().map((dir) => join27(dir, ".codex", "config.toml"));
28497
28383
  }
28498
28384
  function pruneLegacyRemoteEntry(path) {
28499
28385
  if (!existsSync22(path))
@@ -28510,12 +28396,12 @@ var FORWARDED_ENV, DOSU_TABLE = "mcp_servers.dosu", REMOTE_HTTP_KEY, CodexProvid
28510
28396
  priority: () => 8,
28511
28397
  detectPaths: () => ["~/.codex"],
28512
28398
  isInstalled: codexInstalled,
28513
- globalConfigPath: () => join30(codexHome4(), "config.toml"),
28399
+ globalConfigPath: () => join27(codexHome4(), "config.toml"),
28514
28400
  isConfigured: () => {
28515
- const content = readTOML(join30(codexHome4(), "config.toml"));
28401
+ const content = readTOML(join27(codexHome4(), "config.toml"));
28516
28402
  return content.includes("[mcp_servers.dosu]");
28517
28403
  },
28518
- isCurrent: (cfg) => entryHasShape(codexServer(cfg, true), readDosuEntry(readTOML(join30(codexHome4(), "config.toml")))),
28404
+ isCurrent: (cfg) => entryHasShape(codexServer(cfg, true), readDosuEntry(readTOML(join27(codexHome4(), "config.toml")))),
28519
28405
  install(cfg, global) {
28520
28406
  if (cfg.mode !== MODE_OSS && !cfg.active_account?.target?.deployment_id)
28521
28407
  throw new Error("deployment ID is required");
@@ -28548,7 +28434,7 @@ var init_codex3 = __esm(() => {
28548
28434
  });
28549
28435
 
28550
28436
  // src/mcp/providers/copilot.ts
28551
- import { join as join31 } from "node:path";
28437
+ import { join as join28 } from "node:path";
28552
28438
  function globalServer(url, apiKey, proxy) {
28553
28439
  if (proxy)
28554
28440
  return { type: "local", ...stdioServer(proxy), tools: ["*"] };
@@ -28556,7 +28442,7 @@ function globalServer(url, apiKey, proxy) {
28556
28442
  }
28557
28443
  function globalPath() {
28558
28444
  if (process.env.XDG_CONFIG_HOME) {
28559
- return join31(process.env.XDG_CONFIG_HOME, "mcp-config.json");
28445
+ return join28(process.env.XDG_CONFIG_HOME, "mcp-config.json");
28560
28446
  }
28561
28447
  return expandHome("~/.copilot/mcp-config.json");
28562
28448
  }
@@ -28577,7 +28463,7 @@ var CopilotProvider = () => ({
28577
28463
  if (global) {
28578
28464
  installJSONServer(globalPath(), "mcpServers", globalServer(url, cfg.active_account?.target?.api_key, proxy));
28579
28465
  } else {
28580
- const configPath = join31(process.cwd(), ".vscode", "mcp.json");
28466
+ const configPath = join28(process.cwd(), ".vscode", "mcp.json");
28581
28467
  const server = proxy ? { type: "stdio", ...stdioServer(proxy) } : { type: "http", url, headers };
28582
28468
  installJSONServer(configPath, "servers", server);
28583
28469
  }
@@ -28586,7 +28472,7 @@ var CopilotProvider = () => ({
28586
28472
  if (global) {
28587
28473
  removeJSONServer(globalPath(), "mcpServers");
28588
28474
  } else {
28589
- const configPath = join31(process.cwd(), ".vscode", "mcp.json");
28475
+ const configPath = join28(process.cwd(), ".vscode", "mcp.json");
28590
28476
  removeJSONServer(configPath, "servers");
28591
28477
  }
28592
28478
  }
@@ -28599,7 +28485,7 @@ var init_copilot = __esm(() => {
28599
28485
  });
28600
28486
 
28601
28487
  // src/mcp/providers/cursor.ts
28602
- import { join as join32 } from "node:path";
28488
+ import { join as join29 } from "node:path";
28603
28489
  var CursorProvider = () => createJSONProvider({
28604
28490
  providerName: "Cursor",
28605
28491
  providerID: "cursor",
@@ -28612,14 +28498,14 @@ var CursorProvider = () => createJSONProvider({
28612
28498
  url,
28613
28499
  headers
28614
28500
  }),
28615
- localConfigPath: (cwd) => join32(cwd, ".cursor", "mcp.json")
28501
+ localConfigPath: (cwd) => join29(cwd, ".cursor", "mcp.json")
28616
28502
  });
28617
28503
  var init_cursor2 = __esm(() => {
28618
28504
  init_base();
28619
28505
  });
28620
28506
 
28621
28507
  // src/mcp/providers/factory.ts
28622
- import { join as join33 } from "node:path";
28508
+ import { join as join30 } from "node:path";
28623
28509
  var FactoryProvider = () => createJSONProvider({
28624
28510
  providerName: "Factory",
28625
28511
  providerID: "factory",
@@ -28629,7 +28515,7 @@ var FactoryProvider = () => createJSONProvider({
28629
28515
  globalPath: "~/.factory/mcp.json",
28630
28516
  topKey: "mcpServers",
28631
28517
  buildStdioServer: (proxy) => ({ type: "stdio", ...stdioServer(proxy) }),
28632
- localConfigPath: (cwd) => join33(cwd, ".factory", "mcp.json")
28518
+ localConfigPath: (cwd) => join30(cwd, ".factory", "mcp.json")
28633
28519
  });
28634
28520
  var init_factory = __esm(() => {
28635
28521
  init_proxy_entry();
@@ -28637,7 +28523,7 @@ var init_factory = __esm(() => {
28637
28523
  });
28638
28524
 
28639
28525
  // src/mcp/providers/gemini.ts
28640
- import { join as join34 } from "node:path";
28526
+ import { join as join31 } from "node:path";
28641
28527
  var GeminiProvider = () => createJSONProvider({
28642
28528
  providerName: "Gemini CLI",
28643
28529
  providerID: "gemini",
@@ -28646,7 +28532,7 @@ var GeminiProvider = () => createJSONProvider({
28646
28532
  paths: ["~/.gemini"],
28647
28533
  globalPath: "~/.gemini/settings.json",
28648
28534
  topKey: "mcpServers",
28649
- localConfigPath: (cwd) => join34(cwd, ".gemini", "settings.json")
28535
+ localConfigPath: (cwd) => join31(cwd, ".gemini", "settings.json")
28650
28536
  });
28651
28537
  var init_gemini = __esm(() => {
28652
28538
  init_base();
@@ -28691,53 +28577,8 @@ var init_manual = __esm(() => {
28691
28577
  init_config_helpers();
28692
28578
  });
28693
28579
 
28694
- // src/mcp/providers/mcporter.ts
28695
- import { existsSync as existsSync23 } from "node:fs";
28696
- import { join as join35 } from "node:path";
28697
- function server(url, apiKey, proxy) {
28698
- if (proxy)
28699
- return stdioServer(proxy);
28700
- return { type: "http", url, headers: mcpHeaders(apiKey) };
28701
- }
28702
- function resolveGlobalConfigPath() {
28703
- const jsonPath = expandHome("~/.mcporter/mcporter.json");
28704
- if (existsSync23(jsonPath))
28705
- return jsonPath;
28706
- const jsoncPath = expandHome("~/.mcporter/mcporter.jsonc");
28707
- if (existsSync23(jsoncPath))
28708
- return jsoncPath;
28709
- return jsonPath;
28710
- }
28711
- var MCPorterProvider = () => ({
28712
- name: () => "MCPorter",
28713
- id: () => "mcporter",
28714
- supportsLocal: () => true,
28715
- priority: () => 16,
28716
- detectPaths: () => ["~/.mcporter"],
28717
- isInstalled: () => isInstalled(["~/.mcporter"]),
28718
- globalConfigPath: () => resolveGlobalConfigPath(),
28719
- isConfigured: () => isJSONKeyConfigured(resolveGlobalConfigPath(), "mcpServers"),
28720
- isCurrent: (cfg) => entryHasShape(server(shapeEndpoint(cfg), ANY, proxyCommandShape("mcporter")), readJSONServer(resolveGlobalConfigPath(), "mcpServers")),
28721
- install(cfg, global) {
28722
- const configPath = global ? resolveGlobalConfigPath() : join35(process.cwd(), "config", "mcporter.json");
28723
- const url = mcpEndpoint(cfg);
28724
- const proxy = proxyCommand("mcporter");
28725
- installJSONServer(configPath, "mcpServers", server(url, cfg.active_account?.target?.api_key, proxy));
28726
- },
28727
- remove(global) {
28728
- const configPath = global ? resolveGlobalConfigPath() : join35(process.cwd(), "config", "mcporter.json");
28729
- removeJSONServer(configPath, "mcpServers");
28730
- }
28731
- });
28732
- var init_mcporter = __esm(() => {
28733
- init_config_helpers();
28734
- init_detect();
28735
- init_proxy_entry();
28736
- init_shape();
28737
- });
28738
-
28739
28580
  // src/mcp/providers/opencode.ts
28740
- import { join as join36 } from "node:path";
28581
+ import { join as join32 } from "node:path";
28741
28582
  var jsonProvider = () => createJSONProvider({
28742
28583
  providerName: "OpenCode",
28743
28584
  providerID: "opencode",
@@ -28758,7 +28599,7 @@ var jsonProvider = () => createJSONProvider({
28758
28599
  enabled: true,
28759
28600
  headers
28760
28601
  }),
28761
- localConfigPath: (cwd) => join36(cwd, "opencode.json")
28602
+ localConfigPath: (cwd) => join32(cwd, "opencode.json")
28762
28603
  }), OpenCodeProvider = () => {
28763
28604
  const provider = jsonProvider();
28764
28605
  return { ...provider, isInstalled: () => provider.isInstalled() || isOnPath("opencode") };
@@ -28792,133 +28633,15 @@ var init_pi4 = __esm(() => {
28792
28633
  init_pi3();
28793
28634
  });
28794
28635
 
28795
- // src/mcp/providers/vscode.ts
28796
- import { join as join37 } from "node:path";
28797
- var VSCodeProvider = () => createJSONProvider({
28798
- providerName: "VS Code",
28799
- providerID: "vscode",
28800
- local: true,
28801
- priorityValue: 6,
28802
- paths: [join37(appSupportDir(), "Code")],
28803
- globalPath: join37(appSupportDir(), "Code", "User", "mcp.json"),
28804
- topKey: "servers",
28805
- buildStdioServer: (proxy) => ({ type: "stdio", ...stdioServer(proxy) }),
28806
- localConfigPath: (cwd) => join37(cwd, ".vscode", "mcp.json")
28807
- });
28808
- var init_vscode = __esm(() => {
28809
- init_detect();
28810
- init_proxy_entry();
28811
- init_base();
28812
- });
28813
-
28814
- // src/mcp/providers/windsurf.ts
28815
- import { homedir as homedir10 } from "node:os";
28816
- import { join as join38 } from "node:path";
28817
- var WindsurfProvider = () => createJSONProvider({
28818
- providerName: "Windsurf",
28819
- providerID: "windsurf",
28820
- local: false,
28821
- priorityValue: 9,
28822
- paths: [join38(homedir10(), ".codeium", "windsurf")],
28823
- globalPath: join38(homedir10(), ".codeium", "windsurf", "mcp_config.json"),
28824
- topKey: "mcpServers"
28825
- });
28826
- var init_windsurf = __esm(() => {
28827
- init_base();
28828
- });
28829
-
28830
- // src/mcp/providers/zed.ts
28831
- import { rmSync as rmSync5 } from "node:fs";
28832
- import { homedir as homedir11, platform as platform4 } from "node:os";
28833
- import { join as join39 } from "node:path";
28834
- function zedConfigDir() {
28835
- const os = platform4();
28836
- if (os === "win32")
28837
- return join39(appSupportDir(), "Zed");
28838
- if (os === "darwin")
28839
- return join39(homedir11(), ".config", "zed");
28840
- return join39(appSupportDir(), "zed");
28841
- }
28842
- function zedDataDir() {
28843
- const os = platform4();
28844
- if (os === "darwin")
28845
- return join39(appSupportDir(), "Zed");
28846
- if (os === "win32")
28847
- return join39(process.env.LOCALAPPDATA ?? "", "Zed");
28848
- return join39(process.env.XDG_DATA_HOME ?? join39(homedir11(), ".local", "share"), "zed");
28849
- }
28850
- function legacyDarwinSettingsPath() {
28851
- return platform4() === "darwin" ? join39(appSupportDir(), "Zed", "settings.json") : null;
28852
- }
28853
- function removeLegacyDosuEntry(path) {
28854
- let cfg;
28855
- try {
28856
- cfg = readJSONConfig(path);
28857
- } catch {
28858
- return;
28859
- }
28860
- const servers = cfg.context_servers;
28861
- if (typeof servers !== "object" || servers === null || !("dosu" in servers))
28862
- return;
28863
- delete servers.dosu;
28864
- const nothingElse = Object.keys(cfg).length === 1 && Object.keys(servers).length === 0;
28865
- if (nothingElse)
28866
- rmSync5(path, { force: true });
28867
- else
28868
- saveJSONConfig(path, cfg);
28869
- }
28870
- var ZedProvider = (legacyPath = legacyDarwinSettingsPath()) => {
28871
- const provider = createJSONProvider({
28872
- providerName: "Zed",
28873
- providerID: "zed",
28874
- local: true,
28875
- priorityValue: 10,
28876
- paths: [zedConfigDir(), zedDataDir()],
28877
- globalPath: join39(zedConfigDir(), "settings.json"),
28878
- topKey: "context_servers",
28879
- buildServer: ({ url, headers }) => ({ url, headers }),
28880
- localConfigPath: (cwd) => join39(cwd, ".zed", "settings.json")
28881
- });
28882
- if (!legacyPath)
28883
- return provider;
28884
- return {
28885
- ...provider,
28886
- isCurrent: (cfg) => provider.isCurrent(cfg) && readJSONServer(legacyPath, "context_servers") === undefined,
28887
- install(cfg, global) {
28888
- provider.install(cfg, global);
28889
- if (global)
28890
- removeLegacyDosuEntry(legacyPath);
28891
- },
28892
- remove(global) {
28893
- provider.remove(global);
28894
- if (global)
28895
- removeLegacyDosuEntry(legacyPath);
28896
- }
28897
- };
28898
- };
28899
- var init_zed = __esm(() => {
28900
- init_config_helpers();
28901
- init_detect();
28902
- init_base();
28903
- });
28904
-
28905
28636
  // src/mcp/providers.ts
28906
28637
  function allProviders() {
28907
28638
  return [
28908
28639
  ClaudeProvider(),
28909
- ClaudeDesktopProvider(),
28910
28640
  CursorProvider(),
28911
- VSCodeProvider(),
28912
28641
  GeminiProvider(),
28913
28642
  CodexProvider(),
28914
- WindsurfProvider(),
28915
- ZedProvider(),
28916
- ClineProvider(),
28917
- ClineCliProvider(),
28918
28643
  CopilotProvider(),
28919
28644
  OpenCodeProvider(),
28920
- AntigravityProvider(),
28921
- MCPorterProvider(),
28922
28645
  FactoryProvider(),
28923
28646
  PiProvider(),
28924
28647
  ManualProvider()
@@ -28935,23 +28658,15 @@ function getProvider(toolID) {
28935
28658
  return provider;
28936
28659
  }
28937
28660
  var init_providers = __esm(() => {
28938
- init_antigravity();
28939
28661
  init_claude();
28940
- init_claude_desktop();
28941
- init_cline();
28942
- init_cline_cli();
28943
28662
  init_codex3();
28944
28663
  init_copilot();
28945
28664
  init_cursor2();
28946
28665
  init_factory();
28947
28666
  init_gemini();
28948
28667
  init_manual();
28949
- init_mcporter();
28950
28668
  init_opencode4();
28951
28669
  init_pi4();
28952
- init_vscode();
28953
- init_windsurf();
28954
- init_zed();
28955
28670
  });
28956
28671
 
28957
28672
  // src/mcp/refresh.ts
@@ -29000,22 +28715,22 @@ var init_refresh = __esm(() => {
29000
28715
  import { spawn as spawn2 } from "node:child_process";
29001
28716
  import {
29002
28717
  closeSync as closeSync8,
29003
- existsSync as existsSync24,
28718
+ existsSync as existsSync23,
29004
28719
  mkdirSync as mkdirSync14,
29005
28720
  openSync as openSync8,
29006
28721
  readFileSync as readFileSync31,
29007
- rmSync as rmSync6,
28722
+ rmSync as rmSync5,
29008
28723
  statSync as statSync11,
29009
28724
  writeFileSync as writeFileSync15,
29010
28725
  writeSync
29011
28726
  } from "node:fs";
29012
- import { homedir as homedir12 } from "node:os";
29013
- import { join as join40 } from "node:path";
28727
+ import { homedir as homedir10 } from "node:os";
28728
+ import { join as join33 } from "node:path";
29014
28729
  function statePath() {
29015
- return join40(getConfigDir(), STATE_FILENAME2);
28730
+ return join33(getConfigDir(), STATE_FILENAME2);
29016
28731
  }
29017
28732
  function lockPath2() {
29018
- return join40(getConfigDir(), LOCK_FILENAME2);
28733
+ return join33(getConfigDir(), LOCK_FILENAME2);
29019
28734
  }
29020
28735
  function isValidVersion(value) {
29021
28736
  return typeof value === "string" && VERSION_PATTERN.test(value);
@@ -29041,7 +28756,7 @@ function readState() {
29041
28756
  function writeState(state) {
29042
28757
  try {
29043
28758
  const dir = getConfigDir();
29044
- if (!existsSync24(dir))
28759
+ if (!existsSync23(dir))
29045
28760
  mkdirSync14(dir, { recursive: true, mode: 448 });
29046
28761
  writeFileSync15(statePath(), `${JSON.stringify(state, null, 2)}
29047
28762
  `, { mode: 384 });
@@ -29098,7 +28813,7 @@ function claimLock(version, now) {
29098
28813
  try {
29099
28814
  mkdirSync14(getConfigDir(), { recursive: true, mode: 448 });
29100
28815
  if (!lockIsFresh(now))
29101
- rmSync6(lockPath2(), { force: true });
28816
+ rmSync5(lockPath2(), { force: true });
29102
28817
  const fd = openSync8(lockPath2(), "wx", 384);
29103
28818
  try {
29104
28819
  writeSync(fd, version);
@@ -29112,7 +28827,7 @@ function claimLock(version, now) {
29112
28827
  }
29113
28828
  function releaseLock() {
29114
28829
  try {
29115
- rmSync6(lockPath2(), { force: true });
28830
+ rmSync5(lockPath2(), { force: true });
29116
28831
  } catch {}
29117
28832
  }
29118
28833
  function readLockVersion() {
@@ -29144,7 +28859,7 @@ function startAutoUpdate(version, options = {}) {
29144
28859
  return claim === "held" ? "in_progress" : "unavailable";
29145
28860
  try {
29146
28861
  const child = spawn2(invocation.command, invocation.args, {
29147
- cwd: homedir12(),
28862
+ cwd: homedir10(),
29148
28863
  detached: true,
29149
28864
  stdio: "ignore",
29150
28865
  windowsHide: true,
@@ -29191,15 +28906,15 @@ var init_auto_update = __esm(() => {
29191
28906
  });
29192
28907
 
29193
28908
  // src/version/mcp-refresh-check.ts
29194
- import { existsSync as existsSync25, mkdirSync as mkdirSync15, readFileSync as readFileSync32, writeFileSync as writeFileSync16 } from "node:fs";
29195
- import { join as join41 } from "node:path";
28909
+ import { existsSync as existsSync24, mkdirSync as mkdirSync15, readFileSync as readFileSync32, writeFileSync as writeFileSync16 } from "node:fs";
28910
+ import { join as join34 } from "node:path";
29196
28911
  function getCachePath2() {
29197
- return join41(getConfigDir(), CACHE_FILENAME3);
28912
+ return join34(getConfigDir(), CACHE_FILENAME3);
29198
28913
  }
29199
28914
  function readMcpRefreshCache() {
29200
28915
  try {
29201
28916
  const path = getCachePath2();
29202
- if (!existsSync25(path))
28917
+ if (!existsSync24(path))
29203
28918
  return null;
29204
28919
  const data = JSON.parse(readFileSync32(path, "utf-8"));
29205
28920
  if (typeof data?.version === "string")
@@ -29212,7 +28927,7 @@ function readMcpRefreshCache() {
29212
28927
  function writeMcpRefreshCache(cache) {
29213
28928
  try {
29214
28929
  const dir = getConfigDir();
29215
- if (!existsSync25(dir)) {
28930
+ if (!existsSync24(dir)) {
29216
28931
  mkdirSync15(dir, { recursive: true, mode: 448 });
29217
28932
  }
29218
28933
  writeFileSync16(getCachePath2(), JSON.stringify(cache), { mode: 384 });
@@ -29355,11 +29070,11 @@ function createLogFollower(path, emit) {
29355
29070
  var init_follow = () => {};
29356
29071
 
29357
29072
  // src/sessions/session-title.ts
29358
- import { existsSync as existsSync26, mkdirSync as mkdirSync16, readFileSync as readFileSync33, renameSync as renameSync6, statSync as statSync13, writeFileSync as writeFileSync17 } from "node:fs";
29359
- import { homedir as homedir13 } from "node:os";
29360
- import { join as join42 } from "node:path";
29073
+ import { existsSync as existsSync25, mkdirSync as mkdirSync16, readFileSync as readFileSync33, renameSync as renameSync6, statSync as statSync13, writeFileSync as writeFileSync17 } from "node:fs";
29074
+ import { homedir as homedir11 } from "node:os";
29075
+ import { join as join35 } from "node:path";
29361
29076
  function cachePath2(configDir) {
29362
- return join42(configDir, CACHE_FILENAME4);
29077
+ return join35(configDir, CACHE_FILENAME4);
29363
29078
  }
29364
29079
  function loadCacheFile2(configDir) {
29365
29080
  try {
@@ -29373,7 +29088,7 @@ function loadCacheFile2(configDir) {
29373
29088
  }
29374
29089
  function saveCacheFile2(configDir, entries) {
29375
29090
  try {
29376
- if (!existsSync26(configDir))
29091
+ if (!existsSync25(configDir))
29377
29092
  mkdirSync16(configDir, { recursive: true, mode: 448 });
29378
29093
  const path = cachePath2(configDir);
29379
29094
  const tmp = `${path}.${process.pid}.tmp`;
@@ -29411,15 +29126,15 @@ function claudeSummaryFromHead(text) {
29411
29126
  }
29412
29127
  return null;
29413
29128
  }
29414
- function reconstructSession(harness, id, slug, home = homedir13(), exists = existsSync26) {
29129
+ function reconstructSession(harness, id, slug, home = homedir11(), exists = existsSync25) {
29415
29130
  if (!slug)
29416
29131
  return null;
29417
29132
  const candidates = [];
29418
29133
  if (harness === "claude") {
29419
- candidates.push(join42(home, ".claude", "projects", slug, `${id}.jsonl`));
29134
+ candidates.push(join35(home, ".claude", "projects", slug, `${id}.jsonl`));
29420
29135
  } else if (harness === "cursor") {
29421
- const project = join42(home, ".cursor", "projects", slug);
29422
- candidates.push(join42(project, "agent-transcripts", id, `${id}.jsonl`), join42(project, "agent-transcripts", `${id}.jsonl`));
29136
+ const project = join35(home, ".cursor", "projects", slug);
29137
+ candidates.push(join35(project, "agent-transcripts", id, `${id}.jsonl`), join35(project, "agent-transcripts", `${id}.jsonl`));
29423
29138
  } else {
29424
29139
  return null;
29425
29140
  }
@@ -29511,7 +29226,7 @@ var init_alt_screen = __esm(() => {
29511
29226
  });
29512
29227
 
29513
29228
  // src/tui/activity-view.ts
29514
- import { existsSync as existsSync27, readFileSync as readFileSync34 } from "node:fs";
29229
+ import { existsSync as existsSync26, readFileSync as readFileSync34 } from "node:fs";
29515
29230
  import { basename as basename11 } from "node:path";
29516
29231
  function reduceActivityViewKey(key) {
29517
29232
  if (key === "q" || key === ESC7 || key === CTRL_C4)
@@ -29686,8 +29401,8 @@ function confirmBox(queuedCount, backlog, width, mode = "start") {
29686
29401
  "",
29687
29402
  `${import_picocolors37.default.bold("enter")} ${verb} · ${import_picocolors37.default.bold("esc")} cancel`
29688
29403
  ];
29689
- const inner = Math.min(maxInner, Math.max(...rows.map(visibleWidth2)));
29690
- const pad = (row) => row + " ".repeat(Math.max(0, inner - visibleWidth2(row)));
29404
+ const inner = Math.min(maxInner, Math.max(...rows.map(visibleWidth)));
29405
+ const pad = (row) => row + " ".repeat(Math.max(0, inner - visibleWidth(row)));
29691
29406
  return [
29692
29407
  import_picocolors37.default.dim(`╭${"─".repeat(inner + 2)}╮`),
29693
29408
  ...rows.map((row) => `${import_picocolors37.default.dim("│")} ${pad(row)} ${import_picocolors37.default.dim("│")}`),
@@ -29798,7 +29513,7 @@ function createRowNamer() {
29798
29513
  names.titles[key] = t;
29799
29514
  };
29800
29515
  for (const s of [...backlog.queued, ...backlog.open]) {
29801
- if (!existsSync27(s.path))
29516
+ if (!existsSync26(s.path))
29802
29517
  continue;
29803
29518
  const key = `${s.harness}/${s.id}`;
29804
29519
  const dir = dirs.resolve(s);
@@ -30055,14 +29770,14 @@ var init_activity_view = __esm(() => {
30055
29770
  });
30056
29771
 
30057
29772
  // src/rules/installer.ts
30058
- import { existsSync as existsSync28, mkdirSync as mkdirSync17, readFileSync as readFileSync35, unlinkSync as unlinkSync7, writeFileSync as writeFileSync18 } from "node:fs";
30059
- import { homedir as homedir14 } from "node:os";
30060
- import { dirname as dirname10, join as join43 } from "node:path";
29773
+ import { existsSync as existsSync27, mkdirSync as mkdirSync17, readFileSync as readFileSync35, unlinkSync as unlinkSync7, writeFileSync as writeFileSync18 } from "node:fs";
29774
+ import { homedir as homedir12 } from "node:os";
29775
+ import { dirname as dirname10, join as join36 } from "node:path";
30061
29776
  function claudeConfigDir4() {
30062
- return process.env.CLAUDE_CONFIG_DIR || join43(homedir14(), ".claude");
29777
+ return process.env.CLAUDE_CONFIG_DIR || join36(homedir12(), ".claude");
30063
29778
  }
30064
29779
  function codexHome5() {
30065
- return process.env.CODEX_HOME || join43(homedir14(), ".codex");
29780
+ return process.env.CODEX_HOME || join36(homedir12(), ".codex");
30066
29781
  }
30067
29782
  function isRuleAgent(agent) {
30068
29783
  return Object.hasOwn(RULE_TARGETS, agent);
@@ -30091,7 +29806,7 @@ function ensureParent(path) {
30091
29806
  mkdirSync17(dirname10(path), { recursive: true });
30092
29807
  }
30093
29808
  function writeIfChanged2(path, content) {
30094
- if (!existsSync28(path)) {
29809
+ if (!existsSync27(path)) {
30095
29810
  ensureParent(path);
30096
29811
  writeFileSync18(path, content, "utf-8");
30097
29812
  return "created";
@@ -30124,7 +29839,7 @@ function buildSection(content, lineEnding = `
30124
29839
  return `${DOSU_RULE_SECTION_START}${lineEnding}${body}${lineEnding}${DOSU_RULE_SECTION_END}`;
30125
29840
  }
30126
29841
  function upsertSection(path, content) {
30127
- if (!existsSync28(path)) {
29842
+ if (!existsSync27(path)) {
30128
29843
  const section = buildSection(content);
30129
29844
  ensureParent(path);
30130
29845
  writeFileSync18(path, `${section}
@@ -30161,7 +29876,7 @@ function removeRuleForAgent(agent) {
30161
29876
  return null;
30162
29877
  const target = RULE_TARGETS[agent];
30163
29878
  const path = target.path();
30164
- if (!existsSync28(path))
29879
+ if (!existsSync27(path))
30165
29880
  return { agent, path, action: "not_found" };
30166
29881
  if (target.kind === "file") {
30167
29882
  unlinkSync7(path);
@@ -30204,36 +29919,32 @@ var init_installer = __esm(() => {
30204
29919
  RULE_TARGETS = {
30205
29920
  claude: {
30206
29921
  kind: "file",
30207
- path: () => join43(claudeConfigDir4(), "rules", "dosu.md")
29922
+ path: () => join36(claudeConfigDir4(), "rules", "dosu.md")
30208
29923
  },
30209
29924
  cursor: {
30210
29925
  kind: "file",
30211
- path: () => join43(homedir14(), ".cursor", "rules", "dosu.mdc"),
29926
+ path: () => join36(homedir12(), ".cursor", "rules", "dosu.mdc"),
30212
29927
  cursorFrontmatter: true
30213
29928
  },
30214
29929
  codex: {
30215
29930
  kind: "section",
30216
- path: () => join43(codexHome5(), "AGENTS.md")
29931
+ path: () => join36(codexHome5(), "AGENTS.md")
30217
29932
  },
30218
29933
  opencode: {
30219
29934
  kind: "section",
30220
- path: () => join43(homedir14(), ".config", "opencode", "AGENTS.md")
29935
+ path: () => join36(homedir12(), ".config", "opencode", "AGENTS.md")
30221
29936
  },
30222
29937
  gemini: {
30223
29938
  kind: "section",
30224
- path: () => join43(homedir14(), ".gemini", "GEMINI.md")
30225
- },
30226
- antigravity: {
30227
- kind: "section",
30228
- path: () => join43(homedir14(), ".gemini", "GEMINI.md")
29939
+ path: () => join36(homedir12(), ".gemini", "GEMINI.md")
30229
29940
  }
30230
29941
  };
30231
29942
  });
30232
29943
 
30233
29944
  // src/setup/agents-md-step.ts
30234
29945
  import { execSync as execSync2 } from "node:child_process";
30235
- import { existsSync as existsSync29, readFileSync as readFileSync36, writeFileSync as writeFileSync19 } from "node:fs";
30236
- import { join as join44 } from "node:path";
29946
+ import { existsSync as existsSync28, readFileSync as readFileSync36, writeFileSync as writeFileSync19 } from "node:fs";
29947
+ import { join as join37 } from "node:path";
30237
29948
  function inGitWorkTree(cwd = process.cwd()) {
30238
29949
  try {
30239
29950
  const stdout = execSync2("git rev-parse --is-inside-work-tree", {
@@ -30247,8 +29958,8 @@ function inGitWorkTree(cwd = process.cwd()) {
30247
29958
  }
30248
29959
  function dosuAgentsSectionState(cwd = process.cwd()) {
30249
29960
  try {
30250
- const path = join44(cwd, "AGENTS.md");
30251
- if (!existsSync29(path))
29961
+ const path = join37(cwd, "AGENTS.md");
29962
+ if (!existsSync28(path))
30252
29963
  return "missing";
30253
29964
  const content = readFileSync36(path, "utf-8");
30254
29965
  const startMatch = content.match(SECTION_START_RE);
@@ -30285,8 +29996,8 @@ function findSection2(content) {
30285
29996
  return { start, end };
30286
29997
  }
30287
29998
  function upsertDosuAgentsSection(cwd = process.cwd(), content = FALLBACK_DOSU_RULE) {
30288
- const path = join44(cwd, "AGENTS.md");
30289
- if (!existsSync29(path)) {
29999
+ const path = join37(cwd, "AGENTS.md");
30000
+ if (!existsSync28(path)) {
30290
30001
  const section = buildDosuAgentsSection(content);
30291
30002
  writeFileSync19(path, `${section}
30292
30003
  `);
@@ -31109,7 +30820,7 @@ async function runSetupFlow(opts = {}) {
31109
30820
  return;
31110
30821
  }
31111
30822
  if (!refreshed.finishedOnboarding) {
31112
- log2.warn("Your account still needs onboarding. Finish it in the browser at the Dosu app, then re-run `dosu setup`.");
30823
+ log2.warn(wrapLog("Your account still needs onboarding. Finish it in the browser at the Dosu app, then re-run `dosu setup`."));
31113
30824
  trackInBackground(trackCliOnboardingEvent(cfg, onboardingRunID, "cli_onboarding_failed", {
31114
30825
  reason: "onboarding_incomplete_after_handshake"
31115
30826
  }));
@@ -31229,7 +30940,7 @@ async function stepOfferInitialSync(cfg) {
31229
30940
  backlog = inScope(await stepPickSyncScope(candidates, storedScope));
31230
30941
  n = offered(backlog).length;
31231
30942
  if (n === 0) {
31232
- log2.info("No sessions from those repos are waiting. Dosu memory learns from new ones.");
30943
+ log2.info(wrapLog("No sessions from those repos are waiting. Dosu memory learns from new ones."));
31233
30944
  recordCommandFacets({ backfill_offer: "not-offered" });
31234
30945
  return;
31235
30946
  }
@@ -32035,7 +31746,7 @@ var init_flow2 = __esm(() => {
32035
31746
  // src/commands/upgrade.ts
32036
31747
  import { spawnSync as spawnSync2 } from "node:child_process";
32037
31748
  import { realpathSync as realpathSync4 } from "node:fs";
32038
- import { homedir as homedir15 } from "node:os";
31749
+ import { homedir as homedir13 } from "node:os";
32039
31750
  import { posix, win32 } from "node:path";
32040
31751
  function installSpec(version = VERSION) {
32041
31752
  return `${PACKAGE_NAME}@${releaseTag(version)}`;
@@ -32092,7 +31803,7 @@ function packageRoots(manager, platform, comSpec, env, cwd) {
32092
31803
  manager === "npm" ? path.join(lines[0], "@dosu", "cli") : path.join(lines[0], "node_modules", "@dosu", "cli")
32093
31804
  ];
32094
31805
  }
32095
- function owningPackageManager(entrypoint, platform, comSpec, env = process.env, cwd = homedir15()) {
31806
+ function owningPackageManager(entrypoint, platform, comSpec, env = process.env, cwd = homedir13()) {
32096
31807
  const path = platform === "win32" ? win32 : posix;
32097
31808
  if (!entrypoint || !path.isAbsolute(entrypoint))
32098
31809
  return null;
@@ -32150,7 +31861,7 @@ function runUpgrade(channel = INSTALL_CHANNEL, options = {}) {
32150
31861
  }
32151
31862
  const platform = options.platform ?? process.platform;
32152
31863
  const env = options.env ?? process.env;
32153
- const cwd = options.cwd ?? homedir15();
31864
+ const cwd = options.cwd ?? homedir13();
32154
31865
  let manager = null;
32155
31866
  if (channel === "npm") {
32156
31867
  if (isNpxInvocation(channel, env)) {
@@ -32217,7 +31928,7 @@ function finishWithNewBinary(channel, options) {
32217
31928
  return;
32218
31929
  }
32219
31930
  const result = spawnSync2(invocation.command, invocation.args, {
32220
- cwd: options.cwd ?? homedir15(),
31931
+ cwd: options.cwd ?? homedir13(),
32221
31932
  shell: false,
32222
31933
  stdio: "inherit"
32223
31934
  });
@@ -32335,14 +32046,14 @@ var init_upgrade = __esm(() => {
32335
32046
  });
32336
32047
 
32337
32048
  // src/version/incognito-backfill-check.ts
32338
- import { existsSync as existsSync30, mkdirSync as mkdirSync18, writeFileSync as writeFileSync20 } from "node:fs";
32339
- import { join as join45 } from "node:path";
32049
+ import { existsSync as existsSync29, mkdirSync as mkdirSync18, writeFileSync as writeFileSync20 } from "node:fs";
32050
+ import { join as join38 } from "node:path";
32340
32051
  function markerPath() {
32341
- return join45(getConfigDir(), MARKER_FILENAME);
32052
+ return join38(getConfigDir(), MARKER_FILENAME);
32342
32053
  }
32343
32054
  function writeMarker() {
32344
32055
  const dir = getConfigDir();
32345
- if (!existsSync30(dir))
32056
+ if (!existsSync29(dir))
32346
32057
  mkdirSync18(dir, { recursive: true, mode: 448 });
32347
32058
  writeFileSync20(markerPath(), JSON.stringify({ done: true }), { mode: 384 });
32348
32059
  }
@@ -32355,7 +32066,7 @@ ${import_picocolors40.default.green(`✓ Dosu: added the incognito command to ${
32355
32066
  function checkForIncognitoBackfill(options = {}) {
32356
32067
  const notify = options.notify ?? true;
32357
32068
  try {
32358
- if (existsSync30(markerPath()))
32069
+ if (existsSync29(markerPath()))
32359
32070
  return;
32360
32071
  const added = [];
32361
32072
  let failed = false;
@@ -32392,8 +32103,8 @@ var init_incognito_backfill_check = __esm(() => {
32392
32103
  });
32393
32104
 
32394
32105
  // src/version/update-check.ts
32395
- import { existsSync as existsSync31, mkdirSync as mkdirSync19, readFileSync as readFileSync37, writeFileSync as writeFileSync21 } from "node:fs";
32396
- import { join as join46 } from "node:path";
32106
+ import { existsSync as existsSync30, mkdirSync as mkdirSync19, readFileSync as readFileSync37, writeFileSync as writeFileSync21 } from "node:fs";
32107
+ import { join as join39 } from "node:path";
32397
32108
  function isValidVersion2(value) {
32398
32109
  return typeof value === "string" && SEMVER_PATTERN.test(value);
32399
32110
  }
@@ -32446,12 +32157,12 @@ function isNewerRelease(candidate, current) {
32446
32157
  return false;
32447
32158
  }
32448
32159
  function getCachePath3() {
32449
- return join46(getConfigDir(), CACHE_FILENAME5);
32160
+ return join39(getConfigDir(), CACHE_FILENAME5);
32450
32161
  }
32451
32162
  function readCache() {
32452
32163
  try {
32453
32164
  const path = getCachePath3();
32454
- if (!existsSync31(path))
32165
+ if (!existsSync30(path))
32455
32166
  return null;
32456
32167
  const data = JSON.parse(readFileSync37(path, "utf-8"));
32457
32168
  if (typeof data.lastCheck === "number" && isValidVersion2(data.latestVersion)) {
@@ -32465,7 +32176,7 @@ function readCache() {
32465
32176
  function writeCache(cache) {
32466
32177
  try {
32467
32178
  const dir = getConfigDir();
32468
- if (!existsSync31(dir)) {
32179
+ if (!existsSync30(dir)) {
32469
32180
  mkdirSync19(dir, { recursive: true, mode: 448 });
32470
32181
  }
32471
32182
  writeFileSync21(getCachePath3(), JSON.stringify(cache), { mode: 384 });
@@ -32501,9 +32212,9 @@ function styleHint(hint) {
32501
32212
  return [before && import_picocolors41.default.dim(before), import_picocolors41.default.cyan(command), after && import_picocolors41.default.dim(after)].filter(Boolean).join("");
32502
32213
  }
32503
32214
  function framedNotice(content, width) {
32504
- const innerWidth = Math.max(...content.map(visibleWidth2)) + BOX_PADDING * 2;
32215
+ const innerWidth = Math.max(...content.map(visibleWidth)) + BOX_PADDING * 2;
32505
32216
  const framed = (line) => {
32506
- const pad = innerWidth - visibleWidth2(line);
32217
+ const pad = innerWidth - visibleWidth(line);
32507
32218
  const left = Math.floor(pad / 2);
32508
32219
  return `${import_picocolors41.default.yellow("│")}${" ".repeat(left)}${line}${" ".repeat(pad - left)}${import_picocolors41.default.yellow("│")}`;
32509
32220
  };
@@ -32921,7 +32632,7 @@ function wrapValue(text, room) {
32921
32632
  const append = (piece, sep) => {
32922
32633
  if (current === "")
32923
32634
  current = piece;
32924
- else if (visibleWidth2(current) + sep.length + visibleWidth2(piece) <= room) {
32635
+ else if (visibleWidth(current) + sep.length + visibleWidth(piece) <= room) {
32925
32636
  current += sep + piece;
32926
32637
  } else {
32927
32638
  lines.push(current);
@@ -32929,7 +32640,7 @@ function wrapValue(text, room) {
32929
32640
  }
32930
32641
  };
32931
32642
  for (const item of text.split(LIST_SEP)) {
32932
- const pieces = visibleWidth2(item) <= room ? [item] : item.split(" ");
32643
+ const pieces = visibleWidth(item) <= room ? [item] : item.split(" ");
32933
32644
  pieces.forEach((piece, i) => {
32934
32645
  append(piece, i === 0 ? LIST_SEP : " ");
32935
32646
  });
@@ -34980,4 +34691,4 @@ main().catch((err) => {
34980
34691
  process.exit(1);
34981
34692
  });
34982
34693
 
34983
- //# debugId=c8a0f0e8-7cd4-1cd4-6475-6e2164756e21
34694
+ //# debugId=dabff5ff-72af-9bac-6475-6e2164756e21