juno-code 1.0.17 → 1.0.19
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.
- package/dist/bin/cli.js +58 -42
- package/dist/bin/cli.js.map +1 -1
- package/dist/bin/cli.mjs +59 -43
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/templates/services/codex.py +11 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -5,12 +5,10 @@ This script provides a wrapper around OpenAI Codex CLI with configurable options
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import argparse
|
|
8
|
-
import json
|
|
9
8
|
import os
|
|
10
9
|
import subprocess
|
|
11
10
|
import sys
|
|
12
|
-
from
|
|
13
|
-
from typing import Optional, List, Dict, Any
|
|
11
|
+
from typing import List
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
class CodexService:
|
|
@@ -26,6 +24,7 @@ class CodexService:
|
|
|
26
24
|
self.project_path = os.getcwd()
|
|
27
25
|
self.prompt = ""
|
|
28
26
|
self.additional_args: List[str] = []
|
|
27
|
+
self.verbose = False
|
|
29
28
|
|
|
30
29
|
def check_codex_installed(self) -> bool:
|
|
31
30
|
"""Check if codex CLI is installed and available"""
|
|
@@ -94,12 +93,6 @@ Examples:
|
|
|
94
93
|
help="Additional codex config arguments (can be used multiple times)"
|
|
95
94
|
)
|
|
96
95
|
|
|
97
|
-
parser.add_argument(
|
|
98
|
-
"--json",
|
|
99
|
-
action="store_true",
|
|
100
|
-
help="Output in JSON format"
|
|
101
|
-
)
|
|
102
|
-
|
|
103
96
|
parser.add_argument(
|
|
104
97
|
"--verbose",
|
|
105
98
|
action="store_true",
|
|
@@ -163,9 +156,8 @@ Examples:
|
|
|
163
156
|
# Add exec command with prompt
|
|
164
157
|
cmd.extend(["exec", full_prompt])
|
|
165
158
|
|
|
166
|
-
#
|
|
167
|
-
|
|
168
|
-
cmd.append("--json")
|
|
159
|
+
# Note: We do NOT add --json flag. Codex will output text format by default.
|
|
160
|
+
# This allows streaming text updates to work correctly with shell backend.
|
|
169
161
|
|
|
170
162
|
return cmd
|
|
171
163
|
|
|
@@ -177,19 +169,22 @@ Examples:
|
|
|
177
169
|
|
|
178
170
|
try:
|
|
179
171
|
# Run the command and stream output
|
|
172
|
+
# Use line buffering (bufsize=1) to ensure each JSON line is output immediately
|
|
180
173
|
process = subprocess.Popen(
|
|
181
174
|
cmd,
|
|
182
175
|
stdout=subprocess.PIPE,
|
|
183
176
|
stderr=subprocess.PIPE,
|
|
184
177
|
text=True,
|
|
185
|
-
bufsize=1,
|
|
178
|
+
bufsize=1, # Line buffering for immediate output
|
|
186
179
|
universal_newlines=True
|
|
187
180
|
)
|
|
188
181
|
|
|
189
|
-
# Stream stdout
|
|
182
|
+
# Stream stdout line by line
|
|
183
|
+
# Codex outputs text format by default (not JSON), so we just pass it through
|
|
190
184
|
if process.stdout:
|
|
191
185
|
for line in process.stdout:
|
|
192
|
-
|
|
186
|
+
# Output text as-is with immediate flush for real-time streaming
|
|
187
|
+
print(line, end='', flush=True)
|
|
193
188
|
|
|
194
189
|
# Wait for process to complete
|
|
195
190
|
process.wait()
|
|
@@ -259,6 +254,7 @@ Examples:
|
|
|
259
254
|
|
|
260
255
|
# Build and execute command
|
|
261
256
|
cmd = self.build_codex_command(args)
|
|
257
|
+
self.verbose = args.verbose
|
|
262
258
|
return self.run_codex(cmd, verbose=args.verbose)
|
|
263
259
|
|
|
264
260
|
|