@aliyunrds/ctxdb 1.0.0-beta.2 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli/main.js +8 -7
  2. package/package.json +1 -1
package/dist/cli/main.js CHANGED
@@ -238,7 +238,7 @@ import {
238
238
  } from "fs";
239
239
  import { homedir } from "os";
240
240
  import { join, dirname } from "path";
241
- import { fileURLToPath } from "url";
241
+ import { fileURLToPath, pathToFileURL } from "url";
242
242
  import { execFileSync } from "child_process";
243
243
  var UNINSTALL_NPM_HINT = "To also remove the npm binaries: `npm uninstall -g @aliyunrds/ctxdb @aliyunrds/ctxdb-shared`";
244
244
  var UNINSTALL_ORDER_HINT = "When you eventually want to uninstall: run `ctxdb uninstall --purge-all` FIRST, then `npm uninstall -g @aliyunrds/ctxdb @aliyunrds/ctxdb-shared`. (npm 7+ removed uninstall lifecycle hooks, so the order matters \u2014 otherwise agent settings.json hooks + ~/.ctxdb/ residue stay behind.)";
@@ -875,19 +875,20 @@ function checkOpencodeShimHealth() {
875
875
  detail: `opencode shim malformed: ${path} \u2014 re-run \`ctxdb setup --agent opencode\``
876
876
  };
877
877
  }
878
- if (!existsSync(target)) {
878
+ const targetPath = target.startsWith("file:") ? fileURLToPath(target) : target;
879
+ if (!existsSync(targetPath)) {
879
880
  return {
880
881
  installed: true,
881
- nodePaths: [target],
882
+ nodePaths: [targetPath],
882
883
  nodeOk: false,
883
- detail: `opencode shim target missing: ${target} \u2014 re-run \`ctxdb setup --agent opencode\``
884
+ detail: `opencode shim target missing: ${targetPath} \u2014 re-run \`ctxdb setup --agent opencode\``
884
885
  };
885
886
  }
886
887
  return {
887
888
  installed: true,
888
- nodePaths: [target],
889
+ nodePaths: [targetPath],
889
890
  nodeOk: true,
890
- detail: `opencode shim: ${path} \u2192 ${target}`
891
+ detail: `opencode shim: ${path} \u2192 ${targetPath}`
891
892
  };
892
893
  }
893
894
  var SETTINGS_BACKUP_KEEP = 5;
@@ -1126,7 +1127,7 @@ var OPENCODE_SHIM_HEADER = "// Generated by ctxdb setup --agent opencode. Do not
1126
1127
  function writeOpencodeShim(absEntry) {
1127
1128
  const path = opencodeShimPath();
1128
1129
  mkdirSync(dirname(path), { recursive: true });
1129
- const importSpec = absEntry.replace(/\\/g, "/");
1130
+ const importSpec = process.platform === "win32" ? pathToFileURL(absEntry).href : absEntry.replace(/\\/g, "/");
1130
1131
  const body = `${OPENCODE_SHIM_HEADER}export { default } from ${JSON.stringify(importSpec)};
1131
1132
  `;
1132
1133
  writeFileSync(path, body, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliyunrds/ctxdb",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "type": "module",
5
5
  "description": "Unified access layer for RDS ContextDatabase: `ctxdb` CLI (memory + KB ops), one-shot `setup --agent <qoder|qoderwork|codex|claude|opencode>` installer, per-agent config, hooks/plugins, and SKILL.md.",
6
6
  "license": "Apache-2.0",