Files
openclaw/src/plugins/codex-app-server-extension-types.ts
Vincent Koc a5128777ee feat(codex): add tool hook parity (#70307)
* 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
2026-04-22 16:18:10 -07:00

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;