archondev 2.6.0 → 2.8.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.
@@ -2,8 +2,8 @@ import {
2
2
  login,
3
3
  logout,
4
4
  status
5
- } from "./chunk-SGGLAY6G.js";
6
- import "./chunk-DHGQPKIV.js";
5
+ } from "./chunk-IA3ENLBQ.js";
6
+ import "./chunk-UG5MAS4X.js";
7
7
  import "./chunk-Y7DQ5XTU.js";
8
8
  import "./chunk-M4LGRTLC.js";
9
9
  import "./chunk-QGM4M3NI.js";
@@ -2,7 +2,7 @@ import {
2
2
  handleTierSetup,
3
3
  promptTierSelection,
4
4
  updateUserTier
5
- } from "./chunk-DHGQPKIV.js";
5
+ } from "./chunk-UG5MAS4X.js";
6
6
  import {
7
7
  clearConfig,
8
8
  loadConfig,
@@ -70,7 +70,7 @@ async function promptTierSelection() {
70
70
  case "s":
71
71
  case "skip":
72
72
  case "":
73
- console.log(chalk.dim("\nDefaulting to Free tier. You can change this anytime with `archon pricing`"));
73
+ console.log(chalk.dim("\nDefaulting to Free tier. You can upgrade anytime with `archon upgrade`"));
74
74
  return { tier: "FREE", skipped: true };
75
75
  default:
76
76
  console.log(chalk.yellow("Invalid choice. Defaulting to Free tier."));
@@ -141,54 +141,89 @@ async function createCheckoutSession(amountCents) {
141
141
  return null;
142
142
  }
143
143
  }
144
- async function showTierSwitchMenu() {
144
+ async function showUpgradeMenu() {
145
145
  const config = await loadConfig();
146
146
  const currentTier = config.tier || "FREE";
147
147
  console.log();
148
- console.log(chalk.bold("Pricing & Billing"));
148
+ console.log(chalk.bold("ARCHONDEV UPGRADE OPTIONS"));
149
149
  console.log();
150
- console.log(`Current tier: ${formatTierDisplay(currentTier)}`);
150
+ console.log(chalk.dim("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));
151
+ console.log(`CURRENT TIER: ${formatTierDisplay(currentTier)}`);
151
152
  console.log();
152
- console.log(chalk.dim("Choose a pricing model:\n"));
153
- const tiers = [
154
- { key: "1", tier: "FREE", info: TIER_INFO.FREE },
155
- { key: "2", tier: "BYOK", info: TIER_INFO.BYOK },
156
- { key: "3", tier: "CREDITS", info: TIER_INFO.CREDITS }
157
- ];
158
- for (const { key, tier, info } of tiers) {
159
- const isCurrent = tier === currentTier;
160
- const marker = isCurrent ? chalk.green("\u25CF ") : "\u25CB ";
161
- console.log(` ${chalk.cyan(key)}) ${marker}${chalk.bold(info.name)}`);
162
- console.log(chalk.dim(` ${info.description}`));
163
- if (tier !== "FREE") {
164
- console.log(chalk.green(` \u2713 ${info.models}`));
165
- }
153
+ if (currentTier !== "FREE") {
154
+ console.log(chalk.green("\u2713 You have unlimited access!"));
155
+ console.log();
156
+ console.log(chalk.dim("Switch tiers:"));
157
+ } else {
158
+ console.log(chalk.bold("UPGRADE TO UNLOCK UNLIMITED ACCESS:"));
159
+ }
160
+ console.log();
161
+ const byokCurrent = currentTier === "BYOK";
162
+ const byokMarker = byokCurrent ? chalk.green("\u25CF ") : "\u25CB ";
163
+ console.log(` ${chalk.cyan("1")}) ${byokMarker}${chalk.bold("\u{1F511} BRING YOUR OWN KEY (BYOK)")} ${chalk.green("- FREE")}`);
164
+ console.log(chalk.dim(" \u2022 Pay only your actual API provider costs (OpenAI, Anthropic, etc.)"));
165
+ console.log(chalk.dim(" \u2022 No ArchonDev fees"));
166
+ console.log(chalk.dim(" \u2022 Full control over your API keys"));
167
+ console.log(chalk.green(" \u2713 Unlimited usage"));
168
+ console.log();
169
+ const creditsCurrent = currentTier === "CREDITS";
170
+ const creditsMarker = creditsCurrent ? chalk.green("\u25CF ") : "\u25CB ";
171
+ console.log(` ${chalk.cyan("2")}) ${creditsMarker}${chalk.bold("\u{1F4B3} MANAGED PLAN")}`);
172
+ console.log(chalk.dim(" \u2022 Just 10% service fee above actual AI costs"));
173
+ console.log(chalk.dim(" \u2022 No API key setup required"));
174
+ console.log(chalk.dim(" \u2022 We handle all provider billing"));
175
+ console.log(chalk.green(" \u2713 Unlimited usage"));
176
+ console.log();
177
+ if (currentTier !== "FREE") {
178
+ const freeMarker = currentTier === "FREE" ? chalk.green("\u25CF ") : "\u25CB ";
179
+ console.log(` ${chalk.cyan("3")}) ${freeMarker}${chalk.dim("Free (Limited)")}`);
180
+ console.log(chalk.dim(" \u2022 Basic models, limited usage"));
166
181
  console.log();
167
182
  }
168
- console.log(` ${chalk.dim("b")}) Back`);
183
+ console.log(chalk.dim("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));
169
184
  console.log();
170
- const choice = await prompt("Enter choice");
185
+ console.log(` ${chalk.dim("b")}) Back / Cancel`);
186
+ console.log();
187
+ const choice = await prompt("Enter choice (1-2 or b)");
171
188
  if (choice.toLowerCase() === "b" || choice === "") {
172
189
  return;
173
190
  }
174
- const selected = tiers.find((t) => t.key === choice);
175
- if (!selected) {
191
+ let selectedTier = null;
192
+ let selectedName = "";
193
+ switch (choice) {
194
+ case "1":
195
+ selectedTier = "BYOK";
196
+ selectedName = "BYOK (Bring Your Own Key)";
197
+ break;
198
+ case "2":
199
+ selectedTier = "CREDITS";
200
+ selectedName = "Managed Plan";
201
+ break;
202
+ case "3":
203
+ if (currentTier !== "FREE") {
204
+ selectedTier = "FREE";
205
+ selectedName = "Free";
206
+ }
207
+ break;
208
+ }
209
+ if (!selectedTier) {
176
210
  console.log(chalk.yellow("Invalid choice."));
177
211
  return;
178
212
  }
179
- if (selected.tier === currentTier) {
180
- console.log(chalk.dim("Already using this pricing model."));
213
+ if (selectedTier === currentTier) {
214
+ console.log(chalk.dim("Already using this tier."));
181
215
  return;
182
216
  }
183
- const spinner = ora(`Switching to ${selected.info.name}...`).start();
184
- const result = await updateUserTier(selected.tier);
217
+ const spinner = ora(`Switching to ${selectedName}...`).start();
218
+ const result = await updateUserTier(selectedTier);
185
219
  if (result.success) {
186
- spinner.succeed(chalk.green(`Switched to ${selected.info.name}`));
187
- await handleTierSetup(selected.tier);
220
+ spinner.succeed(chalk.green(`\u2713 Switched to ${selectedName}`));
221
+ await handleTierSetup(selectedTier);
188
222
  } else {
189
223
  spinner.fail(chalk.red(result.error || "Failed to update tier"));
190
224
  }
191
225
  }
226
+ var showTierSwitchMenu = showUpgradeMenu;
192
227
  async function updateUserTier(tier) {
193
228
  try {
194
229
  const config = await loadConfig();
@@ -260,6 +295,7 @@ function promptYesNo(question, defaultValue) {
260
295
  export {
261
296
  promptTierSelection,
262
297
  handleTierSetup,
298
+ showUpgradeMenu,
263
299
  showTierSwitchMenu,
264
300
  updateUserTier
265
301
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  login
3
- } from "./chunk-SGGLAY6G.js";
3
+ } from "./chunk-IA3ENLBQ.js";
4
4
  import {
5
5
  getApiUrl,
6
6
  getAuthToken,
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setPreference,
19
19
  showExecutionPreferences,
20
20
  showPreferences
21
- } from "./chunk-ZP75P65T.js";
21
+ } from "./chunk-ZCWCSRCQ.js";
22
22
  import {
23
23
  parallelClean,
24
24
  parallelMerge,
@@ -62,12 +62,12 @@ import {
62
62
  login,
63
63
  logout,
64
64
  status
65
- } from "./chunk-SGGLAY6G.js";
65
+ } from "./chunk-IA3ENLBQ.js";
66
66
  import {
67
67
  handleTierSetup,
68
68
  promptTierSelection,
69
69
  updateUserTier
70
- } from "./chunk-DHGQPKIV.js";
70
+ } from "./chunk-UG5MAS4X.js";
71
71
  import {
72
72
  getAuthToken,
73
73
  loadConfig,
@@ -2614,7 +2614,7 @@ async function start(options = {}) {
2614
2614
  } else {
2615
2615
  config.tierConfirmed = true;
2616
2616
  await saveConfig(config);
2617
- console.log(chalk5.dim("Using Free tier. You can change this anytime with `archon pricing`\n"));
2617
+ console.log(chalk5.dim("Using Free tier. You can upgrade anytime with `archon upgrade`\n"));
2618
2618
  }
2619
2619
  }
2620
2620
  }
@@ -2623,8 +2623,14 @@ async function start(options = {}) {
2623
2623
  }
2624
2624
  const currentTier = config.tier || "FREE";
2625
2625
  const tierDisplay = formatTierName(currentTier);
2626
- const upgradeHint = currentTier === "FREE" ? chalk5.dim(" \u2014 Run `archon pricing` to upgrade") : "";
2627
- console.log(chalk5.dim(`Tier: `) + tierDisplay + upgradeHint);
2626
+ console.log(chalk5.dim(`Tier: `) + tierDisplay);
2627
+ if (currentTier === "FREE") {
2628
+ console.log();
2629
+ console.log(chalk5.yellow("\u26A0\uFE0F FREE TIER: Limited usage. Upgrade options:"));
2630
+ console.log(chalk5.dim(" \u2022 ") + chalk5.bold("BYOK (FREE)") + chalk5.dim(" - Unlimited usage with your own API keys"));
2631
+ console.log(chalk5.dim(" \u2022 ") + chalk5.bold("Managed Plan") + chalk5.dim(" - Just 10% fee on AI costs, zero setup"));
2632
+ console.log(chalk5.cyan("\u2192 Run ") + chalk5.bold("'archon upgrade'") + chalk5.cyan(" to unlock unlimited access"));
2633
+ }
2628
2634
  console.log();
2629
2635
  const updateResult = await updateCheckPromise;
2630
2636
  if (updateResult?.hasUpdate) {
@@ -2821,7 +2827,7 @@ async function handleNewProject(cwd, _state) {
2821
2827
  console.log(chalk5.bold("\u{1F389} Starting a new project? Great!\n"));
2822
2828
  console.log(chalk5.dim("Answer as much or as little as you want \u2014 you can always refine later."));
2823
2829
  console.log(chalk5.dim('Type "just start" or "skip" to use defaults.\n'));
2824
- const initialResponse = await prompt("What do you want to do?");
2830
+ const initialResponse = await promptWithCommands("What do you want to do?");
2825
2831
  if (!initialResponse.trim()) {
2826
2832
  console.log(chalk5.yellow("\nNo response provided. Showing options...\n"));
2827
2833
  await showNewProjectMenu(cwd);
@@ -2852,7 +2858,7 @@ async function handleNewProject(cwd, _state) {
2852
2858
  console.log(` ${chalk5.cyan("2")}) ${chalk5.bold("Doing a specific task")} \u2014 fix, add, refactor, analyze`);
2853
2859
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Just exploring")} \u2014 show me what ArchonDev can do`);
2854
2860
  console.log();
2855
- const clarification = await prompt("Enter choice (1-3)");
2861
+ const clarification = await promptWithCommands("Enter choice (1-3)");
2856
2862
  switch (clarification.trim()) {
2857
2863
  case "1":
2858
2864
  await runConversationalInterview(cwd, initialResponse);
@@ -2876,8 +2882,9 @@ async function showNewProjectMenu(cwd) {
2876
2882
  console.log(` ${chalk5.cyan("2")}) ${chalk5.bold("Quick start")} \u2014 Just create basic governance files`);
2877
2883
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Plan a task")} \u2014 Create an atom for a specific task`);
2878
2884
  console.log(` ${chalk5.cyan("q")}) ${chalk5.dim("Quit")}`);
2885
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
2879
2886
  console.log();
2880
- const choice = await prompt("Enter choice");
2887
+ const choice = await promptWithCommands("Enter choice");
2881
2888
  switch (choice.toLowerCase()) {
2882
2889
  case "1":
2883
2890
  await runConversationalInterview(cwd, "");
@@ -3091,8 +3098,9 @@ async function handleAdaptExisting(cwd, state) {
3091
3098
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Manual setup")} \u2014 Keep template files, customize manually`);
3092
3099
  console.log(` ${chalk5.cyan("4")}) ${chalk5.bold("Just start working")} \u2014 Skip setup, use defaults`);
3093
3100
  console.log(` ${chalk5.cyan("q")}) ${chalk5.dim("Quit")}`);
3101
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
3094
3102
  console.log();
3095
- const choice = await prompt("Enter choice");
3103
+ const choice = await promptWithCommands("Enter choice");
3096
3104
  switch (choice.toLowerCase()) {
3097
3105
  case "1":
3098
3106
  await analyzeAndAdapt(cwd);
@@ -3236,13 +3244,19 @@ async function showMainMenu() {
3236
3244
  { key: "5", label: "View status", action: () => viewStatus() },
3237
3245
  { key: "6", label: "Code Review", action: () => reviewCode() },
3238
3246
  { key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
3247
+ { key: "8", label: "Upgrade tier", action: async () => {
3248
+ const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
3249
+ await showUpgradeMenu();
3250
+ await showMainMenu();
3251
+ } },
3239
3252
  { key: "q", label: "Quit", action: async () => process.exit(0) }
3240
3253
  ];
3241
3254
  for (const choice2 of choices) {
3242
3255
  console.log(` ${chalk5.cyan(choice2.key)}) ${choice2.label}`);
3243
3256
  }
3257
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
3244
3258
  console.log();
3245
- const selected = await prompt("Enter choice");
3259
+ const selected = await promptWithCommands("Enter choice");
3246
3260
  const choice = choices.find((c) => c.key === selected.toLowerCase());
3247
3261
  if (choice) {
3248
3262
  await choice.action();
@@ -3283,7 +3297,7 @@ async function listAtoms() {
3283
3297
  async function executeNext() {
3284
3298
  const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-67BMJFES.js");
3285
3299
  const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-X6LHSHBJ.js");
3286
- const { loadExecutionPreferences } = await import("./preferences-DRR4A76D.js");
3300
+ const { loadExecutionPreferences } = await import("./preferences-6J2UVWLQ.js");
3287
3301
  const cwd = process.cwd();
3288
3302
  const atoms = await listLocalAtoms2();
3289
3303
  const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
@@ -3330,11 +3344,11 @@ async function reportBug() {
3330
3344
  }
3331
3345
  }
3332
3346
  async function viewStatus() {
3333
- const { status: status2 } = await import("./auth-5BOORBOL.js");
3347
+ const { status: status2 } = await import("./auth-ZWXKMI3Q.js");
3334
3348
  await status2();
3335
3349
  }
3336
3350
  async function settingsMenu() {
3337
- const { interactiveSettings } = await import("./preferences-DRR4A76D.js");
3351
+ const { interactiveSettings } = await import("./preferences-6J2UVWLQ.js");
3338
3352
  await interactiveSettings();
3339
3353
  await showMainMenu();
3340
3354
  }
@@ -3390,6 +3404,40 @@ async function reviewCode() {
3390
3404
  }
3391
3405
  await reviewCode();
3392
3406
  }
3407
+ async function handleInSessionCommand(input) {
3408
+ const normalized = input.toLowerCase().trim();
3409
+ if (normalized === "upgrade" || normalized === "archon upgrade" || normalized === "pricing" || normalized === "archon pricing") {
3410
+ const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
3411
+ await showUpgradeMenu();
3412
+ return true;
3413
+ }
3414
+ if (normalized === "status" || normalized === "archon status") {
3415
+ const { status: status2 } = await import("./auth-ZWXKMI3Q.js");
3416
+ await status2();
3417
+ return true;
3418
+ }
3419
+ if (normalized === "help" || normalized === "?" || normalized === "archon help") {
3420
+ console.log();
3421
+ console.log(chalk5.bold("Available commands (type anytime):"));
3422
+ console.log(chalk5.dim(" upgrade \u2014 Switch to BYOK or Managed plan"));
3423
+ console.log(chalk5.dim(" status \u2014 Show login and tier status"));
3424
+ console.log(chalk5.dim(" keys \u2014 Manage API keys (BYOK tier)"));
3425
+ console.log(chalk5.dim(" quit / q \u2014 Exit ArchonDev"));
3426
+ console.log(chalk5.dim(" skip \u2014 Skip current question"));
3427
+ console.log();
3428
+ return true;
3429
+ }
3430
+ if (normalized === "keys" || normalized === "archon keys") {
3431
+ const { listKeys: listKeys2 } = await import("./keys-LHIUYDFT.js");
3432
+ await listKeys2();
3433
+ return true;
3434
+ }
3435
+ if (normalized === "quit" || normalized === "exit" || normalized === "q") {
3436
+ console.log(chalk5.dim("Goodbye!"));
3437
+ process.exit(0);
3438
+ }
3439
+ return false;
3440
+ }
3393
3441
  function prompt(question) {
3394
3442
  return new Promise((resolve) => {
3395
3443
  const rl = readline.createInterface({
@@ -3402,6 +3450,16 @@ function prompt(question) {
3402
3450
  });
3403
3451
  });
3404
3452
  }
3453
+ async function promptWithCommands(question) {
3454
+ while (true) {
3455
+ const answer = await prompt(question);
3456
+ const handled = await handleInSessionCommand(answer);
3457
+ if (!handled) {
3458
+ return answer;
3459
+ }
3460
+ console.log(chalk5.dim("(Returning to previous question...)\n"));
3461
+ }
3462
+ }
3405
3463
  function promptYesNo(question, defaultValue) {
3406
3464
  return new Promise((resolve) => {
3407
3465
  const rl = readline.createInterface({
@@ -7466,9 +7524,13 @@ program.command("logout").description("Clear stored authentication").action(asyn
7466
7524
  program.command("status").description("Show current user and project status").action(async () => {
7467
7525
  await status();
7468
7526
  });
7469
- program.command("pricing").description("View and switch pricing tiers (Free, BYOK, Credits)").action(async () => {
7470
- const { showTierSwitchMenu } = await import("./tier-selection-YPES45QY.js");
7471
- await showTierSwitchMenu();
7527
+ program.command("upgrade").description("Upgrade your tier (BYOK for free unlimited, or Managed plan)").action(async () => {
7528
+ const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
7529
+ await showUpgradeMenu();
7530
+ });
7531
+ program.command("pricing", { hidden: true }).action(async () => {
7532
+ const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
7533
+ await showUpgradeMenu();
7472
7534
  });
7473
7535
  program.command("init").description("Initialize ArchonDev in current project").option("--analyze", "Run enhanced analysis of codebase").option("--no-git", "Skip git initialization").action(async (options) => {
7474
7536
  await init(options);
@@ -7,10 +7,10 @@ import {
7
7
  setPreference,
8
8
  showExecutionPreferences,
9
9
  showPreferences
10
- } from "./chunk-ZP75P65T.js";
10
+ } from "./chunk-ZCWCSRCQ.js";
11
11
  import "./chunk-QN65APWL.js";
12
- import "./chunk-SGGLAY6G.js";
13
- import "./chunk-DHGQPKIV.js";
12
+ import "./chunk-IA3ENLBQ.js";
13
+ import "./chunk-UG5MAS4X.js";
14
14
  import "./chunk-Y7DQ5XTU.js";
15
15
  import "./chunk-M4LGRTLC.js";
16
16
  import "./chunk-WH6IKTYF.js";
@@ -2,8 +2,9 @@ import {
2
2
  handleTierSetup,
3
3
  promptTierSelection,
4
4
  showTierSwitchMenu,
5
+ showUpgradeMenu,
5
6
  updateUserTier
6
- } from "./chunk-DHGQPKIV.js";
7
+ } from "./chunk-UG5MAS4X.js";
7
8
  import "./chunk-Y7DQ5XTU.js";
8
9
  import "./chunk-M4LGRTLC.js";
9
10
  import "./chunk-QGM4M3NI.js";
@@ -11,5 +12,6 @@ export {
11
12
  handleTierSetup,
12
13
  promptTierSelection,
13
14
  showTierSwitchMenu,
15
+ showUpgradeMenu,
14
16
  updateUserTier
15
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archondev",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "Local-first AI-powered development governance system",
5
5
  "main": "dist/index.js",
6
6
  "bin": {