aether-code 0.36.3 → 0.36.5

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.
@@ -28,7 +28,7 @@ import {
28
28
  import readline from "node:readline";
29
29
  import { c, errorLine, divider, setTerminalTitle } from "../src/render.js";
30
30
 
31
- const VERSION = "0.36.3";
31
+ const VERSION = "0.36.5";
32
32
 
33
33
  /**
34
34
  * Try to start MCP servers from ~/.aether/mcp.json. Returns a started
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aether-code",
3
- "version": "0.36.3",
3
+ "version": "0.36.5",
4
4
  "description": "Uncensored AI coding agent for your terminal — Claude Code alternative with MCP support. Reads code, writes files, runs commands. Drives IDA Pro, Roblox Studio, Wireshark, Blender, and any MCP server. No refusal layer.",
5
5
  "homepage": "https://trynoguard.com",
6
6
  "repository": {
package/src/box-input.js CHANGED
@@ -77,6 +77,7 @@ export function promptBox({ history = [], placeholder = "", mode = "review", sup
77
77
  let drawn = 0;
78
78
  let lastSigint = 0;
79
79
  const clipImages = [];
80
+ let resizeHandler = null;
80
81
 
81
82
  const termW = () => Math.max(30, (process.stdout.columns || 80) - 2);
82
83
 
@@ -132,6 +133,7 @@ export function promptBox({ history = [], placeholder = "", mode = "review", sup
132
133
  };
133
134
 
134
135
  const finish = (result) => {
136
+ if (resizeHandler) process.stdout.removeListener("resize", resizeHandler);
135
137
  process.stdin.removeListener("keypress", onKey);
136
138
  if (process.stdin.isTTY) process.stdin.setRawMode(false);
137
139
  process.stdin.pause();
@@ -215,5 +217,13 @@ export function promptBox({ history = [], placeholder = "", mode = "review", sup
215
217
  process.stdin.resume();
216
218
  process.stdin.on("keypress", onKey);
217
219
  draw(true);
220
+ resizeHandler = () => {
221
+ process.stdout.write(`\x1b[${drawn}A\x1b[J`);
222
+ let vr = process.stdout.rows || 24;
223
+ if (process.platform === "win32" && !process.env.WT_SESSION && vr > 60) vr = 24;
224
+ process.stdout.write(`\x1b[${Math.max(1, vr - 3)};1H`);
225
+ draw(true);
226
+ };
227
+ process.stdout.on("resize", resizeHandler);
218
228
  });
219
229
  }
package/src/repl.js CHANGED
@@ -9,7 +9,7 @@ import { c, errorLine, turnStats } from "./render.js";
9
9
  import { autoUpdate } from "./update-check.js";
10
10
  import { promptBox, EXIT_SIGNAL } from "./box-input.js";
11
11
 
12
- const VERSION = "0.36.3";
12
+ const VERSION = "0.36.5";
13
13
  const MODEL_NAME = "Aether Core";
14
14
 
15
15
  const MODEL_ALIASES = {
@@ -50,6 +50,22 @@ function pushPromptToBottom(contentLines) {
50
50
  if (gap > 0) process.stdout.write("\n".repeat(gap));
51
51
  }
52
52
 
53
+ function drawStaticPrompt(startRow, state) {
54
+ const termCols = process.stdout.columns || 80;
55
+ const ruleStr = `\x1b[36m ${"─".repeat(Math.max(0, termCols - 2))}\x1b[0m`;
56
+ const modeStr = state.autoYes ? "auto-yes" : "review";
57
+ const blkFn = (code) => `\x1b[${code}m \x1b[0m`;
58
+ const statusBar = blkFn(46) + blkFn(44) +
59
+ `\x1b[2m ${modeStr} mode \xB7 ? for shortcuts \xB7 @file for images\x1b[0m`;
60
+ process.stdout.write(
61
+ `\x1b[${startRow};1H` +
62
+ ruleStr + "\n" +
63
+ `\x1b[2m> \x1b[0m` + "\n" +
64
+ ruleStr + "\n" +
65
+ statusBar,
66
+ );
67
+ }
68
+
53
69
  export async function runRepl({ cwd: initialCwd, autoYes: initialAutoYes, unsafePaths: initialUnsafePaths, maxTurns: initialMaxTurns, model: initialModel = null, mcpManager = null }) {
54
70
  const initialAlias = Object.values(MODEL_ALIASES).find((a) => a.id === initialModel);
55
71
  const state = {
@@ -128,35 +144,59 @@ export async function runRepl({ cwd: initialCwd, autoYes: initialAutoYes, unsafe
128
144
  const echoLen = echoDisplay.length + 2;
129
145
  const echoPad = Math.max(0, echoCols - echoLen);
130
146
  const echoBar = `\x1b[48;5;236m ${echoDisplay}${" ".repeat(echoPad)}\x1b[0m`;
131
- process.stdout.write("\x1b[2J\x1b[H" + bLines.join("\n") + "\n" + echoBar + "\n");
132
-
133
- const contentAbove = bLines.length + 1;
134
-
135
- // Count newlines in all output during agent run + stats so we know
136
- // how far down the cursor moved and can pad to the bottom.
137
- let outputNewlines = 0;
138
- const _origWrite = process.stdout.write;
139
- const _boundWrite = _origWrite.bind(process.stdout);
140
- process.stdout.write = function countingWrite(chunk, ...args) {
141
- if (typeof chunk === "string") {
142
- for (let i = 0; i < chunk.length; i++) { if (chunk[i] === "\n") outputNewlines++; }
143
- } else if (Buffer.isBuffer(chunk)) {
144
- for (let i = 0; i < chunk.length; i++) { if (chunk[i] === 0x0A) outputNewlines++; }
145
- }
146
- return _boundWrite(chunk, ...args);
147
+
148
+ const vr = getVisibleRows();
149
+ let scrollEnd = Math.max(4, vr - 4);
150
+ let promptRow = scrollEnd + 1;
151
+
152
+ // Clear screen, print banner + echo, draw static prompt at bottom,
153
+ // then set scroll region so agent output stays above the prompt.
154
+ process.stdout.write(
155
+ "\x1b[r" +
156
+ "\x1b[2J\x1b[H" +
157
+ bLines.join("\n") + "\n" + echoBar + "\n",
158
+ );
159
+ drawStaticPrompt(promptRow, state);
160
+
161
+ const agentRow = Math.min(bLines.length + 2, scrollEnd);
162
+ process.stdout.write(`\x1b[1;${scrollEnd}r\x1b[${agentRow};1H`);
163
+
164
+ const onResize = () => {
165
+ const newVr = getVisibleRows();
166
+ const newScrollEnd = Math.max(4, newVr - 4);
167
+ const newPromptRow = newScrollEnd + 1;
168
+ process.stdout.write(
169
+ "\x1b7" +
170
+ "\x1b[r" +
171
+ `\x1b[${promptRow};1H\x1b[J`,
172
+ );
173
+ drawStaticPrompt(newPromptRow, state);
174
+ process.stdout.write(
175
+ `\x1b[1;${newScrollEnd}r` +
176
+ "\x1b8",
177
+ );
178
+ scrollEnd = newScrollEnd;
179
+ promptRow = newPromptRow;
147
180
  };
181
+ process.stdout.on("resize", onResize);
148
182
 
149
183
  const t0 = Date.now();
150
- const result = await runAgent({
151
- initialPrompt: line,
152
- priorMessages: state.messages.length > 0 ? state.messages : undefined,
153
- cwd: state.cwd,
154
- autoYes: state.autoYes,
155
- unsafePaths: state.unsafePaths,
156
- model: state.model,
157
- maxTurns: state.maxTurns,
158
- mcpManager,
159
- });
184
+ let result;
185
+ try {
186
+ result = await runAgent({
187
+ initialPrompt: line,
188
+ priorMessages: state.messages.length > 0 ? state.messages : undefined,
189
+ cwd: state.cwd,
190
+ autoYes: state.autoYes,
191
+ unsafePaths: state.unsafePaths,
192
+ model: state.model,
193
+ maxTurns: state.maxTurns,
194
+ mcpManager,
195
+ });
196
+ } finally {
197
+ process.stdout.removeListener("resize", onResize);
198
+ process.stdout.write("\x1b[r");
199
+ }
160
200
  const elapsed = Date.now() - t0;
161
201
 
162
202
  state.sessionCredits += result.totalCredits ?? 0;
@@ -179,9 +219,8 @@ export async function runRepl({ cwd: initialCwd, autoYes: initialAutoYes, unsafe
179
219
  if (stats) console.log(stats);
180
220
  console.log("");
181
221
 
182
- // Restore stdout and push prompt to bottom
183
- process.stdout.write = _origWrite;
184
- pushPromptToBottom(contentAbove + outputNewlines);
222
+ // Position cursor at prompt area for the interactive prompt
223
+ process.stdout.write(`\x1b[${promptRow};1H\x1b[J`);
185
224
  }
186
225
  }
187
226