adhdev 0.6.48 → 0.6.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -321,14 +321,26 @@ function addCliHistory(entry) {
321
321
  const config2 = loadConfig();
322
322
  const history = config2.cliHistory || [];
323
323
  const argsKey = (entry.cliArgs || []).join(" ");
324
+ const category = entry.category || "cli";
325
+ const workspaceKey = entry.workspace || "";
326
+ const modelKey = entry.model || "";
324
327
  const filtered = history.filter((h) => {
325
328
  const hArgsKey = (h.cliArgs || []).join(" ");
326
- return !(h.cliType === entry.cliType && h.dir === entry.dir && hArgsKey === argsKey);
329
+ return !((h.category || "cli") === category && h.cliType === entry.cliType && h.dir === entry.dir && hArgsKey === argsKey && (h.workspace || "") === workspaceKey && (h.model || "") === modelKey);
327
330
  });
328
331
  filtered.unshift({
329
332
  ...entry,
333
+ category,
330
334
  timestamp: Date.now(),
331
- label: entry.label || `${entry.cliType} \xB7 ${entry.dir.split("/").filter(Boolean).pop() || "root"}${argsKey ? ` (${argsKey})` : ""}`
335
+ label: entry.label || (() => {
336
+ const base = `${entry.cliType} \xB7 ${entry.dir.split("/").filter(Boolean).pop() || "root"}`;
337
+ const suffix = [];
338
+ if (entry.workspace && entry.workspace !== entry.dir) suffix.push(entry.workspace.split("/").filter(Boolean).pop() || entry.workspace);
339
+ if (entry.model) suffix.push(`model=${entry.model}`);
340
+ if (argsKey) suffix.push(argsKey);
341
+ if (entry.newWindow) suffix.push("new window");
342
+ return suffix.length > 0 ? `${base} (${suffix.join(" \xB7 ")})` : base;
343
+ })()
332
344
  });
333
345
  config2.cliHistory = filtered.slice(0, 20);
334
346
  saveConfig(config2);
@@ -6627,6 +6639,7 @@ var init_router = __esm({
6627
6639
  init_config();
6628
6640
  init_workspaces();
6629
6641
  init_workspace_activity();
6642
+ init_config();
6630
6643
  init_ide_detector();
6631
6644
  init_logger();
6632
6645
  init_command_log();
@@ -6758,6 +6771,18 @@ var init_router = __esm({
6758
6771
  };
6759
6772
  LOG.info("LaunchIDE", `target=${ideKey || "auto"}`);
6760
6773
  const result = await launchWithCdp(launchArgs);
6774
+ if (result.success && (result.ideId || ideKey)) {
6775
+ try {
6776
+ addCliHistory({
6777
+ category: "ide",
6778
+ cliType: result.ideId || ideKey,
6779
+ dir: resolvedWorkspace || "",
6780
+ workspace: resolvedWorkspace || "",
6781
+ newWindow: args?.newWindow === true
6782
+ });
6783
+ } catch {
6784
+ }
6785
+ }
6761
6786
  if (result.success && result.port && result.ideId && !this.deps.cdpManagers.has(result.ideId)) {
6762
6787
  const logFn = this.deps.getCdpLogFn ? this.deps.getCdpLogFn(result.ideId) : LOG.forComponent(`CDP:${result.ideId}`).asLogFn();
6763
6788
  const provider = this.deps.providerLoader.getMeta(result.ideId);
@@ -25342,7 +25367,7 @@ ${installInfo}`
25342
25367
  }
25343
25368
  }
25344
25369
  try {
25345
- addCliHistory({ cliType: normalizedType, dir: resolvedDir, cliArgs });
25370
+ addCliHistory({ category: "acp", cliType: normalizedType, dir: resolvedDir, workspace: resolvedDir, cliArgs, model: initialModel });
25346
25371
  } catch (e) {
25347
25372
  LOG.warn("CLI", `ACP history save failed: ${e?.message}`);
25348
25373
  }
@@ -25431,7 +25456,7 @@ ${installInfo}`
25431
25456
  console.log(import_chalk.default.green(` \u2713 CLI started: ${cliInfo.displayName} v${cliInfo.version || "unknown"} in ${resolvedDir}`));
25432
25457
  }
25433
25458
  try {
25434
- addCliHistory({ cliType, dir: resolvedDir, cliArgs });
25459
+ addCliHistory({ category: "cli", cliType, dir: resolvedDir, workspace: resolvedDir, cliArgs, model: initialModel });
25435
25460
  } catch (e) {
25436
25461
  LOG.warn("CLI", `CLI history save failed: ${e?.message}`);
25437
25462
  }
@@ -31329,7 +31354,7 @@ var init_adhdev_daemon = __esm({
31329
31354
  fs11 = __toESM(require("fs"));
31330
31355
  path14 = __toESM(require("path"));
31331
31356
  import_chalk2 = __toESM(require("chalk"));
31332
- pkgVersion = "0.6.48";
31357
+ pkgVersion = "0.6.50";
31333
31358
  if (pkgVersion === "unknown") {
31334
31359
  try {
31335
31360
  const possiblePaths = [