@pentoshi/clai 3.8.3 → 3.8.6
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/agent/runner.js +9 -16
- package/dist/agent/runner.js.map +1 -1
- package/dist/store/history.d.ts +1 -1
- package/dist/store/history.js +4 -3
- package/dist/store/history.js.map +1 -1
- package/dist/tools/http.js +19 -1
- package/dist/tools/http.js.map +1 -1
- package/dist/tui/state.js +6 -0
- package/dist/tui/state.js.map +1 -1
- package/dist/tui-v2/actions/format-shortcuts.js +10 -6
- package/dist/tui-v2/actions/format-shortcuts.js.map +1 -1
- package/dist/tui-v2/app/App.js +4 -6
- package/dist/tui-v2/app/App.js.map +1 -1
- package/dist/tui-v2/components/composer/composer-input-box.d.ts +25 -0
- package/dist/tui-v2/components/composer/composer-input-box.js +31 -0
- package/dist/tui-v2/components/composer/composer-input-box.js.map +1 -0
- package/dist/tui-v2/components/toast/toast-host.d.ts +3 -3
- package/dist/tui-v2/components/toast/toast-host.js +9 -9
- package/dist/tui-v2/components/toast/toast-host.js.map +1 -1
- package/dist/tui-v2/components/transcript/transcript-view.js +1 -0
- package/dist/tui-v2/components/transcript/transcript-view.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.d.ts +11 -2
- package/dist/tui-v2/composer/composer-editor.js +55 -66
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/tui-v2/composer/composer-wheel.d.ts +12 -0
- package/dist/tui-v2/composer/composer-wheel.js +23 -4
- package/dist/tui-v2/composer/composer-wheel.js.map +1 -1
- package/dist/tui-v2/composer/disable-native-textarea-scroll.d.ts +13 -0
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js +31 -0
- package/dist/tui-v2/composer/disable-native-textarea-scroll.js.map +1 -0
- package/dist/tui-v2/composer/textarea-keybindings.d.ts +9 -8
- package/dist/tui-v2/composer/textarea-keybindings.js +22 -25
- package/dist/tui-v2/composer/textarea-keybindings.js.map +1 -1
- package/dist/tui-v2/layout/compute-layout.d.ts +3 -2
- package/dist/tui-v2/layout/compute-layout.js +3 -2
- package/dist/tui-v2/layout/compute-layout.js.map +1 -1
- package/dist/tui-v2/state/transcript-hydrate.d.ts +1 -1
- package/dist/tui-v2/state/transcript-hydrate.js +4 -0
- package/dist/tui-v2/state/transcript-hydrate.js.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +1 -1
package/dist/agent/runner.js
CHANGED
|
@@ -522,8 +522,9 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
522
522
|
liveMessages = messages;
|
|
523
523
|
/** Assigned after session flags exist — see below. */
|
|
524
524
|
let refreshSessionState = () => undefined;
|
|
525
|
+
/** Model-only nudge — never shown as a YOU bubble / WARN in the chat UI. */
|
|
525
526
|
const recoveryUserMessage = (content) => {
|
|
526
|
-
const message = { role: "user", content };
|
|
527
|
+
const message = { role: "user", content, internal: true };
|
|
527
528
|
if (options.images && options.images.length > 0) {
|
|
528
529
|
// Some OpenAI-compatible gateways/models attend most strongly to the
|
|
529
530
|
// latest user turn. Keep the image attached on recovery nudges so a
|
|
@@ -2624,7 +2625,6 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2624
2625
|
}
|
|
2625
2626
|
if (action) {
|
|
2626
2627
|
consumeBudget(recovery, action.budgetKey);
|
|
2627
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2628
2628
|
pushAssistantHistory(assistantText.visible);
|
|
2629
2629
|
messages.push(recoveryUserMessage(action.message));
|
|
2630
2630
|
continue;
|
|
@@ -2638,9 +2638,8 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2638
2638
|
? " Call the web_search tool now."
|
|
2639
2639
|
: " Reply with ONLY a fenced ```tool block for web.search now."));
|
|
2640
2640
|
consumeBudget(recovery, action.budgetKey);
|
|
2641
|
-
writeNotice("info", action.notice, chalk.dim(` ℹ ${action.notice}\n`));
|
|
2642
2641
|
pushAssistantHistory(assistantText.visible);
|
|
2643
|
-
messages.push(
|
|
2642
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2644
2643
|
continue;
|
|
2645
2644
|
}
|
|
2646
2645
|
if (isPlanMode &&
|
|
@@ -2652,8 +2651,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2652
2651
|
const action = recoveryForMissingPlan(toolsAttached);
|
|
2653
2652
|
consumeBudget(recovery, action.budgetKey);
|
|
2654
2653
|
pushAssistantHistory(assistantText.visible);
|
|
2655
|
-
messages.push(
|
|
2656
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2654
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2657
2655
|
continue;
|
|
2658
2656
|
}
|
|
2659
2657
|
}
|
|
@@ -2669,8 +2667,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2669
2667
|
const action = recoveryForMissingFeature(getActiveProjectRoot());
|
|
2670
2668
|
consumeBudget(recovery, action.budgetKey);
|
|
2671
2669
|
pushAssistantHistory(assistantText.visible);
|
|
2672
|
-
messages.push(
|
|
2673
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2670
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2674
2671
|
continue;
|
|
2675
2672
|
}
|
|
2676
2673
|
if (buildLike &&
|
|
@@ -2700,8 +2697,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2700
2697
|
const action = recoveryForRuntimeVerify(getActiveProjectRoot());
|
|
2701
2698
|
consumeBudget(recovery, action.budgetKey);
|
|
2702
2699
|
pushAssistantHistory(assistantText.visible);
|
|
2703
|
-
messages.push(
|
|
2704
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2700
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2705
2701
|
continue;
|
|
2706
2702
|
}
|
|
2707
2703
|
}
|
|
@@ -2716,8 +2712,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2716
2712
|
const action = recoveryForFailedProbe();
|
|
2717
2713
|
consumeBudget(recovery, action.budgetKey);
|
|
2718
2714
|
pushAssistantHistory(assistantText.visible);
|
|
2719
|
-
messages.push(
|
|
2720
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2715
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2721
2716
|
continue;
|
|
2722
2717
|
}
|
|
2723
2718
|
if ((pentestLike || pentestSession) &&
|
|
@@ -2729,8 +2724,7 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2729
2724
|
const action = recoveryForShallowPentest();
|
|
2730
2725
|
consumeBudget(recovery, action.budgetKey);
|
|
2731
2726
|
pushAssistantHistory(assistantText.visible);
|
|
2732
|
-
messages.push(
|
|
2733
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2727
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2734
2728
|
continue;
|
|
2735
2729
|
}
|
|
2736
2730
|
if (session.planApproved.value &&
|
|
@@ -2746,9 +2740,8 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2746
2740
|
errorFix: errorFixNarration,
|
|
2747
2741
|
});
|
|
2748
2742
|
consumeBudget(recovery, action.budgetKey);
|
|
2749
|
-
writeNotice("warn", action.notice, chalk.yellow(` ⚠ ${action.notice}\n`));
|
|
2750
2743
|
pushAssistantHistory(assistantText.visible);
|
|
2751
|
-
messages.push(
|
|
2744
|
+
messages.push(recoveryUserMessage(action.message));
|
|
2752
2745
|
continue;
|
|
2753
2746
|
}
|
|
2754
2747
|
}
|