mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 23:50:44 +00:00
* feat(codex): add tool hook parity * fix(codex): stabilize tool hook parity * fix(codex): tighten transcript hook typing * fix(codex): preserve mirrored transcript idempotency * fix(codex): normalize tool hook context
39 lines
944 B
TypeScript
39 lines
944 B
TypeScript
import type { AgentToolResult } from "@mariozechner/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;
|