archondev 2.19.26 → 2.19.28
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 +62 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2615,6 +2615,7 @@ function detectWebProject(cwd) {
|
|
|
2615
2615
|
|
|
2616
2616
|
// src/cli/start.ts
|
|
2617
2617
|
var PAID_TIER_DEFAULT_CHAT_MODEL = "gemini-3.1-pro-preview";
|
|
2618
|
+
var pendingProposalRequest = null;
|
|
2618
2619
|
function uiText(rich, plain) {
|
|
2619
2620
|
return isTerminalSafeMode() ? plain : rich;
|
|
2620
2621
|
}
|
|
@@ -3675,6 +3676,10 @@ async function runAgentMode(cwd, state) {
|
|
|
3675
3676
|
async function handleAgentConversationInput(cwd, input) {
|
|
3676
3677
|
const normalized = input.trim().toLowerCase();
|
|
3677
3678
|
if (!normalized) return false;
|
|
3679
|
+
if (pendingProposalRequest && isPlanApprovalDirective(normalized)) {
|
|
3680
|
+
await applyApprovedProposal(cwd);
|
|
3681
|
+
return true;
|
|
3682
|
+
}
|
|
3678
3683
|
if (isContinuationDirective(normalized)) {
|
|
3679
3684
|
await continueWithCurrentTask(cwd);
|
|
3680
3685
|
return true;
|
|
@@ -3683,6 +3688,10 @@ async function handleAgentConversationInput(cwd, input) {
|
|
|
3683
3688
|
await showLatestPlannedAtom(cwd);
|
|
3684
3689
|
return true;
|
|
3685
3690
|
}
|
|
3691
|
+
if (wantsProposalBeforeExecution(input)) {
|
|
3692
|
+
await showProposalForApproval(input);
|
|
3693
|
+
return true;
|
|
3694
|
+
}
|
|
3686
3695
|
const intent = detectUserIntent(input);
|
|
3687
3696
|
if (isReadOnlyExploreRequest(input) || intent.mode === "explore" && intent.confidence >= 0.7) {
|
|
3688
3697
|
console.log(chalk5.dim("\n> Got it! Analyzing the project...\n"));
|
|
@@ -3692,11 +3701,12 @@ async function handleAgentConversationInput(cwd, input) {
|
|
|
3692
3701
|
console.log(chalk5.dim("\n> Got it! Creating a task for this...\n"));
|
|
3693
3702
|
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|
|
3694
3703
|
await plan2(input, { conversational: true });
|
|
3695
|
-
if (
|
|
3696
|
-
await
|
|
3704
|
+
if (shouldAutoExecuteAfterPlanning(input)) {
|
|
3705
|
+
await continueWithCurrentTask(cwd);
|
|
3697
3706
|
return true;
|
|
3698
3707
|
}
|
|
3699
|
-
await
|
|
3708
|
+
await showLatestPlannedAtom(cwd);
|
|
3709
|
+
console.log(chalk5.dim('\nReply "continue" when you approve this plan, or tell me what to change.'));
|
|
3700
3710
|
return true;
|
|
3701
3711
|
}
|
|
3702
3712
|
function isReadOnlyExploreRequest(input) {
|
|
@@ -3711,7 +3721,28 @@ function isReferenceToPreviousRequest(input) {
|
|
|
3711
3721
|
}
|
|
3712
3722
|
function shouldStopAfterPlanning(input) {
|
|
3713
3723
|
const normalized = input.toLowerCase();
|
|
3714
|
-
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");
|
|
3724
|
+
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");
|
|
3725
|
+
}
|
|
3726
|
+
function shouldAutoExecuteAfterPlanning(input) {
|
|
3727
|
+
const normalized = input.toLowerCase();
|
|
3728
|
+
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");
|
|
3729
|
+
}
|
|
3730
|
+
function wantsProposalBeforeExecution(input) {
|
|
3731
|
+
const normalized = input.toLowerCase();
|
|
3732
|
+
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"));
|
|
3733
|
+
}
|
|
3734
|
+
async function showProposalForApproval(input) {
|
|
3735
|
+
pendingProposalRequest = input.trim();
|
|
3736
|
+
console.log(chalk5.dim("\n> Understood. I will not create atoms yet.\n"));
|
|
3737
|
+
console.log(chalk5.bold("Proposed plan (for your approval):"));
|
|
3738
|
+
console.log(chalk5.dim(" 1. Review project files and locate the capsule markdown/source for day 1."));
|
|
3739
|
+
console.log(chalk5.dim(" 2. Evaluate day-1 content boundaries and recommend one capsule vs multiple capsules with rationale."));
|
|
3740
|
+
console.log(chalk5.dim(" 3. Draft a user-friendly capsule structure for day 1."));
|
|
3741
|
+
console.log(chalk5.dim(" 4. Present implementation plan and wait for your approval before creating atoms or executing."));
|
|
3742
|
+
if (input.trim()) {
|
|
3743
|
+
console.log();
|
|
3744
|
+
console.log(chalk5.dim('Reply "approve plan" to proceed, or tell me what to adjust in this plan.'));
|
|
3745
|
+
}
|
|
3715
3746
|
}
|
|
3716
3747
|
async function showLatestPlannedAtom(cwd) {
|
|
3717
3748
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-PJI6MCS3.js");
|
|
@@ -3739,6 +3770,24 @@ function isContinuationDirective(input) {
|
|
|
3739
3770
|
const normalized = input.trim().toLowerCase();
|
|
3740
3771
|
return normalized === "continue" || normalized === "continue." || normalized === "go on" || normalized === "go ahead" || normalized === "next" || normalized === "proceed" || normalized === "do it";
|
|
3741
3772
|
}
|
|
3773
|
+
function isPlanApprovalDirective(input) {
|
|
3774
|
+
const normalized = input.trim().toLowerCase();
|
|
3775
|
+
return normalized === "approve" || normalized === "approve plan" || normalized === "approved" || normalized === "yes" || normalized === "yes, proceed" || normalized === "proceed" || normalized === "continue" || normalized === "continue.";
|
|
3776
|
+
}
|
|
3777
|
+
async function applyApprovedProposal(cwd) {
|
|
3778
|
+
const approvedRequest = pendingProposalRequest;
|
|
3779
|
+
if (!approvedRequest) return;
|
|
3780
|
+
pendingProposalRequest = null;
|
|
3781
|
+
console.log(chalk5.dim("\n> Great. I will create the task from your approved request.\n"));
|
|
3782
|
+
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|
|
3783
|
+
await plan2(approvedRequest, { conversational: true });
|
|
3784
|
+
if (shouldAutoExecuteAfterPlanning(approvedRequest)) {
|
|
3785
|
+
await continueWithCurrentTask(cwd);
|
|
3786
|
+
return;
|
|
3787
|
+
}
|
|
3788
|
+
await showLatestPlannedAtom(cwd);
|
|
3789
|
+
console.log(chalk5.dim('\nReply "continue" when you approve this plan, or tell me what to change.'));
|
|
3790
|
+
}
|
|
3742
3791
|
async function continueWithCurrentTask(cwd) {
|
|
3743
3792
|
const { listLocalAtoms: listLocalAtoms2 } = await import("./plan-PJI6MCS3.js");
|
|
3744
3793
|
const atoms = await listLocalAtoms2();
|
|
@@ -3871,6 +3920,11 @@ function containsActionIntent(input) {
|
|
|
3871
3920
|
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);
|
|
3872
3921
|
}
|
|
3873
3922
|
async function handlePostExploreAction(cwd, request, options = {}) {
|
|
3923
|
+
const sourceInput = options.originalInput?.trim() || request;
|
|
3924
|
+
if (wantsProposalBeforeExecution(sourceInput)) {
|
|
3925
|
+
await showProposalForApproval(sourceInput);
|
|
3926
|
+
return;
|
|
3927
|
+
}
|
|
3874
3928
|
const intent = detectUserIntent(request);
|
|
3875
3929
|
if (intent.mode === "app_builder" && intent.confidence >= 0.7) {
|
|
3876
3930
|
console.log(chalk5.dim("> Let me understand your project better...\n"));
|
|
@@ -3885,12 +3939,12 @@ async function handlePostExploreAction(cwd, request, options = {}) {
|
|
|
3885
3939
|
const { plan: plan2 } = await import("./plan-PJI6MCS3.js");
|
|
3886
3940
|
await plan2(request, { conversational: true });
|
|
3887
3941
|
if (options.agentMode) {
|
|
3888
|
-
|
|
3889
|
-
if (shouldStopAfterPlanning(sourceInput)) {
|
|
3890
|
-
await showLatestPlannedAtom(cwd);
|
|
3891
|
-
} else {
|
|
3942
|
+
if (shouldAutoExecuteAfterPlanning(sourceInput)) {
|
|
3892
3943
|
await continueWithCurrentTask(cwd);
|
|
3944
|
+
return;
|
|
3893
3945
|
}
|
|
3946
|
+
await showLatestPlannedAtom(cwd);
|
|
3947
|
+
console.log(chalk5.dim('\nReply "continue" when you approve this plan, or tell me what to change.'));
|
|
3894
3948
|
}
|
|
3895
3949
|
}
|
|
3896
3950
|
async function planTask() {
|