@openai/agents-core
Version:
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows.
34 lines (33 loc) • 2.21 kB
TypeScript
import type { RunToolApprovalItem } from './items';
import type { Agent } from './agent';
import type { RunContext } from './runContext';
import type * as protocol from './types/protocol';
export type ApprovalCapableToolCall = RunToolApprovalItem['rawItem'];
export type LocalToolCall = protocol.FunctionCallItem | protocol.ComputerUseCallItem | protocol.ShellCallItem | protocol.ApplyPatchCallItem;
export declare function getHostedMcpApprovalToolName(toolName: string, toolCall: ApprovalCapableToolCall): string;
export declare function getToolInvocationCallId(toolCall: ApprovalCapableToolCall): string | undefined;
export declare function getToolInvocationFingerprint(toolName: string, toolCall: ApprovalCapableToolCall): string;
export declare function getToolInvocationNameFromFingerprint(fingerprint: string): string | undefined;
export declare function validateToolInvocationApproval(context: RunContext<any>, agent: Agent<any, any>, tool: {
name: string;
}, toolCall: ApprovalCapableToolCall): {
callId: string;
fingerprint: string;
};
export declare function validateToolInvocationName(context: RunContext<any>, agent: Agent<any, any>, toolName: string, toolCall: ApprovalCapableToolCall): {
callId: string;
fingerprint: string;
};
export declare function getHandoffToolInvocationName(handoffName: string): string;
export declare function validateHandoffToolInvocation(context: RunContext<any>, agent: Agent<any, any>, handoffName: string, toolCall: protocol.FunctionCallItem): {
callId: string;
fingerprint: string;
};
export declare function getToolInvocationApproval(context: RunContext<any>, agent: Agent<any, any>, tool: {
name: string;
}, toolCall: ApprovalCapableToolCall): boolean | undefined;
export declare function getToolInvocationRejectionMessage(context: RunContext<any>, agent: Agent<any, any>, tool: {
name: string;
}, toolCall: ApprovalCapableToolCall): string | undefined;
export declare function getBoundToolInvocationRejectionMessage(context: RunContext<any>, agent: Agent<any, any>, toolName: string, toolCall: ApprovalCapableToolCall): string | undefined;
export declare function getCanonicalToolCaller(toolCall: unknown): protocol.ToolCaller;