archondev 2.16.0 → 2.18.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.
Files changed (55) hide show
  1. package/README.md +3 -0
  2. package/dist/a11y-O35BAA25.js +14 -0
  3. package/dist/auth-7AUNKGQW.js +14 -0
  4. package/dist/bug-PH2E6GQT.js +13 -0
  5. package/dist/{chunk-P4KDRIFM.js → chunk-23IS6N63.js} +6 -6
  6. package/dist/{chunk-ER4ADSWH.js → chunk-2NSWZDP7.js} +1 -156
  7. package/dist/chunk-3ASILTFB.js +73 -0
  8. package/dist/{chunk-DQE6E436.js → chunk-4KJJ6MSQ.js} +159 -274
  9. package/dist/{chunk-QGM4M3NI.js → chunk-4VNS5WPM.js} +5 -0
  10. package/dist/{chunk-NLW75APJ.js → chunk-4VWKGOBQ.js} +8 -8
  11. package/dist/{chunk-P666JE3G.js → chunk-54ATBLYE.js} +1 -1
  12. package/dist/chunk-5CFGPXQ3.js +160 -0
  13. package/dist/chunk-67ZTMWP4.js +495 -0
  14. package/dist/{chunk-FGH2UX3E.js → chunk-BFPWDOMA.js} +1 -1
  15. package/dist/{chunk-CJ3CFP52.js → chunk-BKJISQXP.js} +76 -24
  16. package/dist/chunk-FWLLGLD5.js +353 -0
  17. package/dist/{chunk-BDPGWWQC.js → chunk-HGLPIM7J.js} +1 -1
  18. package/dist/{chunk-NIKN37AY.js → chunk-HJARQDQR.js} +1 -1
  19. package/dist/{chunk-7NSVJFIZ.js → chunk-HKSVJWMI.js} +1 -1
  20. package/dist/{chunk-35AOCHTE.js → chunk-JAWG5QX4.js} +71 -4
  21. package/dist/chunk-JF7JCK6H.js +485 -0
  22. package/dist/chunk-KY2HKRC2.js +175 -0
  23. package/dist/{chunk-3JURZUY7.js → chunk-OQUWPU5F.js} +6 -4
  24. package/dist/{chunk-KMVMRFQ5.js → chunk-RPVPOUH3.js} +11 -1
  25. package/dist/{chunk-SVU7MLG6.js → chunk-SUGIWSCB.js} +24 -5
  26. package/dist/{chunk-JWY56A3X.js → chunk-U2ZTHVDD.js} +8 -12
  27. package/dist/{chunk-LXXTCZ2Q.js → chunk-UFR2LX6G.js} +216 -14
  28. package/dist/{code-review-ORCNXANW.js → code-review-6MU4UE5M.js} +4 -4
  29. package/dist/{config-BBQW726O.js → config-UARQV6FG.js} +3 -2
  30. package/dist/{constants-AHP5F7HW.js → constants-XDIWFFPN.js} +1 -1
  31. package/dist/execute-6SJL5POT.js +18 -0
  32. package/dist/geo-RP6HKLKZ.js +21 -0
  33. package/dist/index.js +929 -1843
  34. package/dist/{init-6EXMDCWC.js → init-5RS332ZH.js} +2 -2
  35. package/dist/{interviewer-SULVHQW6.js → interviewer-Z7K4IZYG.js} +6 -5
  36. package/dist/{keys-SXJ6MKPY.js → keys-THCHXIFD.js} +1 -1
  37. package/dist/{keys-5Y7KQAHI.js → keys-XE2D6I24.js} +4 -3
  38. package/dist/list-PCDSX4UI.js +17 -0
  39. package/dist/{manager-32P6ZZBP.js → manager-YSNTH2DG.js} +1 -1
  40. package/dist/models-UTFGCHAY.js +33 -0
  41. package/dist/{orchestration-X6LHSHBJ.js → orchestration-HIF3KP25.js} +1 -1
  42. package/dist/{parallel-4NN4ONOH.js → parallel-IRFNVIB6.js} +11 -7
  43. package/dist/{parser-4KJH2PT5.js → parser-BFHETZ5B.js} +1 -1
  44. package/dist/plan-RE5A3E2J.js +22 -0
  45. package/dist/{preferences-32J3GUTY.js → preferences-QAM5QKAQ.js} +6 -6
  46. package/dist/{review-T4ID2QUF.js → review-AUG6GIL6.js} +5 -5
  47. package/dist/seo-PMI42KRZ.js +10 -0
  48. package/dist/{tier-selection-3N4BZYWA.js → tier-selection-2W6JWJUN.js} +4 -3
  49. package/dist/web-checks-4BSYXWDF.js +13 -0
  50. package/package.json +1 -1
  51. package/dist/auth-2E4VORGY.js +0 -14
  52. package/dist/bug-KUMC6HSR.js +0 -11
  53. package/dist/execute-MAFSY5FY.js +0 -16
  54. package/dist/list-C224HUQ6.js +0 -16
  55. package/dist/plan-7DPVPUNK.js +0 -19
