@autonoma-ai/planner 0.1.18 → 0.1.19
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/index.js +62 -44
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -14,11 +14,11 @@ var __export = (target, all) => {
|
|
|
14
14
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_jiti@2.6.1_postcss@8.5.15_tsx@4.21.0_typescript@
|
|
17
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_jiti@2.6.1_postcss@8.5.15_tsx@4.21.0_typescript@7.0.2_yaml@2.8.3/node_modules/tsup/assets/esm_shims.js
|
|
18
18
|
import path from "path";
|
|
19
19
|
import { fileURLToPath } from "url";
|
|
20
20
|
var init_esm_shims = __esm({
|
|
21
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_jiti@2.6.1_postcss@8.5.15_tsx@4.21.0_typescript@
|
|
21
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.3_jiti@2.6.1_postcss@8.5.15_tsx@4.21.0_typescript@7.0.2_yaml@2.8.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
22
22
|
"use strict";
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -218,6 +218,29 @@ var init_analytics = __esm({
|
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
+
// src/core/colors.ts
|
|
222
|
+
function fg(hex) {
|
|
223
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
224
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
225
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
226
|
+
return `${ESC}38;2;${r};${g};${b}m`;
|
|
227
|
+
}
|
|
228
|
+
var ESC, RESET, BOLD, DIM, PRIMARY, SUCCESS, ERROR, WARNING;
|
|
229
|
+
var init_colors = __esm({
|
|
230
|
+
"src/core/colors.ts"() {
|
|
231
|
+
"use strict";
|
|
232
|
+
init_esm_shims();
|
|
233
|
+
ESC = "\x1B[";
|
|
234
|
+
RESET = `${ESC}0m`;
|
|
235
|
+
BOLD = `${ESC}1m`;
|
|
236
|
+
DIM = `${ESC}2m`;
|
|
237
|
+
PRIMARY = fg("#CCFF00");
|
|
238
|
+
SUCCESS = fg("#3FB950");
|
|
239
|
+
ERROR = fg("#FF5C5C");
|
|
240
|
+
WARNING = fg("#FFB020");
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
221
244
|
// src/core/context.ts
|
|
222
245
|
import { readFile, writeFile } from "fs/promises";
|
|
223
246
|
import { join as join5 } from "path";
|
|
@@ -533,7 +556,7 @@ function createStepLogger(agentId, _maxSteps) {
|
|
|
533
556
|
function writeSpinner(message) {
|
|
534
557
|
const frame = SPINNER_FRAMES[frameIdx % SPINNER_FRAMES.length];
|
|
535
558
|
frameIdx++;
|
|
536
|
-
process.stderr.write(`${CLEAR_LINE} ${
|
|
559
|
+
process.stderr.write(`${CLEAR_LINE} ${DIM}${frame} ${message}${RESET}`);
|
|
537
560
|
lastSpinnerLine = true;
|
|
538
561
|
}
|
|
539
562
|
function writePermanent(message) {
|
|
@@ -564,55 +587,49 @@ function createStepLogger(agentId, _maxSteps) {
|
|
|
564
587
|
case "write_file": {
|
|
565
588
|
stats.filesWritten++;
|
|
566
589
|
const path3 = String(tc.input.path ?? tc.input.file_path ?? "");
|
|
567
|
-
writePermanent(` ${
|
|
590
|
+
writePermanent(` ${SUCCESS}\u270E write ${path3}${RESET}`);
|
|
568
591
|
break;
|
|
569
592
|
}
|
|
570
593
|
case "write_test":
|
|
571
594
|
stats.filesWritten++;
|
|
572
|
-
writePermanent(` ${
|
|
595
|
+
writePermanent(` ${SUCCESS}\u270E test ${summary2}${RESET}`);
|
|
573
596
|
break;
|
|
574
597
|
case "finish":
|
|
575
|
-
writePermanent(` ${
|
|
598
|
+
writePermanent(` ${SUCCESS}${BOLD}\u2713 done:${RESET} ${SUCCESS}${agentId}${RESET}`);
|
|
576
599
|
break;
|
|
577
600
|
case "subagent":
|
|
578
601
|
case "spawn_researcher":
|
|
579
|
-
writePermanent(` ${
|
|
602
|
+
writePermanent(` ${PRIMARY}\u2295 subagent: ${summary2}${RESET}`);
|
|
580
603
|
break;
|
|
581
604
|
default:
|
|
582
605
|
writeSpinner(`${tc.name}${summary2 ? " " + summary2 : ""}`);
|
|
583
606
|
}
|
|
584
607
|
}
|
|
585
608
|
for (const te of info.toolErrors) {
|
|
586
|
-
writePermanent(` ${
|
|
609
|
+
writePermanent(` ${ERROR}\u2717 ${te.name}: ${te.error}${RESET}`);
|
|
587
610
|
}
|
|
588
611
|
for (const f of info.writtenFiles) {
|
|
589
|
-
writePermanent(` ${
|
|
612
|
+
writePermanent(` ${SUCCESS}\u{1F4C4} wrote: ${f}${RESET}`);
|
|
590
613
|
}
|
|
591
614
|
}
|
|
592
615
|
function checkpoint(message) {
|
|
593
|
-
writePermanent(` ${
|
|
616
|
+
writePermanent(` ${WARNING}\u25B8 ${message}${RESET}`);
|
|
594
617
|
}
|
|
595
618
|
function summary() {
|
|
596
619
|
clearSpinner();
|
|
597
620
|
if (stats.filesRead > 0 || stats.filesWritten > 0) {
|
|
598
|
-
console.log(` ${
|
|
599
|
-
console.log(` ${
|
|
621
|
+
console.log(` ${DIM}\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500${RESET}`);
|
|
622
|
+
console.log(` ${DIM}files read: ${stats.filesRead} | files written: ${stats.filesWritten}${RESET}`);
|
|
600
623
|
}
|
|
601
624
|
}
|
|
602
625
|
return { log: log9, checkpoint, summary, stats };
|
|
603
626
|
}
|
|
604
|
-
var
|
|
627
|
+
var SPINNER_FRAMES, CLEAR_LINE;
|
|
605
628
|
var init_display = __esm({
|
|
606
629
|
"src/core/display.ts"() {
|
|
607
630
|
"use strict";
|
|
608
631
|
init_esm_shims();
|
|
609
|
-
|
|
610
|
-
RESET2 = "\x1B[0m";
|
|
611
|
-
CYAN = "\x1B[36m";
|
|
612
|
-
GREEN = "\x1B[32m";
|
|
613
|
-
RED = "\x1B[31m";
|
|
614
|
-
YELLOW = "\x1B[33m";
|
|
615
|
-
BOLD = "\x1B[1m";
|
|
632
|
+
init_colors();
|
|
616
633
|
SPINNER_FRAMES = ["\u25D2", "\u25D0", "\u25D3", "\u25D1"];
|
|
617
634
|
CLEAR_LINE = "\x1B[2K\r";
|
|
618
635
|
}
|
|
@@ -674,7 +691,7 @@ async function runAgent(config, prompt, extractResult) {
|
|
|
674
691
|
const msg = err instanceof Error ? err.message : String(err);
|
|
675
692
|
throw new AgentError(`agent "${config.id}" (model ${modelIdOf(model)}) failed: ${msg}`, config.id, err);
|
|
676
693
|
};
|
|
677
|
-
const
|
|
694
|
+
const YELLOW3 = "\x1B[33m";
|
|
678
695
|
const RESET8 = "\x1B[0m";
|
|
679
696
|
for (let retry = 0; retry < MAX_RETRIES; retry++) {
|
|
680
697
|
const heartbeat = () => {
|
|
@@ -699,7 +716,7 @@ async function runAgent(config, prompt, extractResult) {
|
|
|
699
716
|
while (extractResult() === void 0 && nudges < MAX_NUDGES) {
|
|
700
717
|
nudges++;
|
|
701
718
|
console.log(
|
|
702
|
-
` ${
|
|
719
|
+
` ${YELLOW3}[${config.id}] agent stopped without finishing - nudging (${nudges}/${MAX_NUDGES})...${RESET8}`
|
|
703
720
|
);
|
|
704
721
|
track("cli_agent_nudged", { agent: config.id, nudge: nudges });
|
|
705
722
|
messages.push(...generation.response.messages);
|
|
@@ -715,13 +732,13 @@ async function runAgent(config, prompt, extractResult) {
|
|
|
715
732
|
if (errorClass === "fatal") fail(err);
|
|
716
733
|
const msg = err instanceof Error ? err.message : String(err);
|
|
717
734
|
if (errorClass === "timeout") {
|
|
718
|
-
console.log(` ${
|
|
735
|
+
console.log(` ${YELLOW3}[${config.id}] step timed out after ${stepTimeout / 1e3}s${RESET8}`);
|
|
719
736
|
} else {
|
|
720
|
-
console.log(` ${
|
|
737
|
+
console.log(` ${YELLOW3}[${config.id}] provider error: ${msg}${RESET8}`);
|
|
721
738
|
}
|
|
722
739
|
track("cli_agent_retryable_error", { agent: config.id, error_class: errorClass, retry });
|
|
723
740
|
if (retry < MAX_RETRIES - 1) {
|
|
724
|
-
console.log(` ${
|
|
741
|
+
console.log(` ${YELLOW3}[${config.id}] retrying (${retry + 1}/${MAX_RETRIES})...${RESET8}`);
|
|
725
742
|
if (errorClass === "transient") {
|
|
726
743
|
await sleep(Math.min(2e3 * 2 ** retry, 1e4));
|
|
727
744
|
}
|
|
@@ -1518,7 +1535,7 @@ async function launchEditor(editor, files) {
|
|
|
1518
1535
|
const proc = spawn(editor.command, args, { stdio: "inherit" });
|
|
1519
1536
|
proc.on("error", (err) => {
|
|
1520
1537
|
p3.log.warn(`Couldn't open ${editor.label} (${err.message}). Review the files manually:`);
|
|
1521
|
-
for (const f of files) console.log(` ${
|
|
1538
|
+
for (const f of files) console.log(` ${CYAN}${f}${RESET3}`);
|
|
1522
1539
|
settle();
|
|
1523
1540
|
});
|
|
1524
1541
|
if (isTerminalEditor) {
|
|
@@ -1532,7 +1549,7 @@ async function openInEditor(files) {
|
|
|
1532
1549
|
const editors = await detectEditors();
|
|
1533
1550
|
if (editors.length === 0) {
|
|
1534
1551
|
p3.log.warn("No editors found. Review the files manually:");
|
|
1535
|
-
for (const f of files) console.log(` ${
|
|
1552
|
+
for (const f of files) console.log(` ${CYAN}${f}${RESET3}`);
|
|
1536
1553
|
return;
|
|
1537
1554
|
}
|
|
1538
1555
|
if (preferredEditor) {
|
|
@@ -1571,7 +1588,7 @@ async function openInEditor(files) {
|
|
|
1571
1588
|
}
|
|
1572
1589
|
async function showResults(result, options) {
|
|
1573
1590
|
console.log("");
|
|
1574
|
-
console.log(` ${
|
|
1591
|
+
console.log(` ${GREEN}[${options.agentId}] Step complete.${RESET3}`);
|
|
1575
1592
|
if (result.artifacts.length === 0) {
|
|
1576
1593
|
const knownFiles = ["AUTONOMA.md", "entity-audit.md", "scenarios.md"];
|
|
1577
1594
|
for (const f of knownFiles) {
|
|
@@ -1590,7 +1607,7 @@ async function showResults(result, options) {
|
|
|
1590
1607
|
for (const a of result.artifacts) {
|
|
1591
1608
|
const fullPath = resolvePath(a, options.outputDir);
|
|
1592
1609
|
resolvedPaths.push(fullPath);
|
|
1593
|
-
console.log(` ${
|
|
1610
|
+
console.log(` ${CYAN}${fullPath}${RESET3}`);
|
|
1594
1611
|
}
|
|
1595
1612
|
}
|
|
1596
1613
|
if (result.summary) {
|
|
@@ -1641,7 +1658,7 @@ async function reviewLoop(result, options) {
|
|
|
1641
1658
|
await showResults(result, options);
|
|
1642
1659
|
}
|
|
1643
1660
|
}
|
|
1644
|
-
var DIM3,
|
|
1661
|
+
var DIM3, CYAN, GREEN, RESET3, EDITORS, cachedEditors, preferredEditor, TERMINAL_EDITORS;
|
|
1645
1662
|
var init_review = __esm({
|
|
1646
1663
|
"src/core/review.ts"() {
|
|
1647
1664
|
"use strict";
|
|
@@ -1649,8 +1666,8 @@ var init_review = __esm({
|
|
|
1649
1666
|
init_debug();
|
|
1650
1667
|
init_notify();
|
|
1651
1668
|
DIM3 = "\x1B[2m";
|
|
1652
|
-
|
|
1653
|
-
|
|
1669
|
+
CYAN = "\x1B[36m";
|
|
1670
|
+
GREEN = "\x1B[32m";
|
|
1654
1671
|
RESET3 = "\x1B[0m";
|
|
1655
1672
|
EDITORS = [
|
|
1656
1673
|
{ command: "cursor", label: "Cursor", args: (f) => f },
|
|
@@ -1714,7 +1731,7 @@ function renderFlowsTable(flows) {
|
|
|
1714
1731
|
const sep = `${DIM4}${"\u2500".repeat(numW + nameW + critW + DESC_MAX + 6)}${RESET4}`;
|
|
1715
1732
|
const body = rows.map((r) => {
|
|
1716
1733
|
const line = `${pad(r.num, numW)} ${pad(r.name, nameW)} ${pad(r.crit, critW)} ${r.desc}`;
|
|
1717
|
-
return r.crit === "core" ? `${
|
|
1734
|
+
return r.crit === "core" ? `${YELLOW}${line}${RESET4}` : line;
|
|
1718
1735
|
}).join("\n");
|
|
1719
1736
|
const caption = `${DIM4}${flows.length} flows \xB7 ${coreCount} marked core${RESET4}`;
|
|
1720
1737
|
return `${header}
|
|
@@ -1722,14 +1739,14 @@ ${sep}
|
|
|
1722
1739
|
${body}
|
|
1723
1740
|
${caption}`;
|
|
1724
1741
|
}
|
|
1725
|
-
var RESET4, DIM4,
|
|
1742
|
+
var RESET4, DIM4, YELLOW, BOLD2;
|
|
1726
1743
|
var init_flows = __esm({
|
|
1727
1744
|
"src/agents/01-kb-generator/flows.ts"() {
|
|
1728
1745
|
"use strict";
|
|
1729
1746
|
init_esm_shims();
|
|
1730
1747
|
RESET4 = "\x1B[0m";
|
|
1731
1748
|
DIM4 = "\x1B[2m";
|
|
1732
|
-
|
|
1749
|
+
YELLOW = "\x1B[33m";
|
|
1733
1750
|
BOLD2 = "\x1B[1m";
|
|
1734
1751
|
}
|
|
1735
1752
|
});
|
|
@@ -2325,7 +2342,7 @@ function renderEntityAuditTable(models) {
|
|
|
2325
2342
|
const sep = `${DIM5}${"\u2500".repeat(numW + nameW + critW + SRC_MAX + 6)}${RESET5}`;
|
|
2326
2343
|
const body = rows.map((r) => {
|
|
2327
2344
|
const line = `${pad2(r.num, numW)} ${pad2(r.name, nameW)} ${pad2(r.creation, critW)} ${r.source}`;
|
|
2328
|
-
return r.creation === "standalone" ? `${
|
|
2345
|
+
return r.creation === "standalone" ? `${YELLOW2}${line}${RESET5}` : line;
|
|
2329
2346
|
}).join("\n");
|
|
2330
2347
|
const caption = `${DIM5}${models.length} models \xB7 ${standalone} standalone \xB7 ${models.length - standalone} side-effect-only${RESET5}`;
|
|
2331
2348
|
return `${header}
|
|
@@ -2333,7 +2350,7 @@ ${sep}
|
|
|
2333
2350
|
${body}
|
|
2334
2351
|
${caption}`;
|
|
2335
2352
|
}
|
|
2336
|
-
var RESET5, DIM5,
|
|
2353
|
+
var RESET5, DIM5, YELLOW2, BOLD3;
|
|
2337
2354
|
var init_audit_table = __esm({
|
|
2338
2355
|
"src/agents/02-entity-audit/audit-table.ts"() {
|
|
2339
2356
|
"use strict";
|
|
@@ -2341,7 +2358,7 @@ var init_audit_table = __esm({
|
|
|
2341
2358
|
init_entity_order();
|
|
2342
2359
|
RESET5 = "\x1B[0m";
|
|
2343
2360
|
DIM5 = "\x1B[2m";
|
|
2344
|
-
|
|
2361
|
+
YELLOW2 = "\x1B[33m";
|
|
2345
2362
|
BOLD3 = "\x1B[1m";
|
|
2346
2363
|
}
|
|
2347
2364
|
});
|
|
@@ -7015,6 +7032,7 @@ function loadConfig(args) {
|
|
|
7015
7032
|
|
|
7016
7033
|
// src/index.ts
|
|
7017
7034
|
init_analytics();
|
|
7035
|
+
init_colors();
|
|
7018
7036
|
init_context();
|
|
7019
7037
|
init_errors();
|
|
7020
7038
|
|
|
@@ -7023,10 +7041,10 @@ init_esm_shims();
|
|
|
7023
7041
|
init_debug();
|
|
7024
7042
|
import readline from "readline";
|
|
7025
7043
|
import { settings } from "@clack/core";
|
|
7026
|
-
var
|
|
7027
|
-
var
|
|
7044
|
+
var DIM2 = "\x1B[2m";
|
|
7045
|
+
var RESET2 = "\x1B[0m";
|
|
7028
7046
|
var SHOW_CURSOR = "\x1B[?25h";
|
|
7029
|
-
var EXIT_HINT = `${
|
|
7047
|
+
var EXIT_HINT = `${DIM2}(press Ctrl+C again to exit)${RESET2}`;
|
|
7030
7048
|
var ARM_WINDOW_MS = 3e3;
|
|
7031
7049
|
var FORCE_EXIT_MS = 2500;
|
|
7032
7050
|
var installed = false;
|
|
@@ -7517,14 +7535,14 @@ async function showStatus(outputDir) {
|
|
|
7517
7535
|
}
|
|
7518
7536
|
}
|
|
7519
7537
|
var BANNER = `
|
|
7520
|
-
|
|
7538
|
+
${PRIMARY}${BOLD} \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
|
|
7521
7539
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
|
|
7522
7540
|
\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551
|
|
7523
7541
|
\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551
|
|
7524
7542
|
\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551
|
|
7525
7543
|
\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
|
|
7526
|
-
|
|
7527
|
-
|
|
7544
|
+
${RESET}
|
|
7545
|
+
${DIM} E2E Test Planner - Generate exhaustive test suites from your codebase${RESET}
|
|
7528
7546
|
`;
|
|
7529
7547
|
function ensureAutonomaAuth() {
|
|
7530
7548
|
if (readEnv().AUTONOMA_API_TOKEN?.trim()) return true;
|