aether-code 0.23.0 → 0.24.0

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.
@@ -26,7 +26,7 @@ import {
26
26
  import readline from "node:readline";
27
27
  import { c, errorLine, divider, setTerminalTitle } from "../src/render.js";
28
28
 
29
- const VERSION = "0.23.0";
29
+ const VERSION = "0.24.0";
30
30
 
31
31
  /**
32
32
  * 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.23.0",
3
+ "version": "0.24.0",
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/agent.js CHANGED
@@ -8,7 +8,7 @@ import { agentTurnStream, AetherError } from "./api.js";
8
8
  import { TOOL_DEFINITIONS, executeTool } from "./tools.js";
9
9
  import { unnamespaceToolName } from "./mcp.js";
10
10
  import { loadAllSkills, selectSkills, renderSkillsBlock } from "./skills.js";
11
- import { c, divider, turn, toolLabel, toolSummary, makeTokenStripper, errorLine } from "./render.js";
11
+ import { c, divider, turn, toolLabel, toolSummary, makeTokenStripper, errorLine, startSpinner } from "./render.js";
12
12
 
13
13
  const DEFAULT_MAX_TURNS = 25;
14
14
 
@@ -77,6 +77,9 @@ export async function runAgent({
77
77
  let totalIn = 0;
78
78
  let totalOut = 0;
79
79
  let lastBalance = null;
80
+ // Loop guard: count identical (name+args) tool calls across the whole run so a
81
+ // confused model can't burn turns re-running the same call (e.g. glob *.md x9).
82
+ const callCounts = new Map();
80
83
 
81
84
  for (let i = 0; i < maxTurns; i++) {
82
85
  // No turn header and no leading blank here — each step (assistant text and
@@ -98,6 +101,11 @@ export async function runAgent({
98
101
  const turnMessages = buildTurnMessages(messages, allSkills, referencedPaths);
99
102
 
100
103
  let res;
104
+ // "Thinking" spinner: shown from request-send until the first token or tool
105
+ // call arrives, so the wait doesn't look dead. Stopped exactly once.
106
+ const spinner = startSpinner("thinking");
107
+ let spinStopped = false;
108
+ const stopSpin = () => { if (!spinStopped) { spinStopped = true; spinner.stop(); } };
101
109
  try {
102
110
  res = await agentTurnStream({
103
111
  messages: turnMessages,
@@ -107,6 +115,7 @@ export async function runAgent({
107
115
  // be split across stream chunks) before display.
108
116
  const clean = stripper.push(text);
109
117
  if (!clean) return;
118
+ stopSpin();
110
119
  if (!lastWasText) {
111
120
  process.stdout.write("\n" + c.cyan("● "));
112
121
  lastWasText = true;
@@ -118,6 +127,7 @@ export async function runAgent({
118
127
  // call — the clean label is printed at execution time, so no noisy
119
128
  // "preparing args" placeholder here.
120
129
  if (delta.name && !announced.has(delta.index)) {
130
+ stopSpin();
121
131
  announced.add(delta.index);
122
132
  if (lastWasText) process.stdout.write("\n");
123
133
  lastWasText = false;
@@ -125,11 +135,13 @@ export async function runAgent({
125
135
  },
126
136
  });
127
137
  } catch (err) {
138
+ stopSpin();
128
139
  if (err instanceof AetherError) {
129
140
  return { ok: false, error: err, totalCredits, totalIn, totalOut, balance: lastBalance, messages };
130
141
  }
131
142
  throw err;
132
143
  }
144
+ stopSpin(); // ensure it's cleared even if the turn produced no output
133
145
 
134
146
  // Flush any held-back partial token, then close the line.
135
147
  const tail = stripper.flush();
@@ -167,14 +179,37 @@ export async function runAgent({
167
179
  const label = toolLabel(call.function.name, args);
168
180
  if (label) console.log("\n" + c.cyan("●") + " " + label);
169
181
 
182
+ // Loop guard — short-circuit a tool call we've already run 3+ times with
183
+ // the same args, and tell the model to change approach instead of looping.
184
+ const sig = `${call.function.name}:${call.function.arguments || ""}`;
185
+ const seen = (callCounts.get(sig) || 0) + 1;
186
+ callCounts.set(sig, seen);
187
+ if (seen > 3) {
188
+ console.log(" " + c.red("└─") + " " + c.gray("skipped (repeated call)"));
189
+ messages.push({
190
+ role: "tool",
191
+ tool_call_id: call.id,
192
+ content:
193
+ "STOP: you have already run this exact tool call 3 times and the result will not change. Do NOT call it again. " +
194
+ "If you were looking for a file that doesn't exist, create it with write_file. Otherwise change approach or finish and summarize.",
195
+ });
196
+ continue;
197
+ }
198
+
170
199
  // Route to MCP if the tool name is namespaced (mcp__server__tool);
171
200
  // otherwise execute the built-in tool. unnamespaceToolName returns
172
201
  // null for non-MCP names, which is our cheap dispatch test.
202
+ const slow = call.function.name === "web_search" || call.function.name === "web_fetch";
203
+ const tspin = slow ? startSpinner(call.function.name === "web_search" ? "searching the web" : "fetching page") : null;
173
204
  let result;
174
- if (mcpManager && unnamespaceToolName(call.function.name)) {
175
- result = await mcpManager.callTool(call.function.name, args);
176
- } else {
177
- result = await executeTool(call, { cwd, autoYes, unsafePaths });
205
+ try {
206
+ if (mcpManager && unnamespaceToolName(call.function.name)) {
207
+ result = await mcpManager.callTool(call.function.name, args);
208
+ } else {
209
+ result = await executeTool(call, { cwd, autoYes, unsafePaths });
210
+ }
211
+ } finally {
212
+ if (tspin) tspin.stop();
178
213
  }
179
214
 
180
215
  // Track paths the model has touched. Skills with path-pattern triggers
package/src/render.js CHANGED
@@ -80,6 +80,33 @@ export function setTerminalTitle(title) {
80
80
  if (process.stdout.isTTY) process.stdout.write(`\x1b]0;${title}\x07`);
81
81
  }
82
82
 
83
+ // Live "working…" spinner. Rewrites a single line in place (\r) with a rotating
84
+ // half-circle (Geometric Shapes — same block as ●, so cmd.exe-safe) + elapsed
85
+ // seconds, so the user sees the agent is alive while the model thinks or a slow
86
+ // tool runs. stop() clears the line and restores the cursor. No-op in non-TTY.
87
+ export function startSpinner(label) {
88
+ if (!process.stdout.isTTY) return { stop: () => {} };
89
+ const frames = ["◐", "◓", "◑", "◒"];
90
+ const t0 = Date.now();
91
+ let i = 0;
92
+ process.stdout.write("\x1b[?25l"); // hide cursor
93
+ const render = () => {
94
+ const s = Math.floor((Date.now() - t0) / 1000);
95
+ const tail = s > 0 ? c.gray(` ${s}s`) : "";
96
+ process.stdout.write(`\r\x1b[K${c.cyan(frames[i % frames.length])} ${c.gray(label + "…")}${tail}`);
97
+ i++;
98
+ };
99
+ render();
100
+ const timer = setInterval(render, 120);
101
+ if (typeof timer.unref === "function") timer.unref(); // don't keep the process alive
102
+ return {
103
+ stop: () => {
104
+ clearInterval(timer);
105
+ process.stdout.write("\r\x1b[K\x1b[?25h"); // clear line + show cursor
106
+ },
107
+ };
108
+ }
109
+
83
110
  // Terse one-line result summary instead of dumping raw JSON / file contents.
84
111
  // Tools whose handlers already render rich output (diffs, the shell stream, the
85
112
  // plan) just get a check — the detail was already printed.
package/src/repl.js CHANGED
@@ -16,7 +16,7 @@ import { c, errorLine, box } from "./render.js";
16
16
  import { checkForUpdate } from "./update-check.js";
17
17
  import { promptBox, EXIT_SIGNAL } from "./box-input.js";
18
18
 
19
- const VERSION = "0.23.0";
19
+ const VERSION = "0.24.0";
20
20
  const MODEL_NAME = "Aether Core";
21
21
 
22
22
  const SHORTCUTS = `
package/src/tools.js CHANGED
@@ -574,7 +574,12 @@ async function editFile(args, opts) {
574
574
  return { ok: false, output: "path, find, replace are required" };
575
575
  }
576
576
  const abs = resolveSafe(args.path, opts);
577
- if (!fs.existsSync(abs)) return { ok: false, output: `File not found: ${args.path}` };
577
+ if (!fs.existsSync(abs)) {
578
+ return {
579
+ ok: false,
580
+ output: `File not found: ${args.path}. It doesn't exist yet — use write_file to CREATE it (edit_file only modifies existing files). Do not retry edit_file on this path.`,
581
+ };
582
+ }
578
583
  const oldContent = fs.readFileSync(abs, "utf8");
579
584
  const occurrences = oldContent.split(args.find).length - 1;
580
585
  if (occurrences === 0) {