archondev 2.19.10 → 2.19.11

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.
Files changed (2) hide show
  1. package/dist/index.js +107 -40
  2. 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
- console.log();
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
- console.log();
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,14 +3661,110 @@ ${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 continueChoice = await promptYesNo("Would you like to plan your first task now?", true);
3694
- if (continueChoice) {
3695
- const description = await promptWithCommands("Describe what you want to build first", { allowMultiline: true });
3696
- if (description.trim()) {
3697
- const { plan: plan2 } = await import("./plan-AR6Y4QUD.js");
3698
- await plan2(description, {});
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 });
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, {});
3694
+ }
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 };
3699
3765
  }
3700
3766
  }
3767
+ return best?.language;
3701
3768
  }
3702
3769
  async function quickStart(cwd) {
3703
3770
  const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archondev",
3
- "version": "2.19.10",
3
+ "version": "2.19.11",
4
4
  "description": "Local-first AI-powered development governance system",
5
5
  "main": "dist/index.js",
6
6
  "bin": {