archondev 2.19.50 → 2.19.52

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,6 +1,6 @@
1
1
  import {
2
2
  loadAtom
3
- } from "./chunk-RH64CSQU.js";
3
+ } from "./chunk-FKKVJFSW.js";
4
4
 
5
5
  // src/cli/show.ts
6
6
  import chalk from "chalk";
@@ -7,7 +7,7 @@ import {
7
7
  UsageRecorder,
8
8
  handleInsufficientCreditsRecovery,
9
9
  loadAtom
10
- } from "./chunk-RH64CSQU.js";
10
+ } from "./chunk-FKKVJFSW.js";
11
11
  import {
12
12
  transitionAtom
13
13
  } from "./chunk-WGLVDEZC.js";
@@ -4533,7 +4533,7 @@ var TrackedExecutorAgent = class {
4533
4533
  operation: "EXECUTION",
4534
4534
  inputTokens: result.usage.inputTokens,
4535
4535
  outputTokens: result.usage.outputTokens,
4536
- atomId: atom.id
4536
+ atomId: isUuid(atom.id) ? atom.id : void 0
4537
4537
  });
4538
4538
  totalCostCents = billingResult.costCents;
4539
4539
  remainingBalance = billingResult.remainingBalance;
@@ -4552,6 +4552,9 @@ var TrackedExecutorAgent = class {
4552
4552
  return this.billing;
4553
4553
  }
4554
4554
  };
4555
+ function isUuid(value) {
4556
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
4557
+ }
4555
4558
 
4556
4559
  // src/core/config/roles.ts
4557
4560
  import { existsSync as existsSync7 } from "fs";
@@ -4832,7 +4835,7 @@ async function attemptPathScopeAutoRecovery(atom, cwd, parseSchema, options) {
4832
4835
  if (allowedPaths.length === 0) {
4833
4836
  return false;
4834
4837
  }
4835
- const { listLocalAtoms, plan } = await import("./plan-I3P6U2ZM.js");
4838
+ const { listLocalAtoms, plan } = await import("./plan-Y5S5VXMT.js");
4836
4839
  const before = await listLocalAtoms();
4837
4840
  const recoveryStartedAt = Date.now();
4838
4841
  const recoverySource = atom.description ?? atom.title;
@@ -4900,7 +4903,7 @@ async function execute(atomId, options) {
4900
4903
  process.exit(1);
4901
4904
  };
4902
4905
  if (options.parallel && options.parallel.length > 0) {
4903
- const { parallelExecute } = await import("./parallel-5UP6URF2.js");
4906
+ const { parallelExecute } = await import("./parallel-NGAMZ22X.js");
4904
4907
  const allAtomIds = [atomId, ...options.parallel];
4905
4908
  await parallelExecute(allAtomIds, { skipGates: options.skipGates === true });
4906
4909
  return;
@@ -5295,10 +5298,15 @@ async function resolveProfileId(authId, accessToken) {
5295
5298
  const supabase = createAuthedSupabaseClient(SUPABASE_URL, SUPABASE_ANON_KEY, accessToken);
5296
5299
  const { data: rawData, error } = await supabase.from("user_profiles").select("id").eq("auth_id", authId).single();
5297
5300
  const data = rawData;
5298
- if (error || !data?.id) {
5301
+ if (!error && data?.id) {
5302
+ return data.id;
5303
+ }
5304
+ const { data: byProfileRaw, error: byProfileError } = await supabase.from("user_profiles").select("id").eq("id", authId).single();
5305
+ const byProfile = byProfileRaw;
5306
+ if (byProfileError || !byProfile?.id) {
5299
5307
  return null;
5300
5308
  }
5301
- return data.id;
5309
+ return byProfile.id;
5302
5310
  } catch {
5303
5311
  return null;
5304
5312
  }
@@ -750,7 +750,7 @@ var TrackedAdversarialPlanner = class {
750
750
  operation: "ADVERSARIAL_PLANNING",
751
751
  inputTokens: result.totalUsage.inputTokens,
752
752
  outputTokens: result.totalUsage.outputTokens,
753
- atomId: atom.id
753
+ atomId: isUuid(atom.id) ? atom.id : void 0
754
754
  });
755
755
  billingResults.push(billingResult);
756
756
  totalCostCents = billingResult.costCents;
@@ -770,6 +770,9 @@ var TrackedAdversarialPlanner = class {
770
770
  return this.billing;
771
771
  }
772
772
  };
773
+ function isUuid(value) {
774
+ return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
775
+ }
773
776
 
774
777
  // src/cli/credits-recovery.ts
775
778
  import chalk from "chalk";
@@ -1615,8 +1618,13 @@ async function resolveProfileId(authId, accessToken) {
1615
1618
  const supabase = createAuthedSupabaseClient(SUPABASE_URL, SUPABASE_ANON_KEY, accessToken);
1616
1619
  const { data: rawData, error } = await supabase.from("user_profiles").select("id").eq("auth_id", authId).single();
1617
1620
  const data = rawData;
1618
- if (error || !data?.id) return null;
1619
- return data.id;
1621
+ if (!error && data?.id) {
1622
+ return data.id;
1623
+ }
1624
+ const { data: byProfileRaw, error: byProfileError } = await supabase.from("user_profiles").select("id").eq("id", authId).single();
1625
+ const byProfile = byProfileRaw;
1626
+ if (byProfileError || !byProfile?.id) return null;
1627
+ return byProfile.id;
1620
1628
  } catch {
1621
1629
  return null;
1622
1630
  }
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  listLocalAtoms,
8
8
  loadAtom
9
- } from "./chunk-RH64CSQU.js";
9
+ } from "./chunk-FKKVJFSW.js";
10
10
  import {
11
11
  loadConfig
12
12
  } from "./chunk-SVU7MLG6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  listLocalAtoms
