dsh-cuigengji-plugin 0.4.2 → 0.4.3

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/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.4.3 固定发布与验收流程
4
+
5
+ - 维护者通过统一发布入口完成预检、打包、GitHub 发布、npm 可信发布、安装与升级验收及市场条目同步,减少渠道版本和安装包不一致的问题。
6
+ - 发布前在临时 Windows DSH 环境验证无 Git 安装,以及上一公开版和旧包名版本的升级、原配置和合成作品数据保留。
7
+ - GitHub 与 npm 复用同一份归档;新增断点续跑、版本与提交绑定、资产哈希检查和发布报告,不替换已公开的同版本安装包。
8
+ - npm 只有在精确版本、归档、完整性、版本标签和原生安装均核对通过后才算可用,占位包与命令返回成功不作为验收结果。
9
+ - 将维护者发布流程与普通用户的安装、迁移 Skill 分开,发布权限通过 GitHub Actions 的可信授权处理,交接资料不保存账号凭据。
10
+
3
11
  ## 0.4.2 统一名称与作品回收站
4
12
 
5
13
  - GitHub 仓库、npm 包和市场显示名统一为 `dsh-cuigengji-plugin`,界面仍显示“催更姬”;增加搜索关键词,安装文档优先面向 Windows 桌面用户。
@@ -32,6 +32,8 @@ npm view dsh-cuigengji-plugin@0.4.2 version repository.url dist.integrity --regi
32
32
 
33
33
  ## 后续自动发布
34
34
 
35
+ 维护者的固定入口为 `npm run release -- trust`:使用 npm 11.15.0 官方 CLI,先读取现有配置,只在缺少匹配权限时添加 `mistnest/dsh-cuigengji-plugin` 的 `publish-npm.yml` 可信发布;不删除其他连接。核对直接发布权限后启用仓库变量。该首次步骤仍需要使用真实安全密钥完成 npm 验证,不能由密码、邮箱验证码或恢复码代替。
36
+
35
37
  首次包已经发布后,在 npm 的 `dsh-cuigengji-plugin` 包设置中添加 GitHub Actions trusted publisher:
36
38
 
37
39
  - Organization or user:`mistnest`
@@ -44,6 +46,10 @@ npm view dsh-cuigengji-plugin@0.4.2 version repository.url dist.integrity --regi
44
46
 
45
47
  确认 npm 配置完成后,在公开仓库 Settings → Secrets and variables → Actions → Variables 新建仓库变量 `NPM_TRUSTED_PUBLISHING_ENABLED=true`,启用自动发布。未启用时工作流跳过,不将首次账号验证尚未完成误报成插件安装失败。
46
48
 
