pybao-cli 1.3.90 → 1.3.92
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-FHAVYTOR.js +47 -0
- package/dist/{acp-NFNPLZWD.js → acp-WA34EP4Q.js} +29 -29
- package/dist/{agentsValidate-ZR3XRSKR.js → agentsValidate-77QXXTFH.js} +7 -7
- package/dist/{ask-GU6D2P2L.js → ask-25QZ7VL6.js} +28 -28
- package/dist/{autoUpdater-4IKBSL3R.js → autoUpdater-D3DOZCYZ.js} +3 -3
- package/dist/{chunk-5I3NGMYI.js → chunk-3EAW7NQW.js} +220 -86
- package/dist/chunk-3EAW7NQW.js.map +7 -0
- package/dist/{chunk-4JBR4ERG.js → chunk-4KXOAXLT.js} +2 -2
- package/dist/{chunk-BS6OG2Q2.js → chunk-4VZVUC7S.js} +3 -3
- package/dist/{chunk-GJOMTRVD.js → chunk-5D4LA7MX.js} +1 -1
- package/dist/{chunk-OJP6IDMT.js → chunk-6PYLF3ET.js} +4 -4
- package/dist/{chunk-S3OHCIOL.js → chunk-7JQ2O2O7.js} +3 -3
- package/dist/{chunk-JSJHGZAJ.js → chunk-B5HI7CIZ.js} +3 -3
- package/dist/{chunk-QH6MAXC2.js → chunk-BF3QQA6B.js} +4 -4
- package/dist/{chunk-CH3GOSXY.js → chunk-BHHLJAAX.js} +2 -2
- package/dist/{chunk-NSIDLRDC.js → chunk-BZJJX5ON.js} +1 -1
- package/dist/{chunk-2GNQ423S.js → chunk-CNQZQWGS.js} +2 -2
- package/dist/{chunk-JYYSYOTH.js → chunk-CX3J3ZM2.js} +1 -1
- package/dist/{chunk-VKVTOCU2.js → chunk-DHVVPKIB.js} +3 -3
- package/dist/{chunk-THH3BAIR.js → chunk-DUYRUANR.js} +1 -1
- package/dist/{chunk-6KWGNHDI.js → chunk-F5MBTGHO.js} +1 -1
- package/dist/{chunk-FDEOTFKS.js → chunk-HJTLI6VS.js} +3 -3
- package/dist/{chunk-47AQS2IE.js → chunk-KDL4PYX2.js} +1 -1
- package/dist/{chunk-OB3KNWFR.js → chunk-LS3G24MQ.js} +2 -2
- package/dist/{chunk-GHW7AKG7.js → chunk-MNN3BFEZ.js} +2 -2
- package/dist/{chunk-X2GIMPNL.js → chunk-NQOZPIZ3.js} +41 -28
- package/dist/chunk-NQOZPIZ3.js.map +7 -0
- package/dist/{chunk-ZV4DBQ6H.js → chunk-NVUSSOII.js} +649 -161
- package/dist/chunk-NVUSSOII.js.map +7 -0
- package/dist/{chunk-JJHY3UEU.js → chunk-POL6ZPVE.js} +3 -3
- package/dist/{chunk-XTGCEFKM.js → chunk-QFZQ4YIM.js} +2 -2
- package/dist/{chunk-GMBQWNBF.js → chunk-QYFEJFLG.js} +3 -3
- package/dist/{chunk-7V77A7PK.js → chunk-VUVKQMC5.js} +1 -1
- package/dist/{chunk-ZHCARYPU.js → chunk-X4SFGT4J.js} +1 -1
- package/dist/{chunk-YV3I6NYR.js → chunk-YIZ5ZIMX.js} +1 -1
- package/dist/{chunk-YV3I6NYR.js.map → chunk-YIZ5ZIMX.js.map} +1 -1
- package/dist/{chunk-7XTXGY66.js → chunk-YMVHPSJ4.js} +3 -3
- package/dist/{chunk-UKHXJNHY.js → chunk-Z66NVOKH.js} +1 -1
- package/dist/{chunk-LKJQF6EX.js → chunk-ZZVEO3HS.js} +2 -2
- package/dist/{cli-UTAK3OUR.js → cli-F4BJ2LO2.js} +87 -87
- package/dist/commands-HSOIWNZO.js +51 -0
- package/dist/{config-VAK73N3C.js → config-7T6GQHYO.js} +4 -4
- package/dist/{context-LITT7GWQ.js → context-FCGOJXLG.js} +5 -5
- package/dist/{customCommands-332BZCYL.js → customCommands-ZQCOLNAA.js} +4 -4
- package/dist/{env-X3OQREU5.js → env-YEMSVJMU.js} +2 -2
- package/dist/{file-YIJCUPIS.js → file-PBBVWSIC.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-ANFLVEGA.js → llm-N2EGKP4A.js} +29 -29
- package/dist/{llmLazy-6ATRXROW.js → llmLazy-M5HJDVWS.js} +1 -1
- package/dist/{loader-4MF6GGVQ.js → loader-3LUHCW5P.js} +4 -4
- package/dist/{lsp-HNYBUOM5.js → lsp-EIXOHBY2.js} +6 -6
- package/dist/{lspAnchor-NJ7QLPRP.js → lspAnchor-QTXVGYX4.js} +6 -6
- package/dist/{mcp-BQDMNBFE.js → mcp-65I2B7GH.js} +7 -7
- package/dist/{mentionProcessor-SI3EDF5D.js → mentionProcessor-MK4NRC65.js} +5 -5
- package/dist/{messages-T26ZAT7X.js → messages-IHFHMYSA.js} +1 -1
- package/dist/{model-KEEPGSL3.js → model-OJUT7KMM.js} +5 -5
- package/dist/{openai-4QY7PES4.js → openai-SZYDID6E.js} +5 -5
- package/dist/{outputStyles-KJQ22WMK.js → outputStyles-LASFU3IN.js} +4 -4
- package/dist/{pluginRuntime-ET2UJKNE.js → pluginRuntime-EE7QC4ZO.js} +6 -6
- package/dist/{pluginValidation-62D3RVRP.js → pluginValidation-RJH2VNIM.js} +6 -6
- package/dist/prompts-KXE7CM3Y.js +53 -0
- package/dist/{pybAgentSessionLoad-BT4UXNLK.js → pybAgentSessionLoad-ZHRRX5SH.js} +4 -4
- package/dist/{pybAgentSessionResume-OELIKRTW.js → pybAgentSessionResume-4BTZDUYL.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-4W33HAZH.js → pybAgentStreamJsonSession-R653JAD5.js} +1 -1
- package/dist/{pybHooks-3ZOPMDSW.js → pybHooks-PZO5PZ4Z.js} +4 -4
- package/dist/query-D4TTBO3G.js +59 -0
- package/dist/{registry-EIHFC2Y2.js → registry-IQEOGXFH.js} +5 -5
- package/dist/{ripgrep-QEAY6XBF.js → ripgrep-S37P6LBE.js} +3 -3
- package/dist/{skillMarketplace-RUKAENGF.js → skillMarketplace-KUSRKZUY.js} +3 -3
- package/dist/{state-HBF5REQ3.js → state-BPJBUEMP.js} +2 -2
- package/dist/{theme-IFSYSZ2G.js → theme-PHX4BKDY.js} +5 -5
- package/dist/{toolPermissionSettings-CJOHNAQD.js → toolPermissionSettings-HJFZDYFO.js} +6 -6
- package/dist/tools-ERFLE7MQ.js +52 -0
- package/dist/{userInput-IOAI64XA.js → userInput-CJWBEKXW.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-DGM3Y3KW.js +0 -47
- package/dist/chunk-5I3NGMYI.js.map +0 -7
- package/dist/chunk-X2GIMPNL.js.map +0 -7
- package/dist/chunk-ZV4DBQ6H.js.map +0 -7
- package/dist/commands-X7AF7Q6B.js +0 -51
- package/dist/prompts-UMP3KBTC.js +0 -53
- package/dist/query-6OHGKDQC.js +0 -55
- package/dist/tools-UQ6JYR3G.js +0 -52
- /package/dist/{REPL-DGM3Y3KW.js.map → REPL-FHAVYTOR.js.map} +0 -0
- /package/dist/{acp-NFNPLZWD.js.map → acp-WA34EP4Q.js.map} +0 -0
- /package/dist/{agentsValidate-ZR3XRSKR.js.map → agentsValidate-77QXXTFH.js.map} +0 -0
- /package/dist/{ask-GU6D2P2L.js.map → ask-25QZ7VL6.js.map} +0 -0
- /package/dist/{autoUpdater-4IKBSL3R.js.map → autoUpdater-D3DOZCYZ.js.map} +0 -0
- /package/dist/{chunk-4JBR4ERG.js.map → chunk-4KXOAXLT.js.map} +0 -0
- /package/dist/{chunk-BS6OG2Q2.js.map → chunk-4VZVUC7S.js.map} +0 -0
- /package/dist/{chunk-GJOMTRVD.js.map → chunk-5D4LA7MX.js.map} +0 -0
- /package/dist/{chunk-OJP6IDMT.js.map → chunk-6PYLF3ET.js.map} +0 -0
- /package/dist/{chunk-S3OHCIOL.js.map → chunk-7JQ2O2O7.js.map} +0 -0
- /package/dist/{chunk-JSJHGZAJ.js.map → chunk-B5HI7CIZ.js.map} +0 -0
- /package/dist/{chunk-QH6MAXC2.js.map → chunk-BF3QQA6B.js.map} +0 -0
- /package/dist/{chunk-CH3GOSXY.js.map → chunk-BHHLJAAX.js.map} +0 -0
- /package/dist/{chunk-NSIDLRDC.js.map → chunk-BZJJX5ON.js.map} +0 -0
- /package/dist/{chunk-2GNQ423S.js.map → chunk-CNQZQWGS.js.map} +0 -0
- /package/dist/{chunk-JYYSYOTH.js.map → chunk-CX3J3ZM2.js.map} +0 -0
- /package/dist/{chunk-VKVTOCU2.js.map → chunk-DHVVPKIB.js.map} +0 -0
- /package/dist/{chunk-THH3BAIR.js.map → chunk-DUYRUANR.js.map} +0 -0
- /package/dist/{chunk-6KWGNHDI.js.map → chunk-F5MBTGHO.js.map} +0 -0
- /package/dist/{chunk-FDEOTFKS.js.map → chunk-HJTLI6VS.js.map} +0 -0
- /package/dist/{chunk-47AQS2IE.js.map → chunk-KDL4PYX2.js.map} +0 -0
- /package/dist/{chunk-OB3KNWFR.js.map → chunk-LS3G24MQ.js.map} +0 -0
- /package/dist/{chunk-GHW7AKG7.js.map → chunk-MNN3BFEZ.js.map} +0 -0
- /package/dist/{chunk-JJHY3UEU.js.map → chunk-POL6ZPVE.js.map} +0 -0
- /package/dist/{chunk-XTGCEFKM.js.map → chunk-QFZQ4YIM.js.map} +0 -0
- /package/dist/{chunk-GMBQWNBF.js.map → chunk-QYFEJFLG.js.map} +0 -0
- /package/dist/{chunk-7V77A7PK.js.map → chunk-VUVKQMC5.js.map} +0 -0
- /package/dist/{chunk-ZHCARYPU.js.map → chunk-X4SFGT4J.js.map} +0 -0
- /package/dist/{chunk-7XTXGY66.js.map → chunk-YMVHPSJ4.js.map} +0 -0
- /package/dist/{chunk-UKHXJNHY.js.map → chunk-Z66NVOKH.js.map} +0 -0
- /package/dist/{chunk-LKJQF6EX.js.map → chunk-ZZVEO3HS.js.map} +0 -0
- /package/dist/{cli-UTAK3OUR.js.map → cli-F4BJ2LO2.js.map} +0 -0
- /package/dist/{commands-X7AF7Q6B.js.map → commands-HSOIWNZO.js.map} +0 -0
- /package/dist/{config-VAK73N3C.js.map → config-7T6GQHYO.js.map} +0 -0
- /package/dist/{context-LITT7GWQ.js.map → context-FCGOJXLG.js.map} +0 -0
- /package/dist/{customCommands-332BZCYL.js.map → customCommands-ZQCOLNAA.js.map} +0 -0
- /package/dist/{env-X3OQREU5.js.map → env-YEMSVJMU.js.map} +0 -0
- /package/dist/{file-YIJCUPIS.js.map → file-PBBVWSIC.js.map} +0 -0
- /package/dist/{llm-ANFLVEGA.js.map → llm-N2EGKP4A.js.map} +0 -0
- /package/dist/{llmLazy-6ATRXROW.js.map → llmLazy-M5HJDVWS.js.map} +0 -0
- /package/dist/{loader-4MF6GGVQ.js.map → loader-3LUHCW5P.js.map} +0 -0
- /package/dist/{lsp-HNYBUOM5.js.map → lsp-EIXOHBY2.js.map} +0 -0
- /package/dist/{lspAnchor-NJ7QLPRP.js.map → lspAnchor-QTXVGYX4.js.map} +0 -0
- /package/dist/{mcp-BQDMNBFE.js.map → mcp-65I2B7GH.js.map} +0 -0
- /package/dist/{mentionProcessor-SI3EDF5D.js.map → mentionProcessor-MK4NRC65.js.map} +0 -0
- /package/dist/{messages-T26ZAT7X.js.map → messages-IHFHMYSA.js.map} +0 -0
- /package/dist/{model-KEEPGSL3.js.map → model-OJUT7KMM.js.map} +0 -0
- /package/dist/{openai-4QY7PES4.js.map → openai-SZYDID6E.js.map} +0 -0
- /package/dist/{outputStyles-KJQ22WMK.js.map → outputStyles-LASFU3IN.js.map} +0 -0
- /package/dist/{pluginRuntime-ET2UJKNE.js.map → pluginRuntime-EE7QC4ZO.js.map} +0 -0
- /package/dist/{pluginValidation-62D3RVRP.js.map → pluginValidation-RJH2VNIM.js.map} +0 -0
- /package/dist/{prompts-UMP3KBTC.js.map → prompts-KXE7CM3Y.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-BT4UXNLK.js.map → pybAgentSessionLoad-ZHRRX5SH.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-OELIKRTW.js.map → pybAgentSessionResume-4BTZDUYL.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-4W33HAZH.js.map → pybAgentStreamJsonSession-R653JAD5.js.map} +0 -0
- /package/dist/{pybHooks-3ZOPMDSW.js.map → pybHooks-PZO5PZ4Z.js.map} +0 -0
- /package/dist/{query-6OHGKDQC.js.map → query-D4TTBO3G.js.map} +0 -0
- /package/dist/{registry-EIHFC2Y2.js.map → registry-IQEOGXFH.js.map} +0 -0
- /package/dist/{ripgrep-QEAY6XBF.js.map → ripgrep-S37P6LBE.js.map} +0 -0
- /package/dist/{skillMarketplace-RUKAENGF.js.map → skillMarketplace-KUSRKZUY.js.map} +0 -0
- /package/dist/{state-HBF5REQ3.js.map → state-BPJBUEMP.js.map} +0 -0
- /package/dist/{theme-IFSYSZ2G.js.map → theme-PHX4BKDY.js.map} +0 -0
- /package/dist/{toolPermissionSettings-CJOHNAQD.js.map → toolPermissionSettings-HJFZDYFO.js.map} +0 -0
- /package/dist/{tools-UQ6JYR3G.js.map → tools-ERFLE7MQ.js.map} +0 -0
- /package/dist/{userInput-IOAI64XA.js.map → userInput-CJWBEKXW.js.map} +0 -0
|
@@ -3,18 +3,18 @@ const require = __pybCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
formatValidationResult,
|
|
5
5
|
validatePluginOrMarketplacePath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B5HI7CIZ.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5D4LA7MX.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DUYRUANR.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QFZQ4YIM.js";
|
|
18
18
|
import {
|
|
19
19
|
drainHookSystemPromptAdditions,
|
|
20
20
|
getHookTranscriptPath,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
runStopHooks,
|
|
27
27
|
runUserPromptSubmitHooks,
|
|
28
28
|
updateHookTranscriptForMessages
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-POL6ZPVE.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_OUTPUT_STYLE,
|
|
32
32
|
getAvailableOutputStyles,
|
|
@@ -35,16 +35,16 @@ import {
|
|
|
35
35
|
getOutputStyleSystemPromptAdditions,
|
|
36
36
|
resolveOutputStyleName,
|
|
37
37
|
setCurrentOutputStyle
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CNQZQWGS.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MNN3BFEZ.js";
|
|
43
43
|
import {
|
|
44
44
|
queryLLM,
|
|
45
45
|
queryQuick,
|
|
46
46
|
verifyApiKey
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-6PYLF3ET.js";
|
|
48
48
|
import {
|
|
49
49
|
DEFAULT_TIMEOUT_MS,
|
|
50
50
|
FallbackToolUseRejectedMessage,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
listMCPServers,
|
|
59
59
|
loadMergedSettings,
|
|
60
60
|
normalizeSandboxRuntimeConfigFromSettings
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-BF3QQA6B.js";
|
|
62
62
|
import {
|
|
63
63
|
addMarketplace,
|
|
64
64
|
disableSkillPlugin,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
refreshMarketplaceAsync,
|
|
72
72
|
removeMarketplace,
|
|
73
73
|
uninstallSkillPlugin
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-VUVKQMC5.js";
|
|
75
75
|
import {
|
|
76
76
|
loadToolPermissionContextFromDisk,
|
|
77
77
|
persistToolPermissionUpdateToDisk
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-4VZVUC7S.js";
|
|
79
79
|
import {
|
|
80
80
|
applyToolPermissionContextUpdate,
|
|
81
81
|
createDefaultToolPermissionContext
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
resetReminderSession,
|
|
89
89
|
setTodos,
|
|
90
90
|
systemReminderService
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-LS3G24MQ.js";
|
|
92
92
|
import {
|
|
93
93
|
getSessionState
|
|
94
94
|
} from "./chunk-ERMQRV55.js";
|
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
getActiveAgents,
|
|
98
98
|
getAgentByType,
|
|
99
99
|
getAllAgents
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-ZZVEO3HS.js";
|
|
101
101
|
import {
|
|
102
102
|
API_ERROR_MESSAGE_PREFIX,
|
|
103
103
|
CANCEL_MESSAGE,
|
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
processUserInput,
|
|
128
128
|
reorderMessages,
|
|
129
129
|
stripSystemMessages
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-CX3J3ZM2.js";
|
|
131
131
|
import {
|
|
132
132
|
getRequestStatus,
|
|
133
133
|
setRequestStatus,
|
|
@@ -150,11 +150,10 @@ import {
|
|
|
150
150
|
normalizeFilePath,
|
|
151
151
|
readTextContent,
|
|
152
152
|
writeTextContent
|
|
153
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-4KXOAXLT.js";
|
|
154
154
|
import {
|
|
155
|
-
ripGrep
|
|
156
|
-
|
|
157
|
-
} from "./chunk-6KWGNHDI.js";
|
|
155
|
+
ripGrep
|
|
156
|
+
} from "./chunk-F5MBTGHO.js";
|
|
158
157
|
import {
|
|
159
158
|
parseBlockEdits
|
|
160
159
|
} from "./chunk-QWIBSCDN.js";
|
|
@@ -164,17 +163,17 @@ import {
|
|
|
164
163
|
ParserRegistry,
|
|
165
164
|
initParser,
|
|
166
165
|
loadLanguage
|
|
167
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-DHVVPKIB.js";
|
|
168
167
|
import {
|
|
169
168
|
getSettingsFileCandidates,
|
|
170
169
|
loadSettingsWithLegacyFallback
|
|
171
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-Z66NVOKH.js";
|
|
172
171
|
import {
|
|
173
172
|
getCustomCommandDirectories,
|
|
174
173
|
hasCustomCommands,
|
|
175
174
|
loadCustomCommands,
|
|
176
175
|
reloadCustomCommands
|
|
177
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-BHHLJAAX.js";
|
|
178
177
|
import {
|
|
179
178
|
getSessionPlugins
|
|
180
179
|
} from "./chunk-BJSWTHRM.js";
|
|
@@ -182,17 +181,17 @@ import {
|
|
|
182
181
|
ModelManager,
|
|
183
182
|
getModelManager,
|
|
184
183
|
isDefaultSlowAndCapableModel
|
|
185
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-YMVHPSJ4.js";
|
|
186
185
|
import {
|
|
187
186
|
getCodeStyle,
|
|
188
187
|
getContext,
|
|
189
188
|
getGitState,
|
|
190
189
|
getIsGit,
|
|
191
190
|
getProjectDocs
|
|
192
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-NQOZPIZ3.js";
|
|
193
192
|
import {
|
|
194
193
|
getTheme
|
|
195
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-BZJJX5ON.js";
|
|
196
195
|
import {
|
|
197
196
|
DEFAULT_GLOBAL_CONFIG,
|
|
198
197
|
enableConfigs,
|
|
@@ -205,7 +204,7 @@ import {
|
|
|
205
204
|
saveGlobalConfig,
|
|
206
205
|
setAllPointersToModel,
|
|
207
206
|
setModelPointer
|
|
208
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-HJTLI6VS.js";
|
|
209
208
|
import {
|
|
210
209
|
AbortError
|
|
211
210
|
} from "./chunk-RQVLBMP7.js";
|
|
@@ -214,7 +213,7 @@ import {
|
|
|
214
213
|
getCurrentRequest,
|
|
215
214
|
logUserFriendly,
|
|
216
215
|
markPhase
|
|
217
|
-
} from "./chunk-
|
|
216
|
+
} from "./chunk-X4SFGT4J.js";
|
|
218
217
|
import {
|
|
219
218
|
ASCII_LOGO,
|
|
220
219
|
BunShell,
|
|
@@ -253,10 +252,10 @@ import {
|
|
|
253
252
|
setCwd,
|
|
254
253
|
shouldApplyToolOutputTruncation,
|
|
255
254
|
truncateToolOutput
|
|
256
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-KDL4PYX2.js";
|
|
257
256
|
import {
|
|
258
257
|
MACRO
|
|
259
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-YIZ5ZIMX.js";
|
|
260
259
|
import {
|
|
261
260
|
formatTotalCost,
|
|
262
261
|
getTotalAPIDuration,
|
|
@@ -444,7 +443,7 @@ var getCommandSubcommandPrefix = memoize(
|
|
|
444
443
|
var getCommandPrefix = memoize(
|
|
445
444
|
async (command4, abortSignal) => {
|
|
446
445
|
const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
|
|
447
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-
|
|
446
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-N2EGKP4A.js");
|
|
448
447
|
const response = await queryQuick2({
|
|
449
448
|
systemPrompt,
|
|
450
449
|
userPrompt,
|
|
@@ -4246,7 +4245,7 @@ function formatParseError(error) {
|
|
|
4246
4245
|
return error instanceof Error ? error.message : String(error);
|
|
4247
4246
|
}
|
|
4248
4247
|
async function defaultGateQuery(args) {
|
|
4249
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-
|
|
4248
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-N2EGKP4A.js");
|
|
4250
4249
|
const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
|
|
4251
4250
|
const messages = [
|
|
4252
4251
|
{
|
|
@@ -6506,7 +6505,7 @@ var FileEditTool = {
|
|
|
6506
6505
|
const originalFileContent = currentFileContent;
|
|
6507
6506
|
let totalPatch = [];
|
|
6508
6507
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6509
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6508
|
+
const { findLspAnchor } = await import("./lspAnchor-QTXVGYX4.js");
|
|
6510
6509
|
for (const op of editOperations) {
|
|
6511
6510
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6512
6511
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -7065,10 +7064,10 @@ var SmartTruncator = class _SmartTruncator {
|
|
|
7065
7064
|
}
|
|
7066
7065
|
try {
|
|
7067
7066
|
const parser = await loadLanguage(langKey);
|
|
7068
|
-
const
|
|
7067
|
+
const tree = parser.parse(code);
|
|
7069
7068
|
let newStart = startLine;
|
|
7070
7069
|
let newEnd = endLine;
|
|
7071
|
-
const endNode =
|
|
7070
|
+
const endNode = tree.rootNode.descendantForPosition({ row: endLine, column: 1e4 });
|
|
7072
7071
|
const containers = _SmartTruncator.findContainers(endNode);
|
|
7073
7072
|
for (const container of containers) {
|
|
7074
7073
|
if (container.endPosition.row > endLine) {
|
|
@@ -7079,7 +7078,7 @@ var SmartTruncator = class _SmartTruncator {
|
|
|
7079
7078
|
}
|
|
7080
7079
|
}
|
|
7081
7080
|
}
|
|
7082
|
-
const startNode =
|
|
7081
|
+
const startNode = tree.rootNode.descendantForPosition({ row: startLine, column: 0 });
|
|
7083
7082
|
const startContainers = _SmartTruncator.findContainers(startNode);
|
|
7084
7083
|
for (const container of startContainers) {
|
|
7085
7084
|
if (container.startPosition.row < startLine) {
|
|
@@ -7777,11 +7776,16 @@ var DESCRIPTION4 = `- Fast file pattern matching tool that works with any codeba
|
|
|
7777
7776
|
- Supports glob patterns like "**/*.js" or "src/**/*.ts"
|
|
7778
7777
|
- Returns matching file paths sorted by modification time
|
|
7779
7778
|
- Use this tool when you need to find files by name patterns
|
|
7780
|
-
- **Semantic Search**:
|
|
7781
|
-
-
|
|
7779
|
+
- **Semantic Search**: \`semantic\` defaults to true to search for code symbols (classes, functions, variables) when name matching finds nothing. This is powered by LSP and can find files based on their *content* definitions even if the filename is different.
|
|
7780
|
+
- Layered enumeration enables multi-level directory/file discovery: use \`*/\` for directories, then for each directory run \`dir/*\` and \`dir/*/\` to expand level by level
|
|
7781
|
+
- Layered glob example: run \`*/\` to get top-level directories, then run \`src/*\` and \`src/*/\` to get second-level files and folders
|
|
7782
|
+
- You can combine Batch to run multiple Globs in parallel for faster locating, but Glob only matches paths/filenames; use Grep or LSP for content keyword searches
|
|
7783
|
+
- Parallel examples: \`*\` + \`*/\` + \`**/package.json\` + \`**/pyproject.toml\` + \`**/README*\`
|
|
7784
|
+
- Partition scan: run \`src/*\`, \`docs/*\`, \`tests/*\` in parallel to build a first-level structure snapshot
|
|
7785
|
+
- Multi-repo filtering: run \`*/.git\` and \`*/package.json\` in parallel to locate candidate repos
|
|
7786
|
+
- Combination strategy: use parallel Glob for structure, parallel Grep for content, and for complex projects use Glob to narrow targets before Grep/LSP
|
|
7782
7787
|
- When you are doing an open ended search that may require multiple rounds of globbing and grepping, use the Agent tool instead
|
|
7783
7788
|
- You can call multiple tools in a single response. It is always better to speculatively perform multiple searches in parallel if they are potentially useful.
|
|
7784
|
-
- This tool is for FINDING files. To SEE the directory structure tree, use the LS tool.
|
|
7785
7789
|
`;
|
|
7786
7790
|
|
|
7787
7791
|
// src/tools/filesystem/GlobTool/GlobTool.tsx
|
|
@@ -7793,7 +7797,7 @@ var inputSchema6 = z6.strictObject({
|
|
|
7793
7797
|
path: z6.string().optional().describe(
|
|
7794
7798
|
'The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter "undefined" or "null" - simply omit it for the default behavior. Must be a valid directory path if provided.'
|
|
7795
7799
|
),
|
|
7796
|
-
semantic: z6.boolean().
|
|
7800
|
+
semantic: z6.boolean().default(true).describe(
|
|
7797
7801
|
"Enable semantic search using LSP workspace symbols to find relevant files. Useful when you know the symbol name but not the file path."
|
|
7798
7802
|
)
|
|
7799
7803
|
});
|
|
@@ -7939,14 +7943,26 @@ var DESCRIPTION5 = `A powerful search tool built on ripgrep
|
|
|
7939
7943
|
- Use Task tool for open-ended searches requiring multiple rounds
|
|
7940
7944
|
- Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (use \`interface\\{\\}\` to find \`interface{}\` in Go code)
|
|
7941
7945
|
- Multiline matching: By default patterns match within single lines only. For cross-line patterns like \`struct \\{[\\s\\S]*?field\`, use \`multiline: true\`
|
|
7942
|
-
- Semantic search:
|
|
7943
|
-
-
|
|
7946
|
+
- Semantic search: \`semantic\` defaults to true to use LSP workspace symbols when text search yields no results or when you explicitly need symbol-based lookup.
|
|
7947
|
+
- Batch parallel Grep: run multiple independent keywords in parallel when they target different scopes, file types, or regexes.
|
|
7948
|
+
- Multi-keyword single pass: for the same scope, use OR regex (e.g., \`foo|bar|baz\`) to reduce IO.
|
|
7949
|
+
- Tradeoff: parallel Grep speeds discovery but increases IO pressure on large repos.
|
|
7950
|
+
- Practical flow: narrow with Glob, then Grep in parallel or OR regex within the scoped paths.
|
|
7951
|
+
- Common usage examples:
|
|
7952
|
+
- Keyword: \`TODO\` in TS files with context: \`pattern="TODO"\`, \`glob="**/*.ts"\`, \`output_mode="content"\`, \`-C=2\`
|
|
7953
|
+
- Regex: find function declarations: \`pattern="function\\s+\\w+"\`, \`glob="**/*.js"\`
|
|
7954
|
+
- Line numbers: errors in logs: \`pattern="error"\`, \`path="logs"\`, \`output_mode="content"\`, \`-n=true\`
|
|
7955
|
+
- Count mode: occurrences per file: \`pattern="panic"\`, \`output_mode="count"\`
|
|
7956
|
+
- Parallel examples (Batch):
|
|
7957
|
+
- \`pattern="TODO"\`, \`glob="**/*.ts"\`
|
|
7958
|
+
- \`pattern="FIXME"\`, \`glob="**/*.ts"\`
|
|
7959
|
+
- \`pattern="deprecated"\`, \`glob="**/*.ts"\`
|
|
7944
7960
|
- STRATEGY: Use Grep as a "Scout" to *find* entry points based on text patterns.
|
|
7945
7961
|
- STEP 1: Search for a unique string (e.g., error message, URL route, specific variable name).
|
|
7946
7962
|
- STEP 2: Once you get a match (File + Line Number), STOP grepping.
|
|
7947
|
-
- STEP 3: Switch to
|
|
7963
|
+
- STEP 3: Switch to LSP immediately. Use the line number from Grep to jump to definition or find references.
|
|
7948
7964
|
- AVOID: Do not use Grep to trace execution flow (e.g., searching for "functionName" manually). Use LSP for that.
|
|
7949
|
-
-
|
|
7965
|
+
- Hotspot strategy: narrow paths first, then paginate or refine; after truncation, focus on hotspot directories to avoid full-repo scans.
|
|
7950
7966
|
`;
|
|
7951
7967
|
|
|
7952
7968
|
// src/tools/search/GrepTool/GrepTool.tsx
|
|
@@ -7988,7 +8004,7 @@ var inputSchema7 = z7.strictObject({
|
|
|
7988
8004
|
multiline: z7.boolean().optional().describe(
|
|
7989
8005
|
"Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false."
|
|
7990
8006
|
),
|
|
7991
|
-
semantic: z7.boolean().
|
|
8007
|
+
semantic: z7.boolean().default(true).describe(
|
|
7992
8008
|
"Enable semantic search using LSP workspace symbols if text search fails. Useful for finding symbols even with typos."
|
|
7993
8009
|
),
|
|
7994
8010
|
symbol_type: z7.string().optional().describe(
|
|
@@ -8152,7 +8168,7 @@ ${result.filenames.join("\n")}`;
|
|
|
8152
8168
|
head_limit,
|
|
8153
8169
|
offset = 0,
|
|
8154
8170
|
multiline = false,
|
|
8155
|
-
semantic =
|
|
8171
|
+
semantic = true,
|
|
8156
8172
|
symbol_type
|
|
8157
8173
|
}, toolUseContext) {
|
|
8158
8174
|
const { abortController } = toolUseContext;
|
|
@@ -11028,7 +11044,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11028
11044
|
}
|
|
11029
11045
|
saveGlobalConfig(config2);
|
|
11030
11046
|
try {
|
|
11031
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11047
|
+
const { resetAnthropicClient } = await import("./llm-N2EGKP4A.js");
|
|
11032
11048
|
resetAnthropicClient();
|
|
11033
11049
|
} catch {
|
|
11034
11050
|
}
|
|
@@ -15310,7 +15326,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15310
15326
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15311
15327
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15312
15328
|
if (dirs.length === 0) return [];
|
|
15313
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15329
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-EE7QC4ZO.js");
|
|
15314
15330
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15315
15331
|
return errors;
|
|
15316
15332
|
}
|
|
@@ -15979,7 +15995,7 @@ async function call(onDone, context) {
|
|
|
15979
15995
|
ModelConfig,
|
|
15980
15996
|
{
|
|
15981
15997
|
onClose: () => {
|
|
15982
|
-
import("./model-
|
|
15998
|
+
import("./model-OJUT7KMM.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
15983
15999
|
reloadModelManager2();
|
|
15984
16000
|
triggerModelConfigChange();
|
|
15985
16001
|
onDone();
|
|
@@ -23423,7 +23439,7 @@ function useStatusLine() {
|
|
|
23423
23439
|
// src/ui/components/PromptInput.tsx
|
|
23424
23440
|
async function interpretHashCommand(input) {
|
|
23425
23441
|
try {
|
|
23426
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
23442
|
+
const { queryQuick: queryQuick2 } = await import("./llm-N2EGKP4A.js");
|
|
23427
23443
|
const systemPrompt = [
|
|
23428
23444
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
23429
23445
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -23736,7 +23752,7 @@ function PromptInput({
|
|
|
23736
23752
|
if (messages2.length) {
|
|
23737
23753
|
if (mode === "bash") {
|
|
23738
23754
|
onQuery(messages2, newAbortController).then(async () => {
|
|
23739
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
23755
|
+
const { getCwd: getCwd2 } = await import("./state-BPJBUEMP.js");
|
|
23740
23756
|
setCurrentPwd(getCwd2());
|
|
23741
23757
|
});
|
|
23742
23758
|
} else {
|
|
@@ -24288,7 +24304,6 @@ async function logBinaryFeedbackEvent(_m1, _m2, _choice) {
|
|
|
24288
24304
|
var PybContextManager = class _PybContextManager {
|
|
24289
24305
|
static instance;
|
|
24290
24306
|
projectDocsCache = "";
|
|
24291
|
-
treeCache = "";
|
|
24292
24307
|
cacheInitialized = false;
|
|
24293
24308
|
initPromise = null;
|
|
24294
24309
|
static getInstance() {
|
|
@@ -24301,12 +24316,8 @@ var PybContextManager = class _PybContextManager {
|
|
|
24301
24316
|
if (this.initPromise) return this.initPromise;
|
|
24302
24317
|
this.initPromise = (async () => {
|
|
24303
24318
|
try {
|
|
24304
|
-
const [projectDocs
|
|
24305
|
-
getProjectDocs(),
|
|
24306
|
-
tree(getCwd(), 50, new AbortController().signal).catch(() => "")
|
|
24307
|
-
]);
|
|
24319
|
+
const [projectDocs] = await Promise.all([getProjectDocs()]);
|
|
24308
24320
|
this.projectDocsCache = projectDocs || "";
|
|
24309
|
-
this.treeCache = treeStr;
|
|
24310
24321
|
this.cacheInitialized = true;
|
|
24311
24322
|
} catch (error) {
|
|
24312
24323
|
logError(error);
|
|
@@ -24314,7 +24325,6 @@ var PybContextManager = class _PybContextManager {
|
|
|
24314
24325
|
error: error instanceof Error ? error.message : String(error)
|
|
24315
24326
|
});
|
|
24316
24327
|
this.projectDocsCache = "";
|
|
24317
|
-
this.treeCache = "";
|
|
24318
24328
|
this.cacheInitialized = true;
|
|
24319
24329
|
}
|
|
24320
24330
|
})();
|
|
@@ -24331,12 +24341,7 @@ var PybContextManager = class _PybContextManager {
|
|
|
24331
24341
|
return "";
|
|
24332
24342
|
}
|
|
24333
24343
|
const context = [
|
|
24334
|
-
this.projectDocsCache
|
|
24335
|
-
this.treeCache ? `
|
|
24336
|
-
# Project Structure
|
|
24337
|
-
\`\`\`
|
|
24338
|
-
${this.treeCache}
|
|
24339
|
-
\`\`\`` : ""
|
|
24344
|
+
this.projectDocsCache
|
|
24340
24345
|
].filter(Boolean).join("\n\n");
|
|
24341
24346
|
return context;
|
|
24342
24347
|
}
|
|
@@ -24614,6 +24619,113 @@ function isToolUseLikeBlock(block) {
|
|
|
24614
24619
|
return block && typeof block === "object" && (block.type === "tool_use" || block.type === "server_tool_use" || block.type === "mcp_tool_use");
|
|
24615
24620
|
}
|
|
24616
24621
|
var __isToolUseLikeBlockForTests = isToolUseLikeBlock;
|
|
24622
|
+
function isBatchToolName(name2) {
|
|
24623
|
+
return name2.trim().toLowerCase() === "batch";
|
|
24624
|
+
}
|
|
24625
|
+
function isMcpToolName(name2) {
|
|
24626
|
+
const trimmed = name2.trim();
|
|
24627
|
+
return trimmed === "mcp" || trimmed.startsWith("mcp__");
|
|
24628
|
+
}
|
|
24629
|
+
function isMarketplaceToolName(name2) {
|
|
24630
|
+
return name2.trim().startsWith("marketplace__");
|
|
24631
|
+
}
|
|
24632
|
+
function isSkillToolName(name2) {
|
|
24633
|
+
return name2.trim() === "Skill";
|
|
24634
|
+
}
|
|
24635
|
+
function normalizeToolCallParameters(input) {
|
|
24636
|
+
if (input && typeof input === "object" && !Array.isArray(input)) {
|
|
24637
|
+
return input;
|
|
24638
|
+
}
|
|
24639
|
+
return {};
|
|
24640
|
+
}
|
|
24641
|
+
function createAutoBatchToolUse(toolUses, batchIndex) {
|
|
24642
|
+
const seed = toolUses[0]?.id || "auto";
|
|
24643
|
+
return {
|
|
24644
|
+
type: "tool_use",
|
|
24645
|
+
id: `batch_auto_${seed}_${batchIndex + 1}`,
|
|
24646
|
+
name: "Batch",
|
|
24647
|
+
input: {
|
|
24648
|
+
tool_calls: toolUses.map((toolUse) => ({
|
|
24649
|
+
tool: resolveToolNameAlias(toolUse.name).resolvedName,
|
|
24650
|
+
parameters: normalizeToolCallParameters(toolUse.input)
|
|
24651
|
+
}))
|
|
24652
|
+
}
|
|
24653
|
+
};
|
|
24654
|
+
}
|
|
24655
|
+
function canAutoBatchToolUse(toolUse, tools) {
|
|
24656
|
+
const resolvedName = resolveToolNameAlias(toolUse.name).resolvedName;
|
|
24657
|
+
if (isBatchToolName(resolvedName) || isMcpToolName(resolvedName) || isMarketplaceToolName(resolvedName) || isSkillToolName(resolvedName)) {
|
|
24658
|
+
return false;
|
|
24659
|
+
}
|
|
24660
|
+
const tool = tools.find((t) => t.name === resolvedName);
|
|
24661
|
+
if (!tool) return false;
|
|
24662
|
+
const parsed = tool.inputSchema.safeParse(
|
|
24663
|
+
normalizeToolCallParameters(toolUse.input)
|
|
24664
|
+
);
|
|
24665
|
+
if (!parsed.success) return false;
|
|
24666
|
+
return tool.isReadOnly(parsed.data) && tool.isConcurrencySafe(parsed.data);
|
|
24667
|
+
}
|
|
24668
|
+
function autoBatchToolUseBlocks(toolUseMessages, tools) {
|
|
24669
|
+
if (toolUseMessages.length < 2) return toolUseMessages;
|
|
24670
|
+
const resolvedNames = toolUseMessages.map(
|
|
24671
|
+
(toolUse) => resolveToolNameAlias(toolUse.name).resolvedName
|
|
24672
|
+
);
|
|
24673
|
+
if (resolvedNames.some(isBatchToolName)) return toolUseMessages;
|
|
24674
|
+
const normalizedToolUses = toolUseMessages.map((toolUse, index) => ({
|
|
24675
|
+
...toolUse,
|
|
24676
|
+
name: resolvedNames[index]
|
|
24677
|
+
}));
|
|
24678
|
+
const output = [];
|
|
24679
|
+
let batchIndex = 0;
|
|
24680
|
+
let buffer = [];
|
|
24681
|
+
const flushBuffer = () => {
|
|
24682
|
+
if (buffer.length === 0) return;
|
|
24683
|
+
if (buffer.length === 1) {
|
|
24684
|
+
output.push(buffer[0]);
|
|
24685
|
+
buffer = [];
|
|
24686
|
+
return;
|
|
24687
|
+
}
|
|
24688
|
+
for (let i = 0; i < buffer.length; i += 10) {
|
|
24689
|
+
const chunk = buffer.slice(i, i + 10);
|
|
24690
|
+
output.push(createAutoBatchToolUse(chunk, batchIndex));
|
|
24691
|
+
batchIndex += 1;
|
|
24692
|
+
}
|
|
24693
|
+
buffer = [];
|
|
24694
|
+
};
|
|
24695
|
+
for (const toolUse of normalizedToolUses) {
|
|
24696
|
+
if (canAutoBatchToolUse(toolUse, tools)) {
|
|
24697
|
+
buffer.push(toolUse);
|
|
24698
|
+
continue;
|
|
24699
|
+
}
|
|
24700
|
+
flushBuffer();
|
|
24701
|
+
output.push(toolUse);
|
|
24702
|
+
}
|
|
24703
|
+
flushBuffer();
|
|
24704
|
+
return output;
|
|
24705
|
+
}
|
|
24706
|
+
var __autoBatchToolUseBlocksForTests = autoBatchToolUseBlocks;
|
|
24707
|
+
function rewriteToolUseBlocksInAssistantMessage(assistantMessage, toolUseMessages) {
|
|
24708
|
+
if (!Array.isArray(assistantMessage.message.content)) return assistantMessage;
|
|
24709
|
+
let nextToolUseIndex = 0;
|
|
24710
|
+
const rewritten = assistantMessage.message.content.flatMap((block) => {
|
|
24711
|
+
if (!isToolUseLikeBlock(block)) return [block];
|
|
24712
|
+
const next = toolUseMessages[nextToolUseIndex];
|
|
24713
|
+
if (!next) return [];
|
|
24714
|
+
nextToolUseIndex += 1;
|
|
24715
|
+
return [next];
|
|
24716
|
+
});
|
|
24717
|
+
for (let i = nextToolUseIndex; i < toolUseMessages.length; i += 1) {
|
|
24718
|
+
rewritten.push(toolUseMessages[i]);
|
|
24719
|
+
}
|
|
24720
|
+
return {
|
|
24721
|
+
...assistantMessage,
|
|
24722
|
+
message: {
|
|
24723
|
+
...assistantMessage.message,
|
|
24724
|
+
content: rewritten
|
|
24725
|
+
}
|
|
24726
|
+
};
|
|
24727
|
+
}
|
|
24728
|
+
var __rewriteToolUseBlocksForTests = rewriteToolUseBlocksInAssistantMessage;
|
|
24617
24729
|
function createSyntheticToolUseErrorMessage(toolUseId, reason) {
|
|
24618
24730
|
if (reason === "user_interrupted") {
|
|
24619
24731
|
return createUserMessage([
|
|
@@ -25017,7 +25129,15 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
25017
25129
|
}
|
|
25018
25130
|
const assistantMessage = result.message;
|
|
25019
25131
|
const shouldSkipPermissionCheck = result.shouldSkipPermissionCheck;
|
|
25020
|
-
const
|
|
25132
|
+
const rawToolUseMessages = assistantMessage.message.content.filter(isToolUseLikeBlock);
|
|
25133
|
+
const toolUseMessages = autoBatchToolUseBlocks(
|
|
25134
|
+
rawToolUseMessages,
|
|
25135
|
+
toolUseContext.options?.tools ?? []
|
|
25136
|
+
);
|
|
25137
|
+
const assistantMessageForTools = rewriteToolUseBlocksInAssistantMessage(
|
|
25138
|
+
assistantMessage,
|
|
25139
|
+
toolUseMessages
|
|
25140
|
+
);
|
|
25021
25141
|
if (!toolUseMessages.length) {
|
|
25022
25142
|
const stopHookEvent = toolUseContext.agentId && toolUseContext.agentId !== "main" ? "SubagentStop" : "Stop";
|
|
25023
25143
|
const stopReason = assistantMessage.message?.stop_reason || assistantMessage.message?.stopReason || "end_turn";
|
|
@@ -25063,7 +25183,7 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
25063
25183
|
yield assistantMessage;
|
|
25064
25184
|
return;
|
|
25065
25185
|
}
|
|
25066
|
-
yield
|
|
25186
|
+
yield assistantMessageForTools;
|
|
25067
25187
|
const siblingToolUseIDs = new Set(toolUseMessages.map((_) => _.id));
|
|
25068
25188
|
const toolQueue = new ToolUseQueue({
|
|
25069
25189
|
toolDefinitions: toolUseContext.options.tools,
|
|
@@ -25073,7 +25193,7 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
25073
25193
|
shouldSkipPermissionCheck
|
|
25074
25194
|
});
|
|
25075
25195
|
for (const toolUse of toolUseMessages) {
|
|
25076
|
-
toolQueue.addTool(toolUse,
|
|
25196
|
+
toolQueue.addTool(toolUse, assistantMessageForTools);
|
|
25077
25197
|
}
|
|
25078
25198
|
const toolMessagesForNextTurn = [];
|
|
25079
25199
|
for await (const message of toolQueue.getRemainingResults()) {
|
|
@@ -26503,6 +26623,7 @@ function getCoreTools() {
|
|
|
26503
26623
|
{ name: "LS", description: "List directory contents" },
|
|
26504
26624
|
{ name: "WebFetch", description: "Fetch web content" },
|
|
26505
26625
|
{ name: "WebSearch", description: "Search the web" },
|
|
26626
|
+
{ name: "Batch", description: "Execute multiple tool calls in parallel" },
|
|
26506
26627
|
{ name: "TodoWrite", description: "Manage task lists" }
|
|
26507
26628
|
];
|
|
26508
26629
|
return tools.filter((t) => t.name !== "Task" && t.name !== "ExitPlanMode");
|
|
@@ -26538,7 +26659,7 @@ import { homedir as homedir7 } from "os";
|
|
|
26538
26659
|
// src/commands/agents/generation.ts
|
|
26539
26660
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
26540
26661
|
async function generateAgentWithClaude(prompt) {
|
|
26541
|
-
const { queryModel } = await import("./llm-
|
|
26662
|
+
const { queryModel } = await import("./llm-N2EGKP4A.js");
|
|
26542
26663
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
26543
26664
|
|
|
26544
26665
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -26834,6 +26955,12 @@ var COLOR_OPTIONS = [
|
|
|
26834
26955
|
"pink",
|
|
26835
26956
|
"cyan"
|
|
26836
26957
|
];
|
|
26958
|
+
function resolveToolSelection(selected, allToolNames) {
|
|
26959
|
+
if (selected.length === allToolNames.length && allToolNames.every((name2) => selected.includes(name2))) {
|
|
26960
|
+
return void 0;
|
|
26961
|
+
}
|
|
26962
|
+
return selected;
|
|
26963
|
+
}
|
|
26837
26964
|
function openInEditor(filePath) {
|
|
26838
26965
|
return new Promise((resolve11, reject) => {
|
|
26839
26966
|
const platform = process.platform;
|
|
@@ -27444,8 +27571,7 @@ function ToolPicker(props) {
|
|
|
27444
27571
|
});
|
|
27445
27572
|
};
|
|
27446
27573
|
const complete = () => {
|
|
27447
|
-
|
|
27448
|
-
props.onComplete(next);
|
|
27574
|
+
props.onComplete(resolveToolSelection(selected, allToolNames));
|
|
27449
27575
|
};
|
|
27450
27576
|
const categorized = useMemo25(() => {
|
|
27451
27577
|
const readOnly = /* @__PURE__ */ new Set(["Read", "Glob", "Grep", "LS"]);
|
|
@@ -29722,8 +29848,8 @@ var BashParser = class {
|
|
|
29722
29848
|
* Returns true if safe, throws error if unsafe.
|
|
29723
29849
|
*/
|
|
29724
29850
|
static async validate(script) {
|
|
29725
|
-
const
|
|
29726
|
-
const root =
|
|
29851
|
+
const tree = await this.parse(script);
|
|
29852
|
+
const root = tree.rootNode;
|
|
29727
29853
|
const commands = root.descendantsOfType("command");
|
|
29728
29854
|
for (const cmd of commands) {
|
|
29729
29855
|
const nameNode = cmd.childForFieldName("name");
|
|
@@ -29740,8 +29866,8 @@ var BashParser = class {
|
|
|
29740
29866
|
// src/utils/bash-parser/validator.ts
|
|
29741
29867
|
import { resolve as resolve9 } from "path";
|
|
29742
29868
|
async function validateSafety(script, cwd = process.cwd()) {
|
|
29743
|
-
const
|
|
29744
|
-
const root =
|
|
29869
|
+
const tree = await BashParser.parse(script);
|
|
29870
|
+
const root = tree.rootNode;
|
|
29745
29871
|
validateNode(root, script, cwd);
|
|
29746
29872
|
}
|
|
29747
29873
|
function validateNode(node, script, cwd) {
|
|
@@ -30508,6 +30634,7 @@ async function getSystemPrompt(options) {
|
|
|
30508
30634
|
const isOutputStyleActive = outputStyle2 !== null;
|
|
30509
30635
|
const includeCodingInstructions = !isOutputStyleActive || outputStyle2.keepCodingInstructions === true;
|
|
30510
30636
|
return [
|
|
30637
|
+
`${await getEnvInfo()}`,
|
|
30511
30638
|
`
|
|
30512
30639
|
You are an interactive CLI tool that helps users ${isOutputStyleActive ? 'according to your "Output Style" below, which describes how you should respond to user queries.' : "with software engineering tasks."} Use the instructions below and the tools available to you to assist the user.
|
|
30513
30640
|
|
|
@@ -30532,13 +30659,10 @@ It is critical that you mark todos as completed as soon as you are done with a t
|
|
|
30532
30659
|
1. **Modification Check**: Before editing, you MUST verify if the change is already present (e.g. use \`grep\` or \`read\`).
|
|
30533
30660
|
2. **Precise Targeting**: For code injection, prefer using LSP to find exact function boundaries, or Read the file to get unique context.
|
|
30534
30661
|
3. **Artifact Verification**: After completing a complex task, verify the artifacts (e.g. check if files exist using \`ls\`).
|
|
30535
|
-
4. **LSP Instinct**: Before modifying any code, you MUST use \`
|
|
30536
|
-
5. **Atomic Verification**: When editing code, especially in critical or complex files, you should strongly consider setting \`verify: true\` in the \`
|
|
30537
|
-
6. **Semantic Search**: When searching for code concepts (e.g. "AuthLogic", "UserHandler") rather than exact filenames, prefer using \`
|
|
30538
|
-
7. **Reference Guard**: Be aware that deleting files might be blocked if they are referenced elsewhere. If the \`
|
|
30539
|
-
|
|
30540
|
-
# \u8DEF\u5F84\u5206\u7247\u7B56\u7565
|
|
30541
|
-
\u5728\u5927\u4ED3\u5E93\u4E2D\u4F7F\u7528\u7ED3\u6784\u6811\u5DE5\u5177\u65F6\uFF0C\u6309\u201C\u6839\u2192\u6838\u5FC3\u76EE\u5F55\u2192\u4E8C\u7EA7\u6A21\u5757\u201D\u987A\u5E8F\u5206\u591A\u6B21\u8C03\u7528\uFF0C\u907F\u514D\u4E00\u6B21\u6027\u5168\u5E93\u626B\u63CF\u3002
|
|
30662
|
+
4. **LSP Instinct**: Before modifying any code, you MUST use \`LSP.documentSymbol\` or \`LSP.definition\` to confirm the exact location and range of the target symbol. Do NOT rely on line numbers from \`read_file\` alone as they may be outdated.
|
|
30663
|
+
5. **Atomic Verification**: When editing code, especially in critical or complex files, you should strongly consider setting \`verify: true\` in the \`FileEdit\`. This enables the tool to automatically detect syntax errors and ROLLBACK changes if they are invalid, preventing you from breaking the build.
|
|
30664
|
+
6. **Semantic Search**: When searching for code concepts (e.g. "AuthLogic", "UserHandler") rather than exact filenames, prefer using \`Glob\` with \`semantic: true\`. This leverages LSP to find files by their content definitions.
|
|
30665
|
+
7. **Reference Guard**: Be aware that deleting files might be blocked if they are referenced elsewhere. If the \`Delete\` blocks you, check the references it reports. Only use \`force: true\` if you are refactoring and intentionally removing those references.
|
|
30542
30666
|
|
|
30543
30667
|
# \u5E76\u53D1\u7B56\u7565\u7EA6\u675F
|
|
30544
30668
|
- \u540C\u8F6E\u591A\u6B21\u8C03\u7528\u4EC5\u5E76\u53D1\u89E6\u53D1\u201C\u53EA\u8BFB\u4E14\u5E76\u53D1\u5B89\u5168\u201D\u7684\u5DE5\u5177\uFF08isConcurrencySafe=true\uFF09
|
|
@@ -30546,6 +30670,15 @@ It is critical that you mark todos as completed as soon as you are done with a t
|
|
|
30546
30670
|
- MCP \u5DE5\u5177\u7684\u5E76\u53D1\u5B89\u5168\u6027\u7531 annotations.readOnlyHint \u5224\u5B9A
|
|
30547
30671
|
- \u5B58\u5728\u4F9D\u8D56\u5173\u7CFB\u7684\u8C03\u7528\u5FC5\u987B\u4E32\u884C\uFF1B\u4EC5\u72EC\u7ACB\u3001\u65E0\u4F9D\u8D56\u7684\u8C03\u7528\u5E76\u53D1
|
|
30548
30672
|
|
|
30673
|
+
# BatchTool \u4F7F\u7528\u7B56\u7565
|
|
30674
|
+
- \u4F55\u65F6\u4F7F\u7528\uFF1A\u591A\u4E2A\u4E92\u4E0D\u4F9D\u8D56\u3001\u53EA\u8BFB\u4E14\u5E76\u53D1\u5B89\u5168\u7684\u5DE5\u5177\u8C03\u7528\uFF0C\u5E0C\u671B\u5E76\u884C\u52A0\u901F\u5E76\u6C47\u603B\u7ED3\u679C
|
|
30675
|
+
- \u4F55\u65F6\u4E0D\u4F7F\u7528\uFF1A\u5B58\u5728\u4F9D\u8D56\u6216\u5171\u4EAB\u72B6\u6001\u3001\u9700\u8981\u987A\u5E8F\u3001\u6216\u5DE5\u5177\u975E\u53EA\u8BFB/\u975E\u5E76\u53D1\u5B89\u5168
|
|
30676
|
+
- \u62C6\u5206\u89C4\u5219\uFF1A\u6709\u4F9D\u8D56\u7684\u8C03\u7528\u62C6\u6210\u987A\u5E8F batch\uFF08\u524D\u4E00\u6279\u5B8C\u6210\u540E\u518D\u53D1\u4E0B\u4E00\u6279\uFF09
|
|
30677
|
+
- \u8303\u56F4\u9650\u5236\uFF1A\u4EC5\u9650\u53EA\u8BFB\u5E76\u53D1\u5B89\u5168\u5DE5\u5177\uFF1BMCP/\u5E02\u573A\u5DE5\u5177\u4E0D\u53EF\u8FDB\u5165 batch
|
|
30678
|
+
- \u9650\u5236\uFF1A\u6700\u591A 10 \u4E2A\uFF0C\u7981\u6B62 batch \u5D4C\u5957
|
|
30679
|
+
- \u4F18\u5148\u7EA7\uFF1A\u5B58\u5728\u591A\u4E2A\u53EF batch \u7684\u8C03\u7528\u65F6\uFF0C\u4F18\u5148\u4F7F\u7528 BatchTool \u5355\u6B21\u6267\u884C\u800C\u4E0D\u662F\u591A\u6761\u5E76\u884C tool \u8C03\u7528
|
|
30680
|
+
- \u53EA\u8BFB\u5E76\u53D1\u4F18\u5148\u4F7F\u7528 BatchTool\uFF0C\u4E0D\u8981\u8F93\u51FA\u591A\u4E2A\u72EC\u7ACB\u7684 Read/Grep
|
|
30681
|
+
|
|
30549
30682
|
# LSP \u540E\u7F6E\u4E0E\u8303\u56F4\u9650\u5236
|
|
30550
30683
|
- \u4F18\u5148\u987A\u5E8F\uFF1A\u7ED3\u6784\u6811 -> \u70ED\u70B9\u5B9A\u4F4D -> Read -> LSP
|
|
30551
30684
|
- workspaceSymbol \u5FC5\u987B\u63D0\u4F9B\u660E\u786E\u7684\u8DEF\u5F84/\u6A21\u5757\u8303\u56F4\uFF0C\u907F\u514D\u5BF9\u5168\u4ED3\u5E93\u65E0\u754C\u67E5\u8BE2
|
|
@@ -30664,8 +30797,8 @@ NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTAN
|
|
|
30664
30797
|
|
|
30665
30798
|
# Cognitive Search Strategy
|
|
30666
30799
|
1. **Concept Search**: WHEN searching for high-level concepts (e.g., "Auth Logic", "Payment Flow") OR when you are uncertain about exact naming, you MUST use \`semantic: true\` in Grep/Glob tools. This activates the LSP Workspace Symbol search which is resilient to typos and fuzzy matches.
|
|
30667
|
-
- Example: \`
|
|
30668
|
-
- Example: \`
|
|
30800
|
+
- Example: \`Grep(pattern: "AuthFeatr", semantic: true)\` will find "AuthFeature".
|
|
30801
|
+
- Example: \`Glob(pattern: "tests", semantic: true)\` will find test files based on project structure.
|
|
30669
30802
|
2. **Exact Identifier**: WHEN you know the precise class/function name (e.g., "UserProfile", "initDatabase"), use standard Grep/Glob without \`semantic\` flag.
|
|
30670
30803
|
3. **Exploration**: If standard search returns 0 results, AUTOMATICALLY retry with \`semantic: true\`.
|
|
30671
30804
|
|
|
@@ -30684,13 +30817,11 @@ When you need to modify files, rely on the **Edit Tool** for almost all tasks.
|
|
|
30684
30817
|
|
|
30685
30818
|
# Cognitive Safety & Verification
|
|
30686
30819
|
1. **Modification Check**: Before editing, you MUST verify if the change is already present (e.g. use \`grep\` or \`read\`). Do not rely on your memory or previous turns.
|
|
30687
|
-
2. **Precise Targeting**: For code injection, prefer using LSP (\`
|
|
30820
|
+
2. **Precise Targeting**: For code injection, prefer using LSP (\`LSP.documentSymbol\` or \`LSP.definition\`) to find exact function boundaries or symbol ranges. Do NOT rely on line numbers from \`read_file\` alone as they may be outdated.
|
|
30688
30821
|
3. **Artifact Verification**: After completing a complex task, verify the artifacts (e.g. check if files exist using \`ls\`, or content matches using \`grep\`).
|
|
30689
30822
|
|
|
30690
30823
|
${isOutputStyleActive ? "" : "\nYou MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail.\n"}
|
|
30691
30824
|
`,
|
|
30692
|
-
`
|
|
30693
|
-
${await getEnvInfo()}`,
|
|
30694
30825
|
...sessionStartAdditionalContext ? [`
|
|
30695
30826
|
${sessionStartAdditionalContext}`] : [],
|
|
30696
30827
|
`IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
|
|
@@ -30700,11 +30831,12 @@ IMPORTANT: Before you begin work, think about what the code you're editing is su
|
|
|
30700
30831
|
async function getEnvInfo() {
|
|
30701
30832
|
const isGit = await getIsGit();
|
|
30702
30833
|
return `Here is useful information about the environment you are running in:
|
|
30834
|
+
|
|
30703
30835
|
<env>
|
|
30836
|
+
Today's date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
|
|
30837
|
+
Platform: ${env.platform}
|
|
30704
30838
|
Working directory: ${getCwd()}
|
|
30705
30839
|
Is directory a git repo: ${isGit ? "Yes" : "No"}
|
|
30706
|
-
Platform: ${env.platform}
|
|
30707
|
-
Today's date: ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
|
|
30708
30840
|
</env>`;
|
|
30709
30841
|
}
|
|
30710
30842
|
async function getAgentPrompt() {
|
|
@@ -30764,6 +30896,8 @@ export {
|
|
|
30764
30896
|
addToHistory,
|
|
30765
30897
|
countTokens,
|
|
30766
30898
|
__isToolUseLikeBlockForTests,
|
|
30899
|
+
__autoBatchToolUseBlocksForTests,
|
|
30900
|
+
__rewriteToolUseBlocksForTests,
|
|
30767
30901
|
__ToolUseQueueForTests,
|
|
30768
30902
|
query,
|
|
30769
30903
|
runToolUse,
|