@dinoxx/dinox-cli 2.20.0 → 2.20.2

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/README.md CHANGED
@@ -52,7 +52,7 @@ Dinox CLI 适合这几类场景:
52
52
 
53
53
  安装前请先确认:
54
54
 
55
- - 推荐使用 Node.js 24 LTS;支持 Node.js 22、23、24、25(不支持 Node.js 21 及以下或 26+)
55
+ - 推荐使用 Node.js 24 或 26(LTS);支持 Node.js 22、23、24、25、26(不支持 Node.js 21 及以下或 27+)
56
56
  - 已安装 npm
57
57
  - 你的系统可以正常执行全局 npm 命令
58
58
 
@@ -65,7 +65,7 @@ npm -v
65
65
 
66
66
  ### 2.2 安装 Dinox CLI
67
67
 
68
- 先确认 `node -v` 是 v22、v23、v24 或 v25,再全局安装。npm 11.16 及以后默认不编译 `better-sqlite3` 和 `sharp`,安装命令要放行这两个包:
68
+ 先确认 `node -v` 是 v22 到 v26,再全局安装。npm 11.16 及以后默认不编译 `better-sqlite3` 和 `sharp`,安装命令要放行这两个包:
69
69
 
70
70
  ```bash
71
71
  npm install -g @dinoxx/dinox-cli@latest --allow-scripts=better-sqlite3,sharp
@@ -89,15 +89,12 @@ dino info
89
89
 
90
90
  ### 2.3 macOS 安装 Node.js(如果你还没装)
91
91
 
92
- Homebrew 的 `node` 公式现在是 Node.js 26,CLI 不能用它。安装 Node.js 24:
93
-
94
92
  ```bash
95
- brew install node@24
96
- export PATH="$(brew --prefix node@24)/bin:$PATH"
93
+ brew install node
97
94
  node -v
98
95
  ```
99
96
 
100
- `node -v` 应显示 v24。再执行上面的安装命令。
97
+ `node -v` 应显示 v22 到 v26。再执行上面的安装命令。
101
98
 
102
99
  ### 2.4 Windows 安装 Node.js(如果你还没装)
103
100
 
@@ -1022,9 +1019,9 @@ schema 包含命令路径、风险级别、参数、选项、输出字段和示
1022
1019
 
1023
1020
  ### Q1:安装或升级后出现 `allowScripts` / `Ignored build scripts`,或者一用就报 `better-sqlite3`
1024
1021
 
1025
- 原因:本地数据库依赖 `better-sqlite3`,图片处理依赖 `sharp`。npm 11.16+ 和 pnpm 10.15+ 默认不运行这两个包的安装脚本,本机程序就没有装上。Node.js 26 也不在支持范围内,Homebrew 的 `brew install node` 现在装的就是 26。
1022
+ 原因:本地数据库依赖 `better-sqlite3`,图片处理依赖 `sharp`。npm 11.16+ 和 pnpm 10.15+ 默认不运行这两个包的安装脚本,本机程序就没有装上。Node.js 21 及以下也不在支持范围内。
1026
1023
 
1027
- 解决:换成 Node.js 24,再重新安装。
1024
+ 解决:确认 Node.js 是 22 到 26,再重新安装。
1028
1025
 
1029
1026
  ```bash
1030
1027
  node -v
@@ -1032,7 +1029,7 @@ npm install -g @dinoxx/dinox-cli@latest --allow-scripts=better-sqlite3,sharp
1032
1029
  dino info
