feat(coding): add PI-105 product file host API
This commit is contained in:
@@ -8,6 +8,11 @@ import {
|
||||
buildProductCodingCommandCatalog,
|
||||
listProductCodingSkills,
|
||||
} from '../../coding-projects/skill-registry';
|
||||
import type {
|
||||
ProductCodingCommand,
|
||||
ProductCodingSkill,
|
||||
ProductPiCommandInput,
|
||||
} from '../../../shared/coding-product-tools';
|
||||
import type { KnownToolDetails, RuntimeContextDetailsV1 } from '../contracts';
|
||||
import { PiAgentBrowserTool } from './extensions/agent-browser';
|
||||
import { reportChangedFiles } from './extensions/changed-file';
|
||||
@@ -65,6 +70,17 @@ export class PiProductTools {
|
||||
return this.changeTracker.getSnapshot(conversationId);
|
||||
}
|
||||
|
||||
listSkills(skillIds: readonly string[]): Promise<ProductCodingSkill[]> {
|
||||
return listProductCodingSkills(this.options.bundledSkillsDir, skillIds);
|
||||
}
|
||||
|
||||
async listCommands(
|
||||
skillIds: readonly string[],
|
||||
piCommands: readonly ProductPiCommandInput[] = [],
|
||||
): Promise<ProductCodingCommand[]> {
|
||||
return buildProductCodingCommandCatalog(await this.listSkills(skillIds), piCommands);
|
||||
}
|
||||
|
||||
async markBash(conversationId: string, runId: string): Promise<void> {
|
||||
await this.changeTracker.markProjectRefresh(conversationId, runId);
|
||||
}
|
||||
@@ -92,7 +108,7 @@ export class PiProductTools {
|
||||
return await reportChangedFiles(this.changeTracker, context, input);
|
||||
}
|
||||
if (toolName !== 'runtime_context') throw new Error('Product tool is unavailable');
|
||||
const skills = await listProductCodingSkills(this.options.bundledSkillsDir, context.skillIds);
|
||||
const skills = await this.listSkills(context.skillIds);
|
||||
const details: RuntimeContextDetailsV1 = {
|
||||
schema: 'runtime-context.v1',
|
||||
skills,
|
||||
|
||||
Reference in New Issue
Block a user