agentsw 0.5.1 → 0.5.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/apps.js +43 -1
  2. package/package.json +1 -1
package/dist/apps.js CHANGED
@@ -79,12 +79,54 @@ export const appPackages = [
79
79
  {
80
80
  id: "dsh",
81
81
  name: "DeepSeek Harness",
82
- binary: "dsh",
82
+ // dsh has no global binary — it runs via `npx @deepseek-ai/dsh web`.
83
+ // Detect via npx cache or ~/.dsh config dir.
83
84
  latest: { kind: "npm", name: "@deepseek-ai/dsh" },
84
85
  installCmd: "npm install -g @deepseek-ai/dsh@latest",
86
+ upgradeCmd: "npm install -g @deepseek-ai/dsh@latest",
85
87
  windowsInstallCmd: "npm install -g @deepseek-ai/dsh@latest",
88
+ localVersion: () => dshLocalVersion(),
86
89
  },
87
90
  ];
91
+ // dsh config dir; respects $DSH_HOME.
92
+ function dshHome() {
93
+ const env = process.env.DSH_HOME?.trim();
94
+ return env ? (env.startsWith("~") ? path.join(home, env.slice(1)) : env) :
95
+ process.platform === "win32" ? path.join(home, "AppData", "Local", "dsh") : path.join(home, ".dsh");
96
+ }
97
+ /** dsh version: search npx cache for @deepseek-ai/dsh, fall back to "?" if config dir exists. */
98
+ function dshLocalVersion() {
99
+ // 1. Check npx cache (~/.npm/_npx/*/node_modules/@deepseek-ai/dsh/package.json)
100
+ const npxCache = path.join(home, ".npm", "_npx");
101
+ if (fs.existsSync(npxCache)) {
102
+ for (const dir of fs.readdirSync(npxCache)) {
103
+ const pkg = path.join(npxCache, dir, "node_modules", "@deepseek-ai", "dsh", "package.json");
104
+ if (fs.existsSync(pkg)) {
105
+ try {
106
+ const v = JSON.parse(fs.readFileSync(pkg, "utf8")).version;
107
+ if (v)
108
+ return v;
109
+ }
110
+ catch { /* ignore */ }
111
+ }
112
+ }
113
+ }
114
+ // 2. Check global npm install
115
+ try {
116
+ const out = execSync("npm ls -g @deepseek-ai/dsh --json --depth=0", {
117
+ encoding: "utf8", timeout: 10000, stdio: ["ignore", "pipe", "pipe"],
118
+ });
119
+ const parsed = JSON.parse(out);
120
+ const v = parsed?.dependencies?.["@deepseek-ai/dsh"]?.version;
121
+ if (v)
122
+ return v;
123
+ }
124
+ catch { /* not installed globally */ }
125
+ // 3. Config dir exists -> used via npx, version unknown
126
+ if (fs.existsSync(dshHome()))
127
+ return "?";
128
+ return undefined;
129
+ }
88
130
  function workbuddyDataDir() {
89
131
  return process.env.WORKBUDDY_CONFIG_DIR?.trim() || process.env.CODEBUDDY_CONFIG_DIR?.trim() ||
90
132
  (process.platform === "win32" ? appDataDir("workbuddy") : path.join(home, ".workbuddy"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentsw",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "CLI provider switcher for coding agents: manage OpenAI/Anthropic-protocol providers in one place and sync them, with models.dev metadata, into Claude Code, Codex, omp, pi, prime-agent, opencode, Hermes, WorkBuddy and DeepSeek Harness",
5
5
  "type": "module",
6
6
  "repository": {