dbx-plugin-skill 0.1.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbx-plugin-skill",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "DBX 插件开发 skill:覆盖插件创建、开发、调试、打包、发布到 dbx-store 上架的全流程,安装到 DSH / Claude Code / agents 技能目录",
5
5
  "type": "module",
6
6
  "bin": {
package/skill/SKILL.md CHANGED
@@ -160,7 +160,7 @@ dbx-plugin package .
160
160
  - 已废弃字段会被 CLI 拒绝:`entrypoints.ui.kind`、`entrypoints.backend.binaries`、`entrypoints.backend.protocol`。
161
161
 
162
162
  **权限**
163
- - 只声明真正用到的权限,取最小集合:`host.workbench`、`host.events`、`host.filesystem`、`host.binary`、`host.network:https://host[:port]`(HTTPS、无路径/通配符/Token,最多 8 个)。
163
+ - 只声明真正用到的权限,取最小集合:`host.workbench`、`host.events`、`host.filesystem`、`host.binary`、`host.plans:read`、`host.network:https://host[:port]`(HTTPS、无路径/通配符/Token,最多 8 个)。`host.plans:read` 仅开放宿主生成的估算执行计划读取。
164
164
  - `host.network` 只影响浏览器 CSP 的 `connect-src`,**不是** Sidecar 的网络防火墙,也仍受目标服务 CORS 约束。
165
165
 
166
166
  **安全**
@@ -34,12 +34,15 @@ const locale = window.dbxPlugin.locale;
34
34
  | `readAssetUrl(path)` | 读取包内资源并返回对象 URL | — |
35
35
  | `openWorkbench(id, context)` | 打开本插件另一个工作台 | `host.workbench` |
36
36
  | `openFilesystem(id, context)` | 打开本插件的文件系统入口 | `host.filesystem` |
37
+ | `getPlanCapabilities(connectionId)` / `explainPlan(request)` | 读取指定连接的估算执行计划 | `host.plans:read` |
37
38
  | `onInit(fn)` | 监听初始化/环境变化 | — |
38
39
  | `onEvent(fn)` | 监听后端事件 | `host.events` |
39
40
 
40
41
  常用 Host 内部方法(通过 `request` 调用):`host.getContext`、`ui.readAsset`。
41
42
  **只调用协议中声明的方法**,不要调用未公开的 DBX 内部函数。
42
43
 
44
+ 计划 API 仅支持宿主允许的只读估算模式;实际执行计划和会产生副作用的语句会被宿主拒绝。初始化消息中的 `capabilities.planApi` 为假或缺失时,应隐藏相关 UI,而不是用请求试探能力。
45
+
43
46
  ## 3. context 与快照规则
44
47
 
45
48
  跨边界传递的 context 是 **JSON 数据快照**,宿主会递归剥离 Vue 响应式包装并发送独立副本。因此插件**不能**依赖 Vue ref、Proxy、DOM 节点、函数、组件实例或凭据。
@@ -39,13 +39,15 @@
39
39
  "host.events",
40
40
  "host.filesystem",
41
41
  "host.binary",
42
+ "host.plans:read",
42
43
  "host.network:https://s3.example.com:443"
43
44
  ]
44
45
  }
45
46
  ```
46
47
 
47
48
  - `engines.host_api` 必需(`minLength: 1`,推荐 `"1"` 或 `"^1.0"`);`engines.dbx` 可选,是产品版本范围(模板默认 `>=0.5.68`)。
48
- - 固定权限枚举:`host.events`、`host.binary`、`host.workbench`、`host.filesystem`。
49
+ - 固定权限枚举:`host.events`、`host.binary`、`host.workbench`、`host.filesystem`、`host.plans:read`。
50
+ - `host.plans:read` 只允许读取宿主生成的**估算执行计划**,不允许执行 SQL、写入、DDL/DML 或实际计划;调用前检查初始化能力中的 `planApi`。
49
51
  - 网络权限 `host.network:https://<host>[:port]`:
50
52
  - **必须 HTTPS**;主机名只允许 `[A-Za-z0-9._-]`,端口可选数字;
51
53
  - **不允许路径、通配符、Token**;
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 本文件的结论来自 `t8y2/dbx-store` 当前源码(`CONTRIBUTING.md`、`scripts/validate.mjs`、`scripts/sync-release-candidate.mjs`、`scripts/discover-plugin-releases.mjs`、`scripts/finalize-candidates.mjs`、`.github/workflows/*`)与 `t8y2/dbx/plugins/RELEASING.md`。**当文档与脚本冲突时,以脚本为准** —— 文末列出已确认的冲突点。
4
4
  >
5
- > 上游 `plugins/RELEASING.md` 仍描述「先开 Issue、再开 catalog PR」的两段式流程;**当前实际流程是「一个 PR」**,以 `dbx-store/CONTRIBUTING.md` 为准。
5
+ > `dbx-store/CONTRIBUTING.md` 是当前提交流程的事实来源:**一个 PR** 同时承载候选、审核、受保护签名和目录回写。上游 `plugins/RELEASING.md` 中仍保留的“先开 Issue”文字已过时,不要照做。
6
6
 
7
7
  ## 1. 四类产物,四个归属
8
8
 
@@ -187,7 +187,7 @@ node <skill-root>/scripts/make-candidate.mjs . --release-notes "Initial release.
187
187
 
188
188
  1. 改代码 → **递增 `manifest.json` 的 `version`**(不要复用旧版本号)。
189
189
  2. 打新源码 Tag、发新 Release;**旧 Release 资产不可覆盖**。
190
- 3. 若仓库已登记 `autoUpdate: true`,Store 的**每小时**同步 Workflow 会在最新 Release 中找到 `release-candidates.json`,自动创建/更新候选 PR:
190
+ 3. 若仓库已登记 `autoUpdate: true`,Store 的同步 Workflow 每小时左右(每 15 分钟排程以抵御 GitHub 调度丢失)会在最新 Release 中找到 `release-candidates.json`,自动创建/更新候选 PR:
191
191
  - 分支 `automation/plugin-release/<plugin-id>/<version>`
192
192
  - PR 标题 `feat(store): submit <plugin-id>@<version>`
193
193
  - 候选内容未变化时**不提交不推送**(幂等)