archondev 2.17.0 → 2.18.2

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 (54) hide show
  1. package/README.md +1 -0
  2. package/dist/a11y-O35BAA25.js +14 -0
  3. package/dist/auth-HQBAG4CR.js +14 -0
  4. package/dist/bug-5WRBCFRT.js +12 -0
  5. package/dist/{chunk-ER4ADSWH.js → chunk-2NSWZDP7.js} +1 -156
  6. package/dist/chunk-3ASILTFB.js +73 -0
  7. package/dist/{chunk-LHCXE6UL.js → chunk-3PZ7WU5I.js} +26 -73
  8. package/dist/{chunk-QGM4M3NI.js → chunk-4VNS5WPM.js} +5 -0
  9. package/dist/chunk-4YEJ26F7.js +183 -0
  10. package/dist/chunk-5CFGPXQ3.js +160 -0
  11. package/dist/{chunk-TRLP7RMZ.js → chunk-75J2JMU3.js} +2 -2
  12. package/dist/{chunk-FGH2UX3E.js → chunk-BFPWDOMA.js} +1 -1
  13. package/dist/{chunk-FA2GAZ7L.js → chunk-CZCY63EY.js} +12 -8
  14. package/dist/{chunk-E7ZTIAQM.js → chunk-EKU62MGC.js} +160 -286
  15. package/dist/chunk-FWLLGLD5.js +353 -0
  16. package/dist/{chunk-BDPGWWQC.js → chunk-HGLPIM7J.js} +1 -1
  17. package/dist/{chunk-NIKN37AY.js → chunk-HJARQDQR.js} +1 -1
  18. package/dist/chunk-JF7JCK6H.js +485 -0
  19. package/dist/{chunk-DUJOT5B6.js → chunk-LBBHM4I5.js} +8 -8
  20. package/dist/{chunk-LPSS2U5V.js → chunk-NCPHO54C.js} +65 -2
  21. package/dist/{chunk-WZIRUPMP.js → chunk-NJF6MRTR.js} +1 -1
  22. package/dist/{chunk-54ATBLYE.js → chunk-P666JE3G.js} +1 -1
  23. package/dist/{chunk-SUGIWSCB.js → chunk-SVU7MLG6.js} +5 -24
  24. package/dist/chunk-UD45ZLV3.js +495 -0
  25. package/dist/{chunk-LXXTCZ2Q.js → chunk-UFR2LX6G.js} +216 -14
  26. package/dist/{chunk-2QIXLBAC.js → chunk-VF2OTDMS.js} +6 -4
  27. package/dist/{chunk-HTJOCKVV.js → chunk-ZJXIOETW.js} +6 -6
  28. package/dist/{code-review-ORCNXANW.js → code-review-6MU4UE5M.js} +4 -4
  29. package/dist/{config-USLUSE4N.js → config-JBPM2YAB.js} +2 -3
  30. package/dist/{constants-AHP5F7HW.js → constants-XDIWFFPN.js} +1 -1
  31. package/dist/execute-MB4ZF3HQ.js +18 -0
  32. package/dist/geo-KV4IRGKN.js +20 -0
  33. package/dist/index.js +928 -1831
  34. package/dist/{init-PSMJLDEZ.js → init-FINETS3Q.js} +2 -2
  35. package/dist/{interviewer-Q6PFSAGT.js → interviewer-NQHNMVH4.js} +5 -6
  36. package/dist/{keys-SXJ6MKPY.js → keys-THCHXIFD.js} +1 -1
  37. package/dist/{keys-VLK3EWSN.js → keys-U4QZE5YB.js} +3 -4
  38. package/dist/list-CNKAH354.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-WHFKRBPR.js → parallel-W2ETYYAL.js} +11 -7
  43. package/dist/{parser-4KJH2PT5.js → parser-BFHETZ5B.js} +1 -1
  44. package/dist/{plan-X77BUKNE.js → plan-XALA4SLH.js} +7 -6
  45. package/dist/{preferences-TWEK2RWY.js → preferences-I6WETXOI.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-Z2RFHZUX.js → tier-selection-426HA765.js} +3 -4
  49. package/dist/web-checks-4BSYXWDF.js +13 -0
  50. package/package.json +1 -1
  51. package/dist/auth-KUFS3PBS.js +0 -14
  52. package/dist/bug-BJH4X5LI.js +0 -12
  53. package/dist/execute-73QW4ZEZ.js +0 -16
  54. package/dist/list-MMKB5TGX.js +0 -16
@@ -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
+ };
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  loadConfig,
9
9
  saveConfig
10
- } from "./chunk-SUGIWSCB.js";
10
+ } from "./chunk-SVU7MLG6.js";
11
11
 
12
12
  // src/cli/keys.ts
13
13
  import chalk from "chalk";
@@ -28,7 +28,7 @@ async function promptForKey(provider) {
28
28
  const originalWrite = rlAny._writeToOutput?.bind(rlAny);
29
29
  rlAny._writeToOutput = (stringToWrite) => {
30
30
  if (rlAny.stdoutMuted) {
31
- rl.output.write("*");
31
+ process.stdout.write("*");
32
32
  return;
33
33
  }
34
34
  originalWrite?.(stringToWrite);
@@ -4,7 +4,7 @@ import {
4
4
  analyzeProject,
5
5
  featuresToTasks,
6
6
  readArchitectureContext
7
- } from "./chunk-BDPGWWQC.js";
7
+ } from "./chunk-HGLPIM7J.js";
8
8
 
9
9
  // src/cli/review.ts
10
10
  import chalk from "chalk";
@@ -1,20 +1,20 @@
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-DUJOT5B6.js";
9
+ } from "./chunk-LBBHM4I5.js";
6
10
  import {
7
11
  clearConfig,
8
- createPkceSupabaseClient,
9
12
  loadConfig,
10
13
  saveConfig
11
- } from "./chunk-SUGIWSCB.js";
12
- import {
13
- SUPABASE_ANON_KEY,
14
- SUPABASE_URL
15
- } from "./chunk-M4LGRTLC.js";
14
+ } from "./chunk-SVU7MLG6.js";
16
15
 
17
16
  // src/cli/auth.ts
17
+ import { createClient } from "@supabase/supabase-js";
18
18
  import { createServer } from "http";
19
19
  import { URL } from "url";
20
20
  import readline from "readline";
@@ -24,7 +24,11 @@ import ora from "ora";
24
24
  var CALLBACK_PORT = 54321;
25
25
  var CALLBACK_URL = `http://localhost:${CALLBACK_PORT}/callback`;
26
26
  function getAuthClient() {
27
- return createPkceSupabaseClient(SUPABASE_URL, SUPABASE_ANON_KEY);
27
+ return createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
28
+ auth: {
29
+ flowType: "pkce"
30
+ }
31
+ });
28
32
  }
29
33
  async function login(providerOrOptions = "github") {
30
34
  const options = typeof providerOrOptions === "string" ? { provider: providerOrOptions } : providerOrOptions;