aether-code 0.19.0 → 0.21.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.
- package/bin/aether-code.js +8 -8
- package/package.json +1 -1
- package/src/diff.js +6 -5
- package/src/menu.js +83 -0
- package/src/render.js +4 -2
- package/src/repl.js +1 -1
- package/src/setup.js +2 -2
- package/src/tools.js +47 -1
package/bin/aether-code.js
CHANGED
|
@@ -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.
|
|
29
|
+
const VERSION = "0.21.0";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Try to start MCP servers from ~/.aether/mcp.json. Returns a started
|
|
@@ -214,12 +214,12 @@ async function main() {
|
|
|
214
214
|
|
|
215
215
|
console.log("\n" + divider());
|
|
216
216
|
if (result.ok) {
|
|
217
|
-
console.log(c.green(c.bold("
|
|
217
|
+
console.log(c.green(c.bold("● Done")) + c.gray(` ${result.turns} turn${result.turns === 1 ? "" : "s"} · ${result.totalCredits} credits · ${result.totalIn}→${result.totalOut} tokens`));
|
|
218
218
|
if (typeof result.balance === "number") {
|
|
219
219
|
console.log(c.gray(` balance: ${result.balance.toLocaleString()} credits`));
|
|
220
220
|
}
|
|
221
221
|
} else {
|
|
222
|
-
console.log(c.red(c.bold("
|
|
222
|
+
console.log(c.red(c.bold("× Stopped")) + c.gray(` ${result.totalCredits} credits used · ${result.totalIn}→${result.totalOut} tokens`));
|
|
223
223
|
if (result.error) console.log(errorLine(result.error.message));
|
|
224
224
|
}
|
|
225
225
|
console.log(divider());
|
|
@@ -242,14 +242,14 @@ async function handleConfig(rest) {
|
|
|
242
242
|
process.stderr.write(c.yellow("warning: keys normally start with ak_live_; saving anyway.\n"));
|
|
243
243
|
}
|
|
244
244
|
writeConfigFile({ apiKey: key });
|
|
245
|
-
console.log(`${c.green("
|
|
245
|
+
console.log(`${c.green("●")} API key saved to ${CONFIG_PATH}`);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
248
|
if (sub === "set-base") {
|
|
249
249
|
const url = rest[1];
|
|
250
250
|
if (!url) die("config set-base: missing URL argument.");
|
|
251
251
|
writeConfigFile({ baseUrl: url });
|
|
252
|
-
console.log(`${c.green("
|
|
252
|
+
console.log(`${c.green("●")} Base URL saved.`);
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
255
|
if (sub === "path") {
|
|
@@ -342,7 +342,7 @@ async function handleMcp(rest) {
|
|
|
342
342
|
const cmdArgs = post.slice(1);
|
|
343
343
|
try {
|
|
344
344
|
const entry = addServer({ name, command, args: cmdArgs, env });
|
|
345
|
-
console.log(`${c.green("
|
|
345
|
+
console.log(`${c.green("●")} Added MCP server "${c.cyan(name)}".`);
|
|
346
346
|
const argsStr = entry.args && entry.args.length > 0 ? " " + entry.args.join(" ") : "";
|
|
347
347
|
console.log(c.gray(` ${entry.command}${argsStr}`));
|
|
348
348
|
console.log(c.gray("Restart the agent (or run `aether`) to attach it."));
|
|
@@ -357,7 +357,7 @@ async function handleMcp(rest) {
|
|
|
357
357
|
if (!name) die("aether mcp remove: missing <name>");
|
|
358
358
|
try {
|
|
359
359
|
removeServer({ name });
|
|
360
|
-
console.log(`${c.green("
|
|
360
|
+
console.log(`${c.green("●")} Removed MCP server "${c.cyan(name)}".`);
|
|
361
361
|
} catch (e) {
|
|
362
362
|
die(e.message || String(e));
|
|
363
363
|
}
|
|
@@ -430,7 +430,7 @@ async function handleMcp(rest) {
|
|
|
430
430
|
args: resolved.args,
|
|
431
431
|
env: resolved.env,
|
|
432
432
|
});
|
|
433
|
-
console.log(`${c.green("
|
|
433
|
+
console.log(`${c.green("●")} Installed MCP server "${c.cyan(entry.id)}".`);
|
|
434
434
|
console.log(c.gray(` ${added.command}${added.args ? " " + added.args.join(" ") : ""}`));
|
|
435
435
|
console.log(c.gray("Restart aether (or run `aether`) to attach it."));
|
|
436
436
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aether-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.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/diff.js
CHANGED
|
@@ -30,11 +30,12 @@ export function unifiedDiff(oldText, newText, filename) {
|
|
|
30
30
|
for (const l of changedNew) lines.push(c.green(`+ ${l}`));
|
|
31
31
|
if (suffix > 0) lines.push(c.gray(` …${suffix} unchanged line${suffix === 1 ? "" : "s"} below…`));
|
|
32
32
|
|
|
33
|
-
// Cap output so
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
33
|
+
// Cap output so writes don't flood the terminal — a short preview is enough
|
|
34
|
+
// (skip-permissions auto-applies; the full file is on disk to inspect).
|
|
35
|
+
const MAX = 14;
|
|
36
|
+
if (lines.length > MAX) {
|
|
37
|
+
const shown = lines.slice(0, MAX - 1);
|
|
38
|
+
return [...shown, c.gray(` …${lines.length - shown.length} more lines (see the file)…`)].join("\n");
|
|
38
39
|
}
|
|
39
40
|
return lines.join("\n");
|
|
40
41
|
}
|
package/src/menu.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Interactive multiple-choice menu — arrow/number selectable, cmd.exe-safe.
|
|
2
|
+
//
|
|
3
|
+
// Deliberately NOT Ink (which ghosts in the legacy Windows console). Uses a
|
|
4
|
+
// simple manual redraw: print the list, and on each keypress move the cursor
|
|
5
|
+
// back up to the top of the menu (ESC[nA) and clear-to-end (ESC[J), then
|
|
6
|
+
// reprint. That's the same VT layer that already renders our ANSI colours, so
|
|
7
|
+
// it works in cmd.exe, Windows Terminal, and POSIX terminals alike.
|
|
8
|
+
//
|
|
9
|
+
// Returns the chosen option object ({label, description}), or null if cancelled.
|
|
10
|
+
|
|
11
|
+
import readline from "node:readline";
|
|
12
|
+
import { c } from "./render.js";
|
|
13
|
+
|
|
14
|
+
const ellip = (s, n) => (s && s.length > n ? s.slice(0, n - 1) + "…" : s || "");
|
|
15
|
+
|
|
16
|
+
export function promptChoice({ question, options }) {
|
|
17
|
+
const opts = (options || [])
|
|
18
|
+
.map((o) => (typeof o === "string" ? { label: o } : o))
|
|
19
|
+
.filter((o) => o && o.label);
|
|
20
|
+
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
// Non-interactive (piped / CI): pick the first option so automation never
|
|
23
|
+
// hangs waiting on a keypress that can't come. Print a note so it's visible.
|
|
24
|
+
if (!process.stdin.isTTY || opts.length === 0) {
|
|
25
|
+
const pick = opts[0] ?? null;
|
|
26
|
+
if (pick) process.stdout.write(c.cyan("● ") + c.bold(question) + c.gray(` → ${pick.label} (auto)\n`));
|
|
27
|
+
resolve(pick);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let sel = 0;
|
|
32
|
+
const total = opts.length + 3; // question line + options + blank + hint line
|
|
33
|
+
|
|
34
|
+
const draw = (first) => {
|
|
35
|
+
if (!first) process.stdout.write(`\x1b[${total}A`); // cursor up to menu top
|
|
36
|
+
process.stdout.write("\x1b[J"); // clear from cursor to end of screen
|
|
37
|
+
process.stdout.write(c.cyan("● ") + c.bold(question) + "\n");
|
|
38
|
+
opts.forEach((o, i) => {
|
|
39
|
+
const active = i === sel;
|
|
40
|
+
const pointer = active ? c.cyan("→") : " ";
|
|
41
|
+
const num = active ? c.cyan(c.bold(`${i + 1}.`)) : c.gray(`${i + 1}.`);
|
|
42
|
+
const label = active ? c.bold(o.label) : o.label;
|
|
43
|
+
const desc = o.description ? c.gray(" " + ellip(o.description, 60)) : "";
|
|
44
|
+
process.stdout.write(` ${pointer} ${num} ${label}${desc}\n`);
|
|
45
|
+
});
|
|
46
|
+
process.stdout.write("\n" + c.gray(" ↑/↓ move · 1-9 pick · Enter select · Esc cancel") + "\n");
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const cleanup = () => {
|
|
50
|
+
process.stdin.removeListener("keypress", onKey);
|
|
51
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(false);
|
|
52
|
+
process.stdin.pause();
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const finish = (result) => {
|
|
56
|
+
cleanup();
|
|
57
|
+
// Collapse the menu to a compact answer line so the transcript stays clean.
|
|
58
|
+
process.stdout.write(`\x1b[${total}A\x1b[J`);
|
|
59
|
+
process.stdout.write(c.cyan("● ") + c.bold(question) + "\n");
|
|
60
|
+
if (result) process.stdout.write(" " + c.cyan("→") + " " + c.green(result.label) + "\n\n");
|
|
61
|
+
else process.stdout.write(" " + c.gray("(cancelled — proceeding with best judgment)") + "\n\n");
|
|
62
|
+
resolve(result);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const onKey = (str, key) => {
|
|
66
|
+
if (!key) return;
|
|
67
|
+
if (key.name === "up" || key.name === "k") { sel = (sel - 1 + opts.length) % opts.length; draw(false); }
|
|
68
|
+
else if (key.name === "down" || key.name === "j" || key.name === "tab") { sel = (sel + 1) % opts.length; draw(false); }
|
|
69
|
+
else if (str && /^[1-9]$/.test(str)) {
|
|
70
|
+
const i = parseInt(str, 10) - 1;
|
|
71
|
+
if (i < opts.length) finish(opts[i]);
|
|
72
|
+
}
|
|
73
|
+
else if (key.name === "return") finish(opts[sel]);
|
|
74
|
+
else if (key.name === "escape" || (key.ctrl && key.name === "c")) finish(null);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
readline.emitKeypressEvents(process.stdin);
|
|
78
|
+
if (process.stdin.isTTY) process.stdin.setRawMode(true);
|
|
79
|
+
process.stdin.resume();
|
|
80
|
+
process.stdin.on("keypress", onKey);
|
|
81
|
+
draw(true);
|
|
82
|
+
});
|
|
83
|
+
}
|
package/src/render.js
CHANGED
|
@@ -54,6 +54,7 @@ export function toolLabel(name, args) {
|
|
|
54
54
|
case "web_search": return `${verb("search web")} ${arg(JSON.stringify(a.query ?? ""))}`;
|
|
55
55
|
case "web_fetch": return `${verb("fetch")} ${arg(a.url)}`;
|
|
56
56
|
case "todo_write": return ""; // its Plan box is the label
|
|
57
|
+
case "ask_user": return ""; // the interactive menu is its display
|
|
57
58
|
default: return `${verb(name)} ${arg(JSON.stringify(a))}`;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -69,7 +70,7 @@ export function setTerminalTitle(title) {
|
|
|
69
70
|
// plan) just get a check — the detail was already printed.
|
|
70
71
|
export function toolSummary(name, result) {
|
|
71
72
|
const ok = result.ok;
|
|
72
|
-
const mark = ok ? c.green("
|
|
73
|
+
const mark = ok ? c.green("●") : c.red("×");
|
|
73
74
|
const out = result.output ?? "";
|
|
74
75
|
const firstLine = out.split("\n").find((l) => l.trim()) ?? "";
|
|
75
76
|
|
|
@@ -79,6 +80,7 @@ export function toolSummary(name, result) {
|
|
|
79
80
|
return ` ${mark} ${c.gray(code === null ? (ok ? "done" : "failed") : `exit ${code}`)}`;
|
|
80
81
|
}
|
|
81
82
|
if (name === "todo_write") return ""; // the Plan box is its own feedback
|
|
83
|
+
if (name === "ask_user") return ""; // the menu already showed the answer
|
|
82
84
|
if (name === "write_file" || name === "edit_file") {
|
|
83
85
|
// Handler already printed the diff; echo its short status line.
|
|
84
86
|
return ` ${mark} ${c.gray(ellip(firstLine, 100))}`;
|
|
@@ -136,7 +138,7 @@ export function makeTokenStripper() {
|
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
export function toolResult(text, ok = true) {
|
|
139
|
-
const prefix = ok ? c.green("
|
|
141
|
+
const prefix = ok ? c.green(" ● ") : c.red(" × ");
|
|
140
142
|
// First line bold-ish, then dim continuation
|
|
141
143
|
const lines = text.split("\n");
|
|
142
144
|
const head = lines[0].slice(0, 200);
|
package/src/repl.js
CHANGED
|
@@ -17,7 +17,7 @@ import { c, errorLine } from "./render.js";
|
|
|
17
17
|
import { checkForUpdate } from "./update-check.js";
|
|
18
18
|
import { promptBoxed, EXIT_SIGNAL } from "./ink-input.js";
|
|
19
19
|
|
|
20
|
-
const VERSION = "0.
|
|
20
|
+
const VERSION = "0.21.0";
|
|
21
21
|
const MODEL_NAME = "Aether Core";
|
|
22
22
|
|
|
23
23
|
const SHORTCUTS = `
|
package/src/setup.js
CHANGED
|
@@ -112,7 +112,7 @@ export async function runSetup() {
|
|
|
112
112
|
process.stdout.write(c.gray("Verifying..."));
|
|
113
113
|
try {
|
|
114
114
|
const me = await fetchBalance();
|
|
115
|
-
console.log(c.green("
|
|
115
|
+
console.log(c.green(" ●"));
|
|
116
116
|
console.log("");
|
|
117
117
|
console.log(c.green(c.bold("Setup complete.")));
|
|
118
118
|
console.log(
|
|
@@ -123,7 +123,7 @@ export async function runSetup() {
|
|
|
123
123
|
saved = true;
|
|
124
124
|
break;
|
|
125
125
|
} catch (err) {
|
|
126
|
-
console.log(c.red("
|
|
126
|
+
console.log(c.red(" ×"));
|
|
127
127
|
if (err instanceof AetherError && err.status === 401) {
|
|
128
128
|
console.log(errorLine("Server rejected that key (401). Double-check you copied it correctly."));
|
|
129
129
|
} else {
|
package/src/tools.js
CHANGED
|
@@ -13,6 +13,7 @@ import path from "node:path";
|
|
|
13
13
|
import readline from "node:readline";
|
|
14
14
|
import { spawn } from "node:child_process";
|
|
15
15
|
import { c } from "./render.js";
|
|
16
|
+
import { promptChoice } from "./menu.js";
|
|
16
17
|
import { unifiedDiff, summarizeWrite } from "./diff.js";
|
|
17
18
|
import { getConfig } from "./config.js";
|
|
18
19
|
|
|
@@ -194,6 +195,33 @@ export const TOOL_DEFINITIONS = [
|
|
|
194
195
|
},
|
|
195
196
|
},
|
|
196
197
|
},
|
|
198
|
+
{
|
|
199
|
+
type: "function",
|
|
200
|
+
function: {
|
|
201
|
+
name: "ask_user",
|
|
202
|
+
description:
|
|
203
|
+
"Ask the user a single multiple-choice question and wait for their answer. Use this ONLY when the request is genuinely ambiguous AND the answer materially changes what you build — e.g. which platform/framework/language, the scope, or an irreversible decision. Ask BEFORE building when a wrong assumption would waste real work. Give 2–5 concrete options, each with a short description; put the best default first. Do NOT use it for trivial choices, things you can infer, or to confirm permission to act — just build when the task is clear.",
|
|
204
|
+
parameters: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
question: { type: "string", description: "The single, focused question to ask." },
|
|
208
|
+
options: {
|
|
209
|
+
type: "array",
|
|
210
|
+
description: "2–5 options. Each is {label, description}. Best default first.",
|
|
211
|
+
items: {
|
|
212
|
+
type: "object",
|
|
213
|
+
properties: {
|
|
214
|
+
label: { type: "string", description: "Short option label." },
|
|
215
|
+
description: { type: "string", description: "One-line explanation of this option." },
|
|
216
|
+
},
|
|
217
|
+
required: ["label"],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
required: ["question", "options"],
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
197
225
|
];
|
|
198
226
|
|
|
199
227
|
/* ─────────────────────── Argument validation ─────────────────────── */
|
|
@@ -362,6 +390,7 @@ export async function executeTool(call, opts) {
|
|
|
362
390
|
web_search: () => webSearch(args, opts),
|
|
363
391
|
web_fetch: () => webFetch(args, opts),
|
|
364
392
|
todo_write: () => todoWrite(args, opts),
|
|
393
|
+
ask_user: () => askUser(args, opts),
|
|
365
394
|
};
|
|
366
395
|
const fn = handlers[name];
|
|
367
396
|
if (!fn) {
|
|
@@ -374,6 +403,23 @@ export async function executeTool(call, opts) {
|
|
|
374
403
|
}
|
|
375
404
|
}
|
|
376
405
|
|
|
406
|
+
// Ask the user a multiple-choice question and block on their answer. Not a
|
|
407
|
+
// permission gate — it runs even in skip-permissions mode, because the model is
|
|
408
|
+
// explicitly requesting input. In a non-TTY the menu auto-picks the first
|
|
409
|
+
// option so scripted runs don't hang.
|
|
410
|
+
async function askUser(args, _opts) {
|
|
411
|
+
const options = Array.isArray(args.options) ? args.options : [];
|
|
412
|
+
if (options.length === 0) {
|
|
413
|
+
return { ok: false, output: "ask_user requires a non-empty options array" };
|
|
414
|
+
}
|
|
415
|
+
const choice = await promptChoice({ question: String(args.question || "Which option?"), options });
|
|
416
|
+
if (!choice) {
|
|
417
|
+
return { ok: true, output: "The user cancelled the question. Proceed with your best judgment." };
|
|
418
|
+
}
|
|
419
|
+
const extra = choice.description ? ` (${choice.description})` : "";
|
|
420
|
+
return { ok: true, output: `The user chose: ${choice.label}${extra}` };
|
|
421
|
+
}
|
|
422
|
+
|
|
377
423
|
function readFile(args, opts) {
|
|
378
424
|
if (typeof args.path !== "string") return { ok: false, output: "path is required" };
|
|
379
425
|
const abs = resolveSafe(args.path, opts);
|
|
@@ -787,7 +833,7 @@ function renderTodos(todos) {
|
|
|
787
833
|
for (const t of todos) {
|
|
788
834
|
const icon =
|
|
789
835
|
t.status === "completed"
|
|
790
|
-
? c.green("
|
|
836
|
+
? c.green("●")
|
|
791
837
|
: t.status === "in_progress"
|
|
792
838
|
? c.yellow("→")
|
|
793
839
|
: c.dim("·");
|