@oxecli/oxe 1.0.81 → 1.0.83

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/LICENSE CHANGED
@@ -12,10 +12,16 @@ furnished to do so, subject to the following conditions:
12
12
  The above copyright notice and this permission notice shall be included in all
13
13
  copies or substantial portions of the Software.
14
14
 
15
+ Redistribution or publication of the Software, in original or modified form,
16
+ must retain this copyright notice and must not be presented, published, or
17
+ distributed under a different author's name or claimed as the redistributor's
18
+ own original work. Attribution to the original author ("Oxe") must be
19
+ preserved in any public release, fork, or derivative distribution.
20
+
15
21
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
22
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
23
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
24
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
25
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
26
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
27
+ SOFTWARE.
package/dist/cli.js CHANGED
@@ -376,7 +376,7 @@ export class CLI {
376
376
  const budget = max_context_tokens - context_overhead_margin;
377
377
  const pct = Math.max(0, Math.min(100, Math.round(((budget - used) / budget) * 100)));
378
378
  const [input, spans] = await askBottomPrompt("You", "❯", this.promptHistory, {
379
- left: "\x1b[90mPress \x1b[1;36mesc\x1b[0m\x1b[90m to interrupt\x1b[0m",
379
+ left: "\x1b[90mPress \x1b[1;36mCtrl+C\x1b[0m\x1b[90m to interrupt\x1b[0m",
380
380
  right: `\x1b[1;36m${pct}%\x1b[0m \x1b[90muntil auto-compact\x1b[0m`,
381
381
  });
382
382
  if (!input.trim())
@@ -445,7 +445,7 @@ export class CLI {
445
445
  }
446
446
  if (err?.message === "interrupt") {
447
447
  const wasActive = queryStarted || engine.inQuery;
448
- if (wasActive && !engine.queryHasOutput) {
448
+ if (wasActive && !engine.queryHasOutput && !engine.queryCalledTool) {
449
449
  process.stdout.write(aiMarkdown("What else can I help you with?") + "\n");
450
450
  }
451
451
  engine.inQuery = false;
package/dist/engine.js CHANGED
@@ -49,6 +49,7 @@ export class InferenceEngine {
49
49
  activeAbort = null;
50
50
  interrupted = false;
51
51
  queryHasOutput = false;
52
+ queryCalledTool = false;
52
53
  temperature;
53
54
  storedResponseIds = [];
54
55
  constructor(config) {
@@ -425,6 +426,7 @@ export class InferenceEngine {
425
426
  this.workRows = 0;
426
427
  this.interrupted = false;
427
428
  this.queryHasOutput = false;
429
+ this.queryCalledTool = false;
428
430
  this.activeAbort = new AbortController();
429
431
  hideCursor();
430
432
  inputItems.push({
@@ -576,6 +578,7 @@ export class InferenceEngine {
576
578
  }
577
579
  for (const c of calls) {
578
580
  this.workActive = false;
581
+ this.queryCalledTool = true;
579
582
  const started = toolCallLabel(c.name, c.arguments);
580
583
  // Print the tool label the instant the command starts, then show a
581
584
  // "⎿ Working..." dots line that swaps to the real result in place.
@@ -595,12 +598,12 @@ export class InferenceEngine {
595
598
  text: action,
596
599
  status: failed ? "failed" : "ok",
597
600
  });
598
- // Swap the "⎿ Working..." line for the real result, then a blank line.
601
+ // Swap the "⎿ Working..." line for the real result. If the tool
602
+ // produced a diff it renders directly below the action line with no
603
+ // gap; otherwise a blank line separates the action from what follows.
599
604
  toolSpinner.replaceWith(action);
600
- process.stdout.write(`\n`);
601
- // Any diff the tool produced is flushed only now, after the spinner
602
- // has stopped, so the box renders cleanly below the action line.
603
- flushPendingDiffOutput();
605
+ if (!flushPendingDiffOutput())
606
+ process.stdout.write("\n");
604
607
  const truncatedResult = c.name === "read_file"
605
608
  ? truncateToolOutput(rawResult, max_read_file_stored_chars)
606
609
  : truncateToolOutput(rawResult);
package/dist/tools.js CHANGED
@@ -36,9 +36,10 @@ function truncateDiffLine(line) {
36
36
  const pendingDiffOutput = [];
37
37
  export function flushPendingDiffOutput() {
38
38
  if (!pendingDiffOutput.length)
39
- return;
39
+ return false;
40
40
  process.stdout.write(pendingDiffOutput.join("\n") + "\n\n");
41
41
  pendingDiffOutput.length = 0;
42
+ return true;
42
43
  }
43
44
  function displayDiff(pathName, oldContent, newContent) {
44
45
  if (oldContent.length + newContent.length > max_diff_source_chars) {
@@ -137,12 +138,15 @@ function displayDiff(pathName, oldContent, newContent) {
137
138
  const bg = isAdd ? "\x1b[48;2;2;40;0m" : "\x1b[48;2;61;1;0m";
138
139
  const fg = isAdd ? "\x1b[38;2;80;200;80m" : "\x1b[38;2;220;90;90m";
139
140
  const sign = isAdd ? "+" : "-";
140
- // Changed content renders normal white with syntax highlighting;
141
- // re-apply the white base after each token reset.
141
+ // The row background spans the full line width (number, sign, content,
142
+ // and trailing fill) so the row reads as one colored strip. Changed
143
+ // content renders normal white with syntax highlighting; re-apply the
144
+ // background + white base after each token reset so both hold across
145
+ // the whole body.
142
146
  const raw = highlightCodeLine(v.body);
143
- const body = truncateStyled(raw.replace(/\x1b\[0m/g, "\x1b[0m\x1b[97m"), bodyMax);
147
+ const body = truncateStyled(raw.replace(/\x1b\[0m/g, `\x1b[0m${bg}\x1b[97m`), bodyMax);
144
148
  const fill = Math.max(0, termW - numW - 4 - plainLen(body));
145
- pendingDiffOutput.push(`${bg}${fg}${numStr} ${sign} \x1b[0m\x1b[97m${body}${" ".repeat(fill)}\x1b[0m`);
149
+ pendingDiffOutput.push(`${bg}${fg}${numStr} ${sign} \x1b[0m${bg}\x1b[97m${body}${bg}\x1b[97m${" ".repeat(fill)}\x1b[0m`);
146
150
  }
147
151
  else {
148
152
  const raw = v.kind === "\\" ? v.body : highlightCodeLine(v.body);
@@ -403,7 +407,7 @@ export function toolWriteFile(pathName, content) {
403
407
  catch (err) {
404
408
  return `Error: ${err}`;
405
409
  }
406
- return `Wrote ${content.length.toLocaleString()} characters to ${pathName}`;
410
+ return `Wrote ${content.length.toLocaleString()} chars`;
407
411
  }
408
412
  // ---------------------------------------------------------------------------
409
413
  // edit_file
package/dist/ui.js CHANGED
@@ -571,7 +571,7 @@ export class Spinner {
571
571
  }, 300);
572
572
  }
573
573
  writeDots(initial) {
574
- const dots = `\x1b[1;36m${DOT_FRAMES[this.dotsFrame]}\x1b[0m`;
574
+ const dots = DOT_FRAMES[this.dotsFrame];
575
575
  if (initial) {
576
576
  process.stdout.write("\r" + this.dotsText + dots + "\r");
577
577
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.81",
3
+ "version": "1.0.83",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },