dsh-sidebar-browser-agent 0.2.5 → 0.2.7
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 +15 -0
- package/README.md +20 -9
- package/icon.svg +16 -7
- package/lib/client.js +1 -1
- package/lib/{entry-0.2.5.js → entry-0.2.7.js} +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -2
- package/test/host-harness.mjs +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.7
|
|
4
|
+
|
|
5
|
+
- Redrew the plugin icon in the official plugin style: a transparent 36x36
|
|
6
|
+
gradient glyph (browser window, sidebar list, agent cursor) using the same
|
|
7
|
+
palette and stroke language as the built-in plugin icons.
|
|
8
|
+
- Declared `icon` in `package.json`, the field the Plugin Manager reads for a
|
|
9
|
+
plugin row, and added a GitHub-hosted 180px raster for storefront tiles.
|
|
10
|
+
|
|
11
|
+
## 0.2.6
|
|
12
|
+
|
|
13
|
+
- Publishing is now token-free: the publish workflow authenticates to npm with
|
|
14
|
+
**Trusted Publishing (GitHub OIDC)**, publishes with provenance, and no
|
|
15
|
+
longer needs the `NPM_TOKEN` secret (long-lived/bypass-2FA tokens are being
|
|
16
|
+
deprecated by npm).
|
|
17
|
+
|
|
3
18
|
## 0.2.5
|
|
4
19
|
|
|
5
20
|
- 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
|
|
129
|
-
|
|
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
|
|
157
|
-
|
|
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
|
|
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
|
|
178
|
+
git push --follow-tags # CI 跑测试;publish workflow 通过 OIDC 自动发布 npm
|
|
168
179
|
```
|
|
169
180
|
|
|
170
181
|
### 本地打包
|
package/icon.svg
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="sidebar-browser-page" x1="8" y1="9" x2="29" y2="27" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#67C7FE" />
|
|
5
|
+
<stop offset="1" stop-color="#3F77D8" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="sidebar-browser-side" x1="10" y1="11" x2="15" y2="25" gradientUnits="userSpaceOnUse">
|
|
8
|
+
<stop stop-color="#6AECB6" />
|
|
9
|
+
<stop offset="1" stop-color="#37A6B1" />
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
<rect x="7.7" y="8.7" width="20.6" height="18.6" rx="3.4" stroke="url(#sidebar-browser-page)" stroke-width="2.4" />
|
|
13
|
+
<rect x="10.4" y="12.2" width="3.6" height="1.8" rx="0.9" fill="url(#sidebar-browser-side)" />
|
|
14
|
+
<rect x="10.4" y="15.7" width="2.8" height="1.8" rx="0.9" fill="url(#sidebar-browser-side)" fill-opacity="0.65" />
|
|
15
|
+
<rect x="10.4" y="19.2" width="3.2" height="1.8" rx="0.9" fill="url(#sidebar-browser-side)" fill-opacity="0.45" />
|
|
16
|
+
<path d="M17.4 15.4L17.4 24.9L19.9 22.5L21.8 26.1L24.1 25.1L22.2 21.5L25.4 21.4Z" fill="url(#sidebar-browser-page)" stroke="#FFFFFF" stroke-width="0.7" stroke-linejoin="round" />
|
|
8
17
|
</svg>
|
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.
|
|
31
|
+
const PLUGIN_VERSION = '0.2.7'
|
|
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.
|
|
23
|
+
export const PLUGIN_VERSION = '0.2.7'
|
|
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.
|
|
23
|
+
export const PLUGIN_VERSION = '0.2.7'
|
|
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,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-sidebar-browser-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"icon": "./icon.svg",
|
|
5
6
|
"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
7
|
"license": "MIT",
|
|
7
8
|
"repository": {
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
"electron-webview"
|
|
20
21
|
],
|
|
21
22
|
"exports": {
|
|
22
|
-
".": "./lib/entry-0.2.
|
|
23
|
+
".": "./lib/entry-0.2.7.js",
|
|
23
24
|
"./client": "./lib/client.js",
|
|
24
25
|
"./locale/*.json": "./locale/*.json",
|
|
25
26
|
"./icon": "./icon.svg"
|
package/test/host-harness.mjs
CHANGED
|
@@ -370,6 +370,14 @@ async function main() {
|
|
|
370
370
|
// --- version consistency and the versioned Host entry ---
|
|
371
371
|
check('package version matches host constant', packageJson.version === PLUGIN_VERSION, `${packageJson.version} vs ${PLUGIN_VERSION}`)
|
|
372
372
|
check('client version matches package', clientSource.includes(`PLUGIN_VERSION = '${packageJson.version}'`), packageJson.version)
|
|
373
|
+
const iconReference = packageJson.icon
|
|
374
|
+
check('package declares a relative icon', typeof iconReference === 'string' && iconReference.startsWith('./') && !iconReference.includes('..'), iconReference)
|
|
375
|
+
const iconFile = typeof iconReference === 'string' ? path.resolve(here, '..', iconReference) : ''
|
|
376
|
+
check('declared icon exists', iconFile !== '' && fs.existsSync(iconFile), iconFile)
|
|
377
|
+
const iconSource = iconFile !== '' && fs.existsSync(iconFile) ? fs.readFileSync(iconFile, 'utf8') : ''
|
|
378
|
+
check('declared icon is a 36x36 svg', iconSource.startsWith('<svg') && iconSource.includes('viewBox="0 0 36 36"'), iconSource.slice(0, 60))
|
|
379
|
+
check('declared icon ships with the package', Array.isArray(packageJson.files) && packageJson.files.includes('icon.svg'), JSON.stringify(packageJson.files))
|
|
380
|
+
|
|
373
381
|
const expectedEntry = `./lib/entry-${packageJson.version}.js`
|
|
374
382
|
check('package entry is versioned', packageJson.exports?.['.'] === expectedEntry, packageJson.exports?.['.'])
|
|
375
383
|
const entryFile = path.join(here, '..', 'lib', `entry-${packageJson.version}.js`)
|