feat(plugins): move game resources behind marketplace

This commit is contained in:
2026-08-31 10:45:20 +08:00
parent 62304dc85b
commit fe656dd865
33 changed files with 1413 additions and 1018 deletions

View File

@@ -22,8 +22,6 @@ const MAX_REQUEST_BYTES = 64 * 1024;
const PRODUCT_TOOL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9._:-]{0,63}$/u;
const CORE_PRODUCT_TOOL_NAMES = new Set([
'agent_browser',
'game_asset_browser',
'game_asset_review',
'task_state',
'changed_file',
'runtime_context',

View File

@@ -12,8 +12,6 @@ const MUTATION_TOOLS = new Set([
'bash',
'edit',
'write',
'game_asset_browser',
'game_asset_review',
]);
const WORKER_ROLE = process.env.MAKELORE_PI_WORKER_ROLE || 'parent';
const leases = new Map();
@@ -272,26 +270,6 @@ export default async function makeloreRuntime(pi) {
},
},
);
if (WORKER_ROLE === 'parent') registerProductTool(
pi,
'game_asset_browser',
'Game assets',
'Load product-owned game asset candidates and their current review state.',
{ type: 'object', additionalProperties: false, properties: { invocationId: { type: 'string' } } },
);
if (WORKER_ROLE === 'parent') registerProductTool(
pi,
'game_asset_review',
'Game asset review',
'Load one versioned game asset review interaction without encoding decisions in message text.',
{
type: 'object', additionalProperties: false,
properties: {
invocationId: { type: 'string' },
candidateIds: { type: 'array', maxItems: 200, items: { type: 'string' } },
},
},
);
if (WORKER_ROLE === 'parent') registerProductTool(
pi,
'task_state',

View File

@@ -24,21 +24,16 @@ 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';
import { projectTaskState } from './extensions/task-state';
export type PiProductToolName =
| 'agent_browser'
| 'game_asset_browser'
| 'game_asset_review'
| 'task_state'
| 'changed_file'
| 'runtime_context';
const PI_PRODUCT_TOOL_NAMES = new Set<string>([
'agent_browser',
'game_asset_browser',
'game_asset_review',
'task_state',
'changed_file',
'runtime_context',
@@ -77,7 +72,6 @@ export interface PiProductToolsOptions {
export class PiProductTools {
readonly changeTracker: ConversationChangeTracker;
private readonly browser: PiAgentBrowserTool;
private readonly gameAssets = new PiGameAssetTools();
private capabilityRegistry: CodingCapabilityRegistry | undefined;
constructor(private readonly options: PiProductToolsOptions) {
@@ -152,12 +146,6 @@ export class PiProductTools {
if (toolName === 'agent_browser') {
return await this.browser.execute(context, input);
}
if (toolName === 'game_asset_browser') {
return await this.gameAssets.browse(context.projectPath, input, context.resourceId);
}
if (toolName === 'game_asset_review') {
return await this.gameAssets.review(context.projectPath, input, context.resourceId);
}
if (toolName === 'task_state') return projectTaskState(input);
if (toolName === 'changed_file') {
return await reportChangedFiles(this.changeTracker, context, input);

View File

@@ -124,7 +124,7 @@ export type PiWorkerProcessOptions = {
/** Tools available to every managed parent worker before plugin materialization. */
export const PI_CORE_TOOL_NAMES = Object.freeze([
'read', 'bash', 'edit', 'write', 'grep', 'find', 'ls', 'ask_user', 'subagent',
'agent_browser', 'game_asset_browser', 'game_asset_review',
'agent_browser',
'task_state', 'changed_file', 'runtime_context',
] as const);