zidane 5.0.3 → 5.0.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/dist/chat.d.ts +2 -2
- package/dist/chat.js +2 -2
- package/dist/{theme-pJv47erq.d.ts → theme-C3JHZ5y9.d.ts} +31 -3
- package/dist/theme-C3JHZ5y9.d.ts.map +1 -0
- package/dist/tui.d.ts +13 -1
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +187 -14
- package/dist/tui.js.map +1 -1
- package/dist/{turn-operations-CHS2Prne.js → turn-operations-BF3hMNgo.js} +27 -8
- package/dist/turn-operations-BF3hMNgo.js.map +1 -0
- package/package.json +1 -1
- package/dist/theme-pJv47erq.d.ts.map +0 -1
- package/dist/turn-operations-CHS2Prne.js.map +0 -1
package/dist/chat.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as SessionData, Dt as SessionTurn, Lt as TurnUsage, U as Provider, b as SkillConfig, w as SkillsConfig } from "./agent-JhicgLOV.js";
|
|
2
2
|
import { m as SourcedScanPath } from "./index-t_W9i7Ql.js";
|
|
3
|
-
import { $ as Settings, A as useEnabledToggleSet, At as
|
|
3
|
+
import { $ as Settings, A as useEnabledToggleSet, At as AgentProfile, B as lastContextSizeFromTurns, C as DiscoveredMcp, Ct as getModelInfo, D as parseMcpsFile, Dt as openrouterDescriptor, E as discoverProjectMcps, Et as openaiDescriptor, F as StateStoreApi, Ft as PLAN_AGENT, G as stripSpawnTokensLine, H as loadState, I as TuiState, It as resolveAgentId, J as toolResultText, K as titleFromTurns, L as createStateStore, Lt as singleAgentRegistry, M as ProviderRegistry, Mt as BUILD_AGENT, N as ResolvedConfig, Nt as BUILTIN_AGENTS, O as EnabledAllowlistKey, Ot as piIdOf, P as resolveConfig, Pt as DEFAULT_AGENT_ID, Q as SessionMeta, R as deriveSessionTitle, S as splitPromptSegments, St as getContextWindow, T as defaultMcpsConfigPaths, Tt as modelsForDescriptor, U as saveState, V as listSessionMeta, W as selectableTurnIds, X as Picked, Y as Owner, Z as Screen, _ as SafeModeProvider, _t as ModelInfo, a as SyntaxStyles, at as CompletionReference, b as PromptSegment, bt as cerebrasDescriptor, c as ThemeColors, ct as collectReferences, d as resolveChipColor, dt as useCompletion, et as StreamEvent, f as resolveTheme, ft as AuthMethod, g as SafeModeActions, gt as BUILTIN_PROVIDERS, h as RequestApproval, ht as detectAuth, i as DEFAULT_THEME, it as CompletionProvider, j as ChatOptions, jt as AgentRegistry, k as EnabledToggleSet, kt as AgentAccent, l as ThemeSelect, lt as findActiveTrigger, m as ApprovalRequest, mt as ProviderKey, n as ChipColor, nt as CompletionContext, o as SyntaxTokenStyle, ot as CompletionState, p as ApprovalDecision, pt as ProviderAuth, q as toolCallPreview, r as ChipColorMap, rt as CompletionItem, s as Theme, st as applyInsert, t as BUILTIN_THEMES, tt as ActiveTrigger, u as ThemeSurfaces, ut as mergeReferences, v as useSafeModeActions, vt as ProviderDescriptor, w as buildMcpServers, wt as modelSupportsReasoning, x as PromptSegmentRef, xt as credKeyOf, y as useSafeModeQueue, yt as anthropicDescriptor, z as eventsFromTurns } from "./theme-C3JHZ5y9.js";
|
|
4
4
|
import { OAuthCredentials } from "@mariozechner/pi-ai/oauth";
|
|
5
5
|
import { Dispatch, ReactNode, SetStateAction } from "react";
|
|
6
6
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -632,5 +632,5 @@ declare function countNeighbors(turnIds: readonly string[], turnId: string): {
|
|
|
632
632
|
after: number;
|
|
633
633
|
} | null;
|
|
634
634
|
//#endregion
|
|
635
|
-
export { type ActiveTrigger, type AgentAccent, type AgentProfile, type AgentRegistry, type ApiKeyCredential, type ApprovalDecision, type ApprovalRequest, type AuthMethod, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, type BooleanSettingKey, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, type ChatOptions, type ChipColor, type ChipColorMap, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type CompletionState, ConfigProvider, type CredentialsFile, DEFAULT_AGENT_ID, DEFAULT_SETTINGS, DEFAULT_THEME, type DiscoveredMcp, type EnabledAllowlistKey, type EnabledToggleSet, FILES_TRIGGER, type FileEntry, type GenerateSessionTitleOptions, IMPLICITLY_SAFE_TOOLS, type ListProjectFilesOptions, type ModelInfo, type OAuthCredential, type OAuthFlowOptions, type Owner, PLAN_AGENT, type Picked, type ProjectEntry, type ProjectsFile, type PromptSegment, type PromptSegmentRef, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type RequestApproval, type ResolvedConfig, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, type SafeModeActions, SafeModeProvider, type Screen, type SessionExportAnchor, type SessionExportFormat, type SessionExportTarget, type SessionMeta, type Settings, type SettingsChoice, SettingsProvider, type SettingsToggle, type StateStoreApi, type StreamBuffer, type StreamEvent, type StreamSource, type SyntaxStyles, type SyntaxTokenStyle, type Theme, type ThemeColors, ThemeProvider, type ThemeSelect, type ThemeSurfaces, type TuiState, VAPORWAVE_THEME, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyInsert, buildMcpServers, buildSkillsConfig, cerebrasDescriptor, cleanTitle, collectReferences, countNeighbors, createFilesCompletionProvider, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, eventsFromTurns, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fmtTokens, generateSessionTitle, getContextWindow, getSafelist, isOnSafelist, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, matchesSafelistEntry, mergeReferences, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseMcpsFile, piIdOf, projectsFilePath, readCredentials, readProjects, readProviderCredential, removeProviderCredential, renderSession, resolveAgentId, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, setProviderCredential, shortId, singleAgentRegistry, splitPromptSegments, stripSpawnTokensLine, suggestSafelistEntry, supportsOAuth, titleFromTurns, toolCallPreview, toolResultText, truncateTurnsAt, turnAsText, turnContextSize, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useEnabledToggleSet, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
|
|
635
|
+
export { type ActiveTrigger, type AgentAccent, type AgentProfile, type AgentRegistry, type ApiKeyCredential, type ApprovalDecision, type ApprovalRequest, type AuthMethod, BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, type BooleanSettingKey, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, type ChatOptions, type ChipColor, type ChipColorMap, type CompletionContext, type CompletionItem, type CompletionProvider, type CompletionReference, type CompletionState, ConfigProvider, type CredentialsFile, DEFAULT_AGENT_ID, DEFAULT_SETTINGS, DEFAULT_THEME, type DiscoveredMcp, type EnabledAllowlistKey, type EnabledToggleSet, FILES_TRIGGER, type FileEntry, type GenerateSessionTitleOptions, IMPLICITLY_SAFE_TOOLS, type ListProjectFilesOptions, type ModelInfo, type OAuthCredential, type OAuthFlowOptions, type Owner, PLAN_AGENT, type Picked, type ProjectEntry, type ProjectsFile, type PromptSegment, type PromptSegmentRef, type ProviderAuth, type ProviderCredential, type ProviderDescriptor, type ProviderKey, type ProviderRegistry, type RequestApproval, type ResolvedConfig, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, type SafeModeActions, SafeModeProvider, type Screen, type SessionExportAnchor, type SessionExportFormat, type SessionExportTarget, type SessionMeta, type Settings, type SettingsChoice, SettingsProvider, type SettingsToggle, type StateStoreApi, type StreamBuffer, type StreamEvent, type StreamSource, type SyntaxStyles, type SyntaxTokenStyle, type Theme, type ThemeColors, ThemeProvider, type ThemeSelect, type ThemeSurfaces, type TuiState, VAPORWAVE_THEME, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyInsert, buildMcpServers, buildSkillsConfig, cerebrasDescriptor, cleanTitle, collectReferences, countNeighbors, createFilesCompletionProvider, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, eventsFromTurns, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fmtTokens, generateSessionTitle, getContextWindow, getModelInfo, getSafelist, isOnSafelist, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, matchesSafelistEntry, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseMcpsFile, piIdOf, projectsFilePath, readCredentials, readProjects, readProviderCredential, removeProviderCredential, renderSession, resolveAgentId, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, setProviderCredential, shortId, singleAgentRegistry, splitPromptSegments, stripSpawnTokensLine, suggestSafelistEntry, supportsOAuth, titleFromTurns, toolCallPreview, toolResultText, truncateTurnsAt, turnAsText, turnContextSize, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useEnabledToggleSet, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
|
|
636
636
|
//# sourceMappingURL=chat.d.ts.map
|
package/dist/chat.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as BUILTIN_THEMES, $t as
|
|
2
|
-
export { BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, ConfigProvider, DEFAULT_AGENT_ID, DEFAULT_SETTINGS, DEFAULT_THEME, FILES_TRIGGER, IMPLICITLY_SAFE_TOOLS, PLAN_AGENT, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SafeModeProvider, SettingsProvider, ThemeProvider, VAPORWAVE_THEME, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyInsert, buildMcpServers, buildSkillsConfig, cerebrasDescriptor, cleanTitle, collectReferences, countNeighbors, createFilesCompletionProvider, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, eventsFromTurns, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fmtTokens, generateSessionTitle, getContextWindow, getSafelist, isOnSafelist, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, matchesSafelistEntry, mergeReferences, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseMcpsFile, piIdOf, projectsFilePath, readCredentials, readProjects, readProviderCredential, removeProviderCredential, renderSession, resolveAgentId, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, setProviderCredential, shortId, singleAgentRegistry, splitPromptSegments, stripSpawnTokensLine, suggestSafelistEntry, supportsOAuth, titleFromTurns, toolCallPreview, toolResultText, truncateTurnsAt, turnAsText, turnContextSize, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useEnabledToggleSet, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
|
|
1
|
+
import { $ as BUILTIN_THEMES, $t as piIdOf, A as readProjects, At as applyInsert, B as cleanTitle, Bt as removeProviderCredential, C as useSafeModeQueue, D as isOnSafelist, Dt as FILES_TRIGGER, E as getSafelist, Et as uniqueSkillNamesFromReferences, F as supportsOAuth, Ft as detectAuth, G as shortId, Gt as cerebrasDescriptor, H as ageString, Ht as writeCredentials, I as buildMcpServers, It as applyApiKeyEnv, J as DEFAULT_SETTINGS, Jt as getModelInfo, K as listProjectFiles, Kt as credKeyOf, L as defaultMcpsConfigPaths, Lt as credentialsPath, M as writeProjects, Mt as findActiveTrigger, N as splitPromptSegments, Nt as mergeReferences, O as matchesSafelistEntry, Ot as createFilesCompletionProvider, P as runOAuthLogin, Pt as useCompletion, Q as useSettings, Qt as openrouterDescriptor, R as discoverProjectMcps, Rt as readCredentials, S as useSafeModeActions, St as toolResultText, T as addToSafelist, Tt as createSkillsCompletionProvider, Ut as BUILTIN_PROVIDERS, V as generateSessionTitle, Vt as setProviderCredential, W as fmtTokens, Wt as anthropicDescriptor, X as SETTINGS_TOGGLES, Xt as modelsForDescriptor, Y as SETTINGS_CHOICES, Yt as modelSupportsReasoning, Z as SettingsProvider, Zt as openaiDescriptor, _ as discoverProjectSkills, _t as saveState, a as ThemeProvider, an as singleAgentRegistry, at as CATPPUCCIN_LATTE, b as writeSessionExport, bt as titleFromTurns, c as useSurfaces, ct as ConfigProvider, d as finalizeStreamingMarkdown, dt as createStateStore, en as BUILD_AGENT, et as DEFAULT_THEME, f as finalizeStreamingMarkdownForOwner, ft as deriveSessionTitle, g as defaultSkillScanPaths, gt as loadState, h as buildSkillsConfig, ht as listSessionMeta, i as turnAsText, in as resolveAgentId, it as CATPPUCCIN_FRAPPE, j as suggestSafelistEntry, jt as collectReferences, k as projectsFilePath, kt as uniqueFilesFromReferences, l as useSyntaxStyles, lt as useConfig, m as useStreamBuffer, mt as lastContextSizeFromTurns, n as deleteTurnSafely, nn as DEFAULT_AGENT_ID, nt as resolveTheme, o as useColors, ot as CATPPUCCIN_MACCHIATO, p as turnContextSize, pt as eventsFromTurns, q as useEnabledToggleSet, qt as getContextWindow, r as truncateTurnsAt, rn as PLAN_AGENT, rt as VAPORWAVE_THEME, s as useSelectStyle, st as CATPPUCCIN_MOCHA, t as countNeighbors, tn as BUILTIN_AGENTS, tt as resolveChipColor, u as useTheme, ut as resolveConfig, v as renderSession, vt as selectableTurnIds, w as IMPLICITLY_SAFE_TOOLS, wt as SKILLS_TRIGGER, x as SafeModeProvider, xt as toolCallPreview, y as resolveSessionExportTarget, yt as stripSpawnTokensLine, z as parseMcpsFile, zt as readProviderCredential } from "./turn-operations-BF3hMNgo.js";
|
|
2
|
+
export { BUILD_AGENT, BUILTIN_AGENTS, BUILTIN_PROVIDERS, BUILTIN_THEMES, CATPPUCCIN_FRAPPE, CATPPUCCIN_LATTE, CATPPUCCIN_MACCHIATO, CATPPUCCIN_MOCHA, ConfigProvider, DEFAULT_AGENT_ID, DEFAULT_SETTINGS, DEFAULT_THEME, FILES_TRIGGER, IMPLICITLY_SAFE_TOOLS, PLAN_AGENT, SETTINGS_CHOICES, SETTINGS_TOGGLES, SKILLS_TRIGGER, SafeModeProvider, SettingsProvider, ThemeProvider, VAPORWAVE_THEME, addToSafelist, ageString, anthropicDescriptor, applyApiKeyEnv, applyInsert, buildMcpServers, buildSkillsConfig, cerebrasDescriptor, cleanTitle, collectReferences, countNeighbors, createFilesCompletionProvider, createSkillsCompletionProvider, createStateStore, credKeyOf, credentialsPath, defaultMcpsConfigPaths, defaultSkillScanPaths, deleteTurnSafely, deriveSessionTitle, detectAuth, discoverProjectMcps, discoverProjectSkills, eventsFromTurns, finalizeStreamingMarkdown, finalizeStreamingMarkdownForOwner, findActiveTrigger, fmtTokens, generateSessionTitle, getContextWindow, getModelInfo, getSafelist, isOnSafelist, lastContextSizeFromTurns, listProjectFiles, listSessionMeta, loadState, matchesSafelistEntry, mergeReferences, modelSupportsReasoning, modelsForDescriptor, openaiDescriptor, openrouterDescriptor, parseMcpsFile, piIdOf, projectsFilePath, readCredentials, readProjects, readProviderCredential, removeProviderCredential, renderSession, resolveAgentId, resolveChipColor, resolveConfig, resolveSessionExportTarget, resolveTheme, runOAuthLogin, saveState, selectableTurnIds, setProviderCredential, shortId, singleAgentRegistry, splitPromptSegments, stripSpawnTokensLine, suggestSafelistEntry, supportsOAuth, titleFromTurns, toolCallPreview, toolResultText, truncateTurnsAt, turnAsText, turnContextSize, uniqueFilesFromReferences, uniqueSkillNamesFromReferences, useColors, useCompletion, useConfig, useEnabledToggleSet, useSafeModeActions, useSafeModeQueue, useSelectStyle, useSettings, useStreamBuffer, useSurfaces, useSyntaxStyles, useTheme, writeCredentials, writeProjects, writeSessionExport };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dt as SessionTurn, Nt as ToolResultContent, O as SessionRun, U as Provider, ht as McpServerConfig, k as SessionStore } from "./agent-JhicgLOV.js";
|
|
1
|
+
import { At as ThinkingLevel, Dt as SessionTurn, Nt as ToolResultContent, O as SessionRun, U as Provider, ht as McpServerConfig, k as SessionStore } from "./agent-JhicgLOV.js";
|
|
2
2
|
import { t as Preset } from "./index-2yLUyTbc.js";
|
|
3
3
|
import { OAuthProviderInterface } from "@mariozechner/pi-ai/oauth";
|
|
4
4
|
import { ReactNode } from "react";
|
|
@@ -182,12 +182,27 @@ declare const BUILTIN_PROVIDERS: Readonly<Record<string, ProviderDescriptor>>;
|
|
|
182
182
|
* model list) — callers should hide the model picker in that case.
|
|
183
183
|
*/
|
|
184
184
|
declare function modelsForDescriptor(descriptor: ProviderDescriptor): readonly ModelInfo[];
|
|
185
|
+
/**
|
|
186
|
+
* Resolve a single model's metadata via the descriptor's model source.
|
|
187
|
+
* Mirrors {@link modelsForDescriptor} routing: descriptor's own list wins,
|
|
188
|
+
* pi-ai's registry is the fallback. Returns `null` when the model isn't
|
|
189
|
+
* known.
|
|
190
|
+
*/
|
|
191
|
+
declare function getModelInfo(descriptor: ProviderDescriptor, modelId: string): ModelInfo | null;
|
|
185
192
|
/**
|
|
186
193
|
* Look up the model's max context window via the descriptor's model source.
|
|
187
194
|
* Returns `null` when the model isn't known (custom slugs, providers without
|
|
188
195
|
* a registry); callers should hide the context indicator in that case.
|
|
189
196
|
*/
|
|
190
197
|
declare function getContextWindow(descriptor: ProviderDescriptor, modelId: string): number | null;
|
|
198
|
+
/**
|
|
199
|
+
* Whether the given model exposes a reasoning / extended-thinking knob.
|
|
200
|
+
* Drives the TUI's effort picker visibility — the `ctrl+n` shortcut and
|
|
201
|
+
* the bottom-bar `effortName` segment only surface when this is `true`.
|
|
202
|
+
* Returns `false` for unknown models (no registry entry → no advertised
|
|
203
|
+
* capability).
|
|
204
|
+
*/
|
|
205
|
+
declare function modelSupportsReasoning(descriptor: ProviderDescriptor, modelId: string): boolean;
|
|
191
206
|
//#endregion
|
|
192
207
|
//#region src/chat/auth.d.ts
|
|
193
208
|
/**
|
|
@@ -492,6 +507,13 @@ interface StreamEvent {
|
|
|
492
507
|
interface Picked {
|
|
493
508
|
provider: ProviderAuth;
|
|
494
509
|
model: string;
|
|
510
|
+
/**
|
|
511
|
+
* Reasoning effort the user selected for `model`. Only meaningful when
|
|
512
|
+
* the active model exposes reasoning (`ModelInfo.reasoning === true`);
|
|
513
|
+
* `undefined` otherwise. Forwarded to `agent.run` as `thinking` so
|
|
514
|
+
* providers route it to their per-model reasoning control.
|
|
515
|
+
*/
|
|
516
|
+
effort?: ThinkingLevel;
|
|
495
517
|
}
|
|
496
518
|
interface SessionMeta {
|
|
497
519
|
id: string;
|
|
@@ -567,6 +589,12 @@ interface TuiState {
|
|
|
567
589
|
lastSessionId?: string;
|
|
568
590
|
/** Per-provider last-used model id. */
|
|
569
591
|
lastModelByProvider?: Partial<Record<ProviderKey, string>>;
|
|
592
|
+
/**
|
|
593
|
+
* Per-model last-picked reasoning effort. Keyed by model id (not provider)
|
|
594
|
+
* so switching the same model across providers preserves the user's
|
|
595
|
+
* intent. Models without reasoning support are absent from the map.
|
|
596
|
+
*/
|
|
597
|
+
lastEffortByModel?: Record<string, ThinkingLevel>;
|
|
570
598
|
/**
|
|
571
599
|
* Last-active agent profile id (see {@link AgentRegistry}). Resumed on
|
|
572
600
|
* launch so a returning user lands back in the same mode (Build / Plan /
|
|
@@ -1198,5 +1226,5 @@ declare const BUILTIN_THEMES: Readonly<Record<string, Theme>>;
|
|
|
1198
1226
|
/** Resolve a theme id to its full `Theme`, falling back to default on unknown ids. */
|
|
1199
1227
|
declare function resolveTheme(id: string | undefined): Theme;
|
|
1200
1228
|
//#endregion
|
|
1201
|
-
export { Settings as $, useEnabledToggleSet as A,
|
|
1202
|
-
//# sourceMappingURL=theme-
|
|
1229
|
+
export { Settings as $, useEnabledToggleSet as A, AgentProfile as At, lastContextSizeFromTurns as B, DiscoveredMcp as C, getModelInfo as Ct, parseMcpsFile as D, openrouterDescriptor as Dt, discoverProjectMcps as E, openaiDescriptor as Et, StateStoreApi as F, PLAN_AGENT as Ft, stripSpawnTokensLine as G, loadState as H, TuiState as I, resolveAgentId as It, toolResultText as J, titleFromTurns as K, createStateStore as L, singleAgentRegistry as Lt, ProviderRegistry as M, BUILD_AGENT as Mt, ResolvedConfig as N, BUILTIN_AGENTS as Nt, EnabledAllowlistKey as O, piIdOf as Ot, resolveConfig as P, DEFAULT_AGENT_ID as Pt, SessionMeta as Q, deriveSessionTitle as R, splitPromptSegments as S, getContextWindow as St, defaultMcpsConfigPaths as T, modelsForDescriptor as Tt, saveState as U, listSessionMeta as V, selectableTurnIds as W, Picked as X, Owner as Y, Screen as Z, SafeModeProvider as _, ModelInfo as _t, SyntaxStyles as a, CompletionReference as at, PromptSegment as b, cerebrasDescriptor as bt, ThemeColors as c, collectReferences as ct, resolveChipColor as d, useCompletion as dt, StreamEvent as et, resolveTheme as f, AuthMethod as ft, SafeModeActions as g, BUILTIN_PROVIDERS as gt, RequestApproval as h, detectAuth as ht, DEFAULT_THEME as i, CompletionProvider as it, ChatOptions as j, AgentRegistry as jt, EnabledToggleSet as k, AgentAccent as kt, ThemeSelect as l, findActiveTrigger as lt, ApprovalRequest as m, ProviderKey as mt, ChipColor as n, CompletionContext as nt, SyntaxTokenStyle as o, CompletionState as ot, ApprovalDecision as p, ProviderAuth as pt, toolCallPreview as q, ChipColorMap as r, CompletionItem as rt, Theme as s, applyInsert as st, BUILTIN_THEMES as t, ActiveTrigger as tt, ThemeSurfaces as u, mergeReferences as ut, useSafeModeActions as v, ProviderDescriptor as vt, buildMcpServers as w, modelSupportsReasoning as wt, PromptSegmentRef as x, credKeyOf as xt, useSafeModeQueue as y, anthropicDescriptor as yt, eventsFromTurns as z };
|
|
1230
|
+
//# sourceMappingURL=theme-C3JHZ5y9.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-C3JHZ5y9.d.ts","names":[],"sources":["../src/chat/agents.ts","../src/chat/providers.ts","../src/chat/auth.ts","../src/chat/completion.ts","../src/chat/types.ts","../src/chat/store.ts","../src/chat/config.ts","../src/chat/enabled-toggle-set.ts","../src/chat/mcps-discovery.ts","../src/chat/prompt-segments.ts","../src/chat/safe-mode-context.tsx","../src/chat/theme.ts"],"mappings":";;;;;;;;;;;;KAwBY,WAAA;AAAA,UAEK,YAAA;EAeN;EAbT,EAAA;EAaoB;EAXpB,KAAA;EAcuB;EAZvB,WAAA;EAYkD;;;;;;EALlD,MAAA,EAAQ,MAAA;EAK0C;EAHlD,MAAA,GAAS,WAAA;AAAA;AAAA,KAGC,aAAA,GAAgB,QAAA,CAAS,MAAA,SAAe,YAAA;;;;;AAiCpD;cApBa,WAAA,EAAa,YAAA;;;;AAqC1B;;;cAjBa,UAAA,EAAY,YAAA;;AAuBzB;;;;cANa,cAAA,EAAgB,aAAA;AAc7B;AAAA,cARa,gBAAA;;;;;;;iBAQG,cAAA,CACd,QAAA,EAAU,aAAA,EACV,WAAA,sBACA,SAAA;;AAgBF;;;;;iBAAgB,mBAAA,CAAoB,MAAA,EAAQ,MAAA,GAAS,aAAA;;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,EAAA;EACA,IAAA;EACA,MAAA;EACA,SAAA;EACA,GAAA;AAAA;;;;;;;;;;;;AVnBF;KUkCY,YAAA,GAAe,MAAA,SAAe,gBAAA;;UAGzB,KAAA;EVrCiC;EUuChD,EAAA;EVlCoB;EUoCpB,KAAA;EACA,MAAA,EAAQ,WAAA;EACR,MAAA,EAAQ,WAAA;EACR,QAAA,EAAU,aAAA;EACV,MAAA,EAAQ,YAAA;AAAA;AAAA,cAmDG,aAAA,EAAe,KAAA;;AVxE5B;;;;;AAYA;;;;cUiLa,cAAA,EAAgB,QAAA,CAAS,MAAA,SAAe,KAAA;AVxKrD;AAAA,iBUkLgB,YAAA,CAAa,EAAA,uBAAyB,KAAA"}
|
package/dist/tui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as SkillConfig } from "./agent-JhicgLOV.js";
|
|
2
|
-
import { $ as Settings, C as DiscoveredMcp,
|
|
2
|
+
import { $ as Settings, C as DiscoveredMcp, N as ResolvedConfig, O as EnabledAllowlistKey, Q as SessionMeta, S as splitPromptSegments, _t as ModelInfo, at as CompletionReference, b as PromptSegment, c as ThemeColors, et as StreamEvent, it as CompletionProvider, j as ChatOptions, jt as AgentRegistry, kt as AgentAccent, m as ApprovalRequest, ot as CompletionState, p as ApprovalDecision, pt as ProviderAuth, s as Theme, x as PromptSegmentRef } from "./theme-C3JHZ5y9.js";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
import { SyntaxStyle } from "@opentui/core";
|
|
@@ -102,6 +102,18 @@ interface Hint {
|
|
|
102
102
|
keyColor?: string;
|
|
103
103
|
/** Optional override for the label color. Defaults to `COLOR.dim`. */
|
|
104
104
|
labelColor?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Optional secondary chord + value rendered inline after the primary
|
|
107
|
+
* pair: `<key><extra.key> <label> <extra.label>`. Lets one hint advertise
|
|
108
|
+
* a compound shortcut (e.g. `ctrl+m/n model effort`) without forcing
|
|
109
|
+
* callers into a parallel struct or a custom renderer.
|
|
110
|
+
*/
|
|
111
|
+
extra?: {
|
|
112
|
+
key: string;
|
|
113
|
+
label: string; /** Defaults to `COLOR.mute` — the secondary key is rendered dimmer than the primary so the chord reads as one unit. */
|
|
114
|
+
keyColor?: string; /** Defaults to `COLOR.dim`. */
|
|
115
|
+
labelColor?: string;
|
|
116
|
+
};
|
|
105
117
|
}
|
|
106
118
|
interface ContextUsage {
|
|
107
119
|
used: number;
|
package/dist/tui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui.d.ts","names":[],"sources":["../src/tui/agent-picker.tsx","../src/tui/app.tsx","../src/tui/completion-popup.tsx","../src/tui/components.tsx","../src/tui/mcps-settings.tsx","../src/tui/modal.tsx","../src/tui/model-picker.tsx","../src/tui/screens.tsx","../src/tui/settings-modal.tsx","../src/tui/skills-settings.tsx","../src/tui/theme.ts","../src/tui/toggle-list-modal.tsx","../src/tui/index.tsx"],"mappings":";;;;;;;;;;;;;AAoBA;;;;;iBAAgB,gBAAA,CAAA;EACd,MAAA;EACA,cAAA;EACA;AAAA;EAEA,MAAA,EAAQ,aAAA;EACR,cAAA;EACA,MAAA,GAAS,EAAA;AAAA,IAFY,OAAA,CAGtB,SAAA;;;;;;iBAkFe,WAAA,CACd,MAAA,EAAQ,WAAA,cACR,KAAA;EAAS,KAAA;EAAe,MAAA;EAAgB,IAAA;EAAc,KAAA;AAAA;;;;;;;;;;AA5FxD;
|
|
1
|
+
{"version":3,"file":"tui.d.ts","names":[],"sources":["../src/tui/agent-picker.tsx","../src/tui/app.tsx","../src/tui/completion-popup.tsx","../src/tui/components.tsx","../src/tui/mcps-settings.tsx","../src/tui/modal.tsx","../src/tui/model-picker.tsx","../src/tui/screens.tsx","../src/tui/settings-modal.tsx","../src/tui/skills-settings.tsx","../src/tui/theme.ts","../src/tui/toggle-list-modal.tsx","../src/tui/index.tsx"],"mappings":";;;;;;;;;;;;;AA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AAa,KAAA,EAAO,KAAA,GAAQ,WAAA;;;;;;;;;;iBA+D5B,UAAA,CAAA,GAAc,WAAA;;;;;;;;AV1D9B;;;;;;;;;;iBWIgB,eAAA,GAAA,CAAA;EACd,OAAA;EACA,KAAA;EACA,UAAA;EACA,KAAA;EACA,YAAA;EACA;AAAA;EAEA,OAAA,WAAkB,CAAA;EAClB,KAAA,GAAQ,KAAA,EAAO,CAAA;EACf,UAAA,EAAY,mBAAA,EXXZ;EWaA,KAAA,UXXA;EWaA,YAAA,IAAgB,KAAA,EAAO,CAAA,KAAM,SAAA,EXZ7B;EWcA,UAAA,EAAY,SAAA;AAAA,IACb,SAAA;;;;;;;;;AXrBD;;;;;;;;;;;;;;;;;;;;;;;;AA0FA;;;;;;;;;;iBYzCsB,MAAA,CAAO,OAAA,GAAS,OAAA,CAAQ,WAAA,IAAoB,OAAA"}
|
package/dist/tui.js
CHANGED
|
@@ -2,7 +2,7 @@ import { d as createAgent } from "./tools-CLazLRb4.js";
|
|
|
2
2
|
import { n as formatTokenUsage } from "./stats-DZIsGqzu.js";
|
|
3
3
|
import { n as loadSession, t as createSession } from "./session-791hhrFa.js";
|
|
4
4
|
import { createTuiStore } from "./session/sqlite.js";
|
|
5
|
-
import { C as useSafeModeQueue, Ct as findGitRoot, D as isOnSafelist, E as getSafelist, Et as uniqueSkillNamesFromReferences, F as supportsOAuth, Ft as detectAuth, G as shortId, H as ageString, I as buildMcpServers, J as DEFAULT_SETTINGS, K as listProjectFiles, N as splitPromptSegments, Ot as createFilesCompletionProvider, P as runOAuthLogin, Pt as useCompletion, Q as useSettings, R as discoverProjectMcps, S as useSafeModeActions, St as toolResultText, T as addToSafelist, Tt as createSkillsCompletionProvider, U as compactPath, V as generateSessionTitle, Vt as setProviderCredential, W as fmtTokens, X as SETTINGS_TOGGLES, Y as SETTINGS_CHOICES, Z as SettingsProvider, _ as discoverProjectSkills, a as ThemeProvider, b as writeSessionExport, c as useSurfaces, ct as ConfigProvider, d as finalizeStreamingMarkdown, f as finalizeStreamingMarkdownForOwner, ft as deriveSessionTitle, g as defaultSkillScanPaths, h as buildSkillsConfig, ht as listSessionMeta, i as turnAsText, j as suggestSafelistEntry, lt as useConfig, m as useStreamBuffer, mt as lastContextSizeFromTurns, n as deleteTurnSafely, nt as resolveTheme, o as useColors, p as turnContextSize, pt as eventsFromTurns, q as useEnabledToggleSet, qt as getContextWindow, r as truncateTurnsAt, s as useSelectStyle, tt as resolveChipColor, u as useTheme, ut as resolveConfig, vt as selectableTurnIds, x as SafeModeProvider, xt as toolCallPreview, yt as stripSpawnTokensLine } from "./turn-operations-
|
|
5
|
+
import { $t as piIdOf, C as useSafeModeQueue, Ct as findGitRoot, D as isOnSafelist, E as getSafelist, Et as uniqueSkillNamesFromReferences, F as supportsOAuth, Ft as detectAuth, G as shortId, H as ageString, I as buildMcpServers, J as DEFAULT_SETTINGS, K as listProjectFiles, N as splitPromptSegments, Ot as createFilesCompletionProvider, P as runOAuthLogin, Pt as useCompletion, Q as useSettings, R as discoverProjectMcps, S as useSafeModeActions, St as toolResultText, T as addToSafelist, Tt as createSkillsCompletionProvider, U as compactPath, V as generateSessionTitle, Vt as setProviderCredential, W as fmtTokens, X as SETTINGS_TOGGLES, Y as SETTINGS_CHOICES, Yt as modelSupportsReasoning, Z as SettingsProvider, _ as discoverProjectSkills, a as ThemeProvider, b as writeSessionExport, c as useSurfaces, ct as ConfigProvider, d as finalizeStreamingMarkdown, f as finalizeStreamingMarkdownForOwner, ft as deriveSessionTitle, g as defaultSkillScanPaths, h as buildSkillsConfig, ht as listSessionMeta, i as turnAsText, j as suggestSafelistEntry, lt as useConfig, m as useStreamBuffer, mt as lastContextSizeFromTurns, n as deleteTurnSafely, nt as resolveTheme, o as useColors, p as turnContextSize, pt as eventsFromTurns, q as useEnabledToggleSet, qt as getContextWindow, r as truncateTurnsAt, s as useSelectStyle, tt as resolveChipColor, u as useTheme, ut as resolveConfig, vt as selectableTurnIds, x as SafeModeProvider, xt as toolCallPreview, yt as stripSpawnTokensLine } from "./turn-operations-BF3hMNgo.js";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
import { createContext, createElement, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
8
8
|
import { RGBA, SyntaxStyle, addDefaultParsers, createCliRenderer, defaultTextareaKeyBindings, getTreeSitterClient } from "@opentui/core";
|
|
@@ -474,9 +474,17 @@ function renderHintSpans(hints, COLOR) {
|
|
|
474
474
|
fg: h.keyColor ?? COLOR.warn,
|
|
475
475
|
children: h.key
|
|
476
476
|
}),
|
|
477
|
+
h.extra && /* @__PURE__ */ jsx("span", {
|
|
478
|
+
fg: h.extra.keyColor ?? COLOR.mute,
|
|
479
|
+
children: h.extra.key
|
|
480
|
+
}),
|
|
477
481
|
/* @__PURE__ */ jsx("span", {
|
|
478
482
|
fg: h.labelColor ?? COLOR.dim,
|
|
479
483
|
children: ` ${h.label}`
|
|
484
|
+
}),
|
|
485
|
+
h.extra && /* @__PURE__ */ jsx("span", {
|
|
486
|
+
fg: h.extra.labelColor ?? COLOR.dim,
|
|
487
|
+
children: ` ${h.extra.label}`
|
|
480
488
|
})
|
|
481
489
|
] }, i));
|
|
482
490
|
}
|
|
@@ -645,7 +653,11 @@ function truncateTrailing(text, max) {
|
|
|
645
653
|
*/
|
|
646
654
|
function hintsLength(hints) {
|
|
647
655
|
if (hints.length === 0) return 0;
|
|
648
|
-
return hints.reduce((sum, h, i) =>
|
|
656
|
+
return hints.reduce((sum, h, i) => {
|
|
657
|
+
const base = h.key.length + 1 + h.label.length;
|
|
658
|
+
const extra = h.extra ? h.extra.key.length + 1 + h.extra.label.length : 0;
|
|
659
|
+
return sum + base + extra + (i > 0 ? 3 : 0);
|
|
660
|
+
}, 0);
|
|
649
661
|
}
|
|
650
662
|
function contextIndicatorLength(context) {
|
|
651
663
|
const ratio = context.max > 0 ? context.used / context.max : 0;
|
|
@@ -1203,6 +1215,94 @@ function ToolResultBlock({ text, indent }) {
|
|
|
1203
1215
|
});
|
|
1204
1216
|
}
|
|
1205
1217
|
//#endregion
|
|
1218
|
+
//#region src/tui/effort-picker.tsx
|
|
1219
|
+
/**
|
|
1220
|
+
* Reasoning effort options surfaced in the picker. Mirrors {@link ThinkingLevel}
|
|
1221
|
+
* minus `'adaptive'` (Anthropic-only — opt in via {@link EffortPickerModal}'s
|
|
1222
|
+
* `supportsAdaptive` flag rather than confusing OpenAI / OpenRouter users with
|
|
1223
|
+
* a level their model silently treats as `'off'`).
|
|
1224
|
+
*/
|
|
1225
|
+
const BASE_LEVELS = [
|
|
1226
|
+
{
|
|
1227
|
+
id: "off",
|
|
1228
|
+
description: "no reasoning — fastest, smallest output"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
id: "minimal",
|
|
1232
|
+
description: "tiny reasoning budget (gpt-5 family)"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
id: "low",
|
|
1236
|
+
description: "short reasoning pass"
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
id: "medium",
|
|
1240
|
+
description: "balanced — sensible default"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
id: "high",
|
|
1244
|
+
description: "deep reasoning — slowest, longest"
|
|
1245
|
+
}
|
|
1246
|
+
];
|
|
1247
|
+
const ADAPTIVE_LEVEL = {
|
|
1248
|
+
id: "adaptive",
|
|
1249
|
+
description: "model decides per-turn (Anthropic)"
|
|
1250
|
+
};
|
|
1251
|
+
/**
|
|
1252
|
+
* Modal that lets the user pick a reasoning effort for the active model.
|
|
1253
|
+
* Only surfaced for models whose registry entry reports
|
|
1254
|
+
* `reasoning: true` — see `modelSupportsReasoning`.
|
|
1255
|
+
*
|
|
1256
|
+
* `'adaptive'` is Anthropic-only; pass `supportsAdaptive` to surface it.
|
|
1257
|
+
*/
|
|
1258
|
+
function EffortPickerModal({ current, supportsAdaptive, onPick }) {
|
|
1259
|
+
const COLOR = useColors();
|
|
1260
|
+
const SELECT_THEME = useSelectStyle();
|
|
1261
|
+
const levels = useMemo(() => supportsAdaptive ? [...BASE_LEVELS, ADAPTIVE_LEVEL] : BASE_LEVELS, [supportsAdaptive]);
|
|
1262
|
+
const options = useMemo(() => levels.map((l) => ({
|
|
1263
|
+
name: `${l.id === current ? "● " : " "}${l.id}`,
|
|
1264
|
+
description: l.description,
|
|
1265
|
+
value: l.id
|
|
1266
|
+
})), [levels, current]);
|
|
1267
|
+
const initialIndex = useMemo(() => {
|
|
1268
|
+
const idx = levels.findIndex((l) => l.id === current);
|
|
1269
|
+
return idx < 0 ? levels.findIndex((l) => l.id === "medium") : idx;
|
|
1270
|
+
}, [levels, current]);
|
|
1271
|
+
return /* @__PURE__ */ jsxs(Modal, {
|
|
1272
|
+
title: "select reasoning effort",
|
|
1273
|
+
children: [/* @__PURE__ */ jsx("select", {
|
|
1274
|
+
...SELECT_THEME,
|
|
1275
|
+
focused: true,
|
|
1276
|
+
options,
|
|
1277
|
+
wrapSelection: true,
|
|
1278
|
+
selectedIndex: Math.max(0, initialIndex),
|
|
1279
|
+
style: { height: levels.length },
|
|
1280
|
+
onSelect: (_idx, option) => {
|
|
1281
|
+
if (option) onPick(option.value);
|
|
1282
|
+
}
|
|
1283
|
+
}), /* @__PURE__ */ jsxs("text", {
|
|
1284
|
+
fg: COLOR.mute,
|
|
1285
|
+
children: [
|
|
1286
|
+
/* @__PURE__ */ jsx("span", {
|
|
1287
|
+
fg: COLOR.warn,
|
|
1288
|
+
children: "↑↓"
|
|
1289
|
+
}),
|
|
1290
|
+
" navigate · ",
|
|
1291
|
+
/* @__PURE__ */ jsx("span", {
|
|
1292
|
+
fg: COLOR.warn,
|
|
1293
|
+
children: "↵"
|
|
1294
|
+
}),
|
|
1295
|
+
" select · ",
|
|
1296
|
+
/* @__PURE__ */ jsx("span", {
|
|
1297
|
+
fg: COLOR.warn,
|
|
1298
|
+
children: "esc"
|
|
1299
|
+
}),
|
|
1300
|
+
" close"
|
|
1301
|
+
]
|
|
1302
|
+
})]
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
//#endregion
|
|
1206
1306
|
//#region src/tui/toggle-list-modal.tsx
|
|
1207
1307
|
/**
|
|
1208
1308
|
* Generic list-with-checkboxes modal. Powers both the Skills and MCP
|
|
@@ -4160,9 +4260,15 @@ function AppShell() {
|
|
|
4160
4260
|
const descriptor = providerRegistry[provider.key];
|
|
4161
4261
|
if (!descriptor) return null;
|
|
4162
4262
|
const remembered = initialState.lastModelByProvider?.[provider.key];
|
|
4163
|
-
|
|
4263
|
+
const model = modelId ?? remembered ?? descriptor.defaultModel ?? descriptor.factory().meta.defaultModel;
|
|
4264
|
+
const effort = effortForModel(descriptor, model, initialState.lastEffortByModel);
|
|
4265
|
+
return effort ? {
|
|
4266
|
+
provider,
|
|
4267
|
+
model,
|
|
4268
|
+
effort
|
|
4269
|
+
} : {
|
|
4164
4270
|
provider,
|
|
4165
|
-
model
|
|
4271
|
+
model
|
|
4166
4272
|
};
|
|
4167
4273
|
}, [providerRegistry, initialState]);
|
|
4168
4274
|
const buildAgent = useCallback((session, key) => {
|
|
@@ -4429,6 +4535,7 @@ function AppShell() {
|
|
|
4429
4535
|
const onPickModel = useCallback((modelId) => {
|
|
4430
4536
|
setPicked((prev) => {
|
|
4431
4537
|
if (!prev) return prev;
|
|
4538
|
+
const descriptor = providerRegistry[prev.provider.key];
|
|
4432
4539
|
const prior = stateStore.load();
|
|
4433
4540
|
stateStore.save({
|
|
4434
4541
|
...prior,
|
|
@@ -4437,13 +4544,45 @@ function AppShell() {
|
|
|
4437
4544
|
[prev.provider.key]: modelId
|
|
4438
4545
|
}
|
|
4439
4546
|
});
|
|
4440
|
-
|
|
4547
|
+
const nextEffort = descriptor ? effortForModel(descriptor, modelId, prior.lastEffortByModel) : void 0;
|
|
4548
|
+
return nextEffort ? {
|
|
4441
4549
|
...prev,
|
|
4550
|
+
model: modelId,
|
|
4551
|
+
effort: nextEffort
|
|
4552
|
+
} : {
|
|
4553
|
+
provider: prev.provider,
|
|
4442
4554
|
model: modelId
|
|
4443
4555
|
};
|
|
4444
4556
|
});
|
|
4445
4557
|
modal.close();
|
|
4558
|
+
}, [
|
|
4559
|
+
modal,
|
|
4560
|
+
stateStore,
|
|
4561
|
+
providerRegistry
|
|
4562
|
+
]);
|
|
4563
|
+
const onPickEffort = useCallback((effort) => {
|
|
4564
|
+
setPicked((prev) => {
|
|
4565
|
+
if (!prev) return prev;
|
|
4566
|
+
const prior = stateStore.load();
|
|
4567
|
+
stateStore.save({
|
|
4568
|
+
...prior,
|
|
4569
|
+
lastEffortByModel: {
|
|
4570
|
+
...prior.lastEffortByModel,
|
|
4571
|
+
[prev.model]: effort
|
|
4572
|
+
}
|
|
4573
|
+
});
|
|
4574
|
+
return {
|
|
4575
|
+
...prev,
|
|
4576
|
+
effort
|
|
4577
|
+
};
|
|
4578
|
+
});
|
|
4579
|
+
modal.close();
|
|
4446
4580
|
}, [modal, stateStore]);
|
|
4581
|
+
const modelHasReasoning = useMemo(() => {
|
|
4582
|
+
if (!picked) return false;
|
|
4583
|
+
const descriptor = providerRegistry[picked.provider.key];
|
|
4584
|
+
return !!descriptor && modelSupportsReasoning(descriptor, picked.model);
|
|
4585
|
+
}, [picked, providerRegistry]);
|
|
4447
4586
|
const onPickAgent = useCallback(async (id) => {
|
|
4448
4587
|
const profile = agentRegistry[id];
|
|
4449
4588
|
if (!profile) return;
|
|
@@ -4500,7 +4639,8 @@ function AppShell() {
|
|
|
4500
4639
|
try {
|
|
4501
4640
|
await agent.run({
|
|
4502
4641
|
model: picked.model,
|
|
4503
|
-
prompt
|
|
4642
|
+
prompt,
|
|
4643
|
+
...picked.effort ? { thinking: picked.effort } : {}
|
|
4504
4644
|
});
|
|
4505
4645
|
await session.save().catch((err) => debugLog("session.save failed", err));
|
|
4506
4646
|
setCurrentSession((prev) => prev ? {
|
|
@@ -4818,6 +4958,15 @@ function AppShell() {
|
|
|
4818
4958
|
}));
|
|
4819
4959
|
return;
|
|
4820
4960
|
}
|
|
4961
|
+
if (key.ctrl && key.name === "n" && screen === "chat" && picked && !busy && modelHasReasoning) {
|
|
4962
|
+
const descriptor = providerRegistry[picked.provider.key];
|
|
4963
|
+
modal.open(/* @__PURE__ */ jsx(EffortPickerModal, {
|
|
4964
|
+
current: picked.effort,
|
|
4965
|
+
supportsAdaptive: !!descriptor && piIdOf(descriptor) === "anthropic",
|
|
4966
|
+
onPick: onPickEffort
|
|
4967
|
+
}));
|
|
4968
|
+
return;
|
|
4969
|
+
}
|
|
4821
4970
|
if (key.ctrl && key.name === "s" && screen === "chat" && !busy && !pendingApproval) {
|
|
4822
4971
|
enterSelectMode();
|
|
4823
4972
|
return;
|
|
@@ -4848,6 +4997,9 @@ function AppShell() {
|
|
|
4848
4997
|
hasMultipleAgents,
|
|
4849
4998
|
modelLabel: picked?.model ?? null,
|
|
4850
4999
|
modelColor: COLOR.model,
|
|
5000
|
+
effortLabel: modelHasReasoning ? picked?.effort ?? "medium" : null,
|
|
5001
|
+
effortColor: COLOR.warn,
|
|
5002
|
+
effortKeyColor: COLOR.warn,
|
|
4851
5003
|
agentLabel: pickedAgent.label,
|
|
4852
5004
|
agentColor: accentColor(pickedAgent.accent, COLOR)
|
|
4853
5005
|
}), [
|
|
@@ -4858,7 +5010,8 @@ function AppShell() {
|
|
|
4858
5010
|
hasMultipleAgents,
|
|
4859
5011
|
picked,
|
|
4860
5012
|
pickedAgent,
|
|
4861
|
-
COLOR
|
|
5013
|
+
COLOR,
|
|
5014
|
+
modelHasReasoning
|
|
4862
5015
|
]);
|
|
4863
5016
|
const promptTriggerHints = useMemo(() => {
|
|
4864
5017
|
const out = [];
|
|
@@ -4941,12 +5094,25 @@ function AppShell() {
|
|
|
4941
5094
|
});
|
|
4942
5095
|
}
|
|
4943
5096
|
/**
|
|
5097
|
+
* Resolve the reasoning effort to seed `Picked.effort` for the given model.
|
|
5098
|
+
* Returns `undefined` when the model has no reasoning knob; otherwise the
|
|
5099
|
+
* per-model remembered value, defaulting to `'medium'` (sensible middle
|
|
5100
|
+
* ground when the user has never picked an explicit effort for this model).
|
|
5101
|
+
*/
|
|
5102
|
+
function effortForModel(descriptor, modelId, remembered) {
|
|
5103
|
+
if (!modelSupportsReasoning(descriptor, modelId)) return void 0;
|
|
5104
|
+
return remembered?.[modelId] ?? "medium";
|
|
5105
|
+
}
|
|
5106
|
+
/**
|
|
4944
5107
|
* Build the footer's shortcut hints for the current screen. On the chat
|
|
4945
5108
|
* screen the model id rides next to its `ctrl+m` shortcut and the agent
|
|
4946
5109
|
* label rides next to `shift+tab`, each in its accent color — the bar
|
|
4947
|
-
* doubles as the status display without needing separate badges.
|
|
5110
|
+
* doubles as the status display without needing separate badges. When
|
|
5111
|
+
* the active model exposes reasoning, the `ctrl+m` hint grows a
|
|
5112
|
+
* secondary `/n` chord with the current effort label, surfacing the
|
|
5113
|
+
* effort picker as a discoverable, in-place affordance.
|
|
4948
5114
|
*/
|
|
4949
|
-
function buildHints({ screen, busy, pending, currentSession, hasMultipleAgents, modelLabel, modelColor, agentLabel, agentColor }) {
|
|
5115
|
+
function buildHints({ screen, busy, pending, currentSession, hasMultipleAgents, modelLabel, modelColor, effortLabel, effortColor, effortKeyColor, agentLabel, agentColor }) {
|
|
4950
5116
|
if (pending) return [
|
|
4951
5117
|
{
|
|
4952
5118
|
key: "↑↓",
|
|
@@ -5001,17 +5167,24 @@ function buildHints({ screen, busy, pending, currentSession, hasMultipleAgents,
|
|
|
5001
5167
|
label: currentSession ? "back" : "exit"
|
|
5002
5168
|
}
|
|
5003
5169
|
];
|
|
5170
|
+
const modelHint = modelLabel ? {
|
|
5171
|
+
key: "ctrl+m",
|
|
5172
|
+
label: modelLabel,
|
|
5173
|
+
labelColor: modelColor,
|
|
5174
|
+
...effortLabel ? { extra: {
|
|
5175
|
+
key: "/n",
|
|
5176
|
+
keyColor: effortKeyColor,
|
|
5177
|
+
label: effortLabel,
|
|
5178
|
+
labelColor: effortColor
|
|
5179
|
+
} } : {}
|
|
5180
|
+
} : null;
|
|
5004
5181
|
return [
|
|
5005
5182
|
...hasMultipleAgents ? [{
|
|
5006
5183
|
key: "shift+tab",
|
|
5007
5184
|
label: agentLabel,
|
|
5008
5185
|
labelColor: agentColor
|
|
5009
5186
|
}] : [],
|
|
5010
|
-
...
|
|
5011
|
-
key: "ctrl+m",
|
|
5012
|
-
label: modelLabel,
|
|
5013
|
-
labelColor: modelColor
|
|
5014
|
-
}] : [],
|
|
5187
|
+
...modelHint ? [modelHint] : [],
|
|
5015
5188
|
...currentSession ? [{
|
|
5016
5189
|
key: "ctrl+x",
|
|
5017
5190
|
label: "session"
|