mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-20 16:34:47 +00:00
39 lines
946 B
TypeScript
39 lines
946 B
TypeScript
import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
|
|
export type CodexAppServerToolResultEvent = {
|
|
threadId: string;
|
|
turnId: string;
|
|
toolCallId: string;
|
|
toolName: string;
|
|
args: Record<string, unknown>;
|
|
result: AgentToolResult<unknown>;
|
|
};
|
|
|
|
export type CodexAppServerExtensionContext = {
|
|
agentId?: string;
|
|
sessionId?: string;
|
|
sessionKey?: string;
|
|
runId?: string;
|
|
};
|
|
|
|
export type CodexAppServerToolResultHandlerResult = {
|
|
result: AgentToolResult<unknown>;
|
|
};
|
|
|
|
export type CodexAppServerExtensionRuntime = {
|
|
on: (
|
|
event: "tool_result",
|
|
handler: (
|
|
event: CodexAppServerToolResultEvent,
|
|
ctx: CodexAppServerExtensionContext,
|
|
) =>
|
|
| Promise<CodexAppServerToolResultHandlerResult | void>
|
|
| CodexAppServerToolResultHandlerResult
|
|
| void,
|
|
) => void;
|
|
};
|
|
|
|
export type CodexAppServerExtensionFactory = (
|
|
runtime: CodexAppServerExtensionRuntime,
|
|
) => Promise<void> | void;
|