@pentoshi/clai 3.8.41 → 3.8.43
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 +13 -4
- package/dist/agent/runner.js.map +1 -1
- package/dist/agent/session-title.js +5 -4
- package/dist/agent/session-title.js.map +1 -1
- package/dist/app/controllers/session-controller.js +2 -1
- package/dist/app/controllers/session-controller.js.map +1 -1
- package/dist/app/controllers/turn-controller.js +5 -21
- package/dist/app/controllers/turn-controller.js.map +1 -1
- package/dist/llm/adapters/gemini-tools.d.ts +3 -0
- package/dist/llm/adapters/gemini-tools.js +87 -3
- package/dist/llm/adapters/gemini-tools.js.map +1 -1
- package/dist/llm/anthropic.d.ts +2 -0
- package/dist/llm/anthropic.js +32 -11
- package/dist/llm/anthropic.js.map +1 -1
- package/dist/llm/aws-mantle.js +22 -18
- package/dist/llm/aws-mantle.js.map +1 -1
- package/dist/llm/gemini.js.map +1 -1
- package/dist/llm/http.d.ts +24 -0
- package/dist/llm/http.js +25 -3
- package/dist/llm/http.js.map +1 -1
- package/dist/llm/router.js +19 -10
- package/dist/llm/router.js.map +1 -1
- package/dist/tui-v2/app/commands/key-commands.js +12 -6
- package/dist/tui-v2/app/commands/key-commands.js.map +1 -1
- package/dist/tui-v2/components/modal/keys-modal.d.ts +4 -0
- package/dist/tui-v2/components/modal/keys-modal.js +49 -16
- package/dist/tui-v2/components/modal/keys-modal.js.map +1 -1
- package/dist/tui-v2/components/transcript/notice-row.js +3 -1
- package/dist/tui-v2/components/transcript/notice-row.js.map +1 -1
- package/dist/tui-v2/composer/completion.d.ts +2 -0
- package/dist/tui-v2/composer/completion.js +19 -0
- package/dist/tui-v2/composer/completion.js.map +1 -1
- package/dist/tui-v2/composer/composer-editor.js +15 -6
- package/dist/tui-v2/composer/composer-editor.js.map +1 -1
- package/dist/tui-v2/composer/paste-placeholder.d.ts +1 -0
- package/dist/tui-v2/composer/paste-placeholder.js +3 -0
- package/dist/tui-v2/composer/paste-placeholder.js.map +1 -1
- package/dist/tui-v2/controllers/overlay-controller.d.ts +3 -0
- package/dist/tui-v2/controllers/overlay-controller.js.map +1 -1
- package/dist/tui-v2/state/transcript-reducer.d.ts +2 -2
- package/dist/tui-v2/state/transcript-reducer.js +17 -94
- package/dist/tui-v2/state/transcript-reducer.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.js.map +1 -1
- package/dist/ui/thinking.js +9 -7
- package/dist/ui/thinking.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
|
@@ -2358,20 +2358,20 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2358
2358
|
}
|
|
2359
2359
|
}
|
|
2360
2360
|
}
|
|
2361
|
-
if (!sawReasoning && /<think/i.test(token)) {
|
|
2361
|
+
if (!sawReasoning && /<think(?:ing)?\b/i.test(token)) {
|
|
2362
2362
|
sawReasoning = true;
|
|
2363
2363
|
inThinking = true;
|
|
2364
2364
|
spinner.setLabel("thinking");
|
|
2365
2365
|
if (!writesDirectly)
|
|
2366
2366
|
emit({ type: "status", text: "thinking" });
|
|
2367
2367
|
}
|
|
2368
|
-
if (/<\/think
|
|
2368
|
+
if (/<\/think(?:ing)?>/i.test(token)) {
|
|
2369
2369
|
inThinking = false;
|
|
2370
2370
|
spinner.setLabel("generating response (0 tokens)");
|
|
2371
2371
|
generatedTokens = 0;
|
|
2372
2372
|
}
|
|
2373
2373
|
if (inThinking) {
|
|
2374
|
-
const cleaned = token.replace(/<\/?think[^>]*>/gi, "");
|
|
2374
|
+
const cleaned = token.replace(/<\/?think(?:ing)?[^>]*>/gi, "");
|
|
2375
2375
|
if (cleaned) {
|
|
2376
2376
|
spinner.pushPreview(cleaned);
|
|
2377
2377
|
const approx = cleaned.split(/\s+/).filter(Boolean).length;
|
|
@@ -2433,7 +2433,16 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
2433
2433
|
(toolsAttached && !isTextOnlyModel(provider, model));
|
|
2434
2434
|
const assistantTextResult = rememberThinkingFromText(completion.text);
|
|
2435
2435
|
assistantText = assistantTextResult;
|
|
2436
|
-
|
|
2436
|
+
// Only emit a thinking-block event when the classic renderer is
|
|
2437
|
+
// active (writesDirectly / no deltaParser). In TUI v2 the
|
|
2438
|
+
// deltaParser already streamed thinking-delta events that created
|
|
2439
|
+
// the thinking item in the correct transcript position; emitting
|
|
2440
|
+
// a redundant thinking-block after tool-call events have cleared
|
|
2441
|
+
// pendingThinkingId causes the reducer to append a *duplicate*
|
|
2442
|
+
// thinking item at the end of the transcript — the root cause of
|
|
2443
|
+
// the "ghost thinking blocks below the response" bug seen with
|
|
2444
|
+
// models that use reasoning_content (e.g. Kimi K2-thinking).
|
|
2445
|
+
if (assistantText.hasThinking && !deltaParser) {
|
|
2437
2446
|
writeThinkingBlock(assistantText.thinkContent);
|
|
2438
2447
|
}
|
|
2439
2448
|
// Native-first: prefer structured toolCalls from the provider.
|