@whyshu/argent 0.1.6 → 0.1.8
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 +15 -0
- package/bin/argent.mjs +4 -3
- package/lib/index.mjs +13 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,3 +21,18 @@ npx -y @whyshu/argent service install # 生成 launchd(macOS)/ systemd(L
|
|
|
21
21
|
|
|
22
22
|
本地仓库联调:`ARGENT_REPO=/path/to/argent-dsh node launcher/bin/argent.mjs setup --dsh-home /tmp/x`
|
|
23
23
|
(从仓库 `plugins/` 用 `file:` 装配;正式发布时改用 npm 依赖解析)。
|
|
24
|
+
|
|
25
|
+
## 运行资产更新(npm 通道,2026-10-19)
|
|
26
|
+
|
|
27
|
+
客户机脚本/技能随 `@whyshu/argent` 的 runtime 依赖一起更新,不需要 `/dl/`:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# 下载并物化最新 runtime + skills(默认写入 ~/.argent-dsh 与 $DSH_HOME/skills)
|
|
31
|
+
npx -y @whyshu/argent@latest runtime install
|
|
32
|
+
|
|
33
|
+
# 只查看当前 runtime 版本
|
|
34
|
+
npx -y @whyshu/argent@latest runtime status
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`runtime install` 只覆盖 runtime 包内文件,客户凭据与 `.git` 不动;被覆盖文件备份到
|
|
38
|
+
`~/.argent-dsh/.runtime-backup/<时间戳>/`。可用 `--target` / `--skills-target` 覆盖落点。
|
package/bin/argent.mjs
CHANGED
|
@@ -39,6 +39,7 @@ const opts = {
|
|
|
39
39
|
repo: repoRoot({ repo: val('--repo') }),
|
|
40
40
|
port: Number(val('--port', '3080')) || 3080,
|
|
41
41
|
target: val('--target', join(homedir(), '.argent-dsh')),
|
|
42
|
+
skillsTarget: has('--no-skills') ? '' : val('--skills-target', join(dshHomeOf(val('--dsh-home')), 'skills')),
|
|
42
43
|
extraBundles: (() => { const raw = val('--bundles', '').split(',').map((x) => x.trim()).filter(Boolean); return raw.flatMap((x) => (x === 'prod' ? PROD_BUNDLES : [x])); })(),
|
|
43
44
|
};
|
|
44
45
|
|
|
@@ -193,9 +194,9 @@ function runtimeCommand(sub) {
|
|
|
193
194
|
}
|
|
194
195
|
if (sub !== 'install') { console.error('用法:argent runtime install|status [--target <dir>] [--dry-run]'); process.exit(2); }
|
|
195
196
|
if (DRY_RUN) { print({ ok: true, dryRun: true, engine, version, target: opts.target, action: 'materialize runtime files' }); return; }
|
|
196
|
-
const r = materializeRuntime({ target: opts.target, engine });
|
|
197
|
+
const r = materializeRuntime({ target: opts.target, engine, skillsTarget: opts.skillsTarget });
|
|
197
198
|
if (!r.ok) { console.error(`❌ runtime 安装失败:${r.message}`); process.exit(2); }
|
|
198
|
-
print({ ok: true, package: '@whyshu/argent-engine', version: r.version, files: r.files, target: r.target, backupDir: r.backupDir });
|
|
199
|
+
print({ ok: true, package: '@whyshu/argent-engine', version: r.version, files: r.files, skillsFiles: r.skillsFiles, target: r.target, skillsTarget: r.skillsTarget, backupDir: r.backupDir });
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
function serviceCommand(sub) {
|
|
@@ -237,7 +238,7 @@ function serviceCommand(sub) {
|
|
|
237
238
|
|
|
238
239
|
const main = async () => {
|
|
239
240
|
if (!command || has('-h') || has('--help')) {
|
|
240
|
-
console.log('用法:argent <web|health|setup|login|pair|runtime install|runtime status|service install|service uninstall> [--dsh-home <dir>] [--json] [--dry-run]');
|
|
241
|
+
console.log('用法:argent <web|health|setup|login|pair|runtime install|runtime status|service install|service uninstall> [--dsh-home <dir>] [--target <dir>] [--skills-target <dir>|--no-skills] [--json] [--dry-run]');
|
|
241
242
|
process.exit(command ? 0 : 2);
|
|
242
243
|
}
|
|
243
244
|
if (command === 'health') return healthCommand();
|
package/lib/index.mjs
CHANGED
|
@@ -115,7 +115,7 @@ function walkFiles(dir, base = dir) {
|
|
|
115
115
|
* 把 npm runtime 包物化到客户机既有资产目录(默认 ~/.argent-dsh)。
|
|
116
116
|
* 只覆盖 engine 包内的文件;客户配置/凭据/.git 不动;被覆盖文件先备份。
|
|
117
117
|
*/
|
|
118
|
-
export function materializeRuntime({ target = join(homedir(), '.argent-dsh'), engine = engineRoot(), now = new Date() } = {}) {
|
|
118
|
+
export function materializeRuntime({ target = join(homedir(), '.argent-dsh'), engine = engineRoot(), skillsTarget = '', now = new Date() } = {}) {
|
|
119
119
|
if (!engine) return { ok: false, code: 'engine_missing', message: '未找到 @whyshu/argent-engine(启动器依赖未安装)' };
|
|
120
120
|
if (!existsSync(target)) mkdirSync(target, { recursive: true });
|
|
121
121
|
const version = readFileSync(join(engine, 'VERSION'), 'utf8').trim();
|
|
@@ -123,9 +123,7 @@ export function materializeRuntime({ target = join(homedir(), '.argent-dsh'), en
|
|
|
123
123
|
const backupDir = join(target, '.runtime-backup', stamp);
|
|
124
124
|
const files = walkFiles(engine);
|
|
125
125
|
let copied = 0;
|
|
126
|
-
|
|
127
|
-
const src = join(engine, rel);
|
|
128
|
-
const dst = join(target, rel);
|
|
126
|
+
const copyFile = (src, dst, rel) => {
|
|
129
127
|
if (existsSync(dst)) {
|
|
130
128
|
const b = join(backupDir, rel);
|
|
131
129
|
mkdirSync(dirname(b), { recursive: true });
|
|
@@ -134,10 +132,19 @@ export function materializeRuntime({ target = join(homedir(), '.argent-dsh'), en
|
|
|
134
132
|
mkdirSync(dirname(dst), { recursive: true });
|
|
135
133
|
cpSync(src, dst);
|
|
136
134
|
copied += 1;
|
|
135
|
+
};
|
|
136
|
+
for (const rel of files) copyFile(join(engine, rel), join(target, rel), rel);
|
|
137
|
+
let skillsFiles = 0;
|
|
138
|
+
if (skillsTarget) {
|
|
139
|
+
const skillsSrc = join(engine, 'skills');
|
|
140
|
+
if (existsSync(skillsSrc)) {
|
|
141
|
+
for (const rel of walkFiles(skillsSrc)) copyFile(join(skillsSrc, rel), join(skillsTarget, rel), `skills/${rel}`);
|
|
142
|
+
skillsFiles = walkFiles(skillsSrc).length;
|
|
143
|
+
}
|
|
137
144
|
}
|
|
138
145
|
mkdirSync(join(target, '.runtime-backup'), { recursive: true });
|
|
139
|
-
writeFileSync(join(target, 'RUNTIME_VERSION.json'), JSON.stringify({ package: '@whyshu/argent-engine', version, installedAt: now.toISOString(), files: copied, backupDir }, null, 2) + '\n');
|
|
140
|
-
return { ok: true, version, files: copied, target, backupDir };
|
|
146
|
+
writeFileSync(join(target, 'RUNTIME_VERSION.json'), JSON.stringify({ package: '@whyshu/argent-engine', version, installedAt: now.toISOString(), files: copied, skillsFiles, skillsTarget: skillsTarget || null, backupDir }, null, 2) + '\n');
|
|
147
|
+
return { ok: true, version, files: copied, skillsFiles, target, skillsTarget, backupDir };
|
|
141
148
|
}
|
|
142
149
|
|
|
143
150
|
export function profileDir(dshHome, profile = PROFILE_NAME) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whyshu/argent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Argent 启动器:一条命令启动「打包好的 dsh + Argent 插件/角色预设」,并管理本机 runner 常驻。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@deepseek-ai/dsh": "0.2.1-rc.2",
|
|
18
|
-
"@whyshu/argent-engine": "0.7.
|
|
18
|
+
"@whyshu/argent-engine": "0.7.6"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"bin/",
|