feat(plugins): bundle project scaffold marketplace plugin

This commit is contained in:
2026-09-04 22:21:24 +08:00
parent 2207806038
commit ddb678b46f
23 changed files with 218 additions and 86 deletions

View File

@@ -21,6 +21,7 @@ import {
const PACKAGE_ROOT = path.resolve('resources/coding-plugins/data-service');
const GAME_RESOURCE_ROOT = path.resolve('resources/coding-plugins/game-resource');
const PROJECT_SCAFFOLD_ROOT = path.resolve('resources/coding-plugins/project-scaffold');
async function packageManifests(): Promise<{ root: Record<string, unknown>; capability: Record<string, unknown> }> {
return {
@@ -33,12 +34,17 @@ describe('bundled coding plugin manifests', () => {
it('loads the fixed Data Service package and immutable declarations', async () => {
const definitions = await loadBundledCodingPluginDefinitions(path.resolve('resources/coding-plugins'));
const startupDefinitions = loadBundledCodingPluginDefinitionsSync(path.resolve('resources/coding-plugins'));
expect(BUNDLED_CODING_PLUGIN_ROOTS).toEqual(['data-service', 'game-resource']);
expect(BUNDLED_CODING_PLUGIN_ROOTS).toEqual([
'data-service',
'game-resource',
'project-scaffold',
]);
expect(resolveBundledCodingPluginRootPaths(path.resolve('resources/coding-plugins'))).toEqual([
PACKAGE_ROOT,
GAME_RESOURCE_ROOT,
PROJECT_SCAFFOLD_ROOT,
]);
expect(definitions).toHaveLength(2);
expect(definitions).toHaveLength(3);
expect(definitions[0]).toMatchObject({
id: 'makelore.data-service',
adapterId: 'data-service',
@@ -54,6 +60,17 @@ describe('bundled coding plugin manifests', () => {
provenance: { source: 'bundled', packageRoot: 'game-resource' },
skills: [{ id: 'game-resource', entryPath: 'skills/game-resource/SKILL.md' }],
},
{
id: 'makelore.project-scaffold', version: '1.0.0', runtimeKind: 'skill_only',
acquisitionMode: 'user_acquired', releaseId: '00000000-0000-4000-8000-000000000303',
provenance: { source: 'bundled', packageRoot: 'project-scaffold' },
skills: [{
id: 'makelore-project-scaffold',
entryPath: 'skills/makelore-project-scaffold/SKILL.md',
grants: [],
}],
tools: [],
},
]);
expect(startupDefinitions).toEqual(definitions);
expect(Object.isFrozen(startupDefinitions)).toBe(true);
@@ -128,6 +145,7 @@ describe('bundled coding plugin manifests', () => {
expect(resolveBundledCodingPluginRootPaths(path.resolve('tmp'))).toEqual([
path.resolve('tmp/data-service'),
path.resolve('tmp/game-resource'),
path.resolve('tmp/project-scaffold'),
]);
});