archondev 2.7.0 → 2.8.1

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/README.md CHANGED
@@ -54,7 +54,8 @@ Copy governance files into any project. Works with your existing AI tools: **Cur
54
54
  | `archon` | Interactive mode — just run and follow prompts |
55
55
  | `archon init` | Initialize in your project |
56
56
  | `archon login` | Authenticate with ArchonDev (tier selection on first login) |
57
- | `archon pricing` | View and switch pricing tiers (Free, BYOK, Credits) |
57
+ | `archon upgrade` | Upgrade to BYOK (free unlimited) or Managed plan |
58
+ | `archon status` | Show login status and current tier |
58
59
  | `archon plan <description>` | Create a work item with AI planning (extracts and confirms multi-item requests) |
59
60
  | `archon execute <atom-id>` | Execute with quality gates |
60
61
  | `archon list` | List all work items |
@@ -102,12 +103,12 @@ Copy governance files into any project. Works with your existing AI tools: **Cur
102
103
 
103
104
  | Tier | Cost | What You Get |
104
105
  |------|------|--------------|
105
- | **Free** | $0 | Ultra-cheap models (GPT-5-nano, GPT-4.1-nano, Gemini 2.5 Flash-Lite) — $0 cost to us |
106
- | **Credits** | Pay as you go | All models, 10% service fee, deposit any amount |
107
- | **BYOK** (Bring Your Own Key) | $0 | Use your own API keys, unlimited usage |
106
+ | **Free** | $0 | Ultra-cheap models (GPT-5-nano, GPT-4.1-nano, Gemini 2.5 Flash-Lite) — limited usage |
107
+ | **BYOK** (Bring Your Own Key) | **$0** | Use your own API keys, **unlimited usage**, all models |
108
+ | **Managed Plan** | 10% fee | All models, we handle billing, no API key setup |
108
109
  | **Claude Subscription** *(coming soon)* | Your existing sub | Use Claude Pro/Max subscription instead of API keys |
109
110
 
110
- No subscriptions. No commitments. Start free.
111
+ No subscriptions. No commitments. Start free, upgrade anytime with `archon upgrade`.
111
112
 
112
113
  ### Claude Pro/Max Subscription Support (Coming Soon)
113
114
 
@@ -136,23 +137,33 @@ $ archon
136
137
  ArchonDev - AI-Powered Development Governance
137
138
  ────────────────────────────────────────────────
138
139
 
139
- Welcome to ArchonDev!
140
- Let's get you set up. First, we need to create your account.
140
+ Logged in as: you@example.com
141
+ Tier: Free (basic models)
141
142
 
142
- [Opens browser for GitHub/Google login]
143
-
144
- How would you like to use ArchonDev?
145
-
146
- 1) Free (basic models)
147
- 2) BYOK (Bring Your Own Key) - use your API keys
148
- 3) Credits (pay-as-you-go)
143
+ ⚠️ FREE TIER: Limited usage. Upgrade options:
144
+ • BYOK (FREE) - Unlimited usage with your own API keys
145
+ Managed Plan - Just 10% fee on AI costs, zero setup
146
+ → Run 'archon upgrade' to unlock unlimited access
149
147
 
150
148
  → What kind of project are you building?
151
149
  [AI asks natural follow-up questions based on your answers]
150
+ (Type "upgrade" or "help" anytime)
152
151
 
153
152
  ✓ Project initialized!
