@oxecli/oxe 1.0.1 → 1.0.3
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/cli.js +3 -3
- package/dist/ui.js +31 -10
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ export class CLI {
|
|
|
17
17
|
promptHistory = [];
|
|
18
18
|
constructor() {
|
|
19
19
|
clearScreen();
|
|
20
|
-
renderPanel("AI CODING AGENT", "Engine: Ready");
|
|
20
|
+
renderPanel("AI CODING AGENT", "", "Engine: Ready");
|
|
21
21
|
process.stdout.write("\n");
|
|
22
22
|
this.config = null;
|
|
23
23
|
}
|
|
@@ -189,7 +189,7 @@ export class CLI {
|
|
|
189
189
|
this.sessionId = sid;
|
|
190
190
|
engine.reasoningEffort = String(rec["reasoning_effort"] ?? default_reasoning_effort);
|
|
191
191
|
clearScreen();
|
|
192
|
-
renderPanel(`AI CODING AGENT (resumed ${sid})`, "Engine: Ready");
|
|
192
|
+
renderPanel(`AI CODING AGENT (resumed ${sid})`, "", "Engine: Ready");
|
|
193
193
|
process.stdout.write(`\x1b[2mResumed:\x1b[0m ${truncateLabel(rec["label"])}\n`);
|
|
194
194
|
process.stdout.write(`\x1b[2m(${this.inputItems.length} items · ${estimateTokens(this.inputItems).toLocaleString()} tokens · Effort: \x1b[1;36m${engine.reasoningEffort}\x1b[0m\x1b[2m)\x1b[0m\n\n`);
|
|
195
195
|
renderPanel("Conversation history", "Restored");
|
|
@@ -226,7 +226,7 @@ export class CLI {
|
|
|
226
226
|
this.story = [];
|
|
227
227
|
this.sessionId = null;
|
|
228
228
|
clearScreen();
|
|
229
|
-
renderPanel("AI CODING AGENT", "Engine: Ready");
|
|
229
|
+
renderPanel("AI CODING AGENT", "", "Engine: Ready");
|
|
230
230
|
process.stdout.write("\n");
|
|
231
231
|
continue;
|
|
232
232
|
}
|
package/dist/ui.js
CHANGED
|
@@ -134,26 +134,47 @@ export function mutedMarkdown(text) {
|
|
|
134
134
|
// ---------------------------------------------------------------------------
|
|
135
135
|
// Panel
|
|
136
136
|
// ---------------------------------------------------------------------------
|
|
137
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Render a rich-style rounded panel: title in the top border, optional subtitle
|
|
139
|
+
* in the bottom border, content lines inside.
|
|
140
|
+
*/
|
|
141
|
+
export function renderPanel(content, title = "", subtitle = "", borderStyle = "90" // 90 = bright black (grey50)
|
|
142
|
+
) {
|
|
138
143
|
const w = terminalWidth();
|
|
139
144
|
const innerW = Math.max(w - 4, 10);
|
|
140
145
|
const styled = markupToAnsi(content);
|
|
146
|
+
const styledLines = styled.split("\n");
|
|
141
147
|
const plainLines = styled.replace(/\x1b\[[0-9;]*m/g, "").split("\n");
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
// Effective width used by the border (accounting for a title/subtitle side)
|
|
149
|
+
const borderW = innerW;
|
|
150
|
+
const topSegs = [];
|
|
151
|
+
topSegs.push("╭");
|
|
144
152
|
if (title) {
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
console.log(`\x1b[90m|${titleStr}${" ".repeat(pad)}|`);
|
|
153
|
+
const t = ` ${title} `;
|
|
154
|
+
topSegs.push(`─${t}${"─".repeat(Math.max(borderW - t.length - 2, 0))}`);
|
|
148
155
|
}
|
|
149
|
-
|
|
156
|
+
else {
|
|
157
|
+
topSegs.push("─".repeat(borderW));
|
|
158
|
+
}
|
|
159
|
+
topSegs.push("╮");
|
|
160
|
+
process.stdout.write(`\x1b[${borderStyle}m${topSegs.join("")}\x1b[0m\n`);
|
|
150
161
|
for (let i = 0; i < styledLines.length; i++) {
|
|
151
162
|
const line = styledLines[i];
|
|
152
163
|
const plain = plainLines[i] ?? "";
|
|
153
|
-
const pad = Math.max(
|
|
154
|
-
|
|
164
|
+
const pad = Math.max(borderW - plain.length - 1, 0);
|
|
165
|
+
process.stdout.write(`\x1b[${borderStyle}m│\x1b[0m ${line}${" ".repeat(pad)} \x1b[${borderStyle}m│\x1b[0m\n`);
|
|
166
|
+
}
|
|
167
|
+
const bottomSegs = [];
|
|
168
|
+
bottomSegs.push("╰");
|
|
169
|
+
if (subtitle) {
|
|
170
|
+
const s = ` ${subtitle} `;
|
|
171
|
+
bottomSegs.push(`─${s}${"─".repeat(Math.max(borderW - s.length - 2, 0))}`);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
bottomSegs.push("─".repeat(borderW));
|
|
155
175
|
}
|
|
156
|
-
|
|
176
|
+
bottomSegs.push("╯");
|
|
177
|
+
process.stdout.write(`\x1b[${borderStyle}m${bottomSegs.join("")}\x1b[0m\n`);
|
|
157
178
|
}
|
|
158
179
|
// ---------------------------------------------------------------------------
|
|
159
180
|
// Durations
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxecli/oxe",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"diff": "^5.2.0",
|
|
41
|
-
"openai": "^
|
|
41
|
+
"openai": "^5.0.0",
|
|
42
42
|
"yaml": "^2.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|