mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 19:06:08 +00:00
* feat(codex): share native threads across clients * test(codex): track coexistence temp dirs * fix(codex): preserve native source on thread forks * test(codex): use public temp fixtures * fix(codex): preserve owner context for deferred tools * fix(codex): forward owner identity to dynamic tools * fix(codex): forward owner status to harness attempts * docs(security): document shared Codex home * docs(security): document shared Codex home * docs(security): document shared Codex home
39 lines
1.4 KiB
TypeScript
39 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",
|
|
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;
|
|
}
|