archondev 2.8.2 → 2.8.4
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/{auth-FMUYA7AY.js → auth-2LHKBEIA.js} +2 -2
- package/dist/{chunk-NLH6DN6S.js → chunk-SWTCJSCA.js} +1 -1
- package/dist/{chunk-H42IQKPJ.js → chunk-VX63Y6PC.js} +1 -1
- package/dist/{chunk-BFN2CKY5.js → chunk-XU25OCAE.js} +66 -8
- package/dist/index.js +11 -11
- package/dist/{preferences-AWXFBFKT.js → preferences-XC5M3W6H.js} +3 -3
- package/dist/{tier-selection-274IVLWI.js → tier-selection-ITJBTLTH.js} +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
login,
|
|
3
3
|
logout,
|
|
4
4
|
status
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VX63Y6PC.js";
|
|
6
6
|
import "./chunk-M4LGRTLC.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XU25OCAE.js";
|
|
8
8
|
import "./chunk-SVU7MLG6.js";
|
|
9
9
|
import "./chunk-QGM4M3NI.js";
|
|
10
10
|
export {
|
|
@@ -35,6 +35,37 @@ var TIER_INFO = {
|
|
|
35
35
|
cost: "10% service fee on AI costs"
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
async function offerReauthentication(reason) {
|
|
39
|
+
console.log();
|
|
40
|
+
console.log(chalk.yellow(`\u26A0\uFE0F ${reason}`));
|
|
41
|
+
const reauth = await promptYesNoInternal("Would you like to log in again now?", true);
|
|
42
|
+
if (!reauth) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
console.log();
|
|
46
|
+
const { login } = await import("./auth-2LHKBEIA.js");
|
|
47
|
+
await login();
|
|
48
|
+
const { loadConfig: reload } = await import("./config-BBQW726O.js");
|
|
49
|
+
const config = await reload();
|
|
50
|
+
return !!(config && config.accessToken);
|
|
51
|
+
}
|
|
52
|
+
function promptYesNoInternal(question, defaultValue) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
const rl = readline.createInterface({
|
|
55
|
+
input: process.stdin,
|
|
56
|
+
output: process.stdout
|
|
57
|
+
});
|
|
58
|
+
const hint = defaultValue ? "(Y/n)" : "(y/N)";
|
|
59
|
+
rl.question(`${chalk.cyan("?")} ${question} ${hint}: `, (answer) => {
|
|
60
|
+
rl.close();
|
|
61
|
+
if (answer.trim() === "") {
|
|
62
|
+
resolve(defaultValue);
|
|
63
|
+
} else {
|
|
64
|
+
resolve(answer.toLowerCase().startsWith("y"));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
38
69
|
async function promptTierSelection() {
|
|
39
70
|
console.log();
|
|
40
71
|
console.log(chalk.bold("\u{1F389} Welcome to ArchonDev!"));
|
|
@@ -110,11 +141,21 @@ async function handleTierSetup(tier) {
|
|
|
110
141
|
async function createCheckoutSession(amountCents) {
|
|
111
142
|
const spinner = ora("Preparing checkout...").start();
|
|
112
143
|
try {
|
|
113
|
-
const { ensureValidSession } = await import("./config-BBQW726O.js");
|
|
114
|
-
|
|
144
|
+
const { ensureValidSession, loadConfig: loadConfig2 } = await import("./config-BBQW726O.js");
|
|
145
|
+
let config = await ensureValidSession();
|
|
115
146
|
if (!config || !config.accessToken || !config.userId) {
|
|
116
|
-
spinner.
|
|
117
|
-
|
|
147
|
+
spinner.stop();
|
|
148
|
+
const reauth = await offerReauthentication("Your session has expired.");
|
|
149
|
+
if (!reauth) {
|
|
150
|
+
console.log(chalk.dim("Checkout cancelled."));
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
config = await loadConfig2();
|
|
154
|
+
if (!config || !config.accessToken || !config.userId) {
|
|
155
|
+
console.log(chalk.red("Authentication failed."));
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
spinner.start("Preparing checkout...");
|
|
118
159
|
}
|
|
119
160
|
const apiUrl = getApiUrl(config);
|
|
120
161
|
const response = await fetch(`${apiUrl}/api/checkout`, {
|
|
@@ -129,7 +170,12 @@ async function createCheckoutSession(amountCents) {
|
|
|
129
170
|
})
|
|
130
171
|
});
|
|
131
172
|
if (response.status === 401) {
|
|
132
|
-
spinner.
|
|
173
|
+
spinner.stop();
|
|
174
|
+
const reauth = await offerReauthentication("Your session has expired.");
|
|
175
|
+
if (reauth) {
|
|
176
|
+
return createCheckoutSession(amountCents);
|
|
177
|
+
}
|
|
178
|
+
console.log(chalk.dim("Checkout cancelled."));
|
|
133
179
|
return null;
|
|
134
180
|
}
|
|
135
181
|
const result = await response.json();
|
|
@@ -230,9 +276,17 @@ var showTierSwitchMenu = showUpgradeMenu;
|
|
|
230
276
|
async function updateUserTier(tier) {
|
|
231
277
|
try {
|
|
232
278
|
const { ensureValidSession } = await import("./config-BBQW726O.js");
|
|
233
|
-
|
|
279
|
+
let config = await ensureValidSession();
|
|
234
280
|
if (!config || !config.accessToken) {
|
|
235
|
-
|
|
281
|
+
const reauth = await offerReauthentication("Your session has expired.");
|
|
282
|
+
if (!reauth) {
|
|
283
|
+
return { success: false, error: "Authentication required to update tier." };
|
|
284
|
+
}
|
|
285
|
+
const { loadConfig: reload } = await import("./config-BBQW726O.js");
|
|
286
|
+
config = await reload();
|
|
287
|
+
if (!config || !config.accessToken) {
|
|
288
|
+
return { success: false, error: "Authentication failed." };
|
|
289
|
+
}
|
|
236
290
|
}
|
|
237
291
|
const apiUrl = getApiUrl(config);
|
|
238
292
|
const response = await fetch(`${apiUrl}/api/preferences`, {
|
|
@@ -246,7 +300,11 @@ async function updateUserTier(tier) {
|
|
|
246
300
|
if (!response.ok) {
|
|
247
301
|
const data = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
248
302
|
if (response.status === 401) {
|
|
249
|
-
|
|
303
|
+
const reauth = await offerReauthentication("Your session has expired.");
|
|
304
|
+
if (reauth) {
|
|
305
|
+
return updateUserTier(tier);
|
|
306
|
+
}
|
|
307
|
+
return { success: false, error: "Authentication required to update tier." };
|
|
250
308
|
}
|
|
251
309
|
return { success: false, error: data.error || `Server error: ${response.status}` };
|
|
252
310
|
}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
setPreference,
|
|
19
19
|
showExecutionPreferences,
|
|
20
20
|
showPreferences
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SWTCJSCA.js";
|
|
22
22
|
import {
|
|
23
23
|
parallelClean,
|
|
24
24
|
parallelMerge,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
login,
|
|
63
63
|
logout,
|
|
64
64
|
status
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-VX63Y6PC.js";
|
|
66
66
|
import {
|
|
67
67
|
API_URL,
|
|
68
68
|
SUPABASE_ANON_KEY,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
handleTierSetup,
|
|
73
73
|
promptTierSelection,
|
|
74
74
|
updateUserTier
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-XU25OCAE.js";
|
|
76
76
|
import {
|
|
77
77
|
getAuthToken,
|
|
78
78
|
loadConfig,
|
|
@@ -3245,7 +3245,7 @@ async function showMainMenu() {
|
|
|
3245
3245
|
{ key: "6", label: "Code Review", action: () => reviewCode() },
|
|
3246
3246
|
{ key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
|
|
3247
3247
|
{ key: "8", label: "Upgrade tier", action: async () => {
|
|
3248
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
3248
|
+
const { showUpgradeMenu } = await import("./tier-selection-ITJBTLTH.js");
|
|
3249
3249
|
await showUpgradeMenu();
|
|
3250
3250
|
await showMainMenu();
|
|
3251
3251
|
} },
|
|
@@ -3297,7 +3297,7 @@ async function listAtoms() {
|
|
|
3297
3297
|
async function executeNext() {
|
|
3298
3298
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-UZNWCUQI.js");
|
|
3299
3299
|
const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-X6LHSHBJ.js");
|
|
3300
|
-
const { loadExecutionPreferences } = await import("./preferences-
|
|
3300
|
+
const { loadExecutionPreferences } = await import("./preferences-XC5M3W6H.js");
|
|
3301
3301
|
const cwd = process.cwd();
|
|
3302
3302
|
const atoms = await listLocalAtoms2();
|
|
3303
3303
|
const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
|
|
@@ -3344,11 +3344,11 @@ async function reportBug() {
|
|
|
3344
3344
|
}
|
|
3345
3345
|
}
|
|
3346
3346
|
async function viewStatus() {
|
|
3347
|
-
const { status: status2 } = await import("./auth-
|
|
3347
|
+
const { status: status2 } = await import("./auth-2LHKBEIA.js");
|
|
3348
3348
|
await status2();
|
|
3349
3349
|
}
|
|
3350
3350
|
async function settingsMenu() {
|
|
3351
|
-
const { interactiveSettings } = await import("./preferences-
|
|
3351
|
+
const { interactiveSettings } = await import("./preferences-XC5M3W6H.js");
|
|
3352
3352
|
await interactiveSettings();
|
|
3353
3353
|
await showMainMenu();
|
|
3354
3354
|
}
|
|
@@ -3407,12 +3407,12 @@ async function reviewCode() {
|
|
|
3407
3407
|
async function handleInSessionCommand(input) {
|
|
3408
3408
|
const normalized = input.toLowerCase().trim();
|
|
3409
3409
|
if (normalized === "upgrade" || normalized === "archon upgrade" || normalized === "pricing" || normalized === "archon pricing") {
|
|
3410
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
3410
|
+
const { showUpgradeMenu } = await import("./tier-selection-ITJBTLTH.js");
|
|
3411
3411
|
await showUpgradeMenu();
|
|
3412
3412
|
return true;
|
|
3413
3413
|
}
|
|
3414
3414
|
if (normalized === "status" || normalized === "archon status") {
|
|
3415
|
-
const { status: status2 } = await import("./auth-
|
|
3415
|
+
const { status: status2 } = await import("./auth-2LHKBEIA.js");
|
|
3416
3416
|
await status2();
|
|
3417
3417
|
return true;
|
|
3418
3418
|
}
|
|
@@ -7525,11 +7525,11 @@ program.command("status").description("Show current user and project status").ac
|
|
|
7525
7525
|
await status();
|
|
7526
7526
|
});
|
|
7527
7527
|
program.command("upgrade").description("Upgrade your tier (BYOK for free unlimited, or Managed plan)").action(async () => {
|
|
7528
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
7528
|
+
const { showUpgradeMenu } = await import("./tier-selection-ITJBTLTH.js");
|
|
7529
7529
|
await showUpgradeMenu();
|
|
7530
7530
|
});
|
|
7531
7531
|
program.command("pricing", { hidden: true }).action(async () => {
|
|
7532
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
7532
|
+
const { showUpgradeMenu } = await import("./tier-selection-ITJBTLTH.js");
|
|
7533
7533
|
await showUpgradeMenu();
|
|
7534
7534
|
});
|
|
7535
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,11 +7,11 @@ import {
|
|
|
7
7
|
setPreference,
|
|
8
8
|
showExecutionPreferences,
|
|
9
9
|
showPreferences
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SWTCJSCA.js";
|
|
11
11
|
import "./chunk-QN65APWL.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-VX63Y6PC.js";
|
|
13
13
|
import "./chunk-M4LGRTLC.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-XU25OCAE.js";
|
|
15
15
|
import "./chunk-SVU7MLG6.js";
|
|
16
16
|
import "./chunk-WH6IKTYF.js";
|
|
17
17
|
import "./chunk-QGM4M3NI.js";
|