154
153
  ```
155
154
 
155
+ ### In-Session Commands
156
+
157
+ Type these anytime during interactive prompts:
158
+
159
+ | Command | Description |
160
+ |---------|-------------|
161
+ | `upgrade` | Open tier upgrade menu |
162
+ | `status` | Show login and tier info |
163
+ | `keys` | List configured API keys |
164
+ | `help` | Show available commands |
165
+ | `quit` | Exit ArchonDev |
166
+
156
167
  ## Cloud Execution
157
168
 
158
169
  Run AI agents in the cloud — close your laptop and get a PR when it's done.
@@ -2,10 +2,10 @@ import {
2
2
  login,
3
3
  logout,
4
4
  status
5
- } from "./chunk-IA3ENLBQ.js";
6
- import "./chunk-UG5MAS4X.js";
7
- import "./chunk-Y7DQ5XTU.js";
5
+ } from "./chunk-GVIS5PHD.js";
8
6
  import "./chunk-M4LGRTLC.js";
7
+ import "./chunk-XMQIIPTU.js";
8
+ import "./chunk-Y7DQ5XTU.js";
9
9
  import "./chunk-QGM4M3NI.js";
10
10
  export {
11
11
  login,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  login
3
- } from "./chunk-IA3ENLBQ.js";
3
+ } from "./chunk-GVIS5PHD.js";
4
4
  import {
5
5
  getApiUrl,
6
6
  getAuthToken,
@@ -1,17 +1,17 @@
1
+ import {
2
+ SUPABASE_ANON_KEY,
3
+ SUPABASE_URL
4
+ } from "./chunk-M4LGRTLC.js";
1
5
  import {
2
6
  handleTierSetup,
3
7
  promptTierSelection,
4
8
  updateUserTier
5
- } from "./chunk-UG5MAS4X.js";
9
+ } from "./chunk-XMQIIPTU.js";
6
10
  import {
7
11
  clearConfig,
8
12
  loadConfig,
9
13
  saveConfig
10
14
  } from "./chunk-Y7DQ5XTU.js";
11
- import {
12
- SUPABASE_ANON_KEY,
13
- SUPABASE_URL
14
- } from "./chunk-M4LGRTLC.js";
15
15
 
16
16
  // src/cli/auth.ts
17
17
  import { createClient } from "@supabase/supabase-js";
@@ -3,9 +3,6 @@ import {
3
3
  loadConfig,
4
4
  saveConfig
5
5
  } from "./chunk-Y7DQ5XTU.js";
6
- import {
7
- API_URL
8
- } from "./chunk-M4LGRTLC.js";
9
6
 
10
7
  // src/cli/tier-selection.ts
11
8
  import chalk from "chalk";
@@ -113,12 +110,14 @@ async function handleTierSetup(tier) {
113
110
  async function createCheckoutSession(amountCents) {
114
111
  const spinner = ora("Preparing checkout...").start();
115
112
  try {
116
- const config = await loadConfig();
117
- if (!config.accessToken || !config.userId) {
118
- spinner.fail("Not logged in");
113
+ const { ensureValidSession } = await import("./config-SU5Y6MKO.js");
114
+ const config = await ensureValidSession();
115
+ if (!config || !config.accessToken || !config.userId) {
116
+ spinner.fail("Not logged in. Please run `archon login` first.");
119
117
  return null;
120
118
  }
121
- const response = await fetch(`${API_URL}/api/checkout`, {
119
+ const apiUrl = getApiUrl(config);
120
+ const response = await fetch(`${apiUrl}/api/checkout`, {
122
121
  method: "POST",
123
122
  headers: {
124
123
  "Content-Type": "application/json",
@@ -129,6 +128,10 @@ async function createCheckoutSession(amountCents) {
129
128
  amountCents
130
129
  })
131
130
  });
131
+ if (response.status === 401) {
132
+ spinner.fail("Session expired. Please run `archon login` to re-authenticate.");
133
+ return null;
134
+ }
132
135
  const result = await response.json();
133
136
  if (!response.ok || !result.success) {
134
137
  spinner.fail(result.error?.error || "Failed to create checkout");
@@ -226,9 +229,10 @@ async function showUpgradeMenu() {
226
229
  var showTierSwitchMenu = showUpgradeMenu;
227
230
  async function updateUserTier(tier) {
228
231
  try {
229
- const config = await loadConfig();
230
- if (!config.accessToken) {
231
- return { success: false, error: "Not logged in" };
232
+ const { ensureValidSession } = await import("./config-SU5Y6MKO.js");
233
+ const config = await ensureValidSession();
234
+ if (!config || !config.accessToken) {
235
+ return { success: false, error: "Not logged in. Please run `archon login` first." };
232
236
  }
233
237
  const apiUrl = getApiUrl(config);
234
238
  const response = await fetch(`${apiUrl}/api/preferences`, {
@@ -240,8 +244,11 @@ async function updateUserTier(tier) {
240
244
  body: JSON.stringify({ tier })
241
245
  });
242
246
  if (!response.ok) {
243
- const text = await response.text();
244
- return { success: false, error: text };
247
+ const data = await response.json().catch(() => ({ error: "Unknown error" }));
248
+ if (response.status === 401) {
249
+ return { success: false, error: "Session expired. Please run `archon login` to re-authenticate." };
250
+ }
251
+ return { success: false, error: data.error || `Server error: ${response.status}` };
245
252
  }
246
253
  await saveConfig({ ...config, tier });
247
254
  return { success: true };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  execute
3
- } from "./chunk-IYZRHFAI.js";
3
+ } from "./chunk-LS2ZW5XA.js";
4
4
  import "./chunk-7RBN4OKO.js";
5
5
  import "./chunk-KAFR3QRD.js";
6
6
  import "./chunk-QN65APWL.js";
7
7
  import "./chunk-PQQ6SP4D.js";
8
- import "./chunk-Y7DQ5XTU.js";
9
8
  import "./chunk-M4LGRTLC.js";
9
+ import "./chunk-Y7DQ5XTU.js";
10
10
  import "./chunk-5EVHUDQX.js";
11
11
  import "./chunk-WH6IKTYF.js";
12
12
  import "./chunk-QGM4M3NI.js";
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  setPreference,
19
19
  showExecutionPreferences,
20
20
  showPreferences
21
- } from "./chunk-ZCWCSRCQ.js";
21
+ } from "./chunk-7INSG7ZE.js";
22
22
  import {
23
23
  parallelClean,
24
24
  parallelMerge,
@@ -34,7 +34,7 @@ import {
34
34
  cloudLogs,
35
35
  cloudStatus,
36
36
  execute
37
- } from "./chunk-IYZRHFAI.js";
37
+ } from "./chunk-LS2ZW5XA.js";
38
38
  import {
39
39
  list
40
40
  } from "./chunk-OG4SHBL5.js";
@@ -62,22 +62,22 @@ import {
62
62
  login,
63
63
  logout,
64
64
  status
65
- } from "./chunk-IA3ENLBQ.js";
65
+ } from "./chunk-GVIS5PHD.js";
66
+ import {
67
+ API_URL,
68
+ SUPABASE_ANON_KEY,
69
+ SUPABASE_URL
70
+ } from "./chunk-M4LGRTLC.js";
66
71
  import {
67
72
  handleTierSetup,
68
73
  promptTierSelection,
69
74
  updateUserTier
70
- } from "./chunk-UG5MAS4X.js";
75
+ } from "./chunk-XMQIIPTU.js";
71
76
  import {
72
77
  getAuthToken,
73
78
  loadConfig,
74
79
  saveConfig
75
80
  } from "./chunk-Y7DQ5XTU.js";
76
- import {
77
- API_URL,
78
- SUPABASE_ANON_KEY,
79
- SUPABASE_URL
80
- } from "./chunk-M4LGRTLC.js";
81
81
  import {
82
82
  init,
83
83
  isInitialized
@@ -2827,7 +2827,7 @@ async function handleNewProject(cwd, _state) {
2827
2827
  console.log(chalk5.bold("\u{1F389} Starting a new project? Great!\n"));
2828
2828
  console.log(chalk5.dim("Answer as much or as little as you want \u2014 you can always refine later."));
2829
2829
  console.log(chalk5.dim('Type "just start" or "skip" to use defaults.\n'));
2830
- const initialResponse = await prompt("What do you want to do?");
2830
+ const initialResponse = await promptWithCommands("What do you want to do?");
2831
2831
  if (!initialResponse.trim()) {
2832
2832
  console.log(chalk5.yellow("\nNo response provided. Showing options...\n"));
2833
2833
  await showNewProjectMenu(cwd);
@@ -2858,7 +2858,7 @@ async function handleNewProject(cwd, _state) {
2858
2858
  console.log(` ${chalk5.cyan("2")}) ${chalk5.bold("Doing a specific task")} \u2014 fix, add, refactor, analyze`);
2859
2859
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Just exploring")} \u2014 show me what ArchonDev can do`);
2860
2860
  console.log();
