pybao-cli 1.3.46 → 1.3.47
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-DWNKQNP6.js +42 -0
- package/dist/{acp-37ZYIFLI.js → acp-YUBPN6OC.js} +26 -26
- package/dist/{agentsValidate-ZT2GD2IR.js → agentsValidate-RCXLT6VP.js} +7 -7
- package/dist/{ask-PSYWFNDP.js → ask-33GMXL7B.js} +25 -25
- package/dist/{autoUpdater-HHBVZBYE.js → autoUpdater-ADXYRY6D.js} +3 -3
- package/dist/{chunk-HKQR7WT7.js → chunk-23N4GPNM.js} +2 -2
- package/dist/{chunk-QXB5JU22.js → chunk-2K5YIZQX.js} +3 -3
- package/dist/{chunk-JWIWFXZH.js → chunk-3453KDSF.js} +2 -2
- package/dist/{chunk-AHDLGGNV.js → chunk-3FNC6AV4.js} +1 -1
- package/dist/{chunk-XPNI6T7J.js → chunk-4LHG7MYS.js} +4 -4
- package/dist/{chunk-FREXXRCP.js → chunk-5SWTBK7L.js} +148 -102
- package/dist/{chunk-FREXXRCP.js.map → chunk-5SWTBK7L.js.map} +3 -3
- package/dist/{chunk-2B56EMQC.js → chunk-A3A6NYJ2.js} +16 -2
- package/dist/{chunk-2B56EMQC.js.map → chunk-A3A6NYJ2.js.map} +2 -2
- package/dist/{chunk-PN4VJABA.js → chunk-BOSM57V7.js} +3 -3
- package/dist/{chunk-FJROYNRY.js → chunk-CETM2NKE.js} +1 -1
- package/dist/{chunk-K25LUESX.js → chunk-GGFJFVNS.js} +234 -34
- package/dist/chunk-GGFJFVNS.js.map +7 -0
- package/dist/{chunk-UH5XH34C.js → chunk-I3B2FBK7.js} +1 -1
- package/dist/{chunk-AKPC4FCY.js → chunk-JNPNRVS2.js} +2 -2
- package/dist/{chunk-BKP3JI3M.js → chunk-JRAFB2CB.js} +1 -1
- package/dist/{chunk-J2QBYXHQ.js → chunk-O3XEFDKI.js} +4 -4
- package/dist/{chunk-EL65JN4A.js → chunk-OF4SOO4G.js} +1 -1
- package/dist/{chunk-YCIJ2LZ5.js → chunk-OJ53OUHU.js} +1 -1
- package/dist/{chunk-MLEJ32DL.js → chunk-P6HZFN5C.js} +2 -2
- package/dist/{chunk-2TG6N7RM.js → chunk-Q7LDH3YP.js} +3 -3
- package/dist/{chunk-BSKDTFG4.js → chunk-TGANFBU5.js} +2 -2
- package/dist/{chunk-VWOTB6OP.js → chunk-U3765Q33.js} +1 -1
- package/dist/{chunk-O77VW2OG.js → chunk-VL7XKFG5.js} +3 -3
- package/dist/{chunk-WCSNMHIZ.js → chunk-XP4IVXAJ.js} +1 -1
- package/dist/{chunk-GCQTTFVA.js → chunk-XQXGMAFO.js} +3 -3
- package/dist/{chunk-UJV74XPJ.js → chunk-Y5OAQR5G.js} +3 -3
- package/dist/{chunk-HZDNEHQ4.js → chunk-YEF7W3LN.js} +3 -3
- package/dist/{chunk-YOMMEAP6.js → chunk-Z4VIOTMP.js} +1 -1
- package/dist/{chunk-ZCIAAXXX.js → chunk-ZAODBBE3.js} +2 -2
- package/dist/{cli-7ZDUHVBY.js → cli-B6TRKPGV.js} +77 -77
- package/dist/commands-ISMHWT3A.js +46 -0
- package/dist/{config-GPGGIEEU.js → config-6FG42O7N.js} +4 -4
- package/dist/{context-XHGQOQ7L.js → context-E2GOFLJ6.js} +5 -5
- package/dist/{customCommands-SYMV4ZBK.js → customCommands-OGXM3GXW.js} +4 -4
- package/dist/{env-3UORUGI7.js → env-AQNMECC7.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{llm-Q5CFDHRJ.js → llm-QK6IARCX.js} +26 -26
- package/dist/{llmLazy-SZPYON2Y.js → llmLazy-Z33BI7WQ.js} +1 -1
- package/dist/{loader-DYMAU5JI.js → loader-NM6XN5HZ.js} +4 -4
- package/dist/{mcp-HYFQC5V2.js → mcp-3XVAUOJU.js} +7 -7
- package/dist/{mentionProcessor-Y6I42D6Q.js → mentionProcessor-NRMXINWD.js} +5 -5
- package/dist/{messages-BCVGUQ7P.js → messages-VA3HZVVD.js} +1 -1
- package/dist/{model-TCTZSQL7.js → model-M3TKSYQS.js} +5 -5
- package/dist/{openai-KH7QFYJN.js → openai-ULOIVEKP.js} +5 -5
- package/dist/{outputStyles-C6NCFK57.js → outputStyles-G2GZANKG.js} +4 -4
- package/dist/{pluginRuntime-T5ID6ROB.js → pluginRuntime-WNRCXZQH.js} +6 -6
- package/dist/{pluginValidation-C5BVZ5KJ.js → pluginValidation-KSWIYUJ3.js} +6 -6
- package/dist/prompts-NXU6HQAD.js +48 -0
- package/dist/{pybAgentSessionLoad-Z2HXKCCU.js → pybAgentSessionLoad-FRGT6GPT.js} +4 -4
- package/dist/{pybAgentSessionResume-4SEGOPFC.js → pybAgentSessionResume-OSN6JMV6.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-4K7VFMRX.js → pybAgentStreamJsonSession-3TX4H6MC.js} +1 -1
- package/dist/{pybHooks-QSPLL3AR.js → pybHooks-CKNHWTIA.js} +4 -4
- package/dist/query-GK7KU4B2.js +50 -0
- package/dist/{ripgrep-D2EUEDNQ.js → ripgrep-MH6RRIO3.js} +3 -3
- package/dist/{skillMarketplace-Q4PH6E25.js → skillMarketplace-GWF2XCIA.js} +3 -3
- package/dist/{state-Q4M7BXGL.js → state-5IAEBWVC.js} +2 -2
- package/dist/{theme-B3FIK2UP.js → theme-5JAHGSBI.js} +5 -5
- package/dist/{toolPermissionSettings-66WEVSDI.js → toolPermissionSettings-T6G3AY6X.js} +6 -6
- package/dist/tools-MIHDVFR5.js +47 -0
- package/dist/{userInput-UKA36YDI.js → userInput-PMJMJP4T.js} +27 -27
- package/package.json +16 -2
- package/dist/REPL-ANRALQZB.js +0 -42
- package/dist/chunk-K25LUESX.js.map +0 -7
- package/dist/commands-FGYR52JP.js +0 -46
- package/dist/prompts-IWS65CSD.js +0 -48
- package/dist/query-5OQI4E7J.js +0 -50
- package/dist/tools-HJT5SK6H.js +0 -47
- /package/dist/{REPL-ANRALQZB.js.map → REPL-DWNKQNP6.js.map} +0 -0
- /package/dist/{acp-37ZYIFLI.js.map → acp-YUBPN6OC.js.map} +0 -0
- /package/dist/{agentsValidate-ZT2GD2IR.js.map → agentsValidate-RCXLT6VP.js.map} +0 -0
- /package/dist/{ask-PSYWFNDP.js.map → ask-33GMXL7B.js.map} +0 -0
- /package/dist/{autoUpdater-HHBVZBYE.js.map → autoUpdater-ADXYRY6D.js.map} +0 -0
- /package/dist/{chunk-HKQR7WT7.js.map → chunk-23N4GPNM.js.map} +0 -0
- /package/dist/{chunk-QXB5JU22.js.map → chunk-2K5YIZQX.js.map} +0 -0
- /package/dist/{chunk-JWIWFXZH.js.map → chunk-3453KDSF.js.map} +0 -0
- /package/dist/{chunk-AHDLGGNV.js.map → chunk-3FNC6AV4.js.map} +0 -0
- /package/dist/{chunk-XPNI6T7J.js.map → chunk-4LHG7MYS.js.map} +0 -0
- /package/dist/{chunk-PN4VJABA.js.map → chunk-BOSM57V7.js.map} +0 -0
- /package/dist/{chunk-FJROYNRY.js.map → chunk-CETM2NKE.js.map} +0 -0
- /package/dist/{chunk-UH5XH34C.js.map → chunk-I3B2FBK7.js.map} +0 -0
- /package/dist/{chunk-AKPC4FCY.js.map → chunk-JNPNRVS2.js.map} +0 -0
- /package/dist/{chunk-BKP3JI3M.js.map → chunk-JRAFB2CB.js.map} +0 -0
- /package/dist/{chunk-J2QBYXHQ.js.map → chunk-O3XEFDKI.js.map} +0 -0
- /package/dist/{chunk-EL65JN4A.js.map → chunk-OF4SOO4G.js.map} +0 -0
- /package/dist/{chunk-YCIJ2LZ5.js.map → chunk-OJ53OUHU.js.map} +0 -0
- /package/dist/{chunk-MLEJ32DL.js.map → chunk-P6HZFN5C.js.map} +0 -0
- /package/dist/{chunk-2TG6N7RM.js.map → chunk-Q7LDH3YP.js.map} +0 -0
- /package/dist/{chunk-BSKDTFG4.js.map → chunk-TGANFBU5.js.map} +0 -0
- /package/dist/{chunk-VWOTB6OP.js.map → chunk-U3765Q33.js.map} +0 -0
- /package/dist/{chunk-O77VW2OG.js.map → chunk-VL7XKFG5.js.map} +0 -0
- /package/dist/{chunk-WCSNMHIZ.js.map → chunk-XP4IVXAJ.js.map} +0 -0
- /package/dist/{chunk-GCQTTFVA.js.map → chunk-XQXGMAFO.js.map} +0 -0
- /package/dist/{chunk-UJV74XPJ.js.map → chunk-Y5OAQR5G.js.map} +0 -0
- /package/dist/{chunk-HZDNEHQ4.js.map → chunk-YEF7W3LN.js.map} +0 -0
- /package/dist/{chunk-YOMMEAP6.js.map → chunk-Z4VIOTMP.js.map} +0 -0
- /package/dist/{chunk-ZCIAAXXX.js.map → chunk-ZAODBBE3.js.map} +0 -0
- /package/dist/{cli-7ZDUHVBY.js.map → cli-B6TRKPGV.js.map} +0 -0
- /package/dist/{commands-FGYR52JP.js.map → commands-ISMHWT3A.js.map} +0 -0
- /package/dist/{config-GPGGIEEU.js.map → config-6FG42O7N.js.map} +0 -0
- /package/dist/{context-XHGQOQ7L.js.map → context-E2GOFLJ6.js.map} +0 -0
- /package/dist/{customCommands-SYMV4ZBK.js.map → customCommands-OGXM3GXW.js.map} +0 -0
- /package/dist/{env-3UORUGI7.js.map → env-AQNMECC7.js.map} +0 -0
- /package/dist/{llm-Q5CFDHRJ.js.map → llm-QK6IARCX.js.map} +0 -0
- /package/dist/{llmLazy-SZPYON2Y.js.map → llmLazy-Z33BI7WQ.js.map} +0 -0
- /package/dist/{loader-DYMAU5JI.js.map → loader-NM6XN5HZ.js.map} +0 -0
- /package/dist/{mcp-HYFQC5V2.js.map → mcp-3XVAUOJU.js.map} +0 -0
- /package/dist/{mentionProcessor-Y6I42D6Q.js.map → mentionProcessor-NRMXINWD.js.map} +0 -0
- /package/dist/{messages-BCVGUQ7P.js.map → messages-VA3HZVVD.js.map} +0 -0
- /package/dist/{model-TCTZSQL7.js.map → model-M3TKSYQS.js.map} +0 -0
- /package/dist/{openai-KH7QFYJN.js.map → openai-ULOIVEKP.js.map} +0 -0
- /package/dist/{outputStyles-C6NCFK57.js.map → outputStyles-G2GZANKG.js.map} +0 -0
- /package/dist/{pluginRuntime-T5ID6ROB.js.map → pluginRuntime-WNRCXZQH.js.map} +0 -0
- /package/dist/{pluginValidation-C5BVZ5KJ.js.map → pluginValidation-KSWIYUJ3.js.map} +0 -0
- /package/dist/{prompts-IWS65CSD.js.map → prompts-NXU6HQAD.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-Z2HXKCCU.js.map → pybAgentSessionLoad-FRGT6GPT.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-4SEGOPFC.js.map → pybAgentSessionResume-OSN6JMV6.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-4K7VFMRX.js.map → pybAgentStreamJsonSession-3TX4H6MC.js.map} +0 -0
- /package/dist/{pybHooks-QSPLL3AR.js.map → pybHooks-CKNHWTIA.js.map} +0 -0
- /package/dist/{query-5OQI4E7J.js.map → query-GK7KU4B2.js.map} +0 -0
- /package/dist/{ripgrep-D2EUEDNQ.js.map → ripgrep-MH6RRIO3.js.map} +0 -0
- /package/dist/{skillMarketplace-Q4PH6E25.js.map → skillMarketplace-GWF2XCIA.js.map} +0 -0
- /package/dist/{state-Q4M7BXGL.js.map → state-5IAEBWVC.js.map} +0 -0
- /package/dist/{theme-B3FIK2UP.js.map → theme-5JAHGSBI.js.map} +0 -0
- /package/dist/{toolPermissionSettings-66WEVSDI.js.map → toolPermissionSettings-T6G3AY6X.js.map} +0 -0
- /package/dist/{tools-HJT5SK6H.js.map → tools-MIHDVFR5.js.map} +0 -0
- /package/dist/{userInput-UKA36YDI.js.map → userInput-PMJMJP4T.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import { createRequire as __pybCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __pybCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
listPybAgentSessions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-U3765Q33.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_TIMEOUT_MS,
|
|
8
8
|
FallbackToolUseRejectedMessage,
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
listMCPServers,
|
|
17
17
|
loadMergedSettings,
|
|
18
18
|
normalizeSandboxRuntimeConfigFromSettings
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-O3XEFDKI.js";
|
|
20
20
|
import {
|
|
21
21
|
formatValidationResult,
|
|
22
22
|
validatePluginOrMarketplacePath
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BOSM57V7.js";
|
|
24
24
|
import {
|
|
25
25
|
addMarketplace,
|
|
26
26
|
disableSkillPlugin,
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
refreshMarketplaceAsync,
|
|
34
34
|
removeMarketplace,
|
|
35
35
|
uninstallSkillPlugin
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3FNC6AV4.js";
|
|
37
37
|
import {
|
|
38
38
|
loadPybAgentSessionMessages
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-Z4VIOTMP.js";
|
|
40
40
|
import {
|
|
41
41
|
appendSessionCustomTitleRecord,
|
|
42
42
|
appendSessionJsonlFromMessage,
|
|
43
43
|
appendSessionTagRecord
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-3453KDSF.js";
|
|
45
45
|
import {
|
|
46
46
|
getRequestStatus,
|
|
47
47
|
setRequestStatus,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
runStopHooks,
|
|
59
59
|
runUserPromptSubmitHooks,
|
|
60
60
|
updateHookTranscriptForMessages
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-2K5YIZQX.js";
|
|
62
62
|
import {
|
|
63
63
|
getPybAgentSessionId,
|
|
64
64
|
setPybAgentSessionId
|
|
@@ -71,35 +71,35 @@ import {
|
|
|
71
71
|
getOutputStyleSystemPromptAdditions,
|
|
72
72
|
resolveOutputStyleName,
|
|
73
73
|
setCurrentOutputStyle
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-23N4GPNM.js";
|
|
75
75
|
import {
|
|
76
76
|
fetchCustomModels,
|
|
77
77
|
getModelFeatures
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-ZAODBBE3.js";
|
|
79
79
|
import {
|
|
80
80
|
queryLLM,
|
|
81
81
|
queryQuick,
|
|
82
82
|
verifyApiKey
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-4LHG7MYS.js";
|
|
84
84
|
import {
|
|
85
85
|
listAllContentFiles,
|
|
86
86
|
ripGrep,
|
|
87
87
|
tree
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-OF4SOO4G.js";
|
|
89
89
|
import {
|
|
90
90
|
getCustomCommandDirectories,
|
|
91
91
|
hasCustomCommands,
|
|
92
92
|
loadCustomCommands,
|
|
93
93
|
reloadCustomCommands
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-JNPNRVS2.js";
|
|
95
95
|
import {
|
|
96
96
|
loadToolPermissionContextFromDisk,
|
|
97
97
|
persistToolPermissionUpdateToDisk
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-Q7LDH3YP.js";
|
|
99
99
|
import {
|
|
100
100
|
getSettingsFileCandidates,
|
|
101
101
|
loadSettingsWithLegacyFallback
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-I3B2FBK7.js";
|
|
103
103
|
import {
|
|
104
104
|
applyToolPermissionContextUpdate,
|
|
105
105
|
createDefaultToolPermissionContext
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
resetReminderSession,
|
|
113
113
|
setTodos,
|
|
114
114
|
systemReminderService
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-TGANFBU5.js";
|
|
116
116
|
import {
|
|
117
117
|
getSessionState
|
|
118
118
|
} from "./chunk-ERMQRV55.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
getActiveAgents,
|
|
122
122
|
getAgentByType,
|
|
123
123
|
getAllAgents
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-P6HZFN5C.js";
|
|
125
125
|
import {
|
|
126
126
|
getSessionPlugins
|
|
127
127
|
} from "./chunk-BJSWTHRM.js";
|
|
@@ -154,22 +154,22 @@ import {
|
|
|
154
154
|
processUserInput,
|
|
155
155
|
reorderMessages,
|
|
156
156
|
stripSystemMessages
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-XP4IVXAJ.js";
|
|
158
158
|
import {
|
|
159
159
|
ModelManager,
|
|
160
160
|
getModelManager,
|
|
161
161
|
isDefaultSlowAndCapableModel
|
|
162
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-VL7XKFG5.js";
|
|
163
163
|
import {
|
|
164
164
|
getCodeStyle,
|
|
165
165
|
getContext,
|
|
166
166
|
getGitState,
|
|
167
167
|
getIsGit,
|
|
168
168
|
getProjectDocs
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-Y5OAQR5G.js";
|
|
170
170
|
import {
|
|
171
171
|
getTheme
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-OJ53OUHU.js";
|
|
173
173
|
import {
|
|
174
174
|
DEFAULT_GLOBAL_CONFIG,
|
|
175
175
|
enableConfigs,
|
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
saveGlobalConfig,
|
|
183
183
|
setAllPointersToModel,
|
|
184
184
|
setModelPointer
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-XQXGMAFO.js";
|
|
186
186
|
import {
|
|
187
187
|
AbortError
|
|
188
188
|
} from "./chunk-RQVLBMP7.js";
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
getCurrentRequest,
|
|
192
192
|
logUserFriendly,
|
|
193
193
|
markPhase
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-CETM2NKE.js";
|
|
195
195
|
import {
|
|
196
196
|
ASCII_LOGO,
|
|
197
197
|
BunShell,
|
|
@@ -227,10 +227,10 @@ import {
|
|
|
227
227
|
renderBashNotification,
|
|
228
228
|
setActivePlanConversationKey,
|
|
229
229
|
setCwd
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-JRAFB2CB.js";
|
|
231
231
|
import {
|
|
232
232
|
MACRO
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-A3A6NYJ2.js";
|
|
234
234
|
import {
|
|
235
235
|
formatTotalCost,
|
|
236
236
|
getTotalAPIDuration,
|
|
@@ -418,7 +418,7 @@ var getCommandSubcommandPrefix = memoize(
|
|
|
418
418
|
var getCommandPrefix = memoize(
|
|
419
419
|
async (command4, abortSignal) => {
|
|
420
420
|
const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
|
|
421
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-
|
|
421
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-QK6IARCX.js");
|
|
422
422
|
const response = await queryQuick2({
|
|
423
423
|
systemPrompt,
|
|
424
424
|
userPrompt,
|
|
@@ -561,7 +561,7 @@ function writeTextContent(filePath, content, encoding, endings) {
|
|
|
561
561
|
writeFileSync(filePath, toWrite, { encoding, flush: true });
|
|
562
562
|
}
|
|
563
563
|
var repoEndingCache = new LRUCache({
|
|
564
|
-
fetchMethod: (
|
|
564
|
+
fetchMethod: (path6) => detectRepoLineEndingsDirect(path6),
|
|
565
565
|
ttl: 5 * 60 * 1e3,
|
|
566
566
|
ttlAutopurge: false,
|
|
567
567
|
max: 1e3
|
|
@@ -593,7 +593,7 @@ function fetch2(cache, key, value) {
|
|
|
593
593
|
return v;
|
|
594
594
|
}
|
|
595
595
|
var fileEncodingCache = new LRUCache({
|
|
596
|
-
fetchMethod: (
|
|
596
|
+
fetchMethod: (path6) => detectFileEncodingDirect(path6),
|
|
597
597
|
ttl: 5 * 60 * 1e3,
|
|
598
598
|
ttlAutopurge: false,
|
|
599
599
|
max: 1e3
|
|
@@ -625,7 +625,7 @@ function detectFileEncodingDirect(filePath) {
|
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
627
|
var lineEndingCache = new LRUCache({
|
|
628
|
-
fetchMethod: (
|
|
628
|
+
fetchMethod: (path6) => detectLineEndingsDirect(path6),
|
|
629
629
|
ttl: 5 * 60 * 1e3,
|
|
630
630
|
ttlAutopurge: false,
|
|
631
631
|
max: 1e3
|
|
@@ -674,11 +674,11 @@ function normalizeFilePath(filePath) {
|
|
|
674
674
|
}
|
|
675
675
|
return absoluteFilePath;
|
|
676
676
|
}
|
|
677
|
-
function getAbsolutePath(
|
|
678
|
-
return
|
|
677
|
+
function getAbsolutePath(path6) {
|
|
678
|
+
return path6 ? isAbsolute(path6) ? path6 : resolve(getCwd(), path6) : void 0;
|
|
679
679
|
}
|
|
680
|
-
function getAbsoluteAndRelativePaths(
|
|
681
|
-
const absolutePath = getAbsolutePath(
|
|
680
|
+
function getAbsoluteAndRelativePaths(path6) {
|
|
681
|
+
const absolutePath = getAbsolutePath(path6);
|
|
682
682
|
const relativePath = absolutePath ? relative(getCwd(), absolutePath) : void 0;
|
|
683
683
|
return { absolutePath, relativePath };
|
|
684
684
|
}
|
|
@@ -1139,9 +1139,9 @@ async function startHttpProxy() {
|
|
|
1139
1139
|
writeHttpErrorResponse(clientSocket, "502 Bad Gateway");
|
|
1140
1140
|
});
|
|
1141
1141
|
upstream.once("connect", () => {
|
|
1142
|
-
const
|
|
1142
|
+
const path6 = `${targetUrl.pathname}${targetUrl.search}`;
|
|
1143
1143
|
try {
|
|
1144
|
-
upstream.write(`${method} ${
|
|
1144
|
+
upstream.write(`${method} ${path6} ${version}\r
|
|
1145
1145
|
`);
|
|
1146
1146
|
for (const [k, v] of Object.entries(headers)) {
|
|
1147
1147
|
upstream.write(`${k}: ${v}\r
|
|
@@ -4458,7 +4458,7 @@ function formatParseError(error) {
|
|
|
4458
4458
|
return error instanceof Error ? error.message : String(error);
|
|
4459
4459
|
}
|
|
4460
4460
|
async function defaultGateQuery(args) {
|
|
4461
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-
|
|
4461
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-QK6IARCX.js");
|
|
4462
4462
|
const messages = [
|
|
4463
4463
|
{
|
|
4464
4464
|
type: "user",
|
|
@@ -4536,7 +4536,7 @@ function writeGateFailureDump(args) {
|
|
|
4536
4536
|
const dir = join3(CACHE_PATHS.errors(), "bash-llm-gate");
|
|
4537
4537
|
mkdirSync(dir, { recursive: true });
|
|
4538
4538
|
const filename = `${dateToFilename(/* @__PURE__ */ new Date())}-${randomUUID()}.txt`;
|
|
4539
|
-
const
|
|
4539
|
+
const path6 = join3(dir, filename);
|
|
4540
4540
|
const body = [
|
|
4541
4541
|
"=== Bash LLM gate failure ===",
|
|
4542
4542
|
"",
|
|
@@ -4563,7 +4563,7 @@ function writeGateFailureDump(args) {
|
|
|
4563
4563
|
args.output ?? "",
|
|
4564
4564
|
""
|
|
4565
4565
|
].filter(Boolean).join("\n");
|
|
4566
|
-
writeFileSync2(
|
|
4566
|
+
writeFileSync2(path6, body, "utf8");
|
|
4567
4567
|
} catch {
|
|
4568
4568
|
}
|
|
4569
4569
|
}
|
|
@@ -6111,8 +6111,8 @@ var FileFreshnessService = class {
|
|
|
6111
6111
|
return this.state.readTimestamps.has(filePath);
|
|
6112
6112
|
}
|
|
6113
6113
|
getImportantFiles(maxFiles = 5) {
|
|
6114
|
-
return Array.from(this.state.readTimestamps.entries()).map(([
|
|
6115
|
-
path:
|
|
6114
|
+
return Array.from(this.state.readTimestamps.entries()).map(([path6, info]) => ({
|
|
6115
|
+
path: path6,
|
|
6116
6116
|
timestamp: info.lastRead,
|
|
6117
6117
|
size: info.size
|
|
6118
6118
|
})).filter((file) => this.isValidForRecovery(file.path)).sort((a, b) => b.timestamp - a.timestamp).slice(0, maxFiles);
|
|
@@ -6171,8 +6171,8 @@ import { dirname as dirname2, isAbsolute as isAbsolute2, resolve as resolve2, re
|
|
|
6171
6171
|
import { statSync as statSync3 } from "fs";
|
|
6172
6172
|
var readFileAllowedDirectories = /* @__PURE__ */ new Set();
|
|
6173
6173
|
var writeFileAllowedDirectories = /* @__PURE__ */ new Set();
|
|
6174
|
-
function toAbsolutePath(
|
|
6175
|
-
const abs = isAbsolute2(
|
|
6174
|
+
function toAbsolutePath(path6) {
|
|
6175
|
+
const abs = isAbsolute2(path6) ? resolve2(path6) : resolve2(getCwd(), path6);
|
|
6176
6176
|
return normalizeForCompare(abs);
|
|
6177
6177
|
}
|
|
6178
6178
|
function normalizeForCompare(p) {
|
|
@@ -6186,13 +6186,13 @@ function isSubpath(base, target) {
|
|
|
6186
6186
|
if (isAbsolute2(rel)) return false;
|
|
6187
6187
|
return true;
|
|
6188
6188
|
}
|
|
6189
|
-
function pathToPermissionDirectory(
|
|
6189
|
+
function pathToPermissionDirectory(path6) {
|
|
6190
6190
|
try {
|
|
6191
|
-
const stats = statSync3(
|
|
6192
|
-
if (stats.isDirectory()) return
|
|
6191
|
+
const stats = statSync3(path6);
|
|
6192
|
+
if (stats.isDirectory()) return path6;
|
|
6193
6193
|
} catch {
|
|
6194
6194
|
}
|
|
6195
|
-
return dirname2(
|
|
6195
|
+
return dirname2(path6);
|
|
6196
6196
|
}
|
|
6197
6197
|
function hasReadPermission(directory) {
|
|
6198
6198
|
if (isMainPlanFilePathForActiveConversation(directory)) return true;
|
|
@@ -6232,8 +6232,8 @@ function saveWritePermission(directory) {
|
|
|
6232
6232
|
}
|
|
6233
6233
|
writeFileAllowedDirectories.add(absolutePath);
|
|
6234
6234
|
}
|
|
6235
|
-
function grantWritePermissionForPath(
|
|
6236
|
-
const absolutePath = toAbsolutePath(
|
|
6235
|
+
function grantWritePermissionForPath(path6) {
|
|
6236
|
+
const absolutePath = toAbsolutePath(path6);
|
|
6237
6237
|
saveWritePermission(pathToPermissionDirectory(absolutePath));
|
|
6238
6238
|
}
|
|
6239
6239
|
|
|
@@ -7938,33 +7938,33 @@ var GlobTool = {
|
|
|
7938
7938
|
isConcurrencySafe() {
|
|
7939
7939
|
return true;
|
|
7940
7940
|
},
|
|
7941
|
-
needsPermissions({ path:
|
|
7942
|
-
return !hasReadPermission(
|
|
7941
|
+
needsPermissions({ path: path6 }) {
|
|
7942
|
+
return !hasReadPermission(path6 || getCwd());
|
|
7943
7943
|
},
|
|
7944
7944
|
async prompt() {
|
|
7945
7945
|
return DESCRIPTION4;
|
|
7946
7946
|
},
|
|
7947
|
-
async validateInput({ path:
|
|
7948
|
-
if (!
|
|
7949
|
-
const absolute = isAbsolute8(
|
|
7947
|
+
async validateInput({ path: path6 }) {
|
|
7948
|
+
if (!path6) return { result: true };
|
|
7949
|
+
const absolute = isAbsolute8(path6) ? path6 : resolve8(getCwd(), path6);
|
|
7950
7950
|
if (!existsSync6(absolute)) {
|
|
7951
7951
|
return {
|
|
7952
7952
|
result: false,
|
|
7953
|
-
message: `Directory does not exist: ${
|
|
7953
|
+
message: `Directory does not exist: ${path6}`,
|
|
7954
7954
|
errorCode: 1
|
|
7955
7955
|
};
|
|
7956
7956
|
}
|
|
7957
7957
|
if (!statSync8(absolute).isDirectory()) {
|
|
7958
7958
|
return {
|
|
7959
7959
|
result: false,
|
|
7960
|
-
message: `Path is not a directory: ${
|
|
7960
|
+
message: `Path is not a directory: ${path6}`,
|
|
7961
7961
|
errorCode: 2
|
|
7962
7962
|
};
|
|
7963
7963
|
}
|
|
7964
7964
|
return { result: true };
|
|
7965
7965
|
},
|
|
7966
|
-
renderToolUseMessage({ pattern, path:
|
|
7967
|
-
const absolutePath =
|
|
7966
|
+
renderToolUseMessage({ pattern, path: path6 }, { verbose }) {
|
|
7967
|
+
const absolutePath = path6 ? isAbsolute8(path6) ? path6 : resolve8(getCwd(), path6) : void 0;
|
|
7968
7968
|
const relativePath = absolutePath ? relative9(getCwd(), absolutePath) : void 0;
|
|
7969
7969
|
return `pattern: "${pattern}"${relativePath || verbose ? `, path: "${verbose ? absolutePath : relativePath}"` : ""}`;
|
|
7970
7970
|
},
|
|
@@ -7977,9 +7977,9 @@ var GlobTool = {
|
|
|
7977
7977
|
}
|
|
7978
7978
|
return /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "row" }, /* @__PURE__ */ React15.createElement(Text15, null, "\xA0\xA0\u23BF \xA0Found "), /* @__PURE__ */ React15.createElement(Text15, { bold: true }, output.numFiles, " "), /* @__PURE__ */ React15.createElement(Text15, null, output.numFiles === 0 || output.numFiles > 1 ? "files" : "file")), /* @__PURE__ */ React15.createElement(Cost, { costUSD: 0, durationMs: output.durationMs, debug: false }));
|
|
7979
7979
|
},
|
|
7980
|
-
async *call({ pattern, path:
|
|
7980
|
+
async *call({ pattern, path: path6 }, { abortController }) {
|
|
7981
7981
|
const start = Date.now();
|
|
7982
|
-
const searchPath =
|
|
7982
|
+
const searchPath = path6 ? isAbsolute8(path6) ? path6 : resolve8(getCwd(), path6) : getCwd();
|
|
7983
7983
|
const raw = await ripGrep(
|
|
7984
7984
|
[
|
|
7985
7985
|
"--files",
|
|
@@ -8144,8 +8144,8 @@ var GrepTool = {
|
|
|
8144
8144
|
async isEnabled() {
|
|
8145
8145
|
return true;
|
|
8146
8146
|
},
|
|
8147
|
-
needsPermissions({ path:
|
|
8148
|
-
return !hasReadPermission(
|
|
8147
|
+
needsPermissions({ path: path6 }) {
|
|
8148
|
+
return !hasReadPermission(path6 || getCwd());
|
|
8149
8149
|
},
|
|
8150
8150
|
async prompt() {
|
|
8151
8151
|
return DESCRIPTION5;
|
|
@@ -8153,7 +8153,7 @@ var GrepTool = {
|
|
|
8153
8153
|
renderToolUseMessage(input, { verbose }) {
|
|
8154
8154
|
const {
|
|
8155
8155
|
pattern,
|
|
8156
|
-
path:
|
|
8156
|
+
path: path6,
|
|
8157
8157
|
glob,
|
|
8158
8158
|
type: type2,
|
|
8159
8159
|
output_mode = "files_with_matches",
|
|
@@ -8161,8 +8161,8 @@ var GrepTool = {
|
|
|
8161
8161
|
} = input;
|
|
8162
8162
|
if (!pattern) return null;
|
|
8163
8163
|
const parts = [`pattern: "${pattern}"`];
|
|
8164
|
-
if (
|
|
8165
|
-
const { absolutePath, relativePath } = getAbsoluteAndRelativePaths(
|
|
8164
|
+
if (path6) {
|
|
8165
|
+
const { absolutePath, relativePath } = getAbsoluteAndRelativePaths(path6);
|
|
8166
8166
|
parts.push(`path: "${verbose ? absolutePath : relativePath}"`);
|
|
8167
8167
|
}
|
|
8168
8168
|
if (glob) parts.push(`glob: "${glob}"`);
|
|
@@ -8206,13 +8206,13 @@ Found ${numMatches} total ${numMatches === 1 ? "occurrence" : "occurrences"} acr
|
|
|
8206
8206
|
${result.filenames.join("\n")}`;
|
|
8207
8207
|
return truncateToCharBudget(header);
|
|
8208
8208
|
},
|
|
8209
|
-
async validateInput({ path:
|
|
8210
|
-
if (
|
|
8211
|
-
const abs = getAbsolutePath(
|
|
8209
|
+
async validateInput({ path: path6 }) {
|
|
8210
|
+
if (path6) {
|
|
8211
|
+
const abs = getAbsolutePath(path6);
|
|
8212
8212
|
if (!abs || !existsSync7(abs)) {
|
|
8213
8213
|
return {
|
|
8214
8214
|
result: false,
|
|
8215
|
-
message: `Path does not exist: ${
|
|
8215
|
+
message: `Path does not exist: ${path6}`,
|
|
8216
8216
|
errorCode: 1
|
|
8217
8217
|
};
|
|
8218
8218
|
}
|
|
@@ -8221,7 +8221,7 @@ ${result.filenames.join("\n")}`;
|
|
|
8221
8221
|
},
|
|
8222
8222
|
async *call({
|
|
8223
8223
|
pattern,
|
|
8224
|
-
path:
|
|
8224
|
+
path: path6,
|
|
8225
8225
|
glob,
|
|
8226
8226
|
type: type2,
|
|
8227
8227
|
output_mode = "files_with_matches",
|
|
@@ -8236,7 +8236,7 @@ ${result.filenames.join("\n")}`;
|
|
|
8236
8236
|
}, toolUseContext) {
|
|
8237
8237
|
const { abortController } = toolUseContext;
|
|
8238
8238
|
const start = Date.now();
|
|
8239
|
-
const absolutePath = getAbsolutePath(
|
|
8239
|
+
const absolutePath = getAbsolutePath(path6) || getCwd();
|
|
8240
8240
|
const baseArgs = ["--hidden"];
|
|
8241
8241
|
for (const dir of EXCLUDED_DIRS) {
|
|
8242
8242
|
baseArgs.push("--glob", `!${dir}`);
|
|
@@ -11013,7 +11013,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11013
11013
|
}
|
|
11014
11014
|
saveGlobalConfig(config2);
|
|
11015
11015
|
try {
|
|
11016
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11016
|
+
const { resetAnthropicClient } = await import("./llm-QK6IARCX.js");
|
|
11017
11017
|
resetAnthropicClient();
|
|
11018
11018
|
} catch {
|
|
11019
11019
|
}
|
|
@@ -15295,7 +15295,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15295
15295
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15296
15296
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15297
15297
|
if (dirs.length === 0) return [];
|
|
15298
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15298
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-WNRCXZQH.js");
|
|
15299
15299
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15300
15300
|
return errors;
|
|
15301
15301
|
}
|
|
@@ -15964,7 +15964,7 @@ async function call(onDone, context) {
|
|
|
15964
15964
|
ModelConfig,
|
|
15965
15965
|
{
|
|
15966
15966
|
onClose: () => {
|
|
15967
|
-
import("./model-
|
|
15967
|
+
import("./model-M3TKSYQS.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
15968
15968
|
reloadModelManager2();
|
|
15969
15969
|
triggerModelConfigChange();
|
|
15970
15970
|
onDone();
|
|
@@ -18860,13 +18860,13 @@ function isMultiFile(toolUseConfirm) {
|
|
|
18860
18860
|
}
|
|
18861
18861
|
return false;
|
|
18862
18862
|
}
|
|
18863
|
-
function pathToPermissionDirectory2(
|
|
18863
|
+
function pathToPermissionDirectory2(path6) {
|
|
18864
18864
|
try {
|
|
18865
|
-
const stats = statSync10(
|
|
18866
|
-
if (stats.isDirectory()) return
|
|
18865
|
+
const stats = statSync10(path6);
|
|
18866
|
+
if (stats.isDirectory()) return path6;
|
|
18867
18867
|
} catch {
|
|
18868
18868
|
}
|
|
18869
|
-
return dirname8(
|
|
18869
|
+
return dirname8(path6);
|
|
18870
18870
|
}
|
|
18871
18871
|
function pathFromToolUse(toolUseConfirm) {
|
|
18872
18872
|
const pathArgName = pathArgNameForToolUse(toolUseConfirm);
|
|
@@ -18885,8 +18885,8 @@ function FilesystemPermissionRequest({
|
|
|
18885
18885
|
onDone,
|
|
18886
18886
|
verbose
|
|
18887
18887
|
}) {
|
|
18888
|
-
const
|
|
18889
|
-
if (!
|
|
18888
|
+
const path6 = pathFromToolUse(toolUseConfirm);
|
|
18889
|
+
if (!path6) {
|
|
18890
18890
|
return /* @__PURE__ */ React80.createElement(
|
|
18891
18891
|
FallbackPermissionRequest,
|
|
18892
18892
|
{
|
|
@@ -18900,15 +18900,15 @@ function FilesystemPermissionRequest({
|
|
|
18900
18900
|
FilesystemPermissionRequestImpl,
|
|
18901
18901
|
{
|
|
18902
18902
|
toolUseConfirm,
|
|
18903
|
-
path:
|
|
18903
|
+
path: path6,
|
|
18904
18904
|
onDone,
|
|
18905
18905
|
verbose
|
|
18906
18906
|
}
|
|
18907
18907
|
);
|
|
18908
18908
|
}
|
|
18909
|
-
function getDontAskAgainOptions(toolUseConfirm,
|
|
18909
|
+
function getDontAskAgainOptions(toolUseConfirm, path6, modeCycleShortcut, isInWorkingDir, hasSessionSuggestion) {
|
|
18910
18910
|
if (!hasSessionSuggestion) return [];
|
|
18911
|
-
const permissionDirPath = pathToPermissionDirectory2(
|
|
18911
|
+
const permissionDirPath = pathToPermissionDirectory2(path6);
|
|
18912
18912
|
const permissionDirName = basename4(permissionDirPath) || "this directory";
|
|
18913
18913
|
if (toolUseConfirm.tool.isReadOnly(toolUseConfirm.input)) {
|
|
18914
18914
|
const label2 = isInWorkingDir ? "Yes, during this session" : `Yes, allow reading from ${chalk11.bold(`${permissionDirName}/`)} during this session`;
|
|
@@ -18922,7 +18922,7 @@ function getDontAskAgainOptions(toolUseConfirm, path5, modeCycleShortcut, isInWo
|
|
|
18922
18922
|
}
|
|
18923
18923
|
function FilesystemPermissionRequestImpl({
|
|
18924
18924
|
toolUseConfirm,
|
|
18925
|
-
path:
|
|
18925
|
+
path: path6,
|
|
18926
18926
|
onDone,
|
|
18927
18927
|
verbose
|
|
18928
18928
|
}) {
|
|
@@ -18943,8 +18943,8 @@ function FilesystemPermissionRequestImpl({
|
|
|
18943
18943
|
);
|
|
18944
18944
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
18945
18945
|
const permissionDirPath = useMemo18(
|
|
18946
|
-
() => pathToPermissionDirectory2(
|
|
18947
|
-
[
|
|
18946
|
+
() => pathToPermissionDirectory2(path6),
|
|
18947
|
+
[path6]
|
|
18948
18948
|
);
|
|
18949
18949
|
const isInWorkingDir = useMemo18(
|
|
18950
18950
|
() => isPathInWorkingDirectories(permissionDirPath, toolPermissionContext),
|
|
@@ -19042,7 +19042,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
19042
19042
|
},
|
|
19043
19043
|
...getDontAskAgainOptions(
|
|
19044
19044
|
toolUseConfirm,
|
|
19045
|
-
|
|
19045
|
+
path6,
|
|
19046
19046
|
modeCycleShortcut.displayText,
|
|
19047
19047
|
isInWorkingDir,
|
|
19048
19048
|
hasSessionSuggestion
|
|
@@ -23223,7 +23223,7 @@ function useStatusLine() {
|
|
|
23223
23223
|
// src/ui/components/PromptInput.tsx
|
|
23224
23224
|
async function interpretHashCommand(input) {
|
|
23225
23225
|
try {
|
|
23226
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
23226
|
+
const { queryQuick: queryQuick2 } = await import("./llm-QK6IARCX.js");
|
|
23227
23227
|
const systemPrompt = [
|
|
23228
23228
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
23229
23229
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -23536,7 +23536,7 @@ function PromptInput({
|
|
|
23536
23536
|
if (messages2.length) {
|
|
23537
23537
|
if (mode === "bash") {
|
|
23538
23538
|
onQuery(messages2, newAbortController).then(async () => {
|
|
23539
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
23539
|
+
const { getCwd: getCwd2 } = await import("./state-5IAEBWVC.js");
|
|
23540
23540
|
setCurrentPwd(getCwd2());
|
|
23541
23541
|
});
|
|
23542
23542
|
} else {
|
|
@@ -26322,7 +26322,7 @@ import { homedir as homedir7 } from "os";
|
|
|
26322
26322
|
// src/commands/agents/generation.ts
|
|
26323
26323
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
26324
26324
|
async function generateAgentWithClaude(prompt) {
|
|
26325
|
-
const { queryModel } = await import("./llm-
|
|
26325
|
+
const { queryModel } = await import("./llm-QK6IARCX.js");
|
|
26326
26326
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
26327
26327
|
|
|
26328
26328
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -27547,8 +27547,8 @@ function CreateAgentWizard(props) {
|
|
|
27547
27547
|
true
|
|
27548
27548
|
);
|
|
27549
27549
|
if (openEditor) {
|
|
27550
|
-
const
|
|
27551
|
-
await openInEditor(
|
|
27550
|
+
const path6 = getPrimaryAgentFilePath(location, finalAgent.agentType);
|
|
27551
|
+
await openInEditor(path6);
|
|
27552
27552
|
props.onComplete(
|
|
27553
27553
|
`Created agent: ${chalk15.bold(finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`
|
|
27554
27554
|
);
|
|
@@ -29491,22 +29491,67 @@ function WebFetchPermissionRequest({
|
|
|
29491
29491
|
}
|
|
29492
29492
|
|
|
29493
29493
|
// src/utils/tree-sitter/loader.ts
|
|
29494
|
-
import { createRequire } from "module";
|
|
29495
29494
|
import { Parser, Language } from "web-tree-sitter";
|
|
29496
|
-
|
|
29497
|
-
var
|
|
29498
|
-
|
|
29499
|
-
|
|
29500
|
-
|
|
29501
|
-
|
|
29495
|
+
import path5 from "path";
|
|
29496
|
+
var parserCache = /* @__PURE__ */ new Map();
|
|
29497
|
+
var isInitialized = false;
|
|
29498
|
+
var LANGUAGE_MAP = {
|
|
29499
|
+
bash: "tree-sitter-bash.wasm",
|
|
29500
|
+
typescript: "tree-sitter-typescript.wasm",
|
|
29501
|
+
tsx: "tree-sitter-tsx.wasm",
|
|
29502
|
+
python: "tree-sitter-python.wasm",
|
|
29503
|
+
rust: "tree-sitter-rust.wasm",
|
|
29504
|
+
go: "tree-sitter-go.wasm",
|
|
29505
|
+
java: "tree-sitter-java.wasm",
|
|
29506
|
+
cpp: "tree-sitter-cpp.wasm",
|
|
29507
|
+
c: "tree-sitter-c.wasm",
|
|
29508
|
+
c_sharp: "tree-sitter-c_sharp.wasm",
|
|
29509
|
+
scala: "tree-sitter-scala.wasm",
|
|
29510
|
+
haskell: "tree-sitter-haskell.wasm",
|
|
29511
|
+
julia: "tree-sitter-julia.wasm",
|
|
29512
|
+
ocaml: "tree-sitter-ocaml.wasm",
|
|
29513
|
+
swift: "tree-sitter-swift.wasm",
|
|
29514
|
+
nix: "tree-sitter-nix.wasm",
|
|
29515
|
+
ruby: "tree-sitter-ruby.wasm",
|
|
29516
|
+
html: "tree-sitter-html.wasm",
|
|
29517
|
+
css: "tree-sitter-css.wasm",
|
|
29518
|
+
json: "tree-sitter-json.wasm",
|
|
29519
|
+
yaml: "tree-sitter-yaml.wasm"
|
|
29520
|
+
};
|
|
29521
|
+
async function ensureInitialized() {
|
|
29522
|
+
if (isInitialized) return;
|
|
29523
|
+
const treeWasmPath = path5.resolve(__dirname, "../../../resources/tree-sitter/tree-sitter.wasm");
|
|
29502
29524
|
await Parser.init({
|
|
29503
29525
|
locateFile: () => treeWasmPath
|
|
29504
29526
|
});
|
|
29505
|
-
|
|
29506
|
-
|
|
29507
|
-
|
|
29508
|
-
|
|
29509
|
-
|
|
29527
|
+
isInitialized = true;
|
|
29528
|
+
}
|
|
29529
|
+
var loadLanguage = async (lang) => {
|
|
29530
|
+
if (parserCache.has(lang)) {
|
|
29531
|
+
return parserCache.get(lang);
|
|
29532
|
+
}
|
|
29533
|
+
await ensureInitialized();
|
|
29534
|
+
const fileName = LANGUAGE_MAP[lang];
|
|
29535
|
+
if (!fileName) {
|
|
29536
|
+
throw new Error(`Unsupported language: ${lang}`);
|
|
29537
|
+
}
|
|
29538
|
+
try {
|
|
29539
|
+
const wasmPath = path5.resolve(__dirname, "../../../resources/tree-sitter", fileName);
|
|
29540
|
+
const language = await Language.load(wasmPath);
|
|
29541
|
+
const parser = new Parser();
|
|
29542
|
+
parser.setLanguage(language);
|
|
29543
|
+
parserCache.set(lang, parser);
|
|
29544
|
+
return parser;
|
|
29545
|
+
} catch (error) {
|
|
29546
|
+
console.error(`Error loading language ${lang}:`, error);
|
|
29547
|
+
throw new Error(`Failed to load language ${lang}: ${error}`);
|
|
29548
|
+
}
|
|
29549
|
+
};
|
|
29550
|
+
var legacyParserInstance = null;
|
|
29551
|
+
var initParser = async () => {
|
|
29552
|
+
if (legacyParserInstance) return legacyParserInstance;
|
|
29553
|
+
legacyParserInstance = await loadLanguage("bash");
|
|
29554
|
+
return legacyParserInstance;
|
|
29510
29555
|
};
|
|
29511
29556
|
|
|
29512
29557
|
// src/utils/tree-sitter/parser.ts
|
|
@@ -30468,6 +30513,7 @@ export {
|
|
|
30468
30513
|
KillShellTool,
|
|
30469
30514
|
TodoWriteTool,
|
|
30470
30515
|
hasPermissionsToUseTool,
|
|
30516
|
+
loadLanguage,
|
|
30471
30517
|
BashTool,
|
|
30472
30518
|
getCLISyspromptPrefix,
|
|
30473
30519
|
getSystemPrompt,
|