archondev 2.19.25 → 2.19.27
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/index.js +47 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3226,7 +3226,10 @@ async function runExploreFlow(cwd, followUpInput, options = {}) {
|
|
|
3226
3226
|
if (actionableFollowUp || containsActionIntent(originalFollowUp)) {
|
|
3227
3227
|
const request = actionableFollowUp ?? originalFollowUp;
|
|
3228
3228
|
console.log(chalk5.dim("I finished the project scan. Continuing with your requested task...\n"));
|
|
3229
|
-
await handlePostExploreAction(cwd, request
|
|
3229
|
+
await handlePostExploreAction(cwd, request, {
|
|
3230
|
+
agentMode: options.agentMode,
|
|
3231
|
+
originalInput: originalFollowUp
|
|
3232
|
+
});
|
|
3230
3233
|
return;
|
|
3231
3234
|
}
|
|
3232
3235
|
if (options.agentMode) {
|
|
@@ -3680,6 +3683,10 @@ async function handleAgentConversationInput(cwd, input) {
|
|
|
3680
3683
|
await showLatestPlannedAtom(cwd);
|
|
3681
3684
|
return true;
|
|
3682
3685
|
}
|
|
3686
|
+
if (wantsProposalBeforeExecution(input)) {
|
|
3687
|
+
await showProposalForApproval(input);
|
|
3688
|
+
return true;
|
|
3689
|
+
}
|
|
3683
3690
|
const intent = detectUserIntent(input);
|
|
3684
3691
|
if (isReadOnlyExploreRequest(input) || intent.mode === "explore" && intent.confidence >= 0.7) {
|
|
3685
3692
|
console.log(chalk5.dim("\n> Got it! Analyzing the project...\n"));
|
|
@@ -3689,11 +3696,12 @@ async function handleAgentConversationInput(cwd, input) {
|
|
|
3689
3696
|
console.log(chalk5.dim("\n> Got it! Creating a task for this...\n"));
|
|
3690
3697
|
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|
|
3691
3698
|
await plan2(input, { conversational: true });
|
|
3692
|
-
if (
|
|
3693
|
-
await
|
|
3699
|
+
if (shouldAutoExecuteAfterPlanning(input)) {
|
|
3700
|
+
await continueWithCurrentTask(cwd);
|
|
3694
3701
|
return true;
|
|
3695
3702
|
}
|
|
3696
|
-
await
|
|
3703
|
+
await showLatestPlannedAtom(cwd);
|
|
3704
|
+
console.log(chalk5.dim('\nReply "continue" when you approve this plan, or tell me what to change.'));
|
|
3697
3705
|
return true;
|
|
3698
3706
|
}
|
|
3699
3707
|
function isReadOnlyExploreRequest(input) {
|
|
@@ -3708,7 +3716,27 @@ function isReferenceToPreviousRequest(input) {
|
|
|
3708
3716
|
}
|
|
3709
3717
|
function shouldStopAfterPlanning(input) {
|
|
3710
3718
|
const normalized = input.toLowerCase();
|
|
3711
|
-
return normalized.includes("plan before") || normalized.includes("before continuing") || normalized.includes("before we continue") || normalized.includes("show me your plan") || normalized.includes("give me your plan") || normalized.includes("come up with a plan") || normalized.includes("do not start yet");
|
|
3719
|
+
return normalized.includes("plan before") || normalized.includes("before continuing") || normalized.includes("before we continue") || normalized.includes("show me your plan") || normalized.includes("give me your plan") || normalized.includes("let me know what your plan") || normalized.includes("what your plan is") || normalized.includes("how to implement") || normalized.includes("come up with a plan") || normalized.includes("do not start yet");
|
|
3720
|
+
}
|
|
3721
|
+
function shouldAutoExecuteAfterPlanning(input) {
|
|
3722
|
+
const normalized = input.toLowerCase();
|
|
3723
|
+
return normalized.includes("execute now") || normalized.includes("implement now") || normalized.includes("start coding now") || normalized.includes("go ahead and execute") || normalized.includes("go ahead and implement") || normalized.includes("run it now");
|
|
3724
|
+
}
|
|
3725
|
+
function wantsProposalBeforeExecution(input) {
|
|
3726
|
+
const normalized = input.toLowerCase();
|
|
3727
|
+
return shouldStopAfterPlanning(input) || (normalized.includes("review") || normalized.includes("analyze") || normalized.includes("analyse")) && (normalized.includes("let me know") || normalized.includes("plan")) && (normalized.includes("first") || normalized.includes("before"));
|
|
3728
|
+
}
|
|
3729
|
+
async function showProposalForApproval(input) {
|
|
3730
|
+
console.log(chalk5.dim("\n> Understood. I will not create atoms yet.\n"));
|
|
3731
|
+
console.log(chalk5.bold("Proposed plan (for your approval):"));
|
|
3732
|
+
console.log(chalk5.dim(" 1. Review project files and locate the capsule markdown/source for day 1."));
|
|
3733
|
+
console.log(chalk5.dim(" 2. Evaluate day-1 content boundaries and recommend one capsule vs multiple capsules with rationale."));
|
|
3734
|
+
console.log(chalk5.dim(" 3. Draft a user-friendly capsule structure for day 1."));
|
|
3735
|
+
console.log(chalk5.dim(" 4. Present implementation plan and wait for your approval before creating atoms or executing."));
|
|
3736
|
+
if (input.trim()) {
|
|
3737
|
+
console.log();
|
|
3738
|
+
console.log(chalk5.dim('Reply "approve plan" to proceed, or tell me what to adjust in this plan.'));
|
|
3739
|
+
}
|
|
3712
3740
|
}
|
|
3713
3741
|
async function showLatestPlannedAtom(cwd) {
|
|
3714
3742
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-PJI6MCS3.js");
|
|
@@ -3867,7 +3895,12 @@ function containsActionIntent(input) {
|
|
|
3867
3895
|
if (!normalized) return false;
|
|
3868
3896
|
return /(i would like to|i want to|i need to|how (can|could|do i)|can you|could you|would you|help me|create|build|generate|make|produce|plan|implement|write|fix|convert|compile)/.test(normalized);
|
|
3869
3897
|
}
|
|
3870
|
-
async function handlePostExploreAction(cwd, request) {
|
|
3898
|
+
async function handlePostExploreAction(cwd, request, options = {}) {
|
|
3899
|
+
const sourceInput = options.originalInput?.trim() || request;
|
|
3900
|
+
if (wantsProposalBeforeExecution(sourceInput)) {
|
|
3901
|
+
await showProposalForApproval(sourceInput);
|
|
3902
|
+
return;
|
|
3903
|
+
}
|
|
3871
3904
|
const intent = detectUserIntent(request);
|
|
3872
3905
|
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
3873
3906
|
console.log(chalk5.dim("> Let me understand your project better...\n"));
|
|
@@ -3881,6 +3914,14 @@ async function handlePostExploreAction(cwd, request) {
|
|
|
3881
3914
|
}
|
|
3882
3915
|
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|
|
3883
3916
|
await plan2(request, { conversational: true });
|
|
3917
|
+
if (options.agentMode) {
|
|
3918
|
+
if (shouldAutoExecuteAfterPlanning(sourceInput)) {
|
|
3919
|
+
await continueWithCurrentTask(cwd);
|
|
3920
|
+
return;
|
|
3921
|
+
}
|
|
3922
|
+
await showLatestPlannedAtom(cwd);
|
|
3923
|
+
console.log(chalk5.dim('\nReply "continue" when you approve this plan, or tell me what to change.'));
|
|
3924
|
+
}
|
|
3884
3925
|
}
|
|
3885
3926
|
async function planTask() {
|
|
3886
3927
|
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|