adhdev 0.6.49 → 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/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);
@@ -6431,6 +6443,7 @@ var init_router = __esm({
6431
6443
  init_config();
6432
6444
  init_workspaces();
6433
6445
  init_workspace_activity();
6446
+ init_config();
6434
6447
  init_ide_detector();
6435
6448
  init_logger();
6436
6449
  init_command_log();
@@ -6562,6 +6575,18 @@ var init_router = __esm({
6562
6575
  };
6563
6576
  LOG.info("LaunchIDE", `target=${ideKey || "auto"}`);
6564
6577
  const result = await launchWithCdp(launchArgs);
6578
+ if (result.success && (result.ideId || ideKey)) {
6579
+ try {
6580
+ addCliHistory({
6581
+ category: "ide",
6582
+ cliType: result.ideId || ideKey,
6583
+ dir: resolvedWorkspace || "",
6584
+ workspace: resolvedWorkspace || "",
6585
+ newWindow: args?.newWindow === true
6586
+ });
6587
+ } catch {
6588
+ }
6589
+ }
6565
6590
  if (result.success && result.port && result.ideId && !this.deps.cdpManagers.has(result.ideId)) {
6566
6591
  const logFn = this.deps.getCdpLogFn ? this.deps.getCdpLogFn(result.ideId) : LOG.forComponent(`CDP:${result.ideId}`).asLogFn();
6567
6592
  const provider = this.deps.providerLoader.getMeta(result.ideId);
@@ -25146,7 +25171,7 @@ ${installInfo}`
25146
25171
  }
25147
25172
  }
25148
25173
  try {
25149
- addCliHistory({ cliType: normalizedType, dir: resolvedDir, cliArgs });
25174
+ addCliHistory({ category: "acp", cliType: normalizedType, dir: resolvedDir, workspace: resolvedDir, cliArgs, model: initialModel });
25150
25175
  } catch (e) {
25151
25176
  LOG.warn("CLI", `ACP history save failed: ${e?.message}`);
25152
25177
  }
@@ -25235,7 +25260,7 @@ ${installInfo}`
25235
25260
  console.log(import_chalk.default.green(` \u2713 CLI started: ${cliInfo.displayName} v${cliInfo.version || "unknown"} in ${resolvedDir}`));
25236
25261
  }
25237
25262
  try {
25238
- addCliHistory({ cliType, dir: resolvedDir, cliArgs });
25263
+ addCliHistory({ category: "cli", cliType, dir: resolvedDir, workspace: resolvedDir, cliArgs, model: initialModel });
25239
25264
  } catch (e) {
25240
25265
  LOG.warn("CLI", `CLI history save failed: ${e?.message}`);
25241
25266
  }
@@ -30889,7 +30914,7 @@ var init_adhdev_daemon = __esm({
30889
30914
  fs11 = __toESM(require("fs"));
30890
30915
  path14 = __toESM(require("path"));
30891
30916
  import_chalk2 = __toESM(require("chalk"));
30892
- pkgVersion = "0.6.49";
30917
+ pkgVersion = "0.6.50";
30893
30918
  if (pkgVersion === "unknown") {
30894
30919
  try {
30895
30920
  const possiblePaths = [