Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled
Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11), free to diverge. Tree copied sans upstream .git; upstream remote added for future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19. Preserves docs/ARCHITECTURE.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
674
extensions/codex/src/app-server/protocol.ts
Normal file
674
extensions/codex/src/app-server/protocol.ts
Normal file
@@ -0,0 +1,674 @@
|
||||
// Codex plugin module implements protocol behavior.
|
||||
export type JsonValue = null | boolean | number | string | JsonValue[] | JsonObject;
|
||||
export type JsonObject = { [key: string]: JsonValue };
|
||||
export type CodexServiceTier = string;
|
||||
|
||||
export type CodexAppServerRequestMethod = keyof CodexAppServerRequestResultMap | (string & {});
|
||||
export type CodexAppServerRequestParams<M extends CodexAppServerRequestMethod> =
|
||||
M extends keyof CodexAppServerRequestParamsOverride
|
||||
? CodexAppServerRequestParamsOverride[M]
|
||||
: unknown;
|
||||
|
||||
export type CodexAppServerRequestResult<M extends CodexAppServerRequestMethod> =
|
||||
M extends keyof CodexAppServerRequestResultMap
|
||||
? CodexAppServerRequestResultMap[M]
|
||||
: JsonValue | undefined;
|
||||
|
||||
export type RpcRequest = {
|
||||
id?: number | string;
|
||||
method: string;
|
||||
params?: JsonValue;
|
||||
};
|
||||
|
||||
export type RpcResponse = {
|
||||
id: number | string;
|
||||
result?: JsonValue;
|
||||
error?: {
|
||||
code?: number;
|
||||
message: string;
|
||||
data?: JsonValue;
|
||||
};
|
||||
};
|
||||
|
||||
export type RpcMessage = RpcRequest | RpcResponse;
|
||||
|
||||
export type CodexInitializeParams = {
|
||||
clientInfo: {
|
||||
name: string;
|
||||
title?: string;
|
||||
version?: string;
|
||||
};
|
||||
capabilities?: JsonObject;
|
||||
};
|
||||
|
||||
export type CodexInitializeResponse = {
|
||||
serverInfo?: {
|
||||
name?: string;
|
||||
version?: string;
|
||||
};
|
||||
protocolVersion?: string;
|
||||
userAgent?: string;
|
||||
codexHome?: string;
|
||||
platformFamily?: string;
|
||||
platformOs?: string;
|
||||
};
|
||||
|
||||
export type CodexUserInput =
|
||||
| {
|
||||
type: "text";
|
||||
text: string;
|
||||
text_elements?: JsonValue[];
|
||||
}
|
||||
| {
|
||||
type: "image";
|
||||
url: string;
|
||||
}
|
||||
| {
|
||||
type: "localImage";
|
||||
path: string;
|
||||
};
|
||||
|
||||
export type CodexDynamicToolFunctionSpec = JsonObject & {
|
||||
type: "function";
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: JsonValue;
|
||||
deferLoading?: boolean;
|
||||
};
|
||||
|
||||
export type CodexDynamicToolNamespaceTool = CodexDynamicToolFunctionSpec;
|
||||
|
||||
export type CodexDynamicToolNamespaceSpec = JsonObject & {
|
||||
type: "namespace";
|
||||
name: string;
|
||||
description: string;
|
||||
tools: CodexDynamicToolNamespaceTool[];
|
||||
};
|
||||
|
||||
export type CodexDynamicToolSpec = CodexDynamicToolFunctionSpec | CodexDynamicToolNamespaceSpec;
|
||||
|
||||
export type CodexLegacyDynamicToolFunctionSpec = JsonObject & {
|
||||
name: string;
|
||||
description: string;
|
||||
inputSchema: JsonValue;
|
||||
deferLoading?: boolean;
|
||||
namespace?: string;
|
||||
};
|
||||
|
||||
export type CodexThreadStartDynamicToolSpec =
|
||||
| CodexDynamicToolSpec
|
||||
| CodexLegacyDynamicToolFunctionSpec;
|
||||
|
||||
export function flattenCodexDynamicToolFunctions(
|
||||
tools: readonly CodexDynamicToolSpec[] | undefined,
|
||||
): CodexDynamicToolFunctionSpec[] {
|
||||
return (tools ?? []).flatMap((tool) => (tool.type === "namespace" ? tool.tools : [tool]));
|
||||
}
|
||||
|
||||
export type CodexTurnEnvironmentParams = JsonObject & {
|
||||
environmentId: string;
|
||||
cwd: string;
|
||||
};
|
||||
|
||||
export type CodexThreadStartParams = JsonObject & {
|
||||
input?: CodexUserInput[];
|
||||
cwd?: string;
|
||||
model?: string;
|
||||
modelProvider?: string | null;
|
||||
personality?: string | null;
|
||||
approvalPolicy?: string | JsonObject;
|
||||
approvalsReviewer?: string | null;
|
||||
sandbox?: string;
|
||||
serviceTier?: CodexServiceTier | null;
|
||||
dynamicTools?: CodexThreadStartDynamicToolSpec[] | null;
|
||||
developerInstructions?: string;
|
||||
experimentalRawEvents?: boolean;
|
||||
environments?: CodexTurnEnvironmentParams[] | null;
|
||||
/** Retired by Codex 0.137, but still sent for supported custom app-server 0.125-0.136. */
|
||||
persistExtendedHistory?: boolean;
|
||||
};
|
||||
|
||||
export type CodexThreadResumeParams = JsonObject & {
|
||||
threadId: string;
|
||||
model?: string;
|
||||
modelProvider?: string | null;
|
||||
personality?: string | null;
|
||||
approvalPolicy?: string | JsonObject;
|
||||
approvalsReviewer?: string | null;
|
||||
sandbox?: string;
|
||||
serviceTier?: CodexServiceTier | null;
|
||||
config?: JsonObject;
|
||||
developerInstructions?: string;
|
||||
/** Retired by Codex 0.137, but still sent for supported custom app-server 0.125-0.136. */
|
||||
persistExtendedHistory?: boolean;
|
||||
};
|
||||
|
||||
export type CodexThreadStartResponse = {
|
||||
thread: CodexThread;
|
||||
model: string;
|
||||
modelProvider?: string | null;
|
||||
};
|
||||
|
||||
export type CodexThreadForkParams = CodexThreadStartParams & {
|
||||
threadId: string;
|
||||
baseInstructions?: string;
|
||||
ephemeral?: boolean;
|
||||
threadSource?: string | JsonObject;
|
||||
excludeTurns?: boolean;
|
||||
};
|
||||
|
||||
export type CodexThreadForkResponse = CodexThreadStartResponse;
|
||||
|
||||
export const CODEX_INTERACTIVE_THREAD_SOURCE_KINDS = ["cli", "vscode"] as const;
|
||||
|
||||
export type CodexThreadSourceKind =
|
||||
| (typeof CODEX_INTERACTIVE_THREAD_SOURCE_KINDS)[number]
|
||||
| "exec"
|
||||
| "appServer"
|
||||
| "subAgent"
|
||||
| "subAgentReview"
|
||||
| "subAgentCompact"
|
||||
| "subAgentThreadSpawn"
|
||||
| "subAgentOther"
|
||||
| "unknown";
|
||||
|
||||
export type CodexThreadListParams = JsonObject & {
|
||||
cursor?: string | null;
|
||||
limit?: number | null;
|
||||
modelProviders?: string[] | null;
|
||||
sortKey?: "created_at" | "updated_at" | "recency_at" | null;
|
||||
sortDirection?: "asc" | "desc" | null;
|
||||
archived?: boolean | null;
|
||||
searchTerm?: string | null;
|
||||
sourceKinds?: CodexThreadSourceKind[] | null;
|
||||
};
|
||||
|
||||
export type CodexThreadListResponse = {
|
||||
data: CodexThread[];
|
||||
nextCursor?: string | null;
|
||||
backwardsCursor?: string | null;
|
||||
};
|
||||
|
||||
export type CodexThreadReadParams = JsonObject & {
|
||||
threadId: string;
|
||||
includeTurns?: boolean;
|
||||
};
|
||||
|
||||
export type CodexThreadReadResponse = {
|
||||
thread: CodexThread;
|
||||
};
|
||||
|
||||
export type CodexThreadSetNameParams = JsonObject & {
|
||||
threadId: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type CodexThreadArchiveParams = JsonObject & {
|
||||
threadId: string;
|
||||
};
|
||||
|
||||
export type CodexThreadUnarchiveResponse = {
|
||||
thread: CodexThread;
|
||||
};
|
||||
|
||||
export type CodexThreadResumeResponse = {
|
||||
thread: CodexThread;
|
||||
model: string;
|
||||
modelProvider?: string | null;
|
||||
};
|
||||
|
||||
export type CodexThreadInjectItemsParams = JsonObject & {
|
||||
threadId: string;
|
||||
items: JsonValue[];
|
||||
};
|
||||
|
||||
export type CodexThreadUnsubscribeParams = JsonObject & {
|
||||
threadId: string;
|
||||
};
|
||||
|
||||
export type CodexTurnInterruptParams = JsonObject & {
|
||||
threadId: string;
|
||||
turnId: string;
|
||||
};
|
||||
|
||||
export type CodexTurnStartParams = JsonObject & {
|
||||
threadId: string;
|
||||
input?: CodexUserInput[];
|
||||
cwd?: string;
|
||||
model?: string;
|
||||
approvalPolicy?: string | JsonObject;
|
||||
approvalsReviewer?: string | null;
|
||||
sandboxPolicy?: CodexSandboxPolicy;
|
||||
serviceTier?: CodexServiceTier | null;
|
||||
effort?: string | null;
|
||||
personality?: string | null;
|
||||
environments?: CodexTurnEnvironmentParams[] | null;
|
||||
collaborationMode?: {
|
||||
mode: string;
|
||||
settings: JsonObject & {
|
||||
developer_instructions: string | null;
|
||||
};
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type CodexSandboxPolicy = string | JsonObject;
|
||||
|
||||
export type CodexTurnStartResponse = {
|
||||
turn: CodexTurn;
|
||||
};
|
||||
|
||||
export type CodexTurn = {
|
||||
id: string;
|
||||
threadId: string;
|
||||
status?: string;
|
||||
error?: CodexErrorNotification["error"];
|
||||
startedAt?: string | null;
|
||||
completedAt?: string | null;
|
||||
durationMs?: number | null;
|
||||
items: CodexThreadItem[];
|
||||
};
|
||||
|
||||
export type CodexThread = {
|
||||
id: string;
|
||||
sessionId?: string;
|
||||
name?: string | null;
|
||||
preview?: string | null;
|
||||
createdAt?: number | null;
|
||||
updatedAt?: number | null;
|
||||
status?: CodexThreadStatus | null;
|
||||
cwd?: string | null;
|
||||
source?: CodexSessionSource | null;
|
||||
threadSource?: string | null;
|
||||
agentNickname?: string | null;
|
||||
agentRole?: string | null;
|
||||
turns?: CodexTurn[];
|
||||
};
|
||||
|
||||
export type CodexThreadStatus =
|
||||
| { type: "notLoaded" }
|
||||
| { type: "idle" }
|
||||
| { type: "systemError" }
|
||||
| { type: "active"; activeFlags?: string[] };
|
||||
|
||||
export type CodexSubAgentThreadSpawnSource = {
|
||||
parent_thread_id: string;
|
||||
depth?: number;
|
||||
agent_path?: string | null;
|
||||
agent_nickname?: string | null;
|
||||
agent_role?: string | null;
|
||||
};
|
||||
|
||||
export type CodexSubAgentSource =
|
||||
| "review"
|
||||
| "compact"
|
||||
| "memory_consolidation"
|
||||
| { thread_spawn: CodexSubAgentThreadSpawnSource }
|
||||
| { other: string };
|
||||
|
||||
export type CodexSessionSource =
|
||||
| "cli"
|
||||
| "vscode"
|
||||
| "exec"
|
||||
| "appServer"
|
||||
| "unknown"
|
||||
| { custom: string }
|
||||
| { subAgent: CodexSubAgentSource };
|
||||
|
||||
export type CodexThreadStartedNotification = {
|
||||
thread: CodexThread;
|
||||
};
|
||||
|
||||
export type CodexThreadStatusChangedNotification = {
|
||||
threadId: string;
|
||||
status: CodexThreadStatus;
|
||||
};
|
||||
|
||||
export type CodexThreadItem = {
|
||||
id: string;
|
||||
type: string;
|
||||
title: string | null;
|
||||
status: string | null;
|
||||
name: string | null;
|
||||
tool: string | null;
|
||||
server: string | null;
|
||||
command: string | null;
|
||||
cwd: string | null;
|
||||
query: string | null;
|
||||
arguments?: JsonValue;
|
||||
result?: JsonValue;
|
||||
error?: CodexErrorNotification["error"];
|
||||
exitCode?: number | null;
|
||||
durationMs?: number | null;
|
||||
aggregatedOutput: string | null;
|
||||
text: string;
|
||||
contentItems?: CodexDynamicToolCallOutputContentItem[] | null;
|
||||
changes: Array<{ path: string; kind: string }>;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type CodexServerNotification = {
|
||||
method: string;
|
||||
params?: JsonValue;
|
||||
};
|
||||
|
||||
export type CodexDynamicToolCallParams = {
|
||||
namespace?: string | null;
|
||||
threadId: string;
|
||||
turnId: string;
|
||||
callId: string;
|
||||
tool: string;
|
||||
arguments?: JsonValue;
|
||||
};
|
||||
|
||||
export type CodexDynamicToolCallResponse = {
|
||||
asyncStarted?: boolean;
|
||||
contentItems: CodexDynamicToolCallOutputContentItem[];
|
||||
diagnosticTerminalType?: CodexDynamicToolDiagnosticTerminalType;
|
||||
sideEffectEvidence?: boolean;
|
||||
success: boolean;
|
||||
terminate?: boolean;
|
||||
};
|
||||
|
||||
export type CodexDynamicToolDiagnosticTerminalType = "blocked" | "completed" | "error";
|
||||
|
||||
export type CodexDynamicToolCallOutputContentItem =
|
||||
| {
|
||||
type: "inputText";
|
||||
text: string;
|
||||
}
|
||||
| {
|
||||
type: "inputImage";
|
||||
imageUrl: string;
|
||||
}
|
||||
| JsonObject;
|
||||
|
||||
export type CodexErrorNotification = {
|
||||
error: {
|
||||
message?: string;
|
||||
codexErrorInfo?: {
|
||||
message?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
[key: string]: unknown;
|
||||
};
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export type CodexTurnCompletedNotification = {
|
||||
turn: CodexTurn;
|
||||
};
|
||||
|
||||
export type CodexModel = {
|
||||
id?: string;
|
||||
model?: string;
|
||||
displayName?: string | null;
|
||||
description?: string | null;
|
||||
hidden: boolean;
|
||||
isDefault: boolean;
|
||||
inputModalities: string[];
|
||||
supportedReasoningEfforts: CodexReasoningEffortOption[];
|
||||
defaultReasoningEffort?: string | null;
|
||||
};
|
||||
|
||||
export type CodexReasoningEffortOption = {
|
||||
reasoningEffort?: string | null;
|
||||
};
|
||||
|
||||
export type CodexModelListResponse = {
|
||||
data: CodexModel[];
|
||||
nextCursor?: string | null;
|
||||
};
|
||||
|
||||
export type CodexGetAccountResponse = {
|
||||
account?: JsonValue;
|
||||
requiresOpenaiAuth?: boolean;
|
||||
};
|
||||
|
||||
export type CodexModelProviderCapabilitiesReadResponse = {
|
||||
namespaceTools: boolean;
|
||||
imageGeneration: boolean;
|
||||
webSearch: boolean;
|
||||
};
|
||||
|
||||
export type CodexChatgptAuthTokensRefreshResponse = {
|
||||
accessToken: string;
|
||||
chatgptAccountId: string;
|
||||
chatgptPlanType: string | null;
|
||||
};
|
||||
|
||||
export type CodexLoginAccountParams =
|
||||
| {
|
||||
type: "apiKey";
|
||||
apiKey: string;
|
||||
}
|
||||
| {
|
||||
type: "chatgptAuthTokens";
|
||||
accessToken: string;
|
||||
chatgptAccountId: string;
|
||||
chatgptPlanType: string | null;
|
||||
};
|
||||
|
||||
export type CodexPluginSummary = {
|
||||
id: string;
|
||||
remotePluginId?: string;
|
||||
name: string;
|
||||
source?: JsonObject;
|
||||
installed: boolean;
|
||||
enabled: boolean;
|
||||
installPolicy?: string;
|
||||
authPolicy?: string;
|
||||
availability?: string;
|
||||
interface?: JsonValue;
|
||||
};
|
||||
|
||||
export type CodexAppSummary = {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
installUrl?: string | null;
|
||||
needsAuth: boolean;
|
||||
};
|
||||
|
||||
export type CodexPluginDetail = {
|
||||
marketplaceName?: string;
|
||||
marketplacePath?: string | null;
|
||||
summary: CodexPluginSummary;
|
||||
description?: string | null;
|
||||
skills?: JsonValue[];
|
||||
apps: CodexAppSummary[];
|
||||
mcpServers: string[];
|
||||
};
|
||||
|
||||
export type CodexPluginMarketplaceEntry = {
|
||||
name: string;
|
||||
path?: string | null;
|
||||
interface?: JsonValue;
|
||||
plugins: CodexPluginSummary[];
|
||||
};
|
||||
|
||||
export type CodexPluginListResponse = {
|
||||
marketplaces: CodexPluginMarketplaceEntry[];
|
||||
marketplaceLoadErrors?: JsonValue[];
|
||||
featuredPluginIds?: string[];
|
||||
};
|
||||
|
||||
export type CodexPluginReadResponse = {
|
||||
plugin: CodexPluginDetail;
|
||||
};
|
||||
|
||||
export type CodexPluginListParams = {
|
||||
cwds: string[];
|
||||
};
|
||||
|
||||
export type CodexPluginReadParams = {
|
||||
marketplacePath?: string;
|
||||
remoteMarketplaceName?: string;
|
||||
pluginName: string;
|
||||
};
|
||||
|
||||
export type CodexPluginInstallParams = CodexPluginReadParams;
|
||||
|
||||
export type CodexPluginInstallResponse = {
|
||||
authPolicy: string;
|
||||
appsNeedingAuth: CodexAppSummary[];
|
||||
};
|
||||
|
||||
export type CodexAppInfo = {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string | null;
|
||||
logoUrl?: string | null;
|
||||
logoUrlDark?: string | null;
|
||||
distributionChannel?: string | null;
|
||||
branding?: JsonValue;
|
||||
appMetadata?: JsonValue;
|
||||
labels?: JsonValue;
|
||||
installUrl?: string | null;
|
||||
isAccessible: boolean;
|
||||
isEnabled: boolean;
|
||||
pluginDisplayNames: string[];
|
||||
};
|
||||
|
||||
export type CodexAppsListParams = {
|
||||
cursor?: string | null;
|
||||
limit?: number;
|
||||
forceRefetch?: boolean;
|
||||
};
|
||||
|
||||
export type CodexAppsListResponse = {
|
||||
data: CodexAppInfo[];
|
||||
nextCursor?: string | null;
|
||||
};
|
||||
|
||||
export type CodexSkillsListParams = {
|
||||
cwds: string[];
|
||||
forceReload?: boolean;
|
||||
};
|
||||
|
||||
export type CodexSkillScope = "user" | "repo" | "system" | "admin";
|
||||
|
||||
export type CodexSkillMetadata = {
|
||||
name: string;
|
||||
description: string;
|
||||
shortDescription?: string;
|
||||
interface?: JsonObject;
|
||||
dependencies?: JsonObject;
|
||||
path: string;
|
||||
scope: CodexSkillScope;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
export type CodexSkillErrorInfo = {
|
||||
path: string;
|
||||
message: string;
|
||||
};
|
||||
|
||||
export type CodexSkillsListEntry = {
|
||||
cwd: string;
|
||||
skills: CodexSkillMetadata[];
|
||||
errors: CodexSkillErrorInfo[];
|
||||
};
|
||||
|
||||
export type CodexSkillsListResponse = {
|
||||
data: CodexSkillsListEntry[];
|
||||
};
|
||||
|
||||
export type CodexHooksListParams = {
|
||||
cwds: string[];
|
||||
};
|
||||
|
||||
export type CodexHooksListResponse = {
|
||||
data: JsonValue[];
|
||||
nextCursor?: string | null;
|
||||
};
|
||||
|
||||
export type CodexMcpServerStatus = {
|
||||
name: string;
|
||||
tools: JsonObject;
|
||||
};
|
||||
|
||||
export type CodexListMcpServerStatusResponse = {
|
||||
data: CodexMcpServerStatus[];
|
||||
nextCursor?: string | null;
|
||||
};
|
||||
|
||||
export type CodexRequestObject = Record<string, unknown>;
|
||||
|
||||
export declare namespace v2 {
|
||||
export type AppInfo = CodexAppInfo;
|
||||
export type AppSummary = CodexAppSummary;
|
||||
export type AppsListParams = CodexAppsListParams;
|
||||
export type AppsListResponse = CodexAppsListResponse;
|
||||
export type HooksListParams = CodexHooksListParams;
|
||||
export type HooksListResponse = CodexHooksListResponse;
|
||||
export type PluginDetail = CodexPluginDetail;
|
||||
export type PluginInstallParams = CodexPluginInstallParams;
|
||||
export type PluginInstallResponse = CodexPluginInstallResponse;
|
||||
export type PluginListParams = CodexPluginListParams;
|
||||
export type PluginListResponse = CodexPluginListResponse;
|
||||
export type PluginMarketplaceEntry = CodexPluginMarketplaceEntry;
|
||||
export type PluginReadParams = CodexPluginReadParams;
|
||||
export type PluginReadResponse = CodexPluginReadResponse;
|
||||
export type PluginSummary = CodexPluginSummary;
|
||||
export type SkillsListParams = CodexSkillsListParams;
|
||||
export type SkillsListResponse = CodexSkillsListResponse;
|
||||
}
|
||||
|
||||
type CodexAppServerRequestParamsOverride = {
|
||||
"environment/add": { environmentId: string; execServerUrl: string };
|
||||
"thread/fork": CodexThreadForkParams;
|
||||
"thread/archive": CodexThreadArchiveParams;
|
||||
"thread/inject_items": CodexThreadInjectItemsParams;
|
||||
"thread/list": CodexThreadListParams;
|
||||
"thread/name/set": CodexThreadSetNameParams;
|
||||
"thread/read": CodexThreadReadParams;
|
||||
"thread/start": CodexThreadStartParams;
|
||||
"thread/unarchive": CodexThreadArchiveParams;
|
||||
"thread/unsubscribe": CodexThreadUnsubscribeParams;
|
||||
"turn/interrupt": CodexTurnInterruptParams;
|
||||
};
|
||||
|
||||
type CodexAppServerRequestResultMap = {
|
||||
initialize: CodexInitializeResponse;
|
||||
"account/rateLimits/read": JsonValue;
|
||||
"account/read": CodexGetAccountResponse;
|
||||
"app/list": CodexAppsListResponse;
|
||||
"config/mcpServer/reload": JsonValue;
|
||||
"config/read": JsonValue;
|
||||
"config/value/write": JsonValue;
|
||||
"environment/add": JsonValue;
|
||||
"experimentalFeature/enablement/set": JsonValue;
|
||||
"feedback/upload": JsonValue;
|
||||
"hooks/list": CodexHooksListResponse;
|
||||
"marketplace/add": JsonValue;
|
||||
"mcpServerStatus/list": CodexListMcpServerStatusResponse;
|
||||
"model/list": CodexModelListResponse;
|
||||
"modelProvider/capabilities/read": CodexModelProviderCapabilitiesReadResponse;
|
||||
"plugin/install": CodexPluginInstallResponse;
|
||||
"plugin/list": CodexPluginListResponse;
|
||||
"plugin/read": CodexPluginReadResponse;
|
||||
"review/start": JsonValue;
|
||||
"skills/list": CodexSkillsListResponse;
|
||||
"thread/compact/start": JsonValue;
|
||||
"thread/archive": JsonValue;
|
||||
"thread/fork": CodexThreadForkResponse;
|
||||
"thread/inject_items": JsonValue;
|
||||
"thread/list": CodexThreadListResponse;
|
||||
"thread/name/set": JsonValue;
|
||||
"thread/read": CodexThreadReadResponse;
|
||||
"thread/resume": CodexThreadResumeResponse;
|
||||
"thread/start": CodexThreadStartResponse;
|
||||
"thread/unarchive": CodexThreadUnarchiveResponse;
|
||||
"thread/unsubscribe": JsonValue;
|
||||
"turn/interrupt": JsonValue;
|
||||
"turn/start": CodexTurnStartResponse;
|
||||
"turn/steer": JsonValue;
|
||||
};
|
||||
|
||||
export function isJsonObject(value: unknown): value is JsonObject {
|
||||
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
||||
}
|
||||
|
||||
export function isRpcResponse(message: RpcMessage): message is RpcResponse {
|
||||
return "id" in message && !("method" in message);
|
||||
}
|
||||
Reference in New Issue
Block a user