pybao-cli 1.5.5 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/REPL-S2UEVXWF.js +49 -0
- package/dist/{acp-5ATLRHLF.js → acp-3KRM4YMC.js} +30 -30
- package/dist/{agentsValidate-DZS6QRHL.js → agentsValidate-T6E3S4SD.js} +7 -7
- package/dist/{ask-4737XORX.js → ask-OT3N6WUV.js} +29 -29
- package/dist/{autoUpdater-N3ZBYLEL.js → autoUpdater-MBTYMKZZ.js} +3 -3
- package/dist/{chunk-YVAHZVKG.js → chunk-2DY7NKZY.js} +3 -3
- package/dist/{chunk-YPKIYICA.js → chunk-33HCNVDW.js} +2 -2
- package/dist/{chunk-GR4JDEVQ.js → chunk-5TPUQEB7.js} +3 -3
- package/dist/{chunk-OD44XENK.js → chunk-63RVOHFS.js} +1 -1
- package/dist/{chunk-OD44XENK.js.map → chunk-63RVOHFS.js.map} +1 -1
- package/dist/{chunk-TEC2E3XN.js → chunk-6MZDAIOV.js} +2 -2
- package/dist/{chunk-DRHHYVCW.js → chunk-AKLGEOKM.js} +172 -72
- package/dist/chunk-AKLGEOKM.js.map +7 -0
- package/dist/{chunk-RAGFOLYJ.js → chunk-BKG4N5U7.js} +1 -1
- package/dist/{chunk-334FYYPK.js → chunk-BRDQQ6DH.js} +2 -2
- package/dist/{chunk-WZMYF3UX.js → chunk-CXLPIXKP.js} +2 -2
- package/dist/{chunk-3EXYSVHB.js → chunk-DM2LV6T7.js} +4 -4
- package/dist/{chunk-LIWSSSFH.js → chunk-DTWSIMGF.js} +2 -2
- package/dist/{chunk-HOPQEHPL.js → chunk-FZEVFEDH.js} +1 -1
- package/dist/{chunk-RGKCFZJC.js → chunk-GKFPN3PD.js} +1 -1
- package/dist/{chunk-6LPSL7BE.js → chunk-GPSHYLDR.js} +1 -1
- package/dist/{chunk-5XJMA67J.js → chunk-HV4AL2VG.js} +1 -1
- package/dist/{chunk-K6JHXMXN.js → chunk-KO6ENKTQ.js} +3 -3
- package/dist/{chunk-ZRKIN5IB.js → chunk-L3QFTUHN.js} +3 -3
- package/dist/{chunk-5SIMKDX4.js → chunk-LMTF4FXH.js} +2 -2
- package/dist/{chunk-DXRP66I5.js → chunk-MLZYATJX.js} +1 -1
- package/dist/{chunk-5UMUKAAM.js → chunk-NM5GLMVH.js} +1 -1
- package/dist/{chunk-K6NWBOPY.js → chunk-PCSIH35L.js} +1 -1
- package/dist/{chunk-CHIAWBUA.js → chunk-QD4OU22C.js} +3 -3
- package/dist/{chunk-SSJEKON3.js → chunk-RPIILAZ5.js} +4 -4
- package/dist/{chunk-SIERUHXD.js → chunk-SIE7VHSI.js} +185 -53
- package/dist/chunk-SIE7VHSI.js.map +7 -0
- package/dist/{chunk-K7WUKXHI.js → chunk-TN4TZY7G.js} +2 -2
- package/dist/{chunk-LJ5LSGNH.js → chunk-VDIUCVWJ.js} +3 -3
- package/dist/{chunk-XYTFEOBP.js → chunk-WTF7JOIQ.js} +4 -4
- package/dist/{chunk-UOMNQX6X.js → chunk-X7PDG4FB.js} +1 -1
- package/dist/{chunk-WABSMUT4.js → chunk-YSZEGC2L.js} +3 -3
- package/dist/{chunk-NVE4LCWO.js → chunk-ZUWPUBWZ.js} +1 -1
- package/dist/{chunk-HE7KJ6UH.js → chunk-ZXUQALBB.js} +4 -4
- package/dist/{cli-7LQML4MU.js → cli-F65QNC6S.js} +89 -89
- package/dist/commands-A6WCP2T2.js +53 -0
- package/dist/{config-75TKJIF7.js → config-TEBSBFSO.js} +4 -4
- package/dist/{context-DKI4ZOCF.js → context-T5NFLTK4.js} +6 -6
- package/dist/{conversationTracker-NB2PCUQP.js → conversationTracker-ZUJHBMDH.js} +3 -3
- package/dist/{customCommands-4D5NYHQV.js → customCommands-TBZ5RMJ5.js} +4 -4
- package/dist/{env-YOGE2U3I.js → env-3LH2POC2.js} +2 -2
- package/dist/{file-S4Y77ZDB.js → file-O7PWWVFS.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-Q23IAP4O.js → llm-OW7QDXPZ.js} +30 -30
- package/dist/{llmLazy-7DJ3Z3D6.js → llmLazy-CCD2PHFB.js} +1 -1
- package/dist/{loader-XVITQOFP.js → loader-RBCHNZJW.js} +4 -4
- package/dist/{lsp-F773RHZL.js → lsp-WAD7S2GA.js} +6 -6
- package/dist/{lspAnchor-UJC5DJXX.js → lspAnchor-B5AR4FPG.js} +6 -6
- package/dist/{mcp-CQWFQULD.js → mcp-5H5KKR2C.js} +7 -7
- package/dist/{mentionProcessor-MNKP2G6P.js → mentionProcessor-NK7NPMF2.js} +5 -5
- package/dist/{messages-HMXQVAKG.js → messages-DHHFMED7.js} +1 -1
- package/dist/{model-OGMQRRY5.js → model-XWJ23WCS.js} +5 -5
- package/dist/{openai-ZLOMELLL.js → openai-WAGWEANY.js} +5 -5
- package/dist/{outputStyles-TNK5GPGG.js → outputStyles-F6PPD3VU.js} +4 -4
- package/dist/{pluginRuntime-C6QS67LQ.js → pluginRuntime-BFIRISID.js} +6 -6
- package/dist/{pluginValidation-4SGPUOSV.js → pluginValidation-FDI5C7J7.js} +6 -6
- package/dist/prompts-XIY3JRPC.js +55 -0
- package/dist/{pybAgentSessionLoad-NHZ7Y2UJ.js → pybAgentSessionLoad-Z57EVSBX.js} +4 -4
- package/dist/{pybAgentSessionResume-3XYFO2NO.js → pybAgentSessionResume-74AWGCWV.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-H3AVVLPA.js → pybAgentStreamJsonSession-HVWGJB4Q.js} +1 -1
- package/dist/{pybHooks-JWJOTOPE.js → pybHooks-FZYE52XG.js} +4 -4
- package/dist/query-JWT6DB4G.js +57 -0
- package/dist/{registry-ZSUU43XZ.js → registry-FCKOLGU5.js} +5 -5
- package/dist/{ripgrep-K52QYYMD.js → ripgrep-MYG754KL.js} +3 -3
- package/dist/{skillMarketplace-JZDP6BFA.js → skillMarketplace-B5UZC4ES.js} +3 -3
- package/dist/{state-I4ULG2ZQ.js → state-SP4W7M4L.js} +2 -2
- package/dist/{theme-AZT4CHJW.js → theme-OZAWAG6W.js} +5 -5
- package/dist/{toolPermissionSettings-KPHZJ4NQ.js → toolPermissionSettings-S2WBKN66.js} +6 -6
- package/dist/tools-UE2MORVX.js +54 -0
- package/dist/{userInput-Y4I3F2FW.js → userInput-YJPISBP7.js} +31 -31
- package/package.json +1 -1
- package/dist/REPL-QYABP7JW.js +0 -49
- package/dist/chunk-DRHHYVCW.js.map +0 -7
- package/dist/chunk-SIERUHXD.js.map +0 -7
- package/dist/commands-5NMEFJO5.js +0 -53
- package/dist/prompts-RUCL6EM6.js +0 -55
- package/dist/query-U7X4LZ6Z.js +0 -57
- package/dist/tools-J3ZR5NYG.js +0 -54
- /package/dist/{REPL-QYABP7JW.js.map → REPL-S2UEVXWF.js.map} +0 -0
- /package/dist/{acp-5ATLRHLF.js.map → acp-3KRM4YMC.js.map} +0 -0
- /package/dist/{agentsValidate-DZS6QRHL.js.map → agentsValidate-T6E3S4SD.js.map} +0 -0
- /package/dist/{ask-4737XORX.js.map → ask-OT3N6WUV.js.map} +0 -0
- /package/dist/{autoUpdater-N3ZBYLEL.js.map → autoUpdater-MBTYMKZZ.js.map} +0 -0
- /package/dist/{chunk-YVAHZVKG.js.map → chunk-2DY7NKZY.js.map} +0 -0
- /package/dist/{chunk-YPKIYICA.js.map → chunk-33HCNVDW.js.map} +0 -0
- /package/dist/{chunk-GR4JDEVQ.js.map → chunk-5TPUQEB7.js.map} +0 -0
- /package/dist/{chunk-TEC2E3XN.js.map → chunk-6MZDAIOV.js.map} +0 -0
- /package/dist/{chunk-RAGFOLYJ.js.map → chunk-BKG4N5U7.js.map} +0 -0
- /package/dist/{chunk-334FYYPK.js.map → chunk-BRDQQ6DH.js.map} +0 -0
- /package/dist/{chunk-WZMYF3UX.js.map → chunk-CXLPIXKP.js.map} +0 -0
- /package/dist/{chunk-3EXYSVHB.js.map → chunk-DM2LV6T7.js.map} +0 -0
- /package/dist/{chunk-LIWSSSFH.js.map → chunk-DTWSIMGF.js.map} +0 -0
- /package/dist/{chunk-HOPQEHPL.js.map → chunk-FZEVFEDH.js.map} +0 -0
- /package/dist/{chunk-RGKCFZJC.js.map → chunk-GKFPN3PD.js.map} +0 -0
- /package/dist/{chunk-6LPSL7BE.js.map → chunk-GPSHYLDR.js.map} +0 -0
- /package/dist/{chunk-5XJMA67J.js.map → chunk-HV4AL2VG.js.map} +0 -0
- /package/dist/{chunk-K6JHXMXN.js.map → chunk-KO6ENKTQ.js.map} +0 -0
- /package/dist/{chunk-ZRKIN5IB.js.map → chunk-L3QFTUHN.js.map} +0 -0
- /package/dist/{chunk-5SIMKDX4.js.map → chunk-LMTF4FXH.js.map} +0 -0
- /package/dist/{chunk-DXRP66I5.js.map → chunk-MLZYATJX.js.map} +0 -0
- /package/dist/{chunk-5UMUKAAM.js.map → chunk-NM5GLMVH.js.map} +0 -0
- /package/dist/{chunk-K6NWBOPY.js.map → chunk-PCSIH35L.js.map} +0 -0
- /package/dist/{chunk-CHIAWBUA.js.map → chunk-QD4OU22C.js.map} +0 -0
- /package/dist/{chunk-SSJEKON3.js.map → chunk-RPIILAZ5.js.map} +0 -0
- /package/dist/{chunk-K7WUKXHI.js.map → chunk-TN4TZY7G.js.map} +0 -0
- /package/dist/{chunk-LJ5LSGNH.js.map → chunk-VDIUCVWJ.js.map} +0 -0
- /package/dist/{chunk-XYTFEOBP.js.map → chunk-WTF7JOIQ.js.map} +0 -0
- /package/dist/{chunk-UOMNQX6X.js.map → chunk-X7PDG4FB.js.map} +0 -0
- /package/dist/{chunk-WABSMUT4.js.map → chunk-YSZEGC2L.js.map} +0 -0
- /package/dist/{chunk-NVE4LCWO.js.map → chunk-ZUWPUBWZ.js.map} +0 -0
- /package/dist/{chunk-HE7KJ6UH.js.map → chunk-ZXUQALBB.js.map} +0 -0
- /package/dist/{cli-7LQML4MU.js.map → cli-F65QNC6S.js.map} +0 -0
- /package/dist/{commands-5NMEFJO5.js.map → commands-A6WCP2T2.js.map} +0 -0
- /package/dist/{config-75TKJIF7.js.map → config-TEBSBFSO.js.map} +0 -0
- /package/dist/{context-DKI4ZOCF.js.map → context-T5NFLTK4.js.map} +0 -0
- /package/dist/{conversationTracker-NB2PCUQP.js.map → conversationTracker-ZUJHBMDH.js.map} +0 -0
- /package/dist/{customCommands-4D5NYHQV.js.map → customCommands-TBZ5RMJ5.js.map} +0 -0
- /package/dist/{env-YOGE2U3I.js.map → env-3LH2POC2.js.map} +0 -0
- /package/dist/{file-S4Y77ZDB.js.map → file-O7PWWVFS.js.map} +0 -0
- /package/dist/{llm-Q23IAP4O.js.map → llm-OW7QDXPZ.js.map} +0 -0
- /package/dist/{llmLazy-7DJ3Z3D6.js.map → llmLazy-CCD2PHFB.js.map} +0 -0
- /package/dist/{loader-XVITQOFP.js.map → loader-RBCHNZJW.js.map} +0 -0
- /package/dist/{lsp-F773RHZL.js.map → lsp-WAD7S2GA.js.map} +0 -0
- /package/dist/{lspAnchor-UJC5DJXX.js.map → lspAnchor-B5AR4FPG.js.map} +0 -0
- /package/dist/{mcp-CQWFQULD.js.map → mcp-5H5KKR2C.js.map} +0 -0
- /package/dist/{mentionProcessor-MNKP2G6P.js.map → mentionProcessor-NK7NPMF2.js.map} +0 -0
- /package/dist/{messages-HMXQVAKG.js.map → messages-DHHFMED7.js.map} +0 -0
- /package/dist/{model-OGMQRRY5.js.map → model-XWJ23WCS.js.map} +0 -0
- /package/dist/{openai-ZLOMELLL.js.map → openai-WAGWEANY.js.map} +0 -0
- /package/dist/{outputStyles-TNK5GPGG.js.map → outputStyles-F6PPD3VU.js.map} +0 -0
- /package/dist/{pluginRuntime-C6QS67LQ.js.map → pluginRuntime-BFIRISID.js.map} +0 -0
- /package/dist/{pluginValidation-4SGPUOSV.js.map → pluginValidation-FDI5C7J7.js.map} +0 -0
- /package/dist/{prompts-RUCL6EM6.js.map → prompts-XIY3JRPC.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-NHZ7Y2UJ.js.map → pybAgentSessionLoad-Z57EVSBX.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-3XYFO2NO.js.map → pybAgentSessionResume-74AWGCWV.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-H3AVVLPA.js.map → pybAgentStreamJsonSession-HVWGJB4Q.js.map} +0 -0
- /package/dist/{pybHooks-JWJOTOPE.js.map → pybHooks-FZYE52XG.js.map} +0 -0
- /package/dist/{query-U7X4LZ6Z.js.map → query-JWT6DB4G.js.map} +0 -0
- /package/dist/{registry-ZSUU43XZ.js.map → registry-FCKOLGU5.js.map} +0 -0
- /package/dist/{ripgrep-K52QYYMD.js.map → ripgrep-MYG754KL.js.map} +0 -0
- /package/dist/{skillMarketplace-JZDP6BFA.js.map → skillMarketplace-B5UZC4ES.js.map} +0 -0
- /package/dist/{state-I4ULG2ZQ.js.map → state-SP4W7M4L.js.map} +0 -0
- /package/dist/{theme-AZT4CHJW.js.map → theme-OZAWAG6W.js.map} +0 -0
- /package/dist/{toolPermissionSettings-KPHZJ4NQ.js.map → toolPermissionSettings-S2WBKN66.js.map} +0 -0
- /package/dist/{tools-J3ZR5NYG.js.map → tools-UE2MORVX.js.map} +0 -0
- /package/dist/{userInput-Y4I3F2FW.js.map → userInput-YJPISBP7.js.map} +0 -0
|
@@ -41,57 +41,57 @@ import {
|
|
|
41
41
|
runWithTaskListEnv,
|
|
42
42
|
runWithTaskListId,
|
|
43
43
|
updateTask
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-SIE7VHSI.js";
|
|
45
45
|
import {
|
|
46
46
|
queryLLM
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-RPIILAZ5.js";
|
|
48
48
|
import {
|
|
49
49
|
FallbackToolUseRejectedMessage,
|
|
50
50
|
MCPTool,
|
|
51
51
|
getClients,
|
|
52
52
|
getMCPTools
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-ZXUQALBB.js";
|
|
54
54
|
import {
|
|
55
55
|
emitReminderEvent
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-LMTF4FXH.js";
|
|
57
57
|
import {
|
|
58
58
|
getActiveAgents,
|
|
59
59
|
getAgentByType,
|
|
60
60
|
getAvailableAgentTypes
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-6MZDAIOV.js";
|
|
62
62
|
import {
|
|
63
63
|
INTERRUPT_MESSAGE,
|
|
64
64
|
createAssistantMessage,
|
|
65
65
|
createUserMessage,
|
|
66
66
|
getLastAssistantMessageId
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-BKG4N5U7.js";
|
|
68
68
|
import {
|
|
69
69
|
formatDuration,
|
|
70
70
|
formatNumber
|
|
71
71
|
} from "./chunk-OUXHGDLH.js";
|
|
72
72
|
import {
|
|
73
73
|
getAbsolutePath
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-BRDQQ6DH.js";
|
|
75
75
|
import {
|
|
76
76
|
LspFacade,
|
|
77
77
|
formatDiagnosticsPretty
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-WTF7JOIQ.js";
|
|
79
79
|
import {
|
|
80
80
|
getModelManager
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-QD4OU22C.js";
|
|
82
82
|
import {
|
|
83
83
|
getContext
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-DM2LV6T7.js";
|
|
85
85
|
import {
|
|
86
86
|
filesToTree,
|
|
87
87
|
ripGrepWithStatus
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-ZUWPUBWZ.js";
|
|
89
89
|
import {
|
|
90
90
|
getTheme
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-NM5GLMVH.js";
|
|
92
92
|
import {
|
|
93
93
|
debug
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-X7PDG4FB.js";
|
|
95
95
|
import {
|
|
96
96
|
BunShell,
|
|
97
97
|
MEMORY_DIR,
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
overwriteLog,
|
|
104
104
|
readTaskOutput,
|
|
105
105
|
resolveXdgDataPath
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-GKFPN3PD.js";
|
|
107
107
|
|
|
108
108
|
// src/tools/index.ts
|
|
109
109
|
import { memoize as memoize2 } from "lodash-es";
|
|
@@ -782,7 +782,7 @@ async function analyzeOutputWithLsp(output, exitCode) {
|
|
|
782
782
|
if (exitCode !== 0 || errorCount > 0 || warningCount > 0) {
|
|
783
783
|
try {
|
|
784
784
|
const { isAbsolute: isAbsolute3, resolve: resolve4 } = await import("path");
|
|
785
|
-
const { getSessionRoot: getSessionRoot2 } = await import("./state-
|
|
785
|
+
const { getSessionRoot: getSessionRoot2 } = await import("./state-SP4W7M4L.js");
|
|
786
786
|
const lines = output.split("\n");
|
|
787
787
|
const uniqueFiles = /* @__PURE__ */ new Set();
|
|
788
788
|
const lspSuggestions = [];
|
|
@@ -1155,7 +1155,7 @@ var DeleteTool = {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
if (!force) {
|
|
1157
1157
|
try {
|
|
1158
|
-
const { LspFacade: LspFacade2 } = await import("./lsp-
|
|
1158
|
+
const { LspFacade: LspFacade2 } = await import("./lsp-WAD7S2GA.js");
|
|
1159
1159
|
const referenceDetail = await LspFacade2.checkFileReferences(fullPath);
|
|
1160
1160
|
if (referenceDetail) {
|
|
1161
1161
|
failedItems.push(
|
|
@@ -1327,38 +1327,110 @@ import { z as z5 } from "zod";
|
|
|
1327
1327
|
import { minimatch } from "minimatch";
|
|
1328
1328
|
|
|
1329
1329
|
// src/tools/lsTool/prompt.ts
|
|
1330
|
-
var DESCRIPTION3 =
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
1.
|
|
1334
|
-
2.
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
- Step
|
|
1340
|
-
- Step
|
|
1341
|
-
-
|
|
1342
|
-
|
|
1343
|
-
- \
|
|
1344
|
-
-
|
|
1345
|
-
|
|
1346
|
-
-
|
|
1347
|
-
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
-
|
|
1352
|
-
-
|
|
1353
|
-
-
|
|
1354
|
-
|
|
1355
|
-
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
-
|
|
1361
|
-
|
|
1330
|
+
var DESCRIPTION3 = `List a single-level directory structure with statistics for the specified path.
|
|
1331
|
+
|
|
1332
|
+
**Usage:**
|
|
1333
|
+
1. **Ignore Rules**: Use \`ignore\` to exclude noisy paths and reduce output. Common non-core directories/build artifacts/dependency caches (e.g., node_modules, dist) are ignored by default.
|
|
1334
|
+
2. **Directory Structure Info**: Outputs the specified directory structure with [Directory Structure Info] + [Top-Level Structure View] (single-level directories and top-level files).
|
|
1335
|
+
|
|
1336
|
+
**Search Strategy:**
|
|
1337
|
+
1. **Layered Exploration Mode**: Start from the root directory, drill
|
|
1338
|
+
down layer by layer.
|
|
1339
|
+
- Step 1: LS root directory to get top-level structure
|
|
1340
|
+
- Step 2: Analyze top-level structure, identify candidate directories(e.g., src/, app/, lib/)
|
|
1341
|
+
- Step 3: LS candidate directories layer by layer or use Glob to confirm paths
|
|
1342
|
+
2. **Complexity-Guided Strategy**: Choose strategy based on statistics.
|
|
1343
|
+
- Low complexity (low directory/file ratio, shallow depth) \u2192 can drill down directly
|
|
1344
|
+
- High complexity (high directory/file ratio, deep depth) \u2192 segmented exploration + Glob confirmation
|
|
1345
|
+
3. **Tool Collaboration**:
|
|
1346
|
+
- LS \u2192 Provides structural clues
|
|
1347
|
+
- Glob \u2192 Confirms path existence (e.g., src/* and src/*/)
|
|
1348
|
+
- Grep \u2192 Locates specific files or symbols
|
|
1349
|
+
|
|
1350
|
+
**Notes:**
|
|
1351
|
+
- Outputs only single-level directory structure and statistics by default.
|
|
1352
|
+
- path parameter must be an absolute path.
|
|
1353
|
+
- Path Source Constraint: When path is not user-provided, must first confirm parent directory exists using LS/Glob, then LS the subdirectory.
|
|
1354
|
+
info with statistics
|
|
1355
|
+
- As a directory entry point tool when deep analysis of codebase or functionality is needed, used in conjunction with Glob/Grep
|
|
1356
|
+
- As a directory entry point tool when exploring a new project for the first time
|
|
1357
|
+
- When lost in the filesystem or when results don't match expectations
|
|
1358
|
+
|
|
1359
|
+
**Applicable Scenarios:**
|
|
1360
|
+
- Quickly understand the single-level directory structure and file
|
|
1361
|
+
list information with statistics for a specified directory
|
|
1362
|
+
- As a directory entry point tool when deep analysis of codebase or
|
|
1363
|
+
functionality is needed, used in conjunction with Glob/Grep
|
|
1364
|
+
- As a directory entry point tool when exploring a new project for
|
|
1365
|
+
the first time
|
|
1366
|
+
- When lost in the filesystem or when results don't match actual
|
|
1367
|
+
requirements
|
|
1368
|
+
|
|
1369
|
+
**Typical Usage Examples:**
|
|
1370
|
+
|
|
1371
|
+
- Example 1: Deterministic - User Explicitly Requests Directory Overview
|
|
1372
|
+
<example>
|
|
1373
|
+
user: Show me the structure of src/components/
|
|
1374
|
+
assistant: [uses LS tool on src/components/]
|
|
1375
|
+
</example>
|
|
1376
|
+
|
|
1377
|
+
- Example 2: Deterministic - Confirm Path Existence
|
|
1378
|
+
Before Deep Search
|
|
1379
|
+
<example>
|
|
1380
|
+
user: Find all test files in src/auth/
|
|
1381
|
+
assistant: [uses LS tool on src/auth/ to confirm directory exists and understand structure]
|
|
1382
|
+
[uses Glob tool with pattern="**/*.test.ts"path="src/auth/"]
|
|
1383
|
+
</example>
|
|
1384
|
+
|
|
1385
|
+
- Example 3: Non-Deterministic - New Project Exploration (LS as Entry Point)
|
|
1386
|
+
<example>
|
|
1387
|
+
user: I'm new to this project, help me understand its structure
|
|
1388
|
+
assistant: [uses LS tool on project root to get top-level structure and complexity stats]
|
|
1389
|
+
[analyzes stats: low ratio \u2192 direct deep dive; high ratio \u2192 layered exploration with Glob]
|
|
1390
|
+
[uses LS on candidate directories (e.g., src/, app/,lib/) to identify modules]
|
|
1391
|
+
[uses Grep or Glob to locate specific files based on discovered structure]
|
|
1392
|
+
</example>
|
|
1393
|
+
|
|
1394
|
+
- Example 4: Non-Deterministic - Complexity-Guided Strategy Selection
|
|
1395
|
+
<example>
|
|
1396
|
+
user: Where is the main business logic?
|
|
1397
|
+
assistant: [uses LS tool on project root]
|
|
1398
|
+
[reads stats: totalDirectories/totalFiles ratio=0.8,maxDepth=5 \u2192 high complexity]
|
|
1399
|
+
[decision: use layered Glob instead of broad Grep]
|
|
1400
|
+
[uses Glob tool with pattern="src/**/*.ts" to narrow to source area]
|
|
1401
|
+
[uses Grep tool with pattern="class.*Service" path="src/" semantic: true]
|
|
1402
|
+
</example>
|
|
1403
|
+
|
|
1404
|
+
- Example 5: Collaboration - LS Confirms Scope for Grep
|
|
1405
|
+
<example>
|
|
1406
|
+
user: Search for "authenticate" in the API module
|
|
1407
|
+
assistant: [uses LS tool on src/ to identify if "api" directory exists]
|
|
1408
|
+
[uses LS tool on src/api/ to confirm subdirectory structure]
|
|
1409
|
+
[uses Grep tool with pattern="authenticate"path="src/api/"]
|
|
1410
|
+
</example>
|
|
1411
|
+
|
|
1412
|
+
- Example 6: Recovery - "Lost in Filesystem" Scenario
|
|
1413
|
+
<example>
|
|
1414
|
+
user: I searched but couldn't find the config files mentioned in docs
|
|
1415
|
+
assistant: [uses LS tool on current working directory to reorient]
|
|
1416
|
+
[uses LS tool on likely parent directories to trace expected path]
|
|
1417
|
+
[uses Glob tool with pattern="**/config*" based on LS-discovered structure]
|
|
1418
|
+
</example>
|
|
1419
|
+
|
|
1420
|
+
- Example 7: Parallel Confirmation for Multiple
|
|
1421
|
+
Candidates
|
|
1422
|
+
<example>
|
|
1423
|
+
user: Which directory contains the database layer?
|
|
1424
|
+
assistant: [uses LS tool on src/ to list top-level modules]
|
|
1425
|
+
[uses LS tool in parallel on src/db/, src/database/,src/data/ to identify which exists]
|
|
1426
|
+
[uses Grep tool with pattern="connection|pool" on the confirmed directory]
|
|
1427
|
+
</example>
|
|
1428
|
+
|
|
1429
|
+
**When NOT to Use LS:**
|
|
1430
|
+
- User provides exact file path \u2192 Use Read directly
|
|
1431
|
+
- User provides exact search pattern \u2192 Use Grep directly
|
|
1432
|
+
- User requests specific file type \u2192 Use Glob directly
|
|
1433
|
+
- Need to find files by content \u2192 Use Grep, not LS
|
|
1362
1434
|
`.trim();
|
|
1363
1435
|
|
|
1364
1436
|
// src/tools/lsTool/lsTool.tsx
|
|
@@ -1671,8 +1743,7 @@ import { z as z6 } from "zod";
|
|
|
1671
1743
|
|
|
1672
1744
|
// src/tools/search/LspTool/prompt.ts
|
|
1673
1745
|
var TOOL_NAME_FOR_PROMPT2 = "LSP";
|
|
1674
|
-
var PROMPT4 = `Interact with Language Server Protocol (LSP) servers to get code intelligence features.
|
|
1675
|
-
Supports 29+ languages including Python, Go, Rust, TypeScript, JavaScript, Bash, Java, C++, PHP, and more.
|
|
1746
|
+
var PROMPT4 = `Interact with Language Server Protocol (LSP) servers to get code intelligence features.Supports all languages.
|
|
1676
1747
|
|
|
1677
1748
|
## Capabilities & Scenarios
|
|
1678
1749
|
This tool acts as your "Code Analyst". Use it to understand the codebase semantically, rather than just matching text.
|
|
@@ -1708,32 +1779,61 @@ This tool acts as your "Code Analyst". Use it to understand the codebase semanti
|
|
|
1708
1779
|
- **Why**: It waits for the language server to re-analyze the file and returns fresh errors/warnings. This is your "Self-Correction" mechanism.
|
|
1709
1780
|
|
|
1710
1781
|
## Supported Operations
|
|
1711
|
-
|
|
1712
|
-
-
|
|
1713
|
-
|
|
1714
|
-
-
|
|
1715
|
-
-
|
|
1716
|
-
-
|
|
1717
|
-
-
|
|
1718
|
-
-
|
|
1719
|
-
-
|
|
1720
|
-
-
|
|
1721
|
-
-
|
|
1782
|
+
|
|
1783
|
+
### Location-Based Operations (require line + character)
|
|
1784
|
+
These 8 operations require precise symbol position:
|
|
1785
|
+
- \`goToDefinition\`: Find where a symbol is defined
|
|
1786
|
+
- \`findReferences\`: Find all references to a symbol
|
|
1787
|
+
- \`hover\`: Get hover information (documentation, type info) for a symbol
|
|
1788
|
+
- \`goToImplementation\`: Find implementations of an interface or abstract method
|
|
1789
|
+
- \`prepareCallHierarchy\`: Get call hierarchy item at a position (functions/methods)
|
|
1790
|
+
- \`incomingCalls\`: Find all functions/methods that call the function at a position
|
|
1791
|
+
- \`outgoingCalls\`: Find all functions/methods called by the function at a position
|
|
1792
|
+
- \`getScope\`: Get local variables and closure captures at a position
|
|
1793
|
+
|
|
1794
|
+
### Document-Level Operations (no position required)
|
|
1795
|
+
- \`documentSymbol\`: Get all symbols (functions, classes, variables) in a document
|
|
1796
|
+
- \`diagnostics\`: Get validation errors and warnings for a file (supports waiting for fresh results)
|
|
1797
|
+
|
|
1798
|
+
### Workspace-Level Operations
|
|
1799
|
+
- \`workspaceSymbol\`: Search for symbols across the entire workspace (requires query + scoped filePath)
|
|
1800
|
+
|
|
1801
|
+
## Parameters
|
|
1722
1802
|
|
|
1723
1803
|
All operations require:
|
|
1724
|
-
- filePath
|
|
1804
|
+
- \`filePath\`: The file or directory to operate on
|
|
1725
1805
|
|
|
1726
1806
|
Location-based operations require:
|
|
1727
|
-
- line
|
|
1728
|
-
- character
|
|
1729
|
-
|
|
1730
|
-
workspaceSymbol requires:
|
|
1731
|
-
- query
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
-
|
|
1735
|
-
-
|
|
1736
|
-
|
|
1807
|
+
- \`line\`: The line number (1-based, as shown in editors)
|
|
1808
|
+
- \`character\`: The character offset (1-based, as shown in editors)
|
|
1809
|
+
|
|
1810
|
+
\`workspaceSymbol\` requires:
|
|
1811
|
+
- \`query\`: The symbol name or keyword to search for
|
|
1812
|
+
|
|
1813
|
+
Optional:
|
|
1814
|
+
- \`waitForDiagnostics\`: If true, wait for fresh diagnostics (used with "diagnostics" operation)
|
|
1815
|
+
- \`timeout\`: Timeout in milliseconds for waiting operations (default: 5000)
|
|
1816
|
+
|
|
1817
|
+
## Intelligent Position Handling
|
|
1818
|
+
|
|
1819
|
+
**Do not pass a symbol name.** LSPTool works on positions, not names. Use Read to locate the symbol and derive line + character first.
|
|
1820
|
+
|
|
1821
|
+
### Auto-Adjustment Mechanism
|
|
1822
|
+
If the specified position is not on a valid symbol, the tool automatically searches for the nearest valid token:
|
|
1823
|
+
- **Search scope**: Current line, then previous line, then next line
|
|
1824
|
+
- **Priority**: Current line tokens are preferred (lower score)
|
|
1825
|
+
- **If no valid token found**: Returns an error message
|
|
1826
|
+
|
|
1827
|
+
### Best Practice for Position
|
|
1828
|
+
1. Use Read to open the file and locate the symbol
|
|
1829
|
+
2. Provide accurate 1-based line and character offset
|
|
1830
|
+
3. Position should be on the symbol name itself, not on keywords/operators
|
|
1831
|
+
4. If unsure, position at the start of the symbol name
|
|
1832
|
+
|
|
1833
|
+
## Workflow & Scope Guidelines
|
|
1834
|
+
- **Priority order**: documentSymbol \u2192 hotspot detection \u2192 Read \u2192 LSP (ensure line + character)
|
|
1835
|
+
- **workspaceSymbol**: Must provide scoped filePath (module or directory), avoid unbounded full-repo queries
|
|
1836
|
+
- **documentSymbol**: Uses LspFacade policy (LSP-first for accuracy, Tree-Sitter fallback for speed)
|
|
1737
1837
|
|
|
1738
1838
|
Note: LSP servers are automatically managed and installed for most languages. For system-level languages (like C++, Java), ensure the corresponding tools (clangd, jdtls) are in your PATH.`;
|
|
1739
1839
|
var DESCRIPTION4 = PROMPT4;
|