feat(coding-runtime): add managed Pi extension host
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user