snow-ai 0.7.6 → 0.7.7
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/bundle/cli.mjs +493 -248
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1517,7 +1517,7 @@ var require_react_development = __commonJS({
|
|
|
1517
1517
|
var dispatcher = resolveDispatcher();
|
|
1518
1518
|
return dispatcher.useRef(initialValue);
|
|
1519
1519
|
}
|
|
1520
|
-
function
|
|
1520
|
+
function useEffect82(create3, deps) {
|
|
1521
1521
|
var dispatcher = resolveDispatcher();
|
|
1522
1522
|
return dispatcher.useEffect(create3, deps);
|
|
1523
1523
|
}
|
|
@@ -2300,7 +2300,7 @@ var require_react_development = __commonJS({
|
|
|
2300
2300
|
exports2.useContext = useContext13;
|
|
2301
2301
|
exports2.useDebugValue = useDebugValue;
|
|
2302
2302
|
exports2.useDeferredValue = useDeferredValue;
|
|
2303
|
-
exports2.useEffect =
|
|
2303
|
+
exports2.useEffect = useEffect82;
|
|
2304
2304
|
exports2.useId = useId;
|
|
2305
2305
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2306
2306
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
@@ -66612,11 +66612,11 @@ function getWorkflowSection(hasCodebase) {
|
|
|
66612
66612
|
|
|
66613
66613
|
**Golden Rule: Read what you need to write correct code, nothing more.**
|
|
66614
66614
|
|
|
66615
|
-
**BATCH OPERATIONS
|
|
66616
|
-
When dealing with
|
|
66617
|
-
- Multiple reads
|
|
66618
|
-
- Multiple edits
|
|
66619
|
-
-
|
|
66615
|
+
**BATCH OPERATIONS:**
|
|
66616
|
+
When dealing with multiple independent files, batch operations can improve efficiency:
|
|
66617
|
+
- Multiple reads: \\\`filesystem-read(filePath=["a.ts", "b.ts"])\\\`
|
|
66618
|
+
- Multiple edits: \\\`filesystem-edit(filePath=[{path:"a.ts",operations:[...]}, {path:"b.ts",operations:[...]}])\\\`
|
|
66619
|
+
- Use your judgment \u2014 batch when files are independent, sequence when there are dependencies`;
|
|
66620
66620
|
}
|
|
66621
66621
|
}
|
|
66622
66622
|
function getCodeSearchSection2(hasCodebase) {
|
|
@@ -66778,7 +66778,7 @@ PLACEHOLDER_FOR_TOOL_DISCOVERY_SECTION
|
|
|
66778
66778
|
4. **ABSOLUTE PROHIBITIONS** - NEVER edit partial functions (missing closing brace \`}\`), NEVER edit incomplete markup (missing \`</tag>\`), NEVER edit partial code blocks (unmatched \`{\`, \`}\`, \`(\`, \`)\`, \`[\`, \`]\`), NEVER copy line numbers from filesystem-read output
|
|
66779
66779
|
5. **EDIT** - \`filesystem-edit\` (hash-anchored \u2014 reference "lineNum:hash" anchors from read output, no text reproduction needed) - use ONLY after verification passes
|
|
66780
66780
|
|
|
66781
|
-
**BATCH OPERATIONS:**
|
|
66781
|
+
**BATCH OPERATIONS:** When modifying multiple independent files, consider using batch operations: \`filesystem-read(filePath=["a.ts","b.ts"])\` or \`filesystem-edit(filePath=[{path:"a.ts",operations:[...]},{path:"b.ts",operations:[...]}])\`
|
|
66782
66782
|
|
|
66783
66783
|
**File Creation Safety:**
|
|
66784
66784
|
- \`filesystem-create\` can ONLY create files that do not already exist at the target path
|
|
@@ -91262,7 +91262,7 @@ async function* createStreamingGeminiCompletion(options3, abortSignal, onRetry)
|
|
|
91262
91262
|
if (((_a20 = config3.geminiThinking) == null ? void 0 : _a20.enabled) && !options3.disableThinking) {
|
|
91263
91263
|
requestBody.generationConfig = {
|
|
91264
91264
|
thinkingConfig: {
|
|
91265
|
-
|
|
91265
|
+
thinkingLevel: config3.geminiThinking.thinkingLevel || "high"
|
|
91266
91266
|
}
|
|
91267
91267
|
};
|
|
91268
91268
|
}
|
|
@@ -94816,11 +94816,10 @@ var init_apiConfig = __esm({
|
|
|
94816
94816
|
requestMethod: "chat",
|
|
94817
94817
|
advancedModel: "",
|
|
94818
94818
|
basicModel: "",
|
|
94819
|
-
maxContextTokens:
|
|
94820
|
-
maxTokens:
|
|
94819
|
+
maxContextTokens: 2e5,
|
|
94820
|
+
maxTokens: 64e3,
|
|
94821
94821
|
anthropicBeta: false,
|
|
94822
94822
|
streamIdleTimeoutSec: DEFAULT_STREAM_IDLE_TIMEOUT_SEC,
|
|
94823
|
-
editSimilarityThreshold: 0.75,
|
|
94824
94823
|
streamingDisplay: false
|
|
94825
94824
|
}
|
|
94826
94825
|
};
|
|
@@ -243183,7 +243182,7 @@ var init_filesystem_types = __esm({
|
|
|
243183
243182
|
|
|
243184
243183
|
// dist/mcp/utils/filesystem/similarity.utils.js
|
|
243185
243184
|
function normalizeForDisplay(line) {
|
|
243186
|
-
return line.replace(/\t/g, " ").replace(/ +/g, " ");
|
|
243185
|
+
return line.replace(/\t/g, " ").replace(/ +/g, " ").replace(/\r/g, "");
|
|
243187
243186
|
}
|
|
243188
243187
|
var init_similarity_utils = __esm({
|
|
243189
243188
|
"dist/mcp/utils/filesystem/similarity.utils.js"() {
|
|
@@ -351741,10 +351740,8 @@ ${numberedLines3.join("\n")}`;
|
|
|
351741
351740
|
const structureAnalysis = analyzeCodeStructure(finalLines.join("\n"), filePath, finalLines.slice(editStartLine - 1, editStartLine - 1 + (editEndLine - editStartLine + 1)));
|
|
351742
351741
|
let diagnostics = [];
|
|
351743
351742
|
try {
|
|
351744
|
-
|
|
351745
|
-
|
|
351746
|
-
new Promise((resolve13) => setTimeout(() => resolve13([]), 1e3))
|
|
351747
|
-
]);
|
|
351743
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
351744
|
+
diagnostics = await vscodeConnection.requestDiagnostics(fullPath);
|
|
351748
351745
|
} catch {
|
|
351749
351746
|
}
|
|
351750
351747
|
const result2 = {
|
|
@@ -351942,7 +351939,7 @@ ${fmt}`;
|
|
|
351942
351939
|
},
|
|
351943
351940
|
{
|
|
351944
351941
|
name: "filesystem-edit",
|
|
351945
|
-
description: 'PREFERRED edit tool: Hash-anchored editing using content hashes from filesystem-read.
|
|
351942
|
+
description: 'PREFERRED edit tool: Hash-anchored editing using content hashes from filesystem-read. Line format: "lineNum:hash\u2192content" (e.g. "42:a3\u2192code"). Use anchors "lineNum:hash" to reference lines \u2014 no text reproduction needed. **OPERATIONS**: (1) replace \u2014 replaces startAnchor..endAnchor with content; (2) insert_after \u2014 inserts content after startAnchor; (3) delete \u2014 removes startAnchor..endAnchor, set content to empty string "". **WORKFLOW**: filesystem-read \u2192 note anchors \u2192 call this tool with operations. **ANCHOR FORMAT**: "lineNum:hash" e.g. "10:a3". Omit endAnchor for single-line operations. **SUPPORTS BATCH**: Pass array of {path, operations} for multi-file edits.',
|
|
351946
351943
|
inputSchema: {
|
|
351947
351944
|
type: "object",
|
|
351948
351945
|
properties: {
|
|
@@ -351977,14 +351974,14 @@ ${fmt}`;
|
|
|
351977
351974
|
},
|
|
351978
351975
|
endAnchor: {
|
|
351979
351976
|
type: "string",
|
|
351980
|
-
description:
|
|
351977
|
+
description: 'End anchor for range operations (format: "lineNum:hash", e.g. "10:a3"). Omit for single-line operations.'
|
|
351981
351978
|
},
|
|
351982
351979
|
content: {
|
|
351983
351980
|
type: "string",
|
|
351984
|
-
description:
|
|
351981
|
+
description: 'New content to write (for replace and insert_after). Pass empty string "" for delete. Do NOT include line numbers or hashes.'
|
|
351985
351982
|
}
|
|
351986
351983
|
},
|
|
351987
|
-
required: ["type", "startAnchor"]
|
|
351984
|
+
required: ["type", "startAnchor", "content"]
|
|
351988
351985
|
},
|
|
351989
351986
|
description: "Array of edit operations for this file"
|
|
351990
351987
|
}
|
|
@@ -352004,7 +352001,7 @@ ${fmt}`;
|
|
|
352004
352001
|
type: {
|
|
352005
352002
|
type: "string",
|
|
352006
352003
|
enum: ["replace", "insert_after", "delete"],
|
|
352007
|
-
description: "
|
|
352004
|
+
description: "Operation type"
|
|
352008
352005
|
},
|
|
352009
352006
|
startAnchor: {
|
|
352010
352007
|
type: "string",
|
|
@@ -352012,14 +352009,14 @@ ${fmt}`;
|
|
|
352012
352009
|
},
|
|
352013
352010
|
endAnchor: {
|
|
352014
352011
|
type: "string",
|
|
352015
|
-
description: 'End anchor for range operations (format: "lineNum:hash"). Omit for single-line
|
|
352012
|
+
description: 'End anchor for range operations (format: "lineNum:hash", e.g. "10:a3"). Omit for single-line operations.'
|
|
352016
352013
|
},
|
|
352017
352014
|
content: {
|
|
352018
352015
|
type: "string",
|
|
352019
|
-
description:
|
|
352016
|
+
description: 'New content to write (for replace and insert_after). Pass empty string "" for delete. Do NOT include line numbers or hashes.'
|
|
352020
352017
|
}
|
|
352021
352018
|
},
|
|
352022
|
-
required: ["type", "startAnchor"]
|
|
352019
|
+
required: ["type", "startAnchor", "content"]
|
|
352023
352020
|
},
|
|
352024
352021
|
description: "Array of edit operations (for single file mode). Each operation references anchors from filesystem-read."
|
|
352025
352022
|
},
|
|
@@ -431174,6 +431171,29 @@ var init_todo = __esm({
|
|
|
431174
431171
|
};
|
|
431175
431172
|
return this.saveTodoList(sessionId, todoList.todos, todoList);
|
|
431176
431173
|
}
|
|
431174
|
+
/**
|
|
431175
|
+
* 批量更新多个 TODO 项
|
|
431176
|
+
*/
|
|
431177
|
+
async updateTodoItems(sessionId, todoIds, updates) {
|
|
431178
|
+
const todoList = await this.getTodoList(sessionId);
|
|
431179
|
+
if (!todoList) {
|
|
431180
|
+
return null;
|
|
431181
|
+
}
|
|
431182
|
+
const idSet = new Set(todoIds);
|
|
431183
|
+
const updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
431184
|
+
let anyFound = false;
|
|
431185
|
+
todoList.todos = todoList.todos.map((t) => {
|
|
431186
|
+
if (idSet.has(t.id)) {
|
|
431187
|
+
anyFound = true;
|
|
431188
|
+
return { ...t, ...updates, updatedAt };
|
|
431189
|
+
}
|
|
431190
|
+
return t;
|
|
431191
|
+
});
|
|
431192
|
+
if (!anyFound) {
|
|
431193
|
+
return null;
|
|
431194
|
+
}
|
|
431195
|
+
return this.saveTodoList(sessionId, todoList.todos, todoList);
|
|
431196
|
+
}
|
|
431177
431197
|
/**
|
|
431178
431198
|
* 添加 TODO 项
|
|
431179
431199
|
*/
|
|
@@ -431209,6 +431229,18 @@ var init_todo = __esm({
|
|
|
431209
431229
|
const filteredTodos = todoList.todos.filter((t) => t.id !== todoId && t.parentId !== todoId);
|
|
431210
431230
|
return this.saveTodoList(sessionId, filteredTodos, todoList);
|
|
431211
431231
|
}
|
|
431232
|
+
/**
|
|
431233
|
+
* 批量删除多个 TODO 项(含级联删除子项)
|
|
431234
|
+
*/
|
|
431235
|
+
async deleteTodoItems(sessionId, todoIds) {
|
|
431236
|
+
const todoList = await this.getTodoList(sessionId);
|
|
431237
|
+
if (!todoList) {
|
|
431238
|
+
return null;
|
|
431239
|
+
}
|
|
431240
|
+
const idSet = new Set(todoIds);
|
|
431241
|
+
const filteredTodos = todoList.todos.filter((t) => !idSet.has(t.id) && !idSet.has(t.parentId ?? ""));
|
|
431242
|
+
return this.saveTodoList(sessionId, filteredTodos, todoList);
|
|
431243
|
+
}
|
|
431212
431244
|
/**
|
|
431213
431245
|
* 创建空 TODO 列表(会话自动创建时使用)
|
|
431214
431246
|
*/
|
|
@@ -431294,6 +431326,10 @@ EXAMPLE: todo-get + filesystem-read (check progress while reading files)`,
|
|
|
431294
431326
|
PARALLEL CALLS ONLY: MUST pair with other tools (todo-update + filesystem-edit/terminal-execute/etc).
|
|
431295
431327
|
NEVER call todo-update alone - always combine with an action tool.
|
|
431296
431328
|
|
|
431329
|
+
SUPPORTS BATCH UPDATING:
|
|
431330
|
+
- Single: todoId="task-id"
|
|
431331
|
+
- Multiple: todoId=["id1", "id2", "id3"] (all get the same status/content)
|
|
431332
|
+
|
|
431297
431333
|
BEST PRACTICE:
|
|
431298
431334
|
- Mark "completed" ONLY after task is verified
|
|
431299
431335
|
- Update while working, not after
|
|
@@ -431304,8 +431340,18 @@ This ensures efficient workflow and prevents unnecessary wait times.`,
|
|
|
431304
431340
|
type: "object",
|
|
431305
431341
|
properties: {
|
|
431306
431342
|
todoId: {
|
|
431307
|
-
|
|
431308
|
-
|
|
431343
|
+
oneOf: [
|
|
431344
|
+
{
|
|
431345
|
+
type: "string",
|
|
431346
|
+
description: "Single TODO item ID to update"
|
|
431347
|
+
},
|
|
431348
|
+
{
|
|
431349
|
+
type: "array",
|
|
431350
|
+
items: { type: "string" },
|
|
431351
|
+
description: "Multiple TODO item IDs to update with the same status/content"
|
|
431352
|
+
}
|
|
431353
|
+
],
|
|
431354
|
+
description: "TODO item ID(s) to update (get exact ID from todo-get)"
|
|
431309
431355
|
},
|
|
431310
431356
|
status: {
|
|
431311
431357
|
type: "string",
|
|
@@ -431367,6 +431413,10 @@ SUPPORTS BATCH ADDING:
|
|
|
431367
431413
|
PARALLEL CALLS ONLY: MUST pair with other tools (todo-delete + filesystem-edit/todo-get/etc).
|
|
431368
431414
|
NEVER call todo-delete alone - always combine with an action tool.
|
|
431369
431415
|
|
|
431416
|
+
SUPPORTS BATCH DELETION:
|
|
431417
|
+
- Single: todoId="task-id"
|
|
431418
|
+
- Multiple: todoId=["id1", "id2", "id3"]
|
|
431419
|
+
|
|
431370
431420
|
CASCADE DELETE: Deleting a parent task automatically deletes all its children.
|
|
431371
431421
|
|
|
431372
431422
|
BEST PRACTICE - KEEP TODO CLEAN:
|
|
@@ -431375,8 +431425,18 @@ Proactively delete obsolete, redundant, or overly detailed completed subtasks to
|
|
|
431375
431425
|
type: "object",
|
|
431376
431426
|
properties: {
|
|
431377
431427
|
todoId: {
|
|
431378
|
-
|
|
431379
|
-
|
|
431428
|
+
oneOf: [
|
|
431429
|
+
{
|
|
431430
|
+
type: "string",
|
|
431431
|
+
description: "Single TODO item ID to delete"
|
|
431432
|
+
},
|
|
431433
|
+
{
|
|
431434
|
+
type: "array",
|
|
431435
|
+
items: { type: "string" },
|
|
431436
|
+
description: "Multiple TODO item IDs for batch deletion"
|
|
431437
|
+
}
|
|
431438
|
+
],
|
|
431439
|
+
description: "TODO item ID(s) to delete. Deleting a parent will cascade delete all its children. Get exact ID from todo-get."
|
|
431380
431440
|
}
|
|
431381
431441
|
},
|
|
431382
431442
|
required: ["todoId"]
|
|
@@ -431426,7 +431486,8 @@ Proactively delete obsolete, redundant, or overly detailed completed subtasks to
|
|
|
431426
431486
|
updates.status = status;
|
|
431427
431487
|
if (content)
|
|
431428
431488
|
updates.content = content;
|
|
431429
|
-
const
|
|
431489
|
+
const ids = Array.isArray(todoId) ? todoId : [todoId];
|
|
431490
|
+
const result2 = await this.updateTodoItems(sessionId, ids, updates);
|
|
431430
431491
|
return {
|
|
431431
431492
|
content: [
|
|
431432
431493
|
{
|
|
@@ -431475,7 +431536,8 @@ Proactively delete obsolete, redundant, or overly detailed completed subtasks to
|
|
|
431475
431536
|
}
|
|
431476
431537
|
case "delete": {
|
|
431477
431538
|
const { todoId } = args2;
|
|
431478
|
-
const
|
|
431539
|
+
const ids = Array.isArray(todoId) ? todoId : [todoId];
|
|
431540
|
+
const result2 = await this.deleteTodoItems(sessionId, ids);
|
|
431479
431541
|
return {
|
|
431480
431542
|
content: [
|
|
431481
431543
|
{
|
|
@@ -449061,12 +449123,12 @@ __export(tokenLimiter_exports, {
|
|
|
449061
449123
|
function getToolResultTokenLimit() {
|
|
449062
449124
|
try {
|
|
449063
449125
|
const config3 = getOpenAiConfig();
|
|
449064
|
-
const maxContextTokens = config3.maxContextTokens ||
|
|
449126
|
+
const maxContextTokens = config3.maxContextTokens || 2e5;
|
|
449065
449127
|
let percentage = config3.toolResultTokenLimit ?? DEFAULT_TOOL_RESULT_TOKEN_LIMIT;
|
|
449066
449128
|
percentage = Math.max(MIN_TOOL_RESULT_TOKEN_LIMIT_PERCENT, Math.min(MAX_TOOL_RESULT_TOKEN_LIMIT_PERCENT, percentage));
|
|
449067
449129
|
return Math.floor(maxContextTokens * percentage / 100);
|
|
449068
449130
|
} catch {
|
|
449069
|
-
return Math.floor(
|
|
449131
|
+
return Math.floor(2e5 * DEFAULT_TOOL_RESULT_TOKEN_LIMIT / 100);
|
|
449070
449132
|
}
|
|
449071
449133
|
}
|
|
449072
449134
|
function removeBase64Images(obj2) {
|
|
@@ -451062,6 +451124,19 @@ var init_sessionManager = __esm({
|
|
|
451062
451124
|
logger.error("Summary agent: Failed to generate summary", error40);
|
|
451063
451125
|
}
|
|
451064
451126
|
}
|
|
451127
|
+
/**
|
|
451128
|
+
* 更新当前会话的上下文 token 使用信息(仅更新内存,下次 saveSession 时一并持久化)
|
|
451129
|
+
*/
|
|
451130
|
+
updateContextUsage(usage) {
|
|
451131
|
+
if (!this.currentSession) {
|
|
451132
|
+
return;
|
|
451133
|
+
}
|
|
451134
|
+
if (usage) {
|
|
451135
|
+
this.currentSession.contextUsage = usage;
|
|
451136
|
+
} else {
|
|
451137
|
+
delete this.currentSession.contextUsage;
|
|
451138
|
+
}
|
|
451139
|
+
}
|
|
451065
451140
|
getCurrentSession() {
|
|
451066
451141
|
return this.currentSession;
|
|
451067
451142
|
}
|
|
@@ -452692,6 +452767,8 @@ var init_en2 = __esm({
|
|
|
452692
452767
|
enablePromptOptimization: "Enable Prompt Optimization:",
|
|
452693
452768
|
enableAutoCompress: "Enable Auto Compression:",
|
|
452694
452769
|
autoCompressThreshold: "Auto Compress Threshold (%):",
|
|
452770
|
+
autoCompressThresholdHint: "Algorithm: maxContextTokens \xD7 {percentage}% = {actualThreshold} tokens",
|
|
452771
|
+
autoCompressThresholdDesc: "Triggers compression when context exceeds this threshold (recommended 60-80%, too low impacts performance, too high defeats purpose)",
|
|
452695
452772
|
showThinking: "Show Thinking Process:",
|
|
452696
452773
|
streamingDisplay: "Streaming Line Display:",
|
|
452697
452774
|
thinkingEnabled: "Thinking Enabled:",
|
|
@@ -452701,7 +452778,7 @@ var init_en2 = __esm({
|
|
|
452701
452778
|
thinkingBudgetTokens: "Thinking Budget Tokens:",
|
|
452702
452779
|
thinkingEffort: "Thinking Effort:",
|
|
452703
452780
|
geminiThinkingEnabled: "Gemini Thinking Enabled:",
|
|
452704
|
-
|
|
452781
|
+
geminiThinkingLevel: "Gemini Thinking Level:",
|
|
452705
452782
|
responsesReasoningEnabled: "Responses Reasoning Enabled:",
|
|
452706
452783
|
responsesReasoningEffort: "Responses Reasoning Effort:",
|
|
452707
452784
|
responsesVerbosity: "Responses Verbosity:",
|
|
@@ -452714,7 +452791,6 @@ var init_en2 = __esm({
|
|
|
452714
452791
|
toolResultTokenLimit: "Tool Result Limit (%):",
|
|
452715
452792
|
toolResultTokenLimitHint: "Algorithm: maxContextTokens \xD7 {percentage}% = {actualLimit} tokens",
|
|
452716
452793
|
toolResultTokenLimitDesc: "Limits tool result as % of context window (recommended 20-40%, too low truncates, too high fills context)",
|
|
452717
|
-
editSimilarityThreshold: "Edit Similarity Threshold(0-1, change with caution):",
|
|
452718
452794
|
notSet: "Not set",
|
|
452719
452795
|
enabled: "[\u2713] Enabled",
|
|
452720
452796
|
disabled: "[ ] Disabled",
|
|
@@ -453526,7 +453602,7 @@ var init_en2 = __esm({
|
|
|
453526
453602
|
contentSearchHint: "Content search \u2022 Tab/Enter to select \u2022 ESC to cancel",
|
|
453527
453603
|
fileSearchHint: "Type to filter files \u2022 Tab/Enter to select \u2022 Ctrl+T to toggle view \u2022 ESC to cancel",
|
|
453528
453604
|
expandedViewHint: "Expanded view \u2022 Ctrl+T to toggle",
|
|
453529
|
-
yoloModeActive: "\
|
|
453605
|
+
yoloModeActive: "\u29F4 YOLO MODE ACTIVE - All tools will be auto-approved without confirmation",
|
|
453530
453606
|
planModeActive: "\u2690 Plan mode active - Specialized planning and coordination agent",
|
|
453531
453607
|
vulnerabilityHuntingModeActive: "\u2368 Vulnerability Hunting Mode Active - Focused on vulnerability discovery and security analysis",
|
|
453532
453608
|
toolSearchEnabled: "\u267E\uFE0E Tool Search ON - Tools loaded on demand",
|
|
@@ -453744,7 +453820,10 @@ var init_en2 = __esm({
|
|
|
453744
453820
|
enterResponse: "Enter your response:",
|
|
453745
453821
|
keyboardHints: "Tip: Press 'Enter' to select | Press 'e' to edit selected option",
|
|
453746
453822
|
multiSelectHint: "Multi-select mode",
|
|
453747
|
-
multiSelectKeyboardHints: "\u2191\u2193 Move | Space Toggle | 1-9 Quick toggle | Enter Confirm | e Edit"
|
|
453823
|
+
multiSelectKeyboardHints: "\u2191\u2193 Move | Tab Toggle (Custom/Cancel) | Space Toggle | 1-9 Quick toggle | Enter Confirm | e Edit",
|
|
453824
|
+
optionListScrollHint: "\u2191\u2193 to scroll",
|
|
453825
|
+
optionListMoreAbove: "{count} more above",
|
|
453826
|
+
optionListMoreBelow: "{count} more below"
|
|
453748
453827
|
},
|
|
453749
453828
|
toolConfirmation: {
|
|
453750
453829
|
header: "[Tool Confirmation]",
|
|
@@ -454216,6 +454295,8 @@ var init_zh = __esm({
|
|
|
454216
454295
|
enablePromptOptimization: "\u542F\u7528\u63D0\u793A\u8BCD\u4F18\u5316:",
|
|
454217
454296
|
enableAutoCompress: "\u542F\u7528\u81EA\u52A8\u538B\u7F29:",
|
|
454218
454297
|
autoCompressThreshold: "\u81EA\u52A8\u538B\u7F29\u9608\u503C (%):",
|
|
454298
|
+
autoCompressThresholdHint: "\u7B97\u6CD5: maxContextTokens \xD7 {percentage}% = {actualThreshold} tokens",
|
|
454299
|
+
autoCompressThresholdDesc: "\u5F53\u4E0A\u4E0B\u6587\u8D85\u8FC7\u6B64\u9608\u503C\u65F6\u81EA\u52A8\u89E6\u53D1\u538B\u7F29 (\u63A8\u8350 60-80%, \u8FC7\u4F4E\u9891\u7E41\u538B\u7F29\u5F71\u54CD\u6027\u80FD, \u8FC7\u9AD8\u5219\u5931\u53BB\u538B\u7F29\u610F\u4E49)",
|
|
454219
454300
|
showThinking: "\u663E\u793A\u601D\u8003\u8FC7\u7A0B:",
|
|
454220
454301
|
streamingDisplay: "\u6D41\u5F0F\u9010\u884C\u663E\u793A:",
|
|
454221
454302
|
thinkingEnabled: "\u542F\u7528\u601D\u8003\u6A21\u5F0F:",
|
|
@@ -454225,7 +454306,7 @@ var init_zh = __esm({
|
|
|
454225
454306
|
thinkingBudgetTokens: "\u601D\u8003\u9884\u7B97\u4EE4\u724C\u6570:",
|
|
454226
454307
|
thinkingEffort: "\u601D\u8003\u5F3A\u5EA6:",
|
|
454227
454308
|
geminiThinkingEnabled: "\u542F\u7528 Gemini \u601D\u8003:",
|
|
454228
|
-
|
|
454309
|
+
geminiThinkingLevel: "Gemini \u601D\u8003\u7EA7\u522B:",
|
|
454229
454310
|
responsesReasoningEnabled: "\u542F\u7528 Responses \u63A8\u7406:",
|
|
454230
454311
|
responsesReasoningEffort: "Responses \u63A8\u7406\u5F3A\u5EA6:",
|
|
454231
454312
|
responsesVerbosity: "Responses \u8F93\u51FA\u8BE6\u7EC6\u5EA6:",
|
|
@@ -454238,7 +454319,6 @@ var init_zh = __esm({
|
|
|
454238
454319
|
toolResultTokenLimit: "\u5DE5\u5177\u8FD4\u56DE\u7ED3\u679C\u9650\u5236(%):",
|
|
454239
454320
|
toolResultTokenLimitHint: "\u7B97\u6CD5: maxContextTokens \xD7 {percentage}% = {actualLimit} tokens",
|
|
454240
454321
|
toolResultTokenLimitDesc: "\u9650\u5236\u5355\u4E2A\u5DE5\u5177\u8FD4\u56DE\u7ED3\u679C\u5360\u4E0A\u4E0B\u6587\u7A97\u53E3\u7684\u6BD4\u4F8B (\u63A8\u8350 20-40%, \u8FC7\u4F4E\u4F1A\u622A\u65AD, \u8FC7\u9AD8\u4F1A\u5360\u6EE1\u4E0A\u4E0B\u6587)",
|
|
454241
|
-
editSimilarityThreshold: "\u6587\u4EF6\u7F16\u8F91\u76F8\u4F3C\u5EA6\u9608\u503C(0-1, \u975E\u5FC5\u8981\u4E0D\u6539):",
|
|
454242
454322
|
notSet: "\u672A\u8BBE\u7F6E",
|
|
454243
454323
|
enabled: "[\u2713] \u5DF2\u542F\u7528",
|
|
454244
454324
|
disabled: "[ ] \u5DF2\u7981\u7528",
|
|
@@ -455049,7 +455129,7 @@ var init_zh = __esm({
|
|
|
455049
455129
|
contentSearchHint: "\u5185\u5BB9\u641C\u7D22 \u2022 Tab/Enter \u9009\u62E9 \u2022 ESC \u53D6\u6D88",
|
|
455050
455130
|
fileSearchHint: "\u8F93\u5165\u4EE5\u8FC7\u6EE4\u6587\u4EF6 \u2022 Tab/Enter \u9009\u62E9 \u2022 Ctrl+T \u5207\u6362\u89C6\u56FE \u2022 ESC \u53D6\u6D88",
|
|
455051
455131
|
expandedViewHint: "\u5C55\u5F00\u89C6\u56FE \u2022 Ctrl+T \u5207\u6362",
|
|
455052
|
-
yoloModeActive: "\
|
|
455132
|
+
yoloModeActive: "\u29F4 YOLO \u6A21\u5F0F\u5DF2\u6FC0\u6D3B - \u6240\u6709\u5DE5\u5177\u5C06\u81EA\u52A8\u6279\u51C6\u65E0\u9700\u786E\u8BA4",
|
|
455053
455133
|
planModeActive: "\u2690 Plan \u6A21\u5F0F\u5DF2\u6FC0\u6D3B - \u4E13\u4E1A\u89C4\u5212\u4E0E\u534F\u8C03\u52A9\u624B",
|
|
455054
455134
|
vulnerabilityHuntingModeActive: "\u2368 Vulnerability Hunting \u6A21\u5F0F\u5DF2\u6FC0\u6D3B - \u4E13\u6CE8\u6F0F\u6D1E\u6316\u6398\u4E0E\u5B89\u5168\u5206\u6790",
|
|
455055
455135
|
toolSearchEnabled: "\u267E\uFE0E \u5DE5\u5177\u641C\u7D22\u5DF2\u5F00\u542F - \u6309\u9700\u641C\u7D22\u52A0\u8F7D\u5DE5\u5177",
|
|
@@ -455267,7 +455347,10 @@ var init_zh = __esm({
|
|
|
455267
455347
|
enterResponse: "\u8BF7\u8F93\u5165\u60A8\u7684\u56DE\u7B54:",
|
|
455268
455348
|
keyboardHints: "\u63D0\u793A: \u6309 'Enter' \u9009\u62E9 | \u6309 'e' \u7F16\u8F91\u5F53\u524D\u9009\u9879",
|
|
455269
455349
|
multiSelectHint: "\u591A\u9009\u6A21\u5F0F",
|
|
455270
|
-
multiSelectKeyboardHints: "\u2191\u2193 \u79FB\u52A8 | \u7A7A\u683C \u5207\u6362 | 1-9 \u5FEB\u901F\u5207\u6362 | \u56DE\u8F66 \u786E\u8BA4 | e \u7F16\u8F91"
|
|
455350
|
+
multiSelectKeyboardHints: "\u2191\u2193 \u79FB\u52A8 | Tab \u5207\u6362(\u81EA\u5B9A\u4E49/\u53D6\u6D88) | \u7A7A\u683C \u5207\u6362 | 1-9 \u5FEB\u901F\u5207\u6362 | \u56DE\u8F66 \u786E\u8BA4 | e \u7F16\u8F91",
|
|
455351
|
+
optionListScrollHint: "\u2191\u2193 \u6EDA\u52A8",
|
|
455352
|
+
optionListMoreAbove: "\u4E0A\u65B9\u8FD8\u6709 {count} \u9879",
|
|
455353
|
+
optionListMoreBelow: "\u4E0B\u65B9\u8FD8\u6709 {count} \u9879"
|
|
455271
455354
|
},
|
|
455272
455355
|
toolConfirmation: {
|
|
455273
455356
|
header: "[\u5DE5\u5177\u786E\u8BA4]",
|
|
@@ -455739,6 +455822,8 @@ var init_zh_TW = __esm({
|
|
|
455739
455822
|
enablePromptOptimization: "\u555F\u7528\u63D0\u793A\u8A5E\u512A\u5316:",
|
|
455740
455823
|
enableAutoCompress: "\u555F\u7528\u81EA\u52D5\u58D3\u7E2E:",
|
|
455741
455824
|
autoCompressThreshold: "\u81EA\u52D5\u58D3\u7E2E\u95BE\u503C (%):",
|
|
455825
|
+
autoCompressThresholdHint: "\u7B97\u6CD5: maxContextTokens \xD7 {percentage}% = {actualThreshold} tokens",
|
|
455826
|
+
autoCompressThresholdDesc: "\u7576\u4E0A\u4E0B\u6587\u8D85\u904E\u6B64\u95BE\u503C\u6642\u81EA\u52D5\u89F8\u767C\u58D3\u7E2E (\u63A8\u85A6 60-80%, \u904E\u4F4E\u983B\u7E41\u58D3\u7E2E\u5F71\u97FF\u6027\u80FD, \u904E\u9AD8\u5247\u5931\u53BB\u58D3\u7E2E\u610F\u7FA9)",
|
|
455742
455827
|
showThinking: "\u986F\u793A\u601D\u8003\u904E\u7A0B:",
|
|
455743
455828
|
streamingDisplay: "\u6D41\u5F0F\u9010\u884C\u986F\u793A:",
|
|
455744
455829
|
thinkingEnabled: "\u555F\u7528\u601D\u8003\u6A21\u5F0F:",
|
|
@@ -455748,7 +455833,7 @@ var init_zh_TW = __esm({
|
|
|
455748
455833
|
thinkingBudgetTokens: "\u601D\u8003\u9810\u7B97\u4EE4\u724C\u6578:",
|
|
455749
455834
|
thinkingEffort: "\u601D\u8003\u5F37\u5EA6:",
|
|
455750
455835
|
geminiThinkingEnabled: "\u555F\u7528 Gemini \u601D\u8003:",
|
|
455751
|
-
|
|
455836
|
+
geminiThinkingLevel: "Gemini \u601D\u8003\u7D1A\u5225:",
|
|
455752
455837
|
responsesReasoningEnabled: "\u555F\u7528 Responses \u63A8\u7406:",
|
|
455753
455838
|
responsesReasoningEffort: "Responses \u63A8\u7406\u5F37\u5EA6:",
|
|
455754
455839
|
responsesVerbosity: "Responses \u8F38\u51FA\u8A73\u7D30\u5EA6:",
|
|
@@ -455761,7 +455846,6 @@ var init_zh_TW = __esm({
|
|
|
455761
455846
|
toolResultTokenLimit: "\u5DE5\u5177\u8FD4\u56DE\u7D50\u679C\u9650\u5236(%):",
|
|
455762
455847
|
toolResultTokenLimitHint: "\u7B97\u6CD5: maxContextTokens \xD7 {percentage}% = {actualLimit} tokens",
|
|
455763
455848
|
toolResultTokenLimitDesc: "\u9650\u5236\u55AE\u500B\u5DE5\u5177\u8FD4\u56DE\u7D50\u679C\u4F54\u4E0A\u4E0B\u6587\u7A97\u53E3\u7684\u6BD4\u4F8B (\u63A8\u85A6 20-40%, \u904E\u4F4E\u6703\u622A\u65B7, \u904E\u9AD8\u6703\u4F54\u6EFF\u4E0A\u4E0B\u6587)",
|
|
455764
|
-
editSimilarityThreshold: "\u6A94\u6848\u7DE8\u8F2F\u76F8\u4F3C\u5EA6\u95BE\u503C(0-1, \u975E\u5FC5\u8981\u4E0D\u6539):",
|
|
455765
455849
|
notSet: "\u672A\u8A2D\u5B9A",
|
|
455766
455850
|
enabled: "[\u2713] \u5DF2\u555F\u7528",
|
|
455767
455851
|
disabled: "[ ] \u5DF2\u505C\u7528",
|
|
@@ -456572,7 +456656,7 @@ var init_zh_TW = __esm({
|
|
|
456572
456656
|
contentSearchHint: "\u5167\u5BB9\u641C\u5C0B \u2022 Tab/Enter \u9078\u64C7 \u2022 ESC \u53D6\u6D88",
|
|
456573
456657
|
fileSearchHint: "\u8F38\u5165\u4EE5\u904E\u6FFE\u6A94\u6848 \u2022 Tab/Enter \u9078\u64C7 \u2022 Ctrl+T \u5207\u63DB\u6AA2\u8996 \u2022 ESC \u53D6\u6D88",
|
|
456574
456658
|
expandedViewHint: "\u5C55\u958B\u6AA2\u8996 \u2022 Ctrl+T \u5207\u63DB",
|
|
456575
|
-
yoloModeActive: "\
|
|
456659
|
+
yoloModeActive: "\u29F4 YOLO \u6A21\u5F0F\u5DF2\u555F\u7528 - \u6240\u6709\u5DE5\u5177\u5C07\u81EA\u52D5\u6279\u51C6\u7121\u9700\u78BA\u8A8D",
|
|
456576
456660
|
planModeActive: "\u2690 Plan \u6A21\u5F0F\u5DF2\u555F\u7528 - \u5C08\u696D\u898F\u5283\u8207\u5354\u8ABF\u52A9\u624B",
|
|
456577
456661
|
vulnerabilityHuntingModeActive: "\u2368 Vulnerability Hunting \u6A21\u5F0F\u5DF2\u555F\u7528 - \u5C08\u6CE8\u6F0F\u6D1E\u6316\u6398\u8207\u5B89\u5168\u5206\u6790",
|
|
456578
456662
|
toolSearchEnabled: "\u267E\uFE0E \u5DE5\u5177\u641C\u5C0B\u5DF2\u958B\u555F - \u6309\u9700\u641C\u5C0B\u8F09\u5165\u5DE5\u5177",
|
|
@@ -456789,7 +456873,10 @@ var init_zh_TW = __esm({
|
|
|
456789
456873
|
enterResponse: "\u8ACB\u8F38\u5165\u60A8\u7684\u56DE\u7B54:",
|
|
456790
456874
|
keyboardHints: "\u63D0\u793A: \u6309 'Enter' \u9078\u64C7 | \u6309 'e' \u7DE8\u8F2F\u7576\u524D\u9078\u9805",
|
|
456791
456875
|
multiSelectHint: "\u591A\u9078\u6A21\u5F0F",
|
|
456792
|
-
multiSelectKeyboardHints: "\u2191\u2193 \u79FB\u52D5 | \u7A7A\u683C \u5207\u63DB | 1-9 \u5FEB\u901F\u5207\u63DB | \u56DE\u8ECA \u78BA\u8A8D | e \u7DE8\u8F2F"
|
|
456876
|
+
multiSelectKeyboardHints: "\u2191\u2193 \u79FB\u52D5 | Tab \u5207\u63DB(\u81EA\u8A02/\u53D6\u6D88) | \u7A7A\u683C \u5207\u63DB | 1-9 \u5FEB\u901F\u5207\u63DB | \u56DE\u8ECA \u78BA\u8A8D | e \u7DE8\u8F2F",
|
|
456877
|
+
optionListScrollHint: "\u2191\u2193 \u6372\u52D5",
|
|
456878
|
+
optionListMoreAbove: "\u4E0A\u65B9\u9084\u6709 {count} \u9805",
|
|
456879
|
+
optionListMoreBelow: "\u4E0B\u65B9\u9084\u6709 {count} \u9805"
|
|
456793
456880
|
},
|
|
456794
456881
|
toolConfirmation: {
|
|
456795
456882
|
header: "[\u5DE5\u5177\u78BA\u8A8D]",
|
|
@@ -472500,6 +472587,7 @@ var init_types5 = __esm({
|
|
|
472500
472587
|
"basicModel",
|
|
472501
472588
|
"thinkingMode",
|
|
472502
472589
|
"thinkingEffort",
|
|
472590
|
+
"geminiThinkingLevel",
|
|
472503
472591
|
"responsesReasoningEffort",
|
|
472504
472592
|
"responsesVerbosity",
|
|
472505
472593
|
"anthropicSpeed"
|
|
@@ -472594,19 +472682,26 @@ async function fetchAvailableModels() {
|
|
|
472594
472682
|
const customHeaders = getCustomHeaders();
|
|
472595
472683
|
try {
|
|
472596
472684
|
let models;
|
|
472685
|
+
const defaultOpenAiBaseUrl = "https://api.openai.com/v1";
|
|
472686
|
+
const trimmedBaseUrl = config3.baseUrl.replace(/\/$/, "");
|
|
472687
|
+
const isDefaultBaseUrl = !trimmedBaseUrl || trimmedBaseUrl === defaultOpenAiBaseUrl;
|
|
472597
472688
|
switch (config3.requestMethod) {
|
|
472598
|
-
case "gemini":
|
|
472689
|
+
case "gemini": {
|
|
472599
472690
|
if (!config3.apiKey) {
|
|
472600
472691
|
throw new Error("API key is required for Gemini API");
|
|
472601
472692
|
}
|
|
472602
|
-
|
|
472693
|
+
const geminiBaseUrl = isDefaultBaseUrl ? "https://generativelanguage.googleapis.com/v1beta" : trimmedBaseUrl;
|
|
472694
|
+
models = await fetchGeminiModels(geminiBaseUrl, config3.apiKey);
|
|
472603
472695
|
break;
|
|
472604
|
-
|
|
472696
|
+
}
|
|
472697
|
+
case "anthropic": {
|
|
472605
472698
|
if (!config3.apiKey) {
|
|
472606
472699
|
throw new Error("API key is required for Anthropic API");
|
|
472607
472700
|
}
|
|
472608
|
-
|
|
472701
|
+
const anthropicBaseUrl = isDefaultBaseUrl ? "https://api.anthropic.com/v1" : trimmedBaseUrl;
|
|
472702
|
+
models = await fetchAnthropicModels(anthropicBaseUrl, config3.apiKey, customHeaders);
|
|
472609
472703
|
break;
|
|
472704
|
+
}
|
|
472610
472705
|
case "chat":
|
|
472611
472706
|
case "responses":
|
|
472612
472707
|
default:
|
|
@@ -472667,7 +472762,7 @@ function useConfigState() {
|
|
|
472667
472762
|
const [thinkingBudgetTokens, setThinkingBudgetTokens] = (0, import_react66.useState)(1e4);
|
|
472668
472763
|
const [thinkingEffort, setThinkingEffort] = (0, import_react66.useState)("high");
|
|
472669
472764
|
const [geminiThinkingEnabled, setGeminiThinkingEnabled] = (0, import_react66.useState)(false);
|
|
472670
|
-
const [
|
|
472765
|
+
const [geminiThinkingLevel, setGeminiThinkingLevel] = (0, import_react66.useState)("high");
|
|
472671
472766
|
const [responsesReasoningEnabled, setResponsesReasoningEnabled] = (0, import_react66.useState)(false);
|
|
472672
472767
|
const [responsesReasoningEffort, setResponsesReasoningEffort] = (0, import_react66.useState)("high");
|
|
472673
472768
|
const [responsesVerbosity, setResponsesVerbosity] = (0, import_react66.useState)("medium");
|
|
@@ -472679,7 +472774,6 @@ function useConfigState() {
|
|
|
472679
472774
|
const [maxTokens, setMaxTokens] = (0, import_react66.useState)(4096);
|
|
472680
472775
|
const [toolResultTokenLimit, setToolResultTokenLimit] = (0, import_react66.useState)(30);
|
|
472681
472776
|
const [streamIdleTimeoutSec, setStreamIdleTimeoutSec] = (0, import_react66.useState)(180);
|
|
472682
|
-
const [editSimilarityThreshold, setEditSimilarityThreshold] = (0, import_react66.useState)(0.75);
|
|
472683
472777
|
const [currentField, setCurrentField] = (0, import_react66.useState)("profile");
|
|
472684
472778
|
const [errors, setErrors] = (0, import_react66.useState)([]);
|
|
472685
472779
|
const [isEditing, setIsEditing] = (0, import_react66.useState)(false);
|
|
@@ -472689,7 +472783,6 @@ function useConfigState() {
|
|
|
472689
472783
|
const [searchTerm, setSearchTerm] = (0, import_react66.useState)("");
|
|
472690
472784
|
const [manualInputMode, setManualInputMode] = (0, import_react66.useState)(false);
|
|
472691
472785
|
const [manualInputValue, setManualInputValue] = (0, import_react66.useState)("");
|
|
472692
|
-
const [editingThresholdValue, setEditingThresholdValue] = (0, import_react66.useState)("");
|
|
472693
472786
|
const [, forceUpdate] = (0, import_react66.useState)(0);
|
|
472694
472787
|
const supportsXHigh = requestMethod === "responses";
|
|
472695
472788
|
const requestMethodOptions = [
|
|
@@ -472732,7 +472825,7 @@ function useConfigState() {
|
|
|
472732
472825
|
...thinkingEnabled && thinkingMode === "adaptive" ? ["thinkingEffort"] : []
|
|
472733
472826
|
] : requestMethod === "gemini" ? [
|
|
472734
472827
|
"geminiThinkingEnabled",
|
|
472735
|
-
"
|
|
472828
|
+
"geminiThinkingLevel"
|
|
472736
472829
|
] : requestMethod === "responses" ? [
|
|
472737
472830
|
"responsesReasoningEnabled",
|
|
472738
472831
|
"responsesReasoningEffort",
|
|
@@ -472744,8 +472837,7 @@ function useConfigState() {
|
|
|
472744
472837
|
"maxContextTokens",
|
|
472745
472838
|
"maxTokens",
|
|
472746
472839
|
"streamIdleTimeoutSec",
|
|
472747
|
-
"toolResultTokenLimit"
|
|
472748
|
-
"editSimilarityThreshold"
|
|
472840
|
+
"toolResultTokenLimit"
|
|
472749
472841
|
];
|
|
472750
472842
|
};
|
|
472751
472843
|
const allFields = getAllFields();
|
|
@@ -472780,7 +472872,7 @@ function useConfigState() {
|
|
|
472780
472872
|
if (requestMethod !== "anthropic" && (currentField === "anthropicBeta" || currentField === "anthropicCacheTTL" || currentField === "anthropicSpeed" || currentField === "thinkingEnabled" || currentField === "thinkingBudgetTokens")) {
|
|
472781
472873
|
setCurrentField("advancedModel");
|
|
472782
472874
|
}
|
|
472783
|
-
if (requestMethod !== "gemini" && (currentField === "geminiThinkingEnabled" || currentField === "
|
|
472875
|
+
if (requestMethod !== "gemini" && (currentField === "geminiThinkingEnabled" || currentField === "geminiThinkingLevel")) {
|
|
472784
472876
|
setCurrentField("advancedModel");
|
|
472785
472877
|
}
|
|
472786
472878
|
if (requestMethod !== "responses" && (currentField === "responsesReasoningEnabled" || currentField === "responsesReasoningEffort" || currentField === "responsesVerbosity" || currentField === "responsesFastMode")) {
|
|
@@ -472824,7 +472916,7 @@ function useConfigState() {
|
|
|
472824
472916
|
setThinkingBudgetTokens(((_d4 = config3.thinking) == null ? void 0 : _d4.budget_tokens) || 1e4);
|
|
472825
472917
|
setThinkingEffort(((_e2 = config3.thinking) == null ? void 0 : _e2.effort) || "high");
|
|
472826
472918
|
setGeminiThinkingEnabled(((_f = config3.geminiThinking) == null ? void 0 : _f.enabled) || false);
|
|
472827
|
-
|
|
472919
|
+
setGeminiThinkingLevel(((_g = config3.geminiThinking) == null ? void 0 : _g.thinkingLevel) || "high");
|
|
472828
472920
|
setResponsesReasoningEnabled(((_h = config3.responsesReasoning) == null ? void 0 : _h.enabled) || false);
|
|
472829
472921
|
setResponsesReasoningEffort(((_i = config3.responsesReasoning) == null ? void 0 : _i.effort) || "high");
|
|
472830
472922
|
setResponsesVerbosity(config3.responsesVerbosity || "medium");
|
|
@@ -472836,7 +472928,6 @@ function useConfigState() {
|
|
|
472836
472928
|
setMaxTokens(config3.maxTokens || 4096);
|
|
472837
472929
|
setToolResultTokenLimit(config3.toolResultTokenLimit ?? 30);
|
|
472838
472930
|
setStreamIdleTimeoutSec(config3.streamIdleTimeoutSec || 180);
|
|
472839
|
-
setEditSimilarityThreshold(config3.editSimilarityThreshold ?? 0.75);
|
|
472840
472931
|
const systemPromptConfig = getSystemPromptConfig();
|
|
472841
472932
|
setSystemPrompts(((systemPromptConfig == null ? void 0 : systemPromptConfig.prompts) || []).map((p) => ({ id: p.id, name: p.name })));
|
|
472842
472933
|
setActiveSystemPromptIds((systemPromptConfig == null ? void 0 : systemPromptConfig.active) || []);
|
|
@@ -472895,16 +472986,14 @@ function useConfigState() {
|
|
|
472895
472986
|
return streamIdleTimeoutSec.toString();
|
|
472896
472987
|
if (currentField === "toolResultTokenLimit")
|
|
472897
472988
|
return toolResultTokenLimit.toString();
|
|
472898
|
-
if (currentField === "editSimilarityThreshold")
|
|
472899
|
-
return editSimilarityThreshold.toString();
|
|
472900
472989
|
if (currentField === "thinkingBudgetTokens")
|
|
472901
472990
|
return thinkingBudgetTokens.toString();
|
|
472902
472991
|
if (currentField === "thinkingMode")
|
|
472903
472992
|
return thinkingMode;
|
|
472904
472993
|
if (currentField === "thinkingEffort")
|
|
472905
472994
|
return thinkingEffort;
|
|
472906
|
-
if (currentField === "
|
|
472907
|
-
return
|
|
472995
|
+
if (currentField === "geminiThinkingLevel")
|
|
472996
|
+
return geminiThinkingLevel;
|
|
472908
472997
|
if (currentField === "responsesReasoningEffort")
|
|
472909
472998
|
return responsesReasoningEffort;
|
|
472910
472999
|
if (currentField === "anthropicSpeed")
|
|
@@ -473150,8 +473239,7 @@ function useConfigState() {
|
|
|
473150
473239
|
maxContextTokens,
|
|
473151
473240
|
maxTokens,
|
|
473152
473241
|
streamIdleTimeoutSec,
|
|
473153
|
-
toolResultTokenLimit
|
|
473154
|
-
editSimilarityThreshold
|
|
473242
|
+
toolResultTokenLimit
|
|
473155
473243
|
};
|
|
473156
473244
|
if (thinkingEnabled) {
|
|
473157
473245
|
config3.thinking = thinkingMode === "adaptive" ? {
|
|
@@ -473167,7 +473255,7 @@ function useConfigState() {
|
|
|
473167
473255
|
if (geminiThinkingEnabled) {
|
|
473168
473256
|
config3.geminiThinking = {
|
|
473169
473257
|
enabled: true,
|
|
473170
|
-
|
|
473258
|
+
thinkingLevel: geminiThinkingLevel
|
|
473171
473259
|
};
|
|
473172
473260
|
} else {
|
|
473173
473261
|
config3.geminiThinking = void 0;
|
|
@@ -473198,7 +473286,7 @@ function useConfigState() {
|
|
|
473198
473286
|
type: "enabled",
|
|
473199
473287
|
budget_tokens: thinkingBudgetTokens
|
|
473200
473288
|
} : void 0,
|
|
473201
|
-
geminiThinking: geminiThinkingEnabled ? { enabled: true,
|
|
473289
|
+
geminiThinking: geminiThinkingEnabled ? { enabled: true, thinkingLevel: geminiThinkingLevel } : void 0,
|
|
473202
473290
|
responsesReasoning: {
|
|
473203
473291
|
enabled: responsesReasoningEnabled,
|
|
473204
473292
|
effort: responsesReasoningEffort
|
|
@@ -473211,8 +473299,7 @@ function useConfigState() {
|
|
|
473211
473299
|
maxContextTokens,
|
|
473212
473300
|
maxTokens,
|
|
473213
473301
|
streamIdleTimeoutSec,
|
|
473214
|
-
toolResultTokenLimit
|
|
473215
|
-
editSimilarityThreshold
|
|
473302
|
+
toolResultTokenLimit
|
|
473216
473303
|
}
|
|
473217
473304
|
};
|
|
473218
473305
|
saveProfile(activeProfile, fullConfig);
|
|
@@ -473280,8 +473367,8 @@ function useConfigState() {
|
|
|
473280
473367
|
setThinkingEffort,
|
|
473281
473368
|
geminiThinkingEnabled,
|
|
473282
473369
|
setGeminiThinkingEnabled,
|
|
473283
|
-
|
|
473284
|
-
|
|
473370
|
+
geminiThinkingLevel,
|
|
473371
|
+
setGeminiThinkingLevel,
|
|
473285
473372
|
responsesReasoningEnabled,
|
|
473286
473373
|
setResponsesReasoningEnabled,
|
|
473287
473374
|
responsesReasoningEffort,
|
|
@@ -473305,8 +473392,6 @@ function useConfigState() {
|
|
|
473305
473392
|
setStreamIdleTimeoutSec,
|
|
473306
473393
|
toolResultTokenLimit,
|
|
473307
473394
|
setToolResultTokenLimit,
|
|
473308
|
-
editSimilarityThreshold,
|
|
473309
|
-
setEditSimilarityThreshold,
|
|
473310
473395
|
// UI state
|
|
473311
473396
|
currentField,
|
|
473312
473397
|
setCurrentField,
|
|
@@ -473324,8 +473409,6 @@ function useConfigState() {
|
|
|
473324
473409
|
setManualInputMode,
|
|
473325
473410
|
manualInputValue,
|
|
473326
473411
|
setManualInputValue,
|
|
473327
|
-
editingThresholdValue,
|
|
473328
|
-
setEditingThresholdValue,
|
|
473329
473412
|
// Derived
|
|
473330
473413
|
supportsXHigh,
|
|
473331
473414
|
requestMethodOptions,
|
|
@@ -473375,7 +473458,7 @@ var init_useConfigState = __esm({
|
|
|
473375
473458
|
// dist/ui/pages/configScreen/useConfigInput.js
|
|
473376
473459
|
function useConfigInput(state, callbacks) {
|
|
473377
473460
|
const { onBack, onSave } = callbacks;
|
|
473378
|
-
const { t, profileMode, setProfileMode, setNewProfileName, setRenameProfileName, markedProfiles, activeProfile, setErrors, handleCreateProfile, handleBatchDeleteProfiles, handleRenameProfile, loading, setLoading, manualInputMode, setManualInputMode, manualInputValue, setManualInputValue, isEditing, setIsEditing, currentField, setCurrentField, setSearchTerm, setPendingPromptIds, triggerForceUpdate, saveConfiguration, loadModels, getCurrentValue, getAllFields, anthropicBeta, setAnthropicBeta, enableAutoCompress, setEnableAutoCompress, showThinking, setShowThinking, streamingDisplay, setStreamingDisplay, thinkingEnabled, setThinkingEnabled, geminiThinkingEnabled, setGeminiThinkingEnabled, responsesReasoningEnabled, setResponsesReasoningEnabled, responsesFastMode, setResponsesFastMode, maxContextTokens, setMaxContextTokens, maxTokens, setMaxTokens, streamIdleTimeoutSec, setStreamIdleTimeoutSec, toolResultTokenLimit, setToolResultTokenLimit, thinkingBudgetTokens, setThinkingBudgetTokens, autoCompressThreshold, setAutoCompressThreshold,
|
|
473461
|
+
const { t, profileMode, setProfileMode, setNewProfileName, setRenameProfileName, markedProfiles, activeProfile, setErrors, handleCreateProfile, handleBatchDeleteProfiles, handleRenameProfile, loading, setLoading, manualInputMode, setManualInputMode, manualInputValue, setManualInputValue, isEditing, setIsEditing, currentField, setCurrentField, setSearchTerm, setPendingPromptIds, triggerForceUpdate, saveConfiguration, loadModels, getCurrentValue, getAllFields, anthropicBeta, setAnthropicBeta, enableAutoCompress, setEnableAutoCompress, showThinking, setShowThinking, streamingDisplay, setStreamingDisplay, thinkingEnabled, setThinkingEnabled, geminiThinkingEnabled, setGeminiThinkingEnabled, responsesReasoningEnabled, setResponsesReasoningEnabled, responsesFastMode, setResponsesFastMode, maxContextTokens, setMaxContextTokens, maxTokens, setMaxTokens, streamIdleTimeoutSec, setStreamIdleTimeoutSec, toolResultTokenLimit, setToolResultTokenLimit, thinkingBudgetTokens, setThinkingBudgetTokens, autoCompressThreshold, setAutoCompressThreshold, setAdvancedModel, setBasicModel, systemPromptId } = state;
|
|
473379
473462
|
use_input_default((rawInput, key) => {
|
|
473380
473463
|
const input2 = stripFocusArtifacts(rawInput);
|
|
473381
473464
|
if (!input2 && isFocusEventInput(rawInput)) {
|
|
@@ -473492,11 +473575,7 @@ function useConfigInput(state, callbacks) {
|
|
|
473492
473575
|
}
|
|
473493
473576
|
return;
|
|
473494
473577
|
}
|
|
473495
|
-
if (currentField === "maxContextTokens" || currentField === "maxTokens" || currentField === "streamIdleTimeoutSec" || currentField === "toolResultTokenLimit" || currentField === "thinkingBudgetTokens" || currentField === "
|
|
473496
|
-
if (currentField === "editSimilarityThreshold") {
|
|
473497
|
-
handleThresholdInput(input2, key);
|
|
473498
|
-
return;
|
|
473499
|
-
}
|
|
473578
|
+
if (currentField === "maxContextTokens" || currentField === "maxTokens" || currentField === "streamIdleTimeoutSec" || currentField === "toolResultTokenLimit" || currentField === "thinkingBudgetTokens" || currentField === "autoCompressThreshold") {
|
|
473500
473579
|
handleNumericInput(input2, key);
|
|
473501
473580
|
return;
|
|
473502
473581
|
}
|
|
@@ -473534,32 +473613,6 @@ function useConfigInput(state, callbacks) {
|
|
|
473534
473613
|
setCurrentField(fields[nextIndex]);
|
|
473535
473614
|
}
|
|
473536
473615
|
});
|
|
473537
|
-
function handleThresholdInput(input2, key) {
|
|
473538
|
-
if (input2 && input2.match(/[0-9.]/)) {
|
|
473539
|
-
const currentStr = editingThresholdValue || editSimilarityThreshold.toString();
|
|
473540
|
-
if (input2 === "." && currentStr.includes(".")) {
|
|
473541
|
-
return;
|
|
473542
|
-
}
|
|
473543
|
-
const newStr = currentStr + input2;
|
|
473544
|
-
if (newStr === "." || newStr === "0." || /^[0-9]*\.?[0-9]*$/.test(newStr)) {
|
|
473545
|
-
setEditingThresholdValue(newStr);
|
|
473546
|
-
}
|
|
473547
|
-
} else if (key.backspace || key.delete) {
|
|
473548
|
-
const currentStr = editingThresholdValue || editSimilarityThreshold.toString();
|
|
473549
|
-
const newStr = currentStr.slice(0, -1);
|
|
473550
|
-
setEditingThresholdValue(newStr);
|
|
473551
|
-
} else if (key.return) {
|
|
473552
|
-
const valueToSave = editingThresholdValue || editSimilarityThreshold.toString();
|
|
473553
|
-
const finalValue = parseFloat(valueToSave);
|
|
473554
|
-
if (!isNaN(finalValue) && finalValue >= 0.1 && finalValue <= 1) {
|
|
473555
|
-
setEditSimilarityThreshold(finalValue);
|
|
473556
|
-
} else if (finalValue < 0.1) {
|
|
473557
|
-
setEditSimilarityThreshold(0.1);
|
|
473558
|
-
}
|
|
473559
|
-
setEditingThresholdValue("");
|
|
473560
|
-
setIsEditing(false);
|
|
473561
|
-
}
|
|
473562
|
-
}
|
|
473563
473616
|
function handleNumericInput(input2, key) {
|
|
473564
473617
|
const fieldMap = {
|
|
473565
473618
|
maxContextTokens: {
|
|
@@ -473597,12 +473650,6 @@ function useConfigInput(state, callbacks) {
|
|
|
473597
473650
|
set: setAutoCompressThreshold,
|
|
473598
473651
|
min: 50,
|
|
473599
473652
|
max: 95
|
|
473600
|
-
},
|
|
473601
|
-
geminiThinkingBudget: {
|
|
473602
|
-
get: () => geminiThinkingBudget,
|
|
473603
|
-
set: setGeminiThinkingBudget,
|
|
473604
|
-
min: 1,
|
|
473605
|
-
max: Infinity
|
|
473606
473653
|
}
|
|
473607
473654
|
};
|
|
473608
473655
|
const config3 = fieldMap[currentField];
|
|
@@ -473638,19 +473685,25 @@ function useConfigInput(state, callbacks) {
|
|
|
473638
473685
|
} else if (currentField === "streamingDisplay") {
|
|
473639
473686
|
setStreamingDisplay(!streamingDisplay);
|
|
473640
473687
|
} else if (currentField === "thinkingEnabled") {
|
|
473641
|
-
|
|
473688
|
+
const next = !thinkingEnabled;
|
|
473689
|
+
setThinkingEnabled(next);
|
|
473690
|
+
if (!next)
|
|
473691
|
+
setShowThinking(false);
|
|
473642
473692
|
} else if (currentField === "geminiThinkingEnabled") {
|
|
473643
|
-
|
|
473693
|
+
const next = !geminiThinkingEnabled;
|
|
473694
|
+
setGeminiThinkingEnabled(next);
|
|
473695
|
+
if (!next)
|
|
473696
|
+
setShowThinking(false);
|
|
473644
473697
|
} else if (currentField === "responsesReasoningEnabled") {
|
|
473645
|
-
|
|
473698
|
+
const next = !responsesReasoningEnabled;
|
|
473699
|
+
setResponsesReasoningEnabled(next);
|
|
473700
|
+
if (!next)
|
|
473701
|
+
setShowThinking(false);
|
|
473646
473702
|
} else if (currentField === "responsesFastMode") {
|
|
473647
473703
|
setResponsesFastMode(!responsesFastMode);
|
|
473648
|
-
} else if (currentField === "anthropicCacheTTL" || currentField === "anthropicSpeed" || currentField === "thinkingMode" || currentField === "thinkingEffort" || currentField === "responsesReasoningEffort" || currentField === "responsesVerbosity") {
|
|
473649
|
-
setIsEditing(true);
|
|
473650
|
-
} else if (currentField === "maxContextTokens" || currentField === "maxTokens" || currentField === "streamIdleTimeoutSec" || currentField === "toolResultTokenLimit" || currentField === "thinkingBudgetTokens" || currentField === "geminiThinkingBudget" || currentField === "autoCompressThreshold") {
|
|
473704
|
+
} else if (currentField === "anthropicCacheTTL" || currentField === "anthropicSpeed" || currentField === "thinkingMode" || currentField === "thinkingEffort" || currentField === "geminiThinkingLevel" || currentField === "responsesReasoningEffort" || currentField === "responsesVerbosity") {
|
|
473651
473705
|
setIsEditing(true);
|
|
473652
|
-
} else if (currentField === "
|
|
473653
|
-
setEditingThresholdValue("");
|
|
473706
|
+
} else if (currentField === "maxContextTokens" || currentField === "maxTokens" || currentField === "streamIdleTimeoutSec" || currentField === "toolResultTokenLimit" || currentField === "thinkingBudgetTokens" || currentField === "autoCompressThreshold") {
|
|
473654
473707
|
setIsEditing(true);
|
|
473655
473708
|
} else if (currentField === "advancedModel" || currentField === "basicModel") {
|
|
473656
473709
|
loadModels().then(() => {
|
|
@@ -473974,7 +474027,7 @@ var init_ScrollableSelectInput = __esm({
|
|
|
473974
474027
|
|
|
473975
474028
|
// dist/ui/pages/configScreen/ConfigFieldRenderer.js
|
|
473976
474029
|
function ConfigFieldRenderer({ field, state }) {
|
|
473977
|
-
var _a20, _b14, _c6;
|
|
474030
|
+
var _a20, _b14, _c6, _d4;
|
|
473978
474031
|
const {
|
|
473979
474032
|
t,
|
|
473980
474033
|
theme: theme14,
|
|
@@ -474008,7 +474061,8 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474008
474061
|
thinkingBudgetTokens,
|
|
474009
474062
|
thinkingEffort,
|
|
474010
474063
|
geminiThinkingEnabled,
|
|
474011
|
-
|
|
474064
|
+
geminiThinkingLevel,
|
|
474065
|
+
setGeminiThinkingLevel,
|
|
474012
474066
|
responsesReasoningEnabled,
|
|
474013
474067
|
responsesReasoningEffort,
|
|
474014
474068
|
setResponsesReasoningEffort,
|
|
@@ -474023,8 +474077,6 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474023
474077
|
maxTokens,
|
|
474024
474078
|
streamIdleTimeoutSec,
|
|
474025
474079
|
toolResultTokenLimit,
|
|
474026
|
-
editSimilarityThreshold,
|
|
474027
|
-
editingThresholdValue,
|
|
474028
474080
|
// Helpers
|
|
474029
474081
|
getSystemPromptNameById,
|
|
474030
474082
|
getCustomHeadersSchemeNameById
|
|
@@ -474271,6 +474323,46 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474271
474323
|
)
|
|
474272
474324
|
);
|
|
474273
474325
|
case "autoCompressThreshold":
|
|
474326
|
+
{
|
|
474327
|
+
const actualThreshold = Math.floor(maxContextTokens * autoCompressThreshold / 100);
|
|
474328
|
+
return import_react69.default.createElement(
|
|
474329
|
+
Box_default,
|
|
474330
|
+
{ key: field, flexDirection: "column" },
|
|
474331
|
+
import_react69.default.createElement(
|
|
474332
|
+
Text,
|
|
474333
|
+
{ color: activeColor },
|
|
474334
|
+
activeIndicator,
|
|
474335
|
+
t.configScreen.autoCompressThreshold
|
|
474336
|
+
),
|
|
474337
|
+
isCurrentlyEditing && import_react69.default.createElement(
|
|
474338
|
+
Box_default,
|
|
474339
|
+
{ marginLeft: 3 },
|
|
474340
|
+
import_react69.default.createElement(
|
|
474341
|
+
Text,
|
|
474342
|
+
{ color: theme14.colors.menuInfo },
|
|
474343
|
+
t.configScreen.enterValue,
|
|
474344
|
+
" ",
|
|
474345
|
+
autoCompressThreshold,
|
|
474346
|
+
"%"
|
|
474347
|
+
),
|
|
474348
|
+
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (_c6 = t.configScreen.autoCompressThresholdHint) == null ? void 0 : _c6.replace("{percentage}", autoCompressThreshold.toString()).replace("{maxContext}", maxContextTokens.toString()).replace("{actualThreshold}", actualThreshold.toLocaleString()))
|
|
474349
|
+
),
|
|
474350
|
+
!isCurrentlyEditing && import_react69.default.createElement(
|
|
474351
|
+
Box_default,
|
|
474352
|
+
{ marginLeft: 3, flexDirection: "column" },
|
|
474353
|
+
import_react69.default.createElement(
|
|
474354
|
+
Text,
|
|
474355
|
+
{ color: theme14.colors.menuSecondary },
|
|
474356
|
+
autoCompressThreshold,
|
|
474357
|
+
"% \u2192 ",
|
|
474358
|
+
actualThreshold.toLocaleString(),
|
|
474359
|
+
" ",
|
|
474360
|
+
"tokens"
|
|
474361
|
+
),
|
|
474362
|
+
isActive && import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.configScreen.autoCompressThresholdDesc)
|
|
474363
|
+
)
|
|
474364
|
+
);
|
|
474365
|
+
}
|
|
474274
474366
|
return import_react69.default.createElement(
|
|
474275
474367
|
Box_default,
|
|
474276
474368
|
{ key: field, flexDirection: "column" },
|
|
@@ -474448,7 +474540,7 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474448
474540
|
)
|
|
474449
474541
|
)
|
|
474450
474542
|
);
|
|
474451
|
-
case "
|
|
474543
|
+
case "geminiThinkingLevel":
|
|
474452
474544
|
return import_react69.default.createElement(
|
|
474453
474545
|
Box_default,
|
|
474454
474546
|
{ key: field, flexDirection: "column" },
|
|
@@ -474456,23 +474548,25 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474456
474548
|
Text,
|
|
474457
474549
|
{ color: activeColor },
|
|
474458
474550
|
activeIndicator,
|
|
474459
|
-
t.configScreen.
|
|
474551
|
+
t.configScreen.geminiThinkingLevel
|
|
474460
474552
|
),
|
|
474461
474553
|
isCurrentlyEditing && import_react69.default.createElement(
|
|
474462
474554
|
Box_default,
|
|
474463
474555
|
{ marginLeft: 3 },
|
|
474464
|
-
import_react69.default.createElement(
|
|
474465
|
-
|
|
474466
|
-
{
|
|
474467
|
-
|
|
474468
|
-
" "
|
|
474469
|
-
|
|
474470
|
-
|
|
474556
|
+
import_react69.default.createElement(Select, { options: [
|
|
474557
|
+
{ label: "MINIMAL", value: "minimal" },
|
|
474558
|
+
{ label: "LOW", value: "low" },
|
|
474559
|
+
{ label: "MEDIUM", value: "medium" },
|
|
474560
|
+
{ label: "HIGH", value: "high" }
|
|
474561
|
+
], onChange: (value) => {
|
|
474562
|
+
setGeminiThinkingLevel(value);
|
|
474563
|
+
state.setIsEditing(false);
|
|
474564
|
+
} })
|
|
474471
474565
|
),
|
|
474472
474566
|
!isCurrentlyEditing && import_react69.default.createElement(
|
|
474473
474567
|
Box_default,
|
|
474474
474568
|
{ marginLeft: 3 },
|
|
474475
|
-
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary },
|
|
474569
|
+
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary }, geminiThinkingLevel.toUpperCase())
|
|
474476
474570
|
)
|
|
474477
474571
|
);
|
|
474478
474572
|
case "responsesReasoningEnabled":
|
|
@@ -474637,7 +474731,7 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474637
474731
|
toolResultTokenLimit,
|
|
474638
474732
|
"%"
|
|
474639
474733
|
),
|
|
474640
|
-
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (
|
|
474734
|
+
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, (_d4 = t.configScreen.toolResultTokenLimitHint) == null ? void 0 : _d4.replace("{percentage}", toolResultTokenLimit.toString()).replace("{maxContext}", maxContextTokens.toString()).replace("{actualLimit}", actualLimit.toLocaleString()))
|
|
474641
474735
|
),
|
|
474642
474736
|
!isCurrentlyEditing && import_react69.default.createElement(
|
|
474643
474737
|
Box_default,
|
|
@@ -474654,33 +474748,6 @@ function ConfigFieldRenderer({ field, state }) {
|
|
|
474654
474748
|
)
|
|
474655
474749
|
);
|
|
474656
474750
|
}
|
|
474657
|
-
case "editSimilarityThreshold":
|
|
474658
|
-
return import_react69.default.createElement(
|
|
474659
|
-
Box_default,
|
|
474660
|
-
{ key: field, flexDirection: "column" },
|
|
474661
|
-
import_react69.default.createElement(
|
|
474662
|
-
Text,
|
|
474663
|
-
{ color: activeColor },
|
|
474664
|
-
activeIndicator,
|
|
474665
|
-
t.configScreen.editSimilarityThreshold
|
|
474666
|
-
),
|
|
474667
|
-
isCurrentlyEditing && import_react69.default.createElement(
|
|
474668
|
-
Box_default,
|
|
474669
|
-
{ marginLeft: 3 },
|
|
474670
|
-
import_react69.default.createElement(
|
|
474671
|
-
Text,
|
|
474672
|
-
{ color: theme14.colors.menuInfo },
|
|
474673
|
-
t.configScreen.enterValue,
|
|
474674
|
-
" ",
|
|
474675
|
-
editingThresholdValue || editSimilarityThreshold
|
|
474676
|
-
)
|
|
474677
|
-
),
|
|
474678
|
-
!isCurrentlyEditing && import_react69.default.createElement(
|
|
474679
|
-
Box_default,
|
|
474680
|
-
{ marginLeft: 3 },
|
|
474681
|
-
import_react69.default.createElement(Text, { color: theme14.colors.menuSecondary }, editSimilarityThreshold)
|
|
474682
|
-
)
|
|
474683
|
-
);
|
|
474684
474751
|
default:
|
|
474685
474752
|
return null;
|
|
474686
474753
|
}
|
|
@@ -474728,7 +474795,7 @@ var init_ConfigFieldRenderer = __esm({
|
|
|
474728
474795
|
|
|
474729
474796
|
// dist/ui/pages/configScreen/ConfigSelectPanel.js
|
|
474730
474797
|
function ConfigSelectPanel({ state }) {
|
|
474731
|
-
const { t, theme: theme14, currentField, setIsEditing, requestMethod, setRequestMethod, requestMethodOptions, searchTerm, thinkingMode, setThinkingMode, thinkingEffort, setThinkingEffort, responsesVerbosity, setResponsesVerbosity, anthropicSpeed, setAnthropicSpeed, getCurrentOptions, getCurrentValue, getCustomHeadersSchemeSelectItems, getCustomHeadersSchemeSelectedValue, applyCustomHeadersSchemeSelectValue, handleModelChange } = state;
|
|
474798
|
+
const { t, theme: theme14, currentField, setIsEditing, requestMethod, setRequestMethod, requestMethodOptions, searchTerm, thinkingMode, setThinkingMode, thinkingEffort, setThinkingEffort, geminiThinkingLevel, setGeminiThinkingLevel, responsesVerbosity, setResponsesVerbosity, anthropicSpeed, setAnthropicSpeed, getCurrentOptions, getCurrentValue, getCustomHeadersSchemeSelectItems, getCustomHeadersSchemeSelectedValue, applyCustomHeadersSchemeSelectValue, handleModelChange } = state;
|
|
474732
474799
|
const getFieldLabel = () => {
|
|
474733
474800
|
switch (currentField) {
|
|
474734
474801
|
case "profile":
|
|
@@ -474743,6 +474810,8 @@ function ConfigSelectPanel({ state }) {
|
|
|
474743
474810
|
return t.configScreen.thinkingMode.replace(":", "");
|
|
474744
474811
|
case "thinkingEffort":
|
|
474745
474812
|
return t.configScreen.thinkingEffort.replace(":", "");
|
|
474813
|
+
case "geminiThinkingLevel":
|
|
474814
|
+
return t.configScreen.geminiThinkingLevel.replace(":", "");
|
|
474746
474815
|
case "responsesReasoningEffort":
|
|
474747
474816
|
return t.configScreen.responsesReasoningEffort.replace(":", "");
|
|
474748
474817
|
case "responsesVerbosity":
|
|
@@ -474815,6 +474884,15 @@ function ConfigSelectPanel({ state }) {
|
|
|
474815
474884
|
setThinkingEffort(item.value);
|
|
474816
474885
|
setIsEditing(false);
|
|
474817
474886
|
} }),
|
|
474887
|
+
currentField === "geminiThinkingLevel" && import_react70.default.createElement(ScrollableSelectInput, { items: [
|
|
474888
|
+
{ label: "MINIMAL", value: "minimal" },
|
|
474889
|
+
{ label: "LOW", value: "low" },
|
|
474890
|
+
{ label: "MEDIUM", value: "medium" },
|
|
474891
|
+
{ label: "HIGH", value: "high" }
|
|
474892
|
+
], initialIndex: Math.max(0, ["minimal", "low", "medium", "high"].indexOf(geminiThinkingLevel)), isFocused: true, onSelect: (item) => {
|
|
474893
|
+
setGeminiThinkingLevel(item.value);
|
|
474894
|
+
setIsEditing(false);
|
|
474895
|
+
} }),
|
|
474818
474896
|
currentField === "responsesReasoningEffort" && import_react70.default.createElement(ReasoningEffortSelect, { state }),
|
|
474819
474897
|
currentField === "responsesVerbosity" && import_react70.default.createElement(ScrollableSelectInput, { items: [
|
|
474820
474898
|
{ label: "LOW", value: "low" },
|
|
@@ -521633,7 +521711,7 @@ var init_libesm = __esm({
|
|
|
521633
521711
|
function stripLineNumbers(content) {
|
|
521634
521712
|
const hashlineRe = /^\s*\d+:[0-9a-fA-F]{2}→(.*)$/;
|
|
521635
521713
|
return content.split("\n").map((line) => {
|
|
521636
|
-
let stripped = line;
|
|
521714
|
+
let stripped = line.replace(/\r$/, "");
|
|
521637
521715
|
let match;
|
|
521638
521716
|
while (match = hashlineRe.exec(stripped)) {
|
|
521639
521717
|
stripped = match[1];
|
|
@@ -553960,7 +554038,7 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
553960
554038
|
}
|
|
553961
554039
|
}
|
|
553962
554040
|
}
|
|
553963
|
-
return import_react85.default.createElement(Box_default, { key: `msg-${index}`, marginTop: 0, marginBottom: 1, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react85.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor }, getDisplayContent(message.content)) : import_react85.default.createElement(
|
|
554041
|
+
return import_react85.default.createElement(Box_default, { key: `msg-${index}`, marginTop: message.role === "user" ? 1 : 0, marginBottom: 1, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react85.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor }, getDisplayContent(message.content)) : import_react85.default.createElement(
|
|
553964
554042
|
import_react85.default.Fragment,
|
|
553965
554043
|
null,
|
|
553966
554044
|
isFirstInGroup && import_react85.default.createElement(
|
|
@@ -563536,7 +563614,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
563536
563614
|
thinkingBudgetTokens: (_d4 = cfg == null ? void 0 : cfg.thinking) == null ? void 0 : _d4.budget_tokens,
|
|
563537
563615
|
thinkingEffort: (_e2 = cfg == null ? void 0 : cfg.thinking) == null ? void 0 : _e2.effort,
|
|
563538
563616
|
geminiThinkingEnabled: (_f = cfg == null ? void 0 : cfg.geminiThinking) == null ? void 0 : _f.enabled,
|
|
563539
|
-
|
|
563617
|
+
geminiThinkingLevel: (_g = cfg == null ? void 0 : cfg.geminiThinking) == null ? void 0 : _g.thinkingLevel,
|
|
563540
563618
|
responsesReasoningEnabled: (_h = cfg == null ? void 0 : cfg.responsesReasoning) == null ? void 0 : _h.enabled,
|
|
563541
563619
|
responsesReasoningEffort: (_i = cfg == null ? void 0 : cfg.responsesReasoning) == null ? void 0 : _i.effort,
|
|
563542
563620
|
responsesFastMode: cfg == null ? void 0 : cfg.responsesFastMode,
|
|
@@ -563549,7 +563627,6 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
563549
563627
|
streamIdleTimeoutSec: cfg == null ? void 0 : cfg.streamIdleTimeoutSec,
|
|
563550
563628
|
systemPromptId: cfg == null ? void 0 : cfg.systemPromptId,
|
|
563551
563629
|
customHeadersSchemeId: cfg == null ? void 0 : cfg.customHeadersSchemeId,
|
|
563552
|
-
editSimilarityThreshold: cfg == null ? void 0 : cfg.editSimilarityThreshold,
|
|
563553
563630
|
toolResultTokenLimit: cfg == null ? void 0 : cfg.toolResultTokenLimit,
|
|
563554
563631
|
streamingDisplay: cfg == null ? void 0 : cfg.streamingDisplay
|
|
563555
563632
|
},
|
|
@@ -563666,7 +563743,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
563666
563743
|
const statusItems = [];
|
|
563667
563744
|
if (currentProfileName) {
|
|
563668
563745
|
statusItems.push({
|
|
563669
|
-
text: `\
|
|
563746
|
+
text: `\xA7 ${currentProfileName}`,
|
|
563670
563747
|
color: theme14.colors.menuInfo
|
|
563671
563748
|
});
|
|
563672
563749
|
}
|
|
@@ -563677,7 +563754,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
563677
563754
|
});
|
|
563678
563755
|
}
|
|
563679
563756
|
if (yoloMode) {
|
|
563680
|
-
statusItems.push({ text: "\
|
|
563757
|
+
statusItems.push({ text: "\u29F4 YOLO", color: theme14.colors.warning });
|
|
563681
563758
|
}
|
|
563682
563759
|
if (planMode) {
|
|
563683
563760
|
statusItems.push({ text: "\u2690 Plan", color: "#60A5FA" });
|
|
@@ -563786,7 +563863,7 @@ function StatusLine({ yoloMode = false, planMode = false, vulnerabilityHuntingMo
|
|
|
563786
563863
|
import_react116.default.createElement(
|
|
563787
563864
|
Text,
|
|
563788
563865
|
{ color: theme14.colors.menuInfo, dimColor: true },
|
|
563789
|
-
"\
|
|
563866
|
+
"\xA7 ",
|
|
563790
563867
|
t.chatScreen.profileCurrent,
|
|
563791
563868
|
": ",
|
|
563792
563869
|
currentProfileName,
|
|
@@ -564760,16 +564837,42 @@ var init_ReviewCommitPanel = __esm({
|
|
|
564760
564837
|
});
|
|
564761
564838
|
|
|
564762
564839
|
// dist/utils/commands/btwStream.js
|
|
564840
|
+
function trimIncompleteToolCalls(msgs) {
|
|
564841
|
+
if (msgs.length === 0)
|
|
564842
|
+
return msgs;
|
|
564843
|
+
let lastAssistantIdx = -1;
|
|
564844
|
+
let toolCallIds = [];
|
|
564845
|
+
for (let i = msgs.length - 1; i >= 0; i--) {
|
|
564846
|
+
const m = msgs[i];
|
|
564847
|
+
if (m.role === "assistant" && m.tool_calls && m.tool_calls.length > 0) {
|
|
564848
|
+
lastAssistantIdx = i;
|
|
564849
|
+
toolCallIds = m.tool_calls.map((tc) => tc.id);
|
|
564850
|
+
break;
|
|
564851
|
+
}
|
|
564852
|
+
}
|
|
564853
|
+
if (lastAssistantIdx === -1)
|
|
564854
|
+
return msgs;
|
|
564855
|
+
const resultIds = /* @__PURE__ */ new Set();
|
|
564856
|
+
for (let i = lastAssistantIdx + 1; i < msgs.length; i++) {
|
|
564857
|
+
const m = msgs[i];
|
|
564858
|
+
if (m.role === "tool" && m.tool_call_id) {
|
|
564859
|
+
resultIds.add(m.tool_call_id);
|
|
564860
|
+
}
|
|
564861
|
+
}
|
|
564862
|
+
const incomplete = toolCallIds.some((id) => !resultIds.has(id));
|
|
564863
|
+
return incomplete ? msgs.slice(0, lastAssistantIdx) : msgs;
|
|
564864
|
+
}
|
|
564763
564865
|
function buildContextMessages() {
|
|
564764
564866
|
const session = sessionManager.getCurrentSession();
|
|
564765
564867
|
if (!session || session.messages.length === 0)
|
|
564766
564868
|
return [];
|
|
564767
|
-
|
|
564869
|
+
const mapped = session.messages.map((m) => ({
|
|
564768
564870
|
role: m.role,
|
|
564769
564871
|
content: typeof m.content === "string" ? m.content : "",
|
|
564770
564872
|
...m.tool_call_id ? { tool_call_id: m.tool_call_id } : {},
|
|
564771
564873
|
...m.tool_calls ? { tool_calls: m.tool_calls } : {}
|
|
564772
564874
|
}));
|
|
564875
|
+
return trimIncompleteToolCalls(mapped);
|
|
564773
564876
|
}
|
|
564774
564877
|
async function* streamBtwResponse(question, abortSignal) {
|
|
564775
564878
|
var _a20, _b14, _c6;
|
|
@@ -566128,6 +566231,7 @@ function resolveSnapshotIndex(liveMessages, liveIndex, sessionMessages) {
|
|
|
566128
566231
|
}
|
|
566129
566232
|
function useRollback(props) {
|
|
566130
566233
|
const { messages, setMessages, snapshotState, clearSavedMessages, setRemountKey, setRestoreInputContent, currentContextPercentageRef, streamingState } = props;
|
|
566234
|
+
const { stdout } = use_stdout_default();
|
|
566131
566235
|
(0, import_react128.useEffect)(() => {
|
|
566132
566236
|
const pendingRollback = snapshotState.pendingRollback;
|
|
566133
566237
|
if (!pendingRollback) {
|
|
@@ -566193,6 +566297,7 @@ function useRollback(props) {
|
|
|
566193
566297
|
if (sessionEndsWithAssistant) {
|
|
566194
566298
|
setMessages((prev) => prev.slice(0, selectedIndex));
|
|
566195
566299
|
clearSavedMessages();
|
|
566300
|
+
stdout.write(base_exports.clearTerminal);
|
|
566196
566301
|
setTimeout(() => {
|
|
566197
566302
|
setRemountKey((prev) => prev + 1);
|
|
566198
566303
|
snapshotState.setPendingRollback(null);
|
|
@@ -566225,6 +566330,7 @@ function useRollback(props) {
|
|
|
566225
566330
|
setMessages([]);
|
|
566226
566331
|
clearSavedMessages();
|
|
566227
566332
|
snapshotState.setSnapshotFileCount(/* @__PURE__ */ new Map());
|
|
566333
|
+
stdout.write(base_exports.clearTerminal);
|
|
566228
566334
|
setTimeout(() => {
|
|
566229
566335
|
setRemountKey((prev) => prev + 1);
|
|
566230
566336
|
snapshotState.setPendingRollback(null);
|
|
@@ -566246,6 +566352,7 @@ function useRollback(props) {
|
|
|
566246
566352
|
}
|
|
566247
566353
|
setMessages((prev) => prev.slice(0, selectedIndex));
|
|
566248
566354
|
clearSavedMessages();
|
|
566355
|
+
stdout.write(base_exports.clearTerminal);
|
|
566249
566356
|
setTimeout(() => {
|
|
566250
566357
|
setRemountKey((prev) => prev + 1);
|
|
566251
566358
|
snapshotState.setPendingRollback(null);
|
|
@@ -566262,6 +566369,7 @@ function useRollback(props) {
|
|
|
566262
566369
|
const uiMessages = convertSessionMessagesToUI(originalSession.messages);
|
|
566263
566370
|
clearSavedMessages();
|
|
566264
566371
|
setMessages(uiMessages);
|
|
566372
|
+
streamingState.setContextUsage(originalSession.contextUsage ?? null);
|
|
566265
566373
|
const snapshots = await hashBasedSnapshotManager.listSnapshots(originalSession.id);
|
|
566266
566374
|
const counts = /* @__PURE__ */ new Map();
|
|
566267
566375
|
for (const snapshot of snapshots) {
|
|
@@ -566315,7 +566423,10 @@ function useRollback(props) {
|
|
|
566315
566423
|
const originalSessionId = currentSession.compressedFrom;
|
|
566316
566424
|
const switchedToOriginalSession = await switchToOriginalCompressedSession(originalSessionId, currentSession.id);
|
|
566317
566425
|
if (switchedToOriginalSession) {
|
|
566318
|
-
|
|
566426
|
+
stdout.write(base_exports.clearTerminal);
|
|
566427
|
+
setTimeout(() => {
|
|
566428
|
+
setRemountKey((prev) => prev + 1);
|
|
566429
|
+
}, 0);
|
|
566319
566430
|
return;
|
|
566320
566431
|
}
|
|
566321
566432
|
}
|
|
@@ -566368,6 +566479,7 @@ function useRollback(props) {
|
|
|
566368
566479
|
if (shouldRollbackConversation && originalSessionId) {
|
|
566369
566480
|
const switchedToOriginalSession = await switchToOriginalCompressedSession(originalSessionId, shouldRollbackFiles ? void 0 : compressedSessionId);
|
|
566370
566481
|
if (switchedToOriginalSession) {
|
|
566482
|
+
stdout.write(base_exports.clearTerminal);
|
|
566371
566483
|
setTimeout(() => {
|
|
566372
566484
|
setRemountKey((prev) => prev + 1);
|
|
566373
566485
|
snapshotState.setPendingRollback(null);
|
|
@@ -566416,9 +566528,11 @@ function useRollback(props) {
|
|
|
566416
566528
|
}
|
|
566417
566529
|
var import_react128;
|
|
566418
566530
|
var init_useRollback = __esm({
|
|
566419
|
-
"dist/hooks/conversation/chatLogic/useRollback.js"() {
|
|
566531
|
+
async "dist/hooks/conversation/chatLogic/useRollback.js"() {
|
|
566420
566532
|
"use strict";
|
|
566421
566533
|
import_react128 = __toESM(require_react(), 1);
|
|
566534
|
+
await init_build2();
|
|
566535
|
+
init_ansi_escapes();
|
|
566422
566536
|
init_sessionManager();
|
|
566423
566537
|
init_hashBasedSnapshot();
|
|
566424
566538
|
init_sessionConverter();
|
|
@@ -569461,6 +569575,7 @@ function useChatHandlers(props, deps) {
|
|
|
569461
569575
|
await new Promise((resolve13) => setTimeout(resolve13, 0));
|
|
569462
569576
|
initializeFromSession(session.messages);
|
|
569463
569577
|
setMessages(uiMessages);
|
|
569578
|
+
streamingState.setContextUsage(session.contextUsage ?? null);
|
|
569464
569579
|
const snapshots = await hashBasedSnapshotManager.listSnapshots(session.id);
|
|
569465
569580
|
const counts = /* @__PURE__ */ new Map();
|
|
569466
569581
|
for (const snapshot of snapshots) {
|
|
@@ -570143,7 +570258,7 @@ var init_useChatLogic = __esm({
|
|
|
570143
570258
|
init_vscodeConnection();
|
|
570144
570259
|
init_codebaseSearchEvents();
|
|
570145
570260
|
await init_useMessageProcessing();
|
|
570146
|
-
init_useRollback();
|
|
570261
|
+
await init_useRollback();
|
|
570147
570262
|
await init_useChatHandlers();
|
|
570148
570263
|
await init_useRemoteEvents();
|
|
570149
570264
|
init_i18n();
|
|
@@ -571324,41 +571439,66 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571324
571439
|
const [hasAnswered, setHasAnswered] = (0, import_react139.useState)(false);
|
|
571325
571440
|
const [showCustomInput, setShowCustomInput] = (0, import_react139.useState)(false);
|
|
571326
571441
|
const [customInput, setCustomInput] = (0, import_react139.useState)("");
|
|
571327
|
-
const [
|
|
571442
|
+
const [highlightedOptionIndex, setHighlightedOptionIndex] = (0, import_react139.useState)(0);
|
|
571443
|
+
const [cursorMode, setCursorMode] = (0, import_react139.useState)("options");
|
|
571328
571444
|
const [checkedIndices, setCheckedIndices] = (0, import_react139.useState)(/* @__PURE__ */ new Set());
|
|
571329
571445
|
const [dynamicOptions, setDynamicOptions] = (0, import_react139.useState)([]);
|
|
571330
|
-
const CUSTOM_INPUT_VALUE = "custom";
|
|
571331
|
-
const CANCEL_VALUE = "cancel";
|
|
571332
571446
|
const safeOptions = Array.isArray(options3) ? options3 : [];
|
|
571333
571447
|
const allOptions = [...safeOptions, ...dynamicOptions];
|
|
571334
|
-
const
|
|
571335
|
-
|
|
571336
|
-
|
|
571337
|
-
|
|
571338
|
-
|
|
571339
|
-
|
|
571340
|
-
{
|
|
571341
|
-
|
|
571342
|
-
|
|
571343
|
-
|
|
571344
|
-
|
|
571345
|
-
|
|
571346
|
-
|
|
571347
|
-
|
|
571348
|
-
|
|
571448
|
+
const optionItems = (0, import_react139.useMemo)(() => allOptions.map((option, index) => ({
|
|
571449
|
+
label: option,
|
|
571450
|
+
value: `option-${index}`,
|
|
571451
|
+
index
|
|
571452
|
+
})), [allOptions]);
|
|
571453
|
+
(0, import_react139.useEffect)(() => {
|
|
571454
|
+
if (optionItems.length === 0 && cursorMode === "options") {
|
|
571455
|
+
setCursorMode("custom");
|
|
571456
|
+
return;
|
|
571457
|
+
}
|
|
571458
|
+
if (optionItems.length > 0 && highlightedOptionIndex >= optionItems.length) {
|
|
571459
|
+
setHighlightedOptionIndex(optionItems.length - 1);
|
|
571460
|
+
}
|
|
571461
|
+
}, [optionItems.length, highlightedOptionIndex, cursorMode]);
|
|
571462
|
+
const optionDisplayWindow = (0, import_react139.useMemo)(() => {
|
|
571463
|
+
const total = optionItems.length;
|
|
571464
|
+
if (total <= VISIBLE_OPTION_ROWS) {
|
|
571465
|
+
return {
|
|
571466
|
+
windowItems: optionItems,
|
|
571467
|
+
startIndex: 0,
|
|
571468
|
+
endIndex: total,
|
|
571469
|
+
hiddenAbove: 0,
|
|
571470
|
+
hiddenBelow: 0
|
|
571471
|
+
};
|
|
571472
|
+
}
|
|
571473
|
+
const halfWindow = Math.floor(VISIBLE_OPTION_ROWS / 2);
|
|
571474
|
+
let startIndex = Math.max(0, highlightedOptionIndex - halfWindow);
|
|
571475
|
+
const endIndex = Math.min(total, startIndex + VISIBLE_OPTION_ROWS);
|
|
571476
|
+
if (endIndex - startIndex < VISIBLE_OPTION_ROWS) {
|
|
571477
|
+
startIndex = Math.max(0, endIndex - VISIBLE_OPTION_ROWS);
|
|
571349
571478
|
}
|
|
571350
|
-
|
|
571479
|
+
return {
|
|
571480
|
+
windowItems: optionItems.slice(startIndex, endIndex),
|
|
571481
|
+
startIndex,
|
|
571482
|
+
endIndex,
|
|
571483
|
+
hiddenAbove: startIndex,
|
|
571484
|
+
hiddenBelow: total - endIndex
|
|
571485
|
+
};
|
|
571486
|
+
}, [optionItems, highlightedOptionIndex]);
|
|
571487
|
+
const optionListScrollable = optionItems.length > VISIBLE_OPTION_ROWS;
|
|
571488
|
+
const formatOptionLabel = (0, import_react139.useCallback)((label, isHighlighted) => {
|
|
571489
|
+
if (isHighlighted || label.length <= NON_FOCUSED_OPTION_MAX_LEN) {
|
|
571490
|
+
return label;
|
|
571491
|
+
}
|
|
571492
|
+
return `${label.slice(0, NON_FOCUSED_OPTION_MAX_LEN - 3)}...`;
|
|
571493
|
+
}, []);
|
|
571351
571494
|
const handleSubmit = (0, import_react139.useCallback)(() => {
|
|
571352
571495
|
if (hasAnswered)
|
|
571353
571496
|
return;
|
|
571354
|
-
|
|
571355
|
-
if (!currentItem)
|
|
571356
|
-
return;
|
|
571357
|
-
if (currentItem.value === CUSTOM_INPUT_VALUE) {
|
|
571497
|
+
if (cursorMode === "custom") {
|
|
571358
571498
|
setShowCustomInput(true);
|
|
571359
571499
|
return;
|
|
571360
571500
|
}
|
|
571361
|
-
if (
|
|
571501
|
+
if (cursorMode === "cancel") {
|
|
571362
571502
|
setHasAnswered(true);
|
|
571363
571503
|
onAnswer({
|
|
571364
571504
|
selected: "",
|
|
@@ -571366,6 +571506,9 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571366
571506
|
});
|
|
571367
571507
|
return;
|
|
571368
571508
|
}
|
|
571509
|
+
const currentItem = optionItems[highlightedOptionIndex];
|
|
571510
|
+
if (!currentItem)
|
|
571511
|
+
return;
|
|
571369
571512
|
const selectedOptions = Array.from(checkedIndices).sort((a, b) => a - b).map((idx) => allOptions[idx]).filter(Boolean);
|
|
571370
571513
|
setHasAnswered(true);
|
|
571371
571514
|
if (selectedOptions.length > 0) {
|
|
@@ -571379,8 +571522,9 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571379
571522
|
}
|
|
571380
571523
|
}, [
|
|
571381
571524
|
hasAnswered,
|
|
571382
|
-
|
|
571383
|
-
|
|
571525
|
+
cursorMode,
|
|
571526
|
+
optionItems,
|
|
571527
|
+
highlightedOptionIndex,
|
|
571384
571528
|
checkedIndices,
|
|
571385
571529
|
allOptions,
|
|
571386
571530
|
onAnswer
|
|
@@ -571394,7 +571538,8 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571394
571538
|
setShowCustomInput(false);
|
|
571395
571539
|
setCustomInput("");
|
|
571396
571540
|
const newIndex = allOptions.length;
|
|
571397
|
-
|
|
571541
|
+
setHighlightedOptionIndex(newIndex);
|
|
571542
|
+
setCursorMode("options");
|
|
571398
571543
|
}
|
|
571399
571544
|
}, [customInput, allOptions]);
|
|
571400
571545
|
const handleCustomInputCancel = (0, import_react139.useCallback)(() => {
|
|
@@ -571419,16 +571564,48 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571419
571564
|
return;
|
|
571420
571565
|
}
|
|
571421
571566
|
if (key.upArrow || input2 === "k") {
|
|
571422
|
-
|
|
571567
|
+
if (cursorMode === "cancel") {
|
|
571568
|
+
setCursorMode("custom");
|
|
571569
|
+
} else if (cursorMode === "custom") {
|
|
571570
|
+
if (optionItems.length > 0) {
|
|
571571
|
+
setCursorMode("options");
|
|
571572
|
+
setHighlightedOptionIndex(optionItems.length - 1);
|
|
571573
|
+
} else {
|
|
571574
|
+
setCursorMode("cancel");
|
|
571575
|
+
}
|
|
571576
|
+
} else if (optionItems.length > 0) {
|
|
571577
|
+
setHighlightedOptionIndex((prev) => prev > 0 ? prev - 1 : optionItems.length - 1);
|
|
571578
|
+
}
|
|
571423
571579
|
return;
|
|
571424
571580
|
}
|
|
571425
571581
|
if (key.downArrow || input2 === "j") {
|
|
571426
|
-
|
|
571582
|
+
if (cursorMode === "options") {
|
|
571583
|
+
if (optionItems.length === 0) {
|
|
571584
|
+
setCursorMode("custom");
|
|
571585
|
+
} else if (highlightedOptionIndex < optionItems.length - 1) {
|
|
571586
|
+
setHighlightedOptionIndex((prev) => prev + 1);
|
|
571587
|
+
} else {
|
|
571588
|
+
setCursorMode("custom");
|
|
571589
|
+
}
|
|
571590
|
+
} else if (cursorMode === "custom") {
|
|
571591
|
+
setCursorMode("cancel");
|
|
571592
|
+
} else {
|
|
571593
|
+
if (optionItems.length > 0) {
|
|
571594
|
+
setCursorMode("options");
|
|
571595
|
+
setHighlightedOptionIndex(0);
|
|
571596
|
+
} else {
|
|
571597
|
+
setCursorMode("custom");
|
|
571598
|
+
}
|
|
571599
|
+
}
|
|
571427
571600
|
return;
|
|
571428
571601
|
}
|
|
571429
|
-
if (
|
|
571430
|
-
|
|
571431
|
-
|
|
571602
|
+
if (key.tab) {
|
|
571603
|
+
setCursorMode((prev) => prev === "custom" ? "cancel" : "custom");
|
|
571604
|
+
return;
|
|
571605
|
+
}
|
|
571606
|
+
if (input2 === " " && cursorMode === "options") {
|
|
571607
|
+
const currentItem = optionItems[highlightedOptionIndex];
|
|
571608
|
+
if (currentItem) {
|
|
571432
571609
|
toggleCheck(currentItem.index);
|
|
571433
571610
|
}
|
|
571434
571611
|
return;
|
|
@@ -571436,6 +571613,8 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571436
571613
|
const num = parseInt(input2, 10);
|
|
571437
571614
|
if (!isNaN(num) && num >= 1 && num <= allOptions.length) {
|
|
571438
571615
|
const idx = num - 1;
|
|
571616
|
+
setCursorMode("options");
|
|
571617
|
+
setHighlightedOptionIndex(idx);
|
|
571439
571618
|
toggleCheck(idx);
|
|
571440
571619
|
return;
|
|
571441
571620
|
}
|
|
@@ -571452,13 +571631,13 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571452
571631
|
return;
|
|
571453
571632
|
}
|
|
571454
571633
|
if (input2 === "e" || input2 === "E") {
|
|
571455
|
-
const currentItem = items[highlightedIndex];
|
|
571456
|
-
if (!currentItem)
|
|
571457
|
-
return;
|
|
571458
571634
|
setShowCustomInput(true);
|
|
571459
|
-
if (
|
|
571635
|
+
if (cursorMode === "custom" || cursorMode === "cancel") {
|
|
571460
571636
|
setCustomInput("");
|
|
571461
571637
|
} else {
|
|
571638
|
+
const currentItem = optionItems[highlightedOptionIndex];
|
|
571639
|
+
if (!currentItem)
|
|
571640
|
+
return;
|
|
571462
571641
|
setCustomInput(currentItem.label);
|
|
571463
571642
|
}
|
|
571464
571643
|
}
|
|
@@ -571498,30 +571677,68 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571498
571677
|
import_react139.default.createElement(
|
|
571499
571678
|
Box_default,
|
|
571500
571679
|
{ marginBottom: 1 },
|
|
571501
|
-
import_react139.default.createElement(
|
|
571680
|
+
import_react139.default.createElement(
|
|
571681
|
+
Text,
|
|
571682
|
+
{ dimColor: true },
|
|
571683
|
+
t.askUser.selectPrompt,
|
|
571684
|
+
optionListScrollable ? ` (${highlightedOptionIndex + 1}/${optionItems.length})` : ""
|
|
571685
|
+
)
|
|
571502
571686
|
),
|
|
571503
|
-
import_react139.default.createElement(
|
|
571504
|
-
|
|
571505
|
-
|
|
571506
|
-
|
|
571507
|
-
|
|
571508
|
-
|
|
571687
|
+
import_react139.default.createElement(
|
|
571688
|
+
Box_default,
|
|
571689
|
+
{ flexDirection: "column" },
|
|
571690
|
+
optionDisplayWindow.hiddenAbove > 0 ? import_react139.default.createElement(
|
|
571691
|
+
Text,
|
|
571692
|
+
{ color: "gray", dimColor: true },
|
|
571693
|
+
"\u2191",
|
|
571694
|
+
" ",
|
|
571695
|
+
t.askUser.optionListMoreAbove.replace("{count}", String(optionDisplayWindow.hiddenAbove))
|
|
571696
|
+
) : null,
|
|
571697
|
+
import_react139.default.createElement(Box_default, { flexDirection: "column" }, optionDisplayWindow.windowItems.map((item, rowIndex) => {
|
|
571698
|
+
const index = optionDisplayWindow.startIndex + rowIndex;
|
|
571699
|
+
const isHighlighted = cursorMode === "options" && index === highlightedOptionIndex;
|
|
571700
|
+
const isChecked = item.index >= 0 && checkedIndices.has(item.index);
|
|
571701
|
+
return import_react139.default.createElement(
|
|
571702
|
+
Box_default,
|
|
571703
|
+
{ key: item.value },
|
|
571704
|
+
import_react139.default.createElement(Text, { color: isHighlighted ? theme14.colors.menuInfo : void 0 }, isHighlighted ? "\u25B8 " : " "),
|
|
571705
|
+
import_react139.default.createElement(Text, { color: isChecked ? theme14.colors.success : void 0, dimColor: !isChecked }, isChecked ? "[\u2713] " : "[ ] "),
|
|
571706
|
+
import_react139.default.createElement(
|
|
571707
|
+
Text,
|
|
571708
|
+
{ color: isHighlighted ? theme14.colors.menuInfo : void 0, dimColor: !isHighlighted },
|
|
571709
|
+
item.index >= 0 ? `${item.index + 1}. ` : "",
|
|
571710
|
+
formatOptionLabel(item.label, isHighlighted)
|
|
571711
|
+
)
|
|
571712
|
+
);
|
|
571713
|
+
})),
|
|
571714
|
+
optionDisplayWindow.hiddenBelow > 0 ? import_react139.default.createElement(
|
|
571715
|
+
Text,
|
|
571716
|
+
{ color: "gray", dimColor: true },
|
|
571717
|
+
"\u2193",
|
|
571718
|
+
" ",
|
|
571719
|
+
t.askUser.optionListMoreBelow.replace("{count}", String(optionDisplayWindow.hiddenBelow))
|
|
571720
|
+
) : null
|
|
571721
|
+
),
|
|
571722
|
+
import_react139.default.createElement(
|
|
571723
|
+
Box_default,
|
|
571724
|
+
{ marginTop: 1, flexDirection: "column" },
|
|
571725
|
+
import_react139.default.createElement(
|
|
571509
571726
|
Box_default,
|
|
571510
|
-
|
|
571511
|
-
import_react139.default.createElement(Text, { color:
|
|
571512
|
-
|
|
571513
|
-
|
|
571514
|
-
|
|
571515
|
-
|
|
571516
|
-
|
|
571517
|
-
|
|
571518
|
-
)
|
|
571519
|
-
)
|
|
571520
|
-
|
|
571727
|
+
null,
|
|
571728
|
+
import_react139.default.createElement(Text, { color: cursorMode === "custom" ? theme14.colors.menuInfo : void 0 }, cursorMode === "custom" ? "\u25B8 " : " "),
|
|
571729
|
+
import_react139.default.createElement(Text, { color: cursorMode === "custom" ? theme14.colors.menuInfo : void 0, dimColor: cursorMode !== "custom" }, t.askUser.customInputOption)
|
|
571730
|
+
),
|
|
571731
|
+
import_react139.default.createElement(
|
|
571732
|
+
Box_default,
|
|
571733
|
+
null,
|
|
571734
|
+
import_react139.default.createElement(Text, { color: cursorMode === "cancel" ? theme14.colors.menuInfo : void 0 }, cursorMode === "cancel" ? "\u25B8 " : " "),
|
|
571735
|
+
import_react139.default.createElement(Text, { color: cursorMode === "cancel" ? theme14.colors.menuInfo : void 0, dimColor: cursorMode !== "cancel" }, t.askUser.cancelOption || "Cancel")
|
|
571736
|
+
)
|
|
571737
|
+
),
|
|
571521
571738
|
import_react139.default.createElement(
|
|
571522
571739
|
Box_default,
|
|
571523
571740
|
{ marginTop: 1 },
|
|
571524
|
-
import_react139.default.createElement(Text, { dimColor: true }, t.askUser.multiSelectKeyboardHints || "\u2191\u2193 \u79FB\u52A8 | \u7A7A\u683C \u5207\u6362 | 1-9 \u5FEB\u901F\u5207\u6362 | \u56DE\u8F66 \u786E\u8BA4 | e \u7F16\u8F91")
|
|
571741
|
+
import_react139.default.createElement(Text, { dimColor: true }, t.askUser.multiSelectKeyboardHints || "\u2191\u2193 \u79FB\u52A8 | Tab \u5207\u6362(\u81EA\u5B9A\u4E49/\u53D6\u6D88) | \u7A7A\u683C \u5207\u6362 | 1-9 \u5FEB\u901F\u5207\u6362 | \u56DE\u8F66 \u786E\u8BA4 | e \u7F16\u8F91")
|
|
571525
571742
|
)
|
|
571526
571743
|
) : import_react139.default.createElement(
|
|
571527
571744
|
Box_default,
|
|
@@ -571540,7 +571757,7 @@ function AskUserQuestion({ question, options: options3, onAnswer }) {
|
|
|
571540
571757
|
)
|
|
571541
571758
|
);
|
|
571542
571759
|
}
|
|
571543
|
-
var import_react139;
|
|
571760
|
+
var import_react139, VISIBLE_OPTION_ROWS, NON_FOCUSED_OPTION_MAX_LEN;
|
|
571544
571761
|
var init_AskUserQuestion = __esm({
|
|
571545
571762
|
async "dist/ui/components/special/AskUserQuestion.js"() {
|
|
571546
571763
|
"use strict";
|
|
@@ -571549,6 +571766,8 @@ var init_AskUserQuestion = __esm({
|
|
|
571549
571766
|
await init_build5();
|
|
571550
571767
|
init_ThemeContext();
|
|
571551
571768
|
init_i18n();
|
|
571769
|
+
VISIBLE_OPTION_ROWS = 5;
|
|
571770
|
+
NON_FOCUSED_OPTION_MAX_LEN = 20;
|
|
571552
571771
|
}
|
|
571553
571772
|
});
|
|
571554
571773
|
|
|
@@ -574778,7 +574997,8 @@ var init_ModelsPanel = __esm({
|
|
|
574778
574997
|
const [thinkingBudgetTokens, setThinkingBudgetTokens] = (0, import_react154.useState)(1e4);
|
|
574779
574998
|
const [thinkingEffort, setThinkingEffort] = (0, import_react154.useState)("high");
|
|
574780
574999
|
const [geminiThinkingEnabled, setGeminiThinkingEnabled] = (0, import_react154.useState)(false);
|
|
574781
|
-
const [
|
|
575000
|
+
const [geminiThinkingLevel, setGeminiThinkingLevel] = (0, import_react154.useState)("high");
|
|
575001
|
+
const [isGeminiLevelSelecting, setIsGeminiLevelSelecting] = (0, import_react154.useState)(false);
|
|
574782
575002
|
const [responsesReasoningEnabled, setResponsesReasoningEnabled] = (0, import_react154.useState)(false);
|
|
574783
575003
|
const [responsesReasoningEffort, setResponsesReasoningEffort] = (0, import_react154.useState)("high");
|
|
574784
575004
|
const [responsesFastMode, setResponsesFastMode] = (0, import_react154.useState)(false);
|
|
@@ -574821,7 +575041,8 @@ var init_ModelsPanel = __esm({
|
|
|
574821
575041
|
setThinkingBudgetTokens(((_d4 = cfg.thinking) == null ? void 0 : _d4.budget_tokens) || 1e4);
|
|
574822
575042
|
setThinkingEffort(((_e2 = cfg.thinking) == null ? void 0 : _e2.effort) || "high");
|
|
574823
575043
|
setGeminiThinkingEnabled(((_f = cfg.geminiThinking) == null ? void 0 : _f.enabled) || false);
|
|
574824
|
-
|
|
575044
|
+
setGeminiThinkingLevel(((_g = cfg.geminiThinking) == null ? void 0 : _g.thinkingLevel) || "high");
|
|
575045
|
+
setIsGeminiLevelSelecting(false);
|
|
574825
575046
|
setResponsesReasoningEnabled(((_h = cfg.responsesReasoning) == null ? void 0 : _h.enabled) || false);
|
|
574826
575047
|
setResponsesReasoningEffort(((_i = cfg.responsesReasoning) == null ? void 0 : _i.effort) || "high");
|
|
574827
575048
|
setResponsesFastMode(cfg.responsesFastMode || false);
|
|
@@ -574930,7 +575151,7 @@ var init_ModelsPanel = __esm({
|
|
|
574930
575151
|
return thinkingMode === "adaptive" ? thinkingEffort : String(thinkingBudgetTokens);
|
|
574931
575152
|
}
|
|
574932
575153
|
if (requestMethod === "gemini") {
|
|
574933
|
-
return
|
|
575154
|
+
return geminiThinkingLevel.toUpperCase();
|
|
574934
575155
|
}
|
|
574935
575156
|
if (requestMethod === "responses") {
|
|
574936
575157
|
return responsesReasoningEffort;
|
|
@@ -574941,7 +575162,7 @@ var init_ModelsPanel = __esm({
|
|
|
574941
575162
|
thinkingMode,
|
|
574942
575163
|
thinkingBudgetTokens,
|
|
574943
575164
|
thinkingEffort,
|
|
574944
|
-
|
|
575165
|
+
geminiThinkingLevel,
|
|
574945
575166
|
responsesReasoningEffort,
|
|
574946
575167
|
t
|
|
574947
575168
|
]);
|
|
@@ -574962,6 +575183,11 @@ var init_ModelsPanel = __esm({
|
|
|
574962
575183
|
const applyThinkingEnabled = (0, import_react154.useCallback)(async (next) => {
|
|
574963
575184
|
setErrorMessage("");
|
|
574964
575185
|
try {
|
|
575186
|
+
if (!next && showThinking) {
|
|
575187
|
+
setShowThinking(false);
|
|
575188
|
+
await updateOpenAiConfig({ showThinking: false });
|
|
575189
|
+
configEvents.emitConfigChange({ type: "showThinking", value: false });
|
|
575190
|
+
}
|
|
574965
575191
|
if (requestMethod === "anthropic") {
|
|
574966
575192
|
setThinkingEnabled(next);
|
|
574967
575193
|
await updateOpenAiConfig({
|
|
@@ -574975,7 +575201,7 @@ var init_ModelsPanel = __esm({
|
|
|
574975
575201
|
if (requestMethod === "gemini") {
|
|
574976
575202
|
setGeminiThinkingEnabled(next);
|
|
574977
575203
|
await updateOpenAiConfig({
|
|
574978
|
-
geminiThinking: next ? { enabled: true,
|
|
575204
|
+
geminiThinking: next ? { enabled: true, thinkingLevel: geminiThinkingLevel } : void 0
|
|
574979
575205
|
});
|
|
574980
575206
|
return;
|
|
574981
575207
|
}
|
|
@@ -574996,10 +575222,11 @@ var init_ModelsPanel = __esm({
|
|
|
574996
575222
|
}
|
|
574997
575223
|
}, [
|
|
574998
575224
|
requestMethod,
|
|
575225
|
+
showThinking,
|
|
574999
575226
|
thinkingMode,
|
|
575000
575227
|
thinkingBudgetTokens,
|
|
575001
575228
|
thinkingEffort,
|
|
575002
|
-
|
|
575229
|
+
geminiThinkingLevel,
|
|
575003
575230
|
responsesReasoningEffort
|
|
575004
575231
|
]);
|
|
575005
575232
|
const applyAnthropicBudgetTokens = (0, import_react154.useCallback)(async (next) => {
|
|
@@ -575038,12 +575265,12 @@ var init_ModelsPanel = __esm({
|
|
|
575038
575265
|
setErrorMessage(message);
|
|
575039
575266
|
}
|
|
575040
575267
|
}, [thinkingEnabled]);
|
|
575041
|
-
const
|
|
575268
|
+
const applyGeminiLevel = (0, import_react154.useCallback)(async (next) => {
|
|
575042
575269
|
setErrorMessage("");
|
|
575043
575270
|
try {
|
|
575044
|
-
|
|
575271
|
+
setGeminiThinkingLevel(next);
|
|
575045
575272
|
await updateOpenAiConfig({
|
|
575046
|
-
geminiThinking: geminiThinkingEnabled ? { enabled: true,
|
|
575273
|
+
geminiThinking: geminiThinkingEnabled ? { enabled: true, thinkingLevel: next } : void 0
|
|
575047
575274
|
});
|
|
575048
575275
|
} catch (err) {
|
|
575049
575276
|
const message = err instanceof Error ? err.message : t.modelsPanel.saveFailed;
|
|
@@ -575126,6 +575353,10 @@ var init_ModelsPanel = __esm({
|
|
|
575126
575353
|
setIsThinkingModeSelecting(false);
|
|
575127
575354
|
return;
|
|
575128
575355
|
}
|
|
575356
|
+
if (isGeminiLevelSelecting) {
|
|
575357
|
+
setIsGeminiLevelSelecting(false);
|
|
575358
|
+
return;
|
|
575359
|
+
}
|
|
575129
575360
|
if (isThinkingEffortSelecting) {
|
|
575130
575361
|
setIsThinkingEffortSelecting(false);
|
|
575131
575362
|
return;
|
|
@@ -575166,8 +575397,6 @@ var init_ModelsPanel = __esm({
|
|
|
575166
575397
|
if (!Number.isNaN(parsed) && parsed >= 0) {
|
|
575167
575398
|
if (thinkingInputMode === "anthropicBudgetTokens") {
|
|
575168
575399
|
void applyAnthropicBudgetTokens(parsed);
|
|
575169
|
-
} else {
|
|
575170
|
-
void applyGeminiBudget(parsed);
|
|
575171
575400
|
}
|
|
575172
575401
|
}
|
|
575173
575402
|
setThinkingInputMode(null);
|
|
@@ -575207,7 +575436,7 @@ var init_ModelsPanel = __esm({
|
|
|
575207
575436
|
}
|
|
575208
575437
|
return;
|
|
575209
575438
|
}
|
|
575210
|
-
if (isThinkingModeSelecting || isThinkingEffortSelecting || isVerbositySelecting || isSpeedSelecting) {
|
|
575439
|
+
if (isThinkingModeSelecting || isGeminiLevelSelecting || isThinkingEffortSelecting || isVerbositySelecting || isSpeedSelecting) {
|
|
575211
575440
|
return;
|
|
575212
575441
|
}
|
|
575213
575442
|
if (key.tab) {
|
|
@@ -575232,8 +575461,7 @@ var init_ModelsPanel = __esm({
|
|
|
575232
575461
|
if (requestMethod === "anthropic") {
|
|
575233
575462
|
setIsThinkingModeSelecting(true);
|
|
575234
575463
|
} else if (requestMethod === "gemini") {
|
|
575235
|
-
|
|
575236
|
-
setThinkingInputValue(geminiThinkingBudget.toString());
|
|
575464
|
+
setIsGeminiLevelSelecting(true);
|
|
575237
575465
|
} else if (requestMethod === "responses") {
|
|
575238
575466
|
setIsThinkingEffortSelecting(true);
|
|
575239
575467
|
}
|
|
@@ -575510,6 +575738,19 @@ var init_ModelsPanel = __esm({
|
|
|
575510
575738
|
setIsVerbositySelecting(false);
|
|
575511
575739
|
} })
|
|
575512
575740
|
),
|
|
575741
|
+
isGeminiLevelSelecting && import_react154.default.createElement(
|
|
575742
|
+
Box_default,
|
|
575743
|
+
{ marginTop: 1 },
|
|
575744
|
+
import_react154.default.createElement(ScrollableSelectInput, { items: [
|
|
575745
|
+
{ label: "MINIMAL", value: "minimal" },
|
|
575746
|
+
{ label: "LOW", value: "low" },
|
|
575747
|
+
{ label: "MEDIUM", value: "medium" },
|
|
575748
|
+
{ label: "HIGH", value: "high" }
|
|
575749
|
+
], limit: 6, disableNumberShortcuts: true, initialIndex: Math.max(0, ["minimal", "low", "medium", "high"].indexOf(geminiThinkingLevel)), isFocused: true, onSelect: (item) => {
|
|
575750
|
+
void applyGeminiLevel(item.value);
|
|
575751
|
+
setIsGeminiLevelSelecting(false);
|
|
575752
|
+
} })
|
|
575753
|
+
),
|
|
575513
575754
|
isSpeedSelecting && import_react154.default.createElement(
|
|
575514
575755
|
Box_default,
|
|
575515
575756
|
{ marginTop: 1 },
|
|
@@ -575522,7 +575763,7 @@ var init_ModelsPanel = __esm({
|
|
|
575522
575763
|
setIsSpeedSelecting(false);
|
|
575523
575764
|
} })
|
|
575524
575765
|
),
|
|
575525
|
-
!thinkingInputMode && !isThinkingModeSelecting && !isThinkingEffortSelecting && !isVerbositySelecting && !isSpeedSelecting && import_react154.default.createElement(
|
|
575766
|
+
!thinkingInputMode && !isThinkingModeSelecting && !isGeminiLevelSelecting && !isThinkingEffortSelecting && !isVerbositySelecting && !isSpeedSelecting && import_react154.default.createElement(
|
|
575526
575767
|
Box_default,
|
|
575527
575768
|
{ marginTop: 1 },
|
|
575528
575769
|
import_react154.default.createElement(Text, { dimColor: true, color: theme14.colors.menuSecondary }, t.modelsPanel.navigationHint)
|
|
@@ -580719,7 +580960,7 @@ var init_useChatScreenModes = __esm({
|
|
|
580719
580960
|
});
|
|
580720
580961
|
|
|
580721
580962
|
// dist/ui/pages/chatScreen/useChatScreenSessionLifecycle.js
|
|
580722
|
-
function useChatScreenSessionLifecycle({ autoResume, terminalWidth, remountKey, setRemountKey, setMessages, initializeFromSession, setIsResumingSession }) {
|
|
580963
|
+
function useChatScreenSessionLifecycle({ autoResume, terminalWidth, remountKey, setRemountKey, setMessages, initializeFromSession, setIsResumingSession, setContextUsage }) {
|
|
580723
580964
|
const { stdout } = use_stdout_default();
|
|
580724
580965
|
const isInitialMount = (0, import_react173.useRef)(true);
|
|
580725
580966
|
(0, import_react173.useEffect)(() => {
|
|
@@ -580739,6 +580980,7 @@ function useChatScreenSessionLifecycle({ autoResume, terminalWidth, remountKey,
|
|
|
580739
580980
|
const uiMessages = convertSessionMessagesToUI(session.messages);
|
|
580740
580981
|
setMessages(uiMessages);
|
|
580741
580982
|
initializeFromSession(session.messages);
|
|
580983
|
+
setContextUsage == null ? void 0 : setContextUsage(session.contextUsage ?? null);
|
|
580742
580984
|
}
|
|
580743
580985
|
}
|
|
580744
580986
|
}
|
|
@@ -580969,7 +581211,8 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
580969
581211
|
setRemountKey,
|
|
580970
581212
|
setMessages,
|
|
580971
581213
|
initializeFromSession,
|
|
580972
|
-
setIsResumingSession
|
|
581214
|
+
setIsResumingSession,
|
|
581215
|
+
setContextUsage: streamingState.setContextUsage
|
|
580973
581216
|
});
|
|
580974
581217
|
const { handleMessageSubmit, processMessage, handleHistorySelect, handleRollbackConfirm, handleUserQuestionAnswer, handleSessionPanelSelect, handleQuit, handleReindexCodebase, handleToggleCodebase, handleReviewCommitConfirm, handleEscKey } = useChatLogic({
|
|
580975
581218
|
messages,
|
|
@@ -581104,6 +581347,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
581104
581347
|
cached_tokens: streamingState.contextUsage.cached_tokens,
|
|
581105
581348
|
max_tokens: getOpenAiConfig().maxContextTokens || 128e3
|
|
581106
581349
|
});
|
|
581350
|
+
sessionManager.updateContextUsage(streamingState.contextUsage);
|
|
581107
581351
|
} else {
|
|
581108
581352
|
updateGlobalTokenUsage(null);
|
|
581109
581353
|
}
|
|
@@ -581284,6 +581528,7 @@ var init_ChatScreen = __esm({
|
|
|
581284
581528
|
await init_useCursorHide();
|
|
581285
581529
|
init_ConnectionManager();
|
|
581286
581530
|
init_contextManager();
|
|
581531
|
+
init_sessionManager();
|
|
581287
581532
|
await init_ChatScreenConversationView();
|
|
581288
581533
|
await init_ChatScreenPanels();
|
|
581289
581534
|
init_useBackgroundProcessSelection();
|
|
@@ -597673,7 +597918,7 @@ var require_package3 = __commonJS({
|
|
|
597673
597918
|
"package.json"(exports2, module2) {
|
|
597674
597919
|
module2.exports = {
|
|
597675
597920
|
name: "snow-ai",
|
|
597676
|
-
version: "0.7.
|
|
597921
|
+
version: "0.7.7",
|
|
597677
597922
|
description: "Agentic coding in your terminal",
|
|
597678
597923
|
license: "MIT",
|
|
597679
597924
|
bin: {
|