feat: integrate marketplace plugins with coding runtime

This commit is contained in:
brother7 committed 2026-08-28 18:08:33 +08:00
1 parent 1d64b89499
commit 05917a789a
21 files changed
+1921 -29

No files matched your search

+15
View File
@@ -14,6 +14,7 @@ import {
} from '@electron/coding-runtime/pi/resource-loader';
import type { PluginPolicyClientState } from '@electron/services/plugin-policy-client';
import { DATA_SERVICE_PLUGIN_DEFINITION } from '../../shared/coding-plugins';
import type { EffectivePluginSnapshot } from '../../electron/coding-plugins/effective-resolver';
const temporaryRoots: string[] = [];
@@ -57,6 +58,16 @@ describe('Pi managed resource loader', () => {
it('materializes only managed prompt and explicitly selected bundled skills', async () => {
const fixture = await fixtureRoot();
const prompt = 'PRIVATE PARTNER PROMPT CONTENT';
const effectiveSnapshot: EffectivePluginSnapshot = {
accountSessionId: 'account-a\u00001',
projectId: 'project-1',
pluginReleaseIds: ['release-a'],
effectiveSkillIds: ['grilling'],
skillEntries: [{ id: 'grilling', entryPath: 'grilling/SKILL.md' }],
toolDefinitions: [],
runtimePolicies: [],
unavailableReasons: [],
};
const resources = await materializePiAgentResources({
userDataDir: fixture.userDataDir,
projectId: 'project-1',
@@ -68,6 +79,7 @@ describe('Pi managed resource loader', () => {
],
catalogRevision: 11,
bundledSkillsDir: fixture.skillsDir,
effectiveSnapshot,
revision: { provider: 3, resources: 7 },
});
@@ -88,8 +100,11 @@ describe('Pi managed resource loader', () => {
skillIds: ['grilling'],
skillEntries: [{ id: 'grilling', entryPath: 'grilling/SKILL.md' }],
catalogRevision: 11,
effectivePluginSnapshot: effectiveSnapshot,
revision: { provider: 3, resources: 7 },
});
expect(resources.effectivePluginSnapshot).toEqual(effectiveSnapshot);
expect(resources.summary.effectivePluginSnapshot).toEqual(effectiveSnapshot);
expect(JSON.stringify(manifest)).not.toContain(prompt);
await expect(readFile(path.join(fixture.userDataDir, '.pi', 'agents', 'agent-1.md'), 'utf8'))
.rejects.toMatchObject({ code: 'ENOENT' });