dsh-lark-bot 0.11.0 → 0.12.0
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 +53 -7
- package/dist/cli.js +779 -136
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -328,17 +328,61 @@ to the latest version.
|
|
|
328
328
|
|
|
329
329
|
### 升级 | Upgrade
|
|
330
330
|
|
|
331
|
+
**推荐:一行命令彻底升级(v0.12.0+ 新增,issue #10)**
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
npx dsh-lark-bot@latest upgrade --profile dsh-lark --yes
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
`upgrade` 自动完成:检测当前已装版本 / 运行中 CLI / npm 最新版 → 升级**包本体**
|
|
338
|
+
(`dsh plugin add <name>@<latest>`)→ **幂等重装并重启 guardian 服务** → 升级后运行
|
|
339
|
+
`doctor` 验证。覆盖运行中实例的安全处理:
|
|
340
|
+
|
|
341
|
+
- 默认不打断运行中的 dsh profile,只提示重启命令(升级不影响配置 / 会话 / 凭据);
|
|
342
|
+
- `--restart`:升级后自动重启 guardian 服务与(受管/后台的)dsh profile 进程;
|
|
343
|
+
- `--check`:只报告版本与运行状态,零改动;
|
|
344
|
+
- `--rollback`:回滚到上一次升级前的版本(记录在 `~/.dsh-lark/upgrade-state.json`);
|
|
345
|
+
- `--force`:无法访问 npm(离线)时按当前运行版本重装;
|
|
346
|
+
- `--no-guardian`:跳过守护升级;
|
|
347
|
+
- **runtime profile 一致性修复**:升级后自动把 `dsh-lark-sdk` / `dsh-lark-acp` 的
|
|
348
|
+
own-package 链接重指到新版本(避免下次启动重新预置)。
|
|
349
|
+
|
|
350
|
+
无需交互确认时加 `--yes`(非交互环境不带 `--yes` 会安全中止)。其余方式:
|
|
351
|
+
|
|
331
352
|
- 插件本体:重跑 `setup`(或 `dsh plugin --profile <name> add dsh-lark-bot`)拉取 npm 最新版。
|
|
332
|
-
- 安全网守护:随 `setup` 一起安装 / 升级(幂等重装),也可单独
|
|
353
|
+
- 安全网守护:随 `upgrade` / `setup` 一起安装 / 升级(幂等重装),也可单独
|
|
354
|
+
`dsh-lark-bot guardian install`。
|
|
333
355
|
- CLI 工具(可选):`npm i -g dsh-lark-bot@latest`;使用 `npx` 时无需全局安装。
|
|
334
|
-
- 升级后重启 profile
|
|
356
|
+
- 升级后重启 profile(未用 `--restart` 时):`dsh --profile dsh-lark`。
|
|
357
|
+
|
|
358
|
+
- **Recommended: one-command full upgrade (new in v0.12.0, issue #10)**
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
npx dsh-lark-bot@latest upgrade --profile dsh-lark --yes
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
`upgrade` detects the installed / running / npm-latest versions, upgrades the **package**
|
|
365
|
+
(`dsh plugin add <name>@<latest>`), **idempotently reinstalls and restarts the guardian
|
|
366
|
+
service**, then runs `doctor` verification. Running instances are handled safely:
|
|
367
|
+
|
|
368
|
+
- By default the running dsh profile is never interrupted — you only get the restart command
|
|
369
|
+
(config / sessions / credentials are untouched);
|
|
370
|
+
- `--restart`: also restarts the guardian service and (managed/detached) dsh profile processes;
|
|
371
|
+
- `--check`: report versions and running state only, no changes;
|
|
372
|
+
- `--rollback`: reinstall the version recorded before the last upgrade
|
|
373
|
+
(`~/.dsh-lark/upgrade-state.json`);
|
|
374
|
+
- `--force`: reinstall the running version when npm is unreachable (offline);
|
|
375
|
+
- `--no-guardian`: skip the guardian upgrade.
|
|
376
|
+
|
|
377
|
+
Pass `--yes` to skip the interactive confirmation (non-interactive runs fail closed without it).
|
|
378
|
+
Alternatives:
|
|
335
379
|
|
|
336
380
|
- Plugin: re-run `setup` (or `dsh plugin --profile <name> add dsh-lark-bot`) to pull the latest
|
|
337
381
|
npm release.
|
|
338
|
-
- Safety-net guardian: installed / upgraded together with `setup` (idempotent), or
|
|
339
|
-
`dsh-lark-bot guardian install`.
|
|
382
|
+
- Safety-net guardian: installed / upgraded together with `upgrade` / `setup` (idempotent), or
|
|
383
|
+
standalone via `dsh-lark-bot guardian install`.
|
|
340
384
|
- CLI tool (optional): `npm i -g dsh-lark-bot@latest`; not needed when using `npx`.
|
|
341
|
-
- Restart the profile after upgrading: `dsh --profile dsh-lark`.
|
|
385
|
+
- Restart the profile after upgrading (when not using `--restart`): `dsh --profile dsh-lark`.
|
|
342
386
|
|
|
343
387
|
### 禁用 | Disable
|
|
344
388
|
|
|
@@ -518,6 +562,7 @@ Core environment variables:
|
|
|
518
562
|
| `DSH_LARK_GUARDIAN_SAFE_ADAPTER` | `auto` | 安全模式引擎:`auto` 优先 SDK 流式、失败回退 headless;`sdk` 强制 SDK;`headless` 跳过预置<br>Safe-mode engine: `auto` tries the SDK streaming runtime then falls back to headless; `sdk` requires it; `headless` skips provisioning |
|
|
519
563
|
| `DSH_LARK_GUARDIAN_SAFE_TIMEOUT_MS` | `600000` | 安全模式单任务空闲超时(持续无活动事件才停止并出超时卡)<br>Safe-mode per-task idle timeout (stops the run after it has been silent this long and renders a timeout card) |
|
|
520
564
|
| `DSH_LARK_GUARDIAN_CARD_DENSITY` | `detailed` | 安全模式任务卡片密度(compact / standard / detailed)<br>Card density for safe-mode run cards |
|
|
565
|
+
| `DSH_LARK_UPGRADE_REGISTRY` | `https://registry.npmjs.org` | `upgrade` 探测最新版本的 npm registry(可指向镜像)<br>npm registry used by `upgrade` to discover the latest version (mirrors supported) |
|
|
521
566
|
|
|
522
567
|
启动时会自动查找本机常见的 `@deepseek-ai/dsh` 安装位置。只有自动发现失败或需要指定特殊 profile 时,才需要设置这两个变量。
|
|
523
568
|
|
|
@@ -740,11 +785,12 @@ and relaunches the full profile on `/safemode exit`.
|
|
|
740
785
|
| `src/onboard/` | 首次扫码创建 / 绑定 PersonalAgent 应用<br>First-run QR onboarding |
|
|
741
786
|
| `src/session/` | 会话路由、排队、访问控制<br>Session routing, queueing, access control |
|
|
742
787
|
| `src/workspace/` | 项目工作区、git worktree 隔离与规则注入<br>Project workspace, git worktree isolation & rule injection |
|
|
743
|
-
| `src/adapters/` | agent 后端适配器(sdk 默认 / acp 审批 / headless legacy
|
|
788
|
+
| `src/adapters/` | agent 后端适配器(sdk 默认 / acp 审批 / headless legacy / web 单写者)<br>Agent backend adapters (sdk / acp / headless / web single-writer) |
|
|
744
789
|
| `src/card/` | 流式卡片状态与渲染<br>Streaming card state & rendering |
|
|
745
790
|
| `src/bot/` | 运行注册、消息排队、审批/问答注册表<br>Run registry, queueing, approval/question registries |
|
|
746
791
|
| `src/commands/` | 斜杠命令(/cd /ws /new …)<br>Slash commands |
|
|
747
|
-
| `src/cli/` | CLI 入口:`setup`(唯一安装命令)/ `doctor`(诊断)/ 隐藏 `run`<br>CLI entry: setup / doctor / hidden run |
|
|
792
|
+
| `src/cli/` | CLI 入口:`setup`(唯一安装命令)/ `doctor`(诊断)/ `upgrade`(一键升级)/ 隐藏 `run`<br>CLI entry: setup / doctor / upgrade / hidden run |
|
|
793
|
+
| `src/upgrade/` | 一键升级(issue #10):版本探测、升级状态、运行检测、guardian/profile 重启助手、runtime 链接修复<br>One-command upgrade (issue #10): version probe, upgrade state, running-state detection, restart helpers, runtime link repair |
|
|
748
794
|
| `src/guardian/` | 安全网守护:心跳、进程观察、仅核心安全 profile、接管状态机、系统服务安装<br>Safety-net guardian: heartbeat, process watch, core-only safe profile, takeover state machine, service install |
|
|
749
795
|
| `src/config/` | profile / 配置 / 访问白名单 / dsh 配置管理<br>Profile, config, access & dsh config management |
|
|
750
796
|
| `src/core/` | 结构化日志<br>Structured logging |
|