archondev 2.19.1 → 2.19.3
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/README.md +9 -0
- package/dist/{auth-HQBAG4CR.js → auth-7DNVC6UX.js} +2 -2
- package/dist/{chunk-QTBRLNZQ.js → chunk-4NP2AVJD.js} +1 -1
- package/dist/{chunk-ACFMKTDL.js → chunk-4VIBRFVY.js} +170 -1
- package/dist/{chunk-YA562WHL.js → chunk-6G4S6B5M.js} +1 -1
- package/dist/{chunk-CZCY63EY.js → chunk-F4OUCZPN.js} +1 -1
- package/dist/{chunk-OREGEFTF.js → chunk-F7U5AURY.js} +2 -2
- package/dist/{chunk-LBBHM4I5.js → chunk-GBYW3YAY.js} +3 -3
- package/dist/{chunk-75J2JMU3.js → chunk-JNFXMWBR.js} +4 -0
- package/dist/{chunk-ZJXIOETW.js → chunk-K3XN7PN6.js} +119 -34
- package/dist/{execute-ZTJGSRBW.js → execute-ST5ES4XI.js} +2 -2
- package/dist/index.js +56 -36
- package/dist/{keys-U4QZE5YB.js → keys-T2VPHE7Z.js} +1 -1
- package/dist/{list-REPLUXJF.js → list-GVC7CI5U.js} +2 -2
- package/dist/{parallel-23VQYK7H.js → parallel-5Z2X2FDD.js} +2 -2
- package/dist/{plan-HCYXLSSD.js → plan-XPUDPLT2.js} +1 -1
- package/dist/{preferences-I6WETXOI.js → preferences-SFXRVXT3.js} +8 -5
- package/dist/{tier-selection-426HA765.js → tier-selection-XFBM4SZ4.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,6 +77,7 @@ pnpm exec tsx scripts/init-governance-db.ts
|
|
|
77
77
|
| `archon credits` | View credit balance |
|
|
78
78
|
| `archon credits add` | Purchase credits |
|
|
79
79
|
| `archon credits budget` | Set monthly budget and alerts |
|
|
80
|
+
| `archon usage` | Usage by period and model (BYOK/Credits) |
|
|
80
81
|
| `archon keys add <provider>` | Add your own API key — BYOK (Bring Your Own Key) |
|
|
81
82
|
| `archon keys list` | Show configured API keys by provider |
|
|
82
83
|
| `archon preferences` | Interactive settings menu (billing, models, keys, usage) |
|
|
@@ -117,6 +118,7 @@ pnpm exec tsx scripts/init-governance-db.ts
|
|
|
117
118
|
|
|
118
119
|
**Notes:**
|
|
119
120
|
- Credits tier shows your balance and per‑model usage on startup; use `archon credits` for full details and history.
|
|
121
|
+
- BYOK shows per‑model usage and cost by today/week/month/year in `archon preferences` → “View usage details.”
|
|
120
122
|
- You can paste multi‑line requests into interactive prompts; Archon captures them as a single response.
|
|
121
123
|
|
|
122
124
|
**Tip:** Use `archon plan --edit` to adjust title and acceptance criteria before planning.
|
|
@@ -133,6 +135,13 @@ pnpm exec tsx scripts/init-governance-db.ts
|
|
|
133
135
|
|
|
134
136
|
No subscriptions. No commitments. Start free, upgrade anytime with `archon upgrade`.
|
|
135
137
|
|
|
138
|
+
### BYOK Key Security
|
|
139
|
+
|
|
140
|
+
- Your API keys are stored locally in `~/.archon/keys.json` (never uploaded to ArchonDev servers).
|
|
141
|
+
- Keys are encrypted at rest with AES-256-GCM and the file is set to owner-only permissions (`0600`).
|
|
142
|
+
- BYOK runs locally; cloud execution is Credits-only.
|
|
143
|
+
- If your device is compromised, an attacker could access local files. Treat keys as sensitive secrets.
|
|
144
|
+
|
|
136
145
|
### Claude Pro/Max Subscription Support (Coming Soon)
|
|
137
146
|
|
|
138
147
|
If you have an existing Claude subscription, you'll soon be able to use it with ArchonDev instead of API keys:
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
login,
|
|
3
3
|
logout,
|
|
4
4
|
status
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-F4OUCZPN.js";
|
|
6
6
|
import "./chunk-M4LGRTLC.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-GBYW3YAY.js";
|
|
8
8
|
import "./chunk-SVU7MLG6.js";
|
|
9
9
|
import "./chunk-4VNS5WPM.js";
|
|
10
10
|
export {
|
|
@@ -851,6 +851,13 @@ async function plan(description, options) {
|
|
|
851
851
|
requirements.length = 0;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
+
const classification = classifyTaskIntent({
|
|
855
|
+
description,
|
|
856
|
+
requirements,
|
|
857
|
+
references,
|
|
858
|
+
deliverableTarget: deliverableTarget ?? void 0
|
|
859
|
+
});
|
|
860
|
+
const isContentOnlyTask = classification.kind === "content";
|
|
854
861
|
console.log(chalk.dim("Creating atom from description..."));
|
|
855
862
|
const atomInput = parseAtomDescription(description, options, requirements);
|
|
856
863
|
const atom = createAtom(atomInput, {
|
|
@@ -872,6 +879,26 @@ async function plan(description, options) {
|
|
|
872
879
|
Atom created: ${atom.externalId}`));
|
|
873
880
|
console.log(chalk.dim(`Title: ${atom.title}`));
|
|
874
881
|
console.log(chalk.dim(`Acceptance Criteria: ${atom.acceptanceCriteria.length} items`));
|
|
882
|
+
if (isContentOnlyTask) {
|
|
883
|
+
console.log(chalk.blue("\nContent task detected. Creating a lightweight plan (no adversarial loop)."));
|
|
884
|
+
atom.plan = buildContentPlan({
|
|
885
|
+
description,
|
|
886
|
+
requirements,
|
|
887
|
+
referencedFiles: references,
|
|
888
|
+
deliverableTarget,
|
|
889
|
+
missingFiles
|
|
890
|
+
});
|
|
891
|
+
atom.status = "READY";
|
|
892
|
+
await saveAtom(atom);
|
|
893
|
+
console.log(chalk.green(`
|
|
894
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
895
|
+
console.log(chalk.dim(`Status: ${atom.status}`));
|
|
896
|
+
console.log(chalk.dim(`
|
|
897
|
+
Next steps:`));
|
|
898
|
+
console.log(chalk.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
899
|
+
console.log(chalk.dim(` - View: archon show ${atom.externalId}`));
|
|
900
|
+
return;
|
|
901
|
+
}
|
|
875
902
|
let apiKey = process.env["ANTHROPIC_API_KEY"];
|
|
876
903
|
if (!apiKey) {
|
|
877
904
|
const keyManager = new KeyManager();
|
|
@@ -926,8 +953,56 @@ Atom saved: ${atom.externalId}`));
|
|
|
926
953
|
}
|
|
927
954
|
}
|
|
928
955
|
}
|
|
956
|
+
const shouldAutoFallback = shouldFallbackToContentPlan({
|
|
957
|
+
classification,
|
|
958
|
+
description,
|
|
959
|
+
issues: planResult.iterations.flatMap(
|
|
960
|
+
(iteration) => iteration.validation.passed ? [] : iteration.validation.issues.map((issue) => issue.message)
|
|
961
|
+
)
|
|
962
|
+
});
|
|
963
|
+
if (shouldAutoFallback) {
|
|
964
|
+
console.log(chalk.blue("\nTask looks content-focused. Switching to lightweight plan."));
|
|
965
|
+
atom.plan = buildContentPlan({
|
|
966
|
+
description,
|
|
967
|
+
requirements,
|
|
968
|
+
referencedFiles: references,
|
|
969
|
+
deliverableTarget,
|
|
970
|
+
missingFiles
|
|
971
|
+
});
|
|
972
|
+
atom.status = "READY";
|
|
973
|
+
await saveAtom(atom);
|
|
974
|
+
console.log(chalk.green(`
|
|
975
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
976
|
+
console.log(chalk.dim(`Status: ${atom.status}`));
|
|
977
|
+
console.log(chalk.dim(`
|
|
978
|
+
Next steps:`));
|
|
979
|
+
console.log(chalk.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
980
|
+
console.log(chalk.dim(` - View: archon show ${atom.externalId}`));
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
929
983
|
const answer2 = await prompt.ask("\nSave as draft anyway? (y/N): ");
|
|
930
|
-
|
|
984
|
+
const normalized = answer2.toLowerCase();
|
|
985
|
+
if (normalized.includes("wrong") || normalized.includes("content") || normalized.includes("not a code")) {
|
|
986
|
+
console.log(chalk.blue("\nReclassifying as content task and creating a lightweight plan."));
|
|
987
|
+
atom.plan = buildContentPlan({
|
|
988
|
+
description,
|
|
989
|
+
requirements,
|
|
990
|
+
referencedFiles: references,
|
|
991
|
+
deliverableTarget,
|
|
992
|
+
missingFiles
|
|
993
|
+
});
|
|
994
|
+
atom.status = "READY";
|
|
995
|
+
await saveAtom(atom);
|
|
996
|
+
console.log(chalk.green(`
|
|
997
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
998
|
+
console.log(chalk.dim(`Status: ${atom.status}`));
|
|
999
|
+
console.log(chalk.dim(`
|
|
1000
|
+
Next steps:`));
|
|
1001
|
+
console.log(chalk.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
1002
|
+
console.log(chalk.dim(` - View: archon show ${atom.externalId}`));
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
if (normalized !== "y") {
|
|
931
1006
|
console.log(chalk.dim("Atom discarded."));
|
|
932
1007
|
return;
|
|
933
1008
|
}
|
|
@@ -1029,6 +1104,100 @@ function extractNumberedRequirements(description) {
|
|
|
1029
1104
|
}
|
|
1030
1105
|
return requirements;
|
|
1031
1106
|
}
|
|
1107
|
+
function extractNumberedSteps(description) {
|
|
1108
|
+
const steps = [];
|
|
1109
|
+
const lines = description.split("\n");
|
|
1110
|
+
for (const line of lines) {
|
|
1111
|
+
const match = line.match(/^\s*(\d+)[\).]\s+(.+)$/);
|
|
1112
|
+
if (match && match[2]) {
|
|
1113
|
+
steps.push(match[2].trim());
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return steps;
|
|
1117
|
+
}
|
|
1118
|
+
function classifyTaskIntent(input) {
|
|
1119
|
+
const text = `${input.description}
|
|
1120
|
+
${input.requirements.join("\n")}`.toLowerCase();
|
|
1121
|
+
const signals = [];
|
|
1122
|
+
let contentScore = 0;
|
|
1123
|
+
let codeScore = 0;
|
|
1124
|
+
const contentCues = [
|
|
1125
|
+
/story|storytelling|storyboard|capsule|lesson|outline|narrative|plot|arc|character|conflict/,
|
|
1126
|
+
/illustration|visual|image|diagram|slides?|deck/,
|
|
1127
|
+
/write|draft|summarize|summarise|rewrite|edit|revise|polish/,
|
|
1128
|
+
/teach|teaching|curriculum|learning objectives?|lesson plan/
|
|
1129
|
+
];
|
|
1130
|
+
const codeCues = [
|
|
1131
|
+
/api|endpoint|server|backend|frontend|cli|database|schema|migration/,
|
|
1132
|
+
/typescript|javascript|python|go|rust|java|c\+\+|react|node/,
|
|
1133
|
+
/implement|refactor|compile|build|deploy|test|lint|ci/
|
|
1134
|
+
];
|
|
1135
|
+
for (const cue of contentCues) {
|
|
1136
|
+
if (cue.test(text)) {
|
|
1137
|
+
contentScore += 2;
|
|
1138
|
+
signals.push(`content:${cue.source}`);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
for (const cue of codeCues) {
|
|
1142
|
+
if (cue.test(text)) {
|
|
1143
|
+
codeScore += 2;
|
|
1144
|
+
signals.push(`code:${cue.source}`);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
const references = [...input.references];
|
|
1148
|
+
if (input.deliverableTarget) references.push(input.deliverableTarget);
|
|
1149
|
+
const contentRefs = references.filter((ref) => /\.(md|markdown|txt|rtf|pdf|png|jpg|jpeg|gif|svg|webp)$/i.test(ref));
|
|
1150
|
+
const codeRefs = references.filter((ref) => /\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|kt|cpp|c|h|sql|json|yml|yaml)$/i.test(ref));
|
|
1151
|
+
if (contentRefs.length > 0 && codeRefs.length === 0) {
|
|
1152
|
+
contentScore += 2;
|
|
1153
|
+
signals.push("content:refs");
|
|
1154
|
+
}
|
|
1155
|
+
if (codeRefs.length > 0) {
|
|
1156
|
+
codeScore += 2;
|
|
1157
|
+
signals.push("code:refs");
|
|
1158
|
+
}
|
|
1159
|
+
let kind = "mixed";
|
|
1160
|
+
let confidence = "low";
|
|
1161
|
+
if (contentScore >= 4 && contentScore >= codeScore + 2) {
|
|
1162
|
+
kind = "content";
|
|
1163
|
+
confidence = contentScore >= 6 ? "high" : "medium";
|
|
1164
|
+
} else if (codeScore >= 4 && codeScore >= contentScore + 2) {
|
|
1165
|
+
kind = "code";
|
|
1166
|
+
confidence = codeScore >= 6 ? "high" : "medium";
|
|
1167
|
+
}
|
|
1168
|
+
return { kind, confidence, contentScore, codeScore, signals };
|
|
1169
|
+
}
|
|
1170
|
+
function shouldFallbackToContentPlan(input) {
|
|
1171
|
+
if (input.classification.kind === "content") return true;
|
|
1172
|
+
const text = input.description.toLowerCase();
|
|
1173
|
+
const issueText = input.issues.join(" ").toLowerCase();
|
|
1174
|
+
const contentLike = /story|storytelling|capsule|lesson|outline|storyboard|illustration|visual|image/.test(text);
|
|
1175
|
+
const engineeringBlockers = /api|pipeline|module|interfaces|schema|database|timeout|rate limit|retry|cache|rollback|tests?/.test(issueText);
|
|
1176
|
+
if (contentLike && engineeringBlockers && input.classification.contentScore >= input.classification.codeScore) {
|
|
1177
|
+
return true;
|
|
1178
|
+
}
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
|
+
function buildContentPlan(input) {
|
|
1182
|
+
const stepsFromNumbering = extractNumberedSteps(input.description);
|
|
1183
|
+
const stepsFromRequirements = input.requirements.map((req) => `Create: ${req}`);
|
|
1184
|
+
const steps = stepsFromNumbering.length > 0 ? stepsFromNumbering : stepsFromRequirements.length > 0 ? stepsFromRequirements : ["Draft a clear outline", "Write the content", "Review and refine", "Finalize deliverable"];
|
|
1185
|
+
const files = /* @__PURE__ */ new Set();
|
|
1186
|
+
input.referencedFiles.forEach((f) => files.add(f));
|
|
1187
|
+
if (input.deliverableTarget) files.add(input.deliverableTarget);
|
|
1188
|
+
const risks = [];
|
|
1189
|
+
if (input.missingFiles.length > 0) {
|
|
1190
|
+
risks.push(`Missing inputs: ${input.missingFiles.join(", ")}`);
|
|
1191
|
+
}
|
|
1192
|
+
risks.push("Source material may be incomplete; validate against lesson content.");
|
|
1193
|
+
return {
|
|
1194
|
+
steps,
|
|
1195
|
+
files_to_modify: Array.from(files),
|
|
1196
|
+
dependencies: [],
|
|
1197
|
+
risks,
|
|
1198
|
+
estimated_complexity: steps.length > 6 ? "MEDIUM" : "LOW"
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1032
1201
|
function extractReferencedFiles(description) {
|
|
1033
1202
|
const references = /* @__PURE__ */ new Set();
|
|
1034
1203
|
const barePattern = /\b[\w./-]+\.(md|txt|json|yaml|yml|png|jpg|jpeg|gif|svg|pdf)\b/gi;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
UsageRecorder,
|
|
8
8
|
loadAtom
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4VIBRFVY.js";
|
|
10
10
|
import {
|
|
11
11
|
transitionAtom
|
|
12
12
|
} from "./chunk-PCTP3LKJ.js";
|
|
@@ -4793,7 +4793,7 @@ function createPrompt() {
|
|
|
4793
4793
|
}
|
|
4794
4794
|
async function execute(atomId, options) {
|
|
4795
4795
|
if (options.parallel && options.parallel.length > 0) {
|
|
4796
|
-
const { parallelExecute } = await import("./parallel-
|
|
4796
|
+
const { parallelExecute } = await import("./parallel-5Z2X2FDD.js");
|
|
4797
4797
|
const allAtomIds = [atomId, ...options.parallel];
|
|
4798
4798
|
await parallelExecute(allAtomIds, { skipGates: options.skipGates === true });
|
|
4799
4799
|
return;
|
|
@@ -43,7 +43,7 @@ async function offerReauthentication(reason) {
|
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
console.log();
|
|
46
|
-
const { login } = await import("./auth-
|
|
46
|
+
const { login } = await import("./auth-7DNVC6UX.js");
|
|
47
47
|
await login({ skipTierSelection: true });
|
|
48
48
|
const { loadConfig: reload } = await import("./config-JBPM2YAB.js");
|
|
49
49
|
const config = await reload();
|
|
@@ -207,7 +207,7 @@ async function promptForApiKey() {
|
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
if (provider) {
|
|
210
|
-
const { addKey } = await import("./keys-
|
|
210
|
+
const { addKey } = await import("./keys-T2VPHE7Z.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);
|
|
@@ -455,7 +455,7 @@ function promptYesNo(question, defaultValue) {
|
|
|
455
455
|
}
|
|
456
456
|
async function showKeyManagementMenu() {
|
|
457
457
|
const { keyManager } = await import("./keys-THCHXIFD.js");
|
|
458
|
-
const { listKeys, addKey, removeKey } = await import("./keys-
|
|
458
|
+
const { listKeys, addKey, removeKey } = await import("./keys-T2VPHE7Z.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"));
|
|
@@ -47,6 +47,10 @@ async function addKey(provider, options = {}) {
|
|
|
47
47
|
process.exit(1);
|
|
48
48
|
}
|
|
49
49
|
const label = options.label ?? "default";
|
|
50
|
+
console.log(chalk.dim("Security: Your API key stays on this machine (never uploaded)."));
|
|
51
|
+
console.log(chalk.dim(" \u2022 Encrypted at rest (AES-256-GCM)"));
|
|
52
|
+
console.log(chalk.dim(" \u2022 Stored in ~/.archon/keys.json with owner-only permissions (0600)"));
|
|
53
|
+
console.log(chalk.dim(" \u2022 Used only for local BYOK calls"));
|
|
50
54
|
const apiKey = await promptForKey(provider);
|
|
51
55
|
if (!apiKey) {
|
|
52
56
|
console.error(chalk.red("API key cannot be empty"));
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedSupabaseClient
|
|
3
|
+
} from "./chunk-Q3GIFHIQ.js";
|
|
1
4
|
import {
|
|
2
5
|
findModel,
|
|
3
6
|
getAllActiveModels,
|
|
@@ -14,7 +17,11 @@ import {
|
|
|
14
17
|
} from "./chunk-RDG5BUED.js";
|
|
15
18
|
import {
|
|
16
19
|
login
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-F4OUCZPN.js";
|
|
21
|
+
import {
|
|
22
|
+
SUPABASE_ANON_KEY,
|
|
23
|
+
SUPABASE_URL
|
|
24
|
+
} from "./chunk-M4LGRTLC.js";
|
|
18
25
|
import {
|
|
19
26
|
getApiUrl,
|
|
20
27
|
getAuthToken,
|
|
@@ -783,7 +790,7 @@ async function interactiveSettings() {
|
|
|
783
790
|
await interactiveSettings();
|
|
784
791
|
break;
|
|
785
792
|
case "4":
|
|
786
|
-
await
|
|
793
|
+
await showUsageDetails();
|
|
787
794
|
await interactiveSettings();
|
|
788
795
|
break;
|
|
789
796
|
case "5":
|
|
@@ -1071,7 +1078,7 @@ async function manageApiKeys() {
|
|
|
1071
1078
|
if (removeIndex >= 0 && removeIndex < providers.length) {
|
|
1072
1079
|
const providerToRemove = providers[removeIndex];
|
|
1073
1080
|
if (providerToRemove) {
|
|
1074
|
-
const { removeKey } = await import("./keys-
|
|
1081
|
+
const { removeKey } = await import("./keys-T2VPHE7Z.js");
|
|
1075
1082
|
await removeKey(providerToRemove);
|
|
1076
1083
|
}
|
|
1077
1084
|
}
|
|
@@ -1079,15 +1086,16 @@ async function manageApiKeys() {
|
|
|
1079
1086
|
}
|
|
1080
1087
|
const provider = providerMap[choice];
|
|
1081
1088
|
if (provider) {
|
|
1082
|
-
const { addKey } = await import("./keys-
|
|
1089
|
+
const { addKey } = await import("./keys-T2VPHE7Z.js");
|
|
1083
1090
|
await addKey(provider);
|
|
1084
1091
|
}
|
|
1085
1092
|
}
|
|
1086
|
-
async function
|
|
1093
|
+
async function showUsageDetails() {
|
|
1087
1094
|
console.log(chalk.bold("\n-- Usage Details --\n"));
|
|
1088
1095
|
const spinner = ora("Loading usage data...").start();
|
|
1089
1096
|
const config = await loadConfig();
|
|
1090
1097
|
const authToken = getAuthToken(config);
|
|
1098
|
+
const authId = config.userId;
|
|
1091
1099
|
if (!authToken) {
|
|
1092
1100
|
spinner.fail("Not logged in");
|
|
1093
1101
|
return;
|
|
@@ -1103,36 +1111,112 @@ async function viewUsageDetails() {
|
|
|
1103
1111
|
return;
|
|
1104
1112
|
}
|
|
1105
1113
|
const data = await response.json();
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
console.log(` Input: ${formatTokens(data.totalInputTokens)} tokens`);
|
|
1111
|
-
console.log(` Output: ${formatTokens(data.totalOutputTokens)} tokens`);
|
|
1112
|
-
console.log(` Total: ${formatTokens(data.totalInputTokens + data.totalOutputTokens)} tokens`);
|
|
1113
|
-
console.log();
|
|
1114
|
-
console.log(chalk.blue("Cost:"));
|
|
1115
|
-
console.log(` Base Cost: ${formatCost(data.totalBaseCost)}`);
|
|
1116
|
-
if (data.tier === "CREDITS") {
|
|
1117
|
-
const withFee = data.totalBaseCost * 1.1;
|
|
1118
|
-
console.log(` With 10% Fee: ${formatCost(withFee)}`);
|
|
1119
|
-
} else if (data.tier === "BYOK") {
|
|
1120
|
-
console.log(chalk.dim(" (Paid directly to your provider)"));
|
|
1121
|
-
}
|
|
1122
|
-
if (data.byModel && Object.keys(data.byModel).length > 0) {
|
|
1123
|
-
console.log();
|
|
1124
|
-
console.log(chalk.blue("By Model:"));
|
|
1125
|
-
for (const [model, stats] of Object.entries(data.byModel)) {
|
|
1126
|
-
const modelInfo = findModel(model);
|
|
1127
|
-
const name = modelInfo?.name ?? model;
|
|
1128
|
-
console.log(` ${name}: ${formatTokens(stats.inputTokens + stats.outputTokens)} tokens (${formatCost(stats.cost)})`);
|
|
1114
|
+
if (data.tier === "BYOK") {
|
|
1115
|
+
if (!authId) {
|
|
1116
|
+
console.log(chalk.yellow("Unable to resolve user ID for usage details."));
|
|
1117
|
+
return;
|
|
1129
1118
|
}
|
|
1130
|
-
|
|
1131
|
-
|
|
1119
|
+
const supabase = createAuthedSupabaseClient(SUPABASE_URL, SUPABASE_ANON_KEY, authToken);
|
|
1120
|
+
const { data: profileRow, error: profileError } = await supabase.from("user_profiles").select("id").eq("auth_id", authId).single();
|
|
1121
|
+
if (profileError || !profileRow?.id) {
|
|
1122
|
+
console.log(chalk.yellow("Unable to resolve profile for usage details."));
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
const profileId = profileRow.id;
|
|
1126
|
+
const now = /* @__PURE__ */ new Date();
|
|
1127
|
+
const yearStart = new Date(now.getFullYear(), 0, 1);
|
|
1128
|
+
const { data: usageRows, error } = await supabase.from("token_usage").select("model, input_tokens, output_tokens, base_cost, created_at").eq("user_id", profileId).gte("created_at", yearStart.toISOString()).lte("created_at", now.toISOString());
|
|
1129
|
+
if (error || !usageRows) {
|
|
1130
|
+
console.log(chalk.yellow("Unable to fetch BYOK usage data."));
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
const rows = usageRows;
|
|
1134
|
+
const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
1135
|
+
const startOfWeek = new Date(now.getFullYear(), now.getMonth(), now.getDate() - now.getDay());
|
|
1136
|
+
const startOfMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
1137
|
+
const periods = [
|
|
1138
|
+
{ label: "Today", start: startOfToday, end: now },
|
|
1139
|
+
{ label: "Week to Date (Sun\u2013Sat)", start: startOfWeek, end: now },
|
|
1140
|
+
{ label: "Month to Date", start: startOfMonth, end: now },
|
|
1141
|
+
{ label: "Year to Date", start: yearStart, end: now }
|
|
1142
|
+
];
|
|
1143
|
+
const aggregate = (start, end) => {
|
|
1144
|
+
let totalInputTokens = 0;
|
|
1145
|
+
let totalOutputTokens = 0;
|
|
1146
|
+
let totalCost = 0;
|
|
1147
|
+
const byModelMap = /* @__PURE__ */ new Map();
|
|
1148
|
+
for (const row of rows) {
|
|
1149
|
+
const ts = new Date(row.created_at);
|
|
1150
|
+
if (ts < start || ts > end) continue;
|
|
1151
|
+
totalInputTokens += row.input_tokens;
|
|
1152
|
+
totalOutputTokens += row.output_tokens;
|
|
1153
|
+
totalCost += row.base_cost;
|
|
1154
|
+
const existing = byModelMap.get(row.model);
|
|
1155
|
+
if (existing) {
|
|
1156
|
+
existing.inputTokens += row.input_tokens;
|
|
1157
|
+
existing.outputTokens += row.output_tokens;
|
|
1158
|
+
existing.cost += row.base_cost;
|
|
1159
|
+
} else {
|
|
1160
|
+
byModelMap.set(row.model, {
|
|
1161
|
+
inputTokens: row.input_tokens,
|
|
1162
|
+
outputTokens: row.output_tokens,
|
|
1163
|
+
cost: row.base_cost
|
|
1164
|
+
});
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
const byModel = Array.from(byModelMap.entries()).map(([model, stats]) => ({ model, ...stats })).sort((a, b) => b.cost - a.cost);
|
|
1168
|
+
return { totalInputTokens, totalOutputTokens, totalCost, byModel };
|
|
1169
|
+
};
|
|
1170
|
+
console.log(chalk.blue("BYOK Usage (local time):"));
|
|
1171
|
+
for (const period of periods) {
|
|
1172
|
+
const summary = aggregate(period.start, period.end);
|
|
1173
|
+
console.log();
|
|
1174
|
+
console.log(chalk.bold(`${period.label}:`));
|
|
1175
|
+
console.log(` ${period.start.toLocaleDateString()} \u2192 ${period.end.toLocaleDateString()}`);
|
|
1176
|
+
console.log(` Tokens: ${formatTokens(summary.totalInputTokens + summary.totalOutputTokens)} (in ${formatTokens(summary.totalInputTokens)} / out ${formatTokens(summary.totalOutputTokens)})`);
|
|
1177
|
+
console.log(` Cost: ${formatCost(summary.totalCost)} ${chalk.dim("(paid directly to provider)")}`);
|
|
1178
|
+
if (summary.byModel.length > 0) {
|
|
1179
|
+
console.log(chalk.dim(" By Model:"));
|
|
1180
|
+
for (const model of summary.byModel) {
|
|
1181
|
+
const modelInfo = findModel(model.model);
|
|
1182
|
+
const name = modelInfo?.name ?? model.model;
|
|
1183
|
+
const tokenTotal = model.inputTokens + model.outputTokens;
|
|
1184
|
+
console.log(` ${name}: ${formatTokens(tokenTotal)} tokens (${formatCost(model.cost)})`);
|
|
1185
|
+
}
|
|
1186
|
+
} else {
|
|
1187
|
+
console.log(chalk.dim(" No usage recorded."));
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
} else {
|
|
1191
|
+
console.log(chalk.blue("Current Billing Period:"));
|
|
1192
|
+
console.log(` ${data.periodStart} to ${data.periodEnd}`);
|
|
1193
|
+
console.log();
|
|
1194
|
+
console.log(chalk.blue("Token Usage:"));
|
|
1195
|
+
console.log(` Input: ${formatTokens(data.totalInputTokens)} tokens`);
|
|
1196
|
+
console.log(` Output: ${formatTokens(data.totalOutputTokens)} tokens`);
|
|
1197
|
+
console.log(` Total: ${formatTokens(data.totalInputTokens + data.totalOutputTokens)} tokens`);
|
|
1132
1198
|
console.log();
|
|
1133
|
-
console.log(chalk.blue("
|
|
1134
|
-
|
|
1135
|
-
|
|
1199
|
+
console.log(chalk.blue("Cost:"));
|
|
1200
|
+
console.log(` Base Cost: ${formatCost(data.totalBaseCost)}`);
|
|
1201
|
+
if (data.tier === "CREDITS") {
|
|
1202
|
+
const withFee = data.totalBaseCost * 1.1;
|
|
1203
|
+
console.log(` With 10% Fee: ${formatCost(withFee)}`);
|
|
1204
|
+
}
|
|
1205
|
+
if (data.byModel && data.byModel.length > 0) {
|
|
1206
|
+
console.log();
|
|
1207
|
+
console.log(chalk.blue("By Model:"));
|
|
1208
|
+
for (const stats of data.byModel) {
|
|
1209
|
+
const modelInfo = findModel(stats.model);
|
|
1210
|
+
const name = modelInfo?.name ?? stats.model;
|
|
1211
|
+
console.log(` ${name}: ${formatTokens(stats.inputTokens + stats.outputTokens)} tokens (${formatCost(stats.cost)})`);
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
if (data.byOperation && data.byOperation.length > 0) {
|
|
1215
|
+
console.log();
|
|
1216
|
+
console.log(chalk.blue("By Operation:"));
|
|
1217
|
+
for (const stats of data.byOperation) {
|
|
1218
|
+
console.log(` ${stats.operation}: ${formatTokens(stats.tokenCount)} tokens (${formatCost(stats.cost)})`);
|
|
1219
|
+
}
|
|
1136
1220
|
}
|
|
1137
1221
|
}
|
|
1138
1222
|
} catch {
|
|
@@ -1151,5 +1235,6 @@ export {
|
|
|
1151
1235
|
setPreference,
|
|
1152
1236
|
resetPreferences,
|
|
1153
1237
|
listModels,
|
|
1154
|
-
interactiveSettings
|
|
1238
|
+
interactiveSettings,
|
|
1239
|
+
showUsageDetails
|
|
1155
1240
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
execute
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F7U5AURY.js";
|
|
4
4
|
import "./chunk-EBHHIUCB.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-4VIBRFVY.js";
|
|
6
6
|
import "./chunk-PCTP3LKJ.js";
|
|
7
7
|
import "./chunk-PJRQI5UN.js";
|
|
8
8
|
import "./chunk-EIEU3IIY.js";
|
package/dist/index.js
CHANGED
|
@@ -26,8 +26,9 @@ import {
|
|
|
26
26
|
setExecutionPreference,
|
|
27
27
|
setPreference,
|
|
28
28
|
showExecutionPreferences,
|
|
29
|
-
showPreferences
|
|
30
|
-
|
|
29
|
+
showPreferences,
|
|
30
|
+
showUsageDetails
|
|
31
|
+
} from "./chunk-K3XN7PN6.js";
|
|
31
32
|
import {
|
|
32
33
|
a11yBadge,
|
|
33
34
|
a11yCheck,
|
|
@@ -46,13 +47,13 @@ import {
|
|
|
46
47
|
parallelRunWaves,
|
|
47
48
|
parallelSchedule,
|
|
48
49
|
parallelStatus
|
|
49
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-4NP2AVJD.js";
|
|
50
51
|
import {
|
|
51
52
|
DependencyParser,
|
|
52
53
|
EnvironmentConfigLoader,
|
|
53
54
|
EnvironmentValidator,
|
|
54
55
|
execute
|
|
55
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-F7U5AURY.js";
|
|
56
57
|
import {
|
|
57
58
|
cloudCancel,
|
|
58
59
|
cloudLogs,
|
|
@@ -60,12 +61,12 @@ import {
|
|
|
60
61
|
} from "./chunk-EBHHIUCB.js";
|
|
61
62
|
import {
|
|
62
63
|
list
|
|
63
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-6G4S6B5M.js";
|
|
64
65
|
import {
|
|
65
66
|
listLocalAtoms,
|
|
66
67
|
loadAtom,
|
|
67
68
|
plan
|
|
68
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-4VIBRFVY.js";
|
|
69
70
|
import "./chunk-PCTP3LKJ.js";
|
|
70
71
|
import "./chunk-PJRQI5UN.js";
|
|
71
72
|
import {
|
|
@@ -85,14 +86,14 @@ import {
|
|
|
85
86
|
listKeys,
|
|
86
87
|
removeKey,
|
|
87
88
|
setPrimaryKey
|
|
88
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-JNFXMWBR.js";
|
|
89
90
|
import "./chunk-TFSHS7EN.js";
|
|
90
91
|
import "./chunk-RDG5BUED.js";
|
|
91
92
|
import {
|
|
92
93
|
login,
|
|
93
94
|
logout,
|
|
94
95
|
status
|
|
95
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-F4OUCZPN.js";
|
|
96
97
|
import {
|
|
97
98
|
API_URL,
|
|
98
99
|
SUPABASE_ANON_KEY,
|
|
@@ -102,7 +103,7 @@ import {
|
|
|
102
103
|
handleTierSetup,
|
|
103
104
|
promptTierSelection,
|
|
104
105
|
updateUserTier
|
|
105
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-GBYW3YAY.js";
|
|
106
107
|
import {
|
|
107
108
|
getAuthToken,
|
|
108
109
|
loadConfig,
|
|
@@ -2850,22 +2851,22 @@ async function start(options = {}) {
|
|
|
2850
2851
|
const choice = await promptWithCommands("What would you like to do?", { allowMultiline: true });
|
|
2851
2852
|
switch (choice) {
|
|
2852
2853
|
case "1":
|
|
2853
|
-
const { handleTierSetup: handleTierSetup2 } = await import("./tier-selection-
|
|
2854
|
+
const { handleTierSetup: handleTierSetup2 } = await import("./tier-selection-XFBM4SZ4.js");
|
|
2854
2855
|
await handleTierSetup2("BYOK");
|
|
2855
2856
|
break;
|
|
2856
2857
|
case "2":
|
|
2857
|
-
const { updateUserTier: updateUserTier2 } = await import("./tier-selection-
|
|
2858
|
+
const { updateUserTier: updateUserTier2 } = await import("./tier-selection-XFBM4SZ4.js");
|
|
2858
2859
|
const result = await updateUserTier2("CREDITS");
|
|
2859
2860
|
if (result.success) {
|
|
2860
2861
|
config.tier = "CREDITS";
|
|
2861
2862
|
await saveConfig(config);
|
|
2862
2863
|
console.log(chalk6.green("\u2713 Switched to Managed Plan"));
|
|
2863
|
-
const { handleTierSetup: setupCredits } = await import("./tier-selection-
|
|
2864
|
+
const { handleTierSetup: setupCredits } = await import("./tier-selection-XFBM4SZ4.js");
|
|
2864
2865
|
await setupCredits("CREDITS");
|
|
2865
2866
|
}
|
|
2866
2867
|
break;
|
|
2867
2868
|
case "3":
|
|
2868
|
-
const { updateUserTier: downgrade } = await import("./tier-selection-
|
|
2869
|
+
const { updateUserTier: downgrade } = await import("./tier-selection-XFBM4SZ4.js");
|
|
2869
2870
|
const downgradeResult = await downgrade("FREE");
|
|
2870
2871
|
if (downgradeResult.success) {
|
|
2871
2872
|
config.tier = "FREE";
|
|
@@ -3184,7 +3185,7 @@ async function handleNewProject(cwd, _state) {
|
|
|
3184
3185
|
}
|
|
3185
3186
|
if (intent.mode === "ad_hoc" && intent.confidence >= 0.7) {
|
|
3186
3187
|
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
3187
|
-
const { plan: plan2 } = await import("./plan-
|
|
3188
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3188
3189
|
await plan2(initialResponse, {});
|
|
3189
3190
|
return;
|
|
3190
3191
|
}
|
|
@@ -3208,7 +3209,7 @@ async function handleNewProject(cwd, _state) {
|
|
|
3208
3209
|
break;
|
|
3209
3210
|
case "2":
|
|
3210
3211
|
console.log(chalk6.dim("\n> Creating a task for this...\n"));
|
|
3211
|
-
const { plan: plan2 } = await import("./plan-
|
|
3212
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3212
3213
|
await plan2(initialResponse, {});
|
|
3213
3214
|
break;
|
|
3214
3215
|
case "3":
|
|
@@ -3238,7 +3239,7 @@ async function showNewProjectMenu(cwd) {
|
|
|
3238
3239
|
case "3": {
|
|
3239
3240
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3240
3241
|
if (description.trim()) {
|
|
3241
|
-
const { plan: plan2 } = await import("./plan-
|
|
3242
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3242
3243
|
await plan2(description, {});
|
|
3243
3244
|
}
|
|
3244
3245
|
break;
|
|
@@ -3304,7 +3305,7 @@ async function runExploreFlow(cwd) {
|
|
|
3304
3305
|
case "1": {
|
|
3305
3306
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3306
3307
|
if (description.trim()) {
|
|
3307
|
-
const { plan: plan2 } = await import("./plan-
|
|
3308
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3308
3309
|
await plan2(description, {});
|
|
3309
3310
|
}
|
|
3310
3311
|
break;
|
|
@@ -3566,7 +3567,7 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3566
3567
|
if (continueChoice) {
|
|
3567
3568
|
const description = await promptWithCommands("Describe what you want to build first", { allowMultiline: true });
|
|
3568
3569
|
if (description.trim()) {
|
|
3569
|
-
const { plan: plan2 } = await import("./plan-
|
|
3570
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3570
3571
|
await plan2(description, {});
|
|
3571
3572
|
}
|
|
3572
3573
|
}
|
|
@@ -3620,7 +3621,7 @@ async function handleAdaptExisting(cwd, state) {
|
|
|
3620
3621
|
}
|
|
3621
3622
|
if (intent.mode === "ad_hoc" && intent.confidence >= 0.7) {
|
|
3622
3623
|
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
3623
|
-
const { plan: plan2 } = await import("./plan-
|
|
3624
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3624
3625
|
await plan2(response, {});
|
|
3625
3626
|
return;
|
|
3626
3627
|
}
|
|
@@ -3651,7 +3652,7 @@ async function showAdaptExistingMenu(cwd, state) {
|
|
|
3651
3652
|
case "2": {
|
|
3652
3653
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3653
3654
|
if (description.trim()) {
|
|
3654
|
-
const { plan: plan2 } = await import("./plan-
|
|
3655
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3655
3656
|
await plan2(description, {});
|
|
3656
3657
|
}
|
|
3657
3658
|
break;
|
|
@@ -3788,7 +3789,7 @@ async function showMainMenu() {
|
|
|
3788
3789
|
} }] : [],
|
|
3789
3790
|
{ key: "7", label: "Settings & Preferences", action: () => settingsMenu() },
|
|
3790
3791
|
{ key: "8", label: "Upgrade tier", action: async () => {
|
|
3791
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
3792
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
3792
3793
|
await showUpgradeMenu();
|
|
3793
3794
|
await showMainMenu();
|
|
3794
3795
|
} },
|
|
@@ -3799,10 +3800,26 @@ async function showMainMenu() {
|
|
|
3799
3800
|
}
|
|
3800
3801
|
console.log(chalk6.dim(' (Type "upgrade" or "help" anytime)'));
|
|
3801
3802
|
console.log();
|
|
3802
|
-
const selected = await promptWithCommands("Enter choice");
|
|
3803
|
+
const selected = await promptWithCommands("Enter choice", { allowMultiline: true });
|
|
3803
3804
|
const choice = choices.find((c) => c.key === selected.toLowerCase());
|
|
3804
3805
|
if (choice) {
|
|
3805
3806
|
await choice.action();
|
|
3807
|
+
} else if (selected.trim()) {
|
|
3808
|
+
const freeform = selected.trim();
|
|
3809
|
+
const intent = detectUserIntent(freeform);
|
|
3810
|
+
if (intent.mode === "explore" && intent.confidence >= 0.7) {
|
|
3811
|
+
console.log(chalk6.dim("\n> Got it! Analyzing the project...\n"));
|
|
3812
|
+
await runExploreFlow(cwd);
|
|
3813
|
+
return;
|
|
3814
|
+
}
|
|
3815
|
+
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
3816
|
+
console.log(chalk6.dim("\n> Let me understand your project better...\n"));
|
|
3817
|
+
await runConversationalInterview(cwd, freeform);
|
|
3818
|
+
return;
|
|
3819
|
+
}
|
|
3820
|
+
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
3821
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3822
|
+
await plan2(freeform, {});
|
|
3806
3823
|
} else {
|
|
3807
3824
|
console.log(chalk6.yellow("Invalid choice. Please try again."));
|
|
3808
3825
|
await showMainMenu();
|
|
@@ -3827,20 +3844,20 @@ async function showReviewProgress(cwd) {
|
|
|
3827
3844
|
}
|
|
3828
3845
|
}
|
|
3829
3846
|
async function planTask() {
|
|
3830
|
-
const { plan: plan2 } = await import("./plan-
|
|
3847
|
+
const { plan: plan2 } = await import("./plan-XPUDPLT2.js");
|
|
3831
3848
|
const description = await promptWithCommands("Describe what you want to build", { allowMultiline: true });
|
|
3832
3849
|
if (description.trim()) {
|
|
3833
3850
|
await plan2(description, {});
|
|
3834
3851
|
}
|
|
3835
3852
|
}
|
|
3836
3853
|
async function listAtoms() {
|
|
3837
|
-
const { list: list2 } = await import("./list-
|
|
3854
|
+
const { list: list2 } = await import("./list-GVC7CI5U.js");
|
|
3838
3855
|
await list2({});
|
|
3839
3856
|
}
|
|
3840
3857
|
async function executeNext() {
|
|
3841
|
-
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-
|
|
3858
|
+
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-XPUDPLT2.js");
|
|
3842
3859
|
const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-HIF3KP25.js");
|
|
3843
|
-
const { loadExecutionPreferences } = await import("./preferences-
|
|
3860
|
+
const { loadExecutionPreferences } = await import("./preferences-SFXRVXT3.js");
|
|
3844
3861
|
const cwd = process.cwd();
|
|
3845
3862
|
const atoms = await listLocalAtoms2();
|
|
3846
3863
|
const pendingAtoms = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS");
|
|
@@ -3909,11 +3926,11 @@ async function executeNext() {
|
|
|
3909
3926
|
}
|
|
3910
3927
|
}
|
|
3911
3928
|
if (selectedMode === "parallel-cloud") {
|
|
3912
|
-
const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-
|
|
3929
|
+
const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-5Z2X2FDD.js");
|
|
3913
3930
|
await parallelExecuteCloud2(runIds);
|
|
3914
3931
|
return;
|
|
3915
3932
|
}
|
|
3916
|
-
const { parallelExecute } = await import("./parallel-
|
|
3933
|
+
const { parallelExecute } = await import("./parallel-5Z2X2FDD.js");
|
|
3917
3934
|
await parallelExecute(runIds);
|
|
3918
3935
|
return;
|
|
3919
3936
|
}
|
|
@@ -3921,7 +3938,7 @@ async function executeNext() {
|
|
|
3921
3938
|
const atomId = await prompt("Enter atom ID to execute (or press Enter for first pending)");
|
|
3922
3939
|
const targetId = atomId.trim() || pendingAtoms[0]?.id;
|
|
3923
3940
|
if (targetId) {
|
|
3924
|
-
const { execute: execute2 } = await import("./execute-
|
|
3941
|
+
const { execute: execute2 } = await import("./execute-ST5ES4XI.js");
|
|
3925
3942
|
await execute2(targetId, {});
|
|
3926
3943
|
} else {
|
|
3927
3944
|
console.log(chalk6.yellow("No atom to execute."));
|
|
@@ -3935,11 +3952,11 @@ async function reportBug() {
|
|
|
3935
3952
|
}
|
|
3936
3953
|
}
|
|
3937
3954
|
async function viewStatus() {
|
|
3938
|
-
const { status: status2 } = await import("./auth-
|
|
3955
|
+
const { status: status2 } = await import("./auth-7DNVC6UX.js");
|
|
3939
3956
|
await status2();
|
|
3940
3957
|
}
|
|
3941
3958
|
async function settingsMenu() {
|
|
3942
|
-
const { interactiveSettings } = await import("./preferences-
|
|
3959
|
+
const { interactiveSettings } = await import("./preferences-SFXRVXT3.js");
|
|
3943
3960
|
await interactiveSettings();
|
|
3944
3961
|
await showMainMenu();
|
|
3945
3962
|
}
|
|
@@ -3998,12 +4015,12 @@ async function reviewCode() {
|
|
|
3998
4015
|
async function handleInSessionCommand(input) {
|
|
3999
4016
|
const normalized = input.toLowerCase().trim();
|
|
4000
4017
|
if (normalized === "upgrade" || normalized === "archon upgrade" || normalized === "pricing" || normalized === "archon pricing") {
|
|
4001
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
4018
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
4002
4019
|
await showUpgradeMenu();
|
|
4003
4020
|
return true;
|
|
4004
4021
|
}
|
|
4005
4022
|
if (normalized === "status" || normalized === "archon status") {
|
|
4006
|
-
const { status: status2 } = await import("./auth-
|
|
4023
|
+
const { status: status2 } = await import("./auth-7DNVC6UX.js");
|
|
4007
4024
|
await status2();
|
|
4008
4025
|
return true;
|
|
4009
4026
|
}
|
|
@@ -4019,7 +4036,7 @@ async function handleInSessionCommand(input) {
|
|
|
4019
4036
|
return true;
|
|
4020
4037
|
}
|
|
4021
4038
|
if (normalized === "keys" || normalized === "archon keys") {
|
|
4022
|
-
const { listKeys: listKeys2 } = await import("./keys-
|
|
4039
|
+
const { listKeys: listKeys2 } = await import("./keys-T2VPHE7Z.js");
|
|
4023
4040
|
await listKeys2();
|
|
4024
4041
|
return true;
|
|
4025
4042
|
}
|
|
@@ -8175,11 +8192,11 @@ program.command("status").description("Show current user and project status").ac
|
|
|
8175
8192
|
await status();
|
|
8176
8193
|
});
|
|
8177
8194
|
program.command("upgrade").description("Upgrade your tier (BYOK for free unlimited, or Managed plan)").action(async () => {
|
|
8178
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
8195
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
8179
8196
|
await showUpgradeMenu();
|
|
8180
8197
|
});
|
|
8181
8198
|
program.command("pricing", { hidden: true }).action(async () => {
|
|
8182
|
-
const { showUpgradeMenu } = await import("./tier-selection-
|
|
8199
|
+
const { showUpgradeMenu } = await import("./tier-selection-XFBM4SZ4.js");
|
|
8183
8200
|
await showUpgradeMenu();
|
|
8184
8201
|
});
|
|
8185
8202
|
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) => {
|
|
@@ -8243,6 +8260,9 @@ creditsCommand.command("audit").description("Show billing audit log (immutable r
|
|
|
8243
8260
|
creditsCommand.action(async () => {
|
|
8244
8261
|
await showCredits();
|
|
8245
8262
|
});
|
|
8263
|
+
program.command("usage").description("Show usage by period and model").action(async () => {
|
|
8264
|
+
await showUsageDetails();
|
|
8265
|
+
});
|
|
8246
8266
|
var preferencesCommand = program.command("preferences").description("Manage default model preferences");
|
|
8247
8267
|
preferencesCommand.command("set <key> <model>").description("Set a model preference (fast-model, thinking-model, primary-adversarial, secondary-adversarial)").action(async (key, model) => {
|
|
8248
8268
|
await setPreference(key, model);
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
parallelRunWaves,
|
|
7
7
|
parallelSchedule,
|
|
8
8
|
parallelStatus
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4NP2AVJD.js";
|
|
10
10
|
import "./chunk-EBHHIUCB.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-4VIBRFVY.js";
|
|
12
12
|
import "./chunk-PCTP3LKJ.js";
|
|
13
13
|
import "./chunk-PJRQI5UN.js";
|
|
14
14
|
import "./chunk-EIEU3IIY.js";
|
|
@@ -6,14 +6,16 @@ import {
|
|
|
6
6
|
setExecutionPreference,
|
|
7
7
|
setPreference,
|
|
8
8
|
showExecutionPreferences,
|
|
9
|
-
showPreferences
|
|
10
|
-
|
|
9
|
+
showPreferences,
|
|
10
|
+
showUsageDetails
|
|
11
|
+
} from "./chunk-K3XN7PN6.js";
|
|
12
|
+
import "./chunk-Q3GIFHIQ.js";
|
|
11
13
|
import "./chunk-UFR2LX6G.js";
|
|
12
14
|
import "./chunk-TFSHS7EN.js";
|
|
13
15
|
import "./chunk-RDG5BUED.js";
|
|
14
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-F4OUCZPN.js";
|
|
15
17
|
import "./chunk-M4LGRTLC.js";
|
|
16
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-GBYW3YAY.js";
|
|
17
19
|
import "./chunk-SVU7MLG6.js";
|
|
18
20
|
import "./chunk-4VNS5WPM.js";
|
|
19
21
|
export {
|
|
@@ -24,5 +26,6 @@ export {
|
|
|
24
26
|
setExecutionPreference,
|
|
25
27
|
setPreference,
|
|
26
28
|
showExecutionPreferences,
|
|
27
|
-
showPreferences
|
|
29
|
+
showPreferences,
|
|
30
|
+
showUsageDetails
|
|
28
31
|
};
|