@seeed-studio/solution-cli 0.4.3 → 0.4.4

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/lib/agent.js CHANGED
@@ -52,6 +52,20 @@ function scanAgent(agent) {
52
52
  };
53
53
  }
54
54
 
55
+ export function getLarkShellUsersDirs() {
56
+ const home = os.homedir();
57
+ const dirs = [];
58
+ if (process.platform === 'darwin') {
59
+ dirs.push(path.join(home, 'Library', 'Application Support', 'LarkShell', 'aha', 'users'));
60
+ } else if (process.platform === 'win32') {
61
+ if (process.env.APPDATA) dirs.push(path.join(process.env.APPDATA, 'LarkShell', 'aha', 'users'));
62
+ if (process.env.LOCALAPPDATA) dirs.push(path.join(process.env.LOCALAPPDATA, 'LarkShell', 'aha', 'users'));
63
+ } else {
64
+ dirs.push(path.join(home, '.config', 'LarkShell', 'aha', 'users'));
65
+ }
66
+ return dirs.filter(d => fs.existsSync(d));
67
+ }
68
+
55
69
  export function getKnownAgents() {
56
70
  const home = os.homedir();
57
71
 
@@ -65,7 +79,12 @@ export function getKnownAgents() {
65
79
  path.join(home, '.agents'),
66
80
  ...(process.platform === 'darwin'
67
81
  ? [path.join(home, 'Library', 'Application Support', 'LarkShell')]
68
- : [])
82
+ : process.platform === 'win32'
83
+ ? [
84
+ ...(process.env.APPDATA ? [path.join(process.env.APPDATA, 'LarkShell')] : []),
85
+ ...(process.env.LOCALAPPDATA ? [path.join(process.env.LOCALAPPDATA, 'LarkShell')] : [])
86
+ ]
87
+ : [path.join(home, '.config', 'LarkShell')])
69
88
  ],
70
89
  getSkillsDir: () => {
71
90
  const pDoubao = path.join(home, 'Doubao', 'skills');
@@ -78,16 +97,13 @@ export function getKnownAgents() {
78
97
  return pLegacy;
79
98
  }
80
99
  if (fs.existsSync(path.join(home, 'Doubao'))) return pDoubao;
81
- if (process.platform === 'darwin') {
82
- const larkUsers = path.join(home, 'Library', 'Application Support', 'LarkShell', 'aha', 'users');
83
- if (fs.existsSync(larkUsers)) {
84
- try {
85
- for (const u of fs.readdirSync(larkUsers)) {
86
- const ws = path.join(larkUsers, u, 'doubao', '.doubao', 'agent_mode', 'workspace', '.user_skills');
87
- if (fs.existsSync(ws)) return ws;
88
- }
89
- } catch (_) {}
90
- }
100
+ for (const larkUsers of getLarkShellUsersDirs()) {
101
+ try {
102
+ for (const u of fs.readdirSync(larkUsers)) {
103
+ const ws = path.join(larkUsers, u, 'doubao', '.doubao', 'agent_mode', 'workspace', '.user_skills');
104
+ if (fs.existsSync(ws)) return ws;
105
+ }
106
+ } catch (_) {}
91
107
  }
92
108
  if (fs.existsSync(path.join(home, '.agents'))) return pAgents;
93
109
  if (fs.existsSync(path.join(home, '.doubao'))) return pLegacy;
package/lib/installer.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from './platform.js';
12
12
  import { detectExistingEngine, detectDesktopApp, verifyEngineBinary, compareSemver } from './detector.js';
13
13
  import { downloadEngine, fetchManifest, validateReleaseManifest, pullSolutionContent, updateSolutionContent } from './downloader.js';
14
- import { getKnownAgents, scanLocalAgents, promptAgentSelection } from './agent.js';
14
+ import { getKnownAgents, scanLocalAgents, promptAgentSelection, getLarkShellUsersDirs } from './agent.js';
15
15
  import {
16
16
  recordInstallation,
17
17
  removeInstallation,
@@ -253,11 +253,10 @@ export async function runInstall(options = {}) {
253
253
  } catch (_) {}
254
254
  }
255
255
 
256
- // For Doubao on macOS, additionally sync into active LarkShell agent workspace .user_skills if present
257
- if (a.id === 'doubao' && process.platform === 'darwin') {
256
+ // For Doubao, additionally sync into active LarkShell agent workspace .user_skills if present (macOS / Windows / Linux)
257
+ if (a.id === 'doubao') {
258
258
  try {
259
- const larkUsers = path.join(os.homedir(), 'Library', 'Application Support', 'LarkShell', 'aha', 'users');
260
- if (fs.existsSync(larkUsers)) {
259
+ for (const larkUsers of getLarkShellUsersDirs()) {
261
260
  for (const u of fs.readdirSync(larkUsers)) {
262
261
  const wsUserSkills = path.join(larkUsers, u, 'doubao', '.doubao', 'agent_mode', 'workspace', '.user_skills');
263
262
  if (fs.existsSync(wsUserSkills)) {
@@ -273,15 +272,20 @@ export async function runInstall(options = {}) {
273
272
  logger(` ✔ Skill successfully installed to: ${destDir}`);
274
273
  installedAgents.push({ id: a.id, name: a.name, path: destDir });
275
274
 
276
- // For doubao agent, ensure secondary scanning directory ~/.agents/skills has symlink if possible
275
+ // For doubao agent, ensure secondary scanning directory ~/.agents/skills has symlink or copy if possible
277
276
  if (a.id === 'doubao') {
278
277
  try {
279
278
  const secondarySkills = path.join(os.homedir(), '.agents', 'skills');
280
279
  const secondaryDest = path.join(secondarySkills, SKILL_DIR_NAME);
281
280
  if (path.resolve(a.skillsDir) !== path.resolve(secondarySkills)) {
282
281
  if (fs.existsSync(secondarySkills) && !fs.existsSync(secondaryDest)) {
283
- fs.symlinkSync(destDir, secondaryDest, 'junction');
284
- logger(` ✔ Created compatibility link for Doubao: ${secondaryDest} -> ${destDir}`);
282
+ try {
283
+ fs.symlinkSync(destDir, secondaryDest, 'junction');
284
+ logger(` ✔ Created compatibility link for Doubao: ${secondaryDest} -> ${destDir}`);
285
+ } catch {
286
+ copyFolderSafely(destDir, secondaryDest, secondaryDest, {}, true, () => {});
287
+ logger(` ✔ Created compatibility copy for Doubao: ${secondaryDest}`);
288
+ }
285
289
  }
286
290
  }
287
291
  } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeed-studio/solution-cli",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Installer for the Rust deployment engine and Solution CLI Agent skills (Doubao Work, WorkBuddy, Claude Code, Codex, CodeBuddy, Hermes)",
5
5
  "type": "module",
6
6
  "main": "./lib/installer.js",