ahead-pi 0.8.3 → 0.8.4
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/package.json +1 -1
- package/src/guidance.ts +7 -1
- package/src/index.ts +5 -1
package/package.json
CHANGED
package/src/guidance.ts
CHANGED
|
@@ -424,7 +424,9 @@ export function nextAction(state: RunState, workflow: WorkflowDefinition): Guide
|
|
|
424
424
|
? "Ask AI to challenge the human option and expand alternatives"
|
|
425
425
|
: state.phase.id === "plan"
|
|
426
426
|
? "Ask AI to challenge the human first-pass plan"
|
|
427
|
-
:
|
|
427
|
+
: artifact.title.startsWith("AI ")
|
|
428
|
+
? `Ask AI for ${lowercaseFirst(artifact.title.slice(3))}`
|
|
429
|
+
: `Ask AI to contribute ${artifact.title}`;
|
|
428
430
|
return artifact.required
|
|
429
431
|
? { actor, label, artifactKind: artifact.kind }
|
|
430
432
|
: { actor, label, artifactKind: artifact.kind, optional: true };
|
|
@@ -606,6 +608,10 @@ export function validateArtifactForm(content: string, prompts: string[]): string
|
|
|
606
608
|
return errors;
|
|
607
609
|
}
|
|
608
610
|
|
|
611
|
+
function lowercaseFirst(value: string): string {
|
|
612
|
+
return value.charAt(0).toLowerCase() + value.slice(1);
|
|
613
|
+
}
|
|
614
|
+
|
|
609
615
|
function formatArtifactStatus(artifact: ArtifactState): string {
|
|
610
616
|
const owner = artifact.actor === "ai" ? "AI" : artifact.actor === "human" ? "you" : "you/AI";
|
|
611
617
|
return `${artifact.present ? "✓" : "○"} ${artifact.title} [${owner}]`;
|
package/src/index.ts
CHANGED
|
@@ -702,7 +702,7 @@ async function openAheadMode(
|
|
|
702
702
|
});
|
|
703
703
|
} else if (missingRequired.length === 0) {
|
|
704
704
|
actions.push({
|
|
705
|
-
label: `Continue without optional AI contribution ·
|
|
705
|
+
label: `Continue without optional AI contribution · ${state.gate.title}`,
|
|
706
706
|
run: async () => acceptAndContinue(ctx),
|
|
707
707
|
});
|
|
708
708
|
}
|
|
@@ -752,8 +752,12 @@ async function openAheadMode(
|
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
|
|
755
|
+
// The generic challenger appears only when the next move is the human's.
|
|
756
|
+
// When the primary action is already an AI contribution, the formal AI
|
|
757
|
+
// artifact owns that job and a second "challenge me" entry is noise.
|
|
755
758
|
if (
|
|
756
759
|
state.allowed_ai_capabilities.length > 0 &&
|
|
760
|
+
action.actor !== "ai" &&
|
|
757
761
|
state.artifacts.some(
|
|
758
762
|
(artifact) => artifact.present && artifact.recorded_by?.kind === "human" && artifact.path,
|
|
759
763
|
)
|