archondev 2.1.4 → 2.1.6
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.
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
login
|
|
3
|
+
} from "./chunk-UI4UQ24R.js";
|
|
1
4
|
import {
|
|
2
5
|
keyManager
|
|
3
6
|
} from "./chunk-SMR7JQK6.js";
|
|
@@ -541,6 +544,23 @@ function prompt(question) {
|
|
|
541
544
|
});
|
|
542
545
|
});
|
|
543
546
|
}
|
|
547
|
+
function promptYesNo(question, defaultValue) {
|
|
548
|
+
return new Promise((resolve) => {
|
|
549
|
+
const rl = readline.createInterface({
|
|
550
|
+
input: process.stdin,
|
|
551
|
+
output: process.stdout
|
|
552
|
+
});
|
|
553
|
+
const hint = defaultValue ? "(Y/n)" : "(y/N)";
|
|
554
|
+
rl.question(`${chalk.cyan("?")} ${question} ${hint}: `, (answer) => {
|
|
555
|
+
rl.close();
|
|
556
|
+
if (answer.trim() === "") {
|
|
557
|
+
resolve(defaultValue);
|
|
558
|
+
} else {
|
|
559
|
+
resolve(answer.toLowerCase().startsWith("y"));
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
});
|
|
563
|
+
}
|
|
544
564
|
function formatCost(dollars) {
|
|
545
565
|
if (dollars < 0.01) {
|
|
546
566
|
return `$${dollars.toFixed(4)}`;
|
|
@@ -557,9 +577,7 @@ function formatTokens(tokens) {
|
|
|
557
577
|
return tokens.toString();
|
|
558
578
|
}
|
|
559
579
|
async function interactiveSettings() {
|
|
560
|
-
console.log(chalk.
|
|
561
|
-
console.log(chalk.bold.white(" Settings & Preferences"));
|
|
562
|
-
console.log(chalk.blue("\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\n"));
|
|
580
|
+
console.log(chalk.bold("\nSettings & Preferences\n"));
|
|
563
581
|
const spinner = ora("Loading settings...").start();
|
|
564
582
|
const [profile, usage, providers] = await Promise.all([
|
|
565
583
|
fetchUserProfile(),
|
|
@@ -568,7 +586,12 @@ async function interactiveSettings() {
|
|
|
568
586
|
]);
|
|
569
587
|
spinner.stop();
|
|
570
588
|
if (!profile) {
|
|
571
|
-
console.log(chalk.yellow("Not logged in
|
|
589
|
+
console.log(chalk.yellow("Not logged in.\n"));
|
|
590
|
+
const shouldLogin = await promptYesNo("Would you like to login now?", true);
|
|
591
|
+
if (shouldLogin) {
|
|
592
|
+
await login("github");
|
|
593
|
+
await interactiveSettings();
|
|
594
|
+
}
|
|
572
595
|
return;
|
|
573
596
|
}
|
|
574
597
|
await displayCurrentSettings(profile, usage, providers);
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
setPreference,
|
|
41
41
|
showExecutionPreferences,
|
|
42
42
|
showPreferences
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-F3RLDQTQ.js";
|
|
44
44
|
import {
|
|
45
45
|
login,
|
|
46
46
|
logout,
|
|
@@ -873,9 +873,18 @@ async function runAutoCleanupCheck(cwd) {
|
|
|
873
873
|
async function start(options = {}) {
|
|
874
874
|
const cwd = process.cwd();
|
|
875
875
|
if (!options.skipGovernanceBanner) {
|
|
876
|
-
console.log(chalk4.bold
|
|
876
|
+
console.log(chalk4.bold("\nArchonDev - AI-Powered Development Governance"));
|
|
877
877
|
console.log(chalk4.blue("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"));
|
|
878
878
|
}
|
|
879
|
+
const token = await getAuthToken();
|
|
880
|
+
if (!token) {
|
|
881
|
+
console.log(chalk4.yellow("[!] Not logged in"));
|
|
882
|
+
const shouldLogin = await promptYesNo("Would you like to login now?", true);
|
|
883
|
+
if (shouldLogin) {
|
|
884
|
+
await login();
|
|
885
|
+
console.log();
|
|
886
|
+
}
|
|
887
|
+
}
|
|
879
888
|
const contextManager = new ContextManager();
|
|
880
889
|
const pendingAtomsData = await contextManager.getPendingAtomsData(cwd);
|
|
881
890
|
if (pendingAtomsData && pendingAtomsData.atoms.length > 0) {
|
|
@@ -902,7 +911,7 @@ async function start(options = {}) {
|
|
|
902
911
|
const projectState = detectProjectState(cwd);
|
|
903
912
|
if (!options.skipGovernanceBanner) {
|
|
904
913
|
const governanceStatus = await gatherGovernanceStatus(cwd);
|
|
905
|
-
displayGovernanceBanner(governanceStatus);
|
|
914
|
+
await displayGovernanceBanner(governanceStatus);
|
|
906
915
|
}
|
|
907
916
|
if (await shouldRunAutoCleanup(cwd)) {
|
|
908
917
|
await runAutoCleanupCheck(cwd);
|
|
@@ -1031,15 +1040,21 @@ async function gatherGovernanceStatus(cwd) {
|
|
|
1031
1040
|
}
|
|
1032
1041
|
return status2;
|
|
1033
1042
|
}
|
|
1034
|
-
function displayGovernanceBanner(status2) {
|
|
1035
|
-
console.log(chalk4.bold
|
|
1043
|
+
async function displayGovernanceBanner(status2) {
|
|
1044
|
+
console.log(chalk4.bold("Governance Status"));
|
|
1036
1045
|
console.log(chalk4.blue("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
1037
1046
|
if (status2.hasArchitecture) {
|
|
1038
1047
|
console.log(chalk4.green(" \u2713") + ` ARCHITECTURE.md loaded (${status2.posture} posture)`);
|
|
1039
1048
|
console.log(chalk4.green(" \u2713") + ` ${status2.invariantsCount} invariants enforced`);
|
|
1040
1049
|
console.log(chalk4.green(" \u2713") + ` ${status2.protectedPathsCount} protected paths defined`);
|
|
1041
1050
|
} else {
|
|
1042
|
-
console.log(chalk4.yellow(" [!]") + " ARCHITECTURE.md not found
|
|
1051
|
+
console.log(chalk4.yellow(" [!]") + " ARCHITECTURE.md not found.");
|
|
1052
|
+
const shouldInit = await promptYesNo("Would you like to initialize now?", true);
|
|
1053
|
+
if (shouldInit) {
|
|
1054
|
+
const { init: init2 } = await import("./init-6EXMDCWC.js");
|
|
1055
|
+
await init2({ analyze: true, git: true });
|
|
1056
|
+
console.log();
|
|
1057
|
+
}
|
|
1043
1058
|
}
|
|
1044
1059
|
console.log(chalk4.green(" \u2713") + ` ${status2.dependencyRulesCount} dependency rules active`);
|
|
1045
1060
|
if (status2.lastSessionDate) {
|
|
@@ -1159,7 +1174,7 @@ ${noNoPatterns ? `- **Forbidden patterns:** ${noNoPatterns}` : "- No forbidden p
|
|
|
1159
1174
|
}
|
|
1160
1175
|
}
|
|
1161
1176
|
async function quickStart(cwd) {
|
|
1162
|
-
console.log(chalk4.blue("\n
|
|
1177
|
+
console.log(chalk4.blue("\n-- Quick Start --\n"));
|
|
1163
1178
|
const { init: init2 } = await import("./init-6EXMDCWC.js");
|
|
1164
1179
|
await init2({ analyze: false, git: true });
|
|
1165
1180
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -1186,7 +1201,7 @@ This file tracks learnings and decisions across sessions.
|
|
|
1186
1201
|
await showMainMenu();
|
|
1187
1202
|
}
|
|
1188
1203
|
async function handleAdaptExisting(cwd, state) {
|
|
1189
|
-
console.log(chalk4.
|
|
1204
|
+
console.log(chalk4.bold("Existing project detected!\n"));
|
|
1190
1205
|
console.log(chalk4.dim("I can analyze your codebase and adapt the governance files to match your structure."));
|
|
1191
1206
|
console.log(chalk4.dim("This helps me understand your architecture without changing any code.\n"));
|
|
1192
1207
|
console.log(chalk4.bold("What would you like to do?\n"));
|
|
@@ -1218,7 +1233,7 @@ async function handleAdaptExisting(cwd, state) {
|
|
|
1218
1233
|
}
|
|
1219
1234
|
}
|
|
1220
1235
|
async function analyzeAndAdapt(cwd) {
|
|
1221
|
-
console.log(chalk4.blue("\n
|
|
1236
|
+
console.log(chalk4.blue("\n-- Analyzing Project --\n"));
|
|
1222
1237
|
const { init: init2 } = await import("./init-6EXMDCWC.js");
|
|
1223
1238
|
await init2({ analyze: true, git: true });
|
|
1224
1239
|
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -1244,7 +1259,7 @@ async function analyzeAndAdapt(cwd) {
|
|
|
1244
1259
|
await showMainMenu();
|
|
1245
1260
|
}
|
|
1246
1261
|
async function codeReviewFirst(cwd) {
|
|
1247
|
-
console.log(chalk4.blue("\n
|
|
1262
|
+
console.log(chalk4.blue("\n-- Code Review Mode --\n"));
|
|
1248
1263
|
console.log(chalk4.dim("I'll analyze your code for issues without making any changes.\n"));
|
|
1249
1264
|
const { reviewInit: reviewInit2, reviewAnalyze: reviewAnalyze2, reviewRun: reviewRun2 } = await import("./review-QV4TQM2Z.js");
|
|
1250
1265
|
const reviewDbPath = join4(cwd, "docs", "code-review", "review-tasks.db");
|
|
@@ -1259,7 +1274,7 @@ async function codeReviewFirst(cwd) {
|
|
|
1259
1274
|
console.log(chalk4.dim("\nAfter reviewing, you can run ") + chalk4.cyan("archon") + chalk4.dim(" again to set up governance.\n"));
|
|
1260
1275
|
}
|
|
1261
1276
|
async function manualSetup(cwd) {
|
|
1262
|
-
console.log(chalk4.blue("\n
|
|
1277
|
+
console.log(chalk4.blue("\n-- Manual Setup --\n"));
|
|
1263
1278
|
console.log(chalk4.dim("Creating template files. You can customize them manually.\n"));
|
|
1264
1279
|
const { init: init2 } = await import("./init-6EXMDCWC.js");
|
|
1265
1280
|
await init2({ analyze: false, git: true });
|
|
@@ -1387,7 +1402,7 @@ async function listAtoms() {
|
|
|
1387
1402
|
async function executeNext() {
|
|
1388
1403
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-W2UXAR6E.js");
|
|
1389
1404
|
const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-X6LHSHBJ.js");
|
|
1390
|
-
const { loadExecutionPreferences } = await import("./preferences-
|
|
1405
|
+
const { loadExecutionPreferences } = await import("./preferences-3Z4OCNTT.js");
|
|
1391
1406
|
const cwd = process.cwd();
|
|
1392
1407
|
const atoms = await listLocalAtoms2();
|
|
1393
1408
|
const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
|
|
@@ -1438,7 +1453,7 @@ async function viewStatus() {
|
|
|
1438
1453
|
await status2();
|
|
1439
1454
|
}
|
|
1440
1455
|
async function settingsMenu() {
|
|
1441
|
-
const { interactiveSettings } = await import("./preferences-
|
|
1456
|
+
const { interactiveSettings } = await import("./preferences-3Z4OCNTT.js");
|
|
1442
1457
|
await interactiveSettings();
|
|
1443
1458
|
await showMainMenu();
|
|
1444
1459
|
}
|
|
@@ -7,7 +7,9 @@ import {
|
|
|
7
7
|
setPreference,
|
|
8
8
|
showExecutionPreferences,
|
|
9
9
|
showPreferences
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F3RLDQTQ.js";
|
|
11
|
+
import "./chunk-UI4UQ24R.js";
|
|
12
|
+
import "./chunk-M4LGRTLC.js";
|
|
11
13
|
import "./chunk-SMR7JQK6.js";
|
|
12
14
|
import "./chunk-IVY5AHPS.js";
|
|
13
15
|
import "./chunk-QGM4M3NI.js";
|