3
- } from "./chunk-RH64CSQU.js";
3
+ } from "./chunk-FKKVJFSW.js";
4
4
 
5
5
  // src/cli/list.ts
6
6
  import chalk from "chalk";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  execute
3
- } from "./chunk-TXUHANIN.js";
3
+ } from "./chunk-53OOWYJM.js";
4
4
  import "./chunk-EBHHIUCB.js";
5
- import "./chunk-RH64CSQU.js";
5
+ import "./chunk-FKKVJFSW.js";
6
6
  import "./chunk-WGLVDEZC.js";
7
7
  import "./chunk-3MZOEZUH.js";
8
8
  import "./chunk-F7R3QKHP.js";
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-6URKZ7NB.js";
14
14
  import {
15
15
  show
16
- } from "./chunk-RLENHKO4.js";
16
+ } from "./chunk-3A46HCAI.js";
17
17
  import {
18
18
  bugReport
19
19
  } from "./chunk-AHK2ITJX.js";
@@ -50,13 +50,13 @@ import {
50
50
  parallelRunWaves,
51
51
  parallelSchedule,
52
52
  parallelStatus
53
- } from "./chunk-JH3QUPQD.js";
53
+ } from "./chunk-PQINPCF7.js";
54
54
  import {
55
55
  DependencyParser,
56
56
  EnvironmentConfigLoader,
57
57
  EnvironmentValidator,
58
58
  execute
59
- } from "./chunk-TXUHANIN.js";
59
+ } from "./chunk-53OOWYJM.js";
60
60
  import {
61
61
  cloudCancel,
62
62
  cloudLogs,
@@ -64,12 +64,12 @@ import {
64
64
  } from "./chunk-EBHHIUCB.js";
65
65
  import {
66
66
  list
67
- } from "./chunk-MQKPOULB.js";
67
+ } from "./chunk-UTI3SKKA.js";
68
68
  import {
69
69
  listLocalAtoms,
70
70
  loadAtom,
71
71
  plan
72
- } from "./chunk-RH64CSQU.js";
72
+ } from "./chunk-FKKVJFSW.js";
73
73
  import "./chunk-WGLVDEZC.js";
74
74
  import "./chunk-3MZOEZUH.js";
75
75
  import {
@@ -3034,7 +3034,6 @@ async function resolveStartupChatModel(tier, accessToken, existingAuthId) {
3034
3034
  }
3035
3035
  }