1033
1030
  ```
1034
1031
 
1035
- `node -v` 必须是 v22 到 v25。黄字警告本身不是升级失败;版本号没有变成最新版时,用上面这条命令,不要继续用旧的 `dino update`。
1032
+ `node -v` 必须是 v22 到 v26。黄字警告本身不是升级失败;版本号没有变成最新版时,用上面这条命令,不要继续用旧的 `dino update`。
1036
1033
 
1037
1034
  ### Q2:报错 `Missing resolved userId for the current authorization`
1038
1035
 
@@ -24,7 +24,7 @@ import {
24
24
  toAuthorizationHeaderValue,
25
25
  withAsyncRelease,
26
26
  writeDaemonLogLine
27
- } from "./chunk-DR6BGSZM.js";
27
+ } from "./chunk-CHGKDZV6.js";
28
28
  import {
29
29
  DEFAULT_TODO_FILTER,
30
30
  parseTodoAppend,
@@ -54,7 +54,7 @@ import {
54
54
  savePid,
55
55
  shutdownLegacyDaemon,
56
56
  waitForFreshDaemon
57
- } from "./chunk-ZHKS4R4P.js";
57
+ } from "./chunk-QFSMFANX.js";
58
58
  import {
59
59
  agentLaunch
60
60
  } from "./chunk-7ODU7LXP.js";
@@ -24220,7 +24220,7 @@ var DaemonServer = class {
24220
24220
  }
24221
24221
  };
24222
24222
  const execute = async () => {
24223
- const { runCli } = await import("./runCli-SBQE2VQJ.js");
24223
+ const { runCli } = await import("./runCli-ZJ7WYHJ7.js");
24224
24224
  const exitCode = await requestContext.run(context, () => runCli(input.argv));
24225
24225
  return { stdout: context.stdout.join(""), stderr: context.stderr.join(""), exitCode };
24226
24226
  };
@@ -2,7 +2,7 @@ import { createRequire as __dinoxCreateRequire } from 'node:module';
2
2
  const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  ensureDaemonRunning
5
- } from "./chunk-TAENC45D.js";
5
+ } from "./chunk-MDWXLRRN.js";
6
6
  import {
7
7
  WRITE_DURABILITY_OPTION,
8
8
  buildBatchWriteReceiptFields,
@@ -33,7 +33,7 @@ import {
33
33
  withCommandRuntime,
34
34
  withExclusivePowerSync,
35
35
  withNoteDatabase
36
- } from "./chunk-A6WF7CZL.js";
36
+ } from "./chunk-D3CETVY5.js";
37
37
  import {
38
38
  reportProgress
39
39
  } from "./chunk-BZQYECIH.js";
@@ -235,10 +235,10 @@ import {
235
235
  withNestedWriteTransaction,
236
236
  withPowerSyncWriteTransaction,
237
237
  withReadTransaction
238
- } from "./chunk-WC3GSQBC.js";
238
+ } from "./chunk-4GM3PRSK.js";
239
239
  import {
240
240
  executeCommandLine
241
- } from "./chunk-QNIYFLJT.js";
241
+ } from "./chunk-W4EWLODY.js";
242
242
  import {
243
243
  AI_SERVICE_URL,
244
244
  FORMAT_OPTIONS,
@@ -264,7 +264,7 @@ import {
264
264
  updateConfig,
265
265
  validateRequestId,
266
266
  withAsyncRelease
267
- } from "./chunk-DR6BGSZM.js";
267
+ } from "./chunk-CHGKDZV6.js";
268
268
  import {
269
269
  acquireDaemonExclusiveIntentLock,
270
270
  acquireDaemonStartLock,
@@ -277,7 +277,7 @@ import {
277
277
  readPid,
278
278
  sendDaemonRequest,
279
279
  shutdownDaemonForExclusiveAccess
280
- } from "./chunk-ZHKS4R4P.js";
280
+ } from "./chunk-QFSMFANX.js";
281
281
  import {
282
282
  agentLaunch
283
283
  } from "./chunk-7ODU7LXP.js";
@@ -1842,8 +1842,8 @@ function buildSubtreeChanges(args) {
1842
1842
  };
1843
1843
  });
1844
1844
  }
1845
- function parentPathOf2(path5) {
1846
- const segments = path5.split("/");
1845
+ function parentPathOf2(path6) {
1846
+ const segments = path6.split("/");
1847
1847
  if (segments.length <= 1) {
1848
1848
  return null;
1849
1849
  }
@@ -1883,32 +1883,32 @@ async function applySubtreePathChanges(args) {
1883
1883
  }
1884
1884
  }
1885
1885
  function parseRenameInput(input) {
1886
- const path5 = canonicalizeBoxPath(input.path);
1886
+ const path6 = canonicalizeBoxPath(input.path);
1887
1887
  const newName = canonicalizeBoxPath(input.newName);
1888
1888
  const userId = trimString(input.userId);
1889
- if (!path5) {
1889
+ if (!path6) {
1890
1890
  throw new DinoxError("Box path is required");
1891
1891
  }
1892
1892
  if (!newName || newName.includes("/")) {
1893
1893
  throw new DinoxError("New box name must be a single path segment");
1894
1894
  }
1895
- assertBoxPathLimits(path5);
1895
+ assertBoxPathLimits(path6);
1896
1896
  assertTextLimits("Box name", newName, MAX_BOX_NAME_LENGTH);
1897
- return { path: path5, newName, userId };
1897
+ return { path: path6, newName, userId };
1898
1898
  }
1899
1899
  function parseMoveInput(input) {
1900
- const path5 = canonicalizeBoxPath(input.path);
1900
+ const path6 = canonicalizeBoxPath(input.path);
1901
1901
  const to = canonicalizeBoxPath(input.to);
1902
1902
  const userId = trimString(input.userId);
1903
- if (!path5) {
1903
+ if (!path6) {
1904
1904
  throw new DinoxError("Box path is required");
1905
1905
  }
1906
1906
  if (!to) {
1907
1907
  throw new DinoxError("Target parent path is required");
1908
1908
  }
1909
- assertBoxPathLimits(path5);
1909
+ assertBoxPathLimits(path6);
1910
1910
  assertBoxPathLimits(to, "Target parent path");
1911
- return { path: path5, to, userId };
1911
+ return { path: path6, to, userId };
1912
1912
  }
1913
1913
  function parseMergeInput(input) {
1914
1914
  const from = canonicalizeBoxPath(input.from);
@@ -2376,10 +2376,10 @@ function requireArg(value, message) {
2376
2376
  return trimmed;
2377
2377
  }
2378
2378
  async function runBoxRename(context) {
2379
- const path5 = requireArg(context.args.path, "Box path is required");
2379
+ const path6 = requireArg(context.args.path, "Box path is required");
2380
2380
  const newName = requireArg(context.args.newName, "New box name is required");
2381
2381
  await withBoxWriteRuntime(context, async ({ runtime, userId, durability }) => {
2382
- const result = await renameBox(runtime.db, { path: path5, newName, userId }, { dryRun: Boolean(context.options.dryRun) });
2382
+ const result = await renameBox(runtime.db, { path: path6, newName, userId }, { dryRun: Boolean(context.options.dryRun) });
2383
2383
  if (Boolean(context.options.dryRun)) {
2384
2384
  printDryRunPreview(buildBoxMutationDryRunPreview({
2385
2385
  config: runtime.config,
@@ -2388,7 +2388,7 @@ async function runBoxRename(context) {
2388
2388
  action: "rename_box",
2389
2389
  risk: "write",
2390
2390
  summary: `Rename zettel box "${result.fromPath}" to "${result.toPath}".`,
2391
- inputs: { path: path5, new_name: newName },
2391
+ inputs: { path: path6, new_name: newName },
2392
2392
  changes: { updated_boxes: result.updatedBoxes }
2393
2393
  }), runtime);
2394
2394
  return;
@@ -2397,13 +2397,13 @@ async function runBoxRename(context) {
2397
2397
  });
2398
2398
  }
2399
2399
  async function runBoxMove(context) {
2400
- const path5 = requireArg(context.args.path, "Box path is required");
2400
+ const path6 = requireArg(context.args.path, "Box path is required");
2401
2401
  const to = typeof context.options.to === "string" ? context.options.to.trim() : "";
2402
2402
  if (!to) {
2403
2403
  throw new DinoxError("--to is required");
2404
2404
  }
2405
2405
  await withBoxWriteRuntime(context, async ({ runtime, userId, durability }) => {
2406
- const result = await moveBox(runtime.db, { path: path5, to, userId }, { dryRun: Boolean(context.options.dryRun) });
2406
+ const result = await moveBox(runtime.db, { path: path6, to, userId }, { dryRun: Boolean(context.options.dryRun) });
2407
2407
  if (Boolean(context.options.dryRun)) {
2408
2408
  printDryRunPreview(buildBoxMutationDryRunPreview({
2409
2409
  config: runtime.config,
@@ -2412,7 +2412,7 @@ async function runBoxMove(context) {
2412
2412
  action: "move_box",
2413
2413
  risk: "write",
2414
2414
  summary: `Move zettel box "${result.fromPath}" to "${result.toPath}".`,
2415
- inputs: { path: path5, to },
2415
+ inputs: { path: path6, to },
2416
2416
  changes: { updated_boxes: result.updatedBoxes }
2417
2417
  }), runtime);
2418
2418
  return;
@@ -3322,7 +3322,7 @@ var gatewayCommandGroup = {
3322
3322
  examples: ["dino gateway mcp"]
3323
3323
  },
3324
3324
  action: async () => {
3325
- const { serveDinoxMcpOverStdio } = await import("./mcpServer-T4DNYR7R.js");
3325
+ const { serveDinoxMcpOverStdio } = await import("./mcpServer-7VL4KJH2.js");
3326
3326
  await serveDinoxMcpOverStdio();
3327
3327
  }
3328
3328
  },
@@ -3404,7 +3404,7 @@ var editorCommandGroup = {
3404
3404
  examples: ["dino editor mcp", "dino editor mcp --session codex"]
3405
3405
  },
3406
3406
  action: async (context) => {
3407
- const { serveEditorMcpOverStdio } = await import("./mcp-PZBHAYXQ.js");
3407
+ const { serveEditorMcpOverStdio } = await import("./mcp-AK373P5P.js");
3408
3408
  await serveEditorMcpOverStdio({ session: String(context.options.session ?? "mcp") });
3409
3409
  }
3410
3410
  },
@@ -9800,8 +9800,8 @@ function registerSavedViewCommands(program) {
9800
9800
  // src/commands/skills/index.ts
9801
9801
  import { spawn as spawn2 } from "node:child_process";
9802
9802
  import { readFile } from "node:fs/promises";
9803
- import { homedir } from "node:os";
9804
- import path4 from "node:path";
9803
+ import { homedir as homedir2 } from "node:os";
9804
+ import path5 from "node:path";
9805
9805
  import { parse as parseYaml } from "yaml";
9806
9806
 
9807
9807
  // src/skills/registry.ts
@@ -9870,13 +9870,78 @@ function listRegisteredSkillNames() {
9870
9870
  return SKILL_REGISTRY.map((entry) => entry.name);
9871
9871
  }
9872
9872
 
9873
+ // src/skills/leftovers.ts
9874
+ import { createHash as createHash2 } from "node:crypto";
9875
+ import fs5 from "node:fs/promises";
9876
+ import { homedir } from "node:os";
9877
+ import path4 from "node:path";
9878
+ function defaultAgentSkillDirs(home = homedir()) {
9879
+ return [
9880
+ path4.join(home, ".claude", "skills"),
9881
+ path4.join(home, ".hermes", "skills"),
9882
+ path4.join(home, ".openclaw", "skills")
9883
+ ];
9884
+ }
9885
+ function gitObjectHash(type, body) {
9886
+ return createHash2("sha1").update(`${type} ${body.byteLength}\0`).update(body).digest();
9887
+ }
9888
+ async function gitTreeHash(dir) {
9889
+ return (await treeHash(dir)).toString("hex");
9890
+ }
9891
+ async function treeHash(dir) {
9892
+ const entries = await fs5.readdir(dir, { withFileTypes: true });
9893
+ const items = [];
9894
+ for (const entry of entries) {
9895
+ if (entry.name === ".DS_Store") continue;
9896
+ const full = path4.join(dir, entry.name);
9897
+ let mode;
9898
+ let hash;
9899
+ if (entry.isDirectory()) {
9900
+ mode = "40000";
9901
+ hash = await treeHash(full);
9902
+ } else if (entry.isSymbolicLink()) {
9903
+ mode = "120000";
9904
+ hash = gitObjectHash("blob", Buffer.from(await fs5.readlink(full)));
9905
+ } else {
9906
+ const stats = await fs5.stat(full);
9907
+ mode = stats.mode & 73 ? "100755" : "100644";
9908
+ hash = gitObjectHash("blob", await fs5.readFile(full));
9909
+ }
9910
+ items.push({
9911
+ // git orders tree entries as if directory names ended with '/'.
9912
+ sortKey: entry.isDirectory() ? `${entry.name}/` : entry.name,
9913
+ bytes: Buffer.concat([Buffer.from(`${mode} ${entry.name}\0`), hash])
9914
+ });
9915
+ }
9916
+ items.sort((a, b) => Buffer.compare(Buffer.from(a.sortKey), Buffer.from(b.sortKey)));
9917
+ return gitObjectHash("tree", Buffer.concat(items.map((item) => item.bytes)));
9918
+ }
9919
+ async function findRetiredSkillLeftover(input) {
9920
+ const folder = path4.join(input.skillsRoot, input.name);
9921
+ const stats = await fs5.lstat(folder).catch(() => null);
9922
+ if (!stats?.isDirectory()) return null;
9923
+ const official = await gitTreeHash(folder).then((hash) => hash === input.skillFolderHash, () => false);
9924
+ const links = [];
9925
+ for (const agentDir of input.agentSkillDirs) {
9926
+ const link = path4.join(agentDir, input.name);
9927
+ const target = await fs5.readlink(link).catch(() => null);
9928
+ if (target !== null && path4.resolve(agentDir, target) === folder) links.push(link);
9929
+ }
9930
+ return { path: folder, official, links };
9931
+ }
9932
+ async function removeRetiredSkillLeftover(leftover) {
9933
+ if (!leftover.official) throw new Error(`refusing to delete a modified skill folder: ${leftover.path}`);
9934
+ for (const link of leftover.links) await fs5.unlink(link).catch(() => void 0);
9935
+ await fs5.rm(leftover.path, { recursive: true, force: true });
9936
+ }
9937
+
9873
9938
  // src/commands/skills/index.ts
9874
9939
  var MAX_CAPTURED_INSTALLER_OUTPUT_BYTES = 64 * 1024;
9875
9940
  function isRecord(value) {
9876
9941
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
9877
9942
  }
9878
9943
  function defaultLockFilePath() {
9879
- return path4.join(homedir(), ".agents", ".skill-lock.json");
9944
+ return path5.join(homedir2(), ".agents", ".skill-lock.json");
9880
9945
  }
9881
9946
  async function defaultReadLockFile(lockFilePath) {
9882
9947
  return readFile(lockFilePath, "utf8");
@@ -9902,7 +9967,8 @@ function absentScan(lockFilePath) {
9902
9967
  total: skills.length,
9903
9968
  absent: skills.length,
9904
9969
  safeToRemove: 0,
9905
- conflict: 0
9970
+ conflict: 0,
9971
+ leftover: 0
9906
9972
  },
9907
9973
  skills
9908
9974
  };
@@ -9947,12 +10013,38 @@ async function readSkillsLock(lockFilePath, readLockFile) {
9947
10013
  entries: parsed.skills
9948
10014
  };
9949
10015
  }
9950
- async function scanRetiredSkillsLock(lockFilePath = defaultLockFilePath(), readLockFile = defaultReadLockFile) {
10016
+ async function scanRetiredSkillsLock(lockFilePath = defaultLockFilePath(), readLockFile = defaultReadLockFile, agentSkillDirs = defaultAgentSkillDirs()) {
9951
10017
  const lock = await readSkillsLock(lockFilePath, readLockFile);
9952
- if (!lock.found) {
9953
- return absentScan(lockFilePath);
10018
+ const scan = lock.found ? scanRetiredSkills(lockFilePath, lock) : absentScan(lockFilePath);
10019
+ return await withLeftovers(scan, path5.join(path5.dirname(lockFilePath), "skills"), agentSkillDirs);
10020
+ }
10021
+ async function withLeftovers(scan, skillsRoot, agentSkillDirs) {
10022
+ const skills = [];
10023
+ for (const skill of scan.skills) {
10024
+ if (skill.status !== "absent") {
10025
+ skills.push(skill);
10026
+ continue;
10027
+ }
10028
+ const leftover = await findRetiredSkillLeftover({
10029
+ name: skill.name,
10030
+ skillFolderHash: skill.expected.skillFolderHash,
10031
+ skillsRoot,
10032
+ agentSkillDirs
10033
+ });
10034
+ skills.push(leftover ? { ...skill, status: leftover.official ? "leftover" : "absent", leftover } : skill);
9954
10035
  }
9955
- return scanRetiredSkills(lockFilePath, lock);
10036
+ const count = (status) => skills.filter((skill) => skill.status === status).length;
10037
+ return {
10038
+ ...scan,
10039
+ summary: {
10040
+ total: skills.length,
10041
+ absent: count("absent"),
10042
+ safeToRemove: count("safe-to-remove"),
10043
+ conflict: count("conflict"),
10044
+ leftover: count("leftover")
10045
+ },
10046
+ skills
10047
+ };
9956
10048
  }
9957
10049
  function scanRetiredSkills(lockFilePath, lock) {
9958
10050
  const entries = lock.entries;
@@ -10001,7 +10093,8 @@ function scanRetiredSkills(lockFilePath, lock) {
10001
10093
  total: skills.length,
10002
10094
  absent: skills.filter((skill) => skill.status === "absent").length,
10003
10095
  safeToRemove: skills.filter((skill) => skill.status === "safe-to-remove").length,
10004
- conflict: skills.filter((skill) => skill.status === "conflict").length
10096
+ conflict: skills.filter((skill) => skill.status === "conflict").length,
10097
+ leftover: 0
10005
10098
  },
10006
10099
  skills
10007
10100
  };
@@ -10022,7 +10115,7 @@ function readSkillVersion(skillMarkdown) {
10022
10115
  }
10023
10116
  async function scanCurrentSkills(lockFilePath = defaultLockFilePath(), readLockFile = defaultReadLockFile, readInstalledSkill = defaultReadLockFile, expectedVersion = getPackageVersion()) {
10024
10117
  const lock = await readSkillsLock(lockFilePath, readLockFile);
10025
- const skillsRoot = path4.join(path4.dirname(lockFilePath), "skills");
10118
+ const skillsRoot = path5.join(path5.dirname(lockFilePath), "skills");
10026
10119
  const skills = [];
10027
10120
  for (const name of listRegisteredSkillNames()) {
10028
10121
  const rawEntry = Object.prototype.hasOwnProperty.call(lock.entries, name) ? lock.entries[name] : void 0;
@@ -10037,7 +10130,7 @@ async function scanCurrentSkills(lockFilePath = defaultLockFilePath(), readLockF
10037
10130
  }
10038
10131
  let installedVersion = null;
10039
10132
  try {
10040
- installedVersion = readSkillVersion(await readInstalledSkill(path4.join(skillsRoot, name, "SKILL.md")));
10133
+ installedVersion = readSkillVersion(await readInstalledSkill(path5.join(skillsRoot, name, "SKILL.md")));
10041
10134
  } catch {
10042
10135
  installedVersion = null;
10043
10136
  }
@@ -10133,6 +10226,7 @@ function resolveDependencies(overrides) {
10133
10226
  return {
10134
10227
  getLockFilePath: defaultLockFilePath,
10135
10228
  readLockFile: defaultReadLockFile,
10229
+ getAgentSkillDirs: () => defaultAgentSkillDirs(),
10136
10230
  readInstalledSkill: defaultReadLockFile,
10137
10231
  getExpectedVersion: getPackageVersion,
10138
10232
  runRemoval: runSkillsRemoval,
@@ -10152,10 +10246,15 @@ function printScan(scan) {
10152
10246
  );
10153
10247
  continue;
10154
10248
  }
10155
- printHumanReadableLine(`${skill.name}: ${skill.status}; replacement: ${replacementLabel(skill)}`);
10249
+ if (skill.leftover && !skill.leftover.official) {
10250
+ printHumanReadableLine(`${skill.name}: modified folder kept at ${skill.leftover.path} (not the official skill)`);
10251
+ continue;
10252
+ }
10253
+ const where = skill.status === "leftover" ? ` (folder ${skill.leftover?.path})` : "";
10254
+ printHumanReadableLine(`${skill.name}: ${skill.status}${where}; replacement: ${replacementLabel(skill)}`);
10156
10255
  }
10157
10256
  printHumanReadableLine(
10158
- `summary: safe-to-remove=${scan.summary.safeToRemove} conflict=${scan.summary.conflict} absent=${scan.summary.absent}`
10257
+ `summary: safe-to-remove=${scan.summary.safeToRemove} leftover=${scan.summary.leftover} conflict=${scan.summary.conflict} absent=${scan.summary.absent}`
10159
10258
  );
10160
10259
  }
10161
10260
  function printCurrentScan(current) {
@@ -10181,6 +10280,29 @@ function installerPayload(skillNames) {
10181
10280
  function safeSkillNames(scan) {
10182
10281
  return scan.skills.filter((skill) => skill.status === "safe-to-remove").map((skill) => skill.name);
10183
10282
  }
10283
+ function leftoverSkillNames(scan) {
10284
+ return scan.skills.filter((skill) => skill.status === "leftover").map((skill) => skill.name);
10285
+ }
10286
+ async function removeLeftovers(dependencies, lockFilePath, scan, planned) {
10287
+ const targets = scan.skills.filter(
10288
+ (skill) => skill.status === "leftover" && skill.leftover?.official && planned.includes(skill.name)
10289
+ );
10290
+ if (targets.length === 0) return scan;
10291
+ for (const skill of targets) {
10292
+ try {
10293
+ await removeRetiredSkillLeftover(skill.leftover);
10294
+ } catch (error) {
10295
+ throw new DinoxError(`Failed to remove the leftover folder of retired skill ${skill.name}`, {
10296
+ code: "SKILLS_MIGRATION_FAILED",
10297
+ cause: error,
10298
+ details: { skill: skill.name, path: skill.leftover.path },
10299
+ suggestion: "Check the folder permissions, then rerun `dino skills migrate --dry-run --format json`.",
10300
+ recoverable: true
10301
+ });
10302
+ }
10303
+ }
10304
+ return await rescanForVerification(dependencies, lockFilePath);
10305
+ }
10184
10306
  function conflictSkillNames(scan) {
10185
10307
  return scan.skills.filter((skill) => skill.status === "conflict").map((skill) => skill.name);
10186
10308
  }
@@ -10189,7 +10311,7 @@ function scanStatus(scan, name) {
10189
10311
  }
10190
10312
  async function rescanForVerification(dependencies, lockFilePath) {
10191
10313
  try {
10192
- return await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile);
10314
+ return await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile, dependencies.getAgentSkillDirs());
10193
10315
  } catch (error) {
10194
10316
  throw new DinoxError("Failed to verify the retired skills migration", {
10195
10317
  code: "SKILLS_MIGRATION_VERIFICATION_FAILED",
@@ -10223,7 +10345,7 @@ function createSkillsCommandGroup(overrides = {}) {
10223
10345
  },
10224
10346
  action: async (_context) => {
10225
10347
  const lockFilePath = dependencies.getLockFilePath();
10226
- const scan = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile);
10348
+ const scan = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile, dependencies.getAgentSkillDirs());
10227
10349
  const current = await scanCurrentSkills(
10228
10350
  lockFilePath,
10229
10351
  dependencies.readLockFile,
@@ -10290,10 +10412,11 @@ function createSkillsCommandGroup(overrides = {}) {
10290
10412
  });
10291
10413
  }
10292
10414
  const lockFilePath = dependencies.getLockFilePath();
10293
- const before = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile);
10294
- const plannedRemoval = safeSkillNames(before);
10415
+ const before = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile, dependencies.getAgentSkillDirs());
10416
+ const lockRemoval = safeSkillNames(before);
10417
+ const plannedRemoval = [...lockRemoval, ...leftoverSkillNames(before)];
10295
10418
  const conflicts = conflictSkillNames(before);
10296
- const installer = installerPayload(plannedRemoval);
10419
+ const installer = installerPayload(lockRemoval);
10297
10420
  if (!confirmed) {
10298
10421
  const payload2 = {
10299
10422
  mode: "dry-run",
@@ -10339,9 +10462,9 @@ function createSkillsCommandGroup(overrides = {}) {
10339
10462
  printHumanReadableLine("verified: yes");
10340
10463
  return;
10341
10464
  }
10342
- const preExecution = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile);
10465
+ const preExecution = await scanRetiredSkillsLock(lockFilePath, dependencies.readLockFile, dependencies.getAgentSkillDirs());
10343
10466
  const changedCandidates = plannedRemoval.filter(
10344
- (name) => scanStatus(preExecution, name) !== "safe-to-remove"
10467
+ (name) => scanStatus(preExecution, name) !== scanStatus(before, name)
10345
10468
  );
10346
10469
  if (changedCandidates.length > 0) {
10347
10470
  throw new DinoxError("The skills installer lock changed before migration execution", {
@@ -10357,9 +10480,9 @@ function createSkillsCommandGroup(overrides = {}) {
10357
10480
  recoverable: true
10358
10481
  });
10359
10482
  }
10360
- const execution = await dependencies.runRemoval(plannedRemoval);
10361
- const after = await rescanForVerification(dependencies, lockFilePath);
10362
- if (execution.exitCode !== 0) {
10483
+ const execution = lockRemoval.length > 0 ? await dependencies.runRemoval(lockRemoval) : null;
10484
+ const afterInstaller = await rescanForVerification(dependencies, lockFilePath);
10485
+ if (execution && execution.exitCode !== 0) {
10363
10486
  throw new DinoxError(`The skills installer exited with code ${execution.exitCode ?? "unknown"}`, {
10364
10487
  code: "SKILLS_MIGRATION_FAILED",
10365
10488
  details: {
@@ -10367,12 +10490,13 @@ function createSkillsCommandGroup(overrides = {}) {
10367
10490
  exitCode: execution.exitCode,
10368
10491
  ...execution.stdout.trim() ? { stdout: execution.stdout.trim() } : {},
10369
10492
  ...execution.stderr.trim() ? { stderr: execution.stderr.trim() } : {},
10370
- after
10493
+ after: afterInstaller
10371
10494
  },
10372
10495
  suggestion: "Run `dino skills doctor --format json` before deciding whether to retry.",
10373
10496
  recoverable: true
10374
10497
  });
10375
10498
  }
10499
+ const after = await removeLeftovers(dependencies, lockFilePath, afterInstaller, plannedRemoval);
10376
10500
  const remainingCandidates = plannedRemoval.filter(
10377
10501
  (name) => scanStatus(after, name) !== "absent"
10378
10502
  );
@@ -10383,7 +10507,7 @@ function createSkillsCommandGroup(overrides = {}) {
10383
10507
  throw new DinoxError("Retired skills migration verification failed", {
10384
10508
  code: "SKILLS_MIGRATION_VERIFICATION_FAILED",
10385
10509
  details: {
10386
- command: execution.invocation.displayCommand,
10510
+ command: execution?.invocation.displayCommand ?? null,
10387
10511
  remainingCandidates,
10388
10512
  unexpectedlyRemovedConflicts,
10389
10513
  before,
@@ -11363,7 +11487,7 @@ var clipCommandGroup = {
11363
11487
  examples: ["dino clip inspect https://example.com/article --format json"]
11364
11488
  },
11365
11489
  action: async (context) => {
11366
- const { runClipInspect } = await import("./run-GCMWLTIV.js");
11490
+ const { runClipInspect } = await import("./run-OYMMVKCB.js");
11367
11491
  await runClipInspect(context);
11368
11492
  }
11369
11493
  },
@@ -11421,7 +11545,7 @@ var clipCommandGroup = {
11421
11545
  ]
11422
11546
  },
11423
11547
  action: async (context) => {
11424
- const { runClipAdd } = await import("./run-GCMWLTIV.js");
11548
+ const { runClipAdd } = await import("./run-OYMMVKCB.js");
11425
11549
  await runClipAdd(context);
11426
11550
  }
11427
11551
  },
@@ -11442,7 +11566,7 @@ var clipCommandGroup = {
11442
11566
  examples: ["dino clip process 01a1e3bb-3827-790d-b850-52b187c12b53 --format json"]
11443
11567
  },
11444
11568
  action: async (context) => {
11445
- const { runClipProcess } = await import("./run-GCMWLTIV.js");
11569
+ const { runClipProcess } = await import("./run-OYMMVKCB.js");
11446
11570
  await runClipProcess(context);
11447
11571
  }
11448
11572
  },
@@ -11598,8 +11722,8 @@ function rewriteTagList(tags, oldPrefix, newPrefix, preserveSuffix) {
11598
11722
  function pathKey(value) {
11599
11723
  return canonicalizeTagPath(value).toLowerCase();
11600
11724
  }
11601
- function getPathId(path5, lookup) {
11602
- return lookup?.idByPath.get(pathKey(path5)) ?? canonicalizeTagPath(path5);
11725
+ function getPathId(path6, lookup) {
11726
+ return lookup?.idByPath.get(pathKey(path6)) ?? canonicalizeTagPath(path6);
11603
11727
  }
11604
11728
  function parseJson2(raw) {
11605
11729
  if (!raw) {
@@ -11634,9 +11758,9 @@ function rewriteHashtagsInJson(raw, oldPrefix, newPrefix, preserveSuffix, lookup
11634
11758
  let current = node;
11635
11759
  if (current.type === "hashtag") {
11636
11760
  const attrs = { ...current.attrs ?? {} };
11637
- const path5 = extractHashtagPath(attrs, lookup);
11638
- if (path5 && isTagPathWithinPrefix(path5, oldPrefix)) {
11639
- const nextPath = preserveSuffix ? renameTagPathWithPrefix(path5, oldPrefix, newPrefix) : canonicalizeTagPath(newPrefix);
11761
+ const path6 = extractHashtagPath(attrs, lookup);
11762
+ if (path6 && isTagPathWithinPrefix(path6, oldPrefix)) {
11763
+ const nextPath = preserveSuffix ? renameTagPathWithPrefix(path6, oldPrefix, newPrefix) : canonicalizeTagPath(newPrefix);
11640
11764
  const nextId = getPathId(nextPath, lookup);
11641
11765
  if (attrs.label !== nextPath || attrs.id !== nextId) {
11642
11766
  current = {
@@ -11683,9 +11807,9 @@ function collectPlainText(node, lookup) {
11683
11807
  const chunks = [];
11684
11808
  const visit = (current) => {
11685
11809
  if (current.type === "hashtag") {
11686
- const path5 = extractHashtagPath(current.attrs, lookup);
11687
- if (path5) {
11688
- chunks.push(`#${path5}`);
11810
+ const path6 = extractHashtagPath(current.attrs, lookup);
11811
+ if (path6) {
11812
+ chunks.push(`#${path6}`);
11689
11813
  }
