feat(FN-3718): add droid runtime to tsup bundle with asset gate

Stages the droid runtime as a bundled plugin in the CLI's tsup configuration, gates the bundle bootstrap on droid asset availability, and adds tests asserting correct staging behavior in bundle output.

Fusion-Task-Id: FN-3718
This commit is contained in:
Fusion
2026-05-07 19:14:43 -07:00
committed by gsxdsm
parent a732ebb8c9
commit 9743dab1d9
5 changed files with 48 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ import {
bundlePath,
clientIndexPath,
dashboardClientStubMarker,
droidPluginMcpServerPath,
hasBuiltDashboardAssets,
openclawMcpSchemaServerPath,
} from "./bundle-output-helpers";
@@ -39,11 +40,21 @@ describe("hasBuiltDashboardAssets", () => {
expect(hasBuiltDashboardAssets()).toBe(false);
});
it("returns false when droid mcp-schema-server.cjs is missing", () => {
state.existingPaths.add(bundlePath);
state.existingPaths.add(clientIndexPath);
state.existingPaths.add(cursorPluginManifestPath);
state.existingPaths.add(openclawMcpSchemaServerPath);
expect(hasBuiltDashboardAssets()).toBe(false);
});
it("returns true when all required assets exist and dashboard stub marker is absent", () => {
state.existingPaths.add(bundlePath);
state.existingPaths.add(clientIndexPath);
state.existingPaths.add(cursorPluginManifestPath);
state.existingPaths.add(openclawMcpSchemaServerPath);
state.existingPaths.add(droidPluginMcpServerPath);
expect(hasBuiltDashboardAssets()).toBe(true);
});
@@ -53,6 +64,7 @@ describe("hasBuiltDashboardAssets", () => {
state.existingPaths.add(clientIndexPath);
state.existingPaths.add(cursorPluginManifestPath);
state.existingPaths.add(openclawMcpSchemaServerPath);
state.existingPaths.add(droidPluginMcpServerPath);
state.indexHtml = dashboardClientStubMarker;
expect(hasBuiltDashboardAssets()).toBe(false);

View File

@@ -14,6 +14,13 @@ export const openclawMcpSchemaServerPath = join(
"fusion-plugin-openclaw-runtime",
"mcp-schema-server.cjs",
);
export const droidPluginMcpServerPath = join(
cliRoot,
"dist",
"plugins",
"fusion-plugin-droid-runtime",
"mcp-schema-server.cjs",
);
export const dashboardClientStubMarker = "Dashboard assets not built";
@@ -40,7 +47,8 @@ export function hasBuiltDashboardAssets(): boolean {
!existsSync(bundlePath) ||
!existsSync(clientIndexPath) ||
!existsSync(cursorPluginManifestPath) ||
!existsSync(openclawMcpSchemaServerPath)
!existsSync(openclawMcpSchemaServerPath) ||
!existsSync(droidPluginMcpServerPath)
) {
return false;
}

View File

@@ -189,6 +189,17 @@ describe("CLI bundle output", () => {
expect(existsSync(join(stagedRoot, "mcp-schema-server.cjs"))).toBe(true);
});
it("dist/plugins/fusion-plugin-droid-runtime/ is staged with required bridge assets", () => {
const stagedRoot = join(cliRoot, "dist", "plugins", "fusion-plugin-droid-runtime");
const manifestPath = join(stagedRoot, "manifest.json");
expect(existsSync(manifestPath)).toBe(true);
const manifest = JSON.parse(readFileSync(manifestPath, "utf-8")) as { id?: string };
expect(manifest.id).toBe("fusion-plugin-droid-runtime");
expect(existsSync(join(stagedRoot, "bundled.js"))).toBe(true);
expect(existsSync(join(stagedRoot, "mcp-schema-server.cjs"))).toBe(true);
});
it("dist/plugins/fusion-plugin-cursor-runtime/ is staged with a valid manifest", () => {
const stagedRoot = join(cliRoot, "dist", "plugins", "fusion-plugin-cursor-runtime");
const manifestPath = join(stagedRoot, "manifest.json");