@whyshu/argent 0.1.27 → 0.2.1
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 +16 -65
- package/cordis.patch.yml +6 -0
- package/dist/client.js +691 -0
- package/mcp/billing-upload.mjs +77 -0
- package/mcp/erp-server.mjs +296 -0
- package/mcp/gateway.mjs +336 -0
- package/mcp/meter.mjs +101 -0
- package/mcp/vault.mjs +78 -0
- package/mcp/vendor/account-token.mjs +37 -0
- package/mcp/vendor/redact.mjs +34 -0
- package/package.json +28 -18
- package/src/account-token.mjs +40 -0
- package/src/actions.mjs +114 -0
- package/src/config.mjs +47 -0
- package/src/error-log.mjs +56 -0
- package/src/fulfillment-result.mjs +84 -0
- package/src/health.mjs +231 -0
- package/src/index.js +239 -0
- package/src/kernel.mjs +111 -0
- package/src/lease.mjs +90 -0
- package/src/llm-whyshu.mjs +155 -0
- package/src/machine-session.mjs +114 -0
- package/src/office-runtime.js +1102 -0
- package/src/skuflow-runner.mjs +57 -0
- package/src/timer-status.mjs +160 -0
- package/src/whyshu-auth.mjs +277 -0
- package/bin/argent.mjs +0 -385
- package/lib/index.mjs +0 -604
- package/runner/argent-runner.mjs +0 -223
package/README.md
CHANGED
|
@@ -1,72 +1,23 @@
|
|
|
1
|
-
# @whyshu/argent
|
|
1
|
+
# @whyshu/argent(单插件)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**一个 dsh bundle 同时服务 `dsh web` 与 DSH Desktop**(2026-11-07 由 `@whyshu/argent-web` + `@whyshu/argent-desktop` 合并)。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npx -y @whyshu/argent login --server-url https://whyshu.com --phone <手机号> # 首跑登录(短信验证码,写 600 auth.json)
|
|
7
|
-
npx -y @whyshu/argent pair --from-login --tenant ly-0001 # 用登录态签发 runner token(写 600 runner.json)
|
|
8
|
-
npx -y @whyshu/argent web # 生成/复用 profile 并启动 dsh web(默认 http://127.0.0.1:3080)
|
|
9
|
-
npx -y @whyshu/argent health # 版本/宿主/profile/端口/runner 配置自检
|
|
10
|
-
npx -y @whyshu/argent setup # 只生成/更新 $DSH_HOME/profiles/argent,不启动
|
|
11
|
-
npx -y @whyshu/argent service install # 生成 launchd(macOS)/ systemd(Linux)常驻 P4 runner
|
|
12
|
-
```
|
|
5
|
+
## 职责
|
|
13
6
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
7
|
+
- 问述代理 provider(`whyshu`,与官方 `deepseek-official` 并存;默认模型带 `inputModalities: ['text','image']`)
|
|
8
|
+
- 一键登录(设备码)与 `refresh_token` 自动续期(写 credentials,不落盘明文)
|
|
9
|
+
- MCP 网关(`engine.*` / `erp.*` / `ml.*`):插件自注册,不需要 profile patch 再挂 `mcp-argent-*`
|
|
10
|
+
- ERP 机器通道(办公室现场 / 机器命令 / SKU 流程):按「先到先得」租约,抢到 poller 才轮询,否则纯 UI
|
|
11
|
+
- 伞伞桌宠 / 积分面板:`/api/argent/health`、`/api/argent/account`,客户端 bundle 轮询
|
|
12
|
+
- 计费互斥甲:`ARGENT_MACHINE_TASK=1` 时代理请求带 `x-argent-source: machine-task`,
|
|
13
|
+
服务端只记 `cost_audit`(0 积分);MCP 工具调用计量 `points: 0`(只统计/审计)
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
(从仓库 `plugins/` 用 `file:` 装配;正式发布时改用 npm 依赖解析)。
|
|
15
|
+
## 安装(UI 面板)
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
DSH web / DSH Desktop 的 **Plugins 面板**安装 `@whyshu/argent@0.2.0`;更新 = 卸载后重装新版本。
|
|
18
|
+
CLI/headless 场景用 `dsh plugin`;启动器 `@whyshu/argent@0.1.x` 已退役,不再需要。
|
|
27
19
|
|
|
28
|
-
##
|
|
20
|
+
## 边界
|
|
29
21
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# 只检查(不写任何东西)
|
|
34
|
-
npx -y @whyshu/argent@latest update check --json
|
|
35
|
-
|
|
36
|
-
# 真正更新 runtime + profile 插件(必须 --yes)
|
|
37
|
-
npx -y @whyshu/argent@latest update run --yes
|
|
38
|
-
|
|
39
|
-
# 看计划 / 指定版本 / 国内镜像
|
|
40
|
-
npx -y @whyshu/argent@latest update run --dry-run
|
|
41
|
-
npx -y @whyshu/argent@latest update run --yes --to 0.1.12
|
|
42
|
-
npx -y @whyshu/argent@latest update check --registry https://registry.npmmirror.com
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
`update run` 会:
|
|
46
|
-
|
|
47
|
-
1. 读取 npm `@whyshu/argent` 的 `latest` 版本;
|
|
48
|
-
2. 备份 profile 的 `package.json` / patch / lock;
|
|
49
|
-
3. 用目标版本启动器执行 `runtime install`;
|
|
50
|
-
4. **原地更新现有 profile 的插件版本**(不重建 profile、不丢 bundles);
|
|
51
|
-
5. 用客户机**真实 dsh** 执行 `dsh plugin --profile argent install`;
|
|
52
|
-
6. 用真实 dsh 执行 `health --json` 验收;
|
|
53
|
-
7. 返回 `restartRequired: true`,由空闲窗口重启宿主。
|
|
54
|
-
|
|
55
|
-
⛔ dsh 版本不等于启动器 exact pin 时,`update run` 会在改任何文件前停止;先升级宿主。
|
|
56
|
-
|
|
57
|
-
失败不会静默:保留更新前 profile 清单备份,并打印分步重试命令。当前不做自动重启。
|
|
58
|
-
|
|
59
|
-
## 运行资产更新(npm 通道,2026-10-19)
|
|
60
|
-
|
|
61
|
-
客户机脚本/技能随 `@whyshu/argent` 的 runtime 依赖一起更新,不需要 `/dl/`:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# 下载并物化最新 runtime + skills(默认写入 ~/.argent-dsh 与 $DSH_HOME/skills)
|
|
65
|
-
npx -y @whyshu/argent@latest runtime install
|
|
66
|
-
|
|
67
|
-
# 只查看当前 runtime 版本
|
|
68
|
-
npx -y @whyshu/argent@latest runtime status
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
`runtime install` 只覆盖 runtime 包内文件,客户凭据与 `.git` 不动;被覆盖文件备份到
|
|
72
|
-
`~/.argent-dsh/.runtime-backup/<时间戳>/`。可用 `--target` / `--skills-target` 覆盖落点。
|
|
22
|
+
- 数据目录判据在内核 `core/lib/argent-datadir.mjs`;引擎目录 `ARGENT_ENGINE_DIR` → `argent.json#engineDir` → 常见路径。
|
|
23
|
+
- 单实例:同一台机器不要同时跑两个宿主(web + desktop)抢同一 ERP 命令队列;租约只做降级不做跨机互斥。
|