11690
11814
  return;
11691
11815
  }
@@ -11770,9 +11894,9 @@ function rewriteHashtagsInMarkdown(raw, oldPrefix, newPrefix, preserveSuffix) {
11770
11894
  index += 1;
11771
11895
  continue;
11772
11896
  }
11773
- const path5 = canonicalizeTagPath(match.label);
11774
- if (path5 && isTagPathWithinPrefix(path5, oldPrefix)) {
11775
- const nextPath = preserveSuffix ? renameTagPathWithPrefix(path5, oldPrefix, newPrefix) : canonicalizeTagPath(newPrefix);
11897
+ const path6 = canonicalizeTagPath(match.label);
11898
+ if (path6 && isTagPathWithinPrefix(path6, oldPrefix)) {
11899
+ const nextPath = preserveSuffix ? renameTagPathWithPrefix(path6, oldPrefix, newPrefix) : canonicalizeTagPath(newPrefix);
11776
11900
  output += `#${nextPath}`;
11777
11901
  changed = true;
11778
11902
  } else {
@@ -11966,26 +12090,26 @@ function buildTagReferenceLookup(nodes, changes = [], aliases = []) {
11966
12090
  const idByPath = /* @__PURE__ */ new Map();
11967
12091
  const pathById = /* @__PURE__ */ new Map();
11968
12092
  for (const node of activeTagNodes(nodes)) {
11969
- const path5 = canonicalizeTagPath(node.fullPath);
11970
- if (!path5) {
12093
+ const path6 = canonicalizeTagPath(node.fullPath);
12094
+ if (!path6) {
11971
12095
  continue;
11972
12096
  }
11973
- idByPath.set(normalizeTagLookupKey(path5), node.id);
11974
- pathById.set(node.id, path5);
12097
+ idByPath.set(normalizeTagLookupKey(path6), node.id);
12098
+ pathById.set(node.id, path6);
11975
12099
  }
11976
12100
  for (const change of changes) {
11977
- const path5 = canonicalizeTagPath(change.toPath);
11978
- if (!path5) {
12101
+ const path6 = canonicalizeTagPath(change.toPath);
12102
+ if (!path6) {
11979
12103
  continue;
11980
12104
  }
11981
- idByPath.set(normalizeTagLookupKey(path5), change.id);
12105
+ idByPath.set(normalizeTagLookupKey(path6), change.id);
11982
12106
  }
11983
12107
  for (const alias of aliases) {
11984
- const path5 = canonicalizeTagPath(alias.path);
11985
- if (!path5 || !alias.id) {
12108
+ const path6 = canonicalizeTagPath(alias.path);
12109
+ if (!path6 || !alias.id) {
11986
12110
  continue;
11987
12111
  }
11988
- idByPath.set(normalizeTagLookupKey(path5), alias.id);
12112
+ idByPath.set(normalizeTagLookupKey(path6), alias.id);
11989
12113
  }
11990
12114
  return { idByPath, pathById };
11991
12115
  }
@@ -12045,7 +12169,7 @@ async function applyTagPathChanges(tx, nodes, changes, timestamp) {
12045
12169
  }
12046
12170
  }
12047
12171
  async function renameTag(db, input, options = {}) {
12048
- const path5 = assertPath(input.path, "Tag path");
12172
+ const path6 = assertPath(input.path, "Tag path");
12049
12173
  const newName = parseSingleSegment(input.newName, "New tag name");
12050
12174
  const userId = trimString2(input.userId);
12051
12175
  const tagColumns = await getTableColumns2(db, "c_tag_node");
@@ -12053,7 +12177,7 @@ async function renameTag(db, input, options = {}) {
12053
12177
  assertCanWriteTag(tagColumns, userId, "update");
12054
12178
  assertRequiredColumns2("c_note", noteColumns, REQUIRED_NOTE_TAG_COLUMNS);
12055
12179
  const nodes = await loadTagNodes(db, tagColumns, { userId, dedupeByPath: true });
12056
- const root = requireActiveTagPath(nodes, path5, "Tag path");
12180
+ const root = requireActiveTagPath(nodes, path6, "Tag path");
12057
12181
  const newRootPath = parentPathOf(root.fullPath) ? `${parentPathOf(root.fullPath)}/${newName}` : newName;
12058
12182
  const changes = buildSubtreeChanges2(nodes, root, newRootPath);
12059
12183
  ensureNoTagPathConflict(nodes, changes);
@@ -12076,7 +12200,7 @@ async function renameTag(db, input, options = {}) {
12076
12200
  };
12077
12201
  }
12078
12202
  async function moveTag(db, input, options = {}) {
12079
- const path5 = assertPath(input.path, "Tag path");
12203
+ const path6 = assertPath(input.path, "Tag path");
12080
12204
  const to = assertPath(input.to, "Target parent path");
12081
12205
  const userId = trimString2(input.userId);
12082
12206
  const tagColumns = await getTableColumns2(db, "c_tag_node");
@@ -12084,7 +12208,7 @@ async function moveTag(db, input, options = {}) {
12084
12208
  assertCanWriteTag(tagColumns, userId, "update");
12085
12209
  assertRequiredColumns2("c_note", noteColumns, REQUIRED_NOTE_TAG_COLUMNS);
12086
12210
  const nodes = await loadTagNodes(db, tagColumns, { userId, dedupeByPath: true });
12087
- const root = requireActiveTagPath(nodes, path5, "Tag path");
12211
+ const root = requireActiveTagPath(nodes, path6, "Tag path");
12088
12212
  const parent = requireActiveTagPath(nodes, to, "Target parent path");
12089
12213
  if (root.id === parent.id || isTagPathWithinPrefix(parent.fullPath, root.fullPath)) {
12090
12214
  throw new DinoxError("Cannot move a tag under itself or one of its descendants");
@@ -12371,10 +12495,10 @@ function requireArg2(value, message) {
12371
12495
  return trimmed;
12372
12496
  }
12373
12497
  async function runTagRename(context) {
12374
- const path5 = requireArg2(context.args.path, "Tag path is required");
12498
+ const path6 = requireArg2(context.args.path, "Tag path is required");
12375
12499
  const newName = requireArg2(context.args.newName, "New tag name is required");
12376
12500
  await withTagWriteRuntime(context, async ({ runtime, userId, durability }) => {
12377
- const result = await renameTag(runtime.db, { path: path5, newName, userId }, { dryRun: Boolean(context.options.dryRun) });
12501
+ const result = await renameTag(runtime.db, { path: path6, newName, userId }, { dryRun: Boolean(context.options.dryRun) });
12378
12502
  if (Boolean(context.options.dryRun)) {
12379
12503
  printDryRunPreview(buildTagMutationDryRunPreview({
12380
12504
  config: runtime.config,
@@ -12383,7 +12507,7 @@ async function runTagRename(context) {
12383
12507
  action: "rename_tag",
12384
12508
  risk: "write",
12385
12509
  summary: `Rename tag "${result.fromPath}" to "${result.toPath}".`,
12386
- inputs: { path: path5, new_name: newName },
12510
+ inputs: { path: path6, new_name: newName },
12387
12511
  changes: { updated_tags: result.updatedTags, updated_notes: result.updatedNotes }
12388
12512
  }), runtime);
12389
12513
  return;
@@ -12392,13 +12516,13 @@ async function runTagRename(context) {
12392
12516
  });
12393
12517
  }
12394
12518
  async function runTagMove(context) {
12395
- const path5 = requireArg2(context.args.path, "Tag path is required");
12519
+ const path6 = requireArg2(context.args.path, "Tag path is required");
12396
12520
  const to = typeof context.options.to === "string" ? context.options.to.trim() : "";
12397
12521
  if (!to) {
12398
12522
  throw new DinoxError("--to is required");
12399
12523
  }
12400
12524
  await withTagWriteRuntime(context, async ({ runtime, userId, durability }) => {
12401
- const result = await moveTag(runtime.db, { path: path5, to, userId }, { dryRun: Boolean(context.options.dryRun) });
12525
+ const result = await moveTag(runtime.db, { path: path6, to, userId }, { dryRun: Boolean(context.options.dryRun) });
12402
12526
  if (Boolean(context.options.dryRun)) {
12403
12527
  printDryRunPreview(buildTagMutationDryRunPreview({
12404
12528
  config: runtime.config,
@@ -12407,7 +12531,7 @@ async function runTagMove(context) {
12407
12531
  action: "move_tag",
12408
12532
  risk: "write",
12409
12533
  summary: `Move tag "${result.fromPath}" to "${result.toPath}".`,
12410
- inputs: { path: path5, to },
12534
+ inputs: { path: path6, to },
12411
12535
  changes: { updated_tags: result.updatedTags, updated_notes: result.updatedNotes }
12412
12536
  }), runtime);
12413
12537
  return;
@@ -13133,12 +13257,12 @@ async function parseJsonInput(value, optionName) {
13133
13257
  throw new DinoxError(`${optionName} must be valid JSON`, { code: "INVALID_ARGUMENT", cause: error });
13134
13258
  }
13135
13259
  }
13136
- function toDraftItems(value, path5 = "--items") {
13260
+ function toDraftItems(value, path6 = "--items") {
13137
13261
  if (!Array.isArray(value)) {
13138
- throw new DinoxError(`${path5} must be a JSON array of task items`, { code: "INVALID_ARGUMENT" });
13262
+ throw new DinoxError(`${path6} must be a JSON array of task items`, { code: "INVALID_ARGUMENT" });
13139
13263
  }
13140
13264
  return value.map((entry, index) => {
13141
- const where = `${path5}[${index}]`;
13265
+ const where = `${path6}[${index}]`;
13142
13266
  if (typeof entry === "string") return { text: entry };
13143
13267
  if (!entry || typeof entry !== "object") {
13144
13268
  throw new DinoxError(`${where} must be a string or an object with "text"`, { code: "INVALID_ARGUMENT" });
@@ -13996,7 +14120,7 @@ function parseMcpGroups(raw) {
13996
14120
  }
13997
14121
  async function runMcp(context) {
13998
14122
  const groups = parseMcpGroups(context.options.groups);
13999
- const { serveStandaloneMcpOverStdio } = await import("./mcpServer-T4DNYR7R.js");
14123
+ const { serveStandaloneMcpOverStdio } = await import("./mcpServer-7VL4KJH2.js");
14000
14124
  await serveStandaloneMcpOverStdio({ readOnly: context.options.readOnly === true, groups });
14001
14125
  }
14002
14126
  var mcpCommandDescriptor = {
@@ -14080,8 +14204,8 @@ var COMMAND_SCHEMA_MAP = new Map(COMMAND_SCHEMAS.map((schema) => [schema.path, s
14080
14204
  function listCommandSchemas() {
14081
14205
  return [...COMMAND_SCHEMAS];
14082
14206
  }
14083
- function findCommandSchema(path5) {
14084
- return COMMAND_SCHEMA_MAP.get(path5) ?? null;
14207
+ function findCommandSchema(path6) {
14208
+ return COMMAND_SCHEMA_MAP.get(path6) ?? null;
14085
14209
  }
14086
14210
 
14087
14211
  export {
@@ -8,7 +8,7 @@ import {
8
8
  getDaemonInfo,
9
9
  getDaemonService,
10
10
  sendDaemonRequest
11
- } from "./chunk-ZHKS4R4P.js";
11
+ } from "./chunk-QFSMFANX.js";
12
12
  import {
13
13
  getPackageVersion
14
14
  } from "./chunk-WMJXAF3X.js";
@@ -736,7 +736,7 @@ var forwardDependencies = {
736
736
  return Boolean(info && matchesRuntimeTokenBinding(info, version, config));
737
737
  },
738
738
  ensureDaemonRunning: async () => {
739
- await (await import("./ensure-MLNCD2SD.js")).ensureDaemonRunning();
739
+ await (await import("./ensure-E3DIRHSQ.js")).ensureDaemonRunning();
740
740
  },
741
741
  sendDaemonRequest,
742
742
  envTokenOverridesLogin,
@@ -14,13 +14,13 @@ import {
14
14
  waitForDownloadIdle,
15
15
  waitForLastSyncedAfter,
16
16
  waitForUploadQueueEmpty
17
- } from "./chunk-WC3GSQBC.js";
17
+ } from "./chunk-4GM3PRSK.js";
18
18
  import {
19
19
  fingerprintDaemonRuntimeConfig,
20
20
  loadConfig,
21
21
  parseSyncTimeoutMs,
22
22
  resolveConfig
23
- } from "./chunk-DR6BGSZM.js";
23
+ } from "./chunk-CHGKDZV6.js";
24
24
  import {
25
25
  acquireDaemonExclusiveIntentLock,
26
26
  acquireDaemonStartLock,
@@ -32,7 +32,7 @@ import {
32
32
  remainingDeadlineMs,
33
33
  runWithinDeadline,
34
34
  shutdownDaemonForExclusiveAccess
35
- } from "./chunk-ZHKS4R4P.js";
35
+ } from "./chunk-QFSMFANX.js";
36
36
  import {
37
37
  getPackageVersion
38
38
  } from "./chunk-WMJXAF3X.js";
@@ -5,7 +5,7 @@ import {
5
5
  hydrateResolvedAuthIdentity,
6
6
  restartDaemonLocked,
7
7
  stopDaemonLocked
8
- } from "./chunk-WC3GSQBC.js";
8
+ } from "./chunk-4GM3PRSK.js";
9
9
  import {
10
10
  daemonServiceSpec,
11
11
  fingerprintDaemonRuntimeConfig,
@@ -17,7 +17,7 @@ import {
17
17
  resolveConfig,
18
18
  usableDaemonService,
19
19
  withAsyncRelease
20
- } from "./chunk-DR6BGSZM.js";
20
+ } from "./chunk-CHGKDZV6.js";
21
21
  import {
22
22
  acquireDaemonStartLock,
23
23
  getDaemonInfo,
@@ -27,7 +27,7 @@ import {
27
27
  isProcessRunning,
28
28
  readPid,
29
29
  waitForFreshDaemon
30
- } from "./chunk-ZHKS4R4P.js";
30
+ } from "./chunk-QFSMFANX.js";
31
31
  import {
32
32
  getPackageVersion
33
33
  } from "./chunk-WMJXAF3X.js";
@@ -128,6 +128,12 @@ var LaunchdService = class {
128
128
  async isLoaded() {
129
129
  return (await this.run("launchctl", ["print", this.target])).code === 0;
130
130
  }
131
+ /** null: not loaded; otherwise whether a daemon process is up. */
132
+ async loadedState() {
133
+ const result = await this.run("launchctl", ["print", this.target]);
134
+ if (result.code !== 0) return null;
135
+ return { running: /^\s*state = running$/m.test(result.stdout) };
136
+ }
131
137
  async bootstrap() {
132
138
  let result = null;
133
139
  for (let attempt = 0; attempt < LAUNCHD_BOOTSTRAP_ATTEMPTS; attempt += 1) {
@@ -143,12 +149,10 @@ var LaunchdService = class {
143
149
  await this.bootstrap();
144
150
  }
145
151
  async start() {
146
- if (!await this.isLoaded()) {
147
- await this.bootstrap();
148
- return;
149
- }
150
- const result = await this.run("launchctl", ["kickstart", this.target]);
151
- if (result.code !== 0) throw failed(this.kind, "kickstart", result);
152
+ const state = await this.loadedState();
153
+ if (state?.running) return;
154
+ if (state) await this.stop();
155
+ await this.bootstrap();
152
156
  }
153
157
  async stop() {
154
158
  const result = await this.run("launchctl", ["bootout", this.target]);
@@ -4,7 +4,7 @@ import {
4
4
  requestIdFromArgv,
5
5
  runWithRequestId,
6
6
  tryForwardToDaemon
7
- } from "./chunk-DR6BGSZM.js";
7
+ } from "./chunk-CHGKDZV6.js";
8
8
  import {
9
9
  localCommandExecution,
10
10
  requestContext
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  // src/requests/execute.ts
14
14
  async function runCapturedInProcess(argv, onFatalError) {
15
- const { runCli } = await import("./runCli-SBQE2VQJ.js");
15
+ const { runCli } = await import("./runCli-ZJ7WYHJ7.js");
16
16
  const context = {
17
17
  stdout: [],
18
18
  stderr: [],
@@ -2,11 +2,11 @@ import { createRequire as __dinoxCreateRequire } from 'node:module';
2
2
  const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  ensureDaemonRunning
5
- } from "./chunk-TAENC45D.js";
6
- import "./chunk-WC3GSQBC.js";
7
- import "./chunk-DR6BGSZM.js";
5
+ } from "./chunk-MDWXLRRN.js";
6
+ import "./chunk-4GM3PRSK.js";
7
+ import "./chunk-CHGKDZV6.js";
8
8
  import "./chunk-BKCNERPB.js";
9
- import "./chunk-ZHKS4R4P.js";
9
+ import "./chunk-QFSMFANX.js";
10
10
  import "./chunk-7ODU7LXP.js";
11
11
  import "./chunk-WMJXAF3X.js";
12
12
  import "./chunk-6D3QLMRM.js";
@@ -3,9 +3,9 @@ const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  executeCommandLine,
5
5
  runCapturedInProcess
6
- } from "./chunk-QNIYFLJT.js";
7
- import "./chunk-DR6BGSZM.js";
8
- import "./chunk-ZHKS4R4P.js";
6
+ } from "./chunk-W4EWLODY.js";
7
+ import "./chunk-CHGKDZV6.js";
8
+ import "./chunk-QFSMFANX.js";
9
9
  import "./chunk-WMJXAF3X.js";
10
10
  import "./chunk-6D3QLMRM.js";
11
11
  import "./chunk-XZLFMJOG.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-BKCNERPB.js";
6
6
  import {
7
7
  sendDaemonRequest
8
- } from "./chunk-ZHKS4R4P.js";
8
+ } from "./chunk-QFSMFANX.js";
9
9
  import {
10
10
  editorPackageRoot
11
11
  } from "./chunk-7A5QISPG.js";
@@ -267,7 +267,7 @@ function createEditorMcpServer(options = {}) {
267
267
  return server;
268
268
  }
269
269
  async function serveEditorMcpOverStdio(options = {}) {
270
- const { ensureDaemonRunning } = await import("./ensure-MLNCD2SD.js");
270
+ const { ensureDaemonRunning } = await import("./ensure-E3DIRHSQ.js");
271
271
  let ensured = null;
272
272
  const ensure = () => ensured ??= ensureDaemonRunning().finally(() => {
273
273
  ensured = null;
@@ -3,9 +3,9 @@ const require = __dinoxCreateRequire(import.meta.url);
3
3
  import {
4
4
  MCP_COMMAND_GROUPS,
5
5
  listCommandSchemas
6
- } from "./chunk-N6ALWINB.js";
7
- import "./chunk-TAENC45D.js";
8
- import "./chunk-A6WF7CZL.js";
6
+ } from "./chunk-7MGDG5BW.js";
7
+ import "./chunk-MDWXLRRN.js";
8
+ import "./chunk-D3CETVY5.js";
9
9
  import "./chunk-BZQYECIH.js";
10
10
  import {
11
11
  DINOX_MCP_SERVER_NAME,
@@ -14,15 +14,15 @@ import {
14
14
  GATEWAY_SESSION_CWD_ENV,
15
15
  GATEWAY_SESSION_TOKEN_ENV,
16
16
  READ_CONVERSATION_MAX_LIMIT
17
- } from "./chunk-WC3GSQBC.js";
18
- import "./chunk-QNIYFLJT.js";
17
+ } from "./chunk-4GM3PRSK.js";
18
+ import "./chunk-W4EWLODY.js";
19
19
  import {
20
20
  tryForwardToDaemon
21
- } from "./chunk-DR6BGSZM.js";
21
+ } from "./chunk-CHGKDZV6.js";
22
22
  import "./chunk-BKCNERPB.js";
23
23
  import {
24
24
  sendDaemonRequest
25
- } from "./chunk-ZHKS4R4P.js";
25
+ } from "./chunk-QFSMFANX.js";
26
26
  import "./chunk-7ODU7LXP.js";
27
27
  import {
28
28
  getPackageVersion
@@ -62,7 +62,7 @@ function createCliCommandRunner(overrides = {}) {
62
62
  noticeProvider: null,
63
63
  cwd: process.cwd()
64
64
  };
65
- const { printCliError } = await import("./runCli-SBQE2VQJ.js");
65
+ const { printCliError } = await import("./runCli-ZJ7WYHJ7.js");
66
66
  const code = requestContext.run(context, () => printCliError(error, argv));
67
67
  throw Object.assign(new Error(`Command failed with exit code ${code}`), {
68
68
  code,
@@ -25,7 +25,7 @@ import {
25
25
  syncBeforeNoteCommand,
26
26
  waitForMutationUpload,
27
27
  withNoteDatabase
28
- } from "./chunk-A6WF7CZL.js";
28
+ } from "./chunk-D3CETVY5.js";
29
29
  import {
30
30
  reportProgress
31
31
  } from "./chunk-BZQYECIH.js";
@@ -36,7 +36,7 @@ import {
36
36
  resolveZettelBoxIdsForCreate,
37
37
  uploadToOfficialStorage,
38
38
  validateTagsForCreate
39
- } from "./chunk-WC3GSQBC.js";
39
+ } from "./chunk-4GM3PRSK.js";
40
40
  import {
41
41
  isWorkbuddyUrl,
42
42
  normalizeWorkbuddyUrl
@@ -139,9 +139,9 @@ import {
139
139
  AI_SERVICE_URL,
140
140
  generateId,
141
141
  toAuthorizationHeaderValue
142
- } from "./chunk-DR6BGSZM.js";
142
+ } from "./chunk-CHGKDZV6.js";
143
143
  import "./chunk-BKCNERPB.js";
144
- import "./chunk-ZHKS4R4P.js";
144
+ import "./chunk-QFSMFANX.js";
145
145
  import "./chunk-7ODU7LXP.js";
146
146
  import "./chunk-WMJXAF3X.js";
147
147
  import {
@@ -27,23 +27,23 @@ import {
27
27
  registerTodoCommands,
28
28
  registerUpdateCommand,
29
29
  schemaCommandMetadata
30
- } from "./chunk-N6ALWINB.js";
31
- import "./chunk-TAENC45D.js";
32
- import "./chunk-A6WF7CZL.js";
30
+ } from "./chunk-7MGDG5BW.js";
31
+ import "./chunk-MDWXLRRN.js";
32
+ import "./chunk-D3CETVY5.js";
33
33
  import {
34
34
  setProgressReporting
35
35
  } from "./chunk-BZQYECIH.js";
36
36
  import {
37
37
  registerDaemonCommands,
38
38
  registerStandaloneCommand
39
- } from "./chunk-WC3GSQBC.js";
40
- import "./chunk-QNIYFLJT.js";
39
+ } from "./chunk-4GM3PRSK.js";
40
+ import "./chunk-W4EWLODY.js";
41
41
  import {
42
42
  GLOBAL_VALUE_OPTIONS,
43
43
  validateRequestId
44
- } from "./chunk-DR6BGSZM.js";
44
+ } from "./chunk-CHGKDZV6.js";
45
45
  import "./chunk-BKCNERPB.js";
46
- import "./chunk-ZHKS4R4P.js";
46
+ import "./chunk-QFSMFANX.js";
47
47
  import "./chunk-7ODU7LXP.js";
48
48
  import {
49
49
  getPackageVersion
package/dist/dinox.js CHANGED
@@ -6,8 +6,8 @@ import {
6
6
  requestIdFromArgv,
7
7
  runWithRequestId,
8
8
  tryForwardToDaemon
9
- } from "./chunks/chunk-DR6BGSZM.js";
10
- import "./chunks/chunk-ZHKS4R4P.js";
9
+ } from "./chunks/chunk-CHGKDZV6.js";
10
+ import "./chunks/chunk-QFSMFANX.js";
11
11
  import {
12
12
  getPackageVersion
13
13
  } from "./chunks/chunk-WMJXAF3X.js";
@@ -49,14 +49,14 @@ function applyDefaultFormat(argv2, env = process.env, stdoutIsTTY = Boolean(proc
49
49
  }
50
50
 
51
51
  // src/utils/nodeRuntime.ts
52
- var SUPPORTED_NODE_MAJORS = /* @__PURE__ */ new Set([22, 23, 24, 25]);
52
+ var SUPPORTED_NODE_MAJORS = /* @__PURE__ */ new Set([22, 23, 24, 25, 26]);
53
53
  function nodeMajor(version) {
54
54
  return Number(version.trim().replace(/^v/, "").split(".")[0] ?? 0) || 0;
55
55
  }
56
56
  function unsupportedNodeMessage(version) {
57
57
  const major = nodeMajor(version);
58
58
  if (SUPPORTED_NODE_MAJORS.has(major)) return null;
59
- return `Dinox CLI supports Node.js 22, 23, 24, and 25. This process is Node.js ${version}.`;
59
+ return `Dinox CLI supports Node.js 22, 23, 24, 25, and 26. This process is Node.js ${version}.`;
60
60
  }
61
61
  var NODE_INSTALL_SUGGESTION = "Install Node.js 24, confirm `node -v` prints v24, then run: npm install -g @dinoxx/dinox-cli@latest --allow-scripts=better-sqlite3,sharp";
62
62
 
@@ -121,10 +121,10 @@ try {
121
121
  process.stderr.write(forwarded.stderr);
122
122
  process.exitCode = forwarded.exitCode;
123
123
  } else {
124
- const { runCli } = await import("./chunks/runCli-SBQE2VQJ.js");
124
+ const { runCli } = await import("./chunks/runCli-ZJ7WYHJ7.js");
125
125
  const key = requestIdFromArgv(argv);
126
126
  if (key && commandExecutionTarget(argv) === "daemon") {
127
- const { runCapturedInProcess } = await import("./chunks/execute-57M65KKK.js");
127
+ const { runCapturedInProcess } = await import("./chunks/execute-YP2N2AMS.js");
128
128
  const result = await runWithRequestId(key, argv, () => runCapturedInProcess(argv, (error) => {
129
129
  fatalError = error;
130
130
  }));
@@ -138,7 +138,7 @@ try {
138
138
  }
139
139
  }
140
140
  } catch (error) {
141
- const { printCliError } = await import("./chunks/runCli-SBQE2VQJ.js");
141
+ const { printCliError } = await import("./chunks/runCli-ZJ7WYHJ7.js");
142
142
  process.exitCode = printCliError(error, argv);
143
143
  }
144
144
  if (isDinoxError(fatalError) && fatalError.requiresProcessExit) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinox-editor-dsh",
3
- "version": "2.20.0",
3
+ "version": "2.20.2",
4
4
  "private": true,
5
5
  "description": "Dinox note editor for DeepSeek Harness Desktop (built by @dinoxx/dinox-cli)",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": "/Users/shanks/.nvm/versions/node/v24.16.0/bin/node",
3
- "cli": "/private/tmp/dinox-cli-release.xPP0/repo/apps/cli/dist/dinox.js",
4
- "version": "2.20.0"
3
+ "cli": "/private/tmp/dinox-cli-release.yeKp/repo/apps/cli/dist/dinox.js",
4
+ "version": "2.20.2"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinoxx/dinox-cli",
3
- "version": "2.20.0",
3
+ "version": "2.20.2",
4
4
  "description": "Dinox CLI",
5
5
  "main": "dist/dinox.js",
6
6
  "keywords": [],
@@ -18,7 +18,7 @@
18
18
  "access": "public"
19
19
  },
20
20
  "engines": {
21
- "node": ">=22.0.0 <26.0.0"
21
+ "node": ">=22.0.0 <27.0.0"
22
22
  },
23
23
  "dependencies": {
24
24
  "@agentclientprotocol/sdk": "^1.8.0",
@@ -94,10 +94,10 @@
94
94
  "tsx": "^4.20.3",
95
95
  "typescript": "6.0.3",
96
96
  "typescript-eslint": "^8.71.1",
97
- "@app/core": "6.0.99",
98
- "@app/powersync": "6.0.99",
99
97
  "@app/clip-engine": "0.1.0",
100
- "@app/shared": "6.0.99"
98
+ "@app/core": "6.0.99",
99
+ "@app/shared": "6.0.99",
100
+ "@app/powersync": "6.0.99"
101
101
  },
102
102
  "repository": {
103
103
  "type": "git",