d24d11a274
- Standardized missing-file read errors and now return `File not found: <path>` for absent edit targets. - Centralized AI provider, usage, and OAuth helpers into shared modules to remove duplicated logic. - Migrated OAuth/API-key login flows to shared factory helpers and removed inline prompt/token-exchange code. - Reused shared tools and formatter utilities for discovery, stream tails, LSP batching, and source formatting. - Consolidated repeated test helpers and fixtures into shared modules, replacing inline helper duplicates.
18 lines
688 B
TypeScript
18 lines
688 B
TypeScript
import type { PythonKernelExecutor } from "@oh-my-pi/pi-coding-agent/ipy/executor";
|
|
import type { KernelExecuteOptions, KernelExecuteResult } from "@oh-my-pi/pi-coding-agent/ipy/kernel";
|
|
|
|
export class FakeKernel implements PythonKernelExecutor {
|
|
private result: KernelExecuteResult;
|
|
private onExecute: (options?: KernelExecuteOptions) => Promise<void> | void;
|
|
|
|
constructor(result: KernelExecuteResult, onExecute: (options?: KernelExecuteOptions) => Promise<void> | void) {
|
|
this.result = result;
|
|
this.onExecute = onExecute;
|
|
}
|
|
|
|
async execute(_code: string, options?: KernelExecuteOptions): Promise<KernelExecuteResult> {
|
|
await this.onExecute(options);
|
|
return this.result;
|
|
}
|
|
}
|