snow-ai 0.6.18 → 0.6.20
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 +524 -135
- package/bundle/package.json +1 -1
- package/package.json +1 -1
package/bundle/cli.mjs
CHANGED
|
@@ -1421,7 +1421,7 @@ var require_react_development = __commonJS({
|
|
|
1421
1421
|
}
|
|
1422
1422
|
return dispatcher.useContext(Context);
|
|
1423
1423
|
}
|
|
1424
|
-
function
|
|
1424
|
+
function useState67(initialState) {
|
|
1425
1425
|
var dispatcher = resolveDispatcher();
|
|
1426
1426
|
return dispatcher.useState(initialState);
|
|
1427
1427
|
}
|
|
@@ -1433,7 +1433,7 @@ var require_react_development = __commonJS({
|
|
|
1433
1433
|
var dispatcher = resolveDispatcher();
|
|
1434
1434
|
return dispatcher.useRef(initialValue);
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function useEffect59(create3, deps) {
|
|
1437
1437
|
var dispatcher = resolveDispatcher();
|
|
1438
1438
|
return dispatcher.useEffect(create3, deps);
|
|
1439
1439
|
}
|
|
@@ -1449,7 +1449,7 @@ var require_react_development = __commonJS({
|
|
|
1449
1449
|
var dispatcher = resolveDispatcher();
|
|
1450
1450
|
return dispatcher.useCallback(callback, deps);
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function useMemo35(create3, deps) {
|
|
1453
1453
|
var dispatcher = resolveDispatcher();
|
|
1454
1454
|
return dispatcher.useMemo(create3, deps);
|
|
1455
1455
|
}
|
|
@@ -2216,15 +2216,15 @@ var require_react_development = __commonJS({
|
|
|
2216
2216
|
exports2.useContext = useContext13;
|
|
2217
2217
|
exports2.useDebugValue = useDebugValue;
|
|
2218
2218
|
exports2.useDeferredValue = useDeferredValue;
|
|
2219
|
-
exports2.useEffect =
|
|
2219
|
+
exports2.useEffect = useEffect59;
|
|
2220
2220
|
exports2.useId = useId;
|
|
2221
2221
|
exports2.useImperativeHandle = useImperativeHandle2;
|
|
2222
2222
|
exports2.useInsertionEffect = useInsertionEffect;
|
|
2223
2223
|
exports2.useLayoutEffect = useLayoutEffect2;
|
|
2224
|
-
exports2.useMemo =
|
|
2224
|
+
exports2.useMemo = useMemo35;
|
|
2225
2225
|
exports2.useReducer = useReducer8;
|
|
2226
2226
|
exports2.useRef = useRef16;
|
|
2227
|
-
exports2.useState =
|
|
2227
|
+
exports2.useState = useState67;
|
|
2228
2228
|
exports2.useSyncExternalStore = useSyncExternalStore;
|
|
2229
2229
|
exports2.useTransition = useTransition;
|
|
2230
2230
|
exports2.version = ReactVersion;
|
|
@@ -46862,14 +46862,18 @@ __export(vulnerabilityHuntingModeSystemPrompt_exports, {
|
|
|
46862
46862
|
});
|
|
46863
46863
|
function getAnalysisToolsSection(hasCodebase) {
|
|
46864
46864
|
if (hasCodebase) {
|
|
46865
|
-
return
|
|
46865
|
+
return `**CRITICAL: Use code search tools to find code. Only use terminal-execute to run build/test commands, NEVER for searching code.**
|
|
46866
|
+
|
|
46867
|
+
- \`codebase-search\` - PRIMARY tool for semantic search (find security-related patterns)
|
|
46866
46868
|
- \`filesystem-read\` - Read code to analyze security controls
|
|
46867
46869
|
- \`ace-find_definition\` - Locate function definitions
|
|
46868
46870
|
- \`ace-find_references\` - Track data flow and usage patterns
|
|
46869
46871
|
- \`ace-file_outline\` - Understand file structure
|
|
46870
46872
|
- \`ace-text_search\` - Find security keywords (TODO, FIXME, password, secret, etc.)`;
|
|
46871
46873
|
} else {
|
|
46872
|
-
return
|
|
46874
|
+
return `**CRITICAL: Use code search tools to find code. Only use terminal-execute to run build/test commands, NEVER for searching code.**
|
|
46875
|
+
|
|
46876
|
+
- \`ace-semantic_search\` - Find relevant code by security-related patterns
|
|
46873
46877
|
- \`ace-find_definition\` - Locate where symbols are defined
|
|
46874
46878
|
- \`ace-find_references\` - Track data flow and usage patterns
|
|
46875
46879
|
- \`ace-file_outline\` - Understand file structure
|
|
@@ -47466,14 +47470,18 @@ __export(planModeSystemPrompt_exports, {
|
|
|
47466
47470
|
});
|
|
47467
47471
|
function getAnalysisToolsSection2(hasCodebase) {
|
|
47468
47472
|
if (hasCodebase) {
|
|
47469
|
-
return
|
|
47473
|
+
return `**CRITICAL: Use code search tools to find code. Only use terminal-execute to run build/test commands, NEVER for searching code.**
|
|
47474
|
+
|
|
47475
|
+
- \`codebase-search\` - PRIMARY tool for code exploration (semantic search across entire codebase)
|
|
47470
47476
|
- \`filesystem-read\` - Read current code to understand implementation
|
|
47471
47477
|
- \`ace-find_definition\` - Locate exact symbol definitions (when you know the symbol name)
|
|
47472
47478
|
- \`ace-find_references\` - See where code is used throughout the project
|
|
47473
47479
|
- \`ace-file_outline\` - Get structure overview of specific files
|
|
47474
47480
|
- \`ide-get_diagnostics\` - Check for existing errors/warnings that might affect the plan`;
|
|
47475
47481
|
} else {
|
|
47476
|
-
return
|
|
47482
|
+
return `**CRITICAL: Use code search tools to find code. Only use terminal-execute to run build/test commands, NEVER for searching code.**
|
|
47483
|
+
|
|
47484
|
+
- \`ace-semantic_search\` - Find relevant code by semantic meaning
|
|
47477
47485
|
- \`ace-find_definition\` - Locate where symbols are defined
|
|
47478
47486
|
- \`ace-find_references\` - See where code is used throughout the project
|
|
47479
47487
|
- \`ace-file_outline\` - Get structure overview of specific files
|
|
@@ -47971,6 +47979,8 @@ function getCodeSearchSection(hasCodebase) {
|
|
|
47971
47979
|
if (hasCodebase) {
|
|
47972
47980
|
return `**Code Search Strategy:**
|
|
47973
47981
|
|
|
47982
|
+
**CRITICAL: Use code search tools to find code. Only use terminal-execute to run build/test commands, NEVER for searching code.**
|
|
47983
|
+
|
|
47974
47984
|
**PRIMARY TOOL - \`codebase-search\` (Semantic Search):**
|
|
47975
47985
|
- **USE THIS FIRST for 90% of code exploration tasks**
|
|
47976
47986
|
- Query by MEANING and intent: "authentication logic", "error handling patterns", "validation flow"
|
|
@@ -48061,6 +48071,10 @@ PLACEHOLDER_FOR_WORKFLOW_SECTION
|
|
|
48061
48071
|
- Reduces cognitive load - AI doesn't need to remember everything
|
|
48062
48072
|
- Enables recovery if conversation is interrupted
|
|
48063
48073
|
|
|
48074
|
+
**Formatting rule:**
|
|
48075
|
+
- TODO item content SHOULD start with a numeric prefix to explicitly mark execution order, e.g. "1. ...", "2. ...", "3. ..."
|
|
48076
|
+
- In continuous conversations, BEFORE calling todo-add, run todo-get (paired with an action tool) to inspect existing items and choose the next available sequence number (typically max(existingPrefix)+1). This prevents duplicate numbering across multiple turns.
|
|
48077
|
+
|
|
48064
48078
|
**WHEN TO USE (Default for most work):**
|
|
48065
48079
|
- ANY task touching 2+ files
|
|
48066
48080
|
- Features, refactoring, bug fixes
|
|
@@ -48073,28 +48087,29 @@ PLACEHOLDER_FOR_WORKFLOW_SECTION
|
|
|
48073
48087
|
- Simple queries that don't change code
|
|
48074
48088
|
|
|
48075
48089
|
**STANDARD WORKFLOW - Always Plan First:**
|
|
48076
|
-
1. **Receive task** \u2192
|
|
48077
|
-
2. **
|
|
48078
|
-
3. **
|
|
48090
|
+
1. **Receive task** \u2192 Run todo-get (paired with an action tool) to see current list and determine the next sequence number
|
|
48091
|
+
2. **Plan** \u2192 Create TODO with todo-add (batch add all steps at once, using the next available sequence number)
|
|
48092
|
+
3. **Execute** \u2192 Update progress with todo-update as each step is completed
|
|
48093
|
+
4. **Complete** \u2192 Clean up obsolete, incorrect, or superseded items with todo-delete
|
|
48079
48094
|
|
|
48080
48095
|
**PARALLEL CALLS RULE:**
|
|
48081
48096
|
ALWAYS pair TODO tools with action tools in same call:
|
|
48082
|
-
- CORRECT: todo-get + filesystem-read | todo-
|
|
48097
|
+
- CORRECT: todo-get + filesystem-read | todo-get + filesystem-edit | todo-update + filesystem-edit
|
|
48083
48098
|
- WRONG: Call todo-get alone, wait for result, then act
|
|
48084
48099
|
|
|
48085
48100
|
**Available tools:**
|
|
48086
48101
|
- **todo-add**: Create task list (supports batch: pass string array to add multiple at once)
|
|
48087
|
-
- **todo-get**:
|
|
48088
|
-
- **todo-update**:
|
|
48102
|
+
- **todo-get**: Get the current TODO list (always pair with other tools)
|
|
48103
|
+
- **todo-update**: Update TODO status/content
|
|
48089
48104
|
- **todo-delete**: Remove obsolete/redundant items
|
|
48090
48105
|
|
|
48091
48106
|
**Examples:**
|
|
48092
48107
|
\`\`\`
|
|
48093
48108
|
User: "Fix authentication bug and add logging"
|
|
48094
|
-
AI: todo-add(content=["Fix auth bug in auth.ts", "Add logging to login flow", "Test login with new logs"]) + filesystem-read("auth.ts")
|
|
48109
|
+
AI: todo-add(content=["1. Fix auth bug in auth.ts", "2. Add logging to login flow", "3. Test login with new logs"]) + filesystem-read("auth.ts")
|
|
48095
48110
|
|
|
48096
48111
|
User: "Refactor utils module"
|
|
48097
|
-
AI: todo-add(content=["Read utils module structure", "Identify refactor targets", "Extract common functions", "Update imports", "Run tests"]) + filesystem-read("utils/")
|
|
48112
|
+
AI: todo-add(content=["1. Read utils module structure", "2. Identify refactor targets", "3. Extract common functions", "4. Update imports", "5. Run tests"]) + filesystem-read("utils/")
|
|
48098
48113
|
\`\`\`
|
|
48099
48114
|
|
|
48100
48115
|
|
|
@@ -75686,6 +75701,24 @@ var init_vscodeConnection = __esm({
|
|
|
75686
75701
|
writable: true,
|
|
75687
75702
|
value: process.cwd()
|
|
75688
75703
|
});
|
|
75704
|
+
Object.defineProperty(this, "connectedWorkspaceFolders", {
|
|
75705
|
+
enumerable: true,
|
|
75706
|
+
configurable: true,
|
|
75707
|
+
writable: true,
|
|
75708
|
+
value: /* @__PURE__ */ new Set()
|
|
75709
|
+
});
|
|
75710
|
+
Object.defineProperty(this, "connectedPortHasCwdMatch", {
|
|
75711
|
+
enumerable: true,
|
|
75712
|
+
configurable: true,
|
|
75713
|
+
writable: true,
|
|
75714
|
+
value: false
|
|
75715
|
+
});
|
|
75716
|
+
Object.defineProperty(this, "trustContextFromConnectedServer", {
|
|
75717
|
+
enumerable: true,
|
|
75718
|
+
configurable: true,
|
|
75719
|
+
writable: true,
|
|
75720
|
+
value: false
|
|
75721
|
+
});
|
|
75689
75722
|
Object.defineProperty(this, "connectingPromise", {
|
|
75690
75723
|
enumerable: true,
|
|
75691
75724
|
configurable: true,
|
|
@@ -75744,8 +75777,10 @@ var init_vscodeConnection = __esm({
|
|
|
75744
75777
|
this.client.on("open", () => {
|
|
75745
75778
|
if (!isSettled) {
|
|
75746
75779
|
isSettled = true;
|
|
75780
|
+
this.trustContextFromConnectedServer = false;
|
|
75747
75781
|
this.reconnectAttempts = 0;
|
|
75748
75782
|
this.port = port;
|
|
75783
|
+
this.refreshConnectedWorkspaceFolders();
|
|
75749
75784
|
if (this.connectionTimeout) {
|
|
75750
75785
|
clearTimeout(this.connectionTimeout);
|
|
75751
75786
|
this.connectionTimeout = null;
|
|
@@ -75909,6 +75944,9 @@ var init_vscodeConnection = __esm({
|
|
|
75909
75944
|
if (!data.workspaceFolder) {
|
|
75910
75945
|
return true;
|
|
75911
75946
|
}
|
|
75947
|
+
if (data.type === "context" && this.trustContextFromConnectedServer) {
|
|
75948
|
+
return true;
|
|
75949
|
+
}
|
|
75912
75950
|
const cwd2 = this.normalizePath(this.currentWorkingDirectory);
|
|
75913
75951
|
const workspaceFolder = this.normalizePath(data.workspaceFolder);
|
|
75914
75952
|
if (cwd2 === workspaceFolder) {
|
|
@@ -75916,7 +75954,43 @@ var init_vscodeConnection = __esm({
|
|
|
75916
75954
|
}
|
|
75917
75955
|
const cwdInWorkspace = cwd2.startsWith(workspaceFolder + "/");
|
|
75918
75956
|
const workspaceInCwd = workspaceFolder.startsWith(cwd2 + "/");
|
|
75919
|
-
|
|
75957
|
+
if (cwdInWorkspace || workspaceInCwd) {
|
|
75958
|
+
return true;
|
|
75959
|
+
}
|
|
75960
|
+
if (this.connectedPortHasCwdMatch && this.connectedWorkspaceFolders.size > 0 && this.connectedWorkspaceFolders.has(workspaceFolder)) {
|
|
75961
|
+
return true;
|
|
75962
|
+
}
|
|
75963
|
+
return false;
|
|
75964
|
+
}
|
|
75965
|
+
refreshConnectedWorkspaceFolders() {
|
|
75966
|
+
this.connectedWorkspaceFolders.clear();
|
|
75967
|
+
this.connectedPortHasCwdMatch = false;
|
|
75968
|
+
try {
|
|
75969
|
+
const portInfoPath = path11.join(os7.tmpdir(), "snow-cli-ports.json");
|
|
75970
|
+
if (!fs11.existsSync(portInfoPath)) {
|
|
75971
|
+
return;
|
|
75972
|
+
}
|
|
75973
|
+
const portInfo = JSON.parse(fs11.readFileSync(portInfoPath, "utf8"));
|
|
75974
|
+
for (const [workspace, port] of Object.entries(portInfo)) {
|
|
75975
|
+
if (typeof port !== "number" || port !== this.port) {
|
|
75976
|
+
continue;
|
|
75977
|
+
}
|
|
75978
|
+
const normalizedWorkspace = this.normalizePath(workspace);
|
|
75979
|
+
if (normalizedWorkspace) {
|
|
75980
|
+
this.connectedWorkspaceFolders.add(normalizedWorkspace);
|
|
75981
|
+
}
|
|
75982
|
+
}
|
|
75983
|
+
const cwd2 = this.normalizePath(this.currentWorkingDirectory);
|
|
75984
|
+
for (const ws of this.connectedWorkspaceFolders) {
|
|
75985
|
+
if (cwd2 === ws || cwd2.startsWith(ws + "/") || ws.startsWith(cwd2 + "/")) {
|
|
75986
|
+
this.connectedPortHasCwdMatch = true;
|
|
75987
|
+
break;
|
|
75988
|
+
}
|
|
75989
|
+
}
|
|
75990
|
+
} catch (error) {
|
|
75991
|
+
this.connectedWorkspaceFolders.clear();
|
|
75992
|
+
this.connectedPortHasCwdMatch = false;
|
|
75993
|
+
}
|
|
75920
75994
|
}
|
|
75921
75995
|
scheduleReconnect() {
|
|
75922
75996
|
if (this.reconnectTimer) {
|
|
@@ -75950,6 +76024,9 @@ var init_vscodeConnection = __esm({
|
|
|
75950
76024
|
}
|
|
75951
76025
|
this.client = null;
|
|
75952
76026
|
}
|
|
76027
|
+
this.trustContextFromConnectedServer = false;
|
|
76028
|
+
this.connectedWorkspaceFolders.clear();
|
|
76029
|
+
this.connectedPortHasCwdMatch = false;
|
|
75953
76030
|
this.reconnectAttempts = 0;
|
|
75954
76031
|
}
|
|
75955
76032
|
isConnected() {
|
|
@@ -75970,6 +76047,7 @@ var init_vscodeConnection = __esm({
|
|
|
75970
76047
|
}
|
|
75971
76048
|
handleMessage(data) {
|
|
75972
76049
|
if (data.type === "context") {
|
|
76050
|
+
this.trustContextFromConnectedServer = true;
|
|
75973
76051
|
this.editorContext = {
|
|
75974
76052
|
activeFile: data.activeFile,
|
|
75975
76053
|
selectedText: data.selectedText,
|
|
@@ -81353,6 +81431,19 @@ var init_en = __esm({
|
|
|
81353
81431
|
searchLabel: "Search:",
|
|
81354
81432
|
noResults: "No matching profiles found"
|
|
81355
81433
|
},
|
|
81434
|
+
skillsPickerPanel: {
|
|
81435
|
+
title: "Select Skill",
|
|
81436
|
+
keyboardHint: "(ESC: cancel \xB7 Tab: switch \xB7 Enter: confirm)",
|
|
81437
|
+
loading: "Loading skills...",
|
|
81438
|
+
searchLabel: "Search:",
|
|
81439
|
+
appendLabel: "Append:",
|
|
81440
|
+
empty: "(empty)",
|
|
81441
|
+
noSkillsFound: "No skills found",
|
|
81442
|
+
noDescription: "No description",
|
|
81443
|
+
scrollHint: "\u2191\u2193 to scroll",
|
|
81444
|
+
moreAbove: "{count} above",
|
|
81445
|
+
moreBelow: "{count} below"
|
|
81446
|
+
},
|
|
81356
81447
|
reviewCommitPanel: {
|
|
81357
81448
|
title: "Review: Select Changes",
|
|
81358
81449
|
loadingCommits: "Loading commits...",
|
|
@@ -81636,6 +81727,10 @@ var init_en = __esm({
|
|
|
81636
81727
|
// Pending
|
|
81637
81728
|
pendingMessageWaiting: "Pending message waiting...",
|
|
81638
81729
|
pendingToolConfirmation: "Tool confirmation required",
|
|
81730
|
+
pendingMessagesTitle: "Pending Messages",
|
|
81731
|
+
pendingMessagesFooter: "Will be sent after tool execution completes",
|
|
81732
|
+
pendingMessagesEscHint: "Press ESC to restore to input (does not interrupt the current process)",
|
|
81733
|
+
pendingMessagesImagesAttached: "{count} images attached",
|
|
81639
81734
|
// Press keys hints
|
|
81640
81735
|
pressEscToClose: "Press ESC to close",
|
|
81641
81736
|
pressEnterToToggle: "Press Enter to toggle",
|
|
@@ -81813,6 +81908,9 @@ var init_en = __esm({
|
|
|
81813
81908
|
reason: "Reason:",
|
|
81814
81909
|
requiresConfirmation: "This command requires confirmation even in YOLO/Always-Approved mode",
|
|
81815
81910
|
arguments: "Arguments:",
|
|
81911
|
+
commandPagerTitle: "Command (paged):",
|
|
81912
|
+
commandPagerStatus: "{page}/{total}",
|
|
81913
|
+
commandPagerHint: "Tab: Next page (wraps)",
|
|
81816
81914
|
selectAction: "Select action:",
|
|
81817
81915
|
enterRejectionReason: "Enter rejection reason:",
|
|
81818
81916
|
pressEnterToSubmit: "Press Enter to submit",
|
|
@@ -82553,6 +82651,19 @@ var init_zh = __esm({
|
|
|
82553
82651
|
searchLabel: "\u641C\u7D22:",
|
|
82554
82652
|
noResults: "\u672A\u627E\u5230\u5339\u914D\u7684\u914D\u7F6E"
|
|
82555
82653
|
},
|
|
82654
|
+
skillsPickerPanel: {
|
|
82655
|
+
title: "\u9009\u62E9\u6280\u80FD",
|
|
82656
|
+
keyboardHint: "(ESC: \u53D6\u6D88 \xB7 Tab: \u5207\u6362 \xB7 Enter: \u786E\u8BA4)",
|
|
82657
|
+
loading: "\u6B63\u5728\u52A0\u8F7D\u6280\u80FD...",
|
|
82658
|
+
searchLabel: "\u641C\u7D22:",
|
|
82659
|
+
appendLabel: "\u8FFD\u52A0:",
|
|
82660
|
+
empty: "(\u7A7A)",
|
|
82661
|
+
noSkillsFound: "\u672A\u627E\u5230\u6280\u80FD",
|
|
82662
|
+
noDescription: "\u65E0\u63CF\u8FF0",
|
|
82663
|
+
scrollHint: "\u2191\u2193 \u6EDA\u52A8",
|
|
82664
|
+
moreAbove: "\u4E0A\u65B9 {count} \u9879",
|
|
82665
|
+
moreBelow: "\u4E0B\u65B9 {count} \u9879"
|
|
82666
|
+
},
|
|
82556
82667
|
reviewCommitPanel: {
|
|
82557
82668
|
title: "\u4EE3\u7801\u5BA1\u67E5\uFF1A\u9009\u62E9\u53D8\u66F4",
|
|
82558
82669
|
loadingCommits: "\u6B63\u5728\u52A0\u8F7D\u63D0\u4EA4\u8BB0\u5F55...",
|
|
@@ -82835,6 +82946,10 @@ var init_zh = __esm({
|
|
|
82835
82946
|
// Pending
|
|
82836
82947
|
pendingMessageWaiting: "\u5F85\u5904\u7406\u6D88\u606F\u7B49\u5F85\u4E2D...",
|
|
82837
82948
|
pendingToolConfirmation: "\u9700\u8981\u5DE5\u5177\u786E\u8BA4",
|
|
82949
|
+
pendingMessagesTitle: "\u5F85\u5904\u7406\u6D88\u606F",
|
|
82950
|
+
pendingMessagesFooter: "\u5DE5\u5177\u6267\u884C\u5B8C\u6210\u540E\u5C06\u81EA\u52A8\u53D1\u9001",
|
|
82951
|
+
pendingMessagesEscHint: "\u6309 ESC \u53EF\u64A4\u56DE\u5230\u8F93\u5165\u6846\uFF0C\u4E0D\u4F1A\u6253\u65AD\u5F53\u524D\u6D41\u7A0B",
|
|
82952
|
+
pendingMessagesImagesAttached: "\u5DF2\u9644\u5E26 {count} \u5F20\u56FE\u7247",
|
|
82838
82953
|
// Press keys hints
|
|
82839
82954
|
pressEscToClose: "\u6309 ESC \u5173\u95ED",
|
|
82840
82955
|
pressEnterToToggle: "\u6309 Enter \u5207\u6362",
|
|
@@ -83012,6 +83127,9 @@ var init_zh = __esm({
|
|
|
83012
83127
|
reason: "\u539F\u56E0:",
|
|
83013
83128
|
requiresConfirmation: "\u6B64\u547D\u4EE4\u5373\u4F7F\u5728 YOLO/\u81EA\u52A8\u6279\u51C6\u6A21\u5F0F\u4E0B\u4E5F\u9700\u8981\u786E\u8BA4",
|
|
83014
83129
|
arguments: "\u53C2\u6570:",
|
|
83130
|
+
commandPagerTitle: "\u547D\u4EE4(\u7FFB\u9875):",
|
|
83131
|
+
commandPagerStatus: "{page}/{total}",
|
|
83132
|
+
commandPagerHint: "Tab \u4E0B\u4E00\u9875(\u5FAA\u73AF)",
|
|
83015
83133
|
selectAction: "\u9009\u62E9\u64CD\u4F5C:",
|
|
83016
83134
|
enterRejectionReason: "\u8F93\u5165\u62D2\u7EDD\u539F\u56E0:",
|
|
83017
83135
|
pressEnterToSubmit: "\u6309 Enter \u63D0\u4EA4",
|
|
@@ -83752,6 +83870,19 @@ var init_zh_TW = __esm({
|
|
|
83752
83870
|
searchLabel: "\u641C\u5C0B:",
|
|
83753
83871
|
noResults: "\u672A\u627E\u5230\u7B26\u5408\u7684\u8A2D\u5B9A\u6A94"
|
|
83754
83872
|
},
|
|
83873
|
+
skillsPickerPanel: {
|
|
83874
|
+
title: "\u9078\u64C7\u6280\u80FD",
|
|
83875
|
+
keyboardHint: "(ESC: \u53D6\u6D88 \xB7 Tab: \u5207\u63DB \xB7 Enter: \u78BA\u8A8D)",
|
|
83876
|
+
loading: "\u6B63\u5728\u8F09\u5165\u6280\u80FD...",
|
|
83877
|
+
searchLabel: "\u641C\u5C0B:",
|
|
83878
|
+
appendLabel: "\u8FFD\u52A0:",
|
|
83879
|
+
empty: "(\u7A7A)",
|
|
83880
|
+
noSkillsFound: "\u672A\u627E\u5230\u6280\u80FD",
|
|
83881
|
+
noDescription: "\u7121\u63CF\u8FF0",
|
|
83882
|
+
scrollHint: "\u2191\u2193 \u6372\u52D5",
|
|
83883
|
+
moreAbove: "\u4E0A\u65B9 {count} \u9805",
|
|
83884
|
+
moreBelow: "\u4E0B\u65B9 {count} \u9805"
|
|
83885
|
+
},
|
|
83755
83886
|
reviewCommitPanel: {
|
|
83756
83887
|
title: "\u7A0B\u5F0F\u78BC\u5BE9\u67E5\uFF1A\u9078\u64C7\u8B8A\u66F4",
|
|
83757
83888
|
loadingCommits: "\u6B63\u5728\u8F09\u5165\u63D0\u4EA4\u8A18\u9304...",
|
|
@@ -84034,6 +84165,10 @@ var init_zh_TW = __esm({
|
|
|
84034
84165
|
// Pending
|
|
84035
84166
|
pendingMessageWaiting: "\u5F85\u8655\u7406\u8A0A\u606F\u7B49\u5F85\u4E2D...",
|
|
84036
84167
|
pendingToolConfirmation: "\u9700\u8981\u5DE5\u5177\u78BA\u8A8D",
|
|
84168
|
+
pendingMessagesTitle: "\u5F85\u8655\u7406\u8A0A\u606F",
|
|
84169
|
+
pendingMessagesFooter: "\u5DE5\u5177\u57F7\u884C\u5B8C\u6210\u5F8C\u5C07\u81EA\u52D5\u50B3\u9001",
|
|
84170
|
+
pendingMessagesEscHint: "\u6309 ESC \u53EF\u64A4\u56DE\u5230\u8F38\u5165\u6846\uFF0C\u4E0D\u6703\u4E2D\u65B7\u76EE\u524D\u6D41\u7A0B",
|
|
84171
|
+
pendingMessagesImagesAttached: "\u5DF2\u9644\u5E36 {count} \u5F35\u5716\u7247",
|
|
84037
84172
|
// Press keys hints
|
|
84038
84173
|
pressEscToClose: "\u6309 ESC \u95DC\u9589",
|
|
84039
84174
|
pressEnterToToggle: "\u6309 Enter \u5207\u63DB",
|
|
@@ -84210,6 +84345,9 @@ var init_zh_TW = __esm({
|
|
|
84210
84345
|
reason: "\u539F\u56E0:",
|
|
84211
84346
|
requiresConfirmation: "\u6B64\u547D\u4EE4\u5373\u4F7F\u5728 YOLO/\u81EA\u52D5\u6279\u51C6\u6A21\u5F0F\u4E0B\u4E5F\u9700\u8981\u78BA\u8A8D",
|
|
84212
84347
|
arguments: "\u53C3\u6578:",
|
|
84348
|
+
commandPagerTitle: "\u547D\u4EE4(\u7FFB\u9801):",
|
|
84349
|
+
commandPagerStatus: "{page}/{total}",
|
|
84350
|
+
commandPagerHint: "Tab \u4E0B\u4E00\u9801(\u5FAA\u74B0)",
|
|
84213
84351
|
selectAction: "\u9078\u64C7\u64CD\u4F5C:",
|
|
84214
84352
|
enterRejectionReason: "\u8F38\u5165\u62D2\u7D55\u539F\u56E0:",
|
|
84215
84353
|
pressEnterToSubmit: "\u6309 Enter \u63D0\u4EA4",
|
|
@@ -365586,7 +365724,7 @@ var init_aceCodeSearch = __esm({
|
|
|
365586
365724
|
/**
|
|
365587
365725
|
* Strategy 1: Use git grep for fast searching in Git repositories
|
|
365588
365726
|
*/
|
|
365589
|
-
async gitGrepSearch(pattern, fileGlob, maxResults = 100, isRegex =
|
|
365727
|
+
async gitGrepSearch(pattern, fileGlob, maxResults = 100, isRegex = true) {
|
|
365590
365728
|
return new Promise((resolve12, reject2) => {
|
|
365591
365729
|
const args2 = ["grep", "--untracked", "-n", "--ignore-case"];
|
|
365592
365730
|
if (isRegex) {
|
|
@@ -365708,7 +365846,7 @@ var init_aceCodeSearch = __esm({
|
|
|
365708
365846
|
/**
|
|
365709
365847
|
* Strategy 3: Pure JavaScript fallback search
|
|
365710
365848
|
*/
|
|
365711
|
-
async jsTextSearch(pattern, fileGlob, isRegex =
|
|
365849
|
+
async jsTextSearch(pattern, fileGlob, isRegex = true, maxResults = 100) {
|
|
365712
365850
|
const results = [];
|
|
365713
365851
|
await this.loadExclusionPatterns();
|
|
365714
365852
|
let searchRegex;
|
|
@@ -365818,7 +365956,7 @@ var init_aceCodeSearch = __esm({
|
|
|
365818
365956
|
* Strategy 3: JavaScript fallback (slower, but always works)
|
|
365819
365957
|
* Searches for text patterns across files with glob filtering
|
|
365820
365958
|
*/
|
|
365821
|
-
async textSearch(pattern, fileGlob, isRegex =
|
|
365959
|
+
async textSearch(pattern, fileGlob, isRegex = true, maxResults = 100) {
|
|
365822
365960
|
const [isGitRepo, gitAvailable, rgAvailable, grepAvailable] = await Promise.all([
|
|
365823
365961
|
this.isGitRepository(),
|
|
365824
365962
|
this.isCommandAvailableCached("git"),
|
|
@@ -366132,7 +366270,7 @@ var init_aceCodeSearch = __esm({
|
|
|
366132
366270
|
properties: {
|
|
366133
366271
|
pattern: {
|
|
366134
366272
|
type: "string",
|
|
366135
|
-
description: 'Text pattern or regex to search for
|
|
366273
|
+
description: 'Text pattern or regex to search for. Examples: "TODO:" (literal), "import.*from" (regex), "tool_call|toolCall" (regex with OR). By default, pattern is treated as regex. Set isRegex to false for literal string search.'
|
|
366136
366274
|
},
|
|
366137
366275
|
fileGlob: {
|
|
366138
366276
|
type: "string",
|
|
@@ -366140,8 +366278,8 @@ var init_aceCodeSearch = __esm({
|
|
|
366140
366278
|
},
|
|
366141
366279
|
isRegex: {
|
|
366142
366280
|
type: "boolean",
|
|
366143
|
-
description: "Whether the
|
|
366144
|
-
default:
|
|
366281
|
+
description: "Whether to force regex mode. If not specified, the tool defaults to regex mode. Set to false to use literal string search.",
|
|
366282
|
+
default: true
|
|
366145
366283
|
},
|
|
366146
366284
|
maxResults: {
|
|
366147
366285
|
type: "number",
|
|
@@ -453289,7 +453427,7 @@ var init_HybridCodeSearchService = __esm({
|
|
|
453289
453427
|
};
|
|
453290
453428
|
return languageMap[ext] || "unknown";
|
|
453291
453429
|
}
|
|
453292
|
-
async textSearch(pattern, fileGlob, isRegex =
|
|
453430
|
+
async textSearch(pattern, fileGlob, isRegex = true, maxResults = 100) {
|
|
453293
453431
|
return this.regexSearch.textSearch(pattern, fileGlob, isRegex, maxResults);
|
|
453294
453432
|
}
|
|
453295
453433
|
async semanticSearch(query, searchType = "all", language, symbolType2, maxResults = 50) {
|
|
@@ -547731,7 +547869,7 @@ function MarkdownRenderer({ content }) {
|
|
|
547731
547869
|
return renderFallback(content);
|
|
547732
547870
|
}
|
|
547733
547871
|
}
|
|
547734
|
-
var import_react75, import_markdown_it_terminal, import_cli_highlight2, md, HEADING_STYLE, FIRST_HEADING_STYLE, originalBulletListOpen, originalBulletListClose, originalOrderedListOpen, originalOrderedListClose, originalListItemClose, originalFenceRule, ANSI_PATTERN;
|
|
547872
|
+
var import_react75, import_markdown_it_terminal, import_cli_highlight2, md, HEADING_STYLE, FIRST_HEADING_STYLE, originalParagraphClose, originalBulletListOpen, originalBulletListClose, originalOrderedListOpen, originalOrderedListClose, originalListItemClose, originalFenceRule, ANSI_PATTERN;
|
|
547735
547873
|
var init_MarkdownRenderer = __esm({
|
|
547736
547874
|
async "dist/ui/components/common/MarkdownRenderer.js"() {
|
|
547737
547875
|
"use strict";
|
|
@@ -547761,16 +547899,18 @@ var init_MarkdownRenderer = __esm({
|
|
|
547761
547899
|
open: "\x1B[35m\x1B[4m\x1B[1m",
|
|
547762
547900
|
close: "\x1B[22m\x1B[24m\x1B[39m"
|
|
547763
547901
|
};
|
|
547902
|
+
originalParagraphClose = md.renderer.rules["paragraph_close"];
|
|
547764
547903
|
md.renderer.rules["paragraph_open"] = (tokens2, idx2) => {
|
|
547765
547904
|
var _a21;
|
|
547766
547905
|
return ((_a21 = tokens2[idx2]) == null ? void 0 : _a21.hidden) ? "" : "";
|
|
547767
547906
|
};
|
|
547768
|
-
md.renderer.rules["paragraph_close"] = (tokens2, idx2) => {
|
|
547907
|
+
md.renderer.rules["paragraph_close"] = (tokens2, idx2, options3, env5, self2) => {
|
|
547769
547908
|
var _a21, _b14, _c6;
|
|
547770
547909
|
if ((_a21 = tokens2[idx2]) == null ? void 0 : _a21.hidden) {
|
|
547771
547910
|
return ((_c6 = (_b14 = tokens2[idx2 + 1]) == null ? void 0 : _b14.type) == null ? void 0 : _c6.endsWith("close")) ? "" : "\n";
|
|
547772
547911
|
}
|
|
547773
|
-
|
|
547912
|
+
const original = (originalParagraphClose == null ? void 0 : originalParagraphClose(tokens2, idx2, options3, env5, self2)) || "\n";
|
|
547913
|
+
return original.replace(/\n\n$/, "\n");
|
|
547774
547914
|
};
|
|
547775
547915
|
md.renderer.rules["heading_open"] = (tokens2, idx2) => {
|
|
547776
547916
|
var _a21, _b14;
|
|
@@ -547881,13 +548021,16 @@ ${simpleLatexToUnicode(latex)}
|
|
|
547881
548021
|
});
|
|
547882
548022
|
|
|
547883
548023
|
// dist/ui/components/tools/ToolResultPreview.js
|
|
548024
|
+
function removeAnsiCodes(text3) {
|
|
548025
|
+
return text3.replace(/\x1b\[[0-9;]*m/g, "");
|
|
548026
|
+
}
|
|
547884
548027
|
function ToolResultPreview({ toolName, result: result2, maxLines = 5, isSubAgentInternal = false }) {
|
|
547885
548028
|
try {
|
|
547886
548029
|
const data = JSON.parse(result2);
|
|
547887
548030
|
if (toolName.startsWith("subagent-")) {
|
|
547888
548031
|
return renderSubAgentPreview(data, maxLines);
|
|
547889
548032
|
} else if (toolName === "terminal-execute") {
|
|
547890
|
-
return renderTerminalExecutePreview(data, isSubAgentInternal);
|
|
548033
|
+
return renderTerminalExecutePreview(data, maxLines, isSubAgentInternal);
|
|
547891
548034
|
} else if (toolName === "filesystem-read") {
|
|
547892
548035
|
return renderReadPreview(data, isSubAgentInternal);
|
|
547893
548036
|
} else if (toolName === "filesystem-create") {
|
|
@@ -547902,6 +548045,8 @@ function ToolResultPreview({ toolName, result: result2, maxLines = 5, isSubAgent
|
|
|
547902
548045
|
return renderACEPreview(toolName, data, maxLines);
|
|
547903
548046
|
} else if (toolName.startsWith("todo-")) {
|
|
547904
548047
|
return renderTodoPreview(toolName, data, maxLines);
|
|
548048
|
+
} else if (toolName === "ide-get_diagnostics") {
|
|
548049
|
+
return renderIdeDiagnosticsPreview(data);
|
|
547905
548050
|
} else if (toolName === "skill-execute") {
|
|
547906
548051
|
return null;
|
|
547907
548052
|
} else {
|
|
@@ -547929,21 +548074,61 @@ function renderSubAgentPreview(data, _maxLines) {
|
|
|
547929
548074
|
)
|
|
547930
548075
|
);
|
|
547931
548076
|
}
|
|
547932
|
-
function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
548077
|
+
function renderTerminalExecutePreview(data, maxLines, isSubAgentInternal) {
|
|
547933
548078
|
const hasError = data.exitCode !== 0;
|
|
547934
548079
|
const hasStdout = data.stdout && data.stdout.trim();
|
|
547935
548080
|
const hasStderr = data.stderr && data.stderr.trim();
|
|
548081
|
+
const sliceLines = (text3, limit) => {
|
|
548082
|
+
if (!text3)
|
|
548083
|
+
return { lines: [], truncated: false };
|
|
548084
|
+
const lines = text3.split("\n");
|
|
548085
|
+
if (lines.length <= limit)
|
|
548086
|
+
return { lines, truncated: false };
|
|
548087
|
+
return { lines: lines.slice(0, limit), truncated: true };
|
|
548088
|
+
};
|
|
547936
548089
|
if (isSubAgentInternal) {
|
|
548090
|
+
const stdoutPreview = sliceLines(data.stdout, maxLines);
|
|
548091
|
+
const stderrPreview = sliceLines(data.stderr, maxLines);
|
|
547937
548092
|
return import_react76.default.createElement(
|
|
547938
548093
|
Box_default,
|
|
547939
|
-
{ marginLeft: 2 },
|
|
548094
|
+
{ flexDirection: "column", marginLeft: 2 },
|
|
548095
|
+
data.command && import_react76.default.createElement(
|
|
548096
|
+
Box_default,
|
|
548097
|
+
{ flexDirection: "column" },
|
|
548098
|
+
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 command:"),
|
|
548099
|
+
import_react76.default.createElement(
|
|
548100
|
+
Box_default,
|
|
548101
|
+
{ marginLeft: 2 },
|
|
548102
|
+
import_react76.default.createElement(Text, { color: "gray" }, data.command)
|
|
548103
|
+
)
|
|
548104
|
+
),
|
|
547940
548105
|
import_react76.default.createElement(
|
|
547941
548106
|
Text,
|
|
547942
548107
|
{ color: hasError ? "red" : "gray", dimColor: true },
|
|
547943
|
-
"\
|
|
547944
|
-
data.exitCode
|
|
547945
|
-
|
|
547946
|
-
|
|
548108
|
+
"\u251C\u2500 exitCode: ",
|
|
548109
|
+
data.exitCode
|
|
548110
|
+
),
|
|
548111
|
+
hasStdout && import_react76.default.createElement(
|
|
548112
|
+
Box_default,
|
|
548113
|
+
{ flexDirection: "column" },
|
|
548114
|
+
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
548115
|
+
import_react76.default.createElement(
|
|
548116
|
+
Box_default,
|
|
548117
|
+
{ marginLeft: 2, flexDirection: "column" },
|
|
548118
|
+
stdoutPreview.lines.map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "white" }, removeAnsiCodes(line))),
|
|
548119
|
+
stdoutPreview.truncated && import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u2026")
|
|
548120
|
+
)
|
|
548121
|
+
),
|
|
548122
|
+
hasStderr && import_react76.default.createElement(
|
|
548123
|
+
Box_default,
|
|
548124
|
+
{ flexDirection: "column" },
|
|
548125
|
+
import_react76.default.createElement(Text, { color: hasError ? "red" : "gray", dimColor: true }, "\u2514\u2500 stderr:"),
|
|
548126
|
+
import_react76.default.createElement(
|
|
548127
|
+
Box_default,
|
|
548128
|
+
{ marginLeft: 2, flexDirection: "column" },
|
|
548129
|
+
stderrPreview.lines.map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: hasError ? "red" : "gray" }, removeAnsiCodes(line))),
|
|
548130
|
+
stderrPreview.truncated && import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u2026")
|
|
548131
|
+
)
|
|
547947
548132
|
)
|
|
547948
548133
|
);
|
|
547949
548134
|
}
|
|
@@ -547985,7 +548170,7 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
547985
548170
|
Box_default,
|
|
547986
548171
|
{ flexDirection: "column" },
|
|
547987
548172
|
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
547988
|
-
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "white" }, line)))
|
|
548173
|
+
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "white" }, removeAnsiCodes(line))))
|
|
547989
548174
|
),
|
|
547990
548175
|
import_react76.default.createElement(
|
|
547991
548176
|
Text,
|
|
@@ -548019,13 +548204,13 @@ function renderTerminalExecutePreview(data, isSubAgentInternal) {
|
|
|
548019
548204
|
Box_default,
|
|
548020
548205
|
{ flexDirection: "column" },
|
|
548021
548206
|
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u251C\u2500 stdout:"),
|
|
548022
|
-
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "yellow" }, line)))
|
|
548207
|
+
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stdout.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "yellow" }, removeAnsiCodes(line))))
|
|
548023
548208
|
),
|
|
548024
548209
|
hasStderr && import_react76.default.createElement(
|
|
548025
548210
|
Box_default,
|
|
548026
548211
|
{ flexDirection: "column" },
|
|
548027
548212
|
import_react76.default.createElement(Text, { color: "red", dimColor: true }, "\u251C\u2500 stderr:"),
|
|
548028
|
-
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stderr.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "red" }, line)))
|
|
548213
|
+
import_react76.default.createElement(Box_default, { marginLeft: 2, flexDirection: "column" }, data.stderr.split("\n").map((line, idx2) => import_react76.default.createElement(Text, { key: idx2, color: "red" }, removeAnsiCodes(line))))
|
|
548029
548214
|
),
|
|
548030
548215
|
data.executedAt && import_react76.default.createElement(
|
|
548031
548216
|
Text,
|
|
@@ -548383,6 +548568,42 @@ function renderTodoPreview(_toolName, data, _maxLines) {
|
|
|
548383
548568
|
)
|
|
548384
548569
|
);
|
|
548385
548570
|
}
|
|
548571
|
+
function renderIdeDiagnosticsPreview(data) {
|
|
548572
|
+
if (!data.diagnostics || !Array.isArray(data.diagnostics)) {
|
|
548573
|
+
return import_react76.default.createElement(
|
|
548574
|
+
Box_default,
|
|
548575
|
+
{ marginLeft: 2 },
|
|
548576
|
+
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No diagnostics data")
|
|
548577
|
+
);
|
|
548578
|
+
}
|
|
548579
|
+
const diagnosticsCount = data.diagnostics.length;
|
|
548580
|
+
if (diagnosticsCount === 0) {
|
|
548581
|
+
return import_react76.default.createElement(
|
|
548582
|
+
Box_default,
|
|
548583
|
+
{ marginLeft: 2 },
|
|
548584
|
+
import_react76.default.createElement(Text, { color: "gray", dimColor: true }, "\u2514\u2500 No diagnostics found")
|
|
548585
|
+
);
|
|
548586
|
+
}
|
|
548587
|
+
const errorCount = data.diagnostics.filter((d) => d.severity === "error").length;
|
|
548588
|
+
const warningCount = data.diagnostics.filter((d) => d.severity === "warning").length;
|
|
548589
|
+
const infoCount = data.diagnostics.filter((d) => d.severity === "info").length;
|
|
548590
|
+
const hintCount = data.diagnostics.filter((d) => d.severity === "hint").length;
|
|
548591
|
+
return import_react76.default.createElement(
|
|
548592
|
+
Box_default,
|
|
548593
|
+
{ marginLeft: 2 },
|
|
548594
|
+
import_react76.default.createElement(
|
|
548595
|
+
Text,
|
|
548596
|
+
{ color: "gray", dimColor: true },
|
|
548597
|
+
"\u2514\u2500 Found ",
|
|
548598
|
+
diagnosticsCount,
|
|
548599
|
+
" diagnostic(s)",
|
|
548600
|
+
errorCount > 0 && ` (${errorCount} error${errorCount > 1 ? "s" : ""})`,
|
|
548601
|
+
warningCount > 0 && ` (${warningCount} warning${warningCount > 1 ? "s" : ""})`,
|
|
548602
|
+
infoCount > 0 && ` (${infoCount} info)`,
|
|
548603
|
+
hintCount > 0 && ` (${hintCount} hint${hintCount > 1 ? "s" : ""})`
|
|
548604
|
+
)
|
|
548605
|
+
);
|
|
548606
|
+
}
|
|
548386
548607
|
var import_react76;
|
|
548387
548608
|
var init_ToolResultPreview = __esm({
|
|
548388
548609
|
async "dist/ui/components/tools/ToolResultPreview.js"() {
|
|
@@ -548503,11 +548724,11 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
548503
548724
|
if (!showThinking && message.thinking && !message.content && !message.toolCall && !message.toolResult && !message.terminalResult && !message.discontinued && !message.hookError) {
|
|
548504
548725
|
return null;
|
|
548505
548726
|
}
|
|
548506
|
-
const
|
|
548727
|
+
const removeAnsiCodes2 = (text3) => {
|
|
548507
548728
|
return text3.replace(/\x1b\[[0-9;]*m/g, "");
|
|
548508
548729
|
};
|
|
548509
548730
|
const getDisplayContent = (content) => {
|
|
548510
|
-
return maskSkillInjectedText(
|
|
548731
|
+
return maskSkillInjectedText(removeAnsiCodes2(content || "")).displayText;
|
|
548511
548732
|
};
|
|
548512
548733
|
const formatUserBubbleText = (text3) => {
|
|
548513
548734
|
const normalized2 = text3.length > 0 ? text3 : " ";
|
|
@@ -548530,7 +548751,11 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
548530
548751
|
} else if (message.messageStatus === "error") {
|
|
548531
548752
|
toolStatusColor = "red";
|
|
548532
548753
|
} else {
|
|
548533
|
-
|
|
548754
|
+
if (message.role === "subagent" && message.subAgentInternal === true) {
|
|
548755
|
+
toolStatusColor = "cyan";
|
|
548756
|
+
} else {
|
|
548757
|
+
toolStatusColor = message.role === "subagent" ? "magenta" : "blue";
|
|
548758
|
+
}
|
|
548534
548759
|
}
|
|
548535
548760
|
}
|
|
548536
548761
|
return import_react78.default.createElement(Box_default, { key: `msg-${index}`, marginTop: 0, marginBottom: 1, paddingX: 1, flexDirection: "column", width: terminalWidth }, message.plainOutput ? import_react78.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor }, getDisplayContent(message.content)) : import_react78.default.createElement(
|
|
@@ -548563,7 +548788,7 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
548563
548788
|
) : import_react78.default.createElement(
|
|
548564
548789
|
import_react78.default.Fragment,
|
|
548565
548790
|
null,
|
|
548566
|
-
message.plainOutput ? import_react78.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor, backgroundColor: message.role === "user" ? theme14.colors.border : void 0 },
|
|
548791
|
+
message.plainOutput ? import_react78.default.createElement(Text, { color: message.role === "user" ? "white" : toolStatusColor, backgroundColor: message.role === "user" ? theme14.colors.border : void 0 }, removeAnsiCodes2(message.content || " ")) : (() => {
|
|
548567
548792
|
if (message.hookError) {
|
|
548568
548793
|
return import_react78.default.createElement(HookErrorDisplay, { details: message.hookError });
|
|
548569
548794
|
}
|
|
@@ -548581,8 +548806,18 @@ function MessageRenderer({ message, index, filteredMessages, terminalWidth, show
|
|
|
548581
548806
|
} catch {
|
|
548582
548807
|
}
|
|
548583
548808
|
const hasToolStatus = message.messageStatus !== void 0;
|
|
548584
|
-
|
|
548585
|
-
|
|
548809
|
+
const isSubAgentInternal = message.subAgentInternal === true;
|
|
548810
|
+
if ((hasToolStatus || isSubAgentInternal) && (message.role === "assistant" || message.role === "subagent")) {
|
|
548811
|
+
const content = message.content || " ";
|
|
548812
|
+
const lines = content.split("\n");
|
|
548813
|
+
const titleLine = lines[0] || "";
|
|
548814
|
+
const treeLines = lines.slice(1);
|
|
548815
|
+
return import_react78.default.createElement(
|
|
548816
|
+
import_react78.default.Fragment,
|
|
548817
|
+
null,
|
|
548818
|
+
import_react78.default.createElement(Text, { color: toolStatusColor }, removeAnsiCodes2(titleLine)),
|
|
548819
|
+
treeLines.length > 0 && import_react78.default.createElement(Text, { color: theme14.colors.menuSecondary }, treeLines.map((line) => removeAnsiCodes2(line || "")).join("\n"))
|
|
548820
|
+
);
|
|
548586
548821
|
}
|
|
548587
548822
|
return import_react78.default.createElement(
|
|
548588
548823
|
import_react78.default.Fragment,
|
|
@@ -554841,8 +555076,10 @@ var init_SkillsPickerPanel = __esm({
|
|
|
554841
555076
|
"use strict";
|
|
554842
555077
|
import_react99 = __toESM(require_react(), 1);
|
|
554843
555078
|
await init_build2();
|
|
555079
|
+
init_i18n();
|
|
554844
555080
|
init_ThemeContext();
|
|
554845
555081
|
SkillsPickerPanel = (0, import_react99.memo)(({ skills, selectedIndex, visible, maxHeight, isLoading = false, searchQuery = "", appendText = "", focus = "search" }) => {
|
|
555082
|
+
const { t } = useI18n();
|
|
554846
555083
|
const { theme: theme14 } = useTheme();
|
|
554847
555084
|
const MAX_DISPLAY_ITEMS = 5;
|
|
554848
555085
|
const effectiveMaxItems = maxHeight ? Math.min(maxHeight, MAX_DISPLAY_ITEMS) : MAX_DISPLAY_ITEMS;
|
|
@@ -554890,16 +555127,16 @@ var init_SkillsPickerPanel = __esm({
|
|
|
554890
555127
|
import_react99.default.createElement(
|
|
554891
555128
|
Text,
|
|
554892
555129
|
{ color: theme14.colors.warning, bold: true },
|
|
554893
|
-
|
|
555130
|
+
t.skillsPickerPanel.title,
|
|
554894
555131
|
" ",
|
|
554895
555132
|
skills.length > effectiveMaxItems && `(${selectedIndex + 1}/${skills.length})`
|
|
554896
555133
|
),
|
|
554897
|
-
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true },
|
|
555134
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.skillsPickerPanel.keyboardHint)
|
|
554898
555135
|
),
|
|
554899
555136
|
isLoading ? import_react99.default.createElement(
|
|
554900
555137
|
Box_default,
|
|
554901
555138
|
{ marginTop: 1 },
|
|
554902
|
-
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true },
|
|
555139
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.skillsPickerPanel.loading)
|
|
554903
555140
|
) : import_react99.default.createElement(
|
|
554904
555141
|
import_react99.default.Fragment,
|
|
554905
555142
|
null,
|
|
@@ -554910,23 +555147,23 @@ var init_SkillsPickerPanel = __esm({
|
|
|
554910
555147
|
Text,
|
|
554911
555148
|
{ color: theme14.colors.menuInfo },
|
|
554912
555149
|
focus === "search" ? "\u25B6 " : " ",
|
|
554913
|
-
|
|
555150
|
+
t.skillsPickerPanel.searchLabel,
|
|
554914
555151
|
" ",
|
|
554915
|
-
import_react99.default.createElement(Text, { color: theme14.colors.menuSelected }, searchQuery ||
|
|
555152
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSelected }, searchQuery || t.skillsPickerPanel.empty)
|
|
554916
555153
|
),
|
|
554917
555154
|
import_react99.default.createElement(
|
|
554918
555155
|
Text,
|
|
554919
555156
|
{ color: theme14.colors.menuInfo },
|
|
554920
555157
|
focus === "append" ? "\u25B6 " : " ",
|
|
554921
|
-
|
|
555158
|
+
t.skillsPickerPanel.appendLabel,
|
|
554922
555159
|
" ",
|
|
554923
|
-
import_react99.default.createElement(Text, { color: theme14.colors.menuSelected }, appendText ||
|
|
555160
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSelected }, appendText || t.skillsPickerPanel.empty)
|
|
554924
555161
|
)
|
|
554925
555162
|
),
|
|
554926
555163
|
skills.length === 0 ? import_react99.default.createElement(
|
|
554927
555164
|
Box_default,
|
|
554928
555165
|
{ marginTop: 1 },
|
|
554929
|
-
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true },
|
|
555166
|
+
import_react99.default.createElement(Text, { color: theme14.colors.menuSecondary, dimColor: true }, t.skillsPickerPanel.noSkillsFound)
|
|
554930
555167
|
) : import_react99.default.createElement(
|
|
554931
555168
|
Box_default,
|
|
554932
555169
|
{ marginTop: 1, flexDirection: "column" },
|
|
@@ -554954,8 +555191,9 @@ var init_SkillsPickerPanel = __esm({
|
|
|
554954
555191
|
import_react99.default.createElement(
|
|
554955
555192
|
Text,
|
|
554956
555193
|
{ color: index === displayedSelectedIndex ? theme14.colors.menuSelected : theme14.colors.menuNormal, dimColor: true },
|
|
554957
|
-
"\u2514\u2500
|
|
554958
|
-
|
|
555194
|
+
"\u2514\u2500",
|
|
555195
|
+
" ",
|
|
555196
|
+
skill.description || skill.name || t.skillsPickerPanel.noDescription
|
|
554959
555197
|
)
|
|
554960
555198
|
)
|
|
554961
555199
|
)),
|
|
@@ -554965,9 +555203,21 @@ var init_SkillsPickerPanel = __esm({
|
|
|
554965
555203
|
import_react99.default.createElement(
|
|
554966
555204
|
Text,
|
|
554967
555205
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
554968
|
-
|
|
554969
|
-
hiddenAboveCount > 0 &&
|
|
554970
|
-
|
|
555206
|
+
t.skillsPickerPanel.scrollHint,
|
|
555207
|
+
hiddenAboveCount > 0 && import_react99.default.createElement(
|
|
555208
|
+
import_react99.default.Fragment,
|
|
555209
|
+
null,
|
|
555210
|
+
"\xB7",
|
|
555211
|
+
" ",
|
|
555212
|
+
t.skillsPickerPanel.moreAbove.replace("{count}", hiddenAboveCount.toString())
|
|
555213
|
+
),
|
|
555214
|
+
hiddenBelowCount > 0 && import_react99.default.createElement(
|
|
555215
|
+
import_react99.default.Fragment,
|
|
555216
|
+
null,
|
|
555217
|
+
"\xB7",
|
|
555218
|
+
" ",
|
|
555219
|
+
t.skillsPickerPanel.moreBelow.replace("{count}", hiddenBelowCount.toString())
|
|
555220
|
+
)
|
|
554971
555221
|
)
|
|
554972
555222
|
)
|
|
554973
555223
|
)
|
|
@@ -555186,7 +555436,7 @@ function calculateContextPercentage(contextUsage) {
|
|
|
555186
555436
|
const totalInputTokens = isAnthropic ? contextUsage.inputTokens + (contextUsage.cacheCreationTokens || 0) + (contextUsage.cacheReadTokens || 0) : contextUsage.inputTokens;
|
|
555187
555437
|
return Math.min(100, totalInputTokens / contextUsage.maxContextTokens * 100);
|
|
555188
555438
|
}
|
|
555189
|
-
function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...", disabled = false, isProcessing = false, chatHistory = [], onHistorySelect, yoloMode = false, setYoloMode, planMode = false, setPlanMode, vulnerabilityHuntingMode = false, setVulnerabilityHuntingMode, contextUsage, initialContent = null, onContextPercentageChange, showProfilePicker = false, setShowProfilePicker, profileSelectedIndex = 0, setProfileSelectedIndex, getFilteredProfiles, handleProfileSelect, profileSearchQuery = "", setProfileSearchQuery, onSwitchProfile, disableKeyboardNavigation = false }) {
|
|
555439
|
+
function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...", disabled = false, isProcessing = false, chatHistory = [], onHistorySelect, yoloMode = false, setYoloMode, planMode = false, setPlanMode, vulnerabilityHuntingMode = false, setVulnerabilityHuntingMode, contextUsage, initialContent = null, draftContent = null, onDraftChange, onContextPercentageChange, showProfilePicker = false, setShowProfilePicker, profileSelectedIndex = 0, setProfileSelectedIndex, getFilteredProfiles, handleProfileSelect, profileSearchQuery = "", setProfileSearchQuery, onSwitchProfile, disableKeyboardNavigation = false }) {
|
|
555190
555440
|
const { t } = useI18n();
|
|
555191
555441
|
const { theme: theme14 } = useTheme();
|
|
555192
555442
|
const { parseBashCommands, parsePureBashCommands } = useBashMode();
|
|
@@ -555350,6 +555600,65 @@ function ChatInput({ onSubmit, onCommand, placeholder = "Type your message...",
|
|
|
555350
555600
|
triggerUpdate();
|
|
555351
555601
|
}
|
|
555352
555602
|
}, [initialContent]);
|
|
555603
|
+
(0, import_react101.useEffect)(() => {
|
|
555604
|
+
if (!draftContent)
|
|
555605
|
+
return;
|
|
555606
|
+
if (initialContent)
|
|
555607
|
+
return;
|
|
555608
|
+
if (buffer.text.length > 0)
|
|
555609
|
+
return;
|
|
555610
|
+
buffer.setText("");
|
|
555611
|
+
const text3 = draftContent.text;
|
|
555612
|
+
const images = draftContent.images || [];
|
|
555613
|
+
if (images.length === 0) {
|
|
555614
|
+
if (text3) {
|
|
555615
|
+
restoreTextWithSkillPlaceholders(buffer, text3);
|
|
555616
|
+
}
|
|
555617
|
+
} else {
|
|
555618
|
+
const imagePlaceholderPattern = /\[image #\d+\]/g;
|
|
555619
|
+
const parts = text3.split(imagePlaceholderPattern);
|
|
555620
|
+
for (let i = 0; i < parts.length; i++) {
|
|
555621
|
+
const part = parts[i];
|
|
555622
|
+
if (part) {
|
|
555623
|
+
restoreTextWithSkillPlaceholders(buffer, part);
|
|
555624
|
+
}
|
|
555625
|
+
if (i < images.length) {
|
|
555626
|
+
const img = images[i];
|
|
555627
|
+
if (img) {
|
|
555628
|
+
let base64Data = img.data;
|
|
555629
|
+
if (base64Data.startsWith("data:")) {
|
|
555630
|
+
const base64Index = base64Data.indexOf("base64,");
|
|
555631
|
+
if (base64Index !== -1) {
|
|
555632
|
+
base64Data = base64Data.substring(base64Index + 7);
|
|
555633
|
+
}
|
|
555634
|
+
}
|
|
555635
|
+
buffer.insertImage(base64Data, img.mimeType);
|
|
555636
|
+
}
|
|
555637
|
+
}
|
|
555638
|
+
}
|
|
555639
|
+
}
|
|
555640
|
+
triggerUpdate();
|
|
555641
|
+
}, [draftContent, initialContent, buffer, triggerUpdate]);
|
|
555642
|
+
(0, import_react101.useEffect)(() => {
|
|
555643
|
+
if (!onDraftChange)
|
|
555644
|
+
return;
|
|
555645
|
+
const text3 = buffer.getFullText();
|
|
555646
|
+
const currentText = buffer.text;
|
|
555647
|
+
const allImages = buffer.getImages();
|
|
555648
|
+
const images = allImages.filter((img) => currentText.includes(img.placeholder)).map((img) => ({
|
|
555649
|
+
type: "image",
|
|
555650
|
+
data: img.data,
|
|
555651
|
+
mimeType: img.mimeType
|
|
555652
|
+
}));
|
|
555653
|
+
if (!text3 && images.length === 0) {
|
|
555654
|
+
onDraftChange(null);
|
|
555655
|
+
return;
|
|
555656
|
+
}
|
|
555657
|
+
onDraftChange({
|
|
555658
|
+
text: text3,
|
|
555659
|
+
images: images.length > 0 ? images : void 0
|
|
555660
|
+
});
|
|
555661
|
+
}, [buffer.text, buffer, onDraftChange]);
|
|
555353
555662
|
(0, import_react101.useEffect)(() => {
|
|
555354
555663
|
const timer2 = setTimeout(() => {
|
|
555355
555664
|
forceUpdate();
|
|
@@ -556230,38 +556539,34 @@ var init_BackgroundProcessPanel = __esm({
|
|
|
556230
556539
|
// dist/ui/components/special/TodoTree.js
|
|
556231
556540
|
function TodoTree({ todos }) {
|
|
556232
556541
|
const { theme: theme14 } = useTheme();
|
|
556542
|
+
const { t } = useI18n();
|
|
556233
556543
|
if (todos.length === 0) {
|
|
556234
556544
|
return null;
|
|
556235
556545
|
}
|
|
556236
|
-
const
|
|
556546
|
+
const PAGE_SIZE2 = 5;
|
|
556237
556547
|
const totalCount = todos.length;
|
|
556238
|
-
const completedCount = todos.reduce((acc,
|
|
556239
|
-
|
|
556240
|
-
|
|
556241
|
-
|
|
556242
|
-
|
|
556243
|
-
|
|
556244
|
-
|
|
556245
|
-
|
|
556246
|
-
|
|
556247
|
-
|
|
556248
|
-
|
|
556249
|
-
|
|
556250
|
-
|
|
556251
|
-
|
|
556252
|
-
|
|
556253
|
-
|
|
556254
|
-
|
|
556255
|
-
|
|
556256
|
-
|
|
556257
|
-
|
|
556258
|
-
|
|
556259
|
-
|
|
556260
|
-
}
|
|
556261
|
-
visibleTodos = todos.filter((_3, i) => visibleMask[i]);
|
|
556262
|
-
const visibleCompletedCount = visibleTodos.reduce((acc, t) => acc + (t.status === "completed" ? 1 : 0), 0);
|
|
556263
|
-
hiddenCompletedCount = Math.max(0, completedCount - visibleCompletedCount);
|
|
556264
|
-
}
|
|
556548
|
+
const completedCount = todos.reduce((acc, t2) => acc + (t2.status === "completed" ? 1 : 0), 0);
|
|
556549
|
+
const sortedTodos = (0, import_react104.useMemo)(() => {
|
|
556550
|
+
return todos.map((t2, originalIndex) => ({ t: t2, originalIndex })).slice().sort((a, b) => {
|
|
556551
|
+
const aCompleted = a.t.status === "completed" ? 1 : 0;
|
|
556552
|
+
const bCompleted = b.t.status === "completed" ? 1 : 0;
|
|
556553
|
+
if (aCompleted !== bCompleted)
|
|
556554
|
+
return aCompleted - bCompleted;
|
|
556555
|
+
return a.originalIndex - b.originalIndex;
|
|
556556
|
+
}).map(({ t: t2 }) => t2);
|
|
556557
|
+
}, [todos]);
|
|
556558
|
+
const pageCount = Math.max(1, Math.ceil(sortedTodos.length / PAGE_SIZE2));
|
|
556559
|
+
const [pageIndex, setPageIndex] = (0, import_react104.useState)(0);
|
|
556560
|
+
(0, import_react104.useEffect)(() => {
|
|
556561
|
+
setPageIndex((p) => Math.min(p, pageCount - 1));
|
|
556562
|
+
}, [pageCount]);
|
|
556563
|
+
use_input_default((_input, key) => {
|
|
556564
|
+
if (!key.tab || pageCount <= 1)
|
|
556565
|
+
return;
|
|
556566
|
+
setPageIndex((p) => (p + 1) % pageCount);
|
|
556567
|
+
});
|
|
556568
|
+
const visibleTodos = sortedTodos.slice(pageIndex * PAGE_SIZE2, pageIndex * PAGE_SIZE2 + PAGE_SIZE2);
|
|
556569
|
+
const hiddenCount = Math.max(0, sortedTodos.length - visibleTodos.length);
|
|
556265
556570
|
const getStatusIcon = (status) => {
|
|
556266
556571
|
return status === "completed" ? "\u2713" : "\u25CB";
|
|
556267
556572
|
};
|
|
@@ -556277,7 +556582,7 @@ function TodoTree({ todos }) {
|
|
|
556277
556582
|
};
|
|
556278
556583
|
return import_react104.default.createElement(
|
|
556279
556584
|
Text,
|
|
556280
|
-
{ key: `${todo.id}:${index}` },
|
|
556585
|
+
{ key: `${todo.id}:${pageIndex}:${index}` },
|
|
556281
556586
|
applyColor(statusIcon),
|
|
556282
556587
|
applyColor(" " + todo.content)
|
|
556283
556588
|
);
|
|
@@ -556298,12 +556603,23 @@ function TodoTree({ todos }) {
|
|
|
556298
556603
|
totalCount,
|
|
556299
556604
|
")"
|
|
556300
556605
|
),
|
|
556301
|
-
|
|
556606
|
+
import_react104.default.createElement(
|
|
556607
|
+
Text,
|
|
556608
|
+
{ dimColor: true },
|
|
556609
|
+
" ",
|
|
556610
|
+
"[",
|
|
556611
|
+
pageIndex + 1,
|
|
556612
|
+
"/",
|
|
556613
|
+
pageCount,
|
|
556614
|
+
"] ",
|
|
556615
|
+
t.toolConfirmation.commandPagerHint
|
|
556616
|
+
),
|
|
556617
|
+
hiddenCount > 0 && import_react104.default.createElement(
|
|
556302
556618
|
Text,
|
|
556303
556619
|
{ dimColor: true },
|
|
556304
556620
|
" +",
|
|
556305
|
-
|
|
556306
|
-
"
|
|
556621
|
+
hiddenCount,
|
|
556622
|
+
" more"
|
|
556307
556623
|
)
|
|
556308
556624
|
),
|
|
556309
556625
|
visibleTodos.map((todo, index) => renderTodoLine(todo, index))
|
|
@@ -556316,6 +556632,7 @@ var init_TodoTree = __esm({
|
|
|
556316
556632
|
import_react104 = __toESM(require_react(), 1);
|
|
556317
556633
|
await init_build2();
|
|
556318
556634
|
init_source();
|
|
556635
|
+
init_i18n();
|
|
556319
556636
|
init_ThemeContext();
|
|
556320
556637
|
}
|
|
556321
556638
|
});
|
|
@@ -556655,7 +556972,7 @@ function ChatFooter(props) {
|
|
|
556655
556972
|
!props.showReviewCommitPanel && import_react106.default.createElement(
|
|
556656
556973
|
import_react106.default.Fragment,
|
|
556657
556974
|
null,
|
|
556658
|
-
import_react106.default.createElement(ChatInput, { onSubmit: props.onSubmit, onCommand: props.onCommand, placeholder: t.chatScreen.inputPlaceholder, disabled: props.disabled, disableKeyboardNavigation: props.showBackgroundPanel, isProcessing: props.isProcessing, chatHistory: props.chatHistory, onHistorySelect: props.handleHistorySelect, yoloMode: props.yoloMode, setYoloMode: props.setYoloMode, planMode: props.planMode, setPlanMode: props.setPlanMode, vulnerabilityHuntingMode: props.vulnerabilityHuntingMode, setVulnerabilityHuntingMode: props.setVulnerabilityHuntingMode, contextUsage: props.contextUsage, initialContent: props.initialContent, onContextPercentageChange: props.onContextPercentageChange, showProfilePicker: props.showProfilePicker, setShowProfilePicker: props.setShowProfilePicker, profileSelectedIndex: props.profileSelectedIndex, setProfileSelectedIndex: props.setProfileSelectedIndex, getFilteredProfiles: props.getFilteredProfiles, handleProfileSelect: props.handleProfileSelect, profileSearchQuery: props.profileSearchQuery, setProfileSearchQuery: props.setProfileSearchQuery, onSwitchProfile: props.onSwitchProfile }),
|
|
556975
|
+
import_react106.default.createElement(ChatInput, { onSubmit: props.onSubmit, onCommand: props.onCommand, placeholder: t.chatScreen.inputPlaceholder, disabled: props.disabled, disableKeyboardNavigation: props.showBackgroundPanel, isProcessing: props.isProcessing, chatHistory: props.chatHistory, onHistorySelect: props.handleHistorySelect, yoloMode: props.yoloMode, setYoloMode: props.setYoloMode, planMode: props.planMode, setPlanMode: props.setPlanMode, vulnerabilityHuntingMode: props.vulnerabilityHuntingMode, setVulnerabilityHuntingMode: props.setVulnerabilityHuntingMode, contextUsage: props.contextUsage, initialContent: props.initialContent, draftContent: props.draftContent, onDraftChange: props.onDraftChange, onContextPercentageChange: props.onContextPercentageChange, showProfilePicker: props.showProfilePicker, setShowProfilePicker: props.setShowProfilePicker, profileSelectedIndex: props.profileSelectedIndex, setProfileSelectedIndex: props.setProfileSelectedIndex, getFilteredProfiles: props.getFilteredProfiles, handleProfileSelect: props.handleProfileSelect, profileSearchQuery: props.profileSearchQuery, setProfileSearchQuery: props.setProfileSearchQuery, onSwitchProfile: props.onSwitchProfile }),
|
|
556659
556976
|
showTodos && todos.length > 0 && import_react106.default.createElement(
|
|
556660
556977
|
Box_default,
|
|
556661
556978
|
{ marginTop: 1 },
|
|
@@ -556721,6 +557038,7 @@ var init_ChatFooter = __esm({
|
|
|
556721
557038
|
// dist/ui/components/chat/PendingMessages.js
|
|
556722
557039
|
function PendingMessages({ pendingMessages }) {
|
|
556723
557040
|
const { theme: theme14 } = useTheme();
|
|
557041
|
+
const { t } = useI18n();
|
|
556724
557042
|
if (pendingMessages.length === 0) {
|
|
556725
557043
|
return null;
|
|
556726
557044
|
}
|
|
@@ -556730,7 +557048,8 @@ function PendingMessages({ pendingMessages }) {
|
|
|
556730
557048
|
import_react107.default.createElement(
|
|
556731
557049
|
Text,
|
|
556732
557050
|
{ color: theme14.colors.warning, bold: true },
|
|
556733
|
-
|
|
557051
|
+
t.chatScreen.pendingMessagesTitle,
|
|
557052
|
+
" (",
|
|
556734
557053
|
pendingMessages.length,
|
|
556735
557054
|
")"
|
|
556736
557055
|
),
|
|
@@ -556758,15 +557077,14 @@ function PendingMessages({ pendingMessages }) {
|
|
|
556758
557077
|
import_react107.default.createElement(
|
|
556759
557078
|
Text,
|
|
556760
557079
|
{ color: theme14.colors.menuSecondary, dimColor: true },
|
|
556761
|
-
"\u2514\u2500
|
|
556762
|
-
|
|
556763
|
-
"
|
|
556764
|
-
message.images.length > 1 ? "s" : "",
|
|
556765
|
-
" attached"
|
|
557080
|
+
"\u2514\u2500",
|
|
557081
|
+
" ",
|
|
557082
|
+
t.chatScreen.pendingMessagesImagesAttached.replace("{count}", String(message.images.length))
|
|
556766
557083
|
)
|
|
556767
557084
|
)
|
|
556768
557085
|
)),
|
|
556769
|
-
import_react107.default.createElement(Text, { color: theme14.colors.warning, dimColor: true },
|
|
557086
|
+
import_react107.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, t.chatScreen.pendingMessagesFooter),
|
|
557087
|
+
import_react107.default.createElement(Text, { color: theme14.colors.warning, dimColor: true }, t.chatScreen.pendingMessagesEscHint)
|
|
556770
557088
|
);
|
|
556771
557089
|
}
|
|
556772
557090
|
var import_react107;
|
|
@@ -556776,6 +557094,7 @@ var init_PendingMessages = __esm({
|
|
|
556776
557094
|
import_react107 = __toESM(require_react(), 1);
|
|
556777
557095
|
await init_build2();
|
|
556778
557096
|
init_ThemeContext();
|
|
557097
|
+
init_i18n();
|
|
556779
557098
|
}
|
|
556780
557099
|
});
|
|
556781
557100
|
|
|
@@ -556962,26 +557281,43 @@ function formatArgumentsAsTree(args2, toolName) {
|
|
|
556962
557281
|
excludeFields.add("context");
|
|
556963
557282
|
excludeFields.add("signature");
|
|
556964
557283
|
}
|
|
556965
|
-
const noTruncateFields = /* @__PURE__ */ new Set();
|
|
556966
|
-
if (toolName === "terminal-execute") {
|
|
556967
|
-
noTruncateFields.add("command");
|
|
556968
|
-
}
|
|
556969
557284
|
const keys2 = Object.keys(args2).filter((key) => !excludeFields.has(key));
|
|
556970
557285
|
return keys2.map((key, index) => ({
|
|
556971
557286
|
key,
|
|
556972
|
-
value: formatArgumentValue(args2[key], 100,
|
|
557287
|
+
value: formatArgumentValue(args2[key], 100, false),
|
|
556973
557288
|
isLast: index === keys2.length - 1
|
|
556974
557289
|
}));
|
|
556975
557290
|
}
|
|
556976
557291
|
function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm, onHookError }) {
|
|
556977
|
-
var _a21
|
|
557292
|
+
var _a21;
|
|
556978
557293
|
const { theme: theme14 } = useTheme();
|
|
556979
557294
|
const { t } = useI18n();
|
|
557295
|
+
const { stdout } = use_stdout_default();
|
|
557296
|
+
const [terminalColumns, setTerminalColumns] = (0, import_react110.useState)((stdout == null ? void 0 : stdout.columns) ?? process.stdout.columns ?? 80);
|
|
557297
|
+
(0, import_react110.useEffect)(() => {
|
|
557298
|
+
var _a22;
|
|
557299
|
+
const next = (stdout == null ? void 0 : stdout.columns) ?? process.stdout.columns;
|
|
557300
|
+
if (typeof next === "number") {
|
|
557301
|
+
setTerminalColumns(next);
|
|
557302
|
+
}
|
|
557303
|
+
const handler = () => {
|
|
557304
|
+
const cols = (stdout == null ? void 0 : stdout.columns) ?? process.stdout.columns;
|
|
557305
|
+
if (typeof cols === "number") {
|
|
557306
|
+
setTerminalColumns(cols);
|
|
557307
|
+
}
|
|
557308
|
+
};
|
|
557309
|
+
(_a22 = stdout == null ? void 0 : stdout.on) == null ? void 0 : _a22.call(stdout, "resize", handler);
|
|
557310
|
+
return () => {
|
|
557311
|
+
var _a23;
|
|
557312
|
+
(_a23 = stdout == null ? void 0 : stdout.off) == null ? void 0 : _a23.call(stdout, "resize", handler);
|
|
557313
|
+
};
|
|
557314
|
+
}, [stdout]);
|
|
556980
557315
|
const [hasSelected, setHasSelected] = (0, import_react110.useState)(false);
|
|
556981
557316
|
const [showRejectInput, setShowRejectInput] = (0, import_react110.useState)(false);
|
|
556982
557317
|
const [rejectReason, setRejectReason] = (0, import_react110.useState)("");
|
|
556983
557318
|
const [menuKey, setMenuKey] = (0, import_react110.useState)(0);
|
|
556984
557319
|
const [initialMenuIndex, setInitialMenuIndex] = (0, import_react110.useState)(0);
|
|
557320
|
+
const [commandPageOffset, setCommandPageOffset] = (0, import_react110.useState)(0);
|
|
556985
557321
|
const sensitiveCommandCheck = (0, import_react110.useMemo)(() => {
|
|
556986
557322
|
if (toolName !== "terminal-execute" || !toolArguments) {
|
|
556987
557323
|
return { isSensitive: false };
|
|
@@ -557006,6 +557342,45 @@ function ToolConfirmation({ toolName, toolArguments, allTools, onConfirm, onHook
|
|
|
557006
557342
|
return null;
|
|
557007
557343
|
}
|
|
557008
557344
|
}, [toolArguments, toolName]);
|
|
557345
|
+
const terminalCommand = (0, import_react110.useMemo)(() => {
|
|
557346
|
+
if (toolName !== "terminal-execute" || !toolArguments) {
|
|
557347
|
+
return null;
|
|
557348
|
+
}
|
|
557349
|
+
try {
|
|
557350
|
+
const parsed = JSON.parse(toolArguments);
|
|
557351
|
+
const command = parsed.command;
|
|
557352
|
+
return typeof command === "string" ? command : null;
|
|
557353
|
+
} catch {
|
|
557354
|
+
return null;
|
|
557355
|
+
}
|
|
557356
|
+
}, [toolName, toolArguments]);
|
|
557357
|
+
(0, import_react110.useEffect)(() => {
|
|
557358
|
+
setCommandPageOffset(0);
|
|
557359
|
+
}, [terminalCommand]);
|
|
557360
|
+
const commandPager = (0, import_react110.useMemo)(() => {
|
|
557361
|
+
if (!terminalCommand)
|
|
557362
|
+
return null;
|
|
557363
|
+
const maxLines = 3;
|
|
557364
|
+
const reserved = 24;
|
|
557365
|
+
const lineWidth = Math.max(20, terminalColumns - reserved);
|
|
557366
|
+
const windowChars = lineWidth * maxLines;
|
|
557367
|
+
const totalPages = Math.max(1, Math.ceil(terminalCommand.length / windowChars));
|
|
557368
|
+
const normalizedOffset = totalPages <= 1 ? 0 : (commandPageOffset % (totalPages * windowChars) + totalPages * windowChars) % (totalPages * windowChars);
|
|
557369
|
+
const slice2 = terminalCommand.slice(normalizedOffset, normalizedOffset + windowChars);
|
|
557370
|
+
const lines = [];
|
|
557371
|
+
for (let i = 0; i < maxLines; i++) {
|
|
557372
|
+
lines.push(slice2.slice(i * lineWidth, (i + 1) * lineWidth));
|
|
557373
|
+
}
|
|
557374
|
+
return {
|
|
557375
|
+
lines,
|
|
557376
|
+
maxLines,
|
|
557377
|
+
lineWidth,
|
|
557378
|
+
windowChars,
|
|
557379
|
+
totalPages,
|
|
557380
|
+
pageIndex: Math.floor(normalizedOffset / windowChars) + 1,
|
|
557381
|
+
canPage: totalPages > 1
|
|
557382
|
+
};
|
|
557383
|
+
}, [terminalCommand, commandPageOffset, terminalColumns]);
|
|
557009
557384
|
(0, import_react110.useEffect)(() => {
|
|
557010
557385
|
const context2 = {
|
|
557011
557386
|
toolName,
|
|
@@ -557177,6 +557552,10 @@ Output: ${combinedOutput}`);
|
|
|
557177
557552
|
return baseItems;
|
|
557178
557553
|
}, [sensitiveCommandCheck.isSensitive, t]);
|
|
557179
557554
|
use_input_default((_input, key) => {
|
|
557555
|
+
if (key.tab && !hasSelected && !showRejectInput && toolName === "terminal-execute" && (commandPager == null ? void 0 : commandPager.canPage)) {
|
|
557556
|
+
setCommandPageOffset((prev) => prev + commandPager.windowChars);
|
|
557557
|
+
return;
|
|
557558
|
+
}
|
|
557180
557559
|
if (showRejectInput && key.escape) {
|
|
557181
557560
|
setShowRejectInput(false);
|
|
557182
557561
|
setRejectReason("");
|
|
@@ -557244,17 +557623,6 @@ Output: ${combinedOutput}`);
|
|
|
557244
557623
|
" "
|
|
557245
557624
|
),
|
|
557246
557625
|
import_react110.default.createElement(Text, { color: "magenta", bold: true }, (_a21 = sensitiveCommandCheck.matchedCommand) == null ? void 0 : _a21.pattern)
|
|
557247
|
-
),
|
|
557248
|
-
import_react110.default.createElement(
|
|
557249
|
-
Box_default,
|
|
557250
|
-
{ marginTop: 0 },
|
|
557251
|
-
import_react110.default.createElement(
|
|
557252
|
-
Text,
|
|
557253
|
-
{ dimColor: true },
|
|
557254
|
-
t.toolConfirmation.reason,
|
|
557255
|
-
" "
|
|
557256
|
-
),
|
|
557257
|
-
import_react110.default.createElement(Text, { color: "white" }, (_b14 = sensitiveCommandCheck.matchedCommand) == null ? void 0 : _b14.description)
|
|
557258
557626
|
)
|
|
557259
557627
|
),
|
|
557260
557628
|
import_react110.default.createElement(
|
|
@@ -557263,7 +557631,7 @@ Output: ${combinedOutput}`);
|
|
|
557263
557631
|
import_react110.default.createElement(Text, { color: theme14.colors.warning, italic: true }, t.toolConfirmation.requiresConfirmation)
|
|
557264
557632
|
)
|
|
557265
557633
|
),
|
|
557266
|
-
formattedArgs && formattedArgs.length > 0 && import_react110.default.createElement(
|
|
557634
|
+
toolName !== "terminal-execute" && formattedArgs && formattedArgs.length > 0 && import_react110.default.createElement(
|
|
557267
557635
|
Box_default,
|
|
557268
557636
|
{ flexDirection: "column", marginBottom: 1 },
|
|
557269
557637
|
import_react110.default.createElement(Text, { dimColor: true }, t.toolConfirmation.arguments),
|
|
@@ -557281,6 +557649,19 @@ Output: ${combinedOutput}`);
|
|
|
557281
557649
|
import_react110.default.createElement(Text, { color: "white" }, arg.value)
|
|
557282
557650
|
)
|
|
557283
557651
|
))
|
|
557652
|
+
),
|
|
557653
|
+
toolName === "terminal-execute" && commandPager && import_react110.default.createElement(
|
|
557654
|
+
Box_default,
|
|
557655
|
+
{ flexDirection: "column", marginBottom: 1 },
|
|
557656
|
+
import_react110.default.createElement(
|
|
557657
|
+
Text,
|
|
557658
|
+
{ dimColor: true },
|
|
557659
|
+
t.toolConfirmation.commandPagerTitle,
|
|
557660
|
+
" ",
|
|
557661
|
+
import_react110.default.createElement(Text, { color: theme14.colors.menuInfo }, t.toolConfirmation.commandPagerStatus.replace("{page}", String(commandPager.pageIndex)).replace("{total}", String(commandPager.totalPages)))
|
|
557662
|
+
),
|
|
557663
|
+
import_react110.default.createElement(Box_default, { flexDirection: "column", paddingLeft: 2 }, commandPager.lines.map((line, idx2) => import_react110.default.createElement(Text, { key: idx2, color: "white", wrap: "truncate" }, line))),
|
|
557664
|
+
commandPager.canPage && import_react110.default.createElement(Text, { dimColor: true }, t.toolConfirmation.commandPagerHint)
|
|
557284
557665
|
)
|
|
557285
557666
|
),
|
|
557286
557667
|
formattedAllTools && import_react110.default.createElement(
|
|
@@ -564926,7 +565307,7 @@ async function handleConversationWithTools(options3) {
|
|
|
564926
565307
|
});
|
|
564927
565308
|
const uiMsg = {
|
|
564928
565309
|
role: "subagent",
|
|
564929
|
-
content: `\x1B[
|
|
565310
|
+
content: `\x1B[36m\u2687 ${subAgentMessage.agentName}\x1B[0m${toolLines.join("")}`,
|
|
564930
565311
|
streaming: false,
|
|
564931
565312
|
subAgent: {
|
|
564932
565313
|
agentId: subAgentMessage.agentId,
|
|
@@ -565022,6 +565403,7 @@ async function handleConversationWithTools(options3) {
|
|
|
565022
565403
|
role: "subagent",
|
|
565023
565404
|
content: `\x1B[38;2;0;186;255m\u2687${statusIcon} ${msg.tool_name}\x1B[0m${statusText}`,
|
|
565024
565405
|
streaming: false,
|
|
565406
|
+
messageStatus: isError2 ? "error" : "success",
|
|
565025
565407
|
toolResult: !isError2 ? msg.content : void 0,
|
|
565026
565408
|
terminalResult: terminalResultData,
|
|
565027
565409
|
toolCall: terminalResultData ? {
|
|
@@ -565042,6 +565424,7 @@ async function handleConversationWithTools(options3) {
|
|
|
565042
565424
|
role: "subagent",
|
|
565043
565425
|
content: `\x1B[38;2;255;100;100m\u2687\u2717 ${msg.tool_name}\x1B[0m`,
|
|
565044
565426
|
streaming: false,
|
|
565427
|
+
messageStatus: "error",
|
|
565045
565428
|
subAgent: {
|
|
565046
565429
|
agentId: subAgentMessage.agentId,
|
|
565047
565430
|
agentName: subAgentMessage.agentName,
|
|
@@ -569725,9 +570108,11 @@ ${errorMsg}`,
|
|
|
569725
570108
|
await codebaseAgentRef.current.stop();
|
|
569726
570109
|
codebaseAgentRef.current.stopWatching();
|
|
569727
570110
|
codebaseAgentRef.current = null;
|
|
569728
|
-
setCodebaseIndexing(false);
|
|
569729
|
-
setWatcherEnabled(false);
|
|
569730
570111
|
}
|
|
570112
|
+
setCodebaseIndexing(false);
|
|
570113
|
+
setWatcherEnabled(false);
|
|
570114
|
+
setCodebaseProgress(null);
|
|
570115
|
+
setFileUpdateNotification(null);
|
|
569731
570116
|
}
|
|
569732
570117
|
};
|
|
569733
570118
|
const handleReviewCommitConfirm = async (selection, notes) => {
|
|
@@ -570643,6 +571028,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
570643
571028
|
const [compressionError, setCompressionError] = (0, import_react139.useState)(null);
|
|
570644
571029
|
const [showPermissionsPanel, setShowPermissionsPanel] = (0, import_react139.useState)(false);
|
|
570645
571030
|
const [restoreInputContent, setRestoreInputContent] = (0, import_react139.useState)(null);
|
|
571031
|
+
const [inputDraftContent, setInputDraftContent] = (0, import_react139.useState)(null);
|
|
570646
571032
|
const [bashSensitiveCommand, setBashSensitiveCommand] = (0, import_react139.useState)(null);
|
|
570647
571033
|
const [suppressLoadingIndicator, setSuppressLoadingIndicator] = (0, import_react139.useState)(false);
|
|
570648
571034
|
const hadBashSensitiveCommandRef = (0, import_react139.useRef)(false);
|
|
@@ -570884,7 +571270,10 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
570884
571270
|
global.__stopCodebaseIndexing = async () => {
|
|
570885
571271
|
if (codebaseAgentRef.current) {
|
|
570886
571272
|
await codebaseAgentRef.current.stop();
|
|
571273
|
+
codebaseAgentRef.current.stopWatching();
|
|
570887
571274
|
setCodebaseIndexing(false);
|
|
571275
|
+
setWatcherEnabled(false);
|
|
571276
|
+
setCodebaseProgress(null);
|
|
570888
571277
|
}
|
|
570889
571278
|
};
|
|
570890
571279
|
return () => {
|
|
@@ -571151,7 +571540,6 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
571151
571540
|
};
|
|
571152
571541
|
}, [streamingState]);
|
|
571153
571542
|
use_input_default((input2, key) => {
|
|
571154
|
-
var _a21;
|
|
571155
571543
|
if (backgroundProcesses.showPanel) {
|
|
571156
571544
|
if (key.escape) {
|
|
571157
571545
|
backgroundProcesses.hidePanel();
|
|
@@ -571220,25 +571608,26 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
571220
571608
|
return;
|
|
571221
571609
|
}
|
|
571222
571610
|
if (key.escape && streamingState.isStreaming && streamingState.abortController && hasFocus) {
|
|
571611
|
+
if (pendingMessages.length > 0) {
|
|
571612
|
+
const mergedText = pendingMessages.map((m) => (m.text || "").trim()).filter(Boolean).join("\n\n");
|
|
571613
|
+
const mergedImages = pendingMessages.flatMap((m) => m.images ?? []);
|
|
571614
|
+
setRestoreInputContent({
|
|
571615
|
+
text: mergedText,
|
|
571616
|
+
images: mergedImages.length > 0 ? mergedImages.map((img) => ({
|
|
571617
|
+
type: "image",
|
|
571618
|
+
data: img.data,
|
|
571619
|
+
mimeType: img.mimeType
|
|
571620
|
+
})) : void 0
|
|
571621
|
+
});
|
|
571622
|
+
setPendingMessages([]);
|
|
571623
|
+
return;
|
|
571624
|
+
}
|
|
571223
571625
|
userInterruptedRef.current = true;
|
|
571224
571626
|
streamingState.setIsStopping(true);
|
|
571225
571627
|
streamingState.setRetryStatus(null);
|
|
571226
571628
|
streamingState.setCodebaseSearchStatus(null);
|
|
571227
571629
|
streamingState.abortController.abort();
|
|
571228
571630
|
setMessages((prev) => prev.filter((msg) => !msg.toolPending));
|
|
571229
|
-
if (pendingMessages.length > 0) {
|
|
571230
|
-
const firstPending = pendingMessages[0];
|
|
571231
|
-
if (firstPending) {
|
|
571232
|
-
setRestoreInputContent({
|
|
571233
|
-
text: firstPending.text,
|
|
571234
|
-
images: (_a21 = firstPending.images) == null ? void 0 : _a21.map((img) => ({
|
|
571235
|
-
type: "image",
|
|
571236
|
-
data: img.data,
|
|
571237
|
-
mimeType: img.mimeType
|
|
571238
|
-
}))
|
|
571239
|
-
});
|
|
571240
|
-
}
|
|
571241
|
-
}
|
|
571242
571631
|
setPendingMessages([]);
|
|
571243
571632
|
}
|
|
571244
571633
|
});
|
|
@@ -571424,7 +571813,7 @@ function ChatScreen({ autoResume, enableYolo, enablePlan }) {
|
|
|
571424
571813
|
cacheCreationTokens: streamingState.contextUsage.cache_creation_input_tokens,
|
|
571425
571814
|
cacheReadTokens: streamingState.contextUsage.cache_read_input_tokens,
|
|
571426
571815
|
cachedTokens: streamingState.contextUsage.cached_tokens
|
|
571427
|
-
} : void 0, initialContent: restoreInputContent, onContextPercentageChange: setCurrentContextPercentage, showProfilePicker: panelState.showProfilePanel, setShowProfilePicker: panelState.setShowProfilePanel, profileSelectedIndex: panelState.profileSelectedIndex, setProfileSelectedIndex: panelState.setProfileSelectedIndex, getFilteredProfiles: () => {
|
|
571816
|
+
} : void 0, initialContent: restoreInputContent, draftContent: inputDraftContent, onDraftChange: setInputDraftContent, onContextPercentageChange: setCurrentContextPercentage, showProfilePicker: panelState.showProfilePanel, setShowProfilePicker: panelState.setShowProfilePanel, profileSelectedIndex: panelState.profileSelectedIndex, setProfileSelectedIndex: panelState.setProfileSelectedIndex, getFilteredProfiles: () => {
|
|
571428
571817
|
const allProfiles = getAllProfiles();
|
|
571429
571818
|
const query = panelState.profileSearchQuery.toLowerCase();
|
|
571430
571819
|
const currentName = panelState.currentProfileName;
|
package/bundle/package.json
CHANGED