@@ -13,6 +13,10 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
13
13
  var __commonJS = (cb, mod) => function __require2() {
14
14
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
15
  };
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
16
20
  var __copyProps = (to, from, except, desc) => {
17
21
  if (from && typeof from === "object" || typeof from === "function") {
18
22
  for (let key of __getOwnPropNames(from))
@@ -33,5 +37,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
37
  export {
34
38
  __require,
35
39
  __commonJS,
40
+ __export,
36
41
  __toESM
37
42
  };
@@ -2,7 +2,7 @@ import {
2
2
  getApiUrl,
3
3
  loadConfig,
4
4
  saveConfig
5
- } from "./chunk-SVU7MLG6.js";
5
+ } from "./chunk-SUGIWSCB.js";
6
6
 
7
7
  // src/cli/tier-selection.ts
8
8
  import chalk from "chalk";
@@ -43,9 +43,9 @@ async function offerReauthentication(reason) {
43
43
  return false;
44
44
  }
45
45
  console.log();
46
- const { login } = await import("./auth-2E4VORGY.js");
46
+ const { login } = await import("./auth-7AUNKGQW.js");
47
47
  await login({ skipTierSelection: true });
48
- const { loadConfig: reload } = await import("./config-BBQW726O.js");
48
+ const { loadConfig: reload } = await import("./config-UARQV6FG.js");
49
49
  const config = await reload();
50
50
  return !!(config && config.accessToken);
51
51
  }
@@ -207,7 +207,7 @@ async function promptForApiKey() {
207
207
  return;
208
208
  }
