@xi-ix/dsh-multi-sync 0.1.2 → 0.1.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.
- package/README.md +1 -1
- package/docs/DETAIL.md +2 -2
- package/index.js +18 -7
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ and writes it to one portable JSON document.
|
|
|
38
38
|
5. Restart DeepSeek Harness so the newly installed plugins load.
|
|
39
39
|
|
|
40
40
|
The first time, the follower has no copy of this plugin yet, so install it by hand
|
|
41
|
-
once: `dsh plugin --profile desktop add @xi-ix/dsh-multi-sync
|
|
41
|
+
once: `dsh plugin --profile desktop add @xi-ix/dsh-multi-sync`.
|
|
42
42
|
|
|
43
43
|
## What it deliberately does not do
|
|
44
44
|
|
package/docs/DETAIL.md
CHANGED
|
@@ -52,10 +52,10 @@ one resolution, one lockfile write, and one bundle registration pass.
|
|
|
52
52
|
## First run on the new machine
|
|
53
53
|
|
|
54
54
|
This plugin cannot install itself before it exists on that machine, so install it
|
|
55
|
-
once by hand:
|
|
55
|
+
once by hand — without a version pin, so this line never goes stale:
|
|
56
56
|
|
|
57
57
|
```
|
|
58
|
-
dsh plugin --profile desktop add @xi-ix/dsh-multi-sync
|
|
58
|
+
dsh plugin --profile desktop add @xi-ix/dsh-multi-sync
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Then restart, open Settings → Multi-sync, and choose **Follower**.
|
package/index.js
CHANGED
|
@@ -397,6 +397,19 @@ function cliAttempts(args) {
|
|
|
397
397
|
const nodeExecutable = process.env.DSH_NODE_EXECUTABLE
|
|
398
398
|
const installDir = process.env.DSH_INSTALL_DIR
|
|
399
399
|
const asNode = { env: { ...process.env, ELECTRON_RUN_AS_NODE: '1' } }
|
|
400
|
+
const resources = resourcesRoot()
|
|
401
|
+
|
|
402
|
+
// The runtime shim is the installed carrier: only it is allowed to manage the
|
|
403
|
+
// desktop profile (`manageDesktopProfile`), so it is tried before the bare CLI.
|
|
404
|
+
if (resources) {
|
|
405
|
+
for (const relative of [join('runtime', 'cli', 'bin'), join('runtime', 'cli'), join('cli', 'bin'), 'bin']) {
|
|
406
|
+
for (const name of platform() === 'win32' ? ['dsh.cmd', 'dsh.exe'] : ['dsh', 'dsh.sh']) {
|
|
407
|
+
const shim = join(resources, relative, name)
|
|
408
|
+
if (!existsSync(shim)) continue
|
|
409
|
+
attempts.push({ command: shim, argv: args, options: { shell: platform() === 'win32' }, label: `${shim} ${args.join(' ')}` })
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
400
413
|
|
|
401
414
|
if (nodeExecutable && installDir) {
|
|
402
415
|
attempts.push({
|
|
@@ -407,7 +420,6 @@ function cliAttempts(args) {
|
|
|
407
420
|
})
|
|
408
421
|
}
|
|
409
422
|
|
|
410
|
-
const resources = resourcesRoot()
|
|
411
423
|
if (resources) {
|
|
412
424
|
for (const relative of [
|
|
413
425
|
join('app.asar', 'dsh', 'node_modules', '@deepseek-ai', 'dsh', 'lib', 'bin.js'),
|
|
@@ -423,11 +435,6 @@ function cliAttempts(args) {
|
|
|
423
435
|
label: `${process.execPath} ${entry} ${args.join(' ')}`,
|
|
424
436
|
})
|
|
425
437
|
}
|
|
426
|
-
for (const relative of [join('runtime', 'cli', 'bin'), join('cli', 'bin')]) {
|
|
427
|
-
const shim = join(resources, relative, platform() === 'win32' ? 'dsh.cmd' : 'dsh')
|
|
428
|
-
if (!existsSync(shim)) continue
|
|
429
|
-
attempts.push({ command: shim, argv: args, options: {}, label: `${shim} ${args.join(' ')}` })
|
|
430
|
-
}
|
|
431
438
|
}
|
|
432
439
|
|
|
433
440
|
attempts.push({
|
|
@@ -446,8 +453,12 @@ async function runDsh(args) {
|
|
|
446
453
|
for (const attempt of cliAttempts(args)) {
|
|
447
454
|
tried.push(attempt.label)
|
|
448
455
|
last = await runOnce(attempt.command, attempt.argv, attempt.options)
|
|
456
|
+
if (last.ok) return { ...last, command: attempt.label, tried }
|
|
449
457
|
const missing = last.code === 'ENOENT' || /not found|不是内部或外部命令|cannot find/i.test(last.stderr)
|
|
450
|
-
|
|
458
|
+
// A bare CLI refuses the desktop profile by design; that is not the end of the
|
|
459
|
+
// search, because the runtime carrier on the next line is allowed to do it.
|
|
460
|
+
const wrongEntry = /managed exclusively|managed by the Electron application/i.test(last.stderr)
|
|
461
|
+
if (missing || wrongEntry) continue
|
|
451
462
|
return { ...last, command: attempt.label, tried }
|
|
452
463
|
}
|
|
453
464
|
return { ...(last ?? { ok: false, stdout: '', stderr: '' }), command: 'none', ok: false, tried }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xi-ix/dsh-multi-sync",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Copy one machine's installed DSH plugin list to another: scan the profile, export a pinned list, then install the selected entries on the other machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -50,3 +50,4 @@
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
|