fix(marketplace): close client review findings
This commit is contained in:
@@ -139,6 +139,53 @@ describe('coding plugin bounded product service', () => {
|
||||
expect(result.items).not.toContainEqual(expect.objectContaining({ id: 'makelore.removed' }));
|
||||
});
|
||||
|
||||
it('projects a client-incompatible installed package as unavailable', async () => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), 'makelore-plugin-incompatible-'));
|
||||
roots.push(root);
|
||||
await createCodingProjectMetadata(root, { now: '2026-08-28T00:00:00.000Z' });
|
||||
await createCodingProjectAgent(root, {
|
||||
id: 'builder', avatarId: 'avatar-01', roleName: '实现者', name: 'Builder',
|
||||
model: null, modelResolution: 'required', skillIds: ['notes'],
|
||||
responsibility: { mission: 'Build', owns: [], boundaries: [], collaborators: [], principles: [] },
|
||||
});
|
||||
const definition = {
|
||||
...DATA_SERVICE_PLUGIN_DEFINITION,
|
||||
id: 'makelore.notes', displayName: 'Notes', description: 'Notes',
|
||||
requiresBackend: false, runtimeKind: 'skill_only' as const,
|
||||
acquisitionMode: 'user_acquired' as const, releaseId: 'release-notes',
|
||||
provenance: { source: 'marketplace' as const, packageRoot: 'C:/packages/release-notes' },
|
||||
adapterId: '', operations: [], tools: [],
|
||||
skills: [{ id: 'notes', entryPath: 'skills/notes/SKILL.md', grants: [] }],
|
||||
surfaces: {},
|
||||
};
|
||||
const service = createCodingProjectPluginService({
|
||||
projects: { getProject: vi.fn().mockResolvedValue({ id: 'local-a', path: root }) },
|
||||
projectPlugins: {
|
||||
getEnabledPluginIds: vi.fn().mockResolvedValue([definition.id]), setEnabled: vi.fn(),
|
||||
},
|
||||
policyClient: {
|
||||
refresh: vi.fn(),
|
||||
getState: () => ({ status: 'unavailable' as const, revision: 0, lastVerifiedAt: null, catalog: null }),
|
||||
},
|
||||
adapters: [], definitions: [definition],
|
||||
effectiveResolver: {
|
||||
resolve: vi.fn().mockResolvedValue({
|
||||
accountSessionId: 'account-a\u00001', projectId: 'local-a',
|
||||
pluginReleaseIds: [], effectiveSkillIds: [], skillEntries: [],
|
||||
toolDefinitions: [], runtimePolicies: [],
|
||||
unavailableReasons: [{
|
||||
pluginId: definition.id, code: 'client_incompatible',
|
||||
message: 'Plugin Release is incompatible with this MakeLore client',
|
||||
}],
|
||||
}),
|
||||
} as never,
|
||||
});
|
||||
|
||||
await expect(service.list('local-a')).resolves.toMatchObject({
|
||||
items: [{ id: definition.id, enabled: true, state: 'unavailable' }],
|
||||
});
|
||||
});
|
||||
|
||||
it('projects the exact three capabilities and fourteen mixed-policy operations', async () => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), 'makelore-plugin-policy-join-'));
|
||||
roots.push(root);
|
||||
|
||||
Reference in New Issue
Block a user