mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:10:42 +00:00
refactor: trim codex internal exports
This commit is contained in:
@@ -123,7 +123,7 @@ export async function applyCodexAppServerAuthProfile(params: {
|
||||
await params.client.request("account/login/start", loginParams);
|
||||
}
|
||||
|
||||
export function resolveCodexAppServerAuthProfileLoginParams(params: {
|
||||
function resolveCodexAppServerAuthProfileLoginParams(params: {
|
||||
agentDir: string;
|
||||
authProfileId?: string;
|
||||
}): Promise<LoginAccountParams | undefined> {
|
||||
|
||||
@@ -12,7 +12,7 @@ export const CODEX_CONTROL_METHODS = {
|
||||
review: "review/start",
|
||||
} as const;
|
||||
|
||||
export type CodexControlName = keyof typeof CODEX_CONTROL_METHODS;
|
||||
type CodexControlName = keyof typeof CODEX_CONTROL_METHODS;
|
||||
export type CodexControlMethod = (typeof CODEX_CONTROL_METHODS)[CodexControlName];
|
||||
|
||||
export function describeControlFailure(error: unknown): string {
|
||||
|
||||
@@ -46,7 +46,7 @@ export class CodexAppServerRpcError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
export type CodexServerRequestHandler = (
|
||||
type CodexServerRequestHandler = (
|
||||
request: Required<Pick<RpcRequest, "id" | "method">> & { params?: JsonValue },
|
||||
) => Promise<JsonValue | undefined> | JsonValue | undefined;
|
||||
|
||||
@@ -413,7 +413,7 @@ export class CodexAppServerClient {
|
||||
}
|
||||
}
|
||||
|
||||
export function defaultServerRequestResponse(
|
||||
function defaultServerRequestResponse(
|
||||
request: Required<Pick<RpcRequest, "id" | "method">> & { params?: JsonValue },
|
||||
): JsonValue {
|
||||
if (request.method === "item/tool/call") {
|
||||
|
||||
@@ -16,7 +16,7 @@ export type CodexComputerUseRequest = <T = JsonValue | undefined>(
|
||||
params?: unknown,
|
||||
) => Promise<T>;
|
||||
|
||||
export type CodexComputerUseStatusReason =
|
||||
type CodexComputerUseStatusReason =
|
||||
| "disabled"
|
||||
| "marketplace_missing"
|
||||
| "plugin_not_installed"
|
||||
@@ -42,7 +42,7 @@ export type CodexComputerUseStatus = {
|
||||
message: string;
|
||||
};
|
||||
|
||||
export class CodexComputerUseSetupError extends Error {
|
||||
class CodexComputerUseSetupError extends Error {
|
||||
readonly status: CodexComputerUseStatus;
|
||||
|
||||
constructor(status: CodexComputerUseStatus) {
|
||||
|
||||
@@ -4,13 +4,13 @@ import type { CodexSandboxPolicy, CodexServiceTier } from "./protocol.js";
|
||||
|
||||
const START_OPTIONS_KEY_SECRET = randomBytes(32);
|
||||
|
||||
export type CodexAppServerTransportMode = "stdio" | "websocket";
|
||||
export type CodexAppServerPolicyMode = "yolo" | "guardian";
|
||||
type CodexAppServerTransportMode = "stdio" | "websocket";
|
||||
type CodexAppServerPolicyMode = "yolo" | "guardian";
|
||||
export type CodexAppServerApprovalPolicy = "never" | "on-request" | "on-failure" | "untrusted";
|
||||
export type CodexAppServerSandboxMode = "read-only" | "workspace-write" | "danger-full-access";
|
||||
export type CodexAppServerApprovalsReviewer = "user" | "auto_review" | "guardian_subagent";
|
||||
export type CodexAppServerCommandSource = "managed" | "resolved-managed" | "config" | "env";
|
||||
export type CodexDynamicToolsProfile = "native-first" | "openclaw-compat";
|
||||
type CodexAppServerApprovalsReviewer = "user" | "auto_review" | "guardian_subagent";
|
||||
type CodexAppServerCommandSource = "managed" | "resolved-managed" | "config" | "env";
|
||||
type CodexDynamicToolsProfile = "native-first" | "openclaw-compat";
|
||||
|
||||
export type CodexComputerUseConfig = {
|
||||
enabled?: boolean;
|
||||
@@ -109,9 +109,9 @@ export const CODEX_COMPUTER_USE_CONFIG_KEYS = [
|
||||
"mcpServerName",
|
||||
] as const;
|
||||
|
||||
export const DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME = "computer-use";
|
||||
export const DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME = "computer-use";
|
||||
export const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 60_000;
|
||||
const DEFAULT_CODEX_COMPUTER_USE_PLUGIN_NAME = "computer-use";
|
||||
const DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME = "computer-use";
|
||||
const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 60_000;
|
||||
|
||||
const codexAppServerTransportSchema = z.enum(["stdio", "websocket"]);
|
||||
const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { AgentMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
||||
|
||||
export type CodexContextProjection = {
|
||||
type CodexContextProjection = {
|
||||
developerInstructionAddition?: string;
|
||||
promptText: string;
|
||||
assembledMessages: AgentMessage[];
|
||||
|
||||
@@ -12,7 +12,7 @@ type ManagedCodexAppServerPaths = {
|
||||
candidateCommandPaths: string[];
|
||||
};
|
||||
|
||||
export type ResolveManagedCodexAppServerOptions = {
|
||||
type ResolveManagedCodexAppServerOptions = {
|
||||
platform?: NodeJS.Platform;
|
||||
pluginRoot?: string;
|
||||
pathExists?: (filePath: string, platform: NodeJS.Platform) => Promise<boolean>;
|
||||
|
||||
@@ -4,12 +4,12 @@ import type {
|
||||
} from "openclaw/plugin-sdk/agent-harness-runtime";
|
||||
import type { JsonObject, JsonValue } from "./protocol.js";
|
||||
|
||||
export const CODEX_NATIVE_HOOK_RELAY_EVENTS = [
|
||||
export const CODEX_NATIVE_HOOK_RELAY_EVENTS: readonly NativeHookRelayEvent[] = [
|
||||
"pre_tool_use",
|
||||
"post_tool_use",
|
||||
"permission_request",
|
||||
"before_agent_finalize",
|
||||
] as const satisfies readonly NativeHookRelayEvent[];
|
||||
] as const;
|
||||
|
||||
type CodexHookEventName = "PreToolUse" | "PostToolUse" | "PermissionRequest" | "Stop";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
type EmbeddedRunAttemptParams,
|
||||
} from "openclaw/plugin-sdk/agent-harness-runtime";
|
||||
|
||||
export const DEFAULT_CODEX_APPROVAL_TIMEOUT_MS = 120_000;
|
||||
const DEFAULT_CODEX_APPROVAL_TIMEOUT_MS = 120_000;
|
||||
const MAX_PLUGIN_APPROVAL_TITLE_LENGTH = 80;
|
||||
const MAX_PLUGIN_APPROVAL_DESCRIPTION_LENGTH = 256;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type UserInputOption = {
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type CodexUserInputBridge = {
|
||||
type CodexUserInputBridge = {
|
||||
handleRequest: (request: {
|
||||
id: number | string;
|
||||
params?: JsonValue;
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { CodexAppServerModelListResult } from "./app-server/models.js";
|
||||
import { isJsonObject, type JsonObject, type JsonValue } from "./app-server/protocol.js";
|
||||
import type { SafeValue } from "./command-rpc.js";
|
||||
|
||||
export type CodexStatusProbes = {
|
||||
type CodexStatusProbes = {
|
||||
models: SafeValue<CodexAppServerModelListResult>;
|
||||
account: SafeValue<JsonValue | undefined>;
|
||||
limits: SafeValue<JsonValue | undefined>;
|
||||
|
||||
@@ -70,7 +70,7 @@ export async function safeCodexControlRequest(
|
||||
);
|
||||
}
|
||||
|
||||
export async function safeCodexModelList(pluginConfig: unknown, limit: number) {
|
||||
async function safeCodexModelList(pluginConfig: unknown, limit: number) {
|
||||
return await safeValue(
|
||||
async () => await listCodexAppServerModels(requestOptions(pluginConfig, limit)),
|
||||
);
|
||||
|
||||
@@ -36,11 +36,8 @@ import { buildCodexConversationTurnInput } from "./conversation-turn-input.js";
|
||||
const DEFAULT_BOUND_TURN_TIMEOUT_MS = 20 * 60_000;
|
||||
|
||||
export {
|
||||
createCodexConversationBindingData,
|
||||
readCodexConversationBindingData,
|
||||
readCodexConversationBindingDataRecord,
|
||||
resolveCodexDefaultWorkspaceDir,
|
||||
type CodexConversationBindingData,
|
||||
} from "./conversation-binding-data.js";
|
||||
|
||||
type CodexConversationRunOptions = {
|
||||
|
||||
@@ -19,20 +19,20 @@ export type CodexSkillSource = {
|
||||
sourceLabel: string;
|
||||
};
|
||||
|
||||
export type CodexPluginSource = {
|
||||
type CodexPluginSource = {
|
||||
name: string;
|
||||
source: string;
|
||||
manifestPath: string;
|
||||
};
|
||||
|
||||
export type CodexArchiveSource = {
|
||||
type CodexArchiveSource = {
|
||||
id: string;
|
||||
path: string;
|
||||
relativePath: string;
|
||||
message?: string;
|
||||
};
|
||||
|
||||
export type CodexSource = {
|
||||
type CodexSource = {
|
||||
root: string;
|
||||
confidence: "low" | "medium" | "high";
|
||||
codexHome: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import type { MigrationProviderContext } from "openclaw/plugin-sdk/plugin-entry";
|
||||
import { resolveHomePath } from "./helpers.js";
|
||||
|
||||
export type CodexMigrationTargets = {
|
||||
type CodexMigrationTargets = {
|
||||
workspaceDir: string;
|
||||
agentDir: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user