@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
41 lines (40 loc) • 1.51 kB
TypeScript
/** Host file protection. auto is an alias for required; off is rejected. */
export type LocalFileIOProtection = 'auto' | 'required' | 'off';
export declare const preparedFileIO: unique symbol;
/** Keep native file changes and snapshot capture separate from state inspection. */
export declare function withUnixLocalFileAccess<T>(state: object, operation: () => Promise<T>): Promise<T>;
/** Canonical host authority plus the requested path to check as the worker user. */
export type LocalFilePath = {
path: string;
accessPath: string;
preserveLeaf: boolean;
/** Only root entries require their pinned referent to remain unchanged. */
rootTarget?: string;
};
type FileRequest = {
operation: 'read' | 'image' | 'list' | 'exists' | 'directoryExists' | 'create' | 'update' | 'delete';
path: LocalFilePath;
destination?: LocalFilePath;
unlinkPath?: LocalFilePath;
limit?: number;
};
/** Owns trusted file workers independently of sandbox shell processes. */
export declare class UnixLocalFiles {
private readonly executable;
constructor(mode?: LocalFileIOProtection);
private readonly active;
private closed;
close(): Promise<void>;
stop(): Promise<void>;
run(request: FileRequest, options?: {
input?: string;
update?: (current: string) => string;
identity?: {
username: string;
uid: number;
gid: number;
isCurrentUser: boolean;
};
}): Promise<Buffer>;
}
export {};