From 431742ffb28de3ea43c4ec5915c810c175631517 Mon Sep 17 00:00:00 2001 From: smackgg Date: Wed, 22 Jul 2026 18:06:49 +0800 Subject: [PATCH] feat(xiaoyunque): publish shared-runtime companion --- docs/packaging.md | 6 ++++++ docs/registry-spec.md | 5 +++++ packages/tools/xiaoyunque-mcp/AGENTS.md | 5 +++-- packages/tools/xiaoyunque-mcp/README.md | 4 +++- packages/tools/xiaoyunque-mcp/package.json | 2 +- packages/tools/xiaoyunque-mcp/src/index.ts | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/packaging.md b/docs/packaging.md index 3e57b4b..2b7a219 100644 --- a/docs/packaging.md +++ b/docs/packaging.md @@ -61,6 +61,12 @@ only that fixed reviewed script name (never a command supplied by package metada then immediately applies the same path, symlink, executable-mode, size, and digest admission checks used by packing. +A reviewed Bun companion may publish a bundle beginning exactly with +`#!/usr/bin/env convax-bun`. Compatible Convax hosts run that verified script through +their app-owned shared Bun runtime, avoiding one embedded Bun runtime per companion. +The script remains an immutable executable Release asset and follows the same target, +mode, size and SHA-256 checks as a native companion. Native companions remain valid. + ## Plugin-owned Skill composition A `convax.plugin/4` manifest may declare `contributes.skills` entries such as diff --git a/docs/registry-spec.md b/docs/registry-spec.md index 4ac5f61..8d6b679 100644 --- a/docs/registry-spec.md +++ b/docs/registry-spec.md @@ -109,6 +109,11 @@ is not arbitrary: it must exactly equal the package's immutable Release tag plus Windows). Clients select only their exact target, then verify byte count and SHA-256 before admitting the executable to host-owned storage. An absent target is an unsupported platform, never permission to search `PATH` or download another URL. +An admitted asset beginning exactly with `#!/usr/bin/env convax-bun` is a bundled +Bun program for a compatible host's app-owned shared runtime; every other asset is +executed natively. This byte-level convention adds no Registry v1 field, so older +clients still parse the catalog and fail closed at execution if the host runner is +unavailable. `opencode.skill/1` is the retained Registry v1 compatibility label used by current Convax clients; it is not the bundle format. Published Skill ZIPs follow the open diff --git a/packages/tools/xiaoyunque-mcp/AGENTS.md b/packages/tools/xiaoyunque-mcp/AGENTS.md index b887270..3bc51da 100644 --- a/packages/tools/xiaoyunque-mcp/AGENTS.md +++ b/packages/tools/xiaoyunque-mcp/AGENTS.md @@ -55,9 +55,10 @@ the Plugin ZIP and must never be imported by Convax packages. only for a canonical terminal state, unrecoverable repeated observation failure, authentication failure, or caller cancellation, without resubmitting the task. - Generated binaries and local credentials are ignored build/runtime output. -- The protected release build writes the `darwin/arm64` binary below +- The protected release build writes the `darwin/arm64` `convax-bun` program below `dist/darwin-arm64/`; repository tooling hashes and publishes it as an independent - companion asset. It must never be copied below the Plugin's `package/` directory. + companion asset. It reuses Convax's app-owned Bun runtime and must never be copied + below the Plugin's `package/` directory or compiled with a private Bun runtime. Run `bun typecheck`, `bun test`, `bun run build`, and `bun run build:release:darwin-arm64` before handoff. diff --git a/packages/tools/xiaoyunque-mcp/README.md b/packages/tools/xiaoyunque-mcp/README.md index 93d8834..75addb2 100644 --- a/packages/tools/xiaoyunque-mcp/README.md +++ b/packages/tools/xiaoyunque-mcp/README.md @@ -15,7 +15,9 @@ bun run build bun run build:release:darwin-arm64 ``` -正式发布产物为 `dist/darwin-arm64/convax-xiaoyunque-mcp`。它作为独立的 +正式发布产物为 `dist/darwin-arm64/convax-xiaoyunque-mcp`。它是带有精确 +`#!/usr/bin/env convax-bun` 标头的小型 Bun 程序,通过兼容版本 Convax 已随应用 +发布的共享 Bun runtime 运行,不再为这个插件重复打包一份 Bun。它作为独立的 `convax-companion-*` Release asset 发布,由 Registry 固定 URL、字节数和 SHA-256;Convax 安装插件时把它放入宿主管理目录。可执行文件不进入静态 Plugin ZIP,也不要求用户配置 `PATH`。 diff --git a/packages/tools/xiaoyunque-mcp/package.json b/packages/tools/xiaoyunque-mcp/package.json index 1b24493..8ffea40 100644 --- a/packages/tools/xiaoyunque-mcp/package.json +++ b/packages/tools/xiaoyunque-mcp/package.json @@ -8,7 +8,7 @@ }, "scripts": { "build": "bun build --compile --minify --outfile dist/convax-xiaoyunque-mcp src/index.ts", - "build:release:darwin-arm64": "bun build --compile --minify --target=bun-darwin-arm64 --outfile dist/darwin-arm64/convax-xiaoyunque-mcp src/index.ts", + "build:release:darwin-arm64": "bun build --minify --target=bun --outfile dist/darwin-arm64/convax-xiaoyunque-mcp src/index.ts", "clean": "rm -rf dist", "smoke:live:video": "bun scripts/live-video-smoke.ts", "test": "bun test", diff --git a/packages/tools/xiaoyunque-mcp/src/index.ts b/packages/tools/xiaoyunque-mcp/src/index.ts index 537cf17..ca897a4 100644 --- a/packages/tools/xiaoyunque-mcp/src/index.ts +++ b/packages/tools/xiaoyunque-mcp/src/index.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env bun +#!/usr/bin/env convax-bun import path from "node:path" import { XiaoYunqueAuthorizationState } from "./authorization-state.ts"