dsh-lark-bot 0.9.1 → 0.9.2

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 CHANGED
@@ -87,12 +87,14 @@ npx dsh-lark-bot@latest setup --profile dsh-lark
87
87
  ```
88
88
 
89
89
  `setup` 会自动完成:发现本机 dsh → 预批准 pnpm 构建策略 → 执行标准的
90
- `dsh plugin --profile dsh-lark add dsh-lark-bot`,并**默认同时安装「安全网守护」**——系统级
90
+ `dsh plugin --profile dsh-lark add dsh-lark-bot@<版本>`(版本号由当前包固定,避免 pnpm
91
+ 裸名解析到旧版本),并**默认同时安装「安全网守护」**——系统级
91
92
  常驻、dsh 全部下线后仍保留飞书救援入口(核心能力之一,见下文「安全网守护」一节)。
92
93
  一条命令即完成全部安装。
93
94
 
94
95
  `setup` automatically: locates your dsh install → pre-approves pnpm's build policy → runs the
95
- standard `dsh plugin --profile dsh-lark add dsh-lark-bot`, and **also installs the safety-net
96
+ standard `dsh plugin --profile dsh-lark add dsh-lark-bot@<version>` (pinned to the running
97
+ package so pnpm never resolves an outdated bare-name release), and **also installs the safety-net
96
98
  guardian by default** — a system-level resident process that keeps the Feishu rescue entrance
97
99
  alive even when dsh is fully down (one of the core features; see "Safety-net guardian" below).
98
100
  One command installs everything.
package/dist/cli.js CHANGED
@@ -145,7 +145,9 @@ function findOwnPackageRoot(startDir) {
145
145
  try {
146
146
  const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
147
147
  if (typeof pkg.name === "string" && isOwnPackageName(pkg.name)) {
148
- return { name: pkg.name, root: dir };
148
+ const info = { name: pkg.name, root: dir };
149
+ if (typeof pkg.version === "string") info.version = pkg.version;
150
+ return info;
149
151
  }
150
152
  } catch {
151
153
  }
@@ -6281,7 +6283,7 @@ async function uninstallGuardian(options) {
6281
6283
  async function runSetup(options = {}) {
6282
6284
  const profile = options.profile ?? "dsh-lark";
6283
6285
  const own = ownPackageInfo();
6284
- const packageSpec = options.packageSpec ?? process.env.DSH_LARK_SETUP_PACKAGE ?? own.name;
6286
+ const packageSpec = options.packageSpec ?? process.env.DSH_LARK_SETUP_PACKAGE ?? (own.version ? `${own.name}@${own.version}` : own.name);
6285
6287
  const dshHome = options.dshHome ?? resolveDshHome(homedir7(), process.env);
6286
6288
  const bin = options.bin ?? discoverDshBin(homedir7(), process.env);
6287
6289
  if (!bin) {