From 2fedab14e5a03b45c8484f2997368d3ef6e7c4c3 Mon Sep 17 00:00:00 2001 From: Eva Date: Thu, 14 May 2026 01:00:57 +0700 Subject: [PATCH] test: guard plugin install metadata contracts --- test/install-contract.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/install-contract.test.ts b/test/install-contract.test.ts index 8ed453610..e09b326b6 100644 --- a/test/install-contract.test.ts +++ b/test/install-contract.test.ts @@ -18,6 +18,27 @@ describe('Eva Brain install contract', () => { expect(manifest.configSchema).not.toHaveProperty('voyage_api_key'); }); + test('root bundle plugin launches the installed gbrain serve runtime', () => { + const manifest = JSON.parse(readFileSync(join(root, 'openclaw.plugin.json'), 'utf8')); + const server = manifest.mcpServers?.gbrain; + + expect(server?.command).toBe('gbrain'); + expect(server?.args).toEqual(['serve']); + }); + + test('repo-owned version surfaces track the package version', () => { + const pkg = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')); + const rootManifest = JSON.parse(readFileSync(join(root, 'openclaw.plugin.json'), 'utf8')); + const codexPkg = JSON.parse(readFileSync(join(root, 'plugins/gbrain-codex/package.json'), 'utf8')); + const codexPlugin = JSON.parse(readFileSync(join(root, 'plugins/gbrain-codex/.codex-plugin/plugin.json'), 'utf8')); + const versionSource = readFileSync(join(root, 'src/version.ts'), 'utf8'); + + expect(rootManifest.version).toBe(pkg.version); + expect(codexPkg.version).toBe(pkg.version); + expect(codexPlugin.version).toBe(pkg.version); + expect(versionSource).toContain('pkg.version'); + }); + test('agent install guide preserves Eva, Voyage, OpenClaw, and support KB setup', () => { const guide = readFileSync(join(root, 'INSTALL_FOR_AGENTS.md'), 'utf8');