@michengai/dsh-codex-suite-installer 0.1.4 → 0.1.6
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/README.zh-CN.md +1 -1
- package/bin.mjs +1 -1
- package/installer.mjs +17 -3
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://r
|
|
|
55
55
|
Preview the installation plan from a repository checkout:
|
|
56
56
|
|
|
57
57
|
```powershell
|
|
58
|
-
node .\packages\dsh-codex-suite\bin.mjs --profile codex --dry-run
|
|
58
|
+
node .\packages\dsh-codex-suite-installer\bin.mjs --profile codex --dry-run
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Remove `--dry-run` to apply it. The checkout path resolves the local `workspace:*` entry to the root package version.
|
package/README.zh-CN.md
CHANGED
|
@@ -55,7 +55,7 @@ dsh plugin --profile web add @michengai/dsh-codex-ui@latest --registry=https://r
|
|
|
55
55
|
仓库检出状态下可先查看安装计划:
|
|
56
56
|
|
|
57
57
|
```powershell
|
|
58
|
-
node .\packages\dsh-codex-suite\bin.mjs --profile codex --dry-run
|
|
58
|
+
node .\packages\dsh-codex-suite-installer\bin.mjs --profile codex --dry-run
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
正式执行时去掉 `--dry-run`。安装器会读取工作区根包版本替换本地的 `workspace:*`。
|
package/bin.mjs
CHANGED
|
@@ -5,6 +5,6 @@ import { installSuite } from './installer.mjs'
|
|
|
5
5
|
try {
|
|
6
6
|
installSuite()
|
|
7
7
|
} catch (error) {
|
|
8
|
-
process.stderr.write(`dsh-codex-suite: ${error instanceof Error ? error.message : String(error)}\n`)
|
|
8
|
+
process.stderr.write(`dsh-codex-suite-installer: ${error instanceof Error ? error.message : String(error)}\n`)
|
|
9
9
|
process.exitCode = 1
|
|
10
10
|
}
|
package/installer.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process'
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
|
-
import { resolve } from 'node:path'
|
|
4
|
+
import { resolve, win32 } from 'node:path'
|
|
5
5
|
|
|
6
6
|
export const SUITE_PACKAGE = '@michengai/dsh-codex-suite'
|
|
7
7
|
export const BASE_BUNDLE = '@deepseek-ai/dsh-base'
|
|
@@ -94,18 +94,32 @@ export function directInstallArgs(profile, registry, manifest = suiteManifest) {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export function helpText() {
|
|
97
|
-
return `Usage: dsh-codex-suite [options]\n\nInstall every Codex Suite member as a direct dependency of one DSH profile.\n\nOptions:\n --profile <name> target profile (default: web)\n --registry <url> npm registry (default: https://registry.npmjs.org/)\n --dry-run print commands without changing the profile\n -h, --help show this help\n`
|
|
97
|
+
return `Usage: dsh-codex-suite-installer [options]\n\nInstall every Codex Suite member as a direct dependency of one DSH profile.\n\nOptions:\n --profile <name> target profile (default: web)\n --registry <url> npm registry (default: https://registry.npmjs.org/)\n --dry-run print commands without changing the profile\n -h, --help show this help\n`
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
function quote(argument) {
|
|
101
101
|
return /[\s"']/u.test(argument) ? JSON.stringify(argument) : argument
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
export function validateWindowsDshCommand(command) {
|
|
105
|
+
if (typeof command !== 'string' || command === '' || command.trim() !== command || /["&|<>^%\r\n]/u.test(command)) {
|
|
106
|
+
throw new Error('DSH_BIN contains unsupported shell characters.')
|
|
107
|
+
}
|
|
108
|
+
if (/^[0-9A-Za-z._-]+$/u.test(command)) return command
|
|
109
|
+
if (/^[A-Za-z]:\\/u.test(command) && win32.isAbsolute(command)) return command
|
|
110
|
+
throw new Error('DSH_BIN must be a command name or an absolute local Windows path.')
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function quoteWindowsCommandArgument(argument) {
|
|
114
|
+
if (/["\r\n]/u.test(argument)) throw new Error('dsh argument contains unsupported shell characters.')
|
|
115
|
+
return `"${argument}"`
|
|
116
|
+
}
|
|
117
|
+
|
|
104
118
|
function runDsh(args, { dryRun = false, command = process.env.DSH_BIN || 'dsh' } = {}) {
|
|
105
119
|
process.stdout.write(`> dsh ${args.map(quote).join(' ')}\n`)
|
|
106
120
|
if (dryRun) return
|
|
107
121
|
const result = process.platform === 'win32'
|
|
108
|
-
? spawnSync(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', `call ${
|
|
122
|
+
? spawnSync(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', `call ${quoteWindowsCommandArgument(validateWindowsDshCommand(command))} ${args.map(quoteWindowsCommandArgument).join(' ')}`], { encoding: 'utf8', stdio: 'inherit', windowsHide: true })
|
|
109
123
|
: spawnSync(command, args, { encoding: 'utf8', stdio: 'inherit' })
|
|
110
124
|
if (result.error !== undefined) throw new Error(`Unable to run dsh: ${result.error.message}`)
|
|
111
125
|
if (result.status !== 0) throw new Error(`dsh exited with code ${result.status ?? 1}.`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-suite-installer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "轻量 DSH Codex Suite 安装器:将六个成员装为同一 profile 的直接插件",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dshCodexSuite": {
|
|
24
24
|
"members": {
|
|
25
|
-
"@michengai/dsh-archive-manager": "0.1.
|
|
26
|
-
"@michengai/dsh-codex-ui": "0.2.
|
|
27
|
-
"@michengai/dsh-skills-manager": "0.1.
|
|
25
|
+
"@michengai/dsh-archive-manager": "0.1.16",
|
|
26
|
+
"@michengai/dsh-codex-ui": "0.2.89",
|
|
27
|
+
"@michengai/dsh-skills-manager": "0.1.25",
|
|
28
28
|
"@michengai/dsh-agency-agents": "0.1.21",
|
|
29
29
|
"@michengai/dsh-im-connect": "0.1.24",
|
|
30
|
-
"@michengai/dsh-automation": "0.1.
|
|
30
|
+
"@michengai/dsh-automation": "0.1.21"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|