mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-19 05:11:38 +00:00
* feat: show Codex transcripts in sidebar * fix: clear Codex sidebar on Gateway switch * chore: leave release notes to release workflow * chore: refresh native i18n inventory * fix: satisfy macOS Codex node lint * fix: refresh native localization inventory * docs: refresh documentation map * chore: refresh UI locale metadata
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
/**
|
|
* Capability helpers for optional Codex app-server control-plane methods.
|
|
*/
|
|
import { CodexAppServerRpcError } from "./client.js";
|
|
|
|
/** Known app-server methods used by OpenClaw control surfaces. */
|
|
export const CODEX_CONTROL_METHODS = {
|
|
account: "account/read",
|
|
compact: "thread/compact/start",
|
|
feedback: "feedback/upload",
|
|
forkThread: "thread/fork",
|
|
listMcpServers: "mcpServerStatus/list",
|
|
listSkills: "skills/list",
|
|
listThreads: "thread/list",
|
|
listThreadTurns: "thread/turns/list",
|
|
readThread: "thread/read",
|
|
rateLimits: "account/rateLimits/read",
|
|
archiveThread: "thread/archive",
|
|
renameThread: "thread/name/set",
|
|
resumeThread: "thread/resume",
|
|
review: "review/start",
|
|
unarchiveThread: "thread/unarchive",
|
|
} as const;
|
|
|
|
type CodexControlName = keyof typeof CODEX_CONTROL_METHODS;
|
|
/** App-server method name from the known control method map. */
|
|
export type CodexControlMethod = (typeof CODEX_CONTROL_METHODS)[CodexControlName];
|
|
|
|
/** Formats unsupported control calls differently from ordinary RPC failures. */
|
|
export function describeControlFailure(error: unknown): string {
|
|
if (isUnsupportedControlError(error)) {
|
|
return "unsupported by this Codex app-server";
|
|
}
|
|
return error instanceof Error ? error.message : String(error);
|
|
}
|
|
|
|
function isUnsupportedControlError(error: unknown): error is CodexAppServerRpcError {
|
|
return error instanceof CodexAppServerRpcError && error.code === -32601;
|
|
}
|