209
209
  if (provider) {
210
- const { addKey } = await import("./keys-5Y7KQAHI.js");
210
+ const { addKey } = await import("./keys-XE2D6I24.js");
211
211
  await addKey(provider, {});
212
212
  console.log();
213
213
  const addAnother = await promptYesNo("Would you like to add another API key?", false);
@@ -219,7 +219,7 @@ async function promptForApiKey() {
219
219
  async function createCheckoutSession(amountCents) {
220
220
  const spinner = ora("Preparing checkout...").start();
221
221
  try {
222
- const { ensureValidSession, loadConfig: loadConfig2 } = await import("./config-BBQW726O.js");
222
+ const { ensureValidSession, loadConfig: loadConfig2 } = await import("./config-UARQV6FG.js");
223
223
  let config = await ensureValidSession();
224
224
  if (!config || !config.accessToken || !config.userId) {
225
225
  spinner.stop();
@@ -367,7 +367,7 @@ Switching to ${selectedName}...`));
367
367
  var showTierSwitchMenu = showUpgradeMenu;
368
368
  async function updateUserTier(tier, _alreadyRetried = false) {
369
369
  try {
370
- const { ensureValidSession, loadConfig: reload } = await import("./config-BBQW726O.js");
370
+ const { ensureValidSession, loadConfig: reload } = await import("./config-UARQV6FG.js");
371
371
  let config = await ensureValidSession();
372
372
  if (!config || !config.accessToken) {
373
373
  if (_alreadyRetried) {
@@ -454,8 +454,8 @@ function promptYesNo(question, defaultValue) {
454
454
  });
455
455
  }
456
456
  async function showKeyManagementMenu() {
457
- const { keyManager } = await import("./keys-SXJ6MKPY.js");
458
- const { listKeys, addKey, removeKey } = await import("./keys-5Y7KQAHI.js");
457
+ const { keyManager } = await import("./keys-THCHXIFD.js");
458
+ const { listKeys, addKey, removeKey } = await import("./keys-XE2D6I24.js");
459
459
  console.log();
460
460
  console.log(chalk.bold("API Key Management"));
461
461
  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"));
@@ -13,7 +13,7 @@ function isInitialized(cwd) {
13
13
  if (existsSync(archMdPath)) {
14
14
  try {
15
15
  const content = readFileSync(archMdPath, "utf-8");
16
- return content.startsWith("---") && content.includes("version:") && content.includes("qualityLevel:");
16
+ return content.startsWith("---") && content.includes("version:") && (content.includes("systemGoals:") || content.includes("components:") || content.includes("profile:"));
17
17
  } catch {
18
18
  return false;
19
19
  }
@@ -0,0 +1,160 @@
1
+ import {
2
+ generateId
3
+ } from "./chunk-HJARQDQR.js";
4
+
5
+ // src/core/atoms/types.ts
6
+ var ATOM_TRANSITIONS = {
7
+ DRAFT: ["READY"],
8
+ READY: ["IN_PROGRESS", "BLOCKED"],
9
+ IN_PROGRESS: ["TESTING", "FAILED"],
10
+ TESTING: ["DONE", "FAILED"],
11
+ DONE: [],
12
+ // Terminal state
13
+ FAILED: ["IN_PROGRESS", "BLOCKED"],
14
+ // Can retry or escalate
15
+ BLOCKED: ["READY"]
16
+ // Can unblock and retry
17
+ };
18
+ var MAX_RETRIES = 3;
19
+
20
+ // src/core/atoms/atoms.ts
21
+ var MAX_RETRIES2 = MAX_RETRIES;
22
+ var atomCounter = 0;
23
+ function generateAtomId() {
24
+ atomCounter++;
25
+ return `ATOM-${String(atomCounter).padStart(3, "0")}`;
26
+ }
27
+ function createAtom(input, context) {
28
+ const now = /* @__PURE__ */ new Date();
29
+ const externalId = generateAtomId();
30
+ return {
31
+ id: generateId("atom"),
32
+ externalId,
33
+ title: input.title,
34
+ description: input.description ?? null,
35
+ goals: input.goals ?? [],
36
+ acceptanceCriteria: input.acceptanceCriteria,
37
+ ownershipPaths: input.ownershipPaths ?? [],
38
+ status: "DRAFT",
39
+ priority: input.priority ?? 100,
40
+ plan: null,
41
+ diffContract: null,
42
+ retryCount: 0,
43
+ errorMessage: null,
44
+ tags: input.tags ?? [],
45
+ metadata: input.metadata ?? {},
46
+ context: context ?? {},
47
+ createdAt: now,
48
+ updatedAt: now
49
+ };
50
+ }
51
+ function validateAtom(atom) {
52
+ const errors = [];
53
+ if (!atom.title || atom.title.trim() === "") {
54
+ errors.push({
55
+ field: "title",
56
+ message: "Title is required",
57
+ code: "REQUIRED"
58
+ });
59
+ }
60
+ if (!atom.acceptanceCriteria || atom.acceptanceCriteria.length === 0) {
61
+ errors.push({
62
+ field: "acceptanceCriteria",
63
+ message: "At least one acceptance criterion is required",
64
+ code: "REQUIRED"
65
+ });
66
+ }
67
+ atom.acceptanceCriteria.forEach((criterion, index) => {
68
+ if (typeof criterion !== "string" || criterion.trim() === "") {
69
+ errors.push({
70
+ field: `acceptanceCriteria[${index}]`,
71
+ message: "Acceptance criterion must be a non-empty string",
72
+ code: "INVALID_FORMAT"
73
+ });
74
+ }
75
+ });
76
+ if (atom.priority < 0) {
77
+ errors.push({
78
+ field: "priority",
79
+ message: "Priority must be a non-negative number",
80
+ code: "INVALID_VALUE"
81
+ });
82
+ }
83
+ const validStatuses = [
84
+ "DRAFT",
85
+ "READY",
86
+ "IN_PROGRESS",
87
+ "TESTING",
88
+ "DONE",
89
+ "FAILED",
90
+ "BLOCKED"
91
+ ];
92
+ if (!validStatuses.includes(atom.status)) {
93
+ errors.push({
94
+ field: "status",
95
+ message: `Invalid status: ${atom.status}`,
96
+ code: "INVALID_VALUE"
97
+ });
98
+ }
99
+ return {
100
+ valid: errors.length === 0,
101
+ errors
102
+ };
103
+ }
104
+ function validateTransition(currentStatus, newStatus) {
105
+ const allowedTransitions = ATOM_TRANSITIONS[currentStatus];
106
+ if (!allowedTransitions) {
107
+ return {
108
+ valid: false,
109
+ errors: [
110
+ {
111
+ field: "status",
112
+ message: `Unknown current status: ${currentStatus}`,
113
+ code: "INVALID_VALUE"
114
+ }
115
+ ]
116
+ };
117
+ }
118
+ if (!allowedTransitions.includes(newStatus)) {
119
+ return {
120
+ valid: false,
121
+ errors: [
122
+ {
123
+ field: "status",
124
+ message: `Cannot transition from ${currentStatus} to ${newStatus}. Allowed: ${allowedTransitions.join(", ") || "none"}`,
125
+ code: "INVALID_TRANSITION"
126
+ }
127
+ ]
128
+ };
129
+ }
130
+ return { valid: true, errors: [] };
131
+ }
132
+ function transitionAtom(atom, newStatus, errorMessage) {
133
+ const validation = validateTransition(atom.status, newStatus);
134
+ if (!validation.valid) {
135
+ const error = validation.errors[0];
136
+ throw new Error(error?.message ?? "Invalid transition");
137
+ }
138
+ const now = /* @__PURE__ */ new Date();
139
+ const updates = {
140
+ status: newStatus,
141
+ updatedAt: now
142
+ };
143
+ if (newStatus === "FAILED") {
144
+ updates.retryCount = atom.retryCount + 1;
145
+ updates.errorMessage = errorMessage ?? null;
146
+ if (updates.retryCount >= MAX_RETRIES2) {
147
+ updates.status = "BLOCKED";
148
+ }
149
+ }
150
+ if (newStatus === "IN_PROGRESS" && atom.status === "FAILED") {
151
+ updates.errorMessage = null;
152
+ }
153
+ return { ...atom, ...updates };
154
+ }
155
+
156
+ export {
157
+ createAtom,
158
+ validateAtom,
159
+ transitionAtom
160
+ };