automata-cli 0.1.0-009-codex-flag-implement-next.73 → 0.1.0-009-codex-flag-implement-next.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +4 -70
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1100,11 +1100,10 @@ function summarizeTool(name, input) {
1100
1100
  }
1101
1101
 
1102
1102
  // src/codex/codexService.ts
1103
- import { spawn as spawn2, spawnSync as spawnSync5 } from "child_process";
1104
- import { createInterface as createInterface2 } from "readline";
1103
+ import { spawnSync as spawnSync5 } from "child_process";
1105
1104
  function invokeCodexCode(prompt, options = {}) {
1106
1105
  if (options.verbose) {
1107
- return invokeCodexCodeVerbose(prompt, options.yolo ?? false);
1106
+ process.stderr.write("Warning: --verbose is not supported for Codex and will be ignored.\n");
1108
1107
  }
1109
1108
  invokeCodexCodeSync(prompt, options.yolo ?? false);
1110
1109
  }
@@ -1117,71 +1116,6 @@ function invokeCodexCodeSync(prompt, yolo) {
1117
1116
  handleSpawnError(result.error, "codex");
1118
1117
  handleExitCode(result.status, "Codex");
1119
1118
  }
1120
- function invokeCodexCodeVerbose(prompt, yolo) {
1121
- return new Promise((resolve2) => {
1122
- const codexBin = resolveCommand("codex");
1123
- const args = ["exec"];
1124
- if (yolo) args.push("--dangerously-bypass-approvals-and-sandbox");
1125
- args.push("--json", prompt);
1126
- const child = spawn2(codexBin, args, { stdio: ["inherit", "pipe", "inherit"] });
1127
- const rl = createInterface2({ input: child.stdout });
1128
- let stepCount = 0;
1129
- child.on("error", (err) => {
1130
- handleSpawnError(err, "codex");
1131
- });
1132
- rl.on("line", (line) => {
1133
- try {
1134
- const event = JSON.parse(line);
1135
- formatCodexEvent(event, stepCount);
1136
- if (event["type"] === "agent_message" || event["type"] === "tool_call") stepCount++;
1137
- } catch {
1138
- }
1139
- });
1140
- child.on("close", (code) => {
1141
- handleExitCode(code, "Codex");
1142
- resolve2();
1143
- });
1144
- });
1145
- }
1146
- function formatCodexEvent(event, stepCount) {
1147
- const type = event["type"];
1148
- if (type === "tool_call") {
1149
- const name = event["name"];
1150
- const input = event["input"];
1151
- const summary = name ? summarizeCodexTool(name, input) : "tool call";
1152
- process.stderr.write(` [step ${stepCount + 1}] ${summary}
1153
- `);
1154
- } else if (type === "agent_message") {
1155
- const content = event["content"];
1156
- if (content && content.length > 0) {
1157
- const preview = content.length > 120 ? content.slice(0, 120) + "..." : content;
1158
- const firstLine = preview.split("\n")[0] ?? preview;
1159
- process.stderr.write(` [step ${stepCount + 1}] ${firstLine}
1160
- `);
1161
- }
1162
- } else if (type === "session_complete" || type === "completed") {
1163
- const result = event["result"];
1164
- process.stderr.write("\n--- Result ---\n");
1165
- if (result) {
1166
- process.stdout.write(result + "\n");
1167
- }
1168
- }
1169
- }
1170
- function summarizeCodexTool(name, input) {
1171
- if (!input) return `tool: ${name}`;
1172
- switch (name) {
1173
- case "shell":
1174
- return `running: ${truncate(String(input["cmd"] ?? input["command"] ?? ""), 80)}`;
1175
- case "read_file":
1176
- return `reading ${String(input["path"] ?? "file")}`;
1177
- case "write_file":
1178
- return `writing ${String(input["path"] ?? "file")}`;
1179
- case "list_files":
1180
- return `listing files: ${String(input["path"] ?? ".")}`;
1181
- default:
1182
- return `tool: ${name}`;
1183
- }
1184
- }
1185
1119
 
1186
1120
  // src/commands/getReady.ts
1187
1121
  var implementNextCommand = new Command3("implement-next").description("Find the next open GitHub issue matching the configured filter, claim it, and invoke the AI code assistant (Claude or Codex)").option("--json", "Output issue details as JSON").option("--no-claude", "Skip all AI invocation (Claude or Codex) after claiming the issue").option("--codex", "Use Codex CLI instead of Claude Code").option("--query-only", "Print issue content and exit without claiming or invoking any AI tools").option("--yolo", "Launch with --dangerously-skip-permissions (Claude) or --dangerously-bypass-approvals-and-sandbox (Codex)").option("--verbose", "Show step-by-step progress summary and final result").option("--opus", "Use claude-opus-4-6").option("--sonnet", "Use claude-sonnet-4-6").option("--haiku", "Use claude-haiku-4-5-20251001").action(async (options) => {
@@ -1255,8 +1189,8 @@ var testClaudeCmd = new Command4("claude").description("Test Claude Code invocat
1255
1189
  const model = resolveModelOption(options);
1256
1190
  await invokeClaudeCode(options.prompt, { yolo: options.yolo, verbose: options.verbose, model });
1257
1191
  });
1258
- var testCodexCmd = new Command4("codex").description("Test Codex CLI invocation with a user-supplied prompt").requiredOption("--prompt <string>", "Prompt to send to Codex CLI").option("--yolo", "Launch Codex with --dangerously-bypass-approvals-and-sandbox").option("--verbose", "Show step-by-step progress summary and final result").action(async (options) => {
1259
- await invokeCodexCode(options.prompt, { yolo: options.yolo, verbose: options.verbose });
1192
+ var testCodexCmd = new Command4("codex").description("Test Codex CLI invocation with a user-supplied prompt").requiredOption("--prompt <string>", "Prompt to send to Codex CLI").option("--yolo", "Launch Codex with --dangerously-bypass-approvals-and-sandbox").option("--verbose", "Not supported for Codex; prints a warning and is otherwise ignored").action((options) => {
1193
+ invokeCodexCode(options.prompt, { yolo: options.yolo, verbose: options.verbose });
1260
1194
  });
1261
1195
  var testCommand = new Command4("test").description("Test commands for verifying automata integrations").addCommand(testClaudeCmd).addCommand(testCodexCmd);
1262
1196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automata-cli",
3
- "version": "0.1.0-009-codex-flag-implement-next.73",
3
+ "version": "0.1.0-009-codex-flag-implement-next.75",
4
4
  "description": "Automata CLI tool",
5
5
  "type": "module",
6
6
  "bin": {