dsh-sidebar-browser-agent 0.2.5 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.6
4
+
5
+ - Publishing is now token-free: the publish workflow authenticates to npm with
6
+ **Trusted Publishing (GitHub OIDC)**, publishes with provenance, and no
7
+ longer needs the `NPM_TOKEN` secret (long-lived/bypass-2FA tokens are being
8
+ deprecated by npm).
9
+
3
10
  ## 0.2.5
4
11
 
5
12
  - Resilience: every awaited guest operation (page script, screenshot, native
package/README.md CHANGED
@@ -123,10 +123,15 @@ github:Hesitate-P/dsh-sidebar-browser-agent#v0.2.2
123
123
  也可以直接填 GitHub 仓库 URL。安装完成后 profile 依赖会记录为 `github:...#v0.2.0`,bundle 自动选中并启用。
124
124
  `engines.dsh` 声明兼容 `>=0.2.2-rc.1 <0.3.0`,Git 规格在安装后由 DSH 校验版本要求。
125
125
 
126
- ### 从 npm 安装(发布后,可一键更新)
126
+ ### 从 npm 安装(推荐,可一键更新)
127
127
 
128
- 包名 `dsh-sidebar-browser-agent`。发布后在 Plugin Manager 中以 `dsh-sidebar-browser-agent@<version>` 安装,
129
- 此后详情页会出现 **Update**(DSH 的版本列表与 Update 只对 registry 安装的第三方包生效)。
128
+ 包名 `dsh-sidebar-browser-agent`(已发布,最新 `0.2.5`)。在 Plugin Manager 中以
129
+ `dsh-sidebar-browser-agent@<version>` 安装(或直接点 Update 升级),此后详情页会持续提供 **Update**
130
+ (DSH 的版本列表与 Update 只对 registry 安装的第三方包生效):
131
+
132
+ ```text
133
+ plugin_manager install_bundle(target: "dsh-sidebar-browser-agent@0.2.5")
134
+ ```
130
135
 
131
136
  ### 开发安装(link)
132
137
 
@@ -153,18 +158,24 @@ GitHub 安装(`github:...` 规格)不会出现 Update。对应更新方式
153
158
  Plugin Manager 重装新版本后解析到新的模块 URL,Host 半会加载新代码而**无需重启** Harness;
154
159
  若仍看到「page half / Host half 版本不一致」告警,重启一次 Harness 即可。
155
160
 
156
- 如果希望 GitHub 安装也具备一键更新:把包发布到 npm(仓库自带 `.github/workflows/publish.yml`,
157
- 在 GitHub 配置 `NPM_TOKEN` secret 后推送 `v*` 标签即自动测试并发布),然后把 profile 的安装来源切换到
158
- registry spec(`dsh-sidebar-browser-agent@<version>`)一次即可。
161
+ 如果希望 GitHub 安装也具备一键更新:把 profile 的安装来源切换到 registry spec
162
+ (`dsh-sidebar-browser-agent@<version>`)一次即可;本仓库自 `0.2.5` 起已发布到 npm。
159
163
 
160
164
  ## 发布流程
161
165
 
166
+ 发布认证使用 **npm Trusted Publishing(GitHub OIDC)**,不使用长期 token:npm 包设置里把发布者绑定到
167
+ 本仓库的 `publish.yml`,workflow 以 `id-token: write` 换取短期发布权限(`npm publish --provenance`)。
168
+ 这样没有需要轮换的 `NPM_TOKEN`,也不受 bypass-2FA token 弃用政策影响。
169
+
170
+ 首次发布前在 npm 包设置(Settings → Trusted Publisher)绑定:owner `Hesitate-P`、repository
171
+ `dsh-sidebar-browser-agent`、workflow `publish.yml`。
172
+
162
173
  ```bash
163
- node scripts/set-version.mjs 0.2.1 # 同步 package.json 与 index.js/client.js 的 PLUGIN_VERSION
164
- npm test # 回归测试同时校验三处版本一致性
174
+ node scripts/set-version.mjs 0.2.1 # 同步 package.json、index.js/client.js 的 PLUGIN_VERSION,并生成新的 lib/entry-<version>.js
175
+ npm test # 回归测试同时校验版本一致性、版本化 Host 入口
165
176
  git commit -am "release v0.2.1"
166
177
  git tag v0.2.1
167
- git push --follow-tags # CI 跑测试;配置了 NPM_TOKEN 时 publish workflow 发布 npm
178
+ git push --follow-tags # CI 跑测试;publish workflow 通过 OIDC 自动发布 npm
168
179
  ```
169
180
 
170
181
  ### 本地打包
package/lib/client.js CHANGED
@@ -28,7 +28,7 @@ window.__ModuleLoader__.load({
28
28
  const BASE_BACKOFF_MS = 400
29
29
  const MAX_EVAL_CHARS = 100_000
30
30
  /** Plugin version reported by diagnostics; keep in sync with package.json. */
31
- const PLUGIN_VERSION = '0.2.5'
31
+ const PLUGIN_VERSION = '0.2.6'
32
32
  const MAX_SCREENSHOT_WIDTH = 1_400
33
33
  const MAX_SCREENSHOT_BASE64 = 12_000_000
34
34
  /**
@@ -20,7 +20,7 @@ import z from '../vendor/schemastery/index.mjs'
20
20
  export const name = 'dsh-sidebar-browser-agent'
21
21
 
22
22
  /** Plugin version reported by diagnostics; keep in sync with package.json. */
23
- export const PLUGIN_VERSION = '0.2.5'
23
+ export const PLUGIN_VERSION = '0.2.6'
24
24
 
25
25
  /** Services that must exist before this plugin mounts. */
26
26
  export const inject = ['webServer', 'connection', 'tools']
package/lib/index.js CHANGED
@@ -20,7 +20,7 @@ import z from '../vendor/schemastery/index.mjs'
20
20
  export const name = 'dsh-sidebar-browser-agent'
21
21
 
22
22
  /** Plugin version reported by diagnostics; keep in sync with package.json. */
23
- export const PLUGIN_VERSION = '0.2.5'
23
+ export const PLUGIN_VERSION = '0.2.6'
24
24
 
25
25
  /** Services that must exist before this plugin mounts. */
26
26
  export const inject = ['webServer', 'connection', 'tools']
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sidebar-browser-agent",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "type": "module",
5
5
  "description": "Native agent control for the DSH right-sidebar browser: manage tabs, and read, click, type, scroll, run JavaScript in and screenshot the real page through its Electron guest.",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "electron-webview"
20
20
  ],
21
21
  "exports": {
22
- ".": "./lib/entry-0.2.5.js",
22
+ ".": "./lib/entry-0.2.6.js",
23
23
  "./client": "./lib/client.js",
24
24
  "./locale/*.json": "./locale/*.json",
25
25
  "./icon": "./icon.svg"