@bitfun-vsl/plugin 0.0.0-stage → 0.0.1
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/LICENSE +21 -0
- package/README.md +62 -3
- package/assets/bitfun/command/vsl/cr-health.md +5 -0
- package/assets/bitfun/command/vsl/review.md +5 -0
- package/assets/bitfun/command/vsl/trajectory.md +8 -0
- package/assets/build.json +4 -0
- package/assets/claude-code/.claude-plugin/plugin.json +5 -0
- package/assets/claude-code/.mcp.json +10 -0
- package/assets/claude-code/agents/vsl-trajectory.md +6 -0
- package/assets/claude-code/commands/cr-health.md +7 -0
- package/assets/claude-code/commands/review.md +7 -0
- package/assets/claude-code/commands/trajectory.md +10 -0
- package/assets/claude-code/scripts/mcp-server.js +741 -0
- package/assets/claude-code/skills/vsl-trajectory-analysis/SKILL.md +7 -0
- package/assets/deveco/skills/vsl-trajectory-analysis/SKILL.md +7 -0
- package/assets/install-manifest.json +58 -0
- package/assets/skills/vsl-trajectory-analysis/SKILL.md +7 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.js +4576 -0
- package/dist/hosts/bitfun-kernel/commands.d.ts +26 -0
- package/dist/hosts/bitfun-kernel/plugin.d.ts +2 -0
- package/dist/hosts/bitfun-kernel/plugin.js +661 -0
- package/dist/hosts/claude-code/index.d.ts +1 -0
- package/dist/hosts/claude-code/index.js +680 -0
- package/dist/hosts/claude-code/mcp-server.d.ts +45 -0
- package/dist/hosts/deveco/plugin.d.ts +2 -0
- package/dist/hosts/deveco/plugin.js +659 -0
- package/dist/hosts/shared/opencode.d.ts +12 -0
- package/dist/hosts/shared/schema.d.ts +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +663 -0
- package/dist/install/config.d.ts +50 -0
- package/dist/install/index.d.ts +182 -0
- package/dist/install/resources.d.ts +7 -0
- package/dist/install/resources.js +590 -0
- package/dist/plugin/contracts.d.ts +63 -0
- package/dist/plugin/index.d.ts +19 -0
- package/dist/plugin/index.js +539 -0
- package/dist/plugin/modules/code-review/index.d.ts +4 -0
- package/dist/plugin/modules/code-review/runtime.d.ts +42 -0
- package/dist/plugin/modules/trajectory-analysis.d.ts +2 -0
- package/dist/plugin/registry.d.ts +16 -0
- package/dist/plugin/schema.d.ts +2 -0
- package/dist/runtime.d.ts +22 -0
- package/docs/code-review-integration.md +182 -0
- package/docs/init-installation.md +97 -0
- package/docs/plugin-design.md +391 -0
- package/package.json +74 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenBitFun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @bitfun-vsl/plugin
|
|
2
|
+
|
|
3
|
+
VSL 是一个面向 DevEco Code、Claude Code 和 BitFun 的精简插件包。插件模块由四类资源组成:Command、Agent、Skill 和 Tool。
|
|
4
|
+
|
|
5
|
+
当前内置轨迹分析 mock 模块和代码审查模块。轨迹模块用于验证注册和调用链路:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
/vsl:trajectory
|
|
9
|
+
-> vsl-trajectory Agent
|
|
10
|
+
-> vsl-trajectory-analysis Skill
|
|
11
|
+
-> vsl_trajectory_read / analyze / report
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
代码审查通过 `/vsl:review` 调用 `vsl_cr_review`,完整执行 CR 的 `cr review` 引擎,使用 CR 自己的模型配置。该模块只注册 Command 和 Tool。使用 `/vsl:cr-health` 检查环境。
|
|
15
|
+
|
|
16
|
+
集成说明见 [CR 代码审查文档](docs/code-review-integration.md)。本地设置 `VSL_CR_BIN` 为原生 CR 程序绝对路径,或将原生程序加入 PATH。
|
|
17
|
+
|
|
18
|
+
## 安装
|
|
19
|
+
|
|
20
|
+
需要 Bun、npm;选择 Claude Code 时还需要 Claude CLI。`vsl init` 按顺序显示两个复选列表:先选宿主(DevEco Code、Claude Code、BitFun,可多选),再选模块(默认全部勾选),最后只确认一次是否执行安装。方向键移动,空格勾选,`a` 全选,回车继续,Ctrl+C 取消。
|
|
21
|
+
|
|
22
|
+
本地包在本目录构建并启动向导:
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
npm pack
|
|
26
|
+
bun .\dist\cli\index.js init --package "$PWD\bitfun-vsl-plugin-0.0.1.tgz"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
发布到 npm 后,用户先安装提供 CLI 的包,再运行同一个向导:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
npm install -g @bitfun-vsl/plugin
|
|
33
|
+
vsl init
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
全局安装只提供 `vsl` 命令;init 负责更新宿主实际加载的依赖和注册。DevEco 安装到 `~/.config/deveco/node_modules/@bitfun-vsl/plugin`;BitFun 在 Windows 安装到 `%APPDATA%/bitfun/config/node_modules/@bitfun-vsl/plugin` 并注册 BitFun 专用入口,同时生成 `~/.config/opencode/command/vsl/*.md`;Claude 使用原生 marketplace/plugin 安装机制。宿主仍按原生插件方式加载资源。
|
|
37
|
+
|
|
38
|
+
模块包括 `trajectory-analysis` 和 `code-review`。模块中的 Command、Agent、Skill、Tool 随模块一起启停;安装向导不按资源分类让用户选择。代码审查需要独立的 CR 原生程序,可设置 `VSL_CR_BIN` 或使用 `--cr-bin <绝对路径>`。
|
|
39
|
+
|
|
40
|
+
自动化可明确选择一个或多个宿主并跳过交互:
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
vsl init --host deveco --host bitfun --modules trajectory-analysis,code-review --yes
|
|
44
|
+
vsl doctor --host deveco --json
|
|
45
|
+
vsl doctor --host bitfun --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
安装后重启宿主,调用 `vsl_runtime_info` 核对 `buildId`、`installationId` 和模块,再执行 `/vsl:trajectory sample.trace`(轨迹 mock)或 `/vsl:cr-health`。`doctor` 仅证明文件及注册正确,宿主加载状态由运行时工具证明。
|
|
49
|
+
|
|
50
|
+
BitFun 使用斜杠命名:`/vsl/trajectory sample.trace`、`/vsl/cr-health`、`/vsl/review`。需要启用 OpenCode 外部兼容。VSL 会把命令文件安装到 BitFun 扫描的 OpenCode 目录;当前 BitFun CLI 只在进入会话后刷新外部命令,启动页显示需要宿主侧支持。具体配置见 [BitFun 安装说明](docs/init-installation.md)。
|
|
51
|
+
|
|
52
|
+
已有原生手工安装入口继续保留;init 对同一宿主只注册一个 VSL 入口。已有无安装清单的旧包或未托管的 VSL file URL 会报告冲突,应先备份并移除对应旧注册/依赖,再运行 init。init 不覆盖用户修改的受管文件。详见 [安装与手动验证](docs/init-installation.md)。
|
|
53
|
+
|
|
54
|
+
## 开发
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bun install --ignore-scripts
|
|
58
|
+
bun test
|
|
59
|
+
bun run build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
共享契约在 `src/plugin`,OpenCode 插件宿主实现在 `src/hosts/shared`,DevEco 适配器在 `src/hosts/deveco`,BitFun kernel 适配器在 `src/hosts/bitfun-kernel`,Claude MCP 适配器在 `src/hosts/claude-code`。
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Check CR executable, CLI compatibility, and optionally its model connection"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use vsl_cr_health. Only set checkConnection=true when the user asks to test the model connection. Report executable path, version, compatibility and diagnostics. User request: $ARGUMENTS
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run a complete CR review of workspace, commit, or branch changes"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use vsl_cr_review to run the complete CR engine. Convert the user's scope to structured arguments; pass the current repository. Default to workspace review. CR uses its own model configuration. Report manifest terminal state and coverage; partial/skipped/failed are not complete. Preserve CR findings and severity; do not substitute your own review. If findingsTruncated or detailsTruncated is true, read resultFile in bounded batches before reporting results. Preview is scope only. Resume requires the original commit or from/to. Do not modify code or publish comments unless requested. User request: $ARGUMENTS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Check CR executable, CLI compatibility, and optionally its model connection"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the VSL MCP tools with their registered host prefix. Pass the absolute current project as repo when applicable.
|
|
6
|
+
|
|
7
|
+
Use vsl_cr_health. Only set checkConnection=true when the user asks to test the model connection. Report executable path, version, compatibility and diagnostics. User request: $ARGUMENTS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run a complete CR review of workspace, commit, or branch changes"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the VSL MCP tools with their registered host prefix. Pass the absolute current project as repo when applicable.
|
|
6
|
+
|
|
7
|
+
Use vsl_cr_review to run the complete CR engine. Convert the user's scope to structured arguments; pass the current repository. Default to workspace review. CR uses its own model configuration. Report manifest terminal state and coverage; partial/skipped/failed are not complete. Preserve CR findings and severity; do not substitute your own review. If findingsTruncated or detailsTruncated is true, read resultFile in bounded batches before reporting results. Preview is scope only. Resume requires the original commit or from/to. Do not modify code or publish comments unless requested. User request: $ARGUMENTS
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "分析指定轨迹并生成分析结果"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the VSL MCP tools with their registered host prefix. Pass the absolute current project as repo when applicable.
|
|
6
|
+
|
|
7
|
+
分析用户指定的轨迹。
|
|
8
|
+
先加载 vsl-trajectory-analysis Skill。
|
|
9
|
+
必须调用 vsl_trajectory_analyze,不要仅根据对话内容推测结果。
|
|
10
|
+
用户参数:$ARGUMENTS
|