3036
3036
  async function resolveAuthIdFromToken(accessToken, existingAuthId) {
3037
- if (existingAuthId) return existingAuthId;
3038
3037
  try {
3039
3038
  const { SUPABASE_URL: SUPABASE_URL2, SUPABASE_ANON_KEY: SUPABASE_ANON_KEY2 } = await import("./constants-XDIWFFPN.js");
3040
3039
  const { createClient: createClient2 } = await import("@supabase/supabase-js");
@@ -3042,9 +3041,9 @@ async function resolveAuthIdFromToken(accessToken, existingAuthId) {
3042
3041
  global: { headers: { Authorization: `Bearer ${accessToken}` } }
3043
3042
  });
3044
3043
  const { data: { user } } = await client.auth.getUser();
3045
- return user?.id ?? null;
3044
+ return user?.id ?? existingAuthId ?? null;
3046
3045
  } catch {
3047
- return null;
3046
+ return existingAuthId ?? null;
3048
3047
  }
3049
3048
  }
3050
3049
  async function fetchCreditsUsageStats(accessToken, authId) {
@@ -3395,7 +3394,7 @@ async function runExploreFlow(cwd, followUpInput, options = {}) {
3395
3394
  case "1": {
3396
3395
  const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
3397
3396
  if (description.trim()) {
3398
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
3397
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
3399
3398
  await plan2(description, { conversational: true });
3400
3399
  }
3401
3400
  await showMainMenu();
@@ -3640,7 +3639,7 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
3640
3639
  const hintedTask = initialTaskHint?.trim() ?? "";
3641
3640
  if (hintedTask) {
3642
3641
  console.log(chalk6.dim("Using your request above as the first task.\n"));
3643
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
3642
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
3644
3643
  await plan2(hintedTask, { conversational: true });
3645
3644
  return;
3646
3645
  }
@@ -3665,7 +3664,7 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
3665
3664
  description = continueAnswer.trim();
3666
3665
  }
3667
3666
  if (description.trim()) {
3668
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
3667
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
3669
3668
  await plan2(description, { conversational: true });
3670
3669
  }
3671
3670
  }
@@ -3894,7 +3893,7 @@ async function handleAgentConversationInput(cwd, input) {
3894
3893
  return true;
3895
3894
  }
3896
3895
  console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
3897
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
3896
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
3898
3897
  await plan2(await withAllowedPathScope(cwd, input), { conversational: true });
3899
3898
  if (shouldAutoExecuteAfterPlanning(input)) {
3900
3899
  await continueWithCurrentTask(cwd, { runAllReady: true });
@@ -3941,7 +3940,7 @@ async function showProposalForApproval(input) {
3941
3940
  }
3942
3941
  }
3943
3942
  async function showLatestPlannedAtom(cwd) {
3944
- const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-I3P6U2ZM.js");
3943
+ const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-Y5S5VXMT.js");
3945
3944
  const atoms = await listLocalAtoms2();
3946
3945
  if (atoms.length === 0) {
3947
3946
  console.log(chalk6.yellow("No atoms found yet. Tell me what to plan."));
@@ -3959,7 +3958,7 @@ async function showLatestPlannedAtom(cwd) {
3959
3958
  console.log(chalk6.dim(`
3960
3959
  Showing latest planned atom (${latest.externalId})...
3961
3960
  `));
3962
- const { show: show2 } = await import("./show-7HL5NIA7.js");
3961
+ const { show: show2 } = await import("./show-IL6WBDTI.js");
3963
3962
  await show2(latest.externalId);
3964
3963
  }
3965
3964
  function isContinuationDirective(input) {
@@ -4092,7 +4091,7 @@ async function applyApprovedProposal(cwd) {
4092
4091
  console.log(chalk6.dim('\nReply "continue" when you want execution to start.'));
4093
4092
  }
4094
4093
  async function createTaskFromRequest(cwd, request) {
4095
- const { plan: plan2, listLocalAtoms: listLocalAtoms2 } = await import("./plan-I3P6U2ZM.js");
4094
+ const { plan: plan2, listLocalAtoms: listLocalAtoms2 } = await import("./plan-Y5S5VXMT.js");
4096
4095
  const before = await listLocalAtoms2();
4097
4096
  const beforeIds = new Set(before.map((atom) => atom.externalId));
4098
4097
  await plan2(await withAllowedPathScope(cwd, request), { conversational: true });
@@ -4268,13 +4267,13 @@ function buildSampleCapsuleDraft(cwd, files, capsuleCount) {
4268
4267
  ].join("\n");
4269
4268
  }
4270
4269
  async function continueWithCurrentTask(cwd, options = {}) {
4271
- const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-I3P6U2ZM.js");
4270
+ const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-Y5S5VXMT.js");
4272
4271
  const byMostRecent = (a, b) => {
4273
4272
  const aTime = new Date(String(a.updatedAt ?? a.createdAt ?? "")).getTime() || 0;
4274
4273
  const bTime = new Date(String(b.updatedAt ?? b.createdAt ?? "")).getTime() || 0;
4275
4274
  return bTime - aTime;
4276
4275
  };
4277
- const { execute: execute2 } = await import("./execute-QQ3OPP6H.js");
4276
+ const { execute: execute2 } = await import("./execute-MQFDA6EX.js");
4278
4277
  const runAllReady = options.runAllReady === true;
4279
4278
  const scopeIds = options.onlyAtomIds ? new Set(options.onlyAtomIds) : null;
4280
4279
  const attempted = /* @__PURE__ */ new Set();
@@ -4350,7 +4349,7 @@ Continuing with ${nextAtom.externalId}...
4350
4349
  }
4351
4350
  }
4352
4351
  async function replanLatestBlockedAtom(cwd) {
4353
- const { listLocalAtoms: listLocalAtoms2, plan: plan2 } = await import("./plan-I3P6U2ZM.js");
4352
+ const { listLocalAtoms: listLocalAtoms2, plan: plan2 } = await import("./plan-Y5S5VXMT.js");
4354
4353
  const atoms = await listLocalAtoms2();
4355
4354
  const blocked = atoms.filter((a) => a.status === "BLOCKED" && (a.errorMessage ?? "").toLowerCase().includes("outside the allowed paths")).sort((a, b) => {
4356
4355
  const aTime = new Date(String(a.updatedAt ?? a.createdAt ?? "")).getTime() || 0;
@@ -4464,7 +4463,7 @@ async function handleFreeformJourneyInput(cwd, input) {
4464
4463
  const state = detectProjectState(cwd);
4465
4464
  if (state.hasArchitecture) {
4466
4465
  console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
4467
- const { plan: plan3 } = await import("./plan-I3P6U2ZM.js");
4466
+ const { plan: plan3 } = await import("./plan-Y5S5VXMT.js");
4468
4467
  await plan3(await withAllowedPathScope(cwd, freeform), { conversational: true });
4469
4468
  return true;
4470
4469
  }
@@ -4473,7 +4472,7 @@ async function handleFreeformJourneyInput(cwd, input) {
4473
4472
  return true;
4474
4473
  }
4475
4474
  console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
4476
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
4475
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
4477
4476
  await plan2(await withAllowedPathScope(cwd, freeform), { conversational: true });
4478
4477
  return true;
4479
4478
  }
@@ -4522,7 +4521,7 @@ function isFileLocationQuestion(input) {
4522
4521
  return true;
4523
4522
  }
4524
4523
  async function answerLatestOutputLocation(cwd) {
4525
- const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-I3P6U2ZM.js");
4524
+ const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-Y5S5VXMT.js");
4526
4525
  const atoms = await listLocalAtoms2();
4527
4526
  const latestDone = atoms.filter((atom) => atom.status === "DONE").sort((a, b) => {
4528
4527
  const aTime = new Date(String(a.updatedAt ?? a.createdAt ?? "")).getTime() || 0;
@@ -4571,7 +4570,7 @@ async function handlePostExploreAction(cwd, request, options = {}) {
4571
4570
  } else {
4572
4571
  console.log(chalk6.dim("> Got it! Creating a task for this...\n"));
4573
4572
  }
4574
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
4573
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
4575
4574
  await plan2(await withAllowedPathScope(cwd, request), { conversational: true });
4576
4575
  if (options.agentMode) {
4577
4576
  if (shouldAutoExecuteAfterPlanning(sourceInput)) {
@@ -4595,18 +4594,18 @@ Constraints:
4595
4594
  - If required files are outside this scope, propose the minimum architecture path update first.`;
4596
4595
  }
4597
4596
  async function planTask() {
4598
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
4597
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
4599
4598
  const description = await promptWithCommands("Describe what you want to build", { allowMultiline: true });
4600
4599
  if (description.trim()) {
4601
4600
  await plan2(description, { conversational: true });
4602
4601
  }
4603
4602
  }
4604
4603
  async function listAtoms() {
4605
- const { list: list2 } = await import("./list-K5J3OCXZ.js");
4604
+ const { list: list2 } = await import("./list-T5JXBHBF.js");
4606
4605
  await list2({});
4607
4606
  }
4608
4607
  async function executeNext() {
4609
- const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-I3P6U2ZM.js");
4608
+ const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-Y5S5VXMT.js");
4610
4609
  const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-HIF3KP25.js");
4611
4610
  const { loadExecutionPreferences } = await import("./preferences-MTGN2VZK.js");
4612
4611
  const cwd = process.cwd();
@@ -4677,11 +4676,11 @@ async function executeNext() {
4677
4676
  }
4678
4677
  }
4679
4678
  if (selectedMode === "parallel-cloud") {
4680
- const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-5UP6URF2.js");
4679
+ const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-NGAMZ22X.js");
4681
4680
  await parallelExecuteCloud2(runIds);
4682
4681
  return;
4683
4682
  }
4684
- const { parallelExecute } = await import("./parallel-5UP6URF2.js");
4683
+ const { parallelExecute } = await import("./parallel-NGAMZ22X.js");
4685
4684
  await parallelExecute(runIds);
4686
4685
  return;
4687
4686
  }
@@ -4689,7 +4688,7 @@ async function executeNext() {
4689
4688
  const atomId = await prompt("Enter atom ID to execute (or press Enter for first pending)");
4690
4689
  const targetId = atomId.trim() || pendingAtoms[0]?.id;
4691
4690
  if (targetId) {
4692
- const { execute: execute2 } = await import("./execute-QQ3OPP6H.js");
4691
+ const { execute: execute2 } = await import("./execute-MQFDA6EX.js");
4693
4692
  await execute2(targetId, {});
4694
4693
  } else {
4695
4694
  console.log(chalk6.yellow("No atom to execute."));
@@ -4838,7 +4837,7 @@ async function handleSlashCommand(input) {
4838
4837
  const arg = parts.slice(1).join(" ").trim();
4839
4838
  switch (command) {
4840
4839
  case "/plan": {
4841
- const { plan: plan2 } = await import("./plan-I3P6U2ZM.js");
4840
+ const { plan: plan2 } = await import("./plan-Y5S5VXMT.js");
4842
4841
  if (arg) {
4843
4842
  await plan2(arg, { conversational: true });
4844
4843
  } else {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  list
3
- } from "./chunk-MQKPOULB.js";
4
- import "./chunk-RH64CSQU.js";
3
+ } from "./chunk-UTI3SKKA.js";
4
+ import "./chunk-FKKVJFSW.js";
5
5
  import "./chunk-WGLVDEZC.js";
6
6
  import "./chunk-3MZOEZUH.js";
7
7
  import "./chunk-F7R3QKHP.js";
@@ -6,9 +6,9 @@ import {
6
6
  parallelRunWaves,
7
7
  parallelSchedule,
8
8
  parallelStatus
9
- } from "./chunk-JH3QUPQD.js";
9
+ } from "./chunk-PQINPCF7.js";
10
10
  import "./chunk-EBHHIUCB.js";
11
- import "./chunk-RH64CSQU.js";
11
+ import "./chunk-FKKVJFSW.js";
12
12
  import "./chunk-WGLVDEZC.js";
13
13
  import "./chunk-3MZOEZUH.js";
14
14
  import "./chunk-F7R3QKHP.js";
@@ -3,7 +3,7 @@ import {
3
3
  loadAtom,
4
4
  parseAtomDescription,
5
5
  plan
6
- } from "./chunk-RH64CSQU.js";
6
+ } from "./chunk-FKKVJFSW.js";
7
7
  import "./chunk-WGLVDEZC.js";
8
8
  import "./chunk-3MZOEZUH.js";
9
9
  import "./chunk-F7R3QKHP.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  show
3
- } from "./chunk-RLENHKO4.js";
4
- import "./chunk-RH64CSQU.js";
3
+ } from "./chunk-3A46HCAI.js";
4
+ import "./chunk-FKKVJFSW.js";
5
5
  import "./chunk-WGLVDEZC.js";
6
6
  import "./chunk-3MZOEZUH.js";
7
7
  import "./chunk-F7R3QKHP.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archondev",
3
- "version": "2.19.50",
3
+ "version": "2.19.52",
4
4
  "description": "Local-first AI-powered development governance system",
5
5
  "main": "dist/index.js",
6
6
  "bin": {