feat(coding-runtime): add managed Pi extension host

This commit is contained in:
2026-08-23 09:39:12 +08:00
parent 47159b3cbd
commit 3861c3286a
22 changed files with 1673 additions and 16 deletions

View File

@@ -75,7 +75,7 @@ export function buildPiRpcArgs(
'--no-themes',
'--no-context-files',
'--no-approve',
'--no-tools',
'--tools', 'read,bash,edit,write,grep,find,ls,ask_user',
...additionalArgs,
];
}
@@ -310,6 +310,17 @@ export class PiWorkerProcess {
return this.rpc.request<T>(command, options);
}
send(command: PiRpcCommand): Promise<void> {
if (!this.rpc) {
return Promise.reject(new PiProcessError(
'PI_WORKER_START_FAILED',
'Pi worker has not started',
{ generation: this.generationValue },
));
}
return this.rpc.send(command);
}
subscribe(listener: (event: PiRpcEvent) => void): () => void {
if (!this.rpc) throw new Error('Pi worker has not started');
return this.rpc.subscribe(listener);