49
+ 首次建立可信发布授权后,必须在两天内通过该授权真实发布一个新版本,完成 npm 对仓库身份的绑定;超时未验证的授权会失效。重跑已发布版本时,本工作流只核对原归档并跳过上传,不能代替首次可信发布验收。按 [npm 官方说明](https://docs.npmjs.com/trusted-publishers/#trusted-publisher-configuration-expiry)准备下一次补丁发布,确认 GitHub Actions 的上传步骤实际成功后,才将自动发布标为已验收。
50
+
51
+ 后续维护 Agent 负责构建、检查、发布和渠道同步,账号持有人保管安全密钥与恢复码。维护流程、仓库和工作流名称可以写入交接文档;密码、一次性验证码、恢复码和访问 token 不作为项目交接资料。首次身份验证或账号授权变更需要持有人操作时,明确说明具体页面和步骤,不使用恢复码代替日常发布验证。
52
+
47
53
  之后照常完成测试,提交编译产物,建立与 `package.json` 版本一致的 `v<版本>` 标签,并发布带 `.tgz` 和 `SHA256SUMS` 的 GitHub Release。`.github/workflows/publish-npm.yml` 会自动:
48
54
 
49
55
  1. 检出版本标签,验证包名、版本与公开仓库身份,运行测试、类型检查及编译产物核对。
@@ -51,6 +57,8 @@ npm view dsh-cuigengji-plugin@0.4.2 version repository.url dist.integrity --regi
51
57
  3. 使用 npm trusted publishing 发布。稳定版使用 `latest`,预发布版使用 `next`。
52
58
  4. 从 npm 重新下载对应版本,核对包身份与 SHA-256。已有版本只有在归档完全一致时才跳过上传;任何不一致都会失败。
53
59
 
60
+ CLI 显示 `+ 包名@版本` 不足以证明可用。发布流程还要核对精确版本、`dist.integrity`、`latest` / `next` 指向和原生安装;公开包只有 `0.0.0-stage` 时视为未完成。若直接上传返回成功但精确版本不存在、`npm stage list` 也为空,保留状态为“公开版本待确认”,不要反复重传同版本或擅自消耗恢复码。
61
+
54
62
  旧 Release 或工作流中断可以在 GitHub Actions 的「Publish npm package」中手动运行,填写已有的 Release 标签。没有 trusted publisher 或权限不符时停止处理,不改用不明来源的凭据。
55
63
 
56
64
  ## 按包名安装验收
@@ -2,6 +2,37 @@
2
2
 
3
3
  本文件记录催更姬长期维护的发布方式。后续维护者和 Agent 以此为入口,再按链接使用现有安装、迁移和发布工具。普通用户看[安装说明](getting-started.md)或把[安装与更新指南](agent-installation.md)交给 Agent。
4
4
 
5
+ ## 固定发布入口
6
+
7
+ 作者说“发布更新”后,维护 Agent 先汇总这次实际修改,确定递增版本、更新 `package.json` / 锁文件 / `CHANGELOG.md`,构建并提交对应源码和产物,然后执行以下入口。作者不需要自己运行这些命令。
8
+
9
+ ```powershell
10
+ npm run release -- plan
11
+ npm run release -- prepare --desktop-exe "D:\Apps\DeepSeek Harness\DeepSeek Harness.exe"
12
+ npm run release -- publish
13
+ npm run release -- status
14
+ ```
15
+
16
+ 其他电脑传实际 DSH exe 路径,或设置 `CUIGENGJI_DESKTOP_EXE`。这些命令不会更新或关闭正式 DSH,不读真实作品;原生安装测试使用临时 profile 和虚构工作库。
17
+
18
+ | 命令 | 负责什么 |
19
+ | --- | --- |
20
+ | `plan` / `status` | 只读检查当前版本、工作树、GitHub Release、npm 精确版本与占位状态、可信发布开关、市场 PR |
21
+ | `prepare` | 要求已提交的 main;跑测试、类型检查、构建一致性、实际包审计、桌面无 Git 全新安装与升级;上一稳定版和 v0.4.1 旧名称边界都验证 |
22
+ | `publish` | 复用准备好的包;推送提交并等待 CI;建立同提交的版本标签和草稿,核对资产后公开;等待 npm 工作流;下载公开版本并进行原生安装验收,再同步待审核市场条目 |
23
+ | `verify` | 不重新打包,补验收公开 GitHub URL / npm 精确版本和升级,恢复中断后的渠道同步 |
24
+ | `trust` | 首次通过 npm 官方 2FA 流程配置指定仓库 / 工作流的直接可信发布权限,核对后启用工作流;需要账号持有人的真实验证方式 |
25
+
26
+ 每个版本的安装包、SHA-256、验收 JSON、`release-state.json`、更新公告草稿保存在 `releases/v<版本>/`,由 Git 忽略。状态绑定源提交与已测试归档;源、说明或包字节变化时拒绝继续。失败后先看报告中具体步骤,重跑原命令;同版本不重打包、不覆盖公开资产、不强推标签。并发运行会被锁阻止;已退出进程留下的锁可由脚本恢复。
27
+
28
+ 准备阶段发现代码或验收脚本错误时,先修复并提交,再用 `prepare --reset --desktop-exe <exe>` 重新验收。此选项仅允许尚无 GitHub Release、npm 版本或本地/远端标签的版本;原归档与记录移入本版 `preparation-history/`,不删除。出现任何发布资产后不能重置,公开内容变化须递增版本。
29
+
30
+ 默认完整发布必须已有 npm 可信发布授权。首次授权未完成而作者仍要发布 GitHub 版本时,用 `publish --github-only`,明确记录“GitHub 可用,npm 待完成”;之后用 `verify` 补齐。不得把 `0.0.0-stage` 占位版本、npm 命令返回 0 或只下载成功当作完成。npm 成功须同时核对精确版本、同一份归档、完整性、`latest` / `next` 指向与 DSH 无 Git 原生安装和升级。
31
+
32
+ 市场入口与主发布分开记录:当前工具只更新已授权的收录 PR #7064 中本插件的 `tarball`,保留介绍;PR 已合并或关闭后提示核对公开目录并准备独立条目更新,不自动改其他条目或发送评论。实际市场搜索和点击安装尚未验证时,报告保持“未验证”。
33
+
34
+ 账号首次授权完成后,后续 npm 上传由 GitHub Actions OIDC 处理;不依赖本地 npm 登录 token,也不保存密码或恢复码。首次可信授权必须两天内真实发布一个新版本,才能完成 npm 对仓库的验证。
35
+
5
36
  ## 一套源码,同一份成品包
6
37
 
7
38
  | 维护项 | 固定职责 |
package/lib/client.js CHANGED
@@ -45,7 +45,7 @@ var import_react = require("react");
45
45
  // package.json
46
46
  var package_default = {
47
47
  name: "dsh-cuigengji-plugin",
48
- version: "0.4.2",
48
+ version: "0.4.3",
49
49
  description: "\u50AC\u66F4\u59EC\uFF1A\u7ED9\u5927\u80A5\u9C7C\u4E00\u4E2A\u5C0F\u8BF4\u5DE5\u4F5C\u53F0\uFF0C\u4E00\u8D77\u5199\u6B63\u6587\u3001\u8BA8\u8BBA\u60C5\u8282\u3001\u6574\u7406\u4EBA\u7269\u4E0E\u4E16\u754C\u8BBE\u5B9A\u3002",
50
50
  type: "module",
51
51
  main: "runtime/index.js",
@@ -85,6 +85,7 @@ var package_default = {
85
85
  build: "node scripts/build.mjs",
86
86
  "check:build": "node scripts/build.mjs --check",
87
87
  "pack:release": "npm run typecheck && npm run build && npm run check:build && npm pack --ignore-scripts",
88
+ release: "node scripts/release.mjs",
88
89
  test: "node --test tests/*.test.js",
89
90
  "test:upgrade": "node --test tests/upgrade.test.js",
90
91
  "test:release": "node scripts/check-release-install.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cuigengji-plugin",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "催更姬:给大肥鱼一个小说工作台,一起写正文、讨论情节、整理人物与世界设定。",
5
5
  "type": "module",
6
6
  "main": "runtime/index.js",
@@ -40,6 +40,7 @@
40
40
  "build": "node scripts/build.mjs",
41
41
  "check:build": "node scripts/build.mjs --check",
42
42
  "pack:release": "npm run typecheck && npm run build && npm run check:build && npm pack --ignore-scripts",
43
+ "release": "node scripts/release.mjs",
43
44
  "test": "node --test tests/*.test.js",
44
45
  "test:upgrade": "node --test tests/upgrade.test.js",
45
46
  "test:release": "node scripts/check-release-install.mjs",