@qfeius/everyline-cli 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/bin/checksums.txt CHANGED
@@ -1,6 +1,6 @@
1
- 9dc852a86aea9ae39a8c386c294a9d5fde07ec6a4133187d0fe136d1411df30c bin/darwin-amd64/everyline-cli
2
- c8d11032ff5779b4c891699ed71c895d2071df3ee6d281860c3571fb74616147 bin/darwin-arm64/everyline-cli
3
- 9132cacb338ecea9fd2d8d60d10a33c4a1a99839003d2d57c380769fbb78515f bin/linux-amd64/everyline-cli
4
- 12e239482566e8a73c75d2515ec650aaea3ceef795eba2eae0513c55d4f256bc bin/linux-arm64/everyline-cli
5
- 14e775a284c4e9fcbe9ce3ca2b98770175bbf62f4d8035bc2bdfca8c401ae74b bin/windows-amd64/everyline-cli.exe
6
- 23a2122126cd74deffbe59958ef785e0bcd9ae1b9033c7342f012048f0ee5f76 bin/windows-arm64/everyline-cli.exe
1
+ 42972378fcae2b729ce992ccc9d07af56980537956d46bca71cd5dcb7c0040a6 bin/darwin-amd64/everyline-cli
2
+ 21e6f194166a29efd88702a77b0b75f0870040cdf3da0360907f3699fb959e78 bin/darwin-arm64/everyline-cli
3
+ 0436b26cf2efd8d0a9745cfd17fd95781381a18d7a0480af9b6e9c81eeb6d297 bin/linux-amd64/everyline-cli
4
+ 12262192b44e3178d732b27c39a16473995061605e3219bde8c72406568b4903 bin/linux-arm64/everyline-cli
5
+ a2dc6aaf804744a8a1905b32919255d8ce5be0fa5263bed57b048ac458af5f5e bin/windows-amd64/everyline-cli.exe
6
+ bc0af994fac92aa8624f3a96bce1ccc5198f09d713642ddf2d1ba55f9441208e bin/windows-arm64/everyline-cli.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -641,3 +641,13 @@ Windows PowerShell 使用自定义 prefix 时:
641
641
  $EverylineNpmPrefix = Join-Path $HOME ".local"
642
642
  npm uninstall -g --prefix $EverylineNpmPrefix @qfeius/everyline-cli
643
643
  ```
644
+
645
+ ### 恢复缺失的命令入口
646
+
647
+ macOS/Linux 全局包仍存在但 `everyline-cli` 命令入口缺失时,使用原安装 prefix 执行:
648
+
649
+ ```bash
650
+ npm rebuild -g --foreground-scripts --allow-scripts=@qfeius/everyline-cli @qfeius/everyline-cli
651
+ ```
652
+
653
+ 安装脚本会按包实际所在 prefix 检查并恢复缺失链接;显式设置 `--bin-links=false` 时跳过恢复。已有文件或链接保持原样;Windows 的命令 shim 由 npm rebuild 管理。入口后来再次被删除时,需要重新执行恢复命令,不会在后台自动重建。
@@ -4,8 +4,8 @@ npm 包名为 `@qfeius/everyline-cli`,终端命令和两项 Skill 名称保持
4
4
 
5
5
  ## 一次性配置
6
6
 
7
- 1. 确认 npm 账号有 `@qfeius` 下此包的发布权限。首次发布前先检查组织权限和包名归属。
8
- 2. GitHub 仓库 `qfeius/everyline-cli` **Settings Secrets and variables → Actions** 中添加 `NPM_TOKEN`。使用具有包写权限、允许非交互发布的 granular access token;按 npm 当前规则配置 Bypass 2FA,不将 token 写入仓库。
7
+ 1. npm 包的 Trusted Publisher 中配置 GitHub 仓库 `qfeius/everyline-cli` 和工作流 `npm-publish.yml`,供 OIDC 发布。确认 npm 账号有 `@qfeius` 下此包的发布权限。首次发布前先检查组织权限和包名归属。
8
+ 2. npm 发布使用 OIDC 临时身份,无需为 GitHub Release 配置 `NPM_TOKEN`。
9
9
  3. 将 `.github/workflows/release.yml` 推送到 GitHub。工作流使用 GitHub 自动提供的 token 创建 Release,无需另配 GitHub token。
10
10
 
11
11
  Token 权限说明:[npm CI/CD 文档](https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow/)。
@@ -24,7 +24,7 @@ git push github v0.0.8
24
24
 
25
25
  上例中的版本须替换为本次版本。`github` 为本仓库指向 GitHub 的远端名称。
26
26
 
27
- 标签触发的工作流依次校验版本与 npm 登录、运行测试和安装校验、发布 GitHub 原生二进制制品、上传 npm 安装包和两项 Skill ZIP、发布 npm 包,最后回查 npm 渠道版本。正式版发布到 `latest`;含预发布后缀的版本发布到 `beta`,不覆盖 `latest`。
27
+ 标签触发两条独立工作流:`release.yml` 校验版本、运行测试和安装校验,发布 GitHub 原生二进制制品、npm 安装包和两项 Skill ZIP;`npm-publish.yml` 通过 OIDC 发布 npm。GitHub 制品发布不依赖 NPM_TOKEN。正式版发布到 `latest`;预发布版使用版本后缀首段作为 dist-tag,例如 `test.1` 使用 `test`。
28
28
 
29
29
  GitLab 流水线继续负责测试、构建和保存 `.tgz`,不重复发布 npm。
30
30
 
@@ -37,7 +37,7 @@ npm install -g --foreground-scripts --allow-scripts=@qfeius/everyline-cli @qfeiu
37
37
  everyline-cli version --output json
38
38
  ```
