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

@@ -261,40 +261,45 @@ describe('buildPluginWorkspaceProjection', () => {
});
it('keeps bundled and downloadable official command sets inside their delivery boundaries', () => {
const bundledCatalog = {
...catalog.items[0]!,
pluginId: 'makelore.game-resource',
title: 'Game Resource',
runtimeKind: 'bundled_typed' as const,
};
const bundledLibrary = {
...library.items[0]!,
pluginId: bundledCatalog.pluginId,
title: bundledCatalog.title,
};
const bundledProject = {
...project,
items: [{
...project.items[0]!,
id: bundledCatalog.pluginId,
displayName: bundledCatalog.title,
enabled: false,
state: 'disabled' as const,
}],
};
for (const [pluginId, title, runtimeKind] of [
['makelore.game-resource', 'Game Resource', 'platform_hosted'],
['makelore.project-scaffold', 'Project Scaffold', 'skill_only'],
] as const) {
const bundledCatalog = {
...catalog.items[0]!,
pluginId,
title,
runtimeKind,
};
const bundledLibrary = {
...library.items[0]!,
pluginId: bundledCatalog.pluginId,
title: bundledCatalog.title,
};
const bundledProject = {
...project,
items: [{
...project.items[0]!,
id: bundledCatalog.pluginId,
displayName: bundledCatalog.title,
enabled: false,
state: 'disabled' as const,
}],
};
expect(commandKinds({
catalog: { ...catalog, items: [bundledCatalog] },
library: { ...library, items: [] },
marketplaceInstallations: {},
project: null,
})).toEqual(['acquire']);
expect(commandKinds({
catalog: { ...catalog, items: [bundledCatalog] },
library: { ...library, items: [bundledLibrary] },
marketplaceInstallations: {},
project: bundledProject,
})).toEqual(['remove_from_library', 'enable_project', 'open_agent_assignment']);
expect(commandKinds({
catalog: { ...catalog, items: [bundledCatalog] },
library: { ...library, items: [] },
marketplaceInstallations: {},
project: null,
})).toEqual(['acquire']);
expect(commandKinds({
catalog: { ...catalog, items: [bundledCatalog] },
library: { ...library, items: [bundledLibrary] },
marketplaceInstallations: {},
project: bundledProject,
})).toEqual(['remove_from_library', 'enable_project', 'open_agent_assignment']);
}
expect(commandKinds({ marketplaceInstallations: {} })).toEqual([
'remove_from_library',