From 901948c0dc1ddd98d26881673bbf5b0c6eedc53d Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 28 Sep 2026 14:03:25 +0200 Subject: [PATCH] fix(server): include internal plugin assets in built output --- .github/workflows/ci.yml | 3 +++ packages/server/package.json | 2 +- scripts/check-built-internal-plugins.mjs | 33 ++++++++++++++++++++++++ scripts/trace-daemon.mjs | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 scripts/check-built-internal-plugins.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e505bbb2a..0644e5b661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,6 +117,9 @@ jobs: - name: Build server stack run: npm run build:server + - name: Verify built internal plugin assets + run: node scripts/check-built-internal-plugins.mjs + - name: Typecheck all packages run: npm run typecheck diff --git a/packages/server/package.json b/packages/server/package.json index a4fd019585..982013cdf5 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -73,7 +73,7 @@ "clean": "node ../../scripts/clean-package-dist.mjs", "build": "npm run build:lib && npm run build:scripts", "build:clean": "npm run clean && npm run build", - "build:lib": "tsc -p tsconfig.server.json --incremental false && node scripts/build-opencode-bridge-plugin.mjs && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/server/server/speech/providers/local/sherpa/assets',{recursive:true}); fs.copyFileSync('src/server/speech/providers/local/sherpa/assets/silero_vad.onnx','dist/server/server/speech/providers/local/sherpa/assets/silero_vad.onnx'); fs.cpSync('src/terminal/shell-integration','dist/server/terminal/shell-integration',{recursive:true}); fs.cpSync('src/terminal/shell-integration','dist/src/terminal/shell-integration',{recursive:true}); fs.copyFileSync('src/terminal/terminal-ts-loader.mjs','dist/server/terminal/terminal-ts-loader.mjs'); fs.rmSync('dist/server/skills',{recursive:true,force:true}); fs.cpSync('../../skills','dist/server/skills',{recursive:true});\"", + "build:lib": "tsc -p tsconfig.server.json --incremental false && node scripts/build-opencode-bridge-plugin.mjs && node -e \"const fs=require('node:fs'); const path=require('node:path'); fs.mkdirSync('dist/server/server/speech/providers/local/sherpa/assets',{recursive:true}); fs.copyFileSync('src/server/speech/providers/local/sherpa/assets/silero_vad.onnx','dist/server/server/speech/providers/local/sherpa/assets/silero_vad.onnx'); fs.cpSync('src/terminal/shell-integration','dist/server/terminal/shell-integration',{recursive:true}); fs.cpSync('src/terminal/shell-integration','dist/src/terminal/shell-integration',{recursive:true}); fs.copyFileSync('src/terminal/terminal-ts-loader.mjs','dist/server/terminal/terminal-ts-loader.mjs'); fs.rmSync('dist/server/skills',{recursive:true,force:true}); fs.cpSync('../../skills','dist/server/skills',{recursive:true}); fs.cpSync('src/plugins','dist/server/plugins',{recursive:true,filter:(source)=>fs.statSync(source).isDirectory()||['paseo-plugin.json','icon.svg'].includes(path.basename(source))});\"", "build:scripts": "tsc -p tsconfig.scripts.json --incremental false && node -e \"const fs=require('node:fs'); fs.mkdirSync('dist/scripts',{recursive:true}); fs.copyFileSync('scripts/mcp-stdio-socket-bridge-cli.mjs','dist/scripts/mcp-stdio-socket-bridge-cli.mjs');\"", "prepack": "npm run build:clean && npm --prefix ../.. run build:daemon-web-ui", "start": "node dist/scripts/supervisor-entrypoint.js", diff --git a/scripts/check-built-internal-plugins.mjs b/scripts/check-built-internal-plugins.mjs new file mode 100644 index 0000000000..0a662dc64e --- /dev/null +++ b/scripts/check-built-internal-plugins.mjs @@ -0,0 +1,33 @@ +import assert from "node:assert/strict"; +import { readFile, stat } from "node:fs/promises"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { INTERNAL_PLUGINS } from "../packages/server/dist/server/plugins/index.js"; + +const pluginRoot = fileURLToPath( + new URL("../packages/server/dist/server/plugins/", import.meta.url), +); + +assert.ok(INTERNAL_PLUGINS.length > 0, "The built daemon must list internal plugins"); +for (const plugin of INTERNAL_PLUGINS) { + assert.equal(path.resolve(plugin.directory), path.join(pluginRoot, plugin.id)); + const manifestPath = path.join(plugin.directory, "paseo-plugin.json"); + assert.ok((await stat(manifestPath)).isFile(), `${plugin.id} manifest must be a file`); + const manifest = JSON.parse(await readFile(manifestPath, "utf8")); + assert.equal(manifest.id, plugin.id); + + const icons = []; + await plugin.contribute({ + registerUsageSource(source) { + if (source.icon) icons.push(source.icon); + }, + }); + for (const icon of icons) { + assert.ok( + (await stat(path.join(plugin.directory, icon))).isFile(), + `${plugin.id} icon must be a file`, + ); + } +} + +console.log(`Verified built assets for ${INTERNAL_PLUGINS.length} internal plugins`); diff --git a/scripts/trace-daemon.mjs b/scripts/trace-daemon.mjs index 137ca13172..93af9fb214 100644 --- a/scripts/trace-daemon.mjs +++ b/scripts/trace-daemon.mjs @@ -53,6 +53,9 @@ const entries = [ const additionalInputs = [ // Agent orchestration skill catalog loaded through filesystem paths "packages/server/dist/server/skills/**", + // Internal plugin manifests and icons are read through filesystem paths. + "packages/server/dist/server/plugins/**/paseo-plugin.json", + "packages/server/dist/server/plugins/**/icon.svg", // Shell integration scripts loaded by the terminal manager "packages/server/dist/server/terminal/shell-integration/**", // Silero VAD ONNX model (sherpa speech provider)