mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
Add the OpenClaw-required top-level id to openclaw.plugin.json, export a direct register(api) entrypoint from src/openclaw-context-engine.ts, add a manifest regression test, and document that skillpack harvest must preserve OpenClaw-native manifest fields (id, configSchema, contracts). llms bundles regenerated (bun run build:llms) — no content drift. Co-authored-by: Garry Tan <garrytan@gmail.com> Co-authored-by: Filip <FilipHarald@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
18 lines
811 B
TypeScript
18 lines
811 B
TypeScript
import { describe, expect, it } from 'bun:test';
|
|
import { readFileSync } from 'fs';
|
|
import { join } from 'path';
|
|
|
|
describe('root OpenClaw plugin manifest', () => {
|
|
it('declares the id required by OpenClaw plugin installs', () => {
|
|
const manifest = JSON.parse(readFileSync(join(import.meta.dir, '..', 'openclaw.plugin.json'), 'utf8'));
|
|
const entrySource = readFileSync(join(import.meta.dir, '..', 'src', 'openclaw-context-engine.ts'), 'utf8');
|
|
const entryId = entrySource.match(/id:\s*'([^']+)'/)?.[1];
|
|
|
|
expect(manifest.id).toBe(entryId);
|
|
expect(manifest.configSchema).toBeDefined();
|
|
expect(typeof manifest.configSchema).toBe('object');
|
|
expect(manifest.contracts?.contextEngines).toContain('gbrain-context');
|
|
expect(entrySource).toContain('export function register');
|
|
});
|
|
});
|