pybao-cli 1.3.45 → 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-JFLVFJY5.js → acp-YUBPN6OC.js} +26 -26
- package/dist/{agentsValidate-UOAZ6CLO.js → agentsValidate-RCXLT6VP.js} +7 -7
- package/dist/{ask-5NDJODMN.js → ask-33GMXL7B.js} +25 -25
- package/dist/{autoUpdater-BRMIOHSL.js → autoUpdater-ADXYRY6D.js} +3 -3
- package/dist/{chunk-2Z7YBO6E.js → chunk-23N4GPNM.js} +2 -2
- package/dist/{chunk-E6IRL6QV.js → chunk-2K5YIZQX.js} +3 -3
- package/dist/{chunk-UOM7ZAT6.js → chunk-3453KDSF.js} +2 -2
- package/dist/{chunk-5CTVR5Q6.js → chunk-3FNC6AV4.js} +1 -1
- package/dist/{chunk-N2FHJ6U4.js → chunk-4LHG7MYS.js} +4 -4
- package/dist/{chunk-6IIVHJGV.js → chunk-5SWTBK7L.js} +225 -168
- package/dist/chunk-5SWTBK7L.js.map +7 -0
- package/dist/{chunk-GAVRDBFN.js → chunk-A3A6NYJ2.js} +16 -2
- package/dist/{chunk-GAVRDBFN.js.map → chunk-A3A6NYJ2.js.map} +2 -2
- package/dist/{chunk-UFCGQTO4.js → chunk-BOSM57V7.js} +3 -3
- package/dist/{chunk-GLVXBTCT.js → chunk-CETM2NKE.js} +1 -1
- package/dist/{chunk-NXRBPOCH.js → chunk-GGFJFVNS.js} +234 -34
- package/dist/chunk-GGFJFVNS.js.map +7 -0
- package/dist/{chunk-L2BFFXW4.js → chunk-I3B2FBK7.js} +1 -1
- package/dist/{chunk-BTOANY7V.js → chunk-JNPNRVS2.js} +2 -2
- package/dist/{chunk-AGRA35OD.js → chunk-JRAFB2CB.js} +9 -10
- package/dist/{chunk-AGRA35OD.js.map → chunk-JRAFB2CB.js.map} +3 -3
- package/dist/{chunk-HIUUNW54.js → chunk-O3XEFDKI.js} +4 -4
- package/dist/{chunk-KE3E6FA3.js → chunk-OF4SOO4G.js} +1 -1
- package/dist/{chunk-KNS4Q44O.js → chunk-OJ53OUHU.js} +1 -1
- package/dist/{chunk-MVKNIY7Z.js → chunk-P6HZFN5C.js} +2 -2
- package/dist/{chunk-2SBENXGW.js → chunk-Q7LDH3YP.js} +3 -3
- package/dist/{chunk-CNAP3T53.js → chunk-TGANFBU5.js} +2 -2
- package/dist/{chunk-ALV4MHJN.js → chunk-U3765Q33.js} +1 -1
- package/dist/{chunk-PFUIIYWW.js → chunk-VL7XKFG5.js} +3 -3
- package/dist/{chunk-HUY7JVZZ.js → chunk-XP4IVXAJ.js} +1 -1
- package/dist/{chunk-FNCCWW7B.js → chunk-XQXGMAFO.js} +3 -3
- package/dist/{chunk-A53GWJD4.js → chunk-Y5OAQR5G.js} +3 -3
- package/dist/{chunk-3BADF34Z.js → chunk-YEF7W3LN.js} +3 -3
- package/dist/{chunk-AUXC4CLX.js → chunk-Z4VIOTMP.js} +1 -1
- package/dist/{chunk-BZANPWON.js → chunk-ZAODBBE3.js} +2 -2
- package/dist/{cli-7RE47DJU.js → cli-B6TRKPGV.js} +77 -77
- package/dist/commands-ISMHWT3A.js +46 -0
- package/dist/{config-GUMWM6SC.js → config-6FG42O7N.js} +4 -4
- package/dist/{context-OMUM4RKN.js → context-E2GOFLJ6.js} +5 -5
- package/dist/{customCommands-VHPG4ASN.js → customCommands-OGXM3GXW.js} +4 -4
- package/dist/{env-BD5U45ZD.js → env-AQNMECC7.js} +2 -2
- package/dist/index.js +3 -3
- package/dist/{llm-HWFG2UP5.js → llm-QK6IARCX.js} +26 -26
- package/dist/{llmLazy-UEYC2EBS.js → llmLazy-Z33BI7WQ.js} +1 -1
- package/dist/{loader-MSGFYDIO.js → loader-NM6XN5HZ.js} +4 -4
- package/dist/{mcp-QE4JN7P7.js → mcp-3XVAUOJU.js} +7 -7
- package/dist/{mentionProcessor-6A4FZD5Y.js → mentionProcessor-NRMXINWD.js} +5 -5
- package/dist/{messages-P4CKGVW2.js → messages-VA3HZVVD.js} +1 -1
- package/dist/{model-KDZW4RDD.js → model-M3TKSYQS.js} +5 -5
- package/dist/{openai-YSZM7ASL.js → openai-ULOIVEKP.js} +5 -5
- package/dist/{outputStyles-FAQB626H.js → outputStyles-G2GZANKG.js} +4 -4
- package/dist/{pluginRuntime-CPU5HOGV.js → pluginRuntime-WNRCXZQH.js} +6 -6
- package/dist/{pluginValidation-XRUYFDGQ.js → pluginValidation-KSWIYUJ3.js} +6 -6
- package/dist/prompts-NXU6HQAD.js +48 -0
- package/dist/{pybAgentSessionLoad-KKHAIX5D.js → pybAgentSessionLoad-FRGT6GPT.js} +4 -4
- package/dist/{pybAgentSessionResume-EWRTRK6S.js → pybAgentSessionResume-OSN6JMV6.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-T7LRMKYN.js → pybAgentStreamJsonSession-3TX4H6MC.js} +1 -1
- package/dist/{pybHooks-RAT4JLPA.js → pybHooks-CKNHWTIA.js} +4 -4
- package/dist/query-GK7KU4B2.js +50 -0
- package/dist/{ripgrep-TQ4PFRZH.js → ripgrep-MH6RRIO3.js} +3 -3
- package/dist/{skillMarketplace-4F6NSCPX.js → skillMarketplace-GWF2XCIA.js} +3 -3
- package/dist/{state-U3Y73WXY.js → state-5IAEBWVC.js} +2 -2
- package/dist/{theme-VDGDIXY6.js → theme-5JAHGSBI.js} +5 -5
- package/dist/{toolPermissionSettings-27F64353.js → toolPermissionSettings-T6G3AY6X.js} +6 -6
- package/dist/tools-MIHDVFR5.js +47 -0
- package/dist/{userInput-XU3VS3BW.js → userInput-PMJMJP4T.js} +27 -27
- package/package.json +16 -2
- package/dist/REPL-L7FH5QSH.js +0 -42
- package/dist/chunk-6IIVHJGV.js.map +0 -7
- package/dist/chunk-NXRBPOCH.js.map +0 -7
- package/dist/commands-TPQWTDD6.js +0 -46
- package/dist/prompts-QYQJGDVU.js +0 -48
- package/dist/query-ROP7BBFU.js +0 -50
- package/dist/tools-L7ZUFPUG.js +0 -47
- /package/dist/{REPL-L7FH5QSH.js.map → REPL-DWNKQNP6.js.map} +0 -0
- /package/dist/{acp-JFLVFJY5.js.map → acp-YUBPN6OC.js.map} +0 -0
- /package/dist/{agentsValidate-UOAZ6CLO.js.map → agentsValidate-RCXLT6VP.js.map} +0 -0
- /package/dist/{ask-5NDJODMN.js.map → ask-33GMXL7B.js.map} +0 -0
- /package/dist/{autoUpdater-BRMIOHSL.js.map → autoUpdater-ADXYRY6D.js.map} +0 -0
- /package/dist/{chunk-2Z7YBO6E.js.map → chunk-23N4GPNM.js.map} +0 -0
- /package/dist/{chunk-E6IRL6QV.js.map → chunk-2K5YIZQX.js.map} +0 -0
- /package/dist/{chunk-UOM7ZAT6.js.map → chunk-3453KDSF.js.map} +0 -0
- /package/dist/{chunk-5CTVR5Q6.js.map → chunk-3FNC6AV4.js.map} +0 -0
- /package/dist/{chunk-N2FHJ6U4.js.map → chunk-4LHG7MYS.js.map} +0 -0
- /package/dist/{chunk-UFCGQTO4.js.map → chunk-BOSM57V7.js.map} +0 -0
- /package/dist/{chunk-GLVXBTCT.js.map → chunk-CETM2NKE.js.map} +0 -0
- /package/dist/{chunk-L2BFFXW4.js.map → chunk-I3B2FBK7.js.map} +0 -0
- /package/dist/{chunk-BTOANY7V.js.map → chunk-JNPNRVS2.js.map} +0 -0
- /package/dist/{chunk-HIUUNW54.js.map → chunk-O3XEFDKI.js.map} +0 -0
- /package/dist/{chunk-KE3E6FA3.js.map → chunk-OF4SOO4G.js.map} +0 -0
- /package/dist/{chunk-KNS4Q44O.js.map → chunk-OJ53OUHU.js.map} +0 -0
- /package/dist/{chunk-MVKNIY7Z.js.map → chunk-P6HZFN5C.js.map} +0 -0
- /package/dist/{chunk-2SBENXGW.js.map → chunk-Q7LDH3YP.js.map} +0 -0
- /package/dist/{chunk-CNAP3T53.js.map → chunk-TGANFBU5.js.map} +0 -0
- /package/dist/{chunk-ALV4MHJN.js.map → chunk-U3765Q33.js.map} +0 -0
- /package/dist/{chunk-PFUIIYWW.js.map → chunk-VL7XKFG5.js.map} +0 -0
- /package/dist/{chunk-HUY7JVZZ.js.map → chunk-XP4IVXAJ.js.map} +0 -0
- /package/dist/{chunk-FNCCWW7B.js.map → chunk-XQXGMAFO.js.map} +0 -0
- /package/dist/{chunk-A53GWJD4.js.map → chunk-Y5OAQR5G.js.map} +0 -0
- /package/dist/{chunk-3BADF34Z.js.map → chunk-YEF7W3LN.js.map} +0 -0
- /package/dist/{chunk-AUXC4CLX.js.map → chunk-Z4VIOTMP.js.map} +0 -0
- /package/dist/{chunk-BZANPWON.js.map → chunk-ZAODBBE3.js.map} +0 -0
- /package/dist/{cli-7RE47DJU.js.map → cli-B6TRKPGV.js.map} +0 -0
- /package/dist/{commands-TPQWTDD6.js.map → commands-ISMHWT3A.js.map} +0 -0
- /package/dist/{config-GUMWM6SC.js.map → config-6FG42O7N.js.map} +0 -0
- /package/dist/{context-OMUM4RKN.js.map → context-E2GOFLJ6.js.map} +0 -0
- /package/dist/{customCommands-VHPG4ASN.js.map → customCommands-OGXM3GXW.js.map} +0 -0
- /package/dist/{env-BD5U45ZD.js.map → env-AQNMECC7.js.map} +0 -0
- /package/dist/{llm-HWFG2UP5.js.map → llm-QK6IARCX.js.map} +0 -0
- /package/dist/{llmLazy-UEYC2EBS.js.map → llmLazy-Z33BI7WQ.js.map} +0 -0
- /package/dist/{loader-MSGFYDIO.js.map → loader-NM6XN5HZ.js.map} +0 -0
- /package/dist/{mcp-QE4JN7P7.js.map → mcp-3XVAUOJU.js.map} +0 -0
- /package/dist/{mentionProcessor-6A4FZD5Y.js.map → mentionProcessor-NRMXINWD.js.map} +0 -0
- /package/dist/{messages-P4CKGVW2.js.map → messages-VA3HZVVD.js.map} +0 -0
- /package/dist/{model-KDZW4RDD.js.map → model-M3TKSYQS.js.map} +0 -0
- /package/dist/{openai-YSZM7ASL.js.map → openai-ULOIVEKP.js.map} +0 -0
- /package/dist/{outputStyles-FAQB626H.js.map → outputStyles-G2GZANKG.js.map} +0 -0
- /package/dist/{pluginRuntime-CPU5HOGV.js.map → pluginRuntime-WNRCXZQH.js.map} +0 -0
- /package/dist/{pluginValidation-XRUYFDGQ.js.map → pluginValidation-KSWIYUJ3.js.map} +0 -0
- /package/dist/{prompts-QYQJGDVU.js.map → prompts-NXU6HQAD.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-KKHAIX5D.js.map → pybAgentSessionLoad-FRGT6GPT.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-EWRTRK6S.js.map → pybAgentSessionResume-OSN6JMV6.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-T7LRMKYN.js.map → pybAgentStreamJsonSession-3TX4H6MC.js.map} +0 -0
- /package/dist/{pybHooks-RAT4JLPA.js.map → pybHooks-CKNHWTIA.js.map} +0 -0
- /package/dist/{query-ROP7BBFU.js.map → query-GK7KU4B2.js.map} +0 -0
- /package/dist/{ripgrep-TQ4PFRZH.js.map → ripgrep-MH6RRIO3.js.map} +0 -0
- /package/dist/{skillMarketplace-4F6NSCPX.js.map → skillMarketplace-GWF2XCIA.js.map} +0 -0
- /package/dist/{state-U3Y73WXY.js.map → state-5IAEBWVC.js.map} +0 -0
- /package/dist/{theme-VDGDIXY6.js.map → theme-5JAHGSBI.js.map} +0 -0
- /package/dist/{toolPermissionSettings-27F64353.js.map → toolPermissionSettings-T6G3AY6X.js.map} +0 -0
- /package/dist/{tools-L7ZUFPUG.js.map → tools-MIHDVFR5.js.map} +0 -0
- /package/dist/{userInput-XU3VS3BW.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,
|
|
@@ -245,7 +245,7 @@ import {
|
|
|
245
245
|
// src/tools/system/BashTool/BashTool.tsx
|
|
246
246
|
import { statSync as statSync12 } from "fs";
|
|
247
247
|
import { EOL as EOL3 } from "os";
|
|
248
|
-
import { isAbsolute as isAbsolute10, relative as relative13, resolve as
|
|
248
|
+
import { isAbsolute as isAbsolute10, relative as relative13, resolve as resolve11 } from "path";
|
|
249
249
|
import * as React109 from "react";
|
|
250
250
|
import { z as z16 } from "zod";
|
|
251
251
|
|
|
@@ -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
|
}
|
|
@@ -941,8 +941,8 @@ async function shouldAllowNetworkRequest(query2) {
|
|
|
941
941
|
}
|
|
942
942
|
async function serializePermissionPrompt(task) {
|
|
943
943
|
let release = null;
|
|
944
|
-
const next = new Promise((
|
|
945
|
-
release =
|
|
944
|
+
const next = new Promise((resolve12) => {
|
|
945
|
+
release = resolve12;
|
|
946
946
|
});
|
|
947
947
|
const prev = active.permissionPromptChain;
|
|
948
948
|
active.permissionPromptChain = prev.then(() => next);
|
|
@@ -975,18 +975,18 @@ async function cleanupSandboxNetworkInfrastructure() {
|
|
|
975
975
|
active.sessionDeniedHosts.clear();
|
|
976
976
|
active.inflightPermissionRequests.clear();
|
|
977
977
|
await Promise.allSettled([
|
|
978
|
-
httpServer ? new Promise((
|
|
978
|
+
httpServer ? new Promise((resolve12) => {
|
|
979
979
|
try {
|
|
980
|
-
httpServer.close(() =>
|
|
980
|
+
httpServer.close(() => resolve12());
|
|
981
981
|
} catch {
|
|
982
|
-
|
|
982
|
+
resolve12();
|
|
983
983
|
}
|
|
984
984
|
}) : Promise.resolve(),
|
|
985
|
-
socksServer ? new Promise((
|
|
985
|
+
socksServer ? new Promise((resolve12) => {
|
|
986
986
|
try {
|
|
987
|
-
socksServer.close(() =>
|
|
987
|
+
socksServer.close(() => resolve12());
|
|
988
988
|
} catch {
|
|
989
|
-
|
|
989
|
+
resolve12();
|
|
990
990
|
}
|
|
991
991
|
}) : Promise.resolve()
|
|
992
992
|
]);
|
|
@@ -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
|
|
@@ -1176,7 +1176,7 @@ async function startHttpProxy() {
|
|
|
1176
1176
|
clientSocket.on("data", onData);
|
|
1177
1177
|
});
|
|
1178
1178
|
active.httpProxyServer = server;
|
|
1179
|
-
return new Promise((
|
|
1179
|
+
return new Promise((resolve12, reject) => {
|
|
1180
1180
|
server.once("error", reject);
|
|
1181
1181
|
server.once("listening", () => {
|
|
1182
1182
|
const addr = server.address();
|
|
@@ -1185,7 +1185,7 @@ async function startHttpProxy() {
|
|
|
1185
1185
|
return;
|
|
1186
1186
|
}
|
|
1187
1187
|
server.unref();
|
|
1188
|
-
|
|
1188
|
+
resolve12(addr.port);
|
|
1189
1189
|
});
|
|
1190
1190
|
server.listen(0, "127.0.0.1");
|
|
1191
1191
|
});
|
|
@@ -1295,7 +1295,7 @@ async function startSocks5Proxy() {
|
|
|
1295
1295
|
socket.on("data", onData);
|
|
1296
1296
|
});
|
|
1297
1297
|
active.socksProxyServer = server;
|
|
1298
|
-
return new Promise((
|
|
1298
|
+
return new Promise((resolve12, reject) => {
|
|
1299
1299
|
server.once("error", reject);
|
|
1300
1300
|
server.once("listening", () => {
|
|
1301
1301
|
const addr = server.address();
|
|
@@ -1304,7 +1304,7 @@ async function startSocks5Proxy() {
|
|
|
1304
1304
|
return;
|
|
1305
1305
|
}
|
|
1306
1306
|
server.unref();
|
|
1307
|
-
|
|
1307
|
+
resolve12(addr.port);
|
|
1308
1308
|
});
|
|
1309
1309
|
server.listen(0, "127.0.0.1");
|
|
1310
1310
|
});
|
|
@@ -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}`);
|
|
@@ -9721,9 +9721,9 @@ function setTerminalTitle(title) {
|
|
|
9721
9721
|
}
|
|
9722
9722
|
}
|
|
9723
9723
|
function clearTerminal() {
|
|
9724
|
-
return new Promise((
|
|
9724
|
+
return new Promise((resolve12) => {
|
|
9725
9725
|
process.stdout.write("\x1B[2J\x1B[3J\x1B[H", () => {
|
|
9726
|
-
|
|
9726
|
+
resolve12();
|
|
9727
9727
|
});
|
|
9728
9728
|
});
|
|
9729
9729
|
}
|
|
@@ -10841,8 +10841,8 @@ var OAuthService = class {
|
|
|
10841
10841
|
await authURLHandler(manualUrl);
|
|
10842
10842
|
await openBrowser(autoUrl);
|
|
10843
10843
|
};
|
|
10844
|
-
const { authorizationCode, useManualRedirect } = await new Promise((
|
|
10845
|
-
this.pendingCodePromise = { resolve:
|
|
10844
|
+
const { authorizationCode, useManualRedirect } = await new Promise((resolve12, reject) => {
|
|
10845
|
+
this.pendingCodePromise = { resolve: resolve12, reject };
|
|
10846
10846
|
this.startLocalServer(state, onReady);
|
|
10847
10847
|
});
|
|
10848
10848
|
const {
|
|
@@ -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
|
}
|
|
@@ -13383,7 +13383,7 @@ function ModelSelector({
|
|
|
13383
13383
|
setModelLoadError(
|
|
13384
13384
|
`Attempt ${attempt}/${MAX_RETRIES}: Retrying model discovery...`
|
|
13385
13385
|
);
|
|
13386
|
-
await new Promise((
|
|
13386
|
+
await new Promise((resolve12) => setTimeout(resolve12, 1e3));
|
|
13387
13387
|
}
|
|
13388
13388
|
try {
|
|
13389
13389
|
const models = await fetchModels();
|
|
@@ -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
|
|
@@ -20023,7 +20023,7 @@ async function launchExternalEditor(initialText) {
|
|
|
20023
20023
|
}
|
|
20024
20024
|
}
|
|
20025
20025
|
try {
|
|
20026
|
-
await new Promise((
|
|
20026
|
+
await new Promise((resolve12, reject) => {
|
|
20027
20027
|
const child = spawn(
|
|
20028
20028
|
editorCommand.command,
|
|
20029
20029
|
[...editorCommand.args, filePath],
|
|
@@ -20035,7 +20035,7 @@ async function launchExternalEditor(initialText) {
|
|
|
20035
20035
|
child.on("error", reject);
|
|
20036
20036
|
child.on("exit", (code, signal) => {
|
|
20037
20037
|
if (code === 0 || code === null) {
|
|
20038
|
-
|
|
20038
|
+
resolve12();
|
|
20039
20039
|
} else {
|
|
20040
20040
|
reject(
|
|
20041
20041
|
new Error(
|
|
@@ -20086,7 +20086,7 @@ async function launchExternalEditorForFilePath(filePath) {
|
|
|
20086
20086
|
}
|
|
20087
20087
|
}
|
|
20088
20088
|
try {
|
|
20089
|
-
await new Promise((
|
|
20089
|
+
await new Promise((resolve12, reject) => {
|
|
20090
20090
|
const child = spawn(
|
|
20091
20091
|
editorCommand.command,
|
|
20092
20092
|
[...editorCommand.args, filePath],
|
|
@@ -20098,7 +20098,7 @@ async function launchExternalEditorForFilePath(filePath) {
|
|
|
20098
20098
|
child.on("error", reject);
|
|
20099
20099
|
child.on("exit", (code, signal) => {
|
|
20100
20100
|
if (code === 0 || code === null) {
|
|
20101
|
-
|
|
20101
|
+
resolve12();
|
|
20102
20102
|
} else {
|
|
20103
20103
|
reject(
|
|
20104
20104
|
new Error(
|
|
@@ -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.",
|
|
@@ -23428,7 +23428,7 @@ function PromptInput({
|
|
|
23428
23428
|
abortController.abort();
|
|
23429
23429
|
}
|
|
23430
23430
|
setIsLoading(false);
|
|
23431
|
-
await new Promise((
|
|
23431
|
+
await new Promise((resolve12) => setTimeout(resolve12, 0));
|
|
23432
23432
|
setIsLoading(true);
|
|
23433
23433
|
let finalInput2 = cleanInput;
|
|
23434
23434
|
for (const { placeholder: placeholder2, text } of pastedTexts) {
|
|
@@ -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 {
|
|
@@ -23896,11 +23896,11 @@ import { useCallback as useCallback14 } from "react";
|
|
|
23896
23896
|
function useCanUseTool(setToolUseConfirm) {
|
|
23897
23897
|
return useCallback14(
|
|
23898
23898
|
async (tool, input, toolUseContext, assistantMessage) => {
|
|
23899
|
-
return new Promise((
|
|
23899
|
+
return new Promise((resolve12) => {
|
|
23900
23900
|
function logCancelledEvent() {
|
|
23901
23901
|
}
|
|
23902
23902
|
function resolveWithCancelledAndAbortAllToolCalls(message) {
|
|
23903
|
-
|
|
23903
|
+
resolve12({
|
|
23904
23904
|
result: false,
|
|
23905
23905
|
message: message ? `${REJECT_MESSAGE_WITH_FEEDBACK_PREFIX}${message}` : REJECT_MESSAGE
|
|
23906
23906
|
});
|
|
@@ -23918,12 +23918,12 @@ function useCanUseTool(setToolUseConfirm) {
|
|
|
23918
23918
|
assistantMessage
|
|
23919
23919
|
).then(async (result) => {
|
|
23920
23920
|
if (result.result === true) {
|
|
23921
|
-
|
|
23921
|
+
resolve12({ result: true });
|
|
23922
23922
|
return;
|
|
23923
23923
|
}
|
|
23924
23924
|
const deniedResult = result;
|
|
23925
23925
|
if (deniedResult.shouldPromptUser === false) {
|
|
23926
|
-
|
|
23926
|
+
resolve12({ result: false, message: deniedResult.message });
|
|
23927
23927
|
return;
|
|
23928
23928
|
}
|
|
23929
23929
|
const [description2, commandPrefix] = await Promise.all([
|
|
@@ -23955,7 +23955,7 @@ function useCanUseTool(setToolUseConfirm) {
|
|
|
23955
23955
|
if (type2 === "permanent") {
|
|
23956
23956
|
} else {
|
|
23957
23957
|
}
|
|
23958
|
-
|
|
23958
|
+
resolve12({ result: true });
|
|
23959
23959
|
},
|
|
23960
23960
|
onReject(rejectionMessage) {
|
|
23961
23961
|
resolveWithCancelledAndAbortAllToolCalls(rejectionMessage);
|
|
@@ -24607,8 +24607,8 @@ var ToolUseQueue = class {
|
|
|
24607
24607
|
}
|
|
24608
24608
|
if (this.hasExecutingTools() && !this.hasCompletedResults() && !this.hasPendingProgress()) {
|
|
24609
24609
|
const promises = this.tools.filter((t) => t.status === "executing" && t.promise).map((t) => t.promise);
|
|
24610
|
-
const progressPromise = new Promise((
|
|
24611
|
-
this.progressAvailableResolve =
|
|
24610
|
+
const progressPromise = new Promise((resolve12) => {
|
|
24611
|
+
this.progressAvailableResolve = resolve12;
|
|
24612
24612
|
});
|
|
24613
24613
|
if (promises.length > 0) {
|
|
24614
24614
|
await Promise.race([...promises, progressPromise]);
|
|
@@ -25473,7 +25473,7 @@ function BinaryFeedbackView({
|
|
|
25473
25473
|
function BinaryFeedback({
|
|
25474
25474
|
m1,
|
|
25475
25475
|
m2,
|
|
25476
|
-
resolve:
|
|
25476
|
+
resolve: resolve12,
|
|
25477
25477
|
debug: debug2,
|
|
25478
25478
|
erroredToolUseIDs,
|
|
25479
25479
|
inProgressToolUseIDs,
|
|
@@ -25485,9 +25485,9 @@ function BinaryFeedback({
|
|
|
25485
25485
|
const onChoose = useCallback15(
|
|
25486
25486
|
(choice) => {
|
|
25487
25487
|
logBinaryFeedbackEvent(m1, m2, choice);
|
|
25488
|
-
|
|
25488
|
+
resolve12(getBinaryFeedbackResultForChoice(m1, m2, choice));
|
|
25489
25489
|
},
|
|
25490
|
-
[m1, m2,
|
|
25490
|
+
[m1, m2, resolve12]
|
|
25491
25491
|
);
|
|
25492
25492
|
useNotifyAfterTimeout(
|
|
25493
25493
|
`${PRODUCT_NAME} needs your input on a response comparison`
|
|
@@ -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:
|
|
@@ -26619,7 +26619,7 @@ var COLOR_OPTIONS = [
|
|
|
26619
26619
|
"cyan"
|
|
26620
26620
|
];
|
|
26621
26621
|
function openInEditor(filePath) {
|
|
26622
|
-
return new Promise((
|
|
26622
|
+
return new Promise((resolve12, reject) => {
|
|
26623
26623
|
const platform = process.platform;
|
|
26624
26624
|
let command4;
|
|
26625
26625
|
let args;
|
|
@@ -26642,7 +26642,7 @@ function openInEditor(filePath) {
|
|
|
26642
26642
|
child.on("error", (err) => reject(err));
|
|
26643
26643
|
child.on(
|
|
26644
26644
|
"exit",
|
|
26645
|
-
(code) => code === 0 ?
|
|
26645
|
+
(code) => code === 0 ? resolve12() : reject(new Error(`Editor exited with ${code}`))
|
|
26646
26646
|
);
|
|
26647
26647
|
});
|
|
26648
26648
|
}
|
|
@@ -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
|
|
@@ -29540,21 +29585,22 @@ var BashParser = class {
|
|
|
29540
29585
|
};
|
|
29541
29586
|
|
|
29542
29587
|
// src/utils/bash-parser/validator.ts
|
|
29543
|
-
|
|
29588
|
+
import { resolve as resolve10 } from "path";
|
|
29589
|
+
async function validateSafety(script, cwd2 = process.cwd()) {
|
|
29544
29590
|
const tree2 = await BashParser.parse(script);
|
|
29545
29591
|
const root = tree2.rootNode;
|
|
29546
|
-
validateNode(root, script);
|
|
29592
|
+
validateNode(root, script, cwd2);
|
|
29547
29593
|
}
|
|
29548
|
-
function validateNode(node, script) {
|
|
29594
|
+
function validateNode(node, script, cwd2) {
|
|
29549
29595
|
if (node.type === "command") {
|
|
29550
|
-
checkCommand(node, script);
|
|
29596
|
+
checkCommand(node, script, cwd2);
|
|
29551
29597
|
}
|
|
29552
29598
|
for (let i = 0; i < node.childCount; i++) {
|
|
29553
29599
|
const child = node.child(i);
|
|
29554
|
-
if (child) validateNode(child, script);
|
|
29600
|
+
if (child) validateNode(child, script, cwd2);
|
|
29555
29601
|
}
|
|
29556
29602
|
}
|
|
29557
|
-
function checkCommand(node, script) {
|
|
29603
|
+
function checkCommand(node, script, cwd2) {
|
|
29558
29604
|
const nameNode = node.childForFieldName("name");
|
|
29559
29605
|
if (!nameNode) return;
|
|
29560
29606
|
const commandName = nameNode.text.trim();
|
|
@@ -29571,7 +29617,6 @@ function checkCommand(node, script) {
|
|
|
29571
29617
|
const isRecursive = args.some((arg) => /^-.*r/.test(arg));
|
|
29572
29618
|
const criticalPaths = [
|
|
29573
29619
|
"/",
|
|
29574
|
-
"/*",
|
|
29575
29620
|
"/etc",
|
|
29576
29621
|
"/var",
|
|
29577
29622
|
"/usr",
|
|
@@ -29584,27 +29629,38 @@ function checkCommand(node, script) {
|
|
|
29584
29629
|
"/lib",
|
|
29585
29630
|
"/lib64",
|
|
29586
29631
|
"/opt",
|
|
29587
|
-
"C:\\",
|
|
29588
29632
|
"C:/",
|
|
29589
|
-
"C:\\Windows",
|
|
29590
29633
|
"C:/Windows",
|
|
29591
|
-
"C:\\Program Files",
|
|
29592
29634
|
"C:/Program Files"
|
|
29593
29635
|
];
|
|
29594
29636
|
const targetsCritical = args.some((arg) => {
|
|
29595
|
-
|
|
29596
|
-
|
|
29597
|
-
|
|
29637
|
+
if (arg.startsWith("-") || arg.startsWith("$")) return false;
|
|
29638
|
+
try {
|
|
29639
|
+
const absPath = resolve10(cwd2, arg).replace(/\\/g, "/");
|
|
29640
|
+
return criticalPaths.some((critical) => {
|
|
29641
|
+
const normalizedCritical = critical.endsWith("/") ? critical : critical + "/";
|
|
29642
|
+
if (absPath === critical || absPath === critical.replace(/\/$/, "")) return true;
|
|
29643
|
+
if (absPath.startsWith(normalizedCritical)) return true;
|
|
29644
|
+
return false;
|
|
29645
|
+
});
|
|
29646
|
+
} catch (e) {
|
|
29647
|
+
return criticalPaths.includes(arg);
|
|
29648
|
+
}
|
|
29598
29649
|
});
|
|
29599
29650
|
const originalCommand = node.text;
|
|
29600
29651
|
if (isRecursive && targetsCritical) {
|
|
29601
29652
|
throw new Error(`Security Alert: Potentially dangerous recursive deletion detected: "${originalCommand}". Execution blocked.`);
|
|
29602
29653
|
}
|
|
29603
|
-
const
|
|
29604
|
-
|
|
29605
|
-
|
|
29606
|
-
|
|
29607
|
-
|
|
29654
|
+
const targetsRoot = args.some((arg) => {
|
|
29655
|
+
if (arg.startsWith("-") || arg.startsWith("$")) return false;
|
|
29656
|
+
try {
|
|
29657
|
+
const absPath = resolve10(cwd2, arg).replace(/\\/g, "/");
|
|
29658
|
+
return absPath === "/" || /^[a-z]:\/?$/i.test(absPath);
|
|
29659
|
+
} catch {
|
|
29660
|
+
return arg === "/" || /^[a-z]:\/?$/i.test(arg);
|
|
29661
|
+
}
|
|
29662
|
+
});
|
|
29663
|
+
if (targetsRoot) {
|
|
29608
29664
|
throw new Error(`Security Alert: Root deletion detected: "${originalCommand}". Execution blocked.`);
|
|
29609
29665
|
}
|
|
29610
29666
|
}
|
|
@@ -29706,7 +29762,7 @@ var BashTool = {
|
|
|
29706
29762
|
async validateInput({ command: command4, timeout, dangerouslyDisableSandbox, cwd: cwd2 }, context) {
|
|
29707
29763
|
const trimmed = command4.trim();
|
|
29708
29764
|
try {
|
|
29709
|
-
await validateSafety(trimmed);
|
|
29765
|
+
await validateSafety(trimmed, cwd2 ? resolve11(getCwd(), cwd2) : getCwd());
|
|
29710
29766
|
} catch (e) {
|
|
29711
29767
|
return {
|
|
29712
29768
|
result: false,
|
|
@@ -29746,7 +29802,7 @@ var BashTool = {
|
|
|
29746
29802
|
};
|
|
29747
29803
|
}
|
|
29748
29804
|
if (cwd2) {
|
|
29749
|
-
const fullTargetDir = isAbsolute10(cwd2) ? cwd2 :
|
|
29805
|
+
const fullTargetDir = isAbsolute10(cwd2) ? cwd2 : resolve11(getCwd(), cwd2);
|
|
29750
29806
|
if (!isInDirectory(
|
|
29751
29807
|
relative13(getOriginalCwd(), fullTargetDir),
|
|
29752
29808
|
relative13(getCwd(), getOriginalCwd())
|
|
@@ -29766,7 +29822,7 @@ var BashTool = {
|
|
|
29766
29822
|
continue;
|
|
29767
29823
|
}
|
|
29768
29824
|
const targetDir = parts[1].replace(/^['"]|['"]$/g, "");
|
|
29769
|
-
const fullTargetDir = isAbsolute10(targetDir) ? targetDir :
|
|
29825
|
+
const fullTargetDir = isAbsolute10(targetDir) ? targetDir : resolve11(getCwd(), targetDir);
|
|
29770
29826
|
if (!isInDirectory(
|
|
29771
29827
|
relative13(getOriginalCwd(), fullTargetDir),
|
|
29772
29828
|
relative13(getCwd(), getOriginalCwd())
|
|
@@ -29851,9 +29907,9 @@ var BashTool = {
|
|
|
29851
29907
|
const safeMode = Boolean(context?.safeMode ?? context?.options?.safeMode);
|
|
29852
29908
|
const userPrompt = typeof context?.options?.lastUserPrompt === "string" ? context.options.lastUserPrompt.trim() : "";
|
|
29853
29909
|
const commandDescription = typeof description2 === "string" ? description2.trim() : "";
|
|
29854
|
-
const effectiveCwd = cwd2 ? isAbsolute10(cwd2) ? cwd2 :
|
|
29910
|
+
const effectiveCwd = cwd2 ? isAbsolute10(cwd2) ? cwd2 : resolve11(getCwd(), cwd2) : getCwd();
|
|
29855
29911
|
try {
|
|
29856
|
-
await validateSafety(command4);
|
|
29912
|
+
await validateSafety(command4, effectiveCwd);
|
|
29857
29913
|
} catch (error) {
|
|
29858
29914
|
const msg = error instanceof Error ? error.message : String(error);
|
|
29859
29915
|
const data = {
|
|
@@ -30001,7 +30057,7 @@ var BashTool = {
|
|
|
30001
30057
|
if (abortController.signal.aborted) return false;
|
|
30002
30058
|
const hostForUrl = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
30003
30059
|
const url2 = `http://${hostForUrl}:${port}/`;
|
|
30004
|
-
return await new Promise((
|
|
30060
|
+
return await new Promise((resolve12) => {
|
|
30005
30061
|
const assistantMessage = createAssistantMessage("");
|
|
30006
30062
|
if (context.messageId) {
|
|
30007
30063
|
;
|
|
@@ -30017,13 +30073,13 @@ var BashTool = {
|
|
|
30017
30073
|
suggestions: void 0,
|
|
30018
30074
|
riskScore: null,
|
|
30019
30075
|
onAbort() {
|
|
30020
|
-
|
|
30076
|
+
resolve12(false);
|
|
30021
30077
|
},
|
|
30022
30078
|
onAllow() {
|
|
30023
|
-
|
|
30079
|
+
resolve12(true);
|
|
30024
30080
|
},
|
|
30025
30081
|
onReject() {
|
|
30026
|
-
|
|
30082
|
+
resolve12(false);
|
|
30027
30083
|
}
|
|
30028
30084
|
};
|
|
30029
30085
|
setToolJSX({
|
|
@@ -30117,8 +30173,8 @@ var BashTool = {
|
|
|
30117
30173
|
);
|
|
30118
30174
|
let backgroundRequested = false;
|
|
30119
30175
|
let resolveBackground = null;
|
|
30120
|
-
const backgroundPromise = new Promise((
|
|
30121
|
-
resolveBackground =
|
|
30176
|
+
const backgroundPromise = new Promise((resolve12) => {
|
|
30177
|
+
resolveBackground = resolve12;
|
|
30122
30178
|
});
|
|
30123
30179
|
const requestBackground = () => {
|
|
30124
30180
|
if (backgroundRequested) return;
|
|
@@ -30161,7 +30217,7 @@ ${footerParts.join(" ")}`;
|
|
|
30161
30217
|
bashId
|
|
30162
30218
|
})),
|
|
30163
30219
|
new Promise(
|
|
30164
|
-
(
|
|
30220
|
+
(resolve12) => setTimeout(() => resolve12({ kind: "tick" }), waitMs)
|
|
30165
30221
|
)
|
|
30166
30222
|
]);
|
|
30167
30223
|
if (race.kind === "background") {
|
|
@@ -30195,7 +30251,7 @@ ${footerParts.join(" ")}`;
|
|
|
30195
30251
|
if (process.env.NODE_ENV !== "test") {
|
|
30196
30252
|
getCommandFilePaths(command4, stdout).then((filePaths) => {
|
|
30197
30253
|
for (const filePath of filePaths) {
|
|
30198
|
-
const fullFilePath = isAbsolute10(filePath) ? filePath :
|
|
30254
|
+
const fullFilePath = isAbsolute10(filePath) ? filePath : resolve11(getCwd(), filePath);
|
|
30199
30255
|
try {
|
|
30200
30256
|
readFileTimestamps[fullFilePath] = statSync12(fullFilePath).mtimeMs;
|
|
30201
30257
|
} catch (e) {
|
|
@@ -30457,6 +30513,7 @@ export {
|
|
|
30457
30513
|
KillShellTool,
|
|
30458
30514
|
TodoWriteTool,
|
|
30459
30515
|
hasPermissionsToUseTool,
|
|
30516
|
+
loadLanguage,
|
|
30460
30517
|
BashTool,
|
|
30461
30518
|
getCLISyspromptPrefix,
|
|
30462
30519
|
getSystemPrompt,
|