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

+19 -3
View File
@@ -19,7 +19,9 @@ import {
import {
type CodingCapabilityRegistry,
} from '../../coding-plugins/registry';
import type { EffectivePluginSnapshot } from '../../coding-plugins/effective-resolver';
import type { KnownToolDetails, RuntimeContextDetailsV1 } from '../contracts';
import { BUNDLED_CODING_SKILL_IDS } from '../../../shared/coding-skills';
import { PiAgentBrowserTool } from './extensions/agent-browser';
import { reportChangedFiles } from './extensions/changed-file';
import { PiGameAssetTools } from './extensions/game-assets';
@@ -53,6 +55,7 @@ export interface PiProductToolContext {
projectId: string;
projectPath: string;
skillIds: readonly string[];
effectiveSnapshot?: EffectivePluginSnapshot;
}
export interface PiProductToolResult {
@@ -66,6 +69,8 @@ export interface PiProductToolsOptions {
bundledSkillsDir: string;
changeTracker?: ConversationChangeTracker;
pluginSkillSources?: readonly ProductCodingPluginSkillSource[];
getPluginSkillSources?(): readonly ProductCodingPluginSkillSource[]
| Promise<readonly ProductCodingPluginSkillSource[]>;
capabilityRegistry?: CodingCapabilityRegistry;
}
@@ -97,16 +102,27 @@ export class PiProductTools {
return this.changeTracker.getSnapshot(conversationId);
}
listSkills(
async listSkills(
skillIds: readonly string[],
availablePluginSkillIds: readonly string[] = [],
): Promise<ProductCodingSkill[]> {
const available = new Set(availablePluginSkillIds);
const sources = (this.options.pluginSkillSources ?? []).map((source) => ({
const dynamicSources = this.options.getPluginSkillSources
? await this.options.getPluginSkillSources()
: [];
const uniqueSources = [...new Map(
[...(this.options.pluginSkillSources ?? []), ...dynamicSources]
.map((source) => [source.id, source] as const),
).values()];
const sources = uniqueSources.map((source) => ({
...source,
available: available.has(source.pluginId ?? source.id) || available.has(source.id),
}));
return listProductCodingSkills(this.options.bundledSkillsDir, skillIds, sources);
const selectedSkillIds = this.options.getPluginSkillSources
? skillIds.filter((id) => BUNDLED_CODING_SKILL_IDS.includes(id)
|| uniqueSources.some((source) => source.id === id))
: skillIds;
return listProductCodingSkills(this.options.bundledSkillsDir, selectedSkillIds, sources);
}
async listCommands(