39
39
 
40
- 预发布版将 `@latest` 替换为 `@beta`。安装包内含六个平台的二进制,不需要再次从 GitHub 下载。
40
+ 预发布版将 `@latest` 替换为对应 dist-tag,例如 `@test`。安装包内含六个平台的二进制,不需要再次从 GitHub 下载。
41
41
 
42
42
  尚未发布到 npm 时,使用构建后的本地包:
43
43
 
@@ -64,7 +64,7 @@ everyline-cli version --output json
64
64
 
65
65
  ## 发布失败
66
66
 
67
- - 缺少 `NPM_TOKEN`:工作流在发布前明确报错,配置 GitHub Secret 后重跑。
67
+ - npm OIDC 身份校验失败:核对 npm Trusted Publisher 配置的仓库与 `npm-publish.yml` 工作流名称。
68
68
  - npm 403:核对 scope、包写权限、token 有效期及非交互发布权限。
69
69
  - 版本已存在:不要覆盖;核对已发布结果,需要变更时提升版本并创建新标签。
70
70
  - GitHub Release 已生成但 npm 发布失败:npm 包尚未发布成功;解决错误后可安装 Release 中的 `.tgz`,再处理 npm 发布。不要仅凭 Release 存在宣称 npm 已可安装。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qfeius/everyline-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "EveryLine CLI 工具的 npm/npx 薄包装",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -346,6 +346,40 @@ function ensureFirstInstallState(packageRoot, environment, userHome, platform, r
346
346
  return { path: statePath, ...JSON.parse(output) };
347
347
  }
348
348
 
349
+ /**
350
+ * restoreGlobalCommand 恢复 macOS/Linux 全局包缺失的命令链接,保留已有入口。
351
+ * 入参:packageRoot(string)为包目录;platform(string)为平台;environment(object)为 npm 环境。
352
+ * 返回值:void;禁用命令链接、非全局、Windows 或非标准全局布局直接返回,文件系统错误向上传递。
353
+ */
354
+ function restoreGlobalCommand(packageRoot, platform, environment) {
355
+ // 尊重 npm 显式禁用命令链接的选择,避免 postinstall 重新创建已被 npm 跳过的入口。
356
+ if (environment.npm_config_bin_links === "false" ||
357
+ environment.npm_config_global !== "true" || platform === "win32") return;
358
+ // 从包实际所在位置推导 prefix,避免使用另一个 Node/npm 的全局目录。
359
+ const root = resolve(packageRoot);
360
+ const modules = dirname(dirname(root));
361
+ if (basename(root) !== "everyline-cli" || basename(dirname(root)) !== "@qfeius" ||
362
+ basename(modules) !== "node_modules" || basename(dirname(modules)) !== "lib") return;
363
+ const source = join(root, "scripts", "run.js");
364
+ if (!existsSync(source)) throw new Error(`npm 包缺少命令入口: ${source}`);
365
+ const target = join(dirname(dirname(modules)), "bin", "everyline-cli");
366
+ try {
367
+ // lstat 也能识别失效链接;已有入口交给 npm 管理,绝不覆盖用户文件。
368
+ lstatSync(target);
369
+ return;
370
+ } catch (error) {
371
+ if (error.code !== "ENOENT") throw error;
372
+ }
373
+ mkdirSync(dirname(target), { recursive: true });
374
+ chmodSync(source, 0o755);
375
+ try {
376
+ symlinkSync(source, target);
377
+ } catch (error) {
378
+ // 并发 npm 已创建入口时保留其结果。
379
+ if (error.code !== "EEXIST") throw error;
380
+ }
381
+ }
382
+
349
383
  /**
350
384
  * installPackage 保留首次安装意图,将三宿主同步、废弃入口迁出和最终安装状态提交放在同一恢复流程中。
351
385
  * 入参:options(object,可选),可注入 packageRoot、platform、architecture、environment 和 userHome 供安装与测试使用。
@@ -368,6 +402,8 @@ function installPackage(options = {}) {
368
402
  chmodSync(binary, 0o755);
369
403
  }
370
404
 
405
+ restoreGlobalCommand(packageRoot, platform, environment);
406
+
371
407
  if (!shouldInstallCodexSkill(environment)) {
372
408
  return {
373
409
  binary,
@@ -492,6 +528,7 @@ if (require.main === module) {
492
528
  }
493
529
 
494
530
  module.exports = {
531
+ restoreGlobalCommand,
495
532
  formatInstallOutput,
496
533
  installPackage,
497
534
  ensureFirstInstallState,
@@ -2,7 +2,7 @@
2
2
  name: everyline-review
3
3
  description: "负责 EveryLine CLI 安装配置、身份授权与恢复;使用 EveryLine CLI 发起或继续单份合同智能审查,包括沙箱附件、审查主体、清单、强度、任务状态和完整签名结果链接;合同起草、一般法律咨询及规则维护不使用本 Skill。"
4
4
  metadata:
5
- version: "0.1.4"
5
+ version: "0.1.6"
6
6
  requires:
7
7
  bins: ["everyline-cli"]
8
8
  cliHelp: "everyline-cli --help;everyline-cli auth --help;everyline-cli review file upload --help;everyline-cli review task start --help;everyline-cli review task result --help"
@@ -2,7 +2,7 @@
2
2
  name: everyline-review-config
3
3
  description: "使用 EveryLine CLI 查询或管理审查清单、审查规则和规则分组,包括新增、修改、调整归属和删除;仅在合同审查中选择已有清单时不使用本 Skill。"
4
4
  metadata:
5
- version: "0.1.4"
5
+ version: "0.1.6"
6
6
  requires:
7
7
  bins: ["everyline-cli"]
8
8
  skills: ["everyline-review"]