mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
26 lines
792 B
TypeScript
26 lines
792 B
TypeScript
import type {
|
|
OpenClawPluginCommandDefinition,
|
|
PluginCommandContext,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
import { handleCodexSubcommand, type CodexCommandDeps } from "./command-handlers.js";
|
|
|
|
export function createCodexCommand(options: {
|
|
pluginConfig?: unknown;
|
|
deps?: Partial<CodexCommandDeps>;
|
|
}): OpenClawPluginCommandDefinition {
|
|
return {
|
|
name: "codex",
|
|
description: "Inspect and control the Codex app-server harness",
|
|
acceptsArgs: true,
|
|
requireAuth: true,
|
|
handler: (ctx) => handleCodexCommand(ctx, options),
|
|
};
|
|
}
|
|
|
|
export async function handleCodexCommand(
|
|
ctx: PluginCommandContext,
|
|
options: { pluginConfig?: unknown; deps?: Partial<CodexCommandDeps> } = {},
|
|
): Promise<{ text: string }> {
|
|
return await handleCodexSubcommand(ctx, options);
|
|
}
|