MCPcopy Index your code
hub / github.com/openai/codex-plugin-cc / handleStatus

Function handleStatus

plugins/codex/scripts/codex-companion.mjs:883–908  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

881}
882
883async function handleStatus(argv) {
884 const { options, positionals } = parseCommandInput(argv, {
885 valueOptions: ["cwd", "timeout-ms", "poll-interval-ms"],
886 booleanOptions: ["json", "all", "wait"]
887 });
888
889 const cwd = resolveCommandCwd(options);
890 const reference = positionals[0] ?? "";
891 if (reference) {
892 const snapshot = options.wait
893 ? await waitForSingleJobSnapshot(cwd, reference, {
894 timeoutMs: options["timeout-ms"],
895 pollIntervalMs: options["poll-interval-ms"]
896 })
897 : buildSingleJobSnapshot(cwd, reference);
898 outputCommandResult(snapshot, renderJobStatusReport(snapshot.job), options.json);
899 return;
900 }
901
902 if (options.wait) {
903 throw new Error("`status --wait` requires a job id.");
904 }
905
906 const report = buildStatusSnapshot(cwd, { all: options.all });
907 outputResult(renderStatusPayload(report, options.json), options.json);
908}
909
910function handleResult(argv) {
911 const { options, positionals } = parseCommandInput(argv, {

Callers 1

mainFunction · 0.85

Calls 9

buildSingleJobSnapshotFunction · 0.90
renderJobStatusReportFunction · 0.90
buildStatusSnapshotFunction · 0.90
parseCommandInputFunction · 0.85
resolveCommandCwdFunction · 0.85
waitForSingleJobSnapshotFunction · 0.85
outputCommandResultFunction · 0.85
outputResultFunction · 0.85
renderStatusPayloadFunction · 0.85

Tested by

no test coverage detected