archondev 2.19.15 → 2.19.18
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/dist/{chunk-MBRWJ3SX.js → chunk-6KE53F2W.js} +1 -1
- package/dist/{chunk-4E3LJAXF.js → chunk-LWNFP7BL.js} +2 -2
- package/dist/{chunk-JFUG25H7.js → chunk-PSUBO3TR.js} +173 -64
- package/dist/{chunk-FP4B73CC.js → chunk-RWNRCLN5.js} +1 -1
- package/dist/{execute-UWJPIG6C.js → execute-3IUO33KY.js} +2 -2
- package/dist/index.js +77 -35
- package/dist/{list-3IMEKFQZ.js → list-P5H2N6WT.js} +2 -2
- package/dist/{parallel-ZBFFEUBW.js → parallel-DBPSYNE4.js} +2 -2
- package/dist/{plan-AR6Y4QUD.js → plan-W4WQY7BR.js} +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
UsageRecorder,
|
|
8
8
|
handleInsufficientCreditsRecovery,
|
|
9
9
|
loadAtom
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PSUBO3TR.js";
|
|
11
11
|
import {
|
|
12
12
|
transitionAtom
|
|
13
13
|
} from "./chunk-PCTP3LKJ.js";
|
|
@@ -4797,7 +4797,7 @@ function createPrompt() {
|
|
|
4797
4797
|
}
|
|
4798
4798
|
async function execute(atomId, options) {
|
|
4799
4799
|
if (options.parallel && options.parallel.length > 0) {
|
|
4800
|
-
const { parallelExecute } = await import("./parallel-
|
|
4800
|
+
const { parallelExecute } = await import("./parallel-DBPSYNE4.js");
|
|
4801
4801
|
const allAtomIds = [atomId, ...options.parallel];
|
|
4802
4802
|
await parallelExecute(allAtomIds, { skipGates: options.skipGates === true });
|
|
4803
4803
|
return;
|
|
@@ -831,6 +831,7 @@ function createPrompt() {
|
|
|
831
831
|
}
|
|
832
832
|
async function plan(description, options) {
|
|
833
833
|
const prompt2 = createPrompt();
|
|
834
|
+
const conversational = options.conversational === true;
|
|
834
835
|
try {
|
|
835
836
|
if (!await isAuthenticated()) {
|
|
836
837
|
console.log(chalk2.yellow('Not authenticated. Run "archon login" first.'));
|
|
@@ -865,25 +866,30 @@ async function plan(description, options) {
|
|
|
865
866
|
for (const missing of missingFiles) {
|
|
866
867
|
console.log(chalk2.yellow(` - ${missing}`));
|
|
867
868
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
console.log(chalk2.dim(" 2) Continue and mark missing files as required"));
|
|
871
|
-
console.log(chalk2.dim(" 3) Continue with default placeholders"));
|
|
872
|
-
const proceedChoice = await prompt2.ask("Choose 1/2/3 (default: 1): ");
|
|
873
|
-
const choice = proceedChoice.trim() || "1";
|
|
874
|
-
if (choice === "1") {
|
|
875
|
-
console.log(chalk2.dim("Planning cancelled."));
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
if (choice === "2") {
|
|
869
|
+
if (conversational) {
|
|
870
|
+
console.log(chalk2.dim("Continuing for now and marking missing inputs as required."));
|
|
879
871
|
missingFiles.forEach((file) => requirements.push(`Missing input required: ${file}`));
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
|
|
872
|
+
} else {
|
|
873
|
+
console.log(chalk2.dim("\nHow would you like to proceed?"));
|
|
874
|
+
console.log(chalk2.dim(" 1) Cancel planning and add the missing files"));
|
|
875
|
+
console.log(chalk2.dim(" 2) Continue and mark missing files as required"));
|
|
876
|
+
console.log(chalk2.dim(" 3) Continue with default placeholders"));
|
|
877
|
+
const proceedChoice = await prompt2.ask("Choose 1/2/3 (default: 1): ");
|
|
878
|
+
const choice = proceedChoice.trim() || "1";
|
|
879
|
+
if (choice === "1") {
|
|
880
|
+
console.log(chalk2.dim("Planning cancelled."));
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
if (choice === "2") {
|
|
884
|
+
missingFiles.forEach((file) => requirements.push(`Missing input required: ${file}`));
|
|
885
|
+
}
|
|
886
|
+
if (choice === "3") {
|
|
887
|
+
missingFiles.forEach((file) => requirements.push(`Use default placeholder for missing input: ${file}`));
|
|
888
|
+
}
|
|
883
889
|
}
|
|
884
890
|
}
|
|
885
891
|
}
|
|
886
|
-
const deliverableTarget = await promptForDeliverableTarget(
|
|
892
|
+
const deliverableTarget = conversational ? null : await promptForDeliverableTarget(
|
|
887
893
|
prompt2,
|
|
888
894
|
requirements,
|
|
889
895
|
references
|
|
@@ -894,9 +900,11 @@ async function plan(description, options) {
|
|
|
894
900
|
if (requirements.length > 0) {
|
|
895
901
|
console.log(chalk2.dim("\nDetected requirements:"));
|
|
896
902
|
requirements.forEach((req, i) => console.log(` ${i + 1}. ${req}`));
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
903
|
+
if (!conversational) {
|
|
904
|
+
const confirm = await prompt2.ask("\nUse these as acceptance criteria? (Y/n): ");
|
|
905
|
+
if (confirm.toLowerCase() === "n") {
|
|
906
|
+
requirements.length = 0;
|
|
907
|
+
}
|
|
900
908
|
}
|
|
901
909
|
}
|
|
902
910
|
let classification = classifyTaskIntent({
|
|
@@ -906,18 +914,13 @@ async function plan(description, options) {
|
|
|
906
914
|
deliverableTarget: deliverableTarget ?? void 0
|
|
907
915
|
});
|
|
908
916
|
if (classification.kind === "mixed" && classification.confidence === "low") {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
kind: clarifiedKind,
|
|
914
|
-
confidence: "high",
|
|
915
|
-
signals: [...classification.signals, `user:${clarifiedKind}`]
|
|
916
|
-
};
|
|
917
|
-
}
|
|
917
|
+
classification = {
|
|
918
|
+
...classification,
|
|
919
|
+
confidence: "medium"
|
|
920
|
+
};
|
|
918
921
|
}
|
|
919
922
|
const isContentOnlyTask = classification.kind === "content";
|
|
920
|
-
const designApproved = await promptForDesignApproval(prompt2, {
|
|
923
|
+
const designApproved = conversational ? true : await promptForDesignApproval(prompt2, {
|
|
921
924
|
description,
|
|
922
925
|
requirements,
|
|
923
926
|
references,
|
|
@@ -951,6 +954,30 @@ async function plan(description, options) {
|
|
|
951
954
|
Atom created: ${atom.externalId}`));
|
|
952
955
|
console.log(chalk2.dim(`Title: ${atom.title}`));
|
|
953
956
|
console.log(chalk2.dim(`Acceptance Criteria: ${atom.acceptanceCriteria.length} items`));
|
|
957
|
+
if (conversational) {
|
|
958
|
+
atom.plan = classification.kind === "content" ? buildContentPlan({
|
|
959
|
+
description,
|
|
960
|
+
requirements,
|
|
961
|
+
referencedFiles: references,
|
|
962
|
+
deliverableTarget,
|
|
963
|
+
missingFiles
|
|
964
|
+
}) : buildConversationalFallbackPlan({
|
|
965
|
+
description,
|
|
966
|
+
requirements,
|
|
967
|
+
references,
|
|
968
|
+
deliverableTarget
|
|
969
|
+
});
|
|
970
|
+
atom.status = "READY";
|
|
971
|
+
await saveAtom(atom);
|
|
972
|
+
console.log(chalk2.green(`
|
|
973
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
974
|
+
console.log(chalk2.dim(`Status: ${atom.status}`));
|
|
975
|
+
console.log(chalk2.dim(`
|
|
976
|
+
Next steps:`));
|
|
977
|
+
console.log(chalk2.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
978
|
+
console.log(chalk2.dim(` - View: archon show ${atom.externalId}`));
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
954
981
|
if (isContentOnlyTask) {
|
|
955
982
|
console.log(chalk2.blue("\nContent task detected. Creating a lightweight plan (no adversarial loop)."));
|
|
956
983
|
atom.plan = buildContentPlan({
|
|
@@ -1004,7 +1031,11 @@ Atom saved: ${atom.externalId}`));
|
|
|
1004
1031
|
}
|
|
1005
1032
|
const planner = billingContext ? new TrackedAdversarialPlanner({ apiKey, billing: billingContext }) : new AdversarialPlanner({ apiKey });
|
|
1006
1033
|
if (billingContext && planner instanceof TrackedAdversarialPlanner) {
|
|
1007
|
-
let balanceCheck = await
|
|
1034
|
+
let balanceCheck = await withTimeout(
|
|
1035
|
+
planner.checkBalance(),
|
|
1036
|
+
conversational ? 15e3 : 3e4,
|
|
1037
|
+
"Balance check timed out"
|
|
1038
|
+
);
|
|
1008
1039
|
if (balanceCheck.tier === "CREDITS") {
|
|
1009
1040
|
console.log(chalk2.dim(`Estimated planning cost: $${(balanceCheck.estimatedCostCents / 100).toFixed(2)} | Balance: $${(balanceCheck.balance / 100).toFixed(2)}`));
|
|
1010
1041
|
}
|
|
@@ -1017,7 +1048,11 @@ Atom saved: ${atom.externalId}`));
|
|
|
1017
1048
|
if (recovery === "abort") {
|
|
1018
1049
|
return;
|
|
1019
1050
|
}
|
|
1020
|
-
balanceCheck = await
|
|
1051
|
+
balanceCheck = await withTimeout(
|
|
1052
|
+
planner.checkBalance(),
|
|
1053
|
+
conversational ? 15e3 : 3e4,
|
|
1054
|
+
"Balance re-check timed out"
|
|
1055
|
+
);
|
|
1021
1056
|
if (!balanceCheck.sufficient && balanceCheck.tier === "CREDITS") {
|
|
1022
1057
|
console.log(chalk2.red("\nStill insufficient credits after recovery action."));
|
|
1023
1058
|
console.log(chalk2.dim("Please add more credits with: archon credits add"));
|
|
@@ -1026,7 +1061,35 @@ Atom saved: ${atom.externalId}`));
|
|
|
1026
1061
|
}
|
|
1027
1062
|
}
|
|
1028
1063
|
}
|
|
1029
|
-
|
|
1064
|
+
let planResult;
|
|
1065
|
+
try {
|
|
1066
|
+
planResult = await withTimeout(
|
|
1067
|
+
planner.planAtom(atom, parseResult.schema),
|
|
1068
|
+
conversational ? 45e3 : 12e4,
|
|
1069
|
+
"Planning timed out"
|
|
1070
|
+
);
|
|
1071
|
+
} catch (error) {
|
|
1072
|
+
if (!conversational) {
|
|
1073
|
+
throw error;
|
|
1074
|
+
}
|
|
1075
|
+
console.log(chalk2.yellow("\nPlanner is taking too long. Switching to a quick fallback plan."));
|
|
1076
|
+
atom.plan = buildConversationalFallbackPlan({
|
|
1077
|
+
description,
|
|
1078
|
+
requirements,
|
|
1079
|
+
references,
|
|
1080
|
+
deliverableTarget
|
|
1081
|
+
});
|
|
1082
|
+
atom.status = "READY";
|
|
1083
|
+
await saveAtom(atom);
|
|
1084
|
+
console.log(chalk2.green(`
|
|
1085
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
1086
|
+
console.log(chalk2.dim(`Status: ${atom.status}`));
|
|
1087
|
+
console.log(chalk2.dim(`
|
|
1088
|
+
Next steps:`));
|
|
1089
|
+
console.log(chalk2.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
1090
|
+
console.log(chalk2.dim(` - View: archon show ${atom.externalId}`));
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1030
1093
|
if (!planResult.approved) {
|
|
1031
1094
|
console.log(chalk2.red("\n\u274C Plan not approved after maximum iterations."));
|
|
1032
1095
|
console.log(chalk2.yellow("Issues found:"));
|
|
@@ -1064,8 +1127,27 @@ Next steps:`));
|
|
|
1064
1127
|
console.log(chalk2.dim(` - View: archon show ${atom.externalId}`));
|
|
1065
1128
|
return;
|
|
1066
1129
|
}
|
|
1067
|
-
|
|
1068
|
-
|
|
1130
|
+
if (conversational) {
|
|
1131
|
+
console.log(chalk2.yellow("\nPlan was not fully approved. Saving a pragmatic fallback plan so you can continue."));
|
|
1132
|
+
atom.plan = buildConversationalFallbackPlan({
|
|
1133
|
+
description,
|
|
1134
|
+
requirements,
|
|
1135
|
+
references,
|
|
1136
|
+
deliverableTarget
|
|
1137
|
+
});
|
|
1138
|
+
atom.status = "READY";
|
|
1139
|
+
await saveAtom(atom);
|
|
1140
|
+
console.log(chalk2.green(`
|
|
1141
|
+
\u2705 Atom saved: ${atom.externalId}`));
|
|
1142
|
+
console.log(chalk2.dim(`Status: ${atom.status}`));
|
|
1143
|
+
console.log(chalk2.dim(`
|
|
1144
|
+
Next steps:`));
|
|
1145
|
+
console.log(chalk2.dim(` - Execute: archon execute ${atom.externalId}`));
|
|
1146
|
+
console.log(chalk2.dim(` - View: archon show ${atom.externalId}`));
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
const answer = await prompt2.ask("\nSave as draft anyway? (y/N): ");
|
|
1150
|
+
const normalized = answer.toLowerCase();
|
|
1069
1151
|
if (normalized.includes("wrong") || normalized.includes("content") || normalized.includes("not a code")) {
|
|
1070
1152
|
console.log(chalk2.blue("\nReclassifying as content task and creating a lightweight plan."));
|
|
1071
1153
|
atom.plan = buildContentPlan({
|
|
@@ -1110,16 +1192,26 @@ Token usage: ${planResult.totalUsage.inputTokens} input, ${planResult.totalUsage
|
|
|
1110
1192
|
}
|
|
1111
1193
|
}
|
|
1112
1194
|
}
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
} else {
|
|
1121
|
-
atom.plan = planResult.finalPlan;
|
|
1195
|
+
if (conversational) {
|
|
1196
|
+
atom.plan = planResult.finalPlan ?? buildConversationalFallbackPlan({
|
|
1197
|
+
description,
|
|
1198
|
+
requirements,
|
|
1199
|
+
references,
|
|
1200
|
+
deliverableTarget
|
|
1201
|
+
});
|
|
1122
1202
|
atom.status = "READY";
|
|
1203
|
+
} else {
|
|
1204
|
+
const answer = await prompt2.ask("\nApprove this plan? (y/N/e for edit): ");
|
|
1205
|
+
if (answer.toLowerCase() === "e") {
|
|
1206
|
+
console.log(chalk2.yellow("Edit mode not yet implemented. Saving as draft."));
|
|
1207
|
+
atom.status = "DRAFT";
|
|
1208
|
+
} else if (answer.toLowerCase() !== "y") {
|
|
1209
|
+
console.log(chalk2.dim("Atom discarded."));
|
|
1210
|
+
return;
|
|
1211
|
+
} else {
|
|
1212
|
+
atom.plan = planResult.finalPlan;
|
|
1213
|
+
atom.status = "READY";
|
|
1214
|
+
}
|
|
1123
1215
|
}
|
|
1124
1216
|
await saveAtom(atom);
|
|
1125
1217
|
console.log(chalk2.green(`
|
|
@@ -1134,6 +1226,17 @@ Next steps:`));
|
|
|
1134
1226
|
prompt2.close();
|
|
1135
1227
|
}
|
|
1136
1228
|
}
|
|
1229
|
+
function withTimeout(promise, ms, message) {
|
|
1230
|
+
let timeoutHandle;
|
|
1231
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
1232
|
+
timeoutHandle = setTimeout(() => reject(new Error(message)), ms);
|
|
1233
|
+
});
|
|
1234
|
+
return Promise.race([promise, timeoutPromise]).finally(() => {
|
|
1235
|
+
if (timeoutHandle) {
|
|
1236
|
+
clearTimeout(timeoutHandle);
|
|
1237
|
+
}
|
|
1238
|
+
});
|
|
1239
|
+
}
|
|
1137
1240
|
function printPlanNextActions(atomExternalId, success) {
|
|
1138
1241
|
console.log();
|
|
1139
1242
|
console.log(chalk2.bold("Next best action:"));
|
|
@@ -1329,28 +1432,6 @@ ${input.requirements.join("\n")}`.toLowerCase();
|
|
|
1329
1432
|
}
|
|
1330
1433
|
return { kind, confidence, contentScore, codeScore, signals };
|
|
1331
1434
|
}
|
|
1332
|
-
async function promptForTaskKindClarification(prompt2, description) {
|
|
1333
|
-
console.log(chalk2.yellow("\nThis request can be interpreted in multiple ways."));
|
|
1334
|
-
console.log(chalk2.dim("To keep planning on track, choose the primary outcome:"));
|
|
1335
|
-
console.log(chalk2.dim(" 1) Content deliverable (PDF/docs/slides/report)"));
|
|
1336
|
-
console.log(chalk2.dim(" 2) Code implementation (features/refactors/tests)"));
|
|
1337
|
-
console.log(chalk2.dim(" Enter to auto-pick based on your wording."));
|
|
1338
|
-
const answer = (await prompt2.ask("Primary outcome (1/2): ")).trim().toLowerCase();
|
|
1339
|
-
if (answer === "1" || answer.includes("content") || answer.includes("pdf") || answer.includes("doc")) {
|
|
1340
|
-
return "content";
|
|
1341
|
-
}
|
|
1342
|
-
if (answer === "2" || answer.includes("code") || answer.includes("implement") || answer.includes("feature")) {
|
|
1343
|
-
return "code";
|
|
1344
|
-
}
|
|
1345
|
-
const normalized = description.toLowerCase();
|
|
1346
|
-
if (/(pdf|document|report|slides?|lesson|curriculum|format)/.test(normalized)) {
|
|
1347
|
-
return "content";
|
|
1348
|
-
}
|
|
1349
|
-
if (/(api|endpoint|schema|migration|typescript|javascript|python|refactor|test|lint|build)/.test(normalized)) {
|
|
1350
|
-
return "code";
|
|
1351
|
-
}
|
|
1352
|
-
return null;
|
|
1353
|
-
}
|
|
1354
1435
|
function shouldFallbackToContentPlan(input) {
|
|
1355
1436
|
if (input.classification.kind === "content") return true;
|
|
1356
1437
|
const text = input.description.toLowerCase();
|
|
@@ -1382,6 +1463,34 @@ function buildContentPlan(input) {
|
|
|
1382
1463
|
estimated_complexity: steps.length > 6 ? "MEDIUM" : "LOW"
|
|
1383
1464
|
};
|
|
1384
1465
|
}
|
|
1466
|
+
function buildConversationalFallbackPlan(input) {
|
|
1467
|
+
const steps = [];
|
|
1468
|
+
if (input.references.length > 0) {
|
|
1469
|
+
steps.push(`Review referenced inputs: ${input.references.join(", ")}`);
|
|
1470
|
+
} else {
|
|
1471
|
+
steps.push("Review current project files relevant to the request");
|
|
1472
|
+
}
|
|
1473
|
+
if (input.requirements.length > 0) {
|
|
1474
|
+
steps.push("Draft implementation outline directly from the detected requirements");
|
|
1475
|
+
} else {
|
|
1476
|
+
steps.push("Define a concrete implementation outline for the requested outcome");
|
|
1477
|
+
}
|
|
1478
|
+
steps.push("Create the first deliverable increment and validate against user intent");
|
|
1479
|
+
steps.push("Summarize the plan and execution-ready next action");
|
|
1480
|
+
if (input.deliverableTarget) {
|
|
1481
|
+
steps.push(`Write output to ${input.deliverableTarget}`);
|
|
1482
|
+
}
|
|
1483
|
+
return {
|
|
1484
|
+
steps,
|
|
1485
|
+
files_to_modify: input.references,
|
|
1486
|
+
dependencies: [],
|
|
1487
|
+
risks: [
|
|
1488
|
+
"Reference mismatch risk: confirm inferred requirements against provided source documents.",
|
|
1489
|
+
"Scope drift risk: keep first increment focused on the requested sample deliverable."
|
|
1490
|
+
],
|
|
1491
|
+
estimated_complexity: "LOW"
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1385
1494
|
function extractReferencedFiles(description) {
|
|
1386
1495
|
const references = /* @__PURE__ */ new Set();
|
|
1387
1496
|
const barePattern = /\b[\w./-]+\.(md|txt|json|yaml|yml|png|jpg|jpeg|gif|svg|pdf)\b/gi;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
execute
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LWNFP7BL.js";
|
|
4
4
|
import "./chunk-EBHHIUCB.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-PSUBO3TR.js";
|
|
6
6
|
import "./chunk-PCTP3LKJ.js";
|
|
7
7
|
import "./chunk-PJRQI5UN.js";
|
|
8
8
|
import "./chunk-EIEU3IIY.js";
|
package/dist/index.js
CHANGED
|
@@ -47,13 +47,13 @@ import {
|
|
|
47
47
|
parallelRunWaves,
|
|
48
48
|
parallelSchedule,
|
|
49
49
|
parallelStatus
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-RWNRCLN5.js";
|
|
51
51
|
import {
|
|
52
52
|
DependencyParser,
|
|
53
53
|
EnvironmentConfigLoader,
|
|
54
54
|
EnvironmentValidator,
|
|
55
55
|
execute
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-LWNFP7BL.js";
|
|
57
57
|
import {
|
|
58
58
|
cloudCancel,
|
|
59
59
|
cloudLogs,
|
|
@@ -61,12 +61,12 @@ import {
|
|
|
61
61
|
} from "./chunk-EBHHIUCB.js";
|
|
62
62
|
import {
|
|
63
63
|
list
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-6KE53F2W.js";
|
|
65
65
|
import {
|
|
66
66
|
listLocalAtoms,
|
|
67
67
|
loadAtom,
|
|
68
68
|
plan
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-PSUBO3TR.js";
|
|
70
70
|
import "./chunk-PCTP3LKJ.js";
|
|
71
71
|
import "./chunk-PJRQI5UN.js";
|
|
72
72
|
import {
|
|
@@ -1135,6 +1135,15 @@ function detectUserIntent(message) {
|
|
|
1135
1135
|
};
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
|
+
const startsWithExploreRequest = /^(analy[sz]e|review|explore|scan|audit|inspect|understand|examine|look at)\b/i.test(normalized) && /\b(codebase|code|project|repo|repository|folder|directory|files)\b/i.test(normalized);
|
|
1139
|
+
if (startsWithExploreRequest) {
|
|
1140
|
+
return {
|
|
1141
|
+
mode: "explore",
|
|
1142
|
+
confidence: 0.92,
|
|
1143
|
+
reasoning: "User starts with explicit project/file review intent",
|
|
1144
|
+
suggestedAction: "execute"
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1138
1147
|
for (const pattern of APP_BUILDER_PATTERNS) {
|
|
1139
1148
|
if (pattern.test(normalized)) {
|
|
1140
1149
|
return {
|
|
@@ -3311,8 +3320,8 @@ async function handleNewProject(cwd, _state) {
|
|
|
3311
3320
|
}
|
|
3312
3321
|
if (intent.mode === "ad_hoc" && intent.confidence >= 0.7) {
|
|
3313
3322
|
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
3314
|
-
const { plan: plan2 } = await import("./plan-
|
|
3315
|
-
await plan2(initialResponse, {});
|
|
3323
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3324
|
+
await plan2(initialResponse, { conversational: true });
|
|
3316
3325
|
return;
|
|
3317
3326
|
}
|
|
3318
3327
|
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
@@ -3336,8 +3345,8 @@ async function handleNewProject(cwd, _state) {
|
|
|
3336
3345
|
}
|
|
3337
3346
|
if (trimmed === "2") {
|
|
3338
3347
|
console.log(chalk6.dim("\n> Creating a task for this...\n"));
|
|
3339
|
-
const { plan: plan2 } = await import("./plan-
|
|
3340
|
-
await plan2(initialResponse, {});
|
|
3348
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3349
|
+
await plan2(initialResponse, { conversational: true });
|
|
3341
3350
|
return;
|
|
3342
3351
|
}
|
|
3343
3352
|
if (trimmed === "3") {
|
|
@@ -3375,8 +3384,8 @@ async function showNewProjectMenu(cwd) {
|
|
|
3375
3384
|
case "3": {
|
|
3376
3385
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3377
3386
|
if (description.trim()) {
|
|
3378
|
-
const { plan: plan2 } = await import("./plan-
|
|
3379
|
-
await plan2(description, {});
|
|
3387
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3388
|
+
await plan2(description, { conversational: true });
|
|
3380
3389
|
}
|
|
3381
3390
|
break;
|
|
3382
3391
|
}
|
|
@@ -3440,7 +3449,6 @@ async function runExploreFlow(cwd, followUpInput) {
|
|
|
3440
3449
|
const request = actionableFollowUp ?? originalFollowUp;
|
|
3441
3450
|
console.log(chalk6.dim("I finished the project scan. Continuing with your requested task...\n"));
|
|
3442
3451
|
await handlePostExploreAction(cwd, request);
|
|
3443
|
-
await showMainMenu();
|
|
3444
3452
|
return;
|
|
3445
3453
|
}
|
|
3446
3454
|
console.log(chalk6.bold("What would you like to do next?\n"));
|
|
@@ -3457,8 +3465,8 @@ async function runExploreFlow(cwd, followUpInput) {
|
|
|
3457
3465
|
case "1": {
|
|
3458
3466
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3459
3467
|
if (description.trim()) {
|
|
3460
|
-
const { plan: plan2 } = await import("./plan-
|
|
3461
|
-
await plan2(description, {});
|
|
3468
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3469
|
+
await plan2(description, { conversational: true });
|
|
3462
3470
|
}
|
|
3463
3471
|
await showMainMenu();
|
|
3464
3472
|
return;
|
|
@@ -3702,8 +3710,8 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3702
3710
|
const hintedTask = initialTaskHint?.trim() ?? "";
|
|
3703
3711
|
if (hintedTask) {
|
|
3704
3712
|
console.log(chalk6.dim("Using your request above as the first task.\n"));
|
|
3705
|
-
const { plan: plan2 } = await import("./plan-
|
|
3706
|
-
await plan2(hintedTask, {});
|
|
3713
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3714
|
+
await plan2(hintedTask, { conversational: true });
|
|
3707
3715
|
return;
|
|
3708
3716
|
}
|
|
3709
3717
|
const continueAnswer = await prompt("Would you like to plan your first task now? (Y/n)");
|
|
@@ -3727,8 +3735,8 @@ ${state.forbiddenPatterns?.length ? `- **Forbidden patterns:** ${state.forbidden
|
|
|
3727
3735
|
description = continueAnswer.trim();
|
|
3728
3736
|
}
|
|
3729
3737
|
if (description.trim()) {
|
|
3730
|
-
const { plan: plan2 } = await import("./plan-
|
|
3731
|
-
await plan2(description, {});
|
|
3738
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3739
|
+
await plan2(description, { conversational: true });
|
|
3732
3740
|
}
|
|
3733
3741
|
}
|
|
3734
3742
|
function inferAudienceFromMessage(message) {
|
|
@@ -3853,8 +3861,8 @@ async function handleAdaptExisting(cwd, state) {
|
|
|
3853
3861
|
}
|
|
3854
3862
|
if (intent.mode === "ad_hoc" && intent.confidence >= 0.7) {
|
|
3855
3863
|
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
3856
|
-
const { plan: plan2 } = await import("./plan-
|
|
3857
|
-
await plan2(response, {});
|
|
3864
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3865
|
+
await plan2(response, { conversational: true });
|
|
3858
3866
|
return;
|
|
3859
3867
|
}
|
|
3860
3868
|
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
@@ -3891,8 +3899,8 @@ async function showAdaptExistingMenu(cwd, state) {
|
|
|
3891
3899
|
case "2": {
|
|
3892
3900
|
const description = await promptWithCommands("Describe what you want to do", { allowMultiline: true });
|
|
3893
3901
|
if (description.trim()) {
|
|
3894
|
-
const { plan: plan2 } = await import("./plan-
|
|
3895
|
-
await plan2(description, {});
|
|
3902
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
3903
|
+
await plan2(description, { conversational: true });
|
|
3896
3904
|
}
|
|
3897
3905
|
break;
|
|
3898
3906
|
}
|
|
@@ -3998,12 +4006,39 @@ async function continueConversationLoop(cwd) {
|
|
|
3998
4006
|
await showMainMenu();
|
|
3999
4007
|
return;
|
|
4000
4008
|
}
|
|
4009
|
+
if (isContinuationDirective(response)) {
|
|
4010
|
+
await continueWithCurrentTask(cwd);
|
|
4011
|
+
continue;
|
|
4012
|
+
}
|
|
4001
4013
|
const handled = await handleFreeformJourneyInput(cwd, response);
|
|
4002
4014
|
if (!handled) {
|
|
4003
4015
|
console.log(chalk6.yellow("I did not catch that. Try describing your goal in one sentence."));
|
|
4004
4016
|
}
|
|
4005
4017
|
}
|
|
4006
4018
|
}
|
|
4019
|
+
function isContinuationDirective(input) {
|
|
4020
|
+
const normalized = input.trim().toLowerCase();
|
|
4021
|
+
return normalized === "continue" || normalized === "continue." || normalized === "go on" || normalized === "go ahead" || normalized === "next" || normalized === "proceed" || normalized === "do it";
|
|
4022
|
+
}
|
|
4023
|
+
async function continueWithCurrentTask(cwd) {
|
|
4024
|
+
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-W4WQY7BR.js");
|
|
4025
|
+
const atoms = await listLocalAtoms2();
|
|
4026
|
+
const pending = atoms.filter((a) => a.status === "READY" || a.status === "IN_PROGRESS").sort((a, b) => a.externalId.localeCompare(b.externalId));
|
|
4027
|
+
if (pending.length === 0) {
|
|
4028
|
+
console.log(chalk6.yellow("No pending atoms found. Tell me what to plan next."));
|
|
4029
|
+
return;
|
|
4030
|
+
}
|
|
4031
|
+
const nextAtom = pending[0];
|
|
4032
|
+
if (!nextAtom) {
|
|
4033
|
+
console.log(chalk6.yellow("No pending atoms found. Tell me what to plan next."));
|
|
4034
|
+
return;
|
|
4035
|
+
}
|
|
4036
|
+
console.log(chalk6.dim(`
|
|
4037
|
+
Continuing with ${nextAtom.externalId}...
|
|
4038
|
+
`));
|
|
4039
|
+
const { execute: execute2 } = await import("./execute-3IUO33KY.js");
|
|
4040
|
+
await execute2(nextAtom.externalId, {});
|
|
4041
|
+
}
|
|
4007
4042
|
function checkForHandoff(cwd) {
|
|
4008
4043
|
try {
|
|
4009
4044
|
const currentContextPath = join6(cwd, ".archon", "current_context.md");
|
|
@@ -4091,13 +4126,20 @@ async function handleFreeformJourneyInput(cwd, input) {
|
|
|
4091
4126
|
return true;
|
|
4092
4127
|
}
|
|
4093
4128
|
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
4129
|
+
const state = detectProjectState(cwd);
|
|
4130
|
+
if (state.hasArchitecture) {
|
|
4131
|
+
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
4132
|
+
const { plan: plan3 } = await import("./plan-W4WQY7BR.js");
|
|
4133
|
+
await plan3(freeform, { conversational: true });
|
|
4134
|
+
return true;
|
|
4135
|
+
}
|
|
4094
4136
|
console.log(chalk6.dim("\n> Let me understand your project better...\n"));
|
|
4095
4137
|
await runConversationalInterview(cwd, freeform);
|
|
4096
4138
|
return true;
|
|
4097
4139
|
}
|
|
4098
4140
|
console.log(chalk6.dim("\n> Got it! Creating a task for this...\n"));
|
|
4099
|
-
const { plan: plan2 } = await import("./plan-
|
|
4100
|
-
await plan2(freeform, {});
|
|
4141
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
4142
|
+
await plan2(freeform, { conversational: true });
|
|
4101
4143
|
return true;
|
|
4102
4144
|
}
|
|
4103
4145
|
function extractActionableFollowUpFromExplore(input) {
|
|
@@ -4146,8 +4188,8 @@ async function handlePostExploreAction(cwd, request) {
|
|
|
4146
4188
|
} else {
|
|
4147
4189
|
console.log(chalk6.dim("> Got it! Creating a task for this...\n"));
|
|
4148
4190
|
}
|
|
4149
|
-
const { plan: plan2 } = await import("./plan-
|
|
4150
|
-
await plan2(request, {});
|
|
4191
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
4192
|
+
await plan2(request, { conversational: true });
|
|
4151
4193
|
}
|
|
4152
4194
|
async function showReviewProgress(cwd) {
|
|
4153
4195
|
try {
|
|
@@ -4168,18 +4210,18 @@ async function showReviewProgress(cwd) {
|
|
|
4168
4210
|
}
|
|
4169
4211
|
}
|
|
4170
4212
|
async function planTask() {
|
|
4171
|
-
const { plan: plan2 } = await import("./plan-
|
|
4213
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
4172
4214
|
const description = await promptWithCommands("Describe what you want to build", { allowMultiline: true });
|
|
4173
4215
|
if (description.trim()) {
|
|
4174
|
-
await plan2(description, {});
|
|
4216
|
+
await plan2(description, { conversational: true });
|
|
4175
4217
|
}
|
|
4176
4218
|
}
|
|
4177
4219
|
async function listAtoms() {
|
|
4178
|
-
const { list: list2 } = await import("./list-
|
|
4220
|
+
const { list: list2 } = await import("./list-P5H2N6WT.js");
|
|
4179
4221
|
await list2({});
|
|
4180
4222
|
}
|
|
4181
4223
|
async function executeNext() {
|
|
4182
|
-
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-
|
|
4224
|
+
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-W4WQY7BR.js");
|
|
4183
4225
|
const { analyzeProject, getComplexityDescription, getModeDescription } = await import("./orchestration-HIF3KP25.js");
|
|
4184
4226
|
const { loadExecutionPreferences } = await import("./preferences-4V4C7MVD.js");
|
|
4185
4227
|
const cwd = process.cwd();
|
|
@@ -4250,11 +4292,11 @@ async function executeNext() {
|
|
|
4250
4292
|
}
|
|
4251
4293
|
}
|
|
4252
4294
|
if (selectedMode === "parallel-cloud") {
|
|
4253
|
-
const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-
|
|
4295
|
+
const { parallelExecuteCloud: parallelExecuteCloud2 } = await import("./parallel-DBPSYNE4.js");
|
|
4254
4296
|
await parallelExecuteCloud2(runIds);
|
|
4255
4297
|
return;
|
|
4256
4298
|
}
|
|
4257
|
-
const { parallelExecute } = await import("./parallel-
|
|
4299
|
+
const { parallelExecute } = await import("./parallel-DBPSYNE4.js");
|
|
4258
4300
|
await parallelExecute(runIds);
|
|
4259
4301
|
return;
|
|
4260
4302
|
}
|
|
@@ -4262,7 +4304,7 @@ async function executeNext() {
|
|
|
4262
4304
|
const atomId = await prompt("Enter atom ID to execute (or press Enter for first pending)");
|
|
4263
4305
|
const targetId = atomId.trim() || pendingAtoms[0]?.id;
|
|
4264
4306
|
if (targetId) {
|
|
4265
|
-
const { execute: execute2 } = await import("./execute-
|
|
4307
|
+
const { execute: execute2 } = await import("./execute-3IUO33KY.js");
|
|
4266
4308
|
await execute2(targetId, {});
|
|
4267
4309
|
} else {
|
|
4268
4310
|
console.log(chalk6.yellow("No atom to execute."));
|
|
@@ -4409,13 +4451,13 @@ async function handleSlashCommand(input) {
|
|
|
4409
4451
|
const arg = parts.slice(1).join(" ").trim();
|
|
4410
4452
|
switch (command) {
|
|
4411
4453
|
case "/plan": {
|
|
4412
|
-
const { plan: plan2 } = await import("./plan-
|
|
4454
|
+
const { plan: plan2 } = await import("./plan-W4WQY7BR.js");
|
|
4413
4455
|
if (arg) {
|
|
4414
|
-
await plan2(arg, {});
|
|
4456
|
+
await plan2(arg, { conversational: true });
|
|
4415
4457
|
} else {
|
|
4416
4458
|
const description = await promptWithCommands("Describe what you want to build", { allowMultiline: true });
|
|
4417
4459
|
if (description.trim()) {
|
|
4418
|
-
await plan2(description, {});
|
|
4460
|
+
await plan2(description, { conversational: true });
|
|
4419
4461
|
}
|
|
4420
4462
|
}
|
|
4421
4463
|
return true;
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
parallelRunWaves,
|
|
7
7
|
parallelSchedule,
|
|
8
8
|
parallelStatus
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RWNRCLN5.js";
|
|
10
10
|
import "./chunk-EBHHIUCB.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-PSUBO3TR.js";
|
|
12
12
|
import "./chunk-PCTP3LKJ.js";
|
|
13
13
|
import "./chunk-PJRQI5UN.js";
|
|
14
14
|
import "./chunk-EIEU3IIY.js";
|