diff --git a/scripts/src/help.ts b/scripts/src/help.ts index f0e35f9f..edd0b5c2 100644 --- a/scripts/src/help.ts +++ b/scripts/src/help.ts @@ -1038,6 +1038,17 @@ async function loadHelp(loader: () => Promise, fallback: unknown): Prom export async function staticNamespaceHelp(args: string[]): Promise { const [top, sub] = args; if (!args.slice(1).some(isHelpToken)) return null; + if ( + top === "platform-infra" + && sub === "sub2api" + && args[2] === "codex-pool" + && args[3] === "trace" + ) { + return loadHelp( + async () => (await import("./platform-infra-sub2api-codex")).codexPoolTraceHelp(), + { command: "platform-infra sub2api codex-pool trace", mutation: false }, + ); + } if ( top === "platform-infra" && sub === "sub2api" diff --git a/scripts/src/platform-infra-sub2api-codex/types.ts b/scripts/src/platform-infra-sub2api-codex/types.ts index d3af6b96..628c9142 100644 --- a/scripts/src/platform-infra-sub2api-codex/types.ts +++ b/scripts/src/platform-infra-sub2api-codex/types.ts @@ -397,6 +397,27 @@ export interface CodexLocalConsumerTomlOptions { responsesWebSocketsV2: boolean; } +export function codexPoolTraceHelp(): Record { + return { + command: "platform-infra sub2api codex-pool trace", + usage: "bun scripts/cli.ts platform-infra sub2api codex-pool trace --request-id [options]", + options: { + "--request-id ": "Required client or internal request ID; --id is an alias.", + "--target ": "YAML-selected Sub2API target.", + "--since ": "Search window such as 2h or 24h; default 24h.", + "--tail ": "Bounded runtime log tail from 100 to 200000; default 20000.", + "--context-seconds ": "Context around indexed events from 0 to 3600; default 300.", + "--show-lines": "Include bounded matched runtime log lines.", + "--full | --raw": "Explicit expanded or machine-readable disclosure.", + }, + state: { + mutation: false, + remoteJobSubmitted: false, + helpSource: "local", + }, + }; +} + export function codexPoolHelp(): unknown { const pool = readCodexPoolConfig(); const runtimeTarget = codexPoolRuntimeTarget();