2861
- const clarification = await prompt("Enter choice (1-3)");
2861
+ const clarification = await promptWithCommands("Enter choice (1-3)");
2862
2862
  switch (clarification.trim()) {
2863
2863
  case "1":
2864
2864
  await runConversationalInterview(cwd, initialResponse);
@@ -2882,8 +2882,9 @@ async function showNewProjectMenu(cwd) {
2882
2882
  console.log(` ${chalk5.cyan("2")}) ${chalk5.bold("Quick start")} \u2014 Just create basic governance files`);
2883
2883
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Plan a task")} \u2014 Create an atom for a specific task`);
2884
2884
  console.log(` ${chalk5.cyan("q")}) ${chalk5.dim("Quit")}`);
2885
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
2885
2886
  console.log();
2886
- const choice = await prompt("Enter choice");
2887
+ const choice = await promptWithCommands("Enter choice");
2887
2888
  switch (choice.toLowerCase()) {
2888
2889
  case "1":
2889
2890
  await runConversationalInterview(cwd, "");
@@ -3097,8 +3098,9 @@ async function handleAdaptExisting(cwd, state) {
3097
3098
  console.log(` ${chalk5.cyan("3")}) ${chalk5.bold("Manual setup")} \u2014 Keep template files, customize manually`);
3098
3099
  console.log(` ${chalk5.cyan("4")}) ${chalk5.bold("Just start working")} \u2014 Skip setup, use defaults`);
3099
3100
  console.log(` ${chalk5.cyan("q")}) ${chalk5.dim("Quit")}`);
3101
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
3100
3102
  console.log();
3101
- const choice = await prompt("Enter choice");
3103
+ const choice = await promptWithCommands("Enter choice");
3102
3104
  switch (choice.toLowerCase()) {
3103
3105
  case "1":
3104
3106
  await analyzeAndAdapt(cwd);
@@ -3242,13 +3244,19 @@ async function showMainMenu() {
3242
3244
  { key: "5", label: "View status", action: () => viewStatus() },
3243
3245
  { key: "6", label: "Code Review", action: () => reviewCode() },
3244
3246
  { key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
3247
+ { key: "8", label: "Upgrade tier", action: async () => {
3248
+ const { showUpgradeMenu } = await import("./tier-selection-X52UG44Y.js");
3249
+ await showUpgradeMenu();
3250
+ await showMainMenu();
3251
+ } },
3245
3252
  { key: "q", label: "Quit", action: async () => process.exit(0) }
3246
3253
  ];
3247
3254
  for (const choice2 of choices) {
3248
3255
  console.log(` ${chalk5.cyan(choice2.key)}) ${choice2.label}`);
3249
3256
  }
3257
+ console.log(chalk5.dim(' (Type "upgrade" or "help" anytime)'));
3250
3258
  console.log();
3251
- const selected = await prompt("Enter choice");
3259
+ const selected = await promptWithCommands("Enter choice");
3252
3260
  const choice = choices.find((c) => c.key === selected.toLowerCase());
3253
3261
  if (choice) {
3254
3262
  await choice.action();
@@ -3289,7 +3297,7 @@ async function listAtoms() {
3289
3297
  async function executeNext() {
3290
3298
  const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-67BMJFES.js");
3291
3299
  const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-X6LHSHBJ.js");
3292
- const { loadExecutionPreferences } = await import("./preferences-6J2UVWLQ.js");
3300
+ const { loadExecutionPreferences } = await import("./preferences-5E5XUH2E.js");
3293
3301
  const cwd = process.cwd();
3294
3302
  const atoms = await listLocalAtoms2();
3295
3303
  const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
@@ -3322,7 +3330,7 @@ async function executeNext() {
3322
3330
  const atomId = await prompt("Enter atom ID to execute (or press Enter for first pending)");
3323
3331
  const targetId = atomId.trim() || pendingAtoms[0]?.id;
3324
3332
  if (targetId) {
3325
- const { execute: execute2 } = await import("./execute-WRRTXCHG.js");
3333
+ const { execute: execute2 } = await import("./execute-2R32XWT5.js");
3326
3334
  await execute2(targetId, {});
3327
3335
  } else {
3328
3336
  console.log(chalk5.yellow("No atom to execute."));
@@ -3336,11 +3344,11 @@ async function reportBug() {
3336
3344
  }
3337
3345
  }
3338
3346
  async function viewStatus() {
3339
- const { status: status2 } = await import("./auth-ZWXKMI3Q.js");
3347
+ const { status: status2 } = await import("./auth-277GWFW4.js");
3340
3348
  await status2();
3341
3349
  }
3342
3350
  async function settingsMenu() {
3343
- const { interactiveSettings } = await import("./preferences-6J2UVWLQ.js");
3351
+ const { interactiveSettings } = await import("./preferences-5E5XUH2E.js");
3344
3352
  await interactiveSettings();
3345
3353
  await showMainMenu();
3346
3354
  }
@@ -3396,6 +3404,40 @@ async function reviewCode() {
3396
3404
  }
3397
3405
  await reviewCode();
3398
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-X52UG44Y.js");
3411
+ await showUpgradeMenu();
3412
+ return true;
3413
+ }
3414
+ if (normalized === "status" || normalized === "archon status") {
3415
+ const { status: status2 } = await import("./auth-277GWFW4.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
+ }
3399
3441
  function prompt(question) {
3400
3442
  return new Promise((resolve) => {
3401
3443
  const rl = readline.createInterface({
@@ -3408,6 +3450,16 @@ function prompt(question) {
3408
3450
  });
3409
3451
  });
3410
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
+ }
3411
3463
  function promptYesNo(question, defaultValue) {
3412
3464
  return new Promise((resolve) => {
3413
3465
  const rl = readline.createInterface({
@@ -7473,11 +7525,11 @@ program.command("status").description("Show current user and project status").ac
7473
7525
  await status();
7474
7526
  });
7475
7527
  program.command("upgrade").description("Upgrade your tier (BYOK for free unlimited, or Managed plan)").action(async () => {
7476
- const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
7528
+ const { showUpgradeMenu } = await import("./tier-selection-X52UG44Y.js");
7477
7529
  await showUpgradeMenu();
7478
7530
  });
7479
7531
  program.command("pricing", { hidden: true }).action(async () => {
7480
- const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
7532
+ const { showUpgradeMenu } = await import("./tier-selection-X52UG44Y.js");
7481
7533
  await showUpgradeMenu();
7482
7534
  });
7483
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) => {
@@ -7,12 +7,12 @@ import {
7
7
  setPreference,
8
8
  showExecutionPreferences,
9
9
  showPreferences
10
- } from "./chunk-ZCWCSRCQ.js";
10
+ } from "./chunk-7INSG7ZE.js";
11
11
  import "./chunk-QN65APWL.js";
12
- import "./chunk-IA3ENLBQ.js";
13
- import "./chunk-UG5MAS4X.js";
14
- import "./chunk-Y7DQ5XTU.js";
12
+ import "./chunk-GVIS5PHD.js";
15
13
  import "./chunk-M4LGRTLC.js";
14
+ import "./chunk-XMQIIPTU.js";
15
+ import "./chunk-Y7DQ5XTU.js";
16
16
  import "./chunk-WH6IKTYF.js";
17
17
  import "./chunk-QGM4M3NI.js";
18
18
  export {
@@ -4,9 +4,8 @@ import {
4
4
  showTierSwitchMenu,
5
5
  showUpgradeMenu,
6
6
  updateUserTier
7
- } from "./chunk-UG5MAS4X.js";
7
+ } from "./chunk-XMQIIPTU.js";
8
8
  import "./chunk-Y7DQ5XTU.js";
9
- import "./chunk-M4LGRTLC.js";
10
9
  import "./chunk-QGM4M3NI.js";
11
10
  export {
12
11
  handleTierSetup,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archondev",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
4
4
  "description": "Local-first AI-powered development governance system",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -8,14 +8,14 @@ import {
8
8
  AnthropicClient,
9
9
  getDefaultModel
10
10
  } from "./chunk-PQQ6SP4D.js";
11
- import {
12
- getAuthToken,
13
- loadConfig
14
- } from "./chunk-Y7DQ5XTU.js";
15
11
  import {
16
12
  SUPABASE_ANON_KEY,
17
13
  SUPABASE_URL
18
14
  } from "./chunk-M4LGRTLC.js";
15
+ import {
16
+ getAuthToken,
17
+ loadConfig
18
+ } from "./chunk-Y7DQ5XTU.js";
19
19
  import {
20
20
  ArchitectureParser
21
21
  } from "./chunk-5EVHUDQX.js";