@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
39 lines (38 loc) • 1.09 kB
TypeScript
import type { ApplyPatchOperation } from './types/protocol';
export type { ApplyPatchOperation } from './types/protocol';
/**
* Result returned by an Editor operation.
*/
export type ApplyPatchResult = {
/**
* Whether the operation completed successfully. Defaults to `completed`.
*/
status?: 'completed' | 'failed';
/**
* Optional textual output to forward to the model.
*/
output?: string;
};
/**
* Host interface responsible for applying diffs on disk.
*/
export interface Editor {
/**
* Creates a new file from a V4A diff.
*/
createFile(operation: Extract<ApplyPatchOperation, {
type: 'create_file';
}>): Promise<ApplyPatchResult | void>;
/**
* Updates an existing file based on a V4A diff.
*/
updateFile(operation: Extract<ApplyPatchOperation, {
type: 'update_file';
}>): Promise<ApplyPatchResult | void>;
/**
* Deletes an existing file.
*/
deleteFile(operation: Extract<ApplyPatchOperation, {
type: 'delete_file';
}>): Promise<ApplyPatchResult | void>;
}