archondev 2.5.0 → 2.7.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.
- package/dist/{auth-5BOORBOL.js → auth-ZWXKMI3Q.js} +2 -2
- package/dist/{chunk-SGGLAY6G.js → chunk-IA3ENLBQ.js} +1 -1
- package/dist/{chunk-DHGQPKIV.js → chunk-UG5MAS4X.js} +64 -28
- package/dist/{chunk-ZP75P65T.js → chunk-ZCWCSRCQ.js} +1 -1
- package/dist/index.js +138 -107
- package/dist/{preferences-DRR4A76D.js → preferences-6J2UVWLQ.js} +3 -3
- package/dist/{tier-selection-YPES45QY.js → tier-selection-LQ7ZOBEK.js} +3 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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("
|
|
148
|
+
console.log(chalk.bold("ARCHONDEV UPGRADE OPTIONS"));
|
|
149
149
|
console.log();
|
|
150
|
-
console.log(
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
175
|
-
|
|
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 (
|
|
180
|
-
console.log(chalk.dim("Already using this
|
|
213
|
+
if (selectedTier === currentTier) {
|
|
214
|
+
console.log(chalk.dim("Already using this tier."));
|
|
181
215
|
return;
|
|
182
216
|
}
|
|
183
|
-
const spinner = ora(`Switching to ${
|
|
184
|
-
const result = await updateUserTier(
|
|
217
|
+
const spinner = ora(`Switching to ${selectedName}...`).start();
|
|
218
|
+
const result = await updateUserTier(selectedTier);
|
|
185
219
|
if (result.success) {
|
|
186
|
-
spinner.succeed(chalk.green(
|
|
187
|
-
await handleTierSetup(
|
|
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
|
};
|
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-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-
|
|
65
|
+
} from "./chunk-IA3ENLBQ.js";
|
|
66
66
|
import {
|
|
67
67
|
handleTierSetup,
|
|
68
68
|
promptTierSelection,
|
|
69
69
|
updateUserTier
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-UG5MAS4X.js";
|
|
71
71
|
import {
|
|
72
72
|
getAuthToken,
|
|
73
73
|
loadConfig,
|
|
@@ -311,7 +311,7 @@ function formatDateTime(date) {
|
|
|
311
311
|
// src/cli/start.ts
|
|
312
312
|
import chalk5 from "chalk";
|
|
313
313
|
import readline from "readline";
|
|
314
|
-
import { existsSync as
|
|
314
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2, readdirSync as readdirSync2, appendFileSync } from "fs";
|
|
315
315
|
import { join as join5 } from "path";
|
|
316
316
|
|
|
317
317
|
// src/core/context/manager.ts
|
|
@@ -880,21 +880,37 @@ async function runAutoCleanupCheck(cwd) {
|
|
|
880
880
|
|
|
881
881
|
// src/cli/update-check.ts
|
|
882
882
|
import chalk4 from "chalk";
|
|
883
|
-
import { readFileSync } from "fs";
|
|
883
|
+
import { readFileSync, existsSync as existsSync4 } from "fs";
|
|
884
884
|
import { join as join4, dirname as dirname3 } from "path";
|
|
885
885
|
import { fileURLToPath } from "url";
|
|
886
|
+
import { execSync as execSync2 } from "child_process";
|
|
886
887
|
var __dirname = dirname3(fileURLToPath(import.meta.url));
|
|
887
888
|
var UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
888
889
|
function getCurrentVersion() {
|
|
890
|
+
try {
|
|
891
|
+
const result = execSync2("npm list -g archondev --depth=0 --json 2>/dev/null", {
|
|
892
|
+
encoding: "utf-8",
|
|
893
|
+
timeout: 3e3,
|
|
894
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
895
|
+
});
|
|
896
|
+
const data = JSON.parse(result);
|
|
897
|
+
if (data.dependencies?.archondev?.version) {
|
|
898
|
+
return data.dependencies.archondev.version;
|
|
899
|
+
}
|
|
900
|
+
} catch {
|
|
901
|
+
}
|
|
889
902
|
try {
|
|
890
903
|
const paths = [
|
|
904
|
+
// From dist/ (when bundled - tsup puts files in dist/)
|
|
905
|
+
join4(__dirname, "package.json"),
|
|
906
|
+
join4(__dirname, "..", "package.json"),
|
|
907
|
+
// From dist/cli/ or src/cli/
|
|
891
908
|
join4(__dirname, "..", "..", "package.json"),
|
|
892
|
-
// from dist/
|
|
893
909
|
join4(__dirname, "..", "..", "..", "package.json")
|
|
894
|
-
// from src/cli/
|
|
895
910
|
];
|
|
896
911
|
for (const pkgPath of paths) {
|
|
897
912
|
try {
|
|
913
|
+
if (!existsSync4(pkgPath)) continue;
|
|
898
914
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
899
915
|
if (pkg.name === "archondev" && pkg.version) {
|
|
900
916
|
return pkg.version;
|
|
@@ -903,10 +919,9 @@ function getCurrentVersion() {
|
|
|
903
919
|
continue;
|
|
904
920
|
}
|
|
905
921
|
}
|
|
906
|
-
return "0.0.0";
|
|
907
922
|
} catch {
|
|
908
|
-
return "0.0.0";
|
|
909
923
|
}
|
|
924
|
+
return "0.0.0";
|
|
910
925
|
}
|
|
911
926
|
async function fetchLatestVersion() {
|
|
912
927
|
try {
|
|
@@ -2581,7 +2596,7 @@ async function start(options = {}) {
|
|
|
2581
2596
|
}
|
|
2582
2597
|
}
|
|
2583
2598
|
if (!config.tier || config.tier === "FREE") {
|
|
2584
|
-
const isFirstRun = !
|
|
2599
|
+
const isFirstRun = !existsSync5(join5(cwd, ".archon")) && !existsSync5(join5(cwd, "ARCHITECTURE.md"));
|
|
2585
2600
|
if (isFirstRun && !config.tierConfirmed) {
|
|
2586
2601
|
console.log(chalk5.bold("How would you like to use ArchonDev?\n"));
|
|
2587
2602
|
const selection = await promptTierSelection();
|
|
@@ -2599,11 +2614,23 @@ async function start(options = {}) {
|
|
|
2599
2614
|
} else {
|
|
2600
2615
|
config.tierConfirmed = true;
|
|
2601
2616
|
await saveConfig(config);
|
|
2602
|
-
console.log(chalk5.dim("Using Free tier. You can
|
|
2617
|
+
console.log(chalk5.dim("Using Free tier. You can upgrade anytime with `archon upgrade`\n"));
|
|
2603
2618
|
}
|
|
2604
2619
|
}
|
|
2605
2620
|
}
|
|
2606
|
-
|
|
2621
|
+
if (config.email) {
|
|
2622
|
+
console.log(chalk5.dim(`Logged in as: ${config.email}`));
|
|
2623
|
+
}
|
|
2624
|
+
const currentTier = config.tier || "FREE";
|
|
2625
|
+
const tierDisplay = formatTierName(currentTier);
|
|
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
|
+
}
|
|
2607
2634
|
console.log();
|
|
2608
2635
|
const updateResult = await updateCheckPromise;
|
|
2609
2636
|
if (updateResult?.hasUpdate) {
|
|
@@ -2689,7 +2716,7 @@ function detectProjectState(cwd) {
|
|
|
2689
2716
|
const sourceExtensions = [".ts", ".tsx", ".js", ".jsx", ".py", ".go", ".rs", ".java", ".rb", ".php"];
|
|
2690
2717
|
let hasSourceFiles = false;
|
|
2691
2718
|
for (const dir of sourceDirs) {
|
|
2692
|
-
if (
|
|
2719
|
+
if (existsSync5(join5(cwd, dir))) {
|
|
2693
2720
|
hasSourceFiles = true;
|
|
2694
2721
|
break;
|
|
2695
2722
|
}
|
|
@@ -2705,11 +2732,11 @@ function detectProjectState(cwd) {
|
|
|
2705
2732
|
}
|
|
2706
2733
|
const projectMarkers = ["package.json", "Cargo.toml", "pyproject.toml", "go.mod", "pom.xml", "build.gradle"];
|
|
2707
2734
|
if (!hasSourceFiles) {
|
|
2708
|
-
hasSourceFiles = projectMarkers.some((marker) =>
|
|
2735
|
+
hasSourceFiles = projectMarkers.some((marker) => existsSync5(join5(cwd, marker)));
|
|
2709
2736
|
}
|
|
2710
|
-
const hasArchitecture =
|
|
2711
|
-
const hasProgress =
|
|
2712
|
-
const hasReviewDb =
|
|
2737
|
+
const hasArchitecture = existsSync5(join5(cwd, "ARCHITECTURE.md"));
|
|
2738
|
+
const hasProgress = existsSync5(join5(cwd, "progress.txt"));
|
|
2739
|
+
const hasReviewDb = existsSync5(join5(cwd, "docs", "code-review", "review-tasks.db"));
|
|
2713
2740
|
let hasProgressEntries = false;
|
|
2714
2741
|
let lastProgressEntry;
|
|
2715
2742
|
if (hasProgress) {
|
|
@@ -2754,7 +2781,7 @@ async function gatherGovernanceStatus(cwd) {
|
|
|
2754
2781
|
pendingAtomsCount: 0
|
|
2755
2782
|
};
|
|
2756
2783
|
const archPath = join5(cwd, "ARCHITECTURE.md");
|
|
2757
|
-
if (
|
|
2784
|
+
if (existsSync5(archPath)) {
|
|
2758
2785
|
const parser = new ArchitectureParser(archPath);
|
|
2759
2786
|
const result = await parser.parse();
|
|
2760
2787
|
if (result.success && result.schema) {
|
|
@@ -2772,7 +2799,7 @@ async function gatherGovernanceStatus(cwd) {
|
|
|
2772
2799
|
}
|
|
2773
2800
|
}
|
|
2774
2801
|
const progressPath = join5(cwd, "progress.txt");
|
|
2775
|
-
if (
|
|
2802
|
+
if (existsSync5(progressPath)) {
|
|
2776
2803
|
try {
|
|
2777
2804
|
const content = readFileSync2(progressPath, "utf-8");
|
|
2778
2805
|
const dateMatches = content.match(/^## (\d{4}-\d{2}-\d{2})/gm);
|
|
@@ -2787,7 +2814,7 @@ async function gatherGovernanceStatus(cwd) {
|
|
|
2787
2814
|
}
|
|
2788
2815
|
}
|
|
2789
2816
|
const atomsDir = join5(cwd, ".archon", "atoms");
|
|
2790
|
-
if (
|
|
2817
|
+
if (existsSync5(atomsDir)) {
|
|
2791
2818
|
try {
|
|
2792
2819
|
const files = readdirSync2(atomsDir);
|
|
2793
2820
|
status2.pendingAtomsCount = files.filter((f) => f.endsWith(".yaml") || f.endsWith(".yml")).length;
|
|
@@ -3009,7 +3036,7 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3009
3036
|
- Ready for first atom
|
|
3010
3037
|
`;
|
|
3011
3038
|
const progressPath = join5(cwd, "progress.txt");
|
|
3012
|
-
if (!
|
|
3039
|
+
if (!existsSync5(progressPath)) {
|
|
3013
3040
|
const { writeFileSync: writeFileSync2 } = await import("fs");
|
|
3014
3041
|
writeFileSync2(progressPath, "# ArchonDev Progress Log\n\nThis file tracks learnings and decisions across sessions.\n");
|
|
3015
3042
|
}
|
|
@@ -3039,7 +3066,7 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3039
3066
|
async function quickStart(cwd) {
|
|
3040
3067
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
3041
3068
|
const progressPath = join5(cwd, "progress.txt");
|
|
3042
|
-
if (!
|
|
3069
|
+
if (!existsSync5(progressPath)) {
|
|
3043
3070
|
const { writeFileSync: writeFileSync2 } = await import("fs");
|
|
3044
3071
|
writeFileSync2(progressPath, `# ArchonDev Progress Log
|
|
3045
3072
|
|
|
@@ -3098,7 +3125,7 @@ async function analyzeAndAdapt(cwd) {
|
|
|
3098
3125
|
await init2({ analyze: true, git: true });
|
|
3099
3126
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
3100
3127
|
const progressPath = join5(cwd, "progress.txt");
|
|
3101
|
-
if (!
|
|
3128
|
+
if (!existsSync5(progressPath)) {
|
|
3102
3129
|
const { writeFileSync: writeFileSync2 } = await import("fs");
|
|
3103
3130
|
writeFileSync2(progressPath, "# ArchonDev Progress Log\n\nThis file tracks learnings and decisions across sessions.\n");
|
|
3104
3131
|
}
|
|
@@ -3123,7 +3150,7 @@ async function codeReviewFirst(cwd) {
|
|
|
3123
3150
|
console.log(chalk5.dim("I'll analyze your code for issues without making any changes.\n"));
|
|
3124
3151
|
const { reviewInit: reviewInit2, reviewAnalyze: reviewAnalyze2, reviewRun: reviewRun2 } = await import("./review-XDUNVTOK.js");
|
|
3125
3152
|
const reviewDbPath = join5(cwd, "docs", "code-review", "review-tasks.db");
|
|
3126
|
-
if (!
|
|
3153
|
+
if (!existsSync5(reviewDbPath)) {
|
|
3127
3154
|
await reviewInit2();
|
|
3128
3155
|
}
|
|
3129
3156
|
await reviewAnalyze2();
|
|
@@ -3151,7 +3178,7 @@ async function quickAdapt(cwd) {
|
|
|
3151
3178
|
await init2({ analyze: true, git: true });
|
|
3152
3179
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
3153
3180
|
const progressPath = join5(cwd, "progress.txt");
|
|
3154
|
-
if (!
|
|
3181
|
+
if (!existsSync5(progressPath)) {
|
|
3155
3182
|
const { writeFileSync: writeFileSync2 } = await import("fs");
|
|
3156
3183
|
writeFileSync2(progressPath, "# ArchonDev Progress Log\n\nThis file tracks learnings and decisions across sessions.\n");
|
|
3157
3184
|
}
|
|
@@ -3189,7 +3216,7 @@ async function handleContinueSession(cwd, state) {
|
|
|
3189
3216
|
function checkForHandoff(cwd) {
|
|
3190
3217
|
try {
|
|
3191
3218
|
const progressPath = join5(cwd, "progress.txt");
|
|
3192
|
-
if (!
|
|
3219
|
+
if (!existsSync5(progressPath)) return null;
|
|
3193
3220
|
const content = readFileSync2(progressPath, "utf-8");
|
|
3194
3221
|
const handoffMatch = content.match(/## Context Handoff[^\n]*\n([\s\S]*?)(?=\n## |\n*$)/);
|
|
3195
3222
|
if (handoffMatch && handoffMatch[1]) {
|
|
@@ -3262,7 +3289,7 @@ async function listAtoms() {
|
|
|
3262
3289
|
async function executeNext() {
|
|
3263
3290
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-67BMJFES.js");
|
|
3264
3291
|
const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-X6LHSHBJ.js");
|
|
3265
|
-
const { loadExecutionPreferences } = await import("./preferences-
|
|
3292
|
+
const { loadExecutionPreferences } = await import("./preferences-6J2UVWLQ.js");
|
|
3266
3293
|
const cwd = process.cwd();
|
|
3267
3294
|
const atoms = await listLocalAtoms2();
|
|
3268
3295
|
const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
|
|
@@ -3309,18 +3336,18 @@ async function reportBug() {
|
|
|
3309
3336
|
}
|
|
3310
3337
|
}
|
|
3311
3338
|
async function viewStatus() {
|
|
3312
|
-
const { status: status2 } = await import("./auth-
|
|
3339
|
+
const { status: status2 } = await import("./auth-ZWXKMI3Q.js");
|
|
3313
3340
|
await status2();
|
|
3314
3341
|
}
|
|
3315
3342
|
async function settingsMenu() {
|
|
3316
|
-
const { interactiveSettings } = await import("./preferences-
|
|
3343
|
+
const { interactiveSettings } = await import("./preferences-6J2UVWLQ.js");
|
|
3317
3344
|
await interactiveSettings();
|
|
3318
3345
|
await showMainMenu();
|
|
3319
3346
|
}
|
|
3320
3347
|
async function reviewCode() {
|
|
3321
3348
|
const cwd = process.cwd();
|
|
3322
3349
|
const reviewDbPath = join5(cwd, "docs", "code-review", "review-tasks.db");
|
|
3323
|
-
if (!
|
|
3350
|
+
if (!existsSync5(reviewDbPath)) {
|
|
3324
3351
|
console.log(chalk5.dim("Code review not initialized. Starting setup...\n"));
|
|
3325
3352
|
const { reviewInit: reviewInit2 } = await import("./review-XDUNVTOK.js");
|
|
3326
3353
|
await reviewInit2();
|
|
@@ -3996,7 +4023,7 @@ async function watch() {
|
|
|
3996
4023
|
import { Command } from "commander";
|
|
3997
4024
|
import chalk7 from "chalk";
|
|
3998
4025
|
import { readFile as readFile4, writeFile as writeFile4 } from "fs/promises";
|
|
3999
|
-
import { existsSync as
|
|
4026
|
+
import { existsSync as existsSync7 } from "fs";
|
|
4000
4027
|
var DEPENDENCIES_FILENAME = "DEPENDENCIES.md";
|
|
4001
4028
|
function createDepsCommand() {
|
|
4002
4029
|
const deps = new Command("deps").description("Manage file-level dependencies (DEPENDENCIES.md)").addHelpText(
|
|
@@ -4146,7 +4173,7 @@ ${yaml3}---${markdownBody}`, "utf-8");
|
|
|
4146
4173
|
}
|
|
4147
4174
|
});
|
|
4148
4175
|
deps.command("init").description("Create a starter DEPENDENCIES.md file").action(async () => {
|
|
4149
|
-
if (
|
|
4176
|
+
if (existsSync7(DEPENDENCIES_FILENAME)) {
|
|
4150
4177
|
console.log(chalk7.yellow("DEPENDENCIES.md already exists."));
|
|
4151
4178
|
return;
|
|
4152
4179
|
}
|
|
@@ -4233,7 +4260,7 @@ function generateYamlFrontmatter(rules) {
|
|
|
4233
4260
|
|
|
4234
4261
|
// src/cli/a11y.ts
|
|
4235
4262
|
import chalk8 from "chalk";
|
|
4236
|
-
import { existsSync as
|
|
4263
|
+
import { existsSync as existsSync8 } from "fs";
|
|
4237
4264
|
import { readFile as readFile5, writeFile as writeFile5, mkdir as mkdir3 } from "fs/promises";
|
|
4238
4265
|
import { join as join7 } from "path";
|
|
4239
4266
|
import { createInterface } from "readline";
|
|
@@ -4367,7 +4394,7 @@ async function a11yCheck(options) {
|
|
|
4367
4394
|
passed: issues.length === 0
|
|
4368
4395
|
};
|
|
4369
4396
|
const archonDir = join7(process.cwd(), ".archon");
|
|
4370
|
-
if (!
|
|
4397
|
+
if (!existsSync8(archonDir)) {
|
|
4371
4398
|
await mkdir3(archonDir, { recursive: true });
|
|
4372
4399
|
}
|
|
4373
4400
|
await writeFile5(join7(archonDir, "a11y-report.json"), JSON.stringify(report, null, 2));
|
|
@@ -4421,7 +4448,7 @@ async function a11yFix(options) {
|
|
|
4421
4448
|
try {
|
|
4422
4449
|
console.log(chalk8.blue("\n\u267F Accessibility Auto-Fix\n"));
|
|
4423
4450
|
const reportPath = join7(process.cwd(), ".archon/a11y-report.json");
|
|
4424
|
-
if (!
|
|
4451
|
+
if (!existsSync8(reportPath)) {
|
|
4425
4452
|
console.log(chalk8.yellow("No accessibility report found. Running check first...\n"));
|
|
4426
4453
|
await a11yCheck({});
|
|
4427
4454
|
}
|
|
@@ -4538,7 +4565,7 @@ async function a11yPreDeploy() {
|
|
|
4538
4565
|
console.log(chalk8.dim("Before deploying a live website, accessibility compliance is required.\n"));
|
|
4539
4566
|
await a11yCheck({});
|
|
4540
4567
|
const reportPath = join7(process.cwd(), ".archon/a11y-report.json");
|
|
4541
|
-
if (!
|
|
4568
|
+
if (!existsSync8(reportPath)) {
|
|
4542
4569
|
return false;
|
|
4543
4570
|
}
|
|
4544
4571
|
const reportContent = await readFile5(reportPath, "utf-8");
|
|
@@ -4576,7 +4603,7 @@ async function a11yPreDeploy() {
|
|
|
4576
4603
|
import { Command as Command2 } from "commander";
|
|
4577
4604
|
import chalk9 from "chalk";
|
|
4578
4605
|
import { readFile as readFile6, writeFile as writeFile6, mkdir as mkdir4 } from "fs/promises";
|
|
4579
|
-
import { existsSync as
|
|
4606
|
+
import { existsSync as existsSync9 } from "fs";
|
|
4580
4607
|
import { join as join8 } from "path";
|
|
4581
4608
|
import { createInterface as createInterface2 } from "readline";
|
|
4582
4609
|
import { glob as glob2 } from "glob";
|
|
@@ -4596,7 +4623,7 @@ function createPrompt2() {
|
|
|
4596
4623
|
}
|
|
4597
4624
|
async function loadGeoConfig(cwd) {
|
|
4598
4625
|
const configPath = join8(cwd, CONFIG_PATH2);
|
|
4599
|
-
if (!
|
|
4626
|
+
if (!existsSync9(configPath)) {
|
|
4600
4627
|
return {};
|
|
4601
4628
|
}
|
|
4602
4629
|
try {
|
|
@@ -4609,11 +4636,11 @@ async function loadGeoConfig(cwd) {
|
|
|
4609
4636
|
async function saveGeoConfig(cwd, config) {
|
|
4610
4637
|
const configPath = join8(cwd, CONFIG_PATH2);
|
|
4611
4638
|
const archonDir = join8(cwd, ".archon");
|
|
4612
|
-
if (!
|
|
4639
|
+
if (!existsSync9(archonDir)) {
|
|
4613
4640
|
await mkdir4(archonDir, { recursive: true });
|
|
4614
4641
|
}
|
|
4615
4642
|
let existing = {};
|
|
4616
|
-
if (
|
|
4643
|
+
if (existsSync9(configPath)) {
|
|
4617
4644
|
try {
|
|
4618
4645
|
const content = await readFile6(configPath, "utf-8");
|
|
4619
4646
|
existing = yaml2.parse(content);
|
|
@@ -4786,7 +4813,7 @@ async function geoSchema(options) {
|
|
|
4786
4813
|
let orgName = identityPhrase.split(" ").slice(0, 2).join(" ");
|
|
4787
4814
|
try {
|
|
4788
4815
|
const pkgPath = join8(cwd, "package.json");
|
|
4789
|
-
if (
|
|
4816
|
+
if (existsSync9(pkgPath)) {
|
|
4790
4817
|
const pkg = JSON.parse(await readFile6(pkgPath, "utf-8"));
|
|
4791
4818
|
if (pkg.name) {
|
|
4792
4819
|
orgName = pkg.name.replace(/-/g, " ").replace(/^\w/, (c) => c.toUpperCase());
|
|
@@ -5052,7 +5079,7 @@ Examples:
|
|
|
5052
5079
|
import { Command as Command3 } from "commander";
|
|
5053
5080
|
import chalk10 from "chalk";
|
|
5054
5081
|
import { readFile as readFile7, writeFile as writeFile7, mkdir as mkdir5 } from "fs/promises";
|
|
5055
|
-
import { existsSync as
|
|
5082
|
+
import { existsSync as existsSync10 } from "fs";
|
|
5056
5083
|
import { join as join9 } from "path";
|
|
5057
5084
|
import { createInterface as createInterface3 } from "readline";
|
|
5058
5085
|
import { glob as glob3 } from "glob";
|
|
@@ -5211,7 +5238,7 @@ async function seoCheck(options) {
|
|
|
5211
5238
|
`));
|
|
5212
5239
|
const issues = await scanForSeoIssues(files);
|
|
5213
5240
|
const archonDir = join9(process.cwd(), ".archon");
|
|
5214
|
-
if (!
|
|
5241
|
+
if (!existsSync10(archonDir)) {
|
|
5215
5242
|
await mkdir5(archonDir, { recursive: true });
|
|
5216
5243
|
}
|
|
5217
5244
|
const report = {
|
|
@@ -5265,7 +5292,7 @@ async function seoFix(options) {
|
|
|
5265
5292
|
try {
|
|
5266
5293
|
console.log(chalk10.blue("\n\u{1F527} SEO Auto-Fix\n"));
|
|
5267
5294
|
const reportPath = join9(process.cwd(), ".archon/seo-report.json");
|
|
5268
|
-
if (!
|
|
5295
|
+
if (!existsSync10(reportPath)) {
|
|
5269
5296
|
console.log(chalk10.yellow("No SEO report found. Running check first...\n"));
|
|
5270
5297
|
await seoCheck({});
|
|
5271
5298
|
}
|
|
@@ -5371,7 +5398,7 @@ async function seoOpenGraph(options) {
|
|
|
5371
5398
|
targetFile = fileChoice.startsWith("/") ? fileChoice : join9(process.cwd(), fileChoice);
|
|
5372
5399
|
}
|
|
5373
5400
|
}
|
|
5374
|
-
if (!
|
|
5401
|
+
if (!existsSync10(targetFile)) {
|
|
5375
5402
|
console.log(chalk10.red(`File not found: ${targetFile}`));
|
|
5376
5403
|
return;
|
|
5377
5404
|
}
|
|
@@ -5435,7 +5462,7 @@ async function seoTwitter(options) {
|
|
|
5435
5462
|
targetFile = fileChoice.startsWith("/") ? fileChoice : join9(process.cwd(), fileChoice);
|
|
5436
5463
|
}
|
|
5437
5464
|
}
|
|
5438
|
-
if (!
|
|
5465
|
+
if (!existsSync10(targetFile)) {
|
|
5439
5466
|
console.log(chalk10.red(`File not found: ${targetFile}`));
|
|
5440
5467
|
return;
|
|
5441
5468
|
}
|
|
@@ -5528,7 +5555,7 @@ import chalk11 from "chalk";
|
|
|
5528
5555
|
import ora2 from "ora";
|
|
5529
5556
|
import os from "os";
|
|
5530
5557
|
import { readFile as readFile8, writeFile as writeFile8 } from "fs/promises";
|
|
5531
|
-
import { existsSync as
|
|
5558
|
+
import { existsSync as existsSync11 } from "fs";
|
|
5532
5559
|
import { join as join10 } from "path";
|
|
5533
5560
|
import { createClient as createClient2 } from "@supabase/supabase-js";
|
|
5534
5561
|
function getSupabaseClient2(accessToken) {
|
|
@@ -5543,21 +5570,21 @@ async function getProjectInfo(cwd) {
|
|
|
5543
5570
|
const archonConfigPath = join10(cwd, ".archon", "config.yaml");
|
|
5544
5571
|
const packageJsonPath = join10(cwd, "package.json");
|
|
5545
5572
|
let projectName = "Unknown Project";
|
|
5546
|
-
if (
|
|
5573
|
+
if (existsSync11(packageJsonPath)) {
|
|
5547
5574
|
try {
|
|
5548
5575
|
const pkg = JSON.parse(await readFile8(packageJsonPath, "utf-8"));
|
|
5549
5576
|
projectName = pkg.name || projectName;
|
|
5550
5577
|
} catch {
|
|
5551
5578
|
}
|
|
5552
5579
|
}
|
|
5553
|
-
if (!
|
|
5580
|
+
if (!existsSync11(archonConfigPath)) {
|
|
5554
5581
|
return null;
|
|
5555
5582
|
}
|
|
5556
5583
|
return { name: projectName, path: cwd };
|
|
5557
5584
|
}
|
|
5558
5585
|
async function getCurrentAtomId(cwd) {
|
|
5559
5586
|
const stateFile = join10(cwd, ".archon", "state.json");
|
|
5560
|
-
if (!
|
|
5587
|
+
if (!existsSync11(stateFile)) return null;
|
|
5561
5588
|
try {
|
|
5562
5589
|
const state = JSON.parse(await readFile8(stateFile, "utf-8"));
|
|
5563
5590
|
return state.currentAtomId || null;
|
|
@@ -5567,7 +5594,7 @@ async function getCurrentAtomId(cwd) {
|
|
|
5567
5594
|
}
|
|
5568
5595
|
async function getPendingAtoms(cwd) {
|
|
5569
5596
|
const stateFile = join10(cwd, ".archon", "state.json");
|
|
5570
|
-
if (!
|
|
5597
|
+
if (!existsSync11(stateFile)) return [];
|
|
5571
5598
|
try {
|
|
5572
5599
|
const state = JSON.parse(await readFile8(stateFile, "utf-8"));
|
|
5573
5600
|
return state.pendingAtoms || [];
|
|
@@ -5576,7 +5603,7 @@ async function getPendingAtoms(cwd) {
|
|
|
5576
5603
|
}
|
|
5577
5604
|
}
|
|
5578
5605
|
async function getFileContent(path2) {
|
|
5579
|
-
if (!
|
|
5606
|
+
if (!existsSync11(path2)) return null;
|
|
5580
5607
|
try {
|
|
5581
5608
|
return await readFile8(path2, "utf-8");
|
|
5582
5609
|
} catch {
|
|
@@ -5740,7 +5767,7 @@ async function syncSession() {
|
|
|
5740
5767
|
return;
|
|
5741
5768
|
}
|
|
5742
5769
|
const stateFile = join10(cwd, ".archon", "state.json");
|
|
5743
|
-
if (!
|
|
5770
|
+
if (!existsSync11(stateFile)) {
|
|
5744
5771
|
spinner.info("No active session to sync");
|
|
5745
5772
|
return;
|
|
5746
5773
|
}
|
|
@@ -5775,16 +5802,16 @@ async function syncSession() {
|
|
|
5775
5802
|
|
|
5776
5803
|
// src/cli/deploy.ts
|
|
5777
5804
|
import chalk12 from "chalk";
|
|
5778
|
-
import { existsSync as
|
|
5805
|
+
import { existsSync as existsSync12 } from "fs";
|
|
5779
5806
|
import { join as join11 } from "path";
|
|
5780
|
-
import { execSync as
|
|
5807
|
+
import { execSync as execSync3 } from "child_process";
|
|
5781
5808
|
function detectPlatform(cwd) {
|
|
5782
|
-
if (
|
|
5783
|
-
if (
|
|
5784
|
-
if (
|
|
5785
|
-
if (
|
|
5786
|
-
if (
|
|
5787
|
-
if (
|
|
5809
|
+
if (existsSync12(join11(cwd, "fly.toml"))) return "fly";
|
|
5810
|
+
if (existsSync12(join11(cwd, "vercel.json"))) return "vercel";
|
|
5811
|
+
if (existsSync12(join11(cwd, "netlify.toml"))) return "netlify";
|
|
5812
|
+
if (existsSync12(join11(cwd, "railway.json"))) return "railway";
|
|
5813
|
+
if (existsSync12(join11(cwd, "render.yaml"))) return "render";
|
|
5814
|
+
if (existsSync12(join11(cwd, "Dockerfile"))) return "fly";
|
|
5788
5815
|
return "unknown";
|
|
5789
5816
|
}
|
|
5790
5817
|
async function deploy(options) {
|
|
@@ -5799,23 +5826,23 @@ async function deploy(options) {
|
|
|
5799
5826
|
switch (platform) {
|
|
5800
5827
|
case "fly":
|
|
5801
5828
|
console.log(chalk12.blue("Deploying to Fly.io..."));
|
|
5802
|
-
|
|
5829
|
+
execSync3("fly deploy", { cwd, stdio: "inherit" });
|
|
5803
5830
|
break;
|
|
5804
5831
|
case "vercel": {
|
|
5805
5832
|
console.log(chalk12.blue("Deploying to Vercel..."));
|
|
5806
5833
|
const cmd = options.preview ? "vercel" : "vercel --prod";
|
|
5807
|
-
|
|
5834
|
+
execSync3(cmd, { cwd, stdio: "inherit" });
|
|
5808
5835
|
break;
|
|
5809
5836
|
}
|
|
5810
5837
|
case "netlify": {
|
|
5811
5838
|
console.log(chalk12.blue("Deploying to Netlify..."));
|
|
5812
5839
|
const netlifyCmd = options.preview ? "netlify deploy" : "netlify deploy --prod";
|
|
5813
|
-
|
|
5840
|
+
execSync3(netlifyCmd, { cwd, stdio: "inherit" });
|
|
5814
5841
|
break;
|
|
5815
5842
|
}
|
|
5816
5843
|
case "railway":
|
|
5817
5844
|
console.log(chalk12.blue("Deploying to Railway..."));
|
|
5818
|
-
|
|
5845
|
+
execSync3("railway up", { cwd, stdio: "inherit" });
|
|
5819
5846
|
break;
|
|
5820
5847
|
case "render":
|
|
5821
5848
|
console.log(chalk12.blue("Deploying to Render..."));
|
|
@@ -5831,7 +5858,7 @@ async function deploy(options) {
|
|
|
5831
5858
|
import chalk13 from "chalk";
|
|
5832
5859
|
|
|
5833
5860
|
// src/core/indexing/local.ts
|
|
5834
|
-
import { existsSync as
|
|
5861
|
+
import { existsSync as existsSync13, mkdirSync } from "fs";
|
|
5835
5862
|
import { readFile as readFile9 } from "fs/promises";
|
|
5836
5863
|
import { join as join12, extname } from "path";
|
|
5837
5864
|
import Database from "better-sqlite3";
|
|
@@ -5881,7 +5908,7 @@ var LocalIndexer = class {
|
|
|
5881
5908
|
}
|
|
5882
5909
|
async init(cwd) {
|
|
5883
5910
|
const archonDir = join12(cwd, ".archon");
|
|
5884
|
-
if (!
|
|
5911
|
+
if (!existsSync13(archonDir)) {
|
|
5885
5912
|
mkdirSync(archonDir, { recursive: true });
|
|
5886
5913
|
}
|
|
5887
5914
|
this.db = new Database(join12(cwd, this.config.dbPath));
|
|
@@ -5935,7 +5962,7 @@ var LocalIndexer = class {
|
|
|
5935
5962
|
return 0;
|
|
5936
5963
|
}
|
|
5937
5964
|
const fullPath = join12(cwd, filePath);
|
|
5938
|
-
if (!
|
|
5965
|
+
if (!existsSync13(fullPath)) {
|
|
5939
5966
|
return 0;
|
|
5940
5967
|
}
|
|
5941
5968
|
const content = await readFile9(fullPath, "utf-8");
|
|
@@ -6017,7 +6044,7 @@ var LocalIndexer = class {
|
|
|
6017
6044
|
// src/core/indexing/cloud.ts
|
|
6018
6045
|
import { createClient as createClient3 } from "@supabase/supabase-js";
|
|
6019
6046
|
import { readFile as readFile10 } from "fs/promises";
|
|
6020
|
-
import { existsSync as
|
|
6047
|
+
import { existsSync as existsSync14 } from "fs";
|
|
6021
6048
|
import { join as join13, extname as extname2 } from "path";
|
|
6022
6049
|
import { createHash as createHash2 } from "crypto";
|
|
6023
6050
|
var CHUNK_SIZE2 = 1e3;
|
|
@@ -6146,7 +6173,7 @@ var CloudIndexer = class {
|
|
|
6146
6173
|
return 0;
|
|
6147
6174
|
}
|
|
6148
6175
|
const fullPath = join13(cwd, filePath);
|
|
6149
|
-
if (!
|
|
6176
|
+
if (!existsSync14(fullPath)) {
|
|
6150
6177
|
return 0;
|
|
6151
6178
|
}
|
|
6152
6179
|
const content = await readFile10(fullPath, "utf-8");
|
|
@@ -6596,7 +6623,7 @@ async function githubDisconnect() {
|
|
|
6596
6623
|
import chalk15 from "chalk";
|
|
6597
6624
|
import readline2 from "readline";
|
|
6598
6625
|
import ora3 from "ora";
|
|
6599
|
-
import { existsSync as
|
|
6626
|
+
import { existsSync as existsSync15, readFileSync as readFileSync4, writeFileSync, mkdirSync as mkdirSync2 } from "fs";
|
|
6600
6627
|
import { join as join15 } from "path";
|
|
6601
6628
|
import { randomUUID } from "crypto";
|
|
6602
6629
|
function getConstitutionPath(cwd) {
|
|
@@ -6608,14 +6635,14 @@ function getDraftPath(cwd) {
|
|
|
6608
6635
|
async function interview(options = {}) {
|
|
6609
6636
|
const cwd = process.cwd();
|
|
6610
6637
|
const archonDir = join15(cwd, ".archon");
|
|
6611
|
-
if (!
|
|
6638
|
+
if (!existsSync15(archonDir)) {
|
|
6612
6639
|
mkdirSync2(archonDir, { recursive: true });
|
|
6613
6640
|
}
|
|
6614
6641
|
console.log(chalk15.bold("\n\u{1F3AF} ArchonDev Project Interview"));
|
|
6615
6642
|
console.log(chalk15.dim("Let's define what you're building.\n"));
|
|
6616
6643
|
const constitutionPath = getConstitutionPath(cwd);
|
|
6617
6644
|
const draftPath = getDraftPath(cwd);
|
|
6618
|
-
if (
|
|
6645
|
+
if (existsSync15(constitutionPath)) {
|
|
6619
6646
|
const existing = deserializeConstitution(readFileSync4(constitutionPath, "utf-8"));
|
|
6620
6647
|
if (existing.state === "FROZEN") {
|
|
6621
6648
|
console.log(chalk15.yellow("[!] A frozen Constitution already exists."));
|
|
@@ -6634,7 +6661,7 @@ async function interview(options = {}) {
|
|
|
6634
6661
|
}
|
|
6635
6662
|
let constitution;
|
|
6636
6663
|
let startPhase = 1;
|
|
6637
|
-
if (
|
|
6664
|
+
if (existsSync15(draftPath) && options.resume !== false) {
|
|
6638
6665
|
const draft = deserializeConstitution(readFileSync4(draftPath, "utf-8"));
|
|
6639
6666
|
console.log(chalk15.blue("[i] Found draft from previous session."));
|
|
6640
6667
|
console.log(chalk15.dim(` Project: ${draft.branding.projectName || "(unnamed)"}`));
|
|
@@ -6789,7 +6816,7 @@ async function interview(options = {}) {
|
|
|
6789
6816
|
try {
|
|
6790
6817
|
const frozen = freezeConstitution(constitution);
|
|
6791
6818
|
writeFileSync(constitutionPath, serializeConstitution(frozen));
|
|
6792
|
-
if (
|
|
6819
|
+
if (existsSync15(draftPath)) {
|
|
6793
6820
|
const { unlinkSync } = await import("fs");
|
|
6794
6821
|
unlinkSync(draftPath);
|
|
6795
6822
|
}
|
|
@@ -6892,10 +6919,10 @@ async function showConstitution() {
|
|
|
6892
6919
|
const cwd = process.cwd();
|
|
6893
6920
|
const constitutionPath = getConstitutionPath(cwd);
|
|
6894
6921
|
const draftPath = getDraftPath(cwd);
|
|
6895
|
-
if (
|
|
6922
|
+
if (existsSync15(constitutionPath)) {
|
|
6896
6923
|
const constitution = deserializeConstitution(readFileSync4(constitutionPath, "utf-8"));
|
|
6897
6924
|
console.log(summarizeConstitution(constitution));
|
|
6898
|
-
} else if (
|
|
6925
|
+
} else if (existsSync15(draftPath)) {
|
|
6899
6926
|
const draft = deserializeConstitution(readFileSync4(draftPath, "utf-8"));
|
|
6900
6927
|
console.log(chalk15.yellow("[DRAFT]"));
|
|
6901
6928
|
console.log(summarizeConstitution(draft));
|
|
@@ -6907,8 +6934,8 @@ async function validateConstitutionCommand() {
|
|
|
6907
6934
|
const cwd = process.cwd();
|
|
6908
6935
|
const constitutionPath = getConstitutionPath(cwd);
|
|
6909
6936
|
const draftPath = getDraftPath(cwd);
|
|
6910
|
-
const path2 =
|
|
6911
|
-
if (!
|
|
6937
|
+
const path2 = existsSync15(constitutionPath) ? constitutionPath : draftPath;
|
|
6938
|
+
if (!existsSync15(path2)) {
|
|
6912
6939
|
console.log(chalk15.dim("No Constitution found. Run `archon interview` to create one."));
|
|
6913
6940
|
return;
|
|
6914
6941
|
}
|
|
@@ -6932,7 +6959,7 @@ async function validateConstitutionCommand() {
|
|
|
6932
6959
|
async function exportConstitution(format) {
|
|
6933
6960
|
const cwd = process.cwd();
|
|
6934
6961
|
const constitutionPath = getConstitutionPath(cwd);
|
|
6935
|
-
if (!
|
|
6962
|
+
if (!existsSync15(constitutionPath)) {
|
|
6936
6963
|
console.log(chalk15.dim("No frozen Constitution found."));
|
|
6937
6964
|
return;
|
|
6938
6965
|
}
|
|
@@ -6952,7 +6979,7 @@ async function exportConstitution(format) {
|
|
|
6952
6979
|
async function generateAtoms(options = {}) {
|
|
6953
6980
|
const cwd = process.cwd();
|
|
6954
6981
|
const constitutionPath = getConstitutionPath(cwd);
|
|
6955
|
-
if (!
|
|
6982
|
+
if (!existsSync15(constitutionPath)) {
|
|
6956
6983
|
console.log(chalk15.red("No frozen Constitution found."));
|
|
6957
6984
|
console.log(chalk15.dim("Run `archon interview` to create one first."));
|
|
6958
6985
|
return;
|
|
@@ -6983,7 +7010,7 @@ async function generateAtoms(options = {}) {
|
|
|
6983
7010
|
}
|
|
6984
7011
|
const prdPath = options.output ?? join15(cwd, "prd.json");
|
|
6985
7012
|
const prdContent = formatAsPrdJson(result, constitution);
|
|
6986
|
-
if (
|
|
7013
|
+
if (existsSync15(prdPath)) {
|
|
6987
7014
|
const overwrite = await promptYesNo2("prd.json already exists. Overwrite?", false);
|
|
6988
7015
|
if (!overwrite) {
|
|
6989
7016
|
console.log(chalk15.dim("Cancelled. Existing prd.json preserved."));
|
|
@@ -7003,7 +7030,7 @@ async function generateAtoms(options = {}) {
|
|
|
7003
7030
|
|
|
7004
7031
|
// src/cli/eject.ts
|
|
7005
7032
|
import chalk16 from "chalk";
|
|
7006
|
-
import { existsSync as
|
|
7033
|
+
import { existsSync as existsSync16, rmSync } from "fs";
|
|
7007
7034
|
import { readFile as readFile11, writeFile as writeFile9 } from "fs/promises";
|
|
7008
7035
|
import { join as join16 } from "path";
|
|
7009
7036
|
import readline3 from "readline";
|
|
@@ -7021,7 +7048,7 @@ async function eject(options = {}) {
|
|
|
7021
7048
|
const cwd = process.cwd();
|
|
7022
7049
|
console.log(chalk16.blue("\n\u{1F680} ArchonDev Eject\n"));
|
|
7023
7050
|
const archonDir = join16(cwd, ".archon");
|
|
7024
|
-
if (!
|
|
7051
|
+
if (!existsSync16(archonDir)) {
|
|
7025
7052
|
console.log(chalk16.yellow("This does not appear to be an ArchonDev project (.archon/ not found)."));
|
|
7026
7053
|
return;
|
|
7027
7054
|
}
|
|
@@ -7029,20 +7056,20 @@ async function eject(options = {}) {
|
|
|
7029
7056
|
const filesToRemove = [];
|
|
7030
7057
|
for (const file of ARCHON_FILES) {
|
|
7031
7058
|
const filePath = join16(cwd, file);
|
|
7032
|
-
if (
|
|
7059
|
+
if (existsSync16(filePath)) {
|
|
7033
7060
|
filesToRemove.push(file);
|
|
7034
7061
|
console.log(chalk16.red(` \u2717 ${file}`));
|
|
7035
7062
|
}
|
|
7036
7063
|
}
|
|
7037
7064
|
const archMd = join16(cwd, "ARCHITECTURE.md");
|
|
7038
|
-
if (
|
|
7065
|
+
if (existsSync16(archMd) && !options.keepArchitecture) {
|
|
7039
7066
|
console.log(chalk16.yellow(` ? ARCHITECTURE.md (will be kept by default)`));
|
|
7040
7067
|
}
|
|
7041
7068
|
console.log();
|
|
7042
7069
|
console.log(chalk16.dim("Files to be modified:"));
|
|
7043
7070
|
for (const file of METADATA_FILES) {
|
|
7044
7071
|
const filePath = join16(cwd, file);
|
|
7045
|
-
if (
|
|
7072
|
+
if (existsSync16(filePath)) {
|
|
7046
7073
|
console.log(chalk16.yellow(` \u25CF ${file}`));
|
|
7047
7074
|
}
|
|
7048
7075
|
}
|
|
@@ -7094,7 +7121,7 @@ async function performEject(cwd, options) {
|
|
|
7094
7121
|
warnings: []
|
|
7095
7122
|
};
|
|
7096
7123
|
const archonDir = join16(cwd, ".archon");
|
|
7097
|
-
if (
|
|
7124
|
+
if (existsSync16(archonDir)) {
|
|
7098
7125
|
try {
|
|
7099
7126
|
rmSync(archonDir, { recursive: true, force: true });
|
|
7100
7127
|
result.filesRemoved.push(".archon/");
|
|
@@ -7103,7 +7130,7 @@ async function performEject(cwd, options) {
|
|
|
7103
7130
|
}
|
|
7104
7131
|
}
|
|
7105
7132
|
const prdPath = join16(cwd, "prd.json");
|
|
7106
|
-
if (
|
|
7133
|
+
if (existsSync16(prdPath)) {
|
|
7107
7134
|
try {
|
|
7108
7135
|
rmSync(prdPath);
|
|
7109
7136
|
result.filesRemoved.push("prd.json");
|
|
@@ -7112,7 +7139,7 @@ async function performEject(cwd, options) {
|
|
|
7112
7139
|
}
|
|
7113
7140
|
}
|
|
7114
7141
|
const progressPath = join16(cwd, "progress.txt");
|
|
7115
|
-
if (
|
|
7142
|
+
if (existsSync16(progressPath)) {
|
|
7116
7143
|
try {
|
|
7117
7144
|
rmSync(progressPath);
|
|
7118
7145
|
result.filesRemoved.push("progress.txt");
|
|
@@ -7121,7 +7148,7 @@ async function performEject(cwd, options) {
|
|
|
7121
7148
|
}
|
|
7122
7149
|
}
|
|
7123
7150
|
const promptPath = join16(cwd, "prompt.md");
|
|
7124
|
-
if (
|
|
7151
|
+
if (existsSync16(promptPath)) {
|
|
7125
7152
|
try {
|
|
7126
7153
|
rmSync(promptPath);
|
|
7127
7154
|
result.filesRemoved.push("prompt.md");
|
|
@@ -7130,7 +7157,7 @@ async function performEject(cwd, options) {
|
|
|
7130
7157
|
}
|
|
7131
7158
|
}
|
|
7132
7159
|
const pkgPath = join16(cwd, "package.json");
|
|
7133
|
-
if (
|
|
7160
|
+
if (existsSync16(pkgPath)) {
|
|
7134
7161
|
try {
|
|
7135
7162
|
const pkgContent = await readFile11(pkgPath, "utf-8");
|
|
7136
7163
|
const pkg = JSON.parse(pkgContent);
|
|
@@ -7158,7 +7185,7 @@ async function performEject(cwd, options) {
|
|
|
7158
7185
|
}
|
|
7159
7186
|
if (!options.keepReadme) {
|
|
7160
7187
|
const readmePath = join16(cwd, "README.md");
|
|
7161
|
-
if (
|
|
7188
|
+
if (existsSync16(readmePath)) {
|
|
7162
7189
|
try {
|
|
7163
7190
|
const content = await readFile11(readmePath, "utf-8");
|
|
7164
7191
|
const archonPatterns = [
|
|
@@ -7191,14 +7218,14 @@ async function ejectDryRun() {
|
|
|
7191
7218
|
const cwd = process.cwd();
|
|
7192
7219
|
console.log(chalk16.blue("\n\u{1F50D} Eject Dry Run\n"));
|
|
7193
7220
|
const archonDir = join16(cwd, ".archon");
|
|
7194
|
-
if (!
|
|
7221
|
+
if (!existsSync16(archonDir)) {
|
|
7195
7222
|
console.log(chalk16.yellow("This does not appear to be an ArchonDev project."));
|
|
7196
7223
|
return;
|
|
7197
7224
|
}
|
|
7198
7225
|
console.log("The following would be removed:\n");
|
|
7199
7226
|
for (const file of ARCHON_FILES) {
|
|
7200
7227
|
const filePath = join16(cwd, file);
|
|
7201
|
-
if (
|
|
7228
|
+
if (existsSync16(filePath)) {
|
|
7202
7229
|
console.log(chalk16.red(` \u2717 ${file}`));
|
|
7203
7230
|
}
|
|
7204
7231
|
}
|
|
@@ -7206,7 +7233,7 @@ async function ejectDryRun() {
|
|
|
7206
7233
|
console.log("The following would be modified:\n");
|
|
7207
7234
|
for (const file of METADATA_FILES) {
|
|
7208
7235
|
const filePath = join16(cwd, file);
|
|
7209
|
-
if (
|
|
7236
|
+
if (existsSync16(filePath)) {
|
|
7210
7237
|
console.log(chalk16.yellow(` \u25CF ${file}`));
|
|
7211
7238
|
}
|
|
7212
7239
|
}
|
|
@@ -7233,15 +7260,15 @@ function promptYesNo3(question, defaultValue) {
|
|
|
7233
7260
|
|
|
7234
7261
|
// src/cli/revert.ts
|
|
7235
7262
|
import chalk17 from "chalk";
|
|
7236
|
-
import { execSync as
|
|
7237
|
-
import { existsSync as
|
|
7263
|
+
import { execSync as execSync4 } from "child_process";
|
|
7264
|
+
import { existsSync as existsSync17 } from "fs";
|
|
7238
7265
|
import { readFile as readFile12, writeFile as writeFile10 } from "fs/promises";
|
|
7239
7266
|
import { join as join17 } from "path";
|
|
7240
7267
|
import readline4 from "readline";
|
|
7241
7268
|
async function findAtomCommits(limit = 50) {
|
|
7242
7269
|
const cwd = process.cwd();
|
|
7243
7270
|
try {
|
|
7244
|
-
const logOutput =
|
|
7271
|
+
const logOutput = execSync4(
|
|
7245
7272
|
`git log --oneline --no-merges -n ${limit} --format="%H|%s|%ai|%an"`,
|
|
7246
7273
|
{ cwd, encoding: "utf-8" }
|
|
7247
7274
|
);
|
|
@@ -7257,7 +7284,7 @@ async function findAtomCommits(limit = 50) {
|
|
|
7257
7284
|
const atomId = atomMatch[1] ?? atomMatch[2] ?? "unknown";
|
|
7258
7285
|
let filesChanged = 0;
|
|
7259
7286
|
try {
|
|
7260
|
-
const statOutput =
|
|
7287
|
+
const statOutput = execSync4(
|
|
7261
7288
|
`git diff --shortstat ${hash}^..${hash}`,
|
|
7262
7289
|
{ cwd, encoding: "utf-8" }
|
|
7263
7290
|
);
|
|
@@ -7327,7 +7354,7 @@ async function revertCommand(atomIdOrHash, options = {}) {
|
|
|
7327
7354
|
console.log();
|
|
7328
7355
|
try {
|
|
7329
7356
|
console.log(chalk17.dim("Changes to be reverted:"));
|
|
7330
|
-
const diffStat =
|
|
7357
|
+
const diffStat = execSync4(
|
|
7331
7358
|
`git diff --stat ${commit.commitHash}^..${commit.commitHash}`,
|
|
7332
7359
|
{ cwd, encoding: "utf-8" }
|
|
7333
7360
|
);
|
|
@@ -7343,7 +7370,7 @@ async function revertCommand(atomIdOrHash, options = {}) {
|
|
|
7343
7370
|
}
|
|
7344
7371
|
try {
|
|
7345
7372
|
const revertArgs = options.noCommit ? "--no-commit" : "";
|
|
7346
|
-
|
|
7373
|
+
execSync4(`git revert ${revertArgs} ${commit.commitHash}`, { cwd, stdio: "pipe" });
|
|
7347
7374
|
console.log(chalk17.green(`
|
|
7348
7375
|
\u2705 Successfully reverted ${commit.atomId}`));
|
|
7349
7376
|
if (options.noCommit) {
|
|
@@ -7368,7 +7395,7 @@ async function revertCommand(atomIdOrHash, options = {}) {
|
|
|
7368
7395
|
}
|
|
7369
7396
|
async function updateAtomStatus(atomId, status2) {
|
|
7370
7397
|
const atomPath = join17(process.cwd(), ".archon", "atoms", `${atomId}.json`);
|
|
7371
|
-
if (!
|
|
7398
|
+
if (!existsSync17(atomPath)) {
|
|
7372
7399
|
return;
|
|
7373
7400
|
}
|
|
7374
7401
|
try {
|
|
@@ -7422,7 +7449,7 @@ function promptYesNo4(question, defaultValue) {
|
|
|
7422
7449
|
|
|
7423
7450
|
// src/cli/index.ts
|
|
7424
7451
|
var program = new Command4();
|
|
7425
|
-
program.name("archon").description("Local-first AI-powered development governance").version(
|
|
7452
|
+
program.name("archon").description("Local-first AI-powered development governance").version(getCurrentVersion()).action(async () => {
|
|
7426
7453
|
const cwd = process.cwd();
|
|
7427
7454
|
const wasInitialized = isInitialized(cwd);
|
|
7428
7455
|
if (!wasInitialized) {
|
|
@@ -7445,9 +7472,13 @@ program.command("logout").description("Clear stored authentication").action(asyn
|
|
|
7445
7472
|
program.command("status").description("Show current user and project status").action(async () => {
|
|
7446
7473
|
await status();
|
|
7447
7474
|
});
|
|
7448
|
-
program.command("
|
|
7449
|
-
const {
|
|
7450
|
-
await
|
|
7475
|
+
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");
|
|
7477
|
+
await showUpgradeMenu();
|
|
7478
|
+
});
|
|
7479
|
+
program.command("pricing", { hidden: true }).action(async () => {
|
|
7480
|
+
const { showUpgradeMenu } = await import("./tier-selection-LQ7ZOBEK.js");
|
|
7481
|
+
await showUpgradeMenu();
|
|
7451
7482
|
});
|
|
7452
7483
|
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) => {
|
|
7453
7484
|
await init(options);
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
setPreference,
|
|
8
8
|
showExecutionPreferences,
|
|
9
9
|
showPreferences
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZCWCSRCQ.js";
|
|
11
11
|
import "./chunk-QN65APWL.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
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-
|
|
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
|
};
|