Files
openclaw/src/commands/codex-runtime-plugin-install.ts

26 lines
1.0 KiB
TypeScript

// Codex runtime plugin auto-install/repair helpers for OpenAI model selections.
import { modelSelectionShouldEnsureCodexPlugin } from "../agents/openai-routing.js";
import { createRuntimePluginModelSelectionHelpers } from "./runtime-plugin-install.js";
export const CODEX_RUNTIME_PLUGIN_ID = "codex";
const CODEX_RUNTIME_PLUGIN_LABEL = "Codex";
const CODEX_RUNTIME_PLUGIN_NPM_SPEC = "@openclaw/codex";
const CODEX_RUNTIME_PLUGIN_DESCRIPTOR = {
pluginId: CODEX_RUNTIME_PLUGIN_ID,
label: CODEX_RUNTIME_PLUGIN_LABEL,
npmSpec: CODEX_RUNTIME_PLUGIN_NPM_SPEC,
warningLabel: CODEX_RUNTIME_PLUGIN_LABEL,
};
const codexRuntimePluginInstall = createRuntimePluginModelSelectionHelpers({
descriptor: CODEX_RUNTIME_PLUGIN_DESCRIPTOR,
shouldEnsure: ({ cfg, model }) =>
modelSelectionShouldEnsureCodexPlugin({
config: cfg,
model,
}),
});
export const ensureCodexRuntimePluginForModelSelection = codexRuntimePluginInstall.ensure;
export const repairCodexRuntimePluginInstallForModelSelection = codexRuntimePluginInstall.repair;