archondev 2.19.10 → 2.19.12
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 +224 -87
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3577,7 +3577,7 @@ async function runAIInterview(cwd, initialMessage, agent) {
|
|
|
3577
3577
|
console.log(chalk6.dim(`
|
|
3578
3578
|
(Interview used ${usage.totalTokens} tokens, $${usage.baseCost.toFixed(4)})`));
|
|
3579
3579
|
}
|
|
3580
|
-
await finishInterview(cwd, state);
|
|
3580
|
+
await finishInterview(cwd, state, initialMessage);
|
|
3581
3581
|
} catch (error) {
|
|
3582
3582
|
console.log(chalk6.yellow("\n[!] AI interview unavailable, using simple setup.\n"));
|
|
3583
3583
|
await runSimpleInterview(cwd, initialMessage);
|
|
@@ -3605,46 +3605,17 @@ async function runSimpleInterview(cwd, initialMessage) {
|
|
|
3605
3605
|
}
|
|
3606
3606
|
}
|
|
3607
3607
|
if (!state.audience) {
|
|
3608
|
-
|
|
3609
|
-
const audience = await prompt("Who is this for? (me / team / public)");
|
|
3610
|
-
if (!wantsToSkip(audience)) {
|
|
3611
|
-
const lower = audience.toLowerCase().trim();
|
|
3612
|
-
if (lower.includes("me") || lower.includes("personal") || lower.includes("myself")) {
|
|
3613
|
-
state.audience = "personal";
|
|
3614
|
-
state.posture = "prototype";
|
|
3615
|
-
} else if (lower.includes("team") || lower.includes("internal")) {
|
|
3616
|
-
state.audience = "team";
|
|
3617
|
-
state.posture = "production";
|
|
3618
|
-
} else if (lower.includes("public") || lower.includes("user") || lower.includes("customer")) {
|
|
3619
|
-
state.audience = "endusers";
|
|
3620
|
-
state.posture = "production";
|
|
3621
|
-
}
|
|
3622
|
-
}
|
|
3608
|
+
state.audience = inferAudienceFromMessage(initialMessage);
|
|
3623
3609
|
}
|
|
3624
3610
|
if (!state.language) {
|
|
3625
|
-
|
|
3626
|
-
const lang = await prompt("What language? (typescript / python / go / rust / other)");
|
|
3627
|
-
if (!wantsToSkip(lang)) {
|
|
3628
|
-
const lower = lang.toLowerCase().trim();
|
|
3629
|
-
if (lower.includes("typescript") || lower.includes("ts") || lower.includes("javascript") || lower.includes("js")) {
|
|
3630
|
-
state.language = "typescript";
|
|
3631
|
-
} else if (lower.includes("python") || lower.includes("py")) {
|
|
3632
|
-
state.language = "python";
|
|
3633
|
-
} else if (lower.includes("go") || lower.includes("golang")) {
|
|
3634
|
-
state.language = "go";
|
|
3635
|
-
} else if (lower.includes("rust") || lower.includes("rs")) {
|
|
3636
|
-
state.language = "rust";
|
|
3637
|
-
} else if (lang.trim()) {
|
|
3638
|
-
state.language = lang.trim();
|
|
3639
|
-
}
|
|
3640
|
-
}
|
|
3611
|
+
state.language = inferLanguageFromProjectFiles(cwd) ?? "typescript";
|
|
3641
3612
|
}
|
|
3642
3613
|
if (!state.posture) {
|
|
3643
3614
|
state.posture = inferPosture(state) ?? "production";
|
|
3644
3615
|
}
|
|
3645
|
-
await finishInterview(cwd, state);
|
|
3616
|
+
await finishInterview(cwd, state, initialMessage);
|
|
3646
3617
|
}
|
|
3647
|
-
async function finishInterview(cwd, state) {
|
|
3618
|
+
async function finishInterview(cwd, state, initialTaskHint) {
|
|
3648
3619
|
console.log(chalk6.blue("\n-- Recording Project Details --\n"));
|
|
3649
3620
|
const posture = state.posture === "enterprise" ? "enterprise" : state.posture === "prototype" ? "prototype" : "production";
|
|
3650
3621
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -3690,15 +3661,111 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3690
3661
|
console.log(` 1. ${chalk6.cyan("Review")} ARCHITECTURE.md and customize if needed`);
|
|
3691
3662
|
console.log(` 2. ${chalk6.cyan("Run")} ${chalk6.dim('archon plan "your first task"')} to create an atom`);
|
|
3692
3663
|
console.log();
|
|
3693
|
-
const
|
|
3694
|
-
if (
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3664
|
+
const hintedTask = initialTaskHint?.trim() ?? "";
|
|
3665
|
+
if (hintedTask) {
|
|
3666
|
+
console.log(chalk6.dim("Using your request above as the first task.\n"));
|
|
3667
|
+
const { plan: plan2 } = await import("./plan-AR6Y4QUD.js");
|
|
3668
|
+
await plan2(hintedTask, {});
|
|
3669
|
+
return;
|
|
3670
|
+
}
|
|
3671
|
+
const continueAnswer = await prompt("Would you like to plan your first task now? (Y/n)");
|
|
3672
|
+
const normalized = continueAnswer.trim().toLowerCase();
|
|
3673
|
+
const useDefault = normalized === "";
|
|
3674
|
+
const isYes = normalized === "y" || normalized === "yes";
|
|
3675
|
+
const isNo = normalized === "n" || normalized === "no";
|
|
3676
|
+
if (isNo) {
|
|
3677
|
+
return;
|
|
3678
|
+
}
|
|
3679
|
+
let description = "";
|
|
3680
|
+
if (useDefault || isYes) {
|
|
3681
|
+
const hinted = initialTaskHint?.trim() ?? "";
|
|
3682
|
+
if (hinted) {
|
|
3683
|
+
description = hinted;
|
|
3684
|
+
console.log(chalk6.dim("\nUsing your request above as the first task.\n"));
|
|
3685
|
+
} else {
|
|
3686
|
+
description = await promptWithCommands("Describe what you want to build first", { allowMultiline: true });
|
|
3699
3687
|
}
|
|
3688
|
+
} else {
|
|
3689
|
+
description = continueAnswer.trim();
|
|
3690
|
+
}
|
|
3691
|
+
if (description.trim()) {
|
|
3692
|
+
const { plan: plan2 } = await import("./plan-AR6Y4QUD.js");
|
|
3693
|
+
await plan2(description, {});
|
|
3700
3694
|
}
|
|
3701
3695
|
}
|
|
3696
|
+
function inferAudienceFromMessage(message) {
|
|
3697
|
+
const lower = message.toLowerCase();
|
|
3698
|
+
if (/\b(i|me|my|myself)\b/.test(lower) && !/\b(users?|customers?|public|team|internal)\b/.test(lower)) {
|
|
3699
|
+
return "personal";
|
|
3700
|
+
}
|
|
3701
|
+
if (/\bteam|internal|coworkers?|org\b/.test(lower)) {
|
|
3702
|
+
return "team";
|
|
3703
|
+
}
|
|
3704
|
+
return "endusers";
|
|
3705
|
+
}
|
|
3706
|
+
function inferLanguageFromProjectFiles(cwd) {
|
|
3707
|
+
const extToLanguage = /* @__PURE__ */ new Map([
|
|
3708
|
+
[".ts", "typescript"],
|
|
3709
|
+
[".tsx", "typescript"],
|
|
3710
|
+
[".js", "javascript"],
|
|
3711
|
+
[".jsx", "javascript"],
|
|
3712
|
+
[".py", "python"],
|
|
3713
|
+
[".go", "go"],
|
|
3714
|
+
[".rs", "rust"],
|
|
3715
|
+
[".java", "java"],
|
|
3716
|
+
[".kt", "kotlin"],
|
|
3717
|
+
[".swift", "swift"],
|
|
3718
|
+
[".rb", "ruby"],
|
|
3719
|
+
[".php", "php"],
|
|
3720
|
+
[".cs", "csharp"]
|
|
3721
|
+
]);
|
|
3722
|
+
const counts = /* @__PURE__ */ new Map();
|
|
3723
|
+
const rootDirs = ["src", "app", "lib", "server", "backend", "frontend", "services"];
|
|
3724
|
+
for (const root of rootDirs) {
|
|
3725
|
+
const rootPath = join6(cwd, root);
|
|
3726
|
+
if (!existsSync6(rootPath)) {
|
|
3727
|
+
continue;
|
|
3728
|
+
}
|
|
3729
|
+
try {
|
|
3730
|
+
const stack = [rootPath];
|
|
3731
|
+
while (stack.length > 0) {
|
|
3732
|
+
const current = stack.pop();
|
|
3733
|
+
if (!current) {
|
|
3734
|
+
continue;
|
|
3735
|
+
}
|
|
3736
|
+
const entries = readdirSync3(current, { withFileTypes: true });
|
|
3737
|
+
for (const entry of entries) {
|
|
3738
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules" || entry.name === "dist" || entry.name === "build") {
|
|
3739
|
+
continue;
|
|
3740
|
+
}
|
|
3741
|
+
const fullPath = join6(current, entry.name);
|
|
3742
|
+
if (entry.isDirectory()) {
|
|
3743
|
+
stack.push(fullPath);
|
|
3744
|
+
continue;
|
|
3745
|
+
}
|
|
3746
|
+
const dotIndex = entry.name.lastIndexOf(".");
|
|
3747
|
+
if (dotIndex === -1) {
|
|
3748
|
+
continue;
|
|
3749
|
+
}
|
|
3750
|
+
const ext = entry.name.slice(dotIndex);
|
|
3751
|
+
const language = extToLanguage.get(ext);
|
|
3752
|
+
if (!language) {
|
|
3753
|
+
continue;
|
|
3754
|
+
}
|
|
3755
|
+
counts.set(language, (counts.get(language) ?? 0) + 1);
|
|
3756
|
+
}
|
|
3757
|
+
}
|
|
3758
|
+
} catch {
|
|
3759
|
+
}
|
|
3760
|
+
}
|
|
3761
|
+
let best;
|
|
3762
|
+
for (const [language, count] of counts.entries()) {
|
|
3763
|
+
if (!best || count > best.count) {
|
|
3764
|
+
best = { language, count };
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
return best?.language;
|
|
3768
|
+
}
|
|
3702
3769
|
async function quickStart(cwd) {
|
|
3703
3770
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
3704
3771
|
const progressPath = join6(cwd, "progress.txt");
|
|
@@ -3880,6 +3947,7 @@ async function handleContinueSession(cwd, state) {
|
|
|
3880
3947
|
if (response.trim()) {
|
|
3881
3948
|
const handled = await handleFreeformJourneyInput(cwd, response);
|
|
3882
3949
|
if (handled) {
|
|
3950
|
+
await showMainMenu();
|
|
3883
3951
|
return;
|
|
3884
3952
|
}
|
|
3885
3953
|
}
|
|
@@ -3912,54 +3980,54 @@ function checkForHandoff(cwd) {
|
|
|
3912
3980
|
}
|
|
3913
3981
|
async function showMainMenu() {
|
|
3914
3982
|
const cwd = process.cwd();
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3983
|
+
while (true) {
|
|
3984
|
+
const state = detectProjectState(cwd);
|
|
3985
|
+
console.log(chalk6.bold("What would you like to do?\n"));
|
|
3986
|
+
if (state.isWebProject) {
|
|
3987
|
+
const { loadWebChecks, formatWebCheckStatus } = await import("./web-checks-4BSYXWDF.js");
|
|
3988
|
+
const prefs = await loadWebChecks(cwd);
|
|
3989
|
+
console.log(chalk6.dim("Web checks status:"));
|
|
3990
|
+
console.log(chalk6.dim(` A11y: ${formatWebCheckStatus(prefs.lastRun?.a11y)}`));
|
|
3991
|
+
console.log(chalk6.dim(` SEO: ${formatWebCheckStatus(prefs.lastRun?.seo)}`));
|
|
3992
|
+
console.log(chalk6.dim(` GEO: ${formatWebCheckStatus(prefs.lastRun?.geo)}`));
|
|
3993
|
+
console.log();
|
|
3994
|
+
}
|
|
3995
|
+
const choices = [
|
|
3996
|
+
{ key: "1", label: "Plan a new task", action: () => planTask() },
|
|
3997
|
+
{ key: "2", label: "List atoms", action: () => listAtoms() },
|
|
3998
|
+
{ key: "3", label: "Execute next atom", action: () => executeNext() },
|
|
3999
|
+
{ key: "4", label: "Report a bug", action: () => reportBug() },
|
|
4000
|
+
{ key: "5", label: "View status", action: () => viewStatus() },
|
|
4001
|
+
{ key: "6", label: "Code Review", action: () => reviewCode() },
|
|
4002
|
+
...state.isWebProject ? [{ key: "w", label: "Web checks (SEO/GEO/A11y)", action: async () => {
|
|
4003
|
+
await showWebChecksMenu();
|
|
4004
|
+
} }] : [],
|
|
4005
|
+
{ key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
|
|
4006
|
+
{ key: "8", label: "Upgrade tier", action: async () => {
|
|
4007
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
4008
|
+
await showUpgradeMenu();
|
|
4009
|
+
} },
|
|
4010
|
+
{ key: "q", label: "Quit", action: async () => process.exit(0) }
|
|
4011
|
+
];
|
|
4012
|
+
for (const choice2 of choices) {
|
|
4013
|
+
console.log(` ${chalk6.cyan(choice2.key)}) ${choice2.label}`);
|
|
4014
|
+
}
|
|
4015
|
+
console.log(chalk6.dim(' (Type "/" for quick commands, or "upgrade"/"help" anytime)'));
|
|
3924
4016
|
console.log();
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
{ key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
|
|
3938
|
-
{ key: "8", label: "Upgrade tier", action: async () => {
|
|
3939
|
-
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
3940
|
-
await showUpgradeMenu();
|
|
3941
|
-
await showMainMenu();
|
|
3942
|
-
} },
|
|
3943
|
-
{ key: "q", label: "Quit", action: async () => process.exit(0) }
|
|
3944
|
-
];
|
|
3945
|
-
for (const choice2 of choices) {
|
|
3946
|
-
console.log(` ${chalk6.cyan(choice2.key)}) ${choice2.label}`);
|
|
3947
|
-
}
|
|
3948
|
-
console.log(chalk6.dim(' (Type "upgrade" or "help" anytime)'));
|
|
3949
|
-
console.log();
|
|
3950
|
-
const selected = await promptWithCommands("Tell me what you want to do (or enter a shortcut)", { allowMultiline: true });
|
|
3951
|
-
const choice = choices.find((c) => c.key === selected.toLowerCase());
|
|
3952
|
-
if (choice) {
|
|
3953
|
-
await choice.action();
|
|
3954
|
-
} else if (selected.trim()) {
|
|
3955
|
-
const handled = await handleFreeformJourneyInput(cwd, selected.trim());
|
|
3956
|
-
if (!handled) {
|
|
3957
|
-
console.log(chalk6.yellow("I did not catch that. Try describing your goal in one sentence."));
|
|
3958
|
-
await showMainMenu();
|
|
4017
|
+
const selected = await promptWithCommands("Tell me what you want to do (or enter a shortcut)", { allowMultiline: true });
|
|
4018
|
+
const choice = choices.find((c) => c.key === selected.toLowerCase());
|
|
4019
|
+
if (choice) {
|
|
4020
|
+
await choice.action();
|
|
4021
|
+
continue;
|
|
4022
|
+
}
|
|
4023
|
+
if (selected.trim()) {
|
|
4024
|
+
const handled = await handleFreeformJourneyInput(cwd, selected.trim());
|
|
4025
|
+
if (!handled) {
|
|
4026
|
+
console.log(chalk6.yellow("I did not catch that. Try describing your goal in one sentence."));
|
|
4027
|
+
}
|
|
4028
|
+
continue;
|
|
3959
4029
|
}
|
|
3960
|
-
} else {
|
|
3961
4030
|
console.log(chalk6.yellow("Invalid choice. Please try again."));
|
|
3962
|
-
await showMainMenu();
|
|
3963
4031
|
}
|
|
3964
4032
|
}
|
|
3965
4033
|
async function handleFreeformJourneyInput(cwd, input) {
|
|
@@ -4163,7 +4231,6 @@ async function viewStatus() {
|
|
|
4163
4231
|
async function settingsMenu() {
|
|
4164
4232
|
const { interactiveSettings } = await import("./preferences-4V4C7MVD.js");
|
|
4165
4233
|
await interactiveSettings();
|
|
4166
|
-
await showMainMenu();
|
|
4167
4234
|
}
|
|
4168
4235
|
async function reviewCode() {
|
|
4169
4236
|
const cwd = process.cwd();
|
|
@@ -4212,7 +4279,6 @@ async function reviewCode() {
|
|
|
4212
4279
|
break;
|
|
4213
4280
|
}
|
|
4214
4281
|
case "b":
|
|
4215
|
-
await showMainMenu();
|
|
4216
4282
|
return;
|
|
4217
4283
|
default:
|
|
4218
4284
|
if (raw.trim()) {
|
|
@@ -4227,6 +4293,16 @@ async function reviewCode() {
|
|
|
4227
4293
|
}
|
|
4228
4294
|
async function handleInSessionCommand(input) {
|
|
4229
4295
|
const normalized = input.toLowerCase().trim();
|
|
4296
|
+
if (normalized === "/" || normalized === "/help") {
|
|
4297
|
+
showSlashCommandMenu();
|
|
4298
|
+
return true;
|
|
4299
|
+
}
|
|
4300
|
+
if (normalized.startsWith("/")) {
|
|
4301
|
+
const slashHandled = await handleSlashCommand(input.trim());
|
|
4302
|
+
if (slashHandled) {
|
|
4303
|
+
return true;
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4230
4306
|
if (normalized === "upgrade" || normalized === "archon upgrade" || normalized === "pricing" || normalized === "archon pricing") {
|
|
4231
4307
|
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
4232
4308
|
await showUpgradeMenu();
|
|
@@ -4259,6 +4335,67 @@ async function handleInSessionCommand(input) {
|
|
|
4259
4335
|
}
|
|
4260
4336
|
return false;
|
|
4261
4337
|
}
|
|
4338
|
+
function showSlashCommandMenu() {
|
|
4339
|
+
console.log();
|
|
4340
|
+
console.log(chalk6.bold("Quick Commands"));
|
|
4341
|
+
console.log(chalk6.dim(" /plan <task> Create a plan from a one-line task"));
|
|
4342
|
+
console.log(chalk6.dim(" /list List atoms"));
|
|
4343
|
+
console.log(chalk6.dim(" /execute Execute next atom"));
|
|
4344
|
+
console.log(chalk6.dim(" /review Open code review menu"));
|
|
4345
|
+
console.log(chalk6.dim(" /status Show account/status"));
|
|
4346
|
+
console.log(chalk6.dim(" /settings Open settings & preferences"));
|
|
4347
|
+
console.log(chalk6.dim(" /upgrade Open tier upgrade menu"));
|
|
4348
|
+
console.log(chalk6.dim(" /quit Exit ArchonDev"));
|
|
4349
|
+
console.log();
|
|
4350
|
+
}
|
|
4351
|
+
async function handleSlashCommand(input) {
|
|
4352
|
+
const trimmed = input.trim();
|
|
4353
|
+
if (!trimmed.startsWith("/")) {
|
|
4354
|
+
return false;
|
|
4355
|
+
}
|
|
4356
|
+
const parts = trimmed.split(/\s+/);
|
|
4357
|
+
const command = parts[0]?.toLowerCase() ?? "";
|
|
4358
|
+
const arg = parts.slice(1).join(" ").trim();
|
|
4359
|
+
switch (command) {
|
|
4360
|
+
case "/plan": {
|
|
4361
|
+
const { plan: plan2 } = await import("./plan-AR6Y4QUD.js");
|
|
4362
|
+
if (arg) {
|
|
4363
|
+
await plan2(arg, {});
|
|
4364
|
+
} else {
|
|
4365
|
+
const description = await promptWithCommands("Describe what you want to build", { allowMultiline: true });
|
|
4366
|
+
if (description.trim()) {
|
|
4367
|
+
await plan2(description, {});
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
return true;
|
|
4371
|
+
}
|
|
4372
|
+
case "/list":
|
|
4373
|
+
await listAtoms();
|
|
4374
|
+
return true;
|
|
4375
|
+
case "/execute":
|
|
4376
|
+
await executeNext();
|
|
4377
|
+
return true;
|
|
4378
|
+
case "/review":
|
|
4379
|
+
await reviewCode();
|
|
4380
|
+
return true;
|
|
4381
|
+
case "/status":
|
|
4382
|
+
await viewStatus();
|
|
4383
|
+
return true;
|
|
4384
|
+
case "/settings":
|
|
4385
|
+
await settingsMenu();
|
|
4386
|
+
return true;
|
|
4387
|
+
case "/upgrade": {
|
|
4388
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
4389
|
+
await showUpgradeMenu();
|
|
4390
|
+
return true;
|
|
4391
|
+
}
|
|
4392
|
+
case "/quit":
|
|
4393
|
+
case "/exit":
|
|
4394
|
+
console.log(chalk6.dim("Goodbye!"));
|
|
4395
|
+
process.exit(0);
|
|
4396
|
+
}
|
|
4397
|
+
return false;
|
|
4398
|
+
}
|
|
4262
4399
|
function prompt(question) {
|
|
4263
4400
|
return new Promise((resolve) => {
|
|
4264
4401
|
const rl = readline.createInterface({
|