pybao-cli 1.4.60 → 1.4.62
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-ATADQWNN.js +46 -0
- package/dist/{acp-E45JJIQK.js → acp-4NYI6JJF.js} +29 -29
- package/dist/{agentsValidate-WCLJMUFS.js → agentsValidate-LYXNTHHB.js} +7 -7
- package/dist/{ask-D5QONKUC.js → ask-3KUPARP2.js} +28 -28
- package/dist/{autoUpdater-6HCYR35P.js → autoUpdater-5XZ6744S.js} +3 -3
- package/dist/{chunk-OEDCAG3L.js → chunk-2YZZWT47.js} +3 -3
- package/dist/{chunk-PRLW2R2R.js → chunk-3EZMZ34Z.js} +1 -1
- package/dist/{chunk-LJLCZUZQ.js → chunk-3FXENPA3.js} +3 -3
- package/dist/{chunk-7IR32BFP.js → chunk-4HE4XCHW.js} +4 -4
- package/dist/{chunk-YSIDSO2P.js → chunk-5DB2HLP3.js} +16 -16
- package/dist/{chunk-5MIVMTW3.js → chunk-5NB4DS5W.js} +1 -1
- package/dist/{chunk-264EIILY.js → chunk-6CTJEKOL.js} +3 -3
- package/dist/{chunk-HGYFFC5R.js → chunk-CK2T76JI.js} +4 -4
- package/dist/{chunk-4I2D2KFY.js → chunk-DCVGTJDI.js} +4 -4
- package/dist/{chunk-HALXVKBG.js → chunk-FJJ6KZ7M.js} +3 -3
- package/dist/{chunk-LLRVPQKM.js → chunk-FPUIG2DR.js} +1 -1
- package/dist/{chunk-KMD3SYCF.js → chunk-GM5ZJ7DT.js} +1 -1
- package/dist/{chunk-EF34UHUH.js → chunk-KIQXQLEB.js} +4 -4
- package/dist/{chunk-3CJMCNQV.js → chunk-KYZ3A4WN.js} +5 -3
- package/dist/chunk-KYZ3A4WN.js.map +7 -0
- package/dist/{chunk-EKSPNQLL.js → chunk-LMLII7Q2.js} +1 -1
- package/dist/{chunk-NWDOI5R3.js → chunk-MDKDC5II.js} +2 -2
- package/dist/{chunk-QLL52LAG.js → chunk-NRSUWZK4.js} +3 -3
- package/dist/{chunk-CJ2ZE3PW.js → chunk-R2IRQSJC.js} +1 -1
- package/dist/{chunk-AVQWE3G4.js → chunk-RA5TQSRT.js} +1 -1
- package/dist/{chunk-KENEMSOE.js → chunk-RDRKGYMZ.js} +2 -2
- package/dist/{chunk-QIRPIHNE.js → chunk-S5EJ7KCA.js} +2 -2
- package/dist/{chunk-J42DBIOK.js → chunk-TNESUQAU.js} +1 -1
- package/dist/{chunk-J42DBIOK.js.map → chunk-TNESUQAU.js.map} +1 -1
- package/dist/{chunk-IPYGSBOY.js → chunk-ULOTS5TZ.js} +2 -2
- package/dist/{chunk-U7KPAZIL.js → chunk-WQTG6HED.js} +805 -402
- package/dist/chunk-WQTG6HED.js.map +7 -0
- package/dist/{chunk-NCIN5L25.js → chunk-XFYI2VDM.js} +2 -2
- package/dist/{chunk-7LTWIP6N.js → chunk-XGSY4SPL.js} +3 -3
- package/dist/{chunk-6G4MUNBC.js → chunk-XMP3P7UJ.js} +1 -1
- package/dist/{chunk-ZEVLVZLV.js → chunk-ZJIUQ235.js} +2 -2
- package/dist/{chunk-TPUJUEOD.js → chunk-ZUNHKV45.js} +2 -2
- package/dist/{chunk-O6TECK56.js → chunk-ZUR27DFA.js} +1 -1
- package/dist/{cli-YHG56XUI.js → cli-L7NI3IOT.js} +87 -87
- package/dist/commands-TMYYMQUF.js +50 -0
- package/dist/{config-3A6INLJZ.js → config-ZNO3N5FZ.js} +4 -4
- package/dist/{context-J4OQBUEZ.js → context-VDFTROLV.js} +6 -6
- package/dist/{customCommands-SC4NQGIV.js → customCommands-FKJZ22HA.js} +4 -4
- package/dist/{env-CBMMCZZ6.js → env-O6PWUAXR.js} +2 -2
- package/dist/{file-GQ5IBHFB.js → file-KPRV3JOY.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-7DBQPG47.js → llm-B56E7A3E.js} +29 -29
- package/dist/{llmLazy-X4SJWRZB.js → llmLazy-PLNA2YEW.js} +1 -1
- package/dist/{loader-42NKTU32.js → loader-JZCFB2Z4.js} +4 -4
- package/dist/{lsp-H3QYYNDE.js → lsp-LRWY5O2G.js} +6 -6
- package/dist/{lspAnchor-XQDA5ERF.js → lspAnchor-7TGKJJ7D.js} +6 -6
- package/dist/{mcp-5RV6EMTA.js → mcp-SMNK5RS5.js} +7 -7
- package/dist/{mentionProcessor-TEB2ZXF7.js → mentionProcessor-634SMOOJ.js} +5 -5
- package/dist/{messages-6FWGY3DY.js → messages-FB4NUTHM.js} +1 -1
- package/dist/{model-ZNDLNOQE.js → model-WH2Q6UZJ.js} +5 -5
- package/dist/{openai-Y7VUSKNQ.js → openai-BV6QP4OA.js} +5 -5
- package/dist/{outputStyles-Y34AOKLE.js → outputStyles-C6H6SVSA.js} +4 -4
- package/dist/{pluginRuntime-YTBMPQIP.js → pluginRuntime-IRKARA7H.js} +6 -6
- package/dist/{pluginValidation-SLHJEVJC.js → pluginValidation-MVWDIOU3.js} +6 -6
- package/dist/prompts-VHQWDKSG.js +52 -0
- package/dist/{pybAgentSessionLoad-5MNQGC4U.js → pybAgentSessionLoad-O2UIG72F.js} +4 -4
- package/dist/{pybAgentSessionResume-MR2BQPWN.js → pybAgentSessionResume-HVLEWJDM.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-T3PUD4KM.js → pybAgentStreamJsonSession-HJZ5DSEI.js} +1 -1
- package/dist/{pybHooks-QG5YXBFT.js → pybHooks-POMLIKQB.js} +4 -4
- package/dist/query-2MIHVE7W.js +54 -0
- package/dist/{registry-EHXEI6UI.js → registry-ODXCQP6E.js} +5 -5
- package/dist/{ripgrep-VDLTL76W.js → ripgrep-AQ7RJ4L2.js} +3 -3
- package/dist/{skillMarketplace-XDYJSPOO.js → skillMarketplace-WY7FEZKV.js} +3 -3
- package/dist/{state-YP6DLLAI.js → state-2EUXD6CF.js} +2 -2
- package/dist/{theme-DNTFOIH4.js → theme-6HMN6U2N.js} +5 -5
- package/dist/{toolPermissionSettings-VDQVUESB.js → toolPermissionSettings-NDOV3POK.js} +6 -6
- package/dist/tools-FVYTYAGD.js +51 -0
- package/dist/{userInput-67MTMZQX.js → userInput-OJ72YG7A.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-25MOGZSA.js +0 -46
- package/dist/chunk-3CJMCNQV.js.map +0 -7
- package/dist/chunk-U7KPAZIL.js.map +0 -7
- package/dist/commands-LZX67TTI.js +0 -50
- package/dist/prompts-ZGLENMR6.js +0 -52
- package/dist/query-2S5F2BKO.js +0 -54
- package/dist/tools-FK2V2NKA.js +0 -51
- /package/dist/{REPL-25MOGZSA.js.map → REPL-ATADQWNN.js.map} +0 -0
- /package/dist/{acp-E45JJIQK.js.map → acp-4NYI6JJF.js.map} +0 -0
- /package/dist/{agentsValidate-WCLJMUFS.js.map → agentsValidate-LYXNTHHB.js.map} +0 -0
- /package/dist/{ask-D5QONKUC.js.map → ask-3KUPARP2.js.map} +0 -0
- /package/dist/{autoUpdater-6HCYR35P.js.map → autoUpdater-5XZ6744S.js.map} +0 -0
- /package/dist/{chunk-OEDCAG3L.js.map → chunk-2YZZWT47.js.map} +0 -0
- /package/dist/{chunk-PRLW2R2R.js.map → chunk-3EZMZ34Z.js.map} +0 -0
- /package/dist/{chunk-LJLCZUZQ.js.map → chunk-3FXENPA3.js.map} +0 -0
- /package/dist/{chunk-7IR32BFP.js.map → chunk-4HE4XCHW.js.map} +0 -0
- /package/dist/{chunk-YSIDSO2P.js.map → chunk-5DB2HLP3.js.map} +0 -0
- /package/dist/{chunk-5MIVMTW3.js.map → chunk-5NB4DS5W.js.map} +0 -0
- /package/dist/{chunk-264EIILY.js.map → chunk-6CTJEKOL.js.map} +0 -0
- /package/dist/{chunk-HGYFFC5R.js.map → chunk-CK2T76JI.js.map} +0 -0
- /package/dist/{chunk-4I2D2KFY.js.map → chunk-DCVGTJDI.js.map} +0 -0
- /package/dist/{chunk-HALXVKBG.js.map → chunk-FJJ6KZ7M.js.map} +0 -0
- /package/dist/{chunk-LLRVPQKM.js.map → chunk-FPUIG2DR.js.map} +0 -0
- /package/dist/{chunk-KMD3SYCF.js.map → chunk-GM5ZJ7DT.js.map} +0 -0
- /package/dist/{chunk-EF34UHUH.js.map → chunk-KIQXQLEB.js.map} +0 -0
- /package/dist/{chunk-EKSPNQLL.js.map → chunk-LMLII7Q2.js.map} +0 -0
- /package/dist/{chunk-NWDOI5R3.js.map → chunk-MDKDC5II.js.map} +0 -0
- /package/dist/{chunk-QLL52LAG.js.map → chunk-NRSUWZK4.js.map} +0 -0
- /package/dist/{chunk-CJ2ZE3PW.js.map → chunk-R2IRQSJC.js.map} +0 -0
- /package/dist/{chunk-AVQWE3G4.js.map → chunk-RA5TQSRT.js.map} +0 -0
- /package/dist/{chunk-KENEMSOE.js.map → chunk-RDRKGYMZ.js.map} +0 -0
- /package/dist/{chunk-QIRPIHNE.js.map → chunk-S5EJ7KCA.js.map} +0 -0
- /package/dist/{chunk-IPYGSBOY.js.map → chunk-ULOTS5TZ.js.map} +0 -0
- /package/dist/{chunk-NCIN5L25.js.map → chunk-XFYI2VDM.js.map} +0 -0
- /package/dist/{chunk-7LTWIP6N.js.map → chunk-XGSY4SPL.js.map} +0 -0
- /package/dist/{chunk-6G4MUNBC.js.map → chunk-XMP3P7UJ.js.map} +0 -0
- /package/dist/{chunk-ZEVLVZLV.js.map → chunk-ZJIUQ235.js.map} +0 -0
- /package/dist/{chunk-TPUJUEOD.js.map → chunk-ZUNHKV45.js.map} +0 -0
- /package/dist/{chunk-O6TECK56.js.map → chunk-ZUR27DFA.js.map} +0 -0
- /package/dist/{cli-YHG56XUI.js.map → cli-L7NI3IOT.js.map} +0 -0
- /package/dist/{commands-LZX67TTI.js.map → commands-TMYYMQUF.js.map} +0 -0
- /package/dist/{config-3A6INLJZ.js.map → config-ZNO3N5FZ.js.map} +0 -0
- /package/dist/{context-J4OQBUEZ.js.map → context-VDFTROLV.js.map} +0 -0
- /package/dist/{customCommands-SC4NQGIV.js.map → customCommands-FKJZ22HA.js.map} +0 -0
- /package/dist/{env-CBMMCZZ6.js.map → env-O6PWUAXR.js.map} +0 -0
- /package/dist/{file-GQ5IBHFB.js.map → file-KPRV3JOY.js.map} +0 -0
- /package/dist/{llm-7DBQPG47.js.map → llm-B56E7A3E.js.map} +0 -0
- /package/dist/{llmLazy-X4SJWRZB.js.map → llmLazy-PLNA2YEW.js.map} +0 -0
- /package/dist/{loader-42NKTU32.js.map → loader-JZCFB2Z4.js.map} +0 -0
- /package/dist/{lsp-H3QYYNDE.js.map → lsp-LRWY5O2G.js.map} +0 -0
- /package/dist/{lspAnchor-XQDA5ERF.js.map → lspAnchor-7TGKJJ7D.js.map} +0 -0
- /package/dist/{mcp-5RV6EMTA.js.map → mcp-SMNK5RS5.js.map} +0 -0
- /package/dist/{mentionProcessor-TEB2ZXF7.js.map → mentionProcessor-634SMOOJ.js.map} +0 -0
- /package/dist/{messages-6FWGY3DY.js.map → messages-FB4NUTHM.js.map} +0 -0
- /package/dist/{model-ZNDLNOQE.js.map → model-WH2Q6UZJ.js.map} +0 -0
- /package/dist/{openai-Y7VUSKNQ.js.map → openai-BV6QP4OA.js.map} +0 -0
- /package/dist/{outputStyles-Y34AOKLE.js.map → outputStyles-C6H6SVSA.js.map} +0 -0
- /package/dist/{pluginRuntime-YTBMPQIP.js.map → pluginRuntime-IRKARA7H.js.map} +0 -0
- /package/dist/{pluginValidation-SLHJEVJC.js.map → pluginValidation-MVWDIOU3.js.map} +0 -0
- /package/dist/{prompts-ZGLENMR6.js.map → prompts-VHQWDKSG.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-5MNQGC4U.js.map → pybAgentSessionLoad-O2UIG72F.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-MR2BQPWN.js.map → pybAgentSessionResume-HVLEWJDM.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-T3PUD4KM.js.map → pybAgentStreamJsonSession-HJZ5DSEI.js.map} +0 -0
- /package/dist/{pybHooks-QG5YXBFT.js.map → pybHooks-POMLIKQB.js.map} +0 -0
- /package/dist/{query-2S5F2BKO.js.map → query-2MIHVE7W.js.map} +0 -0
- /package/dist/{registry-EHXEI6UI.js.map → registry-ODXCQP6E.js.map} +0 -0
- /package/dist/{ripgrep-VDLTL76W.js.map → ripgrep-AQ7RJ4L2.js.map} +0 -0
- /package/dist/{skillMarketplace-XDYJSPOO.js.map → skillMarketplace-WY7FEZKV.js.map} +0 -0
- /package/dist/{state-YP6DLLAI.js.map → state-2EUXD6CF.js.map} +0 -0
- /package/dist/{theme-DNTFOIH4.js.map → theme-6HMN6U2N.js.map} +0 -0
- /package/dist/{toolPermissionSettings-VDQVUESB.js.map → toolPermissionSettings-NDOV3POK.js.map} +0 -0
- /package/dist/{tools-FK2V2NKA.js.map → tools-FVYTYAGD.js.map} +0 -0
- /package/dist/{userInput-67MTMZQX.js.map → userInput-OJ72YG7A.js.map} +0 -0
|
@@ -3,18 +3,18 @@ const require = __pybCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
formatValidationResult,
|
|
5
5
|
validatePluginOrMarketplacePath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NRSUWZK4.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-R2IRQSJC.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GM5ZJ7DT.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RDRKGYMZ.js";
|
|
18
18
|
import {
|
|
19
19
|
drainHookSystemPromptAdditions,
|
|
20
20
|
getHookTranscriptPath,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
runStopHooks,
|
|
27
27
|
runUserPromptSubmitHooks,
|
|
28
28
|
updateHookTranscriptForMessages
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XGSY4SPL.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_OUTPUT_STYLE,
|
|
32
32
|
getAvailableOutputStyles,
|
|
@@ -35,17 +35,17 @@ import {
|
|
|
35
35
|
getOutputStyleSystemPromptAdditions,
|
|
36
36
|
resolveOutputStyleName,
|
|
37
37
|
setCurrentOutputStyle
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MDKDC5II.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures,
|
|
42
42
|
getSessionState
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-ZJIUQ235.js";
|
|
44
44
|
import {
|
|
45
45
|
queryLLM,
|
|
46
46
|
queryQuick,
|
|
47
47
|
verifyApiKey
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-KIQXQLEB.js";
|
|
49
49
|
import {
|
|
50
50
|
DEFAULT_TIMEOUT_MS,
|
|
51
51
|
FallbackToolUseRejectedMessage,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
listMCPServers,
|
|
60
60
|
loadMergedSettings,
|
|
61
61
|
normalizeSandboxRuntimeConfigFromSettings
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-4HE4XCHW.js";
|
|
63
63
|
import {
|
|
64
64
|
addMarketplace,
|
|
65
65
|
disableSkillPlugin,
|
|
@@ -72,11 +72,11 @@ import {
|
|
|
72
72
|
refreshMarketplaceAsync,
|
|
73
73
|
removeMarketplace,
|
|
74
74
|
uninstallSkillPlugin
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-LMLII7Q2.js";
|
|
76
76
|
import {
|
|
77
77
|
loadToolPermissionContextFromDisk,
|
|
78
78
|
persistToolPermissionUpdateToDisk
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-FJJ6KZ7M.js";
|
|
80
80
|
import {
|
|
81
81
|
applyToolPermissionContextUpdate,
|
|
82
82
|
applyToolPermissionContextUpdates,
|
|
@@ -87,13 +87,13 @@ import {
|
|
|
87
87
|
generateSystemReminders,
|
|
88
88
|
resetReminderSession,
|
|
89
89
|
systemReminderService
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-XFYI2VDM.js";
|
|
91
91
|
import {
|
|
92
92
|
clearAgentCache,
|
|
93
93
|
getActiveAgents,
|
|
94
94
|
getAgentByType,
|
|
95
95
|
getAllAgents
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-ULOTS5TZ.js";
|
|
97
97
|
import {
|
|
98
98
|
API_ERROR_MESSAGE_PREFIX,
|
|
99
99
|
CANCEL_MESSAGE,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
processUserInput,
|
|
125
125
|
reorderMessages,
|
|
126
126
|
stripSystemMessages
|
|
127
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-5NB4DS5W.js";
|
|
128
128
|
import {
|
|
129
129
|
getRequestStatus,
|
|
130
130
|
setRequestStatus,
|
|
@@ -154,7 +154,7 @@ import {
|
|
|
154
154
|
normalizeFilePath,
|
|
155
155
|
readTextContent,
|
|
156
156
|
writeTextContent
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-S5EJ7KCA.js";
|
|
158
158
|
import {
|
|
159
159
|
parseBlockEdits
|
|
160
160
|
} from "./chunk-QWIBSCDN.js";
|
|
@@ -164,18 +164,18 @@ import {
|
|
|
164
164
|
ParserRegistry,
|
|
165
165
|
initParser,
|
|
166
166
|
loadLanguage
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-DCVGTJDI.js";
|
|
168
168
|
import {
|
|
169
169
|
getSettingsFileCandidates,
|
|
170
170
|
loadSettingsWithLegacyFallback,
|
|
171
171
|
readSettingsFile
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-RA5TQSRT.js";
|
|
173
173
|
import {
|
|
174
174
|
getCustomCommandDirectories,
|
|
175
175
|
hasCustomCommands,
|
|
176
176
|
loadCustomCommands,
|
|
177
177
|
reloadCustomCommands
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-ZUNHKV45.js";
|
|
179
179
|
import {
|
|
180
180
|
getSessionPlugins
|
|
181
181
|
} from "./chunk-BJSWTHRM.js";
|
|
@@ -183,7 +183,7 @@ import {
|
|
|
183
183
|
ModelManager,
|
|
184
184
|
getModelManager,
|
|
185
185
|
isDefaultSlowAndCapableModel
|
|
186
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-6CTJEKOL.js";
|
|
187
187
|
import {
|
|
188
188
|
getCodeStyle,
|
|
189
189
|
getContext,
|
|
@@ -191,13 +191,13 @@ import {
|
|
|
191
191
|
getIsGit,
|
|
192
192
|
getProjectDocs,
|
|
193
193
|
getProjectStructureStatisticsBlock
|
|
194
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-CK2T76JI.js";
|
|
195
195
|
import {
|
|
196
196
|
ripGrep
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-XMP3P7UJ.js";
|
|
198
198
|
import {
|
|
199
199
|
getTheme
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-FPUIG2DR.js";
|
|
201
201
|
import {
|
|
202
202
|
DEFAULT_GLOBAL_CONFIG,
|
|
203
203
|
enableConfigs,
|
|
@@ -210,7 +210,7 @@ import {
|
|
|
210
210
|
saveGlobalConfig,
|
|
211
211
|
setAllPointersToModel,
|
|
212
212
|
setModelPointer
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-KYZ3A4WN.js";
|
|
214
214
|
import {
|
|
215
215
|
AbortError
|
|
216
216
|
} from "./chunk-RQVLBMP7.js";
|
|
@@ -219,7 +219,7 @@ import {
|
|
|
219
219
|
getCurrentRequest,
|
|
220
220
|
logUserFriendly,
|
|
221
221
|
markPhase
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-ZUR27DFA.js";
|
|
223
223
|
import {
|
|
224
224
|
ASCII_LOGO,
|
|
225
225
|
BunShell,
|
|
@@ -260,10 +260,10 @@ import {
|
|
|
260
260
|
setCwd,
|
|
261
261
|
shouldApplyToolOutputTruncation,
|
|
262
262
|
truncateToolOutput
|
|
263
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-3EZMZ34Z.js";
|
|
264
264
|
import {
|
|
265
265
|
MACRO
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-TNESUQAU.js";
|
|
267
267
|
import {
|
|
268
268
|
__export
|
|
269
269
|
} from "./chunk-I3J4JYES.js";
|
|
@@ -272,7 +272,7 @@ import {
|
|
|
272
272
|
import { statSync as statSync13 } from "fs";
|
|
273
273
|
import { EOL as EOL3 } from "os";
|
|
274
274
|
import { isAbsolute as isAbsolute8, relative as relative12, resolve as resolve10 } from "path";
|
|
275
|
-
import * as
|
|
275
|
+
import * as React111 from "react";
|
|
276
276
|
import { z as z15 } from "zod";
|
|
277
277
|
|
|
278
278
|
// src/utils/commands/index.ts
|
|
@@ -444,7 +444,7 @@ var getCommandSubcommandPrefix = memoize(
|
|
|
444
444
|
var getCommandPrefix = memoize(
|
|
445
445
|
async (command4, abortSignal) => {
|
|
446
446
|
const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
|
|
447
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-
|
|
447
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-B56E7A3E.js");
|
|
448
448
|
const response = await queryQuick2({
|
|
449
449
|
systemPrompt,
|
|
450
450
|
userPrompt,
|
|
@@ -4246,7 +4246,7 @@ function formatParseError(error) {
|
|
|
4246
4246
|
return error instanceof Error ? error.message : String(error);
|
|
4247
4247
|
}
|
|
4248
4248
|
async function defaultGateQuery(args) {
|
|
4249
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-
|
|
4249
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-B56E7A3E.js");
|
|
4250
4250
|
const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
|
|
4251
4251
|
const messages = [
|
|
4252
4252
|
{
|
|
@@ -4654,12 +4654,34 @@ Usage notes:
|
|
|
4654
4654
|
- The URL must be a fully-formed valid URL
|
|
4655
4655
|
- HTTP URLs will be automatically upgraded to HTTPS
|
|
4656
4656
|
- The prompt should describe what information you want to extract from the page
|
|
4657
|
-
- Format options: "markdown"
|
|
4657
|
+
- Format options: "markdown", "text", or "html" (choose based on your intent)
|
|
4658
4658
|
- Timeout is optional and defaults to 30 seconds
|
|
4659
4659
|
- This tool is read-only and does not modify any files
|
|
4660
4660
|
- Results may be summarized if the content is very large
|
|
4661
4661
|
- Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL
|
|
4662
4662
|
- When a URL redirects to a different host, the tool will inform you and provide the redirect URL in a special format. You should then make a new WebFetch request with the redirect URL to fetch the content.
|
|
4663
|
+
|
|
4664
|
+
Requested Format Behavior Examples:
|
|
4665
|
+
--Same HTML Input HTML
|
|
4666
|
+
<article>
|
|
4667
|
+
<h1>Title</h1>
|
|
4668
|
+
<p>Hello <a href="https://example.com">link</a></p>
|
|
4669
|
+
<ul><li>One</li><li>Two</li></ul>
|
|
4670
|
+
</article>
|
|
4671
|
+
--html
|
|
4672
|
+
|
|
4673
|
+
1\uFF1Aformat: "markdown" \u2192 preserves structure (headings/lists/links) for readable summaries and structured quoting:
|
|
4674
|
+
# Title
|
|
4675
|
+
Hello [link](https://example.com)
|
|
4676
|
+
- One
|
|
4677
|
+
- Two
|
|
4678
|
+
2\uFF1Aformat: "text" \u2192 plain text only, removes all markup and links to minimize noise:
|
|
4679
|
+
Title
|
|
4680
|
+
Hello link
|
|
4681
|
+
One
|
|
4682
|
+
Two
|
|
4683
|
+
3\uFF1Aformat: "html" \u2192 cleaned HTML, keeps tags but removes scripts/styles/extra chrome:
|
|
4684
|
+
<article><h1>Title</h1><p>Hello <a href="https://example.com">link</a></p><ul><li>One</li><li>Two</li></ul></article>
|
|
4663
4685
|
`.trim();
|
|
4664
4686
|
|
|
4665
4687
|
// src/tools/network/WebFetchTool/htmlToMarkdown.ts
|
|
@@ -4754,6 +4776,8 @@ var inputSchema = z.strictObject({
|
|
|
4754
4776
|
timeout: z.number().optional().describe("Timeout in seconds (default: 30)")
|
|
4755
4777
|
});
|
|
4756
4778
|
var FETCH_TIMEOUT_MS = 3e4;
|
|
4779
|
+
var CONNECT_TIMEOUT_MS = 5e3;
|
|
4780
|
+
var ANALYSIS_TIMEOUT_MS = 15e3;
|
|
4757
4781
|
var MAX_TIMEOUT_MS = 12e4;
|
|
4758
4782
|
var MAX_URL_LENGTH = 2e3;
|
|
4759
4783
|
var MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
|
@@ -4780,6 +4804,25 @@ function normalizeUrl(url2) {
|
|
|
4780
4804
|
function normalizeHostname(hostname) {
|
|
4781
4805
|
return hostname.replace(/^www\./i, "").toLowerCase();
|
|
4782
4806
|
}
|
|
4807
|
+
var AnalysisTimeoutError = class extends Error {
|
|
4808
|
+
constructor() {
|
|
4809
|
+
super("Analysis timeout");
|
|
4810
|
+
}
|
|
4811
|
+
};
|
|
4812
|
+
function classifyAnalysisError(error) {
|
|
4813
|
+
if (error instanceof AnalysisTimeoutError) {
|
|
4814
|
+
return "\u5206\u6790\u8D85\u65F6";
|
|
4815
|
+
}
|
|
4816
|
+
const message = error instanceof Error ? error.message : String(error || "");
|
|
4817
|
+
const lower = message.toLowerCase();
|
|
4818
|
+
if (lower.includes("401") || lower.includes("403") || lower.includes("429") || lower.includes("rate limit")) {
|
|
4819
|
+
return "\u5206\u6790\u9274\u6743\u6216\u9650\u6D41";
|
|
4820
|
+
}
|
|
4821
|
+
if (lower.includes("fetch") || lower.includes("network") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("eai_again") || lower.includes("etimedout") || lower.includes("econnrefused")) {
|
|
4822
|
+
return "\u5206\u6790\u7F51\u7EDC\u5F02\u5E38";
|
|
4823
|
+
}
|
|
4824
|
+
return "\u5206\u6790\u5931\u8D25";
|
|
4825
|
+
}
|
|
4783
4826
|
function isSameHost(originalUrl, redirectUrl) {
|
|
4784
4827
|
try {
|
|
4785
4828
|
const original = new URL(originalUrl);
|
|
@@ -4792,7 +4835,7 @@ function isSameHost(originalUrl, redirectUrl) {
|
|
|
4792
4835
|
return false;
|
|
4793
4836
|
}
|
|
4794
4837
|
}
|
|
4795
|
-
function createTimeoutSignal(parent, timeoutMs) {
|
|
4838
|
+
function createTimeoutSignal(parent, timeoutMs, onTimeout) {
|
|
4796
4839
|
const controller = new AbortController();
|
|
4797
4840
|
const onAbort = () => controller.abort();
|
|
4798
4841
|
if (parent.aborted) {
|
|
@@ -4800,7 +4843,10 @@ function createTimeoutSignal(parent, timeoutMs) {
|
|
|
4800
4843
|
} else {
|
|
4801
4844
|
parent.addEventListener("abort", onAbort, { once: true });
|
|
4802
4845
|
}
|
|
4803
|
-
const timeout = setTimeout(() =>
|
|
4846
|
+
const timeout = setTimeout(() => {
|
|
4847
|
+
if (onTimeout) onTimeout();
|
|
4848
|
+
controller.abort();
|
|
4849
|
+
}, timeoutMs);
|
|
4804
4850
|
return {
|
|
4805
4851
|
signal: controller.signal,
|
|
4806
4852
|
cleanup: () => {
|
|
@@ -4921,23 +4967,37 @@ ${allowBroaderQuoting ? "Provide a concise response based on the content above.
|
|
|
4921
4967
|
- Never produce or reproduce exact song lyrics.`}
|
|
4922
4968
|
`;
|
|
4923
4969
|
}
|
|
4924
|
-
async function fetchWithRedirectDetection(url2, signal) {
|
|
4970
|
+
async function fetchWithRedirectDetection(url2, signal, connectTimeoutMs) {
|
|
4925
4971
|
let current = url2;
|
|
4926
4972
|
for (let i = 0; i < 10; i++) {
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
"User-Agent": "Mozilla/5.0 (compatible; WebFetch/1.0)",
|
|
4931
|
-
Accept: "text/markdown, text/html, */*",
|
|
4932
|
-
"Accept-Language": "en-US,en;q=0.5"
|
|
4933
|
-
},
|
|
4934
|
-
signal,
|
|
4935
|
-
redirect: "manual"
|
|
4973
|
+
let connectTimeoutTriggered2 = false;
|
|
4974
|
+
const connectTimeout2 = createTimeoutSignal(signal, connectTimeoutMs, () => {
|
|
4975
|
+
connectTimeoutTriggered2 = true;
|
|
4936
4976
|
});
|
|
4937
|
-
|
|
4938
|
-
|
|
4977
|
+
let response;
|
|
4978
|
+
try {
|
|
4979
|
+
response = await fetch(current, {
|
|
4980
|
+
method: "GET",
|
|
4981
|
+
headers: {
|
|
4982
|
+
"User-Agent": "Mozilla/5.0 (compatible; WebFetch/1.0)",
|
|
4983
|
+
Accept: "text/markdown, text/html, */*",
|
|
4984
|
+
"Accept-Language": "en-US,en;q=0.5"
|
|
4985
|
+
},
|
|
4986
|
+
signal: connectTimeout2.signal,
|
|
4987
|
+
redirect: "manual"
|
|
4988
|
+
});
|
|
4989
|
+
} catch (error) {
|
|
4990
|
+
if (connectTimeoutTriggered2) {
|
|
4991
|
+
throw new Error(`Connection timeout while fetching ${current}\uFF08\u4E0D\u53EF\u8FBE\uFF09`);
|
|
4992
|
+
}
|
|
4993
|
+
throw error;
|
|
4994
|
+
} finally {
|
|
4995
|
+
connectTimeout2.cleanup();
|
|
4996
|
+
}
|
|
4997
|
+
if ([301, 302, 307, 308].includes(response.status)) {
|
|
4998
|
+
const location = response.headers.get("location");
|
|
4939
4999
|
if (!location) {
|
|
4940
|
-
return { type: "response", response
|
|
5000
|
+
return { type: "response", response, finalUrl: current };
|
|
4941
5001
|
}
|
|
4942
5002
|
const redirectUrl = new URL(location, current).toString();
|
|
4943
5003
|
if (isSameHost(current, redirectUrl)) {
|
|
@@ -4948,13 +5008,26 @@ async function fetchWithRedirectDetection(url2, signal) {
|
|
|
4948
5008
|
type: "redirect",
|
|
4949
5009
|
originalUrl: url2,
|
|
4950
5010
|
redirectUrl,
|
|
4951
|
-
statusCode:
|
|
5011
|
+
statusCode: response.status
|
|
4952
5012
|
};
|
|
4953
5013
|
}
|
|
4954
|
-
return { type: "response", response
|
|
5014
|
+
return { type: "response", response, finalUrl: current };
|
|
5015
|
+
}
|
|
5016
|
+
let connectTimeoutTriggered = false;
|
|
5017
|
+
const connectTimeout = createTimeoutSignal(signal, connectTimeoutMs, () => {
|
|
5018
|
+
connectTimeoutTriggered = true;
|
|
5019
|
+
});
|
|
5020
|
+
try {
|
|
5021
|
+
const response = await fetch(current, { signal: connectTimeout.signal });
|
|
5022
|
+
return { type: "response", response, finalUrl: current };
|
|
5023
|
+
} catch (error) {
|
|
5024
|
+
if (connectTimeoutTriggered) {
|
|
5025
|
+
throw new Error(`Connection timeout while fetching ${current}\uFF08\u4E0D\u53EF\u8FBE\uFF09`);
|
|
5026
|
+
}
|
|
5027
|
+
throw error;
|
|
5028
|
+
} finally {
|
|
5029
|
+
connectTimeout.cleanup();
|
|
4955
5030
|
}
|
|
4956
|
-
const response = await fetch(current, { signal });
|
|
4957
|
-
return { type: "response", response, finalUrl: current };
|
|
4958
5031
|
}
|
|
4959
5032
|
var WebFetchTool = {
|
|
4960
5033
|
name: TOOL_NAME_FOR_PROMPT,
|
|
@@ -5040,9 +5113,14 @@ ${output.result}`;
|
|
|
5040
5113
|
context.abortController.signal,
|
|
5041
5114
|
timeoutSeconds * 1e3
|
|
5042
5115
|
);
|
|
5116
|
+
const connectTimeoutMs = Math.min(CONNECT_TIMEOUT_MS, timeoutSeconds * 1e3);
|
|
5043
5117
|
try {
|
|
5044
5118
|
const cached = urlCache.get(normalizedUrl);
|
|
5045
|
-
const fetched = cached ? null : await fetchWithRedirectDetection(
|
|
5119
|
+
const fetched = cached ? null : await fetchWithRedirectDetection(
|
|
5120
|
+
normalizedUrl,
|
|
5121
|
+
timeoutSignal.signal,
|
|
5122
|
+
connectTimeoutMs
|
|
5123
|
+
);
|
|
5046
5124
|
if (fetched && fetched.type === "redirect") {
|
|
5047
5125
|
const codeText2 = fetched.statusCode === 301 ? "Moved Permanently" : fetched.statusCode === 308 ? "Permanent Redirect" : fetched.statusCode === 307 ? "Temporary Redirect" : "Found";
|
|
5048
5126
|
const result2 = `REDIRECT DETECTED: The URL redirects to a different host.
|
|
@@ -5110,14 +5188,41 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5110
5188
|
prompt,
|
|
5111
5189
|
allowBroaderQuoting
|
|
5112
5190
|
);
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5191
|
+
let analysisTimeoutTriggered = false;
|
|
5192
|
+
const analysisSignal = createTimeoutSignal(
|
|
5193
|
+
timeoutSignal.signal,
|
|
5194
|
+
ANALYSIS_TIMEOUT_MS,
|
|
5195
|
+
() => {
|
|
5196
|
+
analysisTimeoutTriggered = true;
|
|
5197
|
+
}
|
|
5198
|
+
);
|
|
5199
|
+
try {
|
|
5200
|
+
const aiResponse = await queryQuick({
|
|
5201
|
+
systemPrompt: [],
|
|
5202
|
+
userPrompt,
|
|
5203
|
+
enablePromptCaching: false,
|
|
5204
|
+
signal: analysisSignal.signal
|
|
5205
|
+
});
|
|
5206
|
+
const analysisText = aiResponse.message.content[0]?.text || "";
|
|
5207
|
+
if (!analysisText.trim()) {
|
|
5208
|
+
const reason = "\u5206\u6790\u65E0\u5185\u5BB9";
|
|
5209
|
+
result = `\u3010\u5206\u6790\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u539F\u6587\u3011${reason}
|
|
5210
|
+
|
|
5211
|
+
${formatted}`;
|
|
5212
|
+
mode = "analysis";
|
|
5213
|
+
} else {
|
|
5214
|
+
result = analysisText;
|
|
5215
|
+
mode = "analysis";
|
|
5216
|
+
}
|
|
5217
|
+
} catch (error) {
|
|
5218
|
+
const reason = analysisTimeoutTriggered ? "\u5206\u6790\u8D85\u65F6" : classifyAnalysisError(error);
|
|
5219
|
+
result = `\u3010\u5206\u6790\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u539F\u6587\u3011${reason}
|
|
5220
|
+
|
|
5221
|
+
${formatted}`;
|
|
5222
|
+
mode = "analysis";
|
|
5223
|
+
} finally {
|
|
5224
|
+
analysisSignal.cleanup();
|
|
5225
|
+
}
|
|
5121
5226
|
}
|
|
5122
5227
|
const output = {
|
|
5123
5228
|
bytes,
|
|
@@ -5160,8 +5265,8 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5160
5265
|
};
|
|
5161
5266
|
|
|
5162
5267
|
// src/ui/components/permissions/web-fetch-permission-request/WebFetchPermissionRequest.tsx
|
|
5163
|
-
import { Box as
|
|
5164
|
-
import
|
|
5268
|
+
import { Box as Box81, Text as Text85, useInput as useInput31 } from "ink";
|
|
5269
|
+
import React110, { useMemo as useMemo28 } from "react";
|
|
5165
5270
|
import chalk16 from "chalk";
|
|
5166
5271
|
|
|
5167
5272
|
// src/ui/components/custom-select/select.tsx
|
|
@@ -6538,7 +6643,7 @@ var FileEditTool = {
|
|
|
6538
6643
|
const originalFileContent = currentFileContent;
|
|
6539
6644
|
let totalPatch = [];
|
|
6540
6645
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6541
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6646
|
+
const { findLspAnchor } = await import("./lspAnchor-7TGKJJ7D.js");
|
|
6542
6647
|
for (const op of editOperations) {
|
|
6543
6648
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6544
6649
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -8804,7 +8909,7 @@ var WebSearchTool = {
|
|
|
8804
8909
|
|
|
8805
8910
|
// src/tools/interaction/SlashCommandTool/SlashCommandTool.tsx
|
|
8806
8911
|
import { z as z13 } from "zod";
|
|
8807
|
-
import * as
|
|
8912
|
+
import * as React108 from "react";
|
|
8808
8913
|
|
|
8809
8914
|
// src/ui/components/Bug.tsx
|
|
8810
8915
|
import { Box as Box17, Text as Text19, useInput as useInput5 } from "ink";
|
|
@@ -11173,7 +11278,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11173
11278
|
}
|
|
11174
11279
|
saveGlobalConfig(config2);
|
|
11175
11280
|
try {
|
|
11176
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11281
|
+
const { resetAnthropicClient } = await import("./llm-B56E7A3E.js");
|
|
11177
11282
|
resetAnthropicClient();
|
|
11178
11283
|
} catch {
|
|
11179
11284
|
}
|
|
@@ -15540,7 +15645,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15540
15645
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15541
15646
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15542
15647
|
if (dirs.length === 0) return [];
|
|
15543
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15648
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-IRKARA7H.js");
|
|
15544
15649
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15545
15650
|
return errors;
|
|
15546
15651
|
}
|
|
@@ -16209,7 +16314,7 @@ async function call(onDone, context) {
|
|
|
16209
16314
|
ModelConfig,
|
|
16210
16315
|
{
|
|
16211
16316
|
onClose: () => {
|
|
16212
|
-
import("./model-
|
|
16317
|
+
import("./model-WH2Q6UZJ.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
16213
16318
|
reloadModelManager2();
|
|
16214
16319
|
triggerModelConfigChange();
|
|
16215
16320
|
onDone();
|
|
@@ -17343,14 +17448,14 @@ async function call2(onDone, context) {
|
|
|
17343
17448
|
}
|
|
17344
17449
|
|
|
17345
17450
|
// src/commands/resume.tsx
|
|
17346
|
-
import * as
|
|
17451
|
+
import * as React105 from "react";
|
|
17347
17452
|
|
|
17348
17453
|
// src/ui/screens/ResumeConversation.tsx
|
|
17349
|
-
import
|
|
17454
|
+
import React104 from "react";
|
|
17350
17455
|
import { render } from "ink";
|
|
17351
17456
|
|
|
17352
17457
|
// src/ui/screens/REPL.tsx
|
|
17353
|
-
import { Box as
|
|
17458
|
+
import { Box as Box77, Newline as Newline4, Static as Static2 } from "ink";
|
|
17354
17459
|
|
|
17355
17460
|
// src/ui/components/CostThresholdDialog.tsx
|
|
17356
17461
|
import { Box as Box37, Text as Text42, useInput as useInput17 } from "ink";
|
|
@@ -17403,7 +17508,7 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17403
17508
|
}
|
|
17404
17509
|
|
|
17405
17510
|
// src/ui/screens/REPL.tsx
|
|
17406
|
-
import * as
|
|
17511
|
+
import * as React102 from "react";
|
|
17407
17512
|
import { useEffect as useEffect26, useMemo as useMemo26, useRef as useRef13, useState as useState28, useCallback as useCallback16 } from "react";
|
|
17408
17513
|
|
|
17409
17514
|
// src/ui/components/Message.tsx
|
|
@@ -19657,15 +19762,29 @@ function TaskPanel({
|
|
|
19657
19762
|
}), hidden.length > 0 ? /* @__PURE__ */ React74.createElement(Text59, null, "\u2026 +", hiddenPending > 0 ? hiddenPending : hidden.length, " pending") : null);
|
|
19658
19763
|
}
|
|
19659
19764
|
|
|
19765
|
+
// src/ui/components/QueuedMessageList.tsx
|
|
19766
|
+
import { Box as Box55, Text as Text60 } from "ink";
|
|
19767
|
+
import React75 from "react";
|
|
19768
|
+
function QueuedMessageList({ items }) {
|
|
19769
|
+
if (items.length === 0) return null;
|
|
19770
|
+
return /* @__PURE__ */ React75.createElement(Box55, { flexDirection: "column", width: "100%" }, items.map((item) => /* @__PURE__ */ React75.createElement(Box55, { key: item.id, width: "100%" }, /* @__PURE__ */ React75.createElement(Text60, { backgroundColor: "white", color: "black" }, item.content))));
|
|
19771
|
+
}
|
|
19772
|
+
function QueuedHintLine({
|
|
19773
|
+
show
|
|
19774
|
+
}) {
|
|
19775
|
+
if (!show) return null;
|
|
19776
|
+
return /* @__PURE__ */ React75.createElement(Box55, { paddingLeft: 2, paddingRight: 2 }, /* @__PURE__ */ React75.createElement(Text60, { dimColor: true }, "Press up to edit queued messages"));
|
|
19777
|
+
}
|
|
19778
|
+
|
|
19660
19779
|
// src/ui/components/permissions/PermissionRequest.tsx
|
|
19661
19780
|
import { useInput as useInput25 } from "ink";
|
|
19662
|
-
import * as
|
|
19781
|
+
import * as React93 from "react";
|
|
19663
19782
|
|
|
19664
19783
|
// src/ui/components/permissions/file-edit-permission-request/FileEditPermissionRequest.tsx
|
|
19665
19784
|
import chalk7 from "chalk";
|
|
19666
|
-
import { Box as
|
|
19785
|
+
import { Box as Box58, Text as Text63, useInput as useInput19 } from "ink";
|
|
19667
19786
|
import { basename, dirname as dirname5, extname as extname6 } from "path";
|
|
19668
|
-
import
|
|
19787
|
+
import React78, { useCallback as useCallback8, useMemo as useMemo15 } from "react";
|
|
19669
19788
|
|
|
19670
19789
|
// src/ui/hooks/usePermissionRequestLogging.ts
|
|
19671
19790
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -19693,8 +19812,8 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) {
|
|
|
19693
19812
|
}
|
|
19694
19813
|
|
|
19695
19814
|
// src/ui/components/permissions/PermissionRequestTitle.tsx
|
|
19696
|
-
import * as
|
|
19697
|
-
import { Box as
|
|
19815
|
+
import * as React76 from "react";
|
|
19816
|
+
import { Box as Box56, Text as Text61 } from "ink";
|
|
19698
19817
|
function categoryForRiskScore(riskScore) {
|
|
19699
19818
|
return riskScore >= 70 ? "high" : riskScore >= 30 ? "moderate" : "low";
|
|
19700
19819
|
}
|
|
@@ -19729,20 +19848,20 @@ function PermissionRiskScore({
|
|
|
19729
19848
|
riskScore
|
|
19730
19849
|
}) {
|
|
19731
19850
|
const category = categoryForRiskScore(riskScore);
|
|
19732
|
-
return /* @__PURE__ */
|
|
19851
|
+
return /* @__PURE__ */ React76.createElement(Text61, { color: textColorForRiskScore(riskScore) }, "Risk: ", category);
|
|
19733
19852
|
}
|
|
19734
19853
|
function PermissionRequestTitle({
|
|
19735
19854
|
title,
|
|
19736
19855
|
riskScore
|
|
19737
19856
|
}) {
|
|
19738
|
-
return /* @__PURE__ */
|
|
19857
|
+
return /* @__PURE__ */ React76.createElement(Box56, { flexDirection: "column" }, /* @__PURE__ */ React76.createElement(Text61, { bold: true, color: getTheme().permission }, title), riskScore !== null && /* @__PURE__ */ React76.createElement(PermissionRiskScore, { riskScore }));
|
|
19739
19858
|
}
|
|
19740
19859
|
|
|
19741
19860
|
// src/ui/components/permissions/file-edit-permission-request/FileEditToolDiff.tsx
|
|
19742
|
-
import * as
|
|
19861
|
+
import * as React77 from "react";
|
|
19743
19862
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
19744
19863
|
import { useMemo as useMemo14 } from "react";
|
|
19745
|
-
import { Box as
|
|
19864
|
+
import { Box as Box57, Text as Text62 } from "ink";
|
|
19746
19865
|
import { relative as relative10 } from "path";
|
|
19747
19866
|
function FileEditToolDiff({
|
|
19748
19867
|
file_path,
|
|
@@ -19765,17 +19884,17 @@ function FileEditToolDiff({
|
|
|
19765
19884
|
}),
|
|
19766
19885
|
[file_path, file, old_string, new_string]
|
|
19767
19886
|
);
|
|
19768
|
-
return /* @__PURE__ */
|
|
19769
|
-
|
|
19887
|
+
return /* @__PURE__ */ React77.createElement(Box57, { flexDirection: "column" }, /* @__PURE__ */ React77.createElement(
|
|
19888
|
+
Box57,
|
|
19770
19889
|
{
|
|
19771
19890
|
borderColor: getTheme().secondaryBorder,
|
|
19772
19891
|
borderStyle: useBorder ? "round" : void 0,
|
|
19773
19892
|
flexDirection: "column",
|
|
19774
19893
|
paddingX: 1
|
|
19775
19894
|
},
|
|
19776
|
-
/* @__PURE__ */
|
|
19895
|
+
/* @__PURE__ */ React77.createElement(Box57, { paddingBottom: 1 }, /* @__PURE__ */ React77.createElement(Text62, { bold: true }, verbose ? file_path : relative10(getCwd(), file_path))),
|
|
19777
19896
|
intersperse(
|
|
19778
|
-
patch.map((_) => /* @__PURE__ */
|
|
19897
|
+
patch.map((_) => /* @__PURE__ */ React77.createElement(
|
|
19779
19898
|
StructuredDiff,
|
|
19780
19899
|
{
|
|
19781
19900
|
key: _.newStart,
|
|
@@ -19784,7 +19903,7 @@ function FileEditToolDiff({
|
|
|
19784
19903
|
width
|
|
19785
19904
|
}
|
|
19786
19905
|
)),
|
|
19787
|
-
(i) => /* @__PURE__ */
|
|
19906
|
+
(i) => /* @__PURE__ */ React77.createElement(React77.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React77.createElement(Text62, { color: getTheme().secondaryText }, "..."))
|
|
19788
19907
|
)
|
|
19789
19908
|
));
|
|
19790
19909
|
}
|
|
@@ -19966,8 +20085,8 @@ function FileEditPermissionRequest({
|
|
|
19966
20085
|
handleChoice("yes-session");
|
|
19967
20086
|
return true;
|
|
19968
20087
|
});
|
|
19969
|
-
return /* @__PURE__ */
|
|
19970
|
-
|
|
20088
|
+
return /* @__PURE__ */ React78.createElement(
|
|
20089
|
+
Box58,
|
|
19971
20090
|
{
|
|
19972
20091
|
flexDirection: "column",
|
|
19973
20092
|
borderStyle: "round",
|
|
@@ -19977,14 +20096,14 @@ function FileEditPermissionRequest({
|
|
|
19977
20096
|
paddingRight: 1,
|
|
19978
20097
|
paddingBottom: 1
|
|
19979
20098
|
},
|
|
19980
|
-
/* @__PURE__ */
|
|
20099
|
+
/* @__PURE__ */ React78.createElement(
|
|
19981
20100
|
PermissionRequestTitle,
|
|
19982
20101
|
{
|
|
19983
20102
|
title: "Edit file",
|
|
19984
20103
|
riskScore: toolUseConfirm.riskScore
|
|
19985
20104
|
}
|
|
19986
20105
|
),
|
|
19987
|
-
/* @__PURE__ */
|
|
20106
|
+
/* @__PURE__ */ React78.createElement(
|
|
19988
20107
|
FileEditToolDiff,
|
|
19989
20108
|
{
|
|
19990
20109
|
file_path,
|
|
@@ -19994,7 +20113,7 @@ function FileEditPermissionRequest({
|
|
|
19994
20113
|
width: columns - 12
|
|
19995
20114
|
}
|
|
19996
20115
|
),
|
|
19997
|
-
/* @__PURE__ */
|
|
20116
|
+
/* @__PURE__ */ React78.createElement(Box58, { flexDirection: "column" }, /* @__PURE__ */ React78.createElement(Text63, null, "Do you want to make this edit to", " ", /* @__PURE__ */ React78.createElement(Text63, { bold: true }, basename(file_path)), "?"), /* @__PURE__ */ React78.createElement(
|
|
19998
20117
|
Select,
|
|
19999
20118
|
{
|
|
20000
20119
|
options: getOptions({
|
|
@@ -20018,8 +20137,8 @@ async function extractLanguageName(file_path) {
|
|
|
20018
20137
|
}
|
|
20019
20138
|
|
|
20020
20139
|
// src/ui/components/permissions/bash-permission-request/BashPermissionRequest.tsx
|
|
20021
|
-
import { Box as
|
|
20022
|
-
import
|
|
20140
|
+
import { Box as Box59, Text as Text64 } from "ink";
|
|
20141
|
+
import React79, { useMemo as useMemo16 } from "react";
|
|
20023
20142
|
|
|
20024
20143
|
// src/ui/components/permissions/hooks.ts
|
|
20025
20144
|
import { useEffect as useEffect18 } from "react";
|
|
@@ -20124,8 +20243,8 @@ function BashPermissionRequest({
|
|
|
20124
20243
|
[]
|
|
20125
20244
|
);
|
|
20126
20245
|
usePermissionRequestLogging2(toolUseConfirm, unaryEvent);
|
|
20127
|
-
return /* @__PURE__ */
|
|
20128
|
-
|
|
20246
|
+
return /* @__PURE__ */ React79.createElement(
|
|
20247
|
+
Box59,
|
|
20129
20248
|
{
|
|
20130
20249
|
flexDirection: "column",
|
|
20131
20250
|
borderStyle: "round",
|
|
@@ -20135,19 +20254,19 @@ function BashPermissionRequest({
|
|
|
20135
20254
|
paddingRight: 1,
|
|
20136
20255
|
paddingBottom: 1
|
|
20137
20256
|
},
|
|
20138
|
-
/* @__PURE__ */
|
|
20257
|
+
/* @__PURE__ */ React79.createElement(
|
|
20139
20258
|
PermissionRequestTitle,
|
|
20140
20259
|
{
|
|
20141
20260
|
title: "Bash command",
|
|
20142
20261
|
riskScore: toolUseConfirm.riskScore
|
|
20143
20262
|
}
|
|
20144
20263
|
),
|
|
20145
|
-
/* @__PURE__ */
|
|
20264
|
+
/* @__PURE__ */ React79.createElement(Box59, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React79.createElement(Text64, null, BashTool.renderToolUseMessage({
|
|
20146
20265
|
command: command4,
|
|
20147
20266
|
run_in_background,
|
|
20148
20267
|
description: description3
|
|
20149
|
-
})), /* @__PURE__ */
|
|
20150
|
-
/* @__PURE__ */
|
|
20268
|
+
})), /* @__PURE__ */ React79.createElement(Text64, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20269
|
+
/* @__PURE__ */ React79.createElement(Box59, { flexDirection: "column" }, /* @__PURE__ */ React79.createElement(Text64, null, "Do you want to proceed?"), /* @__PURE__ */ React79.createElement(
|
|
20151
20270
|
Select,
|
|
20152
20271
|
{
|
|
20153
20272
|
options: toolUseOptions({ toolUseConfirm, command: command4 }),
|
|
@@ -20215,8 +20334,8 @@ function BashPermissionRequest({
|
|
|
20215
20334
|
}
|
|
20216
20335
|
|
|
20217
20336
|
// src/ui/components/permissions/FallbackPermissionRequest.tsx
|
|
20218
|
-
import { Box as
|
|
20219
|
-
import
|
|
20337
|
+
import { Box as Box60, Text as Text65 } from "ink";
|
|
20338
|
+
import React80, { useMemo as useMemo17 } from "react";
|
|
20220
20339
|
import chalk9 from "chalk";
|
|
20221
20340
|
function __getFallbackPermissionInputForTests(tool, input) {
|
|
20222
20341
|
return tool === WebSearchTool ? { query: "" } : input;
|
|
@@ -20237,8 +20356,8 @@ function FallbackPermissionRequest({
|
|
|
20237
20356
|
[]
|
|
20238
20357
|
);
|
|
20239
20358
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
20240
|
-
return /* @__PURE__ */
|
|
20241
|
-
|
|
20359
|
+
return /* @__PURE__ */ React80.createElement(
|
|
20360
|
+
Box60,
|
|
20242
20361
|
{
|
|
20243
20362
|
flexDirection: "column",
|
|
20244
20363
|
borderStyle: "round",
|
|
@@ -20248,18 +20367,18 @@ function FallbackPermissionRequest({
|
|
|
20248
20367
|
paddingRight: 1,
|
|
20249
20368
|
paddingBottom: 1
|
|
20250
20369
|
},
|
|
20251
|
-
/* @__PURE__ */
|
|
20370
|
+
/* @__PURE__ */ React80.createElement(
|
|
20252
20371
|
PermissionRequestTitle,
|
|
20253
20372
|
{
|
|
20254
20373
|
title: "Tool use",
|
|
20255
20374
|
riskScore: toolUseConfirm.riskScore
|
|
20256
20375
|
}
|
|
20257
20376
|
),
|
|
20258
|
-
/* @__PURE__ */
|
|
20377
|
+
/* @__PURE__ */ React80.createElement(Box60, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React80.createElement(Text65, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20259
20378
|
toolUseConfirm.input,
|
|
20260
20379
|
{ verbose }
|
|
20261
|
-
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */
|
|
20262
|
-
/* @__PURE__ */
|
|
20380
|
+
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */ React80.createElement(Text65, { color: theme.secondaryText }, " (MCP)") : ""), /* @__PURE__ */ React80.createElement(Text65, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20381
|
+
/* @__PURE__ */ React80.createElement(Box60, { flexDirection: "column" }, /* @__PURE__ */ React80.createElement(Text65, null, "Do you want to proceed?"), /* @__PURE__ */ React80.createElement(
|
|
20263
20382
|
Select,
|
|
20264
20383
|
{
|
|
20265
20384
|
options: [
|
|
@@ -20375,17 +20494,17 @@ function useNotifyAfterTimeout(message, timeout = DEFAULT_INTERACTION_THRESHOLD_
|
|
|
20375
20494
|
}
|
|
20376
20495
|
|
|
20377
20496
|
// src/ui/components/permissions/file-write-permission-request/FileWritePermissionRequest.tsx
|
|
20378
|
-
import { Box as
|
|
20379
|
-
import
|
|
20497
|
+
import { Box as Box62, Text as Text67, useInput as useInput20 } from "ink";
|
|
20498
|
+
import React82, { useCallback as useCallback9, useMemo as useMemo19 } from "react";
|
|
20380
20499
|
import { basename as basename2, dirname as dirname6, extname as extname8 } from "path";
|
|
20381
20500
|
import { existsSync as existsSync12 } from "fs";
|
|
20382
20501
|
import chalk10 from "chalk";
|
|
20383
20502
|
|
|
20384
20503
|
// src/ui/components/permissions/file-write-permission-request/FileWriteToolDiff.tsx
|
|
20385
|
-
import * as
|
|
20504
|
+
import * as React81 from "react";
|
|
20386
20505
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "fs";
|
|
20387
20506
|
import { useMemo as useMemo18 } from "react";
|
|
20388
|
-
import { Box as
|
|
20507
|
+
import { Box as Box61, Text as Text66 } from "ink";
|
|
20389
20508
|
import { extname as extname7, relative as relative11 } from "path";
|
|
20390
20509
|
function FileWriteToolDiff({
|
|
20391
20510
|
file_path,
|
|
@@ -20412,17 +20531,17 @@ function FileWriteToolDiff({
|
|
|
20412
20531
|
newStr: content
|
|
20413
20532
|
});
|
|
20414
20533
|
}, [fileExists, file_path, oldContent, content]);
|
|
20415
|
-
return /* @__PURE__ */
|
|
20416
|
-
|
|
20534
|
+
return /* @__PURE__ */ React81.createElement(
|
|
20535
|
+
Box61,
|
|
20417
20536
|
{
|
|
20418
20537
|
borderColor: getTheme().secondaryBorder,
|
|
20419
20538
|
borderStyle: "round",
|
|
20420
20539
|
flexDirection: "column",
|
|
20421
20540
|
paddingX: 1
|
|
20422
20541
|
},
|
|
20423
|
-
/* @__PURE__ */
|
|
20542
|
+
/* @__PURE__ */ React81.createElement(Box61, { paddingBottom: 1 }, /* @__PURE__ */ React81.createElement(Text66, { bold: true }, verbose ? file_path : relative11(getCwd(), file_path))),
|
|
20424
20543
|
hunks ? intersperse(
|
|
20425
|
-
hunks.map((_) => /* @__PURE__ */
|
|
20544
|
+
hunks.map((_) => /* @__PURE__ */ React81.createElement(
|
|
20426
20545
|
StructuredDiff,
|
|
20427
20546
|
{
|
|
20428
20547
|
key: _.newStart,
|
|
@@ -20431,8 +20550,8 @@ function FileWriteToolDiff({
|
|
|
20431
20550
|
width
|
|
20432
20551
|
}
|
|
20433
20552
|
)),
|
|
20434
|
-
(i) => /* @__PURE__ */
|
|
20435
|
-
) : /* @__PURE__ */
|
|
20553
|
+
(i) => /* @__PURE__ */ React81.createElement(React81.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React81.createElement(Text66, { color: getTheme().secondaryText }, "..."))
|
|
20554
|
+
) : /* @__PURE__ */ React81.createElement(
|
|
20436
20555
|
HighlightedCode,
|
|
20437
20556
|
{
|
|
20438
20557
|
code: content || "(No content)",
|
|
@@ -20567,8 +20686,8 @@ function FileWritePermissionRequest({
|
|
|
20567
20686
|
handleChoice("yes-session");
|
|
20568
20687
|
return true;
|
|
20569
20688
|
});
|
|
20570
|
-
return /* @__PURE__ */
|
|
20571
|
-
|
|
20689
|
+
return /* @__PURE__ */ React82.createElement(
|
|
20690
|
+
Box62,
|
|
20572
20691
|
{
|
|
20573
20692
|
flexDirection: "column",
|
|
20574
20693
|
borderStyle: "round",
|
|
@@ -20578,14 +20697,14 @@ function FileWritePermissionRequest({
|
|
|
20578
20697
|
paddingRight: 1,
|
|
20579
20698
|
paddingBottom: 1
|
|
20580
20699
|
},
|
|
20581
|
-
/* @__PURE__ */
|
|
20700
|
+
/* @__PURE__ */ React82.createElement(
|
|
20582
20701
|
PermissionRequestTitle,
|
|
20583
20702
|
{
|
|
20584
20703
|
title: `${fileExists ? "Edit" : "Create"} file`,
|
|
20585
20704
|
riskScore: toolUseConfirm.riskScore
|
|
20586
20705
|
}
|
|
20587
20706
|
),
|
|
20588
|
-
/* @__PURE__ */
|
|
20707
|
+
/* @__PURE__ */ React82.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(
|
|
20589
20708
|
FileWriteToolDiff,
|
|
20590
20709
|
{
|
|
20591
20710
|
file_path,
|
|
@@ -20594,7 +20713,7 @@ function FileWritePermissionRequest({
|
|
|
20594
20713
|
width: columns - 12
|
|
20595
20714
|
}
|
|
20596
20715
|
)),
|
|
20597
|
-
/* @__PURE__ */
|
|
20716
|
+
/* @__PURE__ */ React82.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(Text67, null, "Do you want to ", fileExists ? "make this edit to" : "create", " ", /* @__PURE__ */ React82.createElement(Text67, { bold: true }, basename2(file_path)), "?"), /* @__PURE__ */ React82.createElement(
|
|
20598
20717
|
Select,
|
|
20599
20718
|
{
|
|
20600
20719
|
options: [
|
|
@@ -20628,8 +20747,8 @@ async function extractLanguageName2(file_path) {
|
|
|
20628
20747
|
}
|
|
20629
20748
|
|
|
20630
20749
|
// src/ui/components/permissions/filesystem-permission-request/FilesystemPermissionRequest.tsx
|
|
20631
|
-
import { Box as
|
|
20632
|
-
import
|
|
20750
|
+
import { Box as Box63, Text as Text68, useInput as useInput21 } from "ink";
|
|
20751
|
+
import React83, { useCallback as useCallback10, useMemo as useMemo20 } from "react";
|
|
20633
20752
|
import chalk11 from "chalk";
|
|
20634
20753
|
import { basename as basename3, dirname as dirname7 } from "path";
|
|
20635
20754
|
import { statSync as statSync10 } from "fs";
|
|
@@ -20686,7 +20805,7 @@ function FilesystemPermissionRequest({
|
|
|
20686
20805
|
}) {
|
|
20687
20806
|
const path5 = pathFromToolUse(toolUseConfirm);
|
|
20688
20807
|
if (!path5) {
|
|
20689
|
-
return /* @__PURE__ */
|
|
20808
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20690
20809
|
FallbackPermissionRequest,
|
|
20691
20810
|
{
|
|
20692
20811
|
toolUseConfirm,
|
|
@@ -20695,7 +20814,7 @@ function FilesystemPermissionRequest({
|
|
|
20695
20814
|
}
|
|
20696
20815
|
);
|
|
20697
20816
|
}
|
|
20698
|
-
return /* @__PURE__ */
|
|
20817
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20699
20818
|
FilesystemPermissionRequestImpl,
|
|
20700
20819
|
{
|
|
20701
20820
|
toolUseConfirm,
|
|
@@ -20837,8 +20956,8 @@ function FilesystemPermissionRequestImpl({
|
|
|
20837
20956
|
handleChoice("yes-session");
|
|
20838
20957
|
return true;
|
|
20839
20958
|
});
|
|
20840
|
-
return /* @__PURE__ */
|
|
20841
|
-
|
|
20959
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20960
|
+
Box63,
|
|
20842
20961
|
{
|
|
20843
20962
|
flexDirection: "column",
|
|
20844
20963
|
borderStyle: "round",
|
|
@@ -20848,18 +20967,18 @@ function FilesystemPermissionRequestImpl({
|
|
|
20848
20967
|
paddingRight: 1,
|
|
20849
20968
|
paddingBottom: 1
|
|
20850
20969
|
},
|
|
20851
|
-
/* @__PURE__ */
|
|
20970
|
+
/* @__PURE__ */ React83.createElement(
|
|
20852
20971
|
PermissionRequestTitle,
|
|
20853
20972
|
{
|
|
20854
20973
|
title,
|
|
20855
20974
|
riskScore: toolUseConfirm.riskScore
|
|
20856
20975
|
}
|
|
20857
20976
|
),
|
|
20858
|
-
/* @__PURE__ */
|
|
20977
|
+
/* @__PURE__ */ React83.createElement(Box63, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React83.createElement(Text68, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20859
20978
|
toolUseConfirm.input,
|
|
20860
20979
|
{ verbose }
|
|
20861
20980
|
), ")")),
|
|
20862
|
-
/* @__PURE__ */
|
|
20981
|
+
/* @__PURE__ */ React83.createElement(Box63, { flexDirection: "column" }, /* @__PURE__ */ React83.createElement(Text68, null, "Do you want to proceed?"), /* @__PURE__ */ React83.createElement(
|
|
20863
20982
|
Select,
|
|
20864
20983
|
{
|
|
20865
20984
|
options: [
|
|
@@ -20887,7 +21006,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
20887
21006
|
|
|
20888
21007
|
// src/tools/ai/SkillTool/SkillTool.tsx
|
|
20889
21008
|
import { z as z9 } from "zod";
|
|
20890
|
-
import * as
|
|
21009
|
+
import * as React84 from "react";
|
|
20891
21010
|
|
|
20892
21011
|
// src/tools/ai/SkillTool/prompt.ts
|
|
20893
21012
|
var TOOL_NAME_FOR_PROMPT5 = "Skill";
|
|
@@ -20984,7 +21103,7 @@ ${availableSkills}${truncatedNotice}
|
|
|
20984
21103
|
return skill || "";
|
|
20985
21104
|
},
|
|
20986
21105
|
renderToolUseRejectedMessage() {
|
|
20987
|
-
return /* @__PURE__ */
|
|
21106
|
+
return /* @__PURE__ */ React84.createElement(FallbackToolUseRejectedMessage, null);
|
|
20988
21107
|
},
|
|
20989
21108
|
renderResultForAssistant(output) {
|
|
20990
21109
|
return `Launching skill: ${output.commandName}`;
|
|
@@ -21119,8 +21238,8 @@ function findCommand(commandName, commands) {
|
|
|
21119
21238
|
}
|
|
21120
21239
|
|
|
21121
21240
|
// src/ui/components/permissions/slash-command-permission-request/SlashCommandPermissionRequest.tsx
|
|
21122
|
-
import { Box as
|
|
21123
|
-
import
|
|
21241
|
+
import { Box as Box64, Text as Text69 } from "ink";
|
|
21242
|
+
import React85, { useMemo as useMemo21 } from "react";
|
|
21124
21243
|
import chalk12 from "chalk";
|
|
21125
21244
|
function parsePrefix(command4) {
|
|
21126
21245
|
const trimmed = command4.trim();
|
|
@@ -21145,8 +21264,8 @@ function SlashCommandPermissionRequest({
|
|
|
21145
21264
|
const command4 = typeof toolUseConfirm.input.command === "string" ? toolUseConfirm.input.command : "";
|
|
21146
21265
|
const prefix = parsePrefix(command4);
|
|
21147
21266
|
const showPrefixOption = !!prefix && hasArgs(command4);
|
|
21148
|
-
return /* @__PURE__ */
|
|
21149
|
-
|
|
21267
|
+
return /* @__PURE__ */ React85.createElement(
|
|
21268
|
+
Box64,
|
|
21150
21269
|
{
|
|
21151
21270
|
flexDirection: "column",
|
|
21152
21271
|
borderStyle: "round",
|
|
@@ -21156,14 +21275,14 @@ function SlashCommandPermissionRequest({
|
|
|
21156
21275
|
paddingRight: 1,
|
|
21157
21276
|
paddingBottom: 1
|
|
21158
21277
|
},
|
|
21159
|
-
/* @__PURE__ */
|
|
21160
|
-
/* @__PURE__ */
|
|
21278
|
+
/* @__PURE__ */ React85.createElement(PermissionRequestTitle, { title: "Slash command", riskScore: null }),
|
|
21279
|
+
/* @__PURE__ */ React85.createElement(Box64, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React85.createElement(Text69, null, toolUseConfirm.tool.userFacingName?.() || "SlashCommand", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
21161
21280
|
toolUseConfirm.input,
|
|
21162
21281
|
{
|
|
21163
21282
|
verbose
|
|
21164
21283
|
}
|
|
21165
|
-
), ")"), /* @__PURE__ */
|
|
21166
|
-
/* @__PURE__ */
|
|
21284
|
+
), ")"), /* @__PURE__ */ React85.createElement(Text69, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
21285
|
+
/* @__PURE__ */ React85.createElement(Box64, { flexDirection: "column" }, /* @__PURE__ */ React85.createElement(Text69, null, "Do you want to proceed?"), /* @__PURE__ */ React85.createElement(
|
|
21167
21286
|
Select,
|
|
21168
21287
|
{
|
|
21169
21288
|
options: [
|
|
@@ -21264,8 +21383,8 @@ function SlashCommandPermissionRequest({
|
|
|
21264
21383
|
}
|
|
21265
21384
|
|
|
21266
21385
|
// src/ui/components/permissions/skill-permission-request/SkillPermissionRequest.tsx
|
|
21267
|
-
import { Box as
|
|
21268
|
-
import
|
|
21386
|
+
import { Box as Box65, Text as Text70 } from "ink";
|
|
21387
|
+
import React86, { useMemo as useMemo22 } from "react";
|
|
21269
21388
|
import chalk13 from "chalk";
|
|
21270
21389
|
function SkillPermissionRequest({
|
|
21271
21390
|
toolUseConfirm,
|
|
@@ -21280,8 +21399,8 @@ function SkillPermissionRequest({
|
|
|
21280
21399
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
21281
21400
|
const raw = typeof toolUseConfirm.input.skill === "string" ? toolUseConfirm.input.skill : "";
|
|
21282
21401
|
const skill = raw.trim().replace(/^\//, "");
|
|
21283
|
-
return /* @__PURE__ */
|
|
21284
|
-
|
|
21402
|
+
return /* @__PURE__ */ React86.createElement(
|
|
21403
|
+
Box65,
|
|
21285
21404
|
{
|
|
21286
21405
|
flexDirection: "column",
|
|
21287
21406
|
borderStyle: "round",
|
|
@@ -21291,14 +21410,14 @@ function SkillPermissionRequest({
|
|
|
21291
21410
|
paddingRight: 1,
|
|
21292
21411
|
paddingBottom: 1
|
|
21293
21412
|
},
|
|
21294
|
-
/* @__PURE__ */
|
|
21295
|
-
/* @__PURE__ */
|
|
21413
|
+
/* @__PURE__ */ React86.createElement(PermissionRequestTitle, { title: "Skill", riskScore: null }),
|
|
21414
|
+
/* @__PURE__ */ React86.createElement(Box65, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React86.createElement(Text70, null, toolUseConfirm.tool.userFacingName?.() || "Skill", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
21296
21415
|
toolUseConfirm.input,
|
|
21297
21416
|
{
|
|
21298
21417
|
verbose
|
|
21299
21418
|
}
|
|
21300
|
-
), ")"), /* @__PURE__ */
|
|
21301
|
-
/* @__PURE__ */
|
|
21419
|
+
), ")"), /* @__PURE__ */ React86.createElement(Text70, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
21420
|
+
/* @__PURE__ */ React86.createElement(Box65, { flexDirection: "column" }, /* @__PURE__ */ React86.createElement(Text70, null, "Do you want to proceed?"), /* @__PURE__ */ React86.createElement(
|
|
21302
21421
|
Select,
|
|
21303
21422
|
{
|
|
21304
21423
|
options: [
|
|
@@ -21368,8 +21487,8 @@ function SkillPermissionRequest({
|
|
|
21368
21487
|
}
|
|
21369
21488
|
|
|
21370
21489
|
// src/tools/agent/PlanModeTool/EnterPlanModeTool.tsx
|
|
21371
|
-
import { Box as
|
|
21372
|
-
import
|
|
21490
|
+
import { Box as Box66, Text as Text71 } from "ink";
|
|
21491
|
+
import React87 from "react";
|
|
21373
21492
|
import { z as z10 } from "zod";
|
|
21374
21493
|
|
|
21375
21494
|
// src/tools/agent/PlanModeTool/prompt.ts
|
|
@@ -21521,11 +21640,11 @@ var EnterPlanModeTool = {
|
|
|
21521
21640
|
},
|
|
21522
21641
|
renderToolUseRejectedMessage() {
|
|
21523
21642
|
const theme = getTheme();
|
|
21524
|
-
return /* @__PURE__ */
|
|
21643
|
+
return /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React87.createElement(Text71, { color: theme.text }, BLACK_CIRCLE), /* @__PURE__ */ React87.createElement(Text71, null, " User declined to enter plan mode"));
|
|
21525
21644
|
},
|
|
21526
21645
|
renderToolResultMessage(_output) {
|
|
21527
21646
|
const theme = getTheme();
|
|
21528
|
-
return /* @__PURE__ */
|
|
21647
|
+
return /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React87.createElement(Text71, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React87.createElement(Text71, null, " Entered plan mode")), /* @__PURE__ */ React87.createElement(Box66, { paddingLeft: 2 }, /* @__PURE__ */ React87.createElement(Text71, { dimColor: true }, "Pyb Agent is now exploring and designing an implementation approach.")));
|
|
21529
21648
|
},
|
|
21530
21649
|
renderResultForAssistant(output) {
|
|
21531
21650
|
return `${output.message}
|
|
@@ -21558,8 +21677,8 @@ Remember: DO NOT write or edit any files yet. This is a read-only exploration an
|
|
|
21558
21677
|
};
|
|
21559
21678
|
|
|
21560
21679
|
// src/tools/agent/PlanModeTool/ExitPlanModeTool.tsx
|
|
21561
|
-
import { Box as
|
|
21562
|
-
import
|
|
21680
|
+
import { Box as Box67, Text as Text72 } from "ink";
|
|
21681
|
+
import React88 from "react";
|
|
21563
21682
|
import { z as z11 } from "zod";
|
|
21564
21683
|
function getExitPlanModePlanText(conversationKey) {
|
|
21565
21684
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
@@ -21604,8 +21723,8 @@ var ExitPlanModeTool = {
|
|
|
21604
21723
|
const conversationKey = typeof options.conversationKey === "string" && options.conversationKey.trim() ? options.conversationKey.trim() : void 0;
|
|
21605
21724
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
21606
21725
|
const plan = getExitPlanModePlanText(conversationKey);
|
|
21607
|
-
return /* @__PURE__ */
|
|
21608
|
-
|
|
21726
|
+
return /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text72, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React88.createElement(Text72, { color: theme.error }, "User rejected Pyb Agent's plan:"), /* @__PURE__ */ React88.createElement(
|
|
21727
|
+
Box67,
|
|
21609
21728
|
{
|
|
21610
21729
|
borderStyle: "round",
|
|
21611
21730
|
borderColor: theme.planMode,
|
|
@@ -21613,14 +21732,14 @@ var ExitPlanModeTool = {
|
|
|
21613
21732
|
paddingX: 1,
|
|
21614
21733
|
overflow: "hidden"
|
|
21615
21734
|
},
|
|
21616
|
-
/* @__PURE__ */
|
|
21735
|
+
/* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, plan)
|
|
21617
21736
|
))));
|
|
21618
21737
|
},
|
|
21619
21738
|
renderToolResultMessage(output) {
|
|
21620
21739
|
const theme = getTheme();
|
|
21621
21740
|
const planPath = typeof output.filePath === "string" ? output.filePath : null;
|
|
21622
21741
|
const plan = output.plan || "No plan found";
|
|
21623
|
-
return /* @__PURE__ */
|
|
21742
|
+
return /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text72, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React88.createElement(Text72, null, " User approved Pyb Agent's plan")), /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text72, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column" }, planPath ? /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, "Plan saved to: ", planPath, " \xB7 /plan to edit") : null, /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, plan))));
|
|
21624
21743
|
},
|
|
21625
21744
|
renderResultForAssistant(output) {
|
|
21626
21745
|
if (output.isAgent) {
|
|
@@ -21704,8 +21823,8 @@ ${output.plan}`;
|
|
|
21704
21823
|
};
|
|
21705
21824
|
|
|
21706
21825
|
// src/ui/components/permissions/plan-mode-permission-request/EnterPlanModePermissionRequest.tsx
|
|
21707
|
-
import { Box as
|
|
21708
|
-
import
|
|
21826
|
+
import { Box as Box68, Text as Text73, useInput as useInput22 } from "ink";
|
|
21827
|
+
import React89 from "react";
|
|
21709
21828
|
function EnterPlanModePermissionRequest({
|
|
21710
21829
|
toolUseConfirm,
|
|
21711
21830
|
onDone
|
|
@@ -21718,8 +21837,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21718
21837
|
onDone();
|
|
21719
21838
|
}
|
|
21720
21839
|
});
|
|
21721
|
-
return /* @__PURE__ */
|
|
21722
|
-
|
|
21840
|
+
return /* @__PURE__ */ React89.createElement(
|
|
21841
|
+
Box68,
|
|
21723
21842
|
{
|
|
21724
21843
|
flexDirection: "column",
|
|
21725
21844
|
borderStyle: "round",
|
|
@@ -21729,11 +21848,11 @@ function EnterPlanModePermissionRequest({
|
|
|
21729
21848
|
paddingRight: 1,
|
|
21730
21849
|
paddingBottom: 1
|
|
21731
21850
|
},
|
|
21732
|
-
/* @__PURE__ */
|
|
21733
|
-
/* @__PURE__ */
|
|
21734
|
-
/* @__PURE__ */
|
|
21735
|
-
/* @__PURE__ */
|
|
21736
|
-
/* @__PURE__ */
|
|
21851
|
+
/* @__PURE__ */ React89.createElement(PermissionRequestTitle, { title: "Enter plan mode?", riskScore: null }),
|
|
21852
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React89.createElement(Text73, null, "The assistant wants to enter plan mode to explore and design an implementation approach.")),
|
|
21853
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, "In plan mode, the assistant will:"), /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, " \xB7 Explore the codebase thoroughly"), /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, " \xB7 Identify existing patterns"), /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, " \xB7 Design an implementation strategy"), /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, " \xB7 Present a plan for your approval")),
|
|
21854
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, "No code changes will be made until you approve the plan.")),
|
|
21855
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column" }, /* @__PURE__ */ React89.createElement(Text73, null, "Would you like to proceed?"), /* @__PURE__ */ React89.createElement(
|
|
21737
21856
|
Select,
|
|
21738
21857
|
{
|
|
21739
21858
|
options: [
|
|
@@ -21756,8 +21875,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21756
21875
|
}
|
|
21757
21876
|
|
|
21758
21877
|
// src/ui/components/permissions/plan-mode-permission-request/ExitPlanModePermissionRequest.tsx
|
|
21759
|
-
import { Box as
|
|
21760
|
-
import
|
|
21878
|
+
import { Box as Box69, Text as Text74, useInput as useInput23 } from "ink";
|
|
21879
|
+
import React90, { useEffect as useEffect20, useMemo as useMemo23, useState as useState21 } from "react";
|
|
21761
21880
|
|
|
21762
21881
|
// src/utils/system/externalEditor.ts
|
|
21763
21882
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -22064,8 +22183,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22064
22183
|
[bypassAvailable, launchSwarmAvailable, teammateCount]
|
|
22065
22184
|
);
|
|
22066
22185
|
if (showRejectInput) {
|
|
22067
|
-
return /* @__PURE__ */
|
|
22068
|
-
|
|
22186
|
+
return /* @__PURE__ */ React90.createElement(
|
|
22187
|
+
Box69,
|
|
22069
22188
|
{
|
|
22070
22189
|
flexDirection: "column",
|
|
22071
22190
|
borderStyle: "round",
|
|
@@ -22075,8 +22194,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22075
22194
|
paddingRight: 1,
|
|
22076
22195
|
paddingBottom: 1
|
|
22077
22196
|
},
|
|
22078
|
-
/* @__PURE__ */
|
|
22079
|
-
/* @__PURE__ */
|
|
22197
|
+
/* @__PURE__ */ React90.createElement(PermissionRequestTitle, { title: "No, keep planning", riskScore: null }),
|
|
22198
|
+
/* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React90.createElement(Text74, { dimColor: true }, "Type here to tell Pyb Agent what to change (Enter submits, Esc cancels)"), rejectError ? /* @__PURE__ */ React90.createElement(Text74, { color: theme.error }, rejectError) : null, /* @__PURE__ */ React90.createElement(
|
|
22080
22199
|
TextInput,
|
|
22081
22200
|
{
|
|
22082
22201
|
value: rejectFeedback,
|
|
@@ -22105,8 +22224,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22105
22224
|
))
|
|
22106
22225
|
);
|
|
22107
22226
|
}
|
|
22108
|
-
return /* @__PURE__ */
|
|
22109
|
-
|
|
22227
|
+
return /* @__PURE__ */ React90.createElement(
|
|
22228
|
+
Box69,
|
|
22110
22229
|
{
|
|
22111
22230
|
flexDirection: "column",
|
|
22112
22231
|
borderStyle: "round",
|
|
@@ -22116,9 +22235,9 @@ function ExitPlanModePermissionRequest({
|
|
|
22116
22235
|
paddingRight: 1,
|
|
22117
22236
|
paddingBottom: 1
|
|
22118
22237
|
},
|
|
22119
|
-
/* @__PURE__ */
|
|
22120
|
-
/* @__PURE__ */
|
|
22121
|
-
|
|
22238
|
+
/* @__PURE__ */ React90.createElement(PermissionRequestTitle, { title: "Ready to code?", riskScore: null }),
|
|
22239
|
+
/* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React90.createElement(Text74, null, "Here is Pyb Agent's plan:"), /* @__PURE__ */ React90.createElement(
|
|
22240
|
+
Box69,
|
|
22122
22241
|
{
|
|
22123
22242
|
borderStyle: "dashed",
|
|
22124
22243
|
borderColor: theme.secondaryBorder,
|
|
@@ -22130,10 +22249,10 @@ function ExitPlanModePermissionRequest({
|
|
|
22130
22249
|
marginBottom: 1,
|
|
22131
22250
|
flexDirection: "column"
|
|
22132
22251
|
},
|
|
22133
|
-
/* @__PURE__ */
|
|
22252
|
+
/* @__PURE__ */ React90.createElement(Text74, null, planText)
|
|
22134
22253
|
)),
|
|
22135
|
-
/* @__PURE__ */
|
|
22136
|
-
/* @__PURE__ */
|
|
22254
|
+
/* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React90.createElement(Text74, { dimColor: true }, "Tip: Press ctrl+g to edit", " ", planSource === "file" ? `plan file: ${planFilePath}` : "plan text", planSaved ? " \xB7 Plan saved!" : "")),
|
|
22255
|
+
/* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React90.createElement(Text74, { dimColor: true }, "Would you like to proceed?"), /* @__PURE__ */ React90.createElement(
|
|
22137
22256
|
Select,
|
|
22138
22257
|
{
|
|
22139
22258
|
options,
|
|
@@ -22159,8 +22278,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22159
22278
|
}
|
|
22160
22279
|
|
|
22161
22280
|
// src/tools/interaction/AskUserQuestionTool/AskUserQuestionTool.tsx
|
|
22162
|
-
import { Box as
|
|
22163
|
-
import
|
|
22281
|
+
import { Box as Box70, Text as Text75 } from "ink";
|
|
22282
|
+
import React91 from "react";
|
|
22164
22283
|
import { z as z12 } from "zod";
|
|
22165
22284
|
|
|
22166
22285
|
// src/tools/interaction/AskUserQuestionTool/prompt.ts
|
|
@@ -22237,11 +22356,11 @@ var AskUserQuestionTool = {
|
|
|
22237
22356
|
},
|
|
22238
22357
|
renderToolUseRejectedMessage() {
|
|
22239
22358
|
const theme = getTheme();
|
|
22240
|
-
return /* @__PURE__ */
|
|
22359
|
+
return /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React91.createElement(Text75, null, "User declined to answer questions"));
|
|
22241
22360
|
},
|
|
22242
22361
|
renderToolResultMessage(output, _options) {
|
|
22243
22362
|
const theme = getTheme();
|
|
22244
|
-
return /* @__PURE__ */
|
|
22363
|
+
return /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "row" }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React91.createElement(Text75, null, "User answered Pyb Agent's questions:")), /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", paddingLeft: 2 }, Object.entries(output.answers).map(([question, answer]) => /* @__PURE__ */ React91.createElement(Box70, { key: question }, /* @__PURE__ */ React91.createElement(Text75, { dimColor: true }, "\xB7 ", question, " \u2192 ", answer)))));
|
|
22245
22364
|
},
|
|
22246
22365
|
renderResultForAssistant(output) {
|
|
22247
22366
|
const formatted = Object.entries(output.answers).map(([question, answer]) => `"${question}"="${answer}"`).join(", ");
|
|
@@ -22258,8 +22377,8 @@ var AskUserQuestionTool = {
|
|
|
22258
22377
|
};
|
|
22259
22378
|
|
|
22260
22379
|
// src/ui/components/permissions/ask-user-question-permission-request/AskUserQuestionPermissionRequest.tsx
|
|
22261
|
-
import
|
|
22262
|
-
import { Box as
|
|
22380
|
+
import React92, { useCallback as useCallback11, useMemo as useMemo24, useState as useState22 } from "react";
|
|
22381
|
+
import { Box as Box71, Text as Text76, useInput as useInput24 } from "ink";
|
|
22263
22382
|
import figures8 from "figures";
|
|
22264
22383
|
import stringWidth from "string-width";
|
|
22265
22384
|
function isTextInputChar(input, key) {
|
|
@@ -22613,18 +22732,18 @@ function AskUserQuestionPermissionRequest({
|
|
|
22613
22732
|
const rightArrowInactive = currentQuestionIndex === maxTabIndex;
|
|
22614
22733
|
const allQuestionsAnswered = questions.every((q) => q?.question && Boolean(answers[q.question])) ?? false;
|
|
22615
22734
|
if (questions.length === 0) {
|
|
22616
|
-
return /* @__PURE__ */
|
|
22735
|
+
return /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text76, { color: theme.error }, "Invalid AskUserQuestion input."), /* @__PURE__ */ React92.createElement(Text76, { dimColor: true }, "Press Esc to cancel."));
|
|
22617
22736
|
}
|
|
22618
|
-
return /* @__PURE__ */
|
|
22619
|
-
|
|
22737
|
+
return /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(
|
|
22738
|
+
Box71,
|
|
22620
22739
|
{
|
|
22621
22740
|
borderTop: true,
|
|
22622
22741
|
borderColor: theme.secondaryText,
|
|
22623
22742
|
flexDirection: "column",
|
|
22624
22743
|
paddingTop: 0
|
|
22625
22744
|
},
|
|
22626
|
-
/* @__PURE__ */
|
|
22627
|
-
|
|
22745
|
+
/* @__PURE__ */ React92.createElement(Box71, { flexDirection: "row", marginBottom: 1 }, showArrows && /* @__PURE__ */ React92.createElement(
|
|
22746
|
+
Text76,
|
|
22628
22747
|
{
|
|
22629
22748
|
color: currentQuestionIndex === 0 ? theme.secondaryText : void 0
|
|
22630
22749
|
},
|
|
@@ -22635,16 +22754,16 @@ function AskUserQuestionPermissionRequest({
|
|
|
22635
22754
|
const checkbox = question.question && answers[question.question] ? figures8.checkboxOn : figures8.checkboxOff;
|
|
22636
22755
|
const headerText = tabHeaders[index] ?? question.header ?? `Q${index + 1}`;
|
|
22637
22756
|
const tabText = ` ${checkbox} ${headerText} `;
|
|
22638
|
-
return /* @__PURE__ */
|
|
22639
|
-
|
|
22757
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, { key: question.question || `question-${index}` }, /* @__PURE__ */ React92.createElement(
|
|
22758
|
+
Text76,
|
|
22640
22759
|
{
|
|
22641
22760
|
backgroundColor: isSelected ? theme.permission : void 0,
|
|
22642
22761
|
color: isSelected ? inverseText : void 0
|
|
22643
22762
|
},
|
|
22644
22763
|
tabText
|
|
22645
22764
|
));
|
|
22646
|
-
}), !hideSubmitTab && /* @__PURE__ */
|
|
22647
|
-
|
|
22765
|
+
}), !hideSubmitTab && /* @__PURE__ */ React92.createElement(
|
|
22766
|
+
Text76,
|
|
22648
22767
|
{
|
|
22649
22768
|
backgroundColor: isSubmitTab ? theme.permission : void 0,
|
|
22650
22769
|
color: isSubmitTab ? inverseText : void 0
|
|
@@ -22653,23 +22772,23 @@ function AskUserQuestionPermissionRequest({
|
|
|
22653
22772
|
figures8.tick,
|
|
22654
22773
|
" Submit",
|
|
22655
22774
|
" "
|
|
22656
|
-
), showArrows && /* @__PURE__ */
|
|
22657
|
-
!isSubmitTab && currentQuestion && /* @__PURE__ */
|
|
22775
|
+
), showArrows && /* @__PURE__ */ React92.createElement(Text76, { color: rightArrowInactive ? theme.secondaryText : void 0 }, " ", "\u2192")),
|
|
22776
|
+
!isSubmitTab && currentQuestion && /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(Text76, { bold: true }, currentQuestion.question), /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column", marginTop: 1 }, (() => {
|
|
22658
22777
|
const rawSelected = activeQuestionState?.selectedValue;
|
|
22659
22778
|
const selectedValues = Array.isArray(rawSelected) ? rawSelected : [];
|
|
22660
22779
|
const otherSelected = currentQuestion.multiSelect ? selectedValues.includes("__other__") : rawSelected === "__other__";
|
|
22661
22780
|
const otherText = questionStates[currentQuestion.question]?.textInputValue ?? "";
|
|
22662
22781
|
const otherPlaceholder = currentQuestion.multiSelect ? "Type something" : "Type something.";
|
|
22663
22782
|
const otherLine = otherText.length > 0 ? otherText : isOtherFocused || otherSelected ? otherPlaceholder : "";
|
|
22664
|
-
return /* @__PURE__ */
|
|
22783
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, currentQuestion.options.map((option, index) => {
|
|
22665
22784
|
const isFocused = !isMultiSelectSubmitFocused && index === focusedOptionIndex;
|
|
22666
22785
|
const isSelected = currentQuestion.multiSelect ? selectedValues.includes(option.label) : rawSelected === option.label;
|
|
22667
22786
|
const pointer = isFocused ? figures8.pointer : " ";
|
|
22668
22787
|
const color = isFocused ? theme.pyb : theme.text;
|
|
22669
22788
|
const indicator = currentQuestion.multiSelect ? isSelected ? figures8.checkboxOn : figures8.checkboxOff : isSelected ? figures8.tick : " ";
|
|
22670
|
-
return /* @__PURE__ */
|
|
22671
|
-
}), /* @__PURE__ */
|
|
22672
|
-
|
|
22789
|
+
return /* @__PURE__ */ React92.createElement(Box71, { key: option.label, flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text76, { color }, pointer, " ", indicator, " ", option.label), /* @__PURE__ */ React92.createElement(Text76, { color: theme.secondaryText }, " ", option.description));
|
|
22790
|
+
}), /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text76, { color: isOtherFocused ? theme.pyb : theme.text }, isOtherFocused ? figures8.pointer : " ", " ", currentQuestion.multiSelect ? otherSelected ? figures8.checkboxOn : figures8.checkboxOff : otherSelected ? figures8.tick : " ", " ", "Other"), (isOtherFocused || otherSelected || otherText.trim().length > 0) && /* @__PURE__ */ React92.createElement(Text76, { color: theme.secondaryText }, otherLine, isOtherFocused && /* @__PURE__ */ React92.createElement(Text76, { color: "gray" }, "\u258C"))), currentQuestion.multiSelect && /* @__PURE__ */ React92.createElement(Box71, { marginTop: 0 }, /* @__PURE__ */ React92.createElement(
|
|
22791
|
+
Text76,
|
|
22673
22792
|
{
|
|
22674
22793
|
color: isMultiSelectSubmitFocused ? theme.pyb : theme.text,
|
|
22675
22794
|
bold: isMultiSelectSubmitFocused
|
|
@@ -22677,9 +22796,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
22677
22796
|
isMultiSelectSubmitFocused ? figures8.pointer : " ",
|
|
22678
22797
|
" ",
|
|
22679
22798
|
currentQuestionIndex === questions.length - 1 ? "Submit" : "Next"
|
|
22680
|
-
)), /* @__PURE__ */
|
|
22799
|
+
)), /* @__PURE__ */ React92.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text76, { color: theme.secondaryText, dimColor: true }, "Enter to select \xB7 Tab/Arrow keys to navigate \xB7 Esc to cancel")));
|
|
22681
22800
|
})())),
|
|
22682
|
-
isSubmitTab && /* @__PURE__ */
|
|
22801
|
+
isSubmitTab && /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text76, { bold: true }, "Review your answers"), !allQuestionsAnswered && /* @__PURE__ */ React92.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text76, { color: theme.warning }, figures8.warning, " You have not answered all questions")), /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column", marginTop: 1 }, questions.filter((q) => q?.question && answers[q.question]).map((q) => /* @__PURE__ */ React92.createElement(Box71, { key: q.question, flexDirection: "column", marginLeft: 1 }, /* @__PURE__ */ React92.createElement(Text76, null, figures8.bullet, " ", q.question), /* @__PURE__ */ React92.createElement(Box71, { marginLeft: 2 }, /* @__PURE__ */ React92.createElement(Text76, { color: theme.success }, figures8.arrowRight, " ", answers[q.question]))))), /* @__PURE__ */ React92.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text76, { color: theme.secondaryText }, "Ready to submit your answers?")), /* @__PURE__ */ React92.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(
|
|
22683
22802
|
Select,
|
|
22684
22803
|
{
|
|
22685
22804
|
options: [
|
|
@@ -22749,7 +22868,7 @@ function PermissionRequest({
|
|
|
22749
22868
|
`${PRODUCT_NAME} needs your permission to use ${toolName}`
|
|
22750
22869
|
);
|
|
22751
22870
|
const PermissionComponent = permissionComponentForTool(toolUseConfirm.tool);
|
|
22752
|
-
return /* @__PURE__ */
|
|
22871
|
+
return /* @__PURE__ */ React93.createElement(
|
|
22753
22872
|
PermissionComponent,
|
|
22754
22873
|
{
|
|
22755
22874
|
toolUseConfirm,
|
|
@@ -22760,8 +22879,8 @@ function PermissionRequest({
|
|
|
22760
22879
|
}
|
|
22761
22880
|
|
|
22762
22881
|
// src/ui/components/PromptInput.tsx
|
|
22763
|
-
import { Box as
|
|
22764
|
-
import * as
|
|
22882
|
+
import { Box as Box74, Text as Text79, useInput as useInput27 } from "ink";
|
|
22883
|
+
import * as React97 from "react";
|
|
22765
22884
|
|
|
22766
22885
|
// src/ui/hooks/useArrowKeyHistory.ts
|
|
22767
22886
|
import { useState as useState23 } from "react";
|
|
@@ -24795,8 +24914,8 @@ function countTokens(messages) {
|
|
|
24795
24914
|
}
|
|
24796
24915
|
|
|
24797
24916
|
// src/ui/components/SentryErrorBoundary.ts
|
|
24798
|
-
import * as
|
|
24799
|
-
var SentryErrorBoundary = class extends
|
|
24917
|
+
import * as React94 from "react";
|
|
24918
|
+
var SentryErrorBoundary = class extends React94.Component {
|
|
24800
24919
|
constructor(props) {
|
|
24801
24920
|
super(props);
|
|
24802
24921
|
this.state = { hasError: false };
|
|
@@ -24819,8 +24938,8 @@ var SentryErrorBoundary = class extends React93.Component {
|
|
|
24819
24938
|
};
|
|
24820
24939
|
|
|
24821
24940
|
// src/ui/components/TokenWarning.tsx
|
|
24822
|
-
import { Box as
|
|
24823
|
-
import * as
|
|
24941
|
+
import { Box as Box72, Text as Text77 } from "ink";
|
|
24942
|
+
import * as React95 from "react";
|
|
24824
24943
|
var MAX_TOKENS = 19e4;
|
|
24825
24944
|
var WARNING_THRESHOLD = MAX_TOKENS * 0.6;
|
|
24826
24945
|
var ERROR_THRESHOLD = MAX_TOKENS * 0.8;
|
|
@@ -24830,7 +24949,7 @@ function TokenWarning({ tokenUsage }) {
|
|
|
24830
24949
|
return null;
|
|
24831
24950
|
}
|
|
24832
24951
|
const isError = tokenUsage >= ERROR_THRESHOLD;
|
|
24833
|
-
return /* @__PURE__ */
|
|
24952
|
+
return /* @__PURE__ */ React95.createElement(Box72, { flexDirection: "row" }, /* @__PURE__ */ React95.createElement(Text77, { color: isError ? theme.error : theme.warning }, "Context low (", Math.max(0, 100 - Math.round(tokenUsage / MAX_TOKENS * 100)), "% remaining) \xB7 Run /compact to compact & continue"));
|
|
24834
24953
|
}
|
|
24835
24954
|
|
|
24836
24955
|
// src/utils/commands/hashCommand.ts
|
|
@@ -24876,8 +24995,8 @@ _Added on ${now.toLocaleString()} ${timezone}_`;
|
|
|
24876
24995
|
}
|
|
24877
24996
|
|
|
24878
24997
|
// src/ui/components/ModeIndicator.tsx
|
|
24879
|
-
import
|
|
24880
|
-
import { Box as
|
|
24998
|
+
import React96 from "react";
|
|
24999
|
+
import { Box as Box73, Text as Text78 } from "ink";
|
|
24881
25000
|
function __getModeIndicatorDisplayForTests(args) {
|
|
24882
25001
|
if (args.mode === "default") {
|
|
24883
25002
|
return {
|
|
@@ -24948,7 +25067,7 @@ function CompactModeIndicator() {
|
|
|
24948
25067
|
shortcutDisplayText: shortcut.displayText,
|
|
24949
25068
|
theme
|
|
24950
25069
|
});
|
|
24951
|
-
return /* @__PURE__ */
|
|
25070
|
+
return /* @__PURE__ */ React96.createElement(Text78, { color: indicator.color }, indicator.mainText, /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, indicator.shortcutHintText));
|
|
24952
25071
|
}
|
|
24953
25072
|
|
|
24954
25073
|
// src/utils/terminal/promptInputSpecialKey.ts
|
|
@@ -25075,7 +25194,7 @@ function useStatusLine() {
|
|
|
25075
25194
|
// src/ui/components/PromptInput.tsx
|
|
25076
25195
|
async function interpretHashCommand(input) {
|
|
25077
25196
|
try {
|
|
25078
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
25197
|
+
const { queryQuick: queryQuick2 } = await import("./llm-B56E7A3E.js");
|
|
25079
25198
|
const systemPrompt = [
|
|
25080
25199
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
25081
25200
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -25126,7 +25245,10 @@ function PromptInput({
|
|
|
25126
25245
|
onShowMessageSelector,
|
|
25127
25246
|
setForkConvoWithMessagesOnTheNextRender,
|
|
25128
25247
|
readFileTimestamps,
|
|
25129
|
-
onModelChange
|
|
25248
|
+
onModelChange,
|
|
25249
|
+
onQueueMessage,
|
|
25250
|
+
onQueueEditRequest,
|
|
25251
|
+
hasQueuedMessages
|
|
25130
25252
|
}) {
|
|
25131
25253
|
useEffect23(() => {
|
|
25132
25254
|
if (!isDisabled && !isLoading) {
|
|
@@ -25147,8 +25269,9 @@ function PromptInput({
|
|
|
25147
25269
|
const [pastedImages, setPastedImages] = useState26([]);
|
|
25148
25270
|
const [isEditingExternally, setIsEditingExternally] = useState26(false);
|
|
25149
25271
|
const [currentPwd, setCurrentPwd] = useState26(process.cwd());
|
|
25150
|
-
const
|
|
25151
|
-
const
|
|
25272
|
+
const [editingQueuedId, setEditingQueuedId] = useState26(null);
|
|
25273
|
+
const pastedTextCounter = React97.useRef(1);
|
|
25274
|
+
const pastedImageCounter = React97.useRef(1);
|
|
25152
25275
|
const { cycleMode, currentMode, toolPermissionContext } = usePermissionContext();
|
|
25153
25276
|
const modeCycleShortcut = useMemo25(() => getPermissionModeCycleShortcut(), []);
|
|
25154
25277
|
const showQuickModelSwitchShortcut = modeCycleShortcut.displayText !== "alt+m";
|
|
@@ -25183,13 +25306,13 @@ function PromptInput({
|
|
|
25183
25306
|
const isSelected = index === selectedIndex;
|
|
25184
25307
|
const isAgent = suggestion.type === "agent";
|
|
25185
25308
|
const displayColor = isSelected ? theme.suggestion : isAgent && suggestion.metadata?.color ? suggestion.metadata.color : void 0;
|
|
25186
|
-
return /* @__PURE__ */
|
|
25187
|
-
|
|
25309
|
+
return /* @__PURE__ */ React97.createElement(
|
|
25310
|
+
Box74,
|
|
25188
25311
|
{
|
|
25189
25312
|
key: `${suggestion.type}-${suggestion.value}-${index}`,
|
|
25190
25313
|
flexDirection: "row"
|
|
25191
25314
|
},
|
|
25192
|
-
/* @__PURE__ */
|
|
25315
|
+
/* @__PURE__ */ React97.createElement(Text79, { color: displayColor, dimColor: !isSelected && !displayColor }, isSelected ? "\u25C6 " : " ", suggestion.displayValue)
|
|
25193
25316
|
);
|
|
25194
25317
|
});
|
|
25195
25318
|
}, [suggestions, selectedIndex, theme.suggestion]);
|
|
@@ -25256,6 +25379,16 @@ function PromptInput({
|
|
|
25256
25379
|
);
|
|
25257
25380
|
const handleHistoryUp = () => {
|
|
25258
25381
|
if (!completionActive) {
|
|
25382
|
+
if (isLoading && hasQueuedMessages && onQueueEditRequest) {
|
|
25383
|
+
const queued = onQueueEditRequest(editingQueuedId ?? void 0);
|
|
25384
|
+
if (queued) {
|
|
25385
|
+
onInputChange(queued.content);
|
|
25386
|
+
onModeChange(queued.mode);
|
|
25387
|
+
setCursorOffset(queued.content.length);
|
|
25388
|
+
setEditingQueuedId(queued.id);
|
|
25389
|
+
return;
|
|
25390
|
+
}
|
|
25391
|
+
}
|
|
25259
25392
|
onHistoryUp();
|
|
25260
25393
|
}
|
|
25261
25394
|
};
|
|
@@ -25268,6 +25401,47 @@ function PromptInput({
|
|
|
25268
25401
|
if (!isSubmittingSlashCommand && completionActive && suggestions.length > 0) {
|
|
25269
25402
|
return;
|
|
25270
25403
|
}
|
|
25404
|
+
if (input2 === "" && !(isLoading && editingQueuedId)) {
|
|
25405
|
+
return;
|
|
25406
|
+
}
|
|
25407
|
+
if (isDisabled) {
|
|
25408
|
+
return;
|
|
25409
|
+
}
|
|
25410
|
+
if (isLoading) {
|
|
25411
|
+
if (onQueueMessage) {
|
|
25412
|
+
if (editingQueuedId) {
|
|
25413
|
+
if (input2 === "") {
|
|
25414
|
+
onQueueMessage({
|
|
25415
|
+
content: "",
|
|
25416
|
+
mode,
|
|
25417
|
+
replaceId: editingQueuedId,
|
|
25418
|
+
delete: true
|
|
25419
|
+
});
|
|
25420
|
+
setEditingQueuedId(null);
|
|
25421
|
+
onInputChange("");
|
|
25422
|
+
setCursorOffset(0);
|
|
25423
|
+
return;
|
|
25424
|
+
}
|
|
25425
|
+
const inputToAdd2 = mode === "bash" ? `!${input2}` : input2;
|
|
25426
|
+
addToHistory(inputToAdd2);
|
|
25427
|
+
resetHistory();
|
|
25428
|
+
onInputChange("");
|
|
25429
|
+
onQueueMessage({
|
|
25430
|
+
content: input2,
|
|
25431
|
+
mode,
|
|
25432
|
+
replaceId: editingQueuedId
|
|
25433
|
+
});
|
|
25434
|
+
setEditingQueuedId(null);
|
|
25435
|
+
return;
|
|
25436
|
+
}
|
|
25437
|
+
const inputToAdd = mode === "bash" ? `!${input2}` : input2;
|
|
25438
|
+
addToHistory(inputToAdd);
|
|
25439
|
+
resetHistory();
|
|
25440
|
+
onInputChange("");
|
|
25441
|
+
onQueueMessage({ content: input2, mode });
|
|
25442
|
+
}
|
|
25443
|
+
return;
|
|
25444
|
+
}
|
|
25271
25445
|
if ((mode === "pyb" || input2.startsWith("#")) && input2.match(/^(#\s*)?(put|create|generate|write|give|provide)/i)) {
|
|
25272
25446
|
try {
|
|
25273
25447
|
const originalInput = input2;
|
|
@@ -25334,15 +25508,6 @@ function PromptInput({
|
|
|
25334
25508
|
onModeChange("prompt");
|
|
25335
25509
|
return;
|
|
25336
25510
|
}
|
|
25337
|
-
if (input2 === "") {
|
|
25338
|
-
return;
|
|
25339
|
-
}
|
|
25340
|
-
if (isDisabled) {
|
|
25341
|
-
return;
|
|
25342
|
-
}
|
|
25343
|
-
if (isLoading) {
|
|
25344
|
-
return;
|
|
25345
|
-
}
|
|
25346
25511
|
if (["exit", "quit", ":q", ":q!", ":wq", ":wq!"].includes(input2.trim())) {
|
|
25347
25512
|
exit();
|
|
25348
25513
|
}
|
|
@@ -25388,7 +25553,7 @@ function PromptInput({
|
|
|
25388
25553
|
if (messages2.length) {
|
|
25389
25554
|
if (mode === "bash") {
|
|
25390
25555
|
onQuery(messages2, newAbortController).then(async () => {
|
|
25391
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
25556
|
+
const { getCwd: getCwd2 } = await import("./state-2EUXD6CF.js");
|
|
25392
25557
|
setCurrentPwd(getCwd2());
|
|
25393
25558
|
});
|
|
25394
25559
|
} else {
|
|
@@ -25440,6 +25605,12 @@ function PromptInput({
|
|
|
25440
25605
|
}, [input]);
|
|
25441
25606
|
useInput27(
|
|
25442
25607
|
(inputChar, key) => {
|
|
25608
|
+
if (key.escape && isLoading && editingQueuedId) {
|
|
25609
|
+
setEditingQueuedId(null);
|
|
25610
|
+
onInputChange("");
|
|
25611
|
+
setCursorOffset(0);
|
|
25612
|
+
return true;
|
|
25613
|
+
}
|
|
25443
25614
|
if (mode === "bash" && (key.backspace || key.delete)) {
|
|
25444
25615
|
if (input === "") {
|
|
25445
25616
|
onModeChange("prompt");
|
|
@@ -25544,17 +25715,17 @@ function PromptInput({
|
|
|
25544
25715
|
currentTokens: tokenUsage
|
|
25545
25716
|
};
|
|
25546
25717
|
}, [tokenUsage, modelSwitchMessage.show, submitCount, currentModelId]);
|
|
25547
|
-
return /* @__PURE__ */
|
|
25548
|
-
|
|
25718
|
+
return /* @__PURE__ */ React97.createElement(Box74, { flexDirection: "column" }, (mode === "bash" || modelInfo) && /* @__PURE__ */ React97.createElement(
|
|
25719
|
+
Box74,
|
|
25549
25720
|
{
|
|
25550
25721
|
justifyContent: "space-between",
|
|
25551
25722
|
marginBottom: 1,
|
|
25552
25723
|
flexDirection: "row"
|
|
25553
25724
|
},
|
|
25554
|
-
mode === "bash" ? /* @__PURE__ */
|
|
25555
|
-
modelInfo && /* @__PURE__ */
|
|
25556
|
-
), /* @__PURE__ */
|
|
25557
|
-
|
|
25725
|
+
mode === "bash" ? /* @__PURE__ */ React97.createElement(Text79, { color: theme.bashBorder }, "Shell PWD: ", currentPwd) : /* @__PURE__ */ React97.createElement(Text79, null, " "),
|
|
25726
|
+
modelInfo && /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, "[", modelInfo.provider, "] ", modelInfo.name, ":", " ", Math.round(modelInfo.currentTokens / 1e3), "k /", " ", Math.round(modelInfo.contextLength / 1e3), "k")
|
|
25727
|
+
), /* @__PURE__ */ React97.createElement(
|
|
25728
|
+
Box74,
|
|
25558
25729
|
{
|
|
25559
25730
|
alignItems: "flex-start",
|
|
25560
25731
|
justifyContent: "flex-start",
|
|
@@ -25568,8 +25739,8 @@ function PromptInput({
|
|
|
25568
25739
|
marginTop: 1,
|
|
25569
25740
|
width: "100%"
|
|
25570
25741
|
},
|
|
25571
|
-
/* @__PURE__ */
|
|
25572
|
-
|
|
25742
|
+
/* @__PURE__ */ React97.createElement(
|
|
25743
|
+
Box74,
|
|
25573
25744
|
{
|
|
25574
25745
|
alignItems: "flex-start",
|
|
25575
25746
|
alignSelf: "flex-start",
|
|
@@ -25577,9 +25748,9 @@ function PromptInput({
|
|
|
25577
25748
|
justifyContent: "flex-start",
|
|
25578
25749
|
width: 3
|
|
25579
25750
|
},
|
|
25580
|
-
mode === "bash" ? /* @__PURE__ */
|
|
25751
|
+
mode === "bash" ? /* @__PURE__ */ React97.createElement(Text79, { color: theme.bashBorder }, "\xA0!\xA0") : mode === "pyb" ? /* @__PURE__ */ React97.createElement(Text79, { color: theme.noting }, "\xA0#\xA0") : /* @__PURE__ */ React97.createElement(Text79, { color: isLoading ? theme.secondaryText : void 0 }, "P>\xA0")
|
|
25581
25752
|
),
|
|
25582
|
-
/* @__PURE__ */
|
|
25753
|
+
/* @__PURE__ */ React97.createElement(Box74, { paddingRight: 1 }, /* @__PURE__ */ React97.createElement(
|
|
25583
25754
|
TextInput,
|
|
25584
25755
|
{
|
|
25585
25756
|
multiline: true,
|
|
@@ -25604,44 +25775,44 @@ function PromptInput({
|
|
|
25604
25775
|
onSpecialKey: handleSpecialKey
|
|
25605
25776
|
}
|
|
25606
25777
|
))
|
|
25607
|
-
), !completionActive && suggestions.length === 0 && /* @__PURE__ */
|
|
25608
|
-
|
|
25778
|
+
), !completionActive && suggestions.length === 0 && /* @__PURE__ */ React97.createElement(Box74, { flexDirection: "column", paddingX: 2, paddingY: 0 }, /* @__PURE__ */ React97.createElement(Box74, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-start", gap: 1 }, exitMessage.show ? /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, "Press ", exitMessage.key, " again to exit") : message.show ? /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, message.text) : rewindMessagePending ? /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, "Press Escape again to undo") : modelSwitchMessage.show ? /* @__PURE__ */ React97.createElement(Text79, { color: theme.success }, modelSwitchMessage.text) : mode === "prompt" && currentMode !== "default" ? /* @__PURE__ */ React97.createElement(CompactModeIndicator, null) : /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(
|
|
25779
|
+
Text79,
|
|
25609
25780
|
{
|
|
25610
25781
|
color: mode === "bash" ? theme.bashBorder : void 0,
|
|
25611
25782
|
dimColor: mode !== "bash"
|
|
25612
25783
|
},
|
|
25613
25784
|
"! run some shell command"
|
|
25614
|
-
), /* @__PURE__ */
|
|
25615
|
-
|
|
25785
|
+
), /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, " \xB7 / for commands"), /* @__PURE__ */ React97.createElement(
|
|
25786
|
+
Text79,
|
|
25616
25787
|
{
|
|
25617
25788
|
color: mode === "pyb" ? theme.noting : void 0,
|
|
25618
25789
|
dimColor: mode !== "pyb"
|
|
25619
25790
|
},
|
|
25620
25791
|
" ",
|
|
25621
25792
|
"\xB7 # tell agent something to remember forever"
|
|
25622
|
-
))), /* @__PURE__ */
|
|
25793
|
+
))), /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-end" }, /* @__PURE__ */ React97.createElement(Text79, { dimColor: true, wrap: "truncate-end" }, statusLine ? `${statusLine} \xB7 ESC to interrupt \xB7 2\xD7ESC for undo` : "ESC to interrupt \xB7 2\xD7ESC for undo"))), !exitMessage.show && !message.show && !modelSwitchMessage.show && !rewindMessagePending && /* @__PURE__ */ React97.createElement(Box74, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-start", gap: 1 }, /* @__PURE__ */ React97.createElement(Text79, { dimColor: true, wrap: "truncate-end" }, "option+enter: newline \xB7", " ", showQuickModelSwitchShortcut ? "option+m: switch model \xB7 " : "", "option+g: external editor \xB7 ", modeCycleShortcut.displayText, ": switch mode")), /* @__PURE__ */ React97.createElement(
|
|
25623
25794
|
SentryErrorBoundary,
|
|
25624
25795
|
{
|
|
25625
|
-
children: /* @__PURE__ */
|
|
25796
|
+
children: /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage }))
|
|
25626
25797
|
}
|
|
25627
|
-
))), suggestions.length > 0 && /* @__PURE__ */
|
|
25628
|
-
|
|
25798
|
+
))), suggestions.length > 0 && /* @__PURE__ */ React97.createElement(
|
|
25799
|
+
Box74,
|
|
25629
25800
|
{
|
|
25630
25801
|
flexDirection: "row",
|
|
25631
25802
|
justifyContent: "space-between",
|
|
25632
25803
|
paddingX: 2,
|
|
25633
25804
|
paddingY: 0
|
|
25634
25805
|
},
|
|
25635
|
-
/* @__PURE__ */
|
|
25636
|
-
|
|
25806
|
+
/* @__PURE__ */ React97.createElement(Box74, { flexDirection: "column" }, renderedSuggestions, /* @__PURE__ */ React97.createElement(
|
|
25807
|
+
Box74,
|
|
25637
25808
|
{
|
|
25638
25809
|
marginTop: 1,
|
|
25639
25810
|
paddingX: 3,
|
|
25640
25811
|
borderStyle: "round",
|
|
25641
25812
|
borderColor: "gray"
|
|
25642
25813
|
},
|
|
25643
|
-
/* @__PURE__ */
|
|
25644
|
-
|
|
25814
|
+
/* @__PURE__ */ React97.createElement(
|
|
25815
|
+
Text79,
|
|
25645
25816
|
{
|
|
25646
25817
|
dimColor: !emptyDirMessage,
|
|
25647
25818
|
color: emptyDirMessage ? "yellow" : void 0
|
|
@@ -25661,10 +25832,10 @@ function PromptInput({
|
|
|
25661
25832
|
})()
|
|
25662
25833
|
)
|
|
25663
25834
|
)),
|
|
25664
|
-
/* @__PURE__ */
|
|
25835
|
+
/* @__PURE__ */ React97.createElement(
|
|
25665
25836
|
SentryErrorBoundary,
|
|
25666
25837
|
{
|
|
25667
|
-
children: /* @__PURE__ */
|
|
25838
|
+
children: /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage: countTokens(messages) }))
|
|
25668
25839
|
}
|
|
25669
25840
|
)
|
|
25670
25841
|
));
|
|
@@ -27020,6 +27191,22 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
27020
27191
|
return;
|
|
27021
27192
|
}
|
|
27022
27193
|
}
|
|
27194
|
+
const queuedMessages = await toolUseContext.options?.dequeueQueuedMessagesForNextTurn?.(
|
|
27195
|
+
assistantMessage.message?.id
|
|
27196
|
+
);
|
|
27197
|
+
if (queuedMessages && queuedMessages.length > 0) {
|
|
27198
|
+
yield assistantMessage;
|
|
27199
|
+
yield* await queryCore(
|
|
27200
|
+
[...messages, assistantMessage, ...queuedMessages],
|
|
27201
|
+
systemPrompt,
|
|
27202
|
+
context,
|
|
27203
|
+
canUseTool,
|
|
27204
|
+
toolUseContext,
|
|
27205
|
+
getBinaryFeedbackResponse,
|
|
27206
|
+
hookState
|
|
27207
|
+
);
|
|
27208
|
+
return;
|
|
27209
|
+
}
|
|
27023
27210
|
yield assistantMessage;
|
|
27024
27211
|
return;
|
|
27025
27212
|
}
|
|
@@ -27048,8 +27235,17 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
27048
27235
|
return;
|
|
27049
27236
|
}
|
|
27050
27237
|
try {
|
|
27238
|
+
const queuedMessages = await toolUseContext.options?.dequeueQueuedMessagesForNextTurn?.(
|
|
27239
|
+
assistantMessage.message?.id
|
|
27240
|
+
);
|
|
27241
|
+
const nextMessages = queuedMessages?.length ? [
|
|
27242
|
+
...messages,
|
|
27243
|
+
assistantMessage,
|
|
27244
|
+
...toolMessagesForNextTurn,
|
|
27245
|
+
...queuedMessages
|
|
27246
|
+
] : [...messages, assistantMessage, ...toolMessagesForNextTurn];
|
|
27051
27247
|
yield* await queryCore(
|
|
27052
|
-
|
|
27248
|
+
nextMessages,
|
|
27053
27249
|
systemPrompt,
|
|
27054
27250
|
context,
|
|
27055
27251
|
canUseTool,
|
|
@@ -27465,18 +27661,99 @@ function createErrorToolResultBlock(args) {
|
|
|
27465
27661
|
};
|
|
27466
27662
|
}
|
|
27467
27663
|
|
|
27664
|
+
// src/utils/queue/queuedInput.ts
|
|
27665
|
+
function applyQueuedEdit(args) {
|
|
27666
|
+
const { entries, replaceId, content, mode, delete: shouldDelete } = args;
|
|
27667
|
+
const index = entries.findIndex((entry) => entry.id === replaceId);
|
|
27668
|
+
if (index === -1) {
|
|
27669
|
+
return entries;
|
|
27670
|
+
}
|
|
27671
|
+
if (shouldDelete) {
|
|
27672
|
+
return entries.filter((entry) => entry.id !== replaceId);
|
|
27673
|
+
}
|
|
27674
|
+
const target = entries[index];
|
|
27675
|
+
const updated = {
|
|
27676
|
+
...target,
|
|
27677
|
+
content: content ?? target.content,
|
|
27678
|
+
mode: mode ?? target.mode
|
|
27679
|
+
};
|
|
27680
|
+
const next = [...entries];
|
|
27681
|
+
next[index] = updated;
|
|
27682
|
+
return next;
|
|
27683
|
+
}
|
|
27684
|
+
function takeQueuedBatch(args) {
|
|
27685
|
+
const { entries, activeTurnId, windowMs } = args;
|
|
27686
|
+
if (entries.length === 0) {
|
|
27687
|
+
return { batch: null, remaining: entries };
|
|
27688
|
+
}
|
|
27689
|
+
const targetId = activeTurnId ?? entries[0].activeTurnId;
|
|
27690
|
+
const matching = entries.filter((entry) => entry.activeTurnId === targetId);
|
|
27691
|
+
if (matching.length === 0) {
|
|
27692
|
+
return { batch: null, remaining: entries };
|
|
27693
|
+
}
|
|
27694
|
+
const sorted = [...matching].sort((a, b) => a.queuedAt - b.queuedAt);
|
|
27695
|
+
const first = sorted[0];
|
|
27696
|
+
const batchEntries = [first];
|
|
27697
|
+
let lastQueuedAt = first.queuedAt;
|
|
27698
|
+
for (let i = 1; i < sorted.length; i += 1) {
|
|
27699
|
+
const next = sorted[i];
|
|
27700
|
+
if (next.mode !== first.mode) {
|
|
27701
|
+
break;
|
|
27702
|
+
}
|
|
27703
|
+
if (next.queuedAt - lastQueuedAt > windowMs) {
|
|
27704
|
+
break;
|
|
27705
|
+
}
|
|
27706
|
+
batchEntries.push(next);
|
|
27707
|
+
lastQueuedAt = next.queuedAt;
|
|
27708
|
+
}
|
|
27709
|
+
const batchIds = new Set(batchEntries.map((entry) => entry.id));
|
|
27710
|
+
const remaining = entries.filter((entry) => !batchIds.has(entry.id));
|
|
27711
|
+
return {
|
|
27712
|
+
batch: {
|
|
27713
|
+
entries: batchEntries,
|
|
27714
|
+
activeTurnId: first.activeTurnId,
|
|
27715
|
+
mode: first.mode,
|
|
27716
|
+
queuedAt: first.queuedAt
|
|
27717
|
+
},
|
|
27718
|
+
remaining
|
|
27719
|
+
};
|
|
27720
|
+
}
|
|
27721
|
+
function buildQueuedWrapper(args) {
|
|
27722
|
+
const turn = args.activeTurnId ?? "unknown";
|
|
27723
|
+
const prefix = [
|
|
27724
|
+
"<system-reminder>",
|
|
27725
|
+
"\u7528\u6237\u521A\u8FFD\u52A0\u4E86\u4E00\u6761\u4EFB\u52A1\u6307\u4EE4\uFF0C\u53D1\u751F\u5728\u6A21\u578B\u8F93\u51FA\u671F\u95F4",
|
|
27726
|
+
"</system-reminder>",
|
|
27727
|
+
"<queued-user-message>",
|
|
27728
|
+
`<queued-at>${args.queuedAt}</queued-at>`,
|
|
27729
|
+
"<queued-during>assistant_response</queued-during>",
|
|
27730
|
+
`<queued-after-turn>${turn}</queued-after-turn>`
|
|
27731
|
+
].join("\n");
|
|
27732
|
+
const suffix = "</queued-user-message>";
|
|
27733
|
+
return { prefix, suffix };
|
|
27734
|
+
}
|
|
27735
|
+
function wrapQueuedContent(args) {
|
|
27736
|
+
const { prefix, suffix } = buildQueuedWrapper({
|
|
27737
|
+
queuedAt: args.queuedAt,
|
|
27738
|
+
activeTurnId: args.activeTurnId
|
|
27739
|
+
});
|
|
27740
|
+
return `${prefix}
|
|
27741
|
+
${args.content}
|
|
27742
|
+
${suffix}`;
|
|
27743
|
+
}
|
|
27744
|
+
|
|
27468
27745
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
27469
|
-
import { default as
|
|
27746
|
+
import { default as React101, useCallback as useCallback15 } from "react";
|
|
27470
27747
|
|
|
27471
27748
|
// src/ui/components/binary-feedback/BinaryFeedbackView.tsx
|
|
27472
27749
|
import chalk14 from "chalk";
|
|
27473
|
-
import { Box as
|
|
27750
|
+
import { Box as Box76, Text as Text80, useInput as useInput29 } from "ink";
|
|
27474
27751
|
import Link2 from "ink-link";
|
|
27475
|
-
import
|
|
27752
|
+
import React100, { useState as useState27 } from "react";
|
|
27476
27753
|
|
|
27477
27754
|
// src/ui/components/binary-feedback/BinaryFeedbackOption.tsx
|
|
27478
|
-
import * as
|
|
27479
|
-
import { Box as
|
|
27755
|
+
import * as React99 from "react";
|
|
27756
|
+
import { Box as Box75 } from "ink";
|
|
27480
27757
|
function BinaryFeedbackOption({
|
|
27481
27758
|
debug: debug2,
|
|
27482
27759
|
erroredToolUseIDs,
|
|
@@ -27488,7 +27765,7 @@ function BinaryFeedbackOption({
|
|
|
27488
27765
|
verbose
|
|
27489
27766
|
}) {
|
|
27490
27767
|
const { columns } = useTerminalSize();
|
|
27491
|
-
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */
|
|
27768
|
+
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */ React99.createElement(Box75, { flexDirection: "column", key: index }, /* @__PURE__ */ React99.createElement(
|
|
27492
27769
|
Message,
|
|
27493
27770
|
{
|
|
27494
27771
|
addMargin: false,
|
|
@@ -27504,7 +27781,7 @@ function BinaryFeedbackOption({
|
|
|
27504
27781
|
verbose,
|
|
27505
27782
|
width: columns / 2 - 6
|
|
27506
27783
|
}
|
|
27507
|
-
), /* @__PURE__ */
|
|
27784
|
+
), /* @__PURE__ */ React99.createElement(AdditionalContext, { message: _, verbose })));
|
|
27508
27785
|
}
|
|
27509
27786
|
function AdditionalContext({
|
|
27510
27787
|
message,
|
|
@@ -27536,7 +27813,7 @@ function AdditionalContext({
|
|
|
27536
27813
|
} catch {
|
|
27537
27814
|
return null;
|
|
27538
27815
|
}
|
|
27539
|
-
return /* @__PURE__ */
|
|
27816
|
+
return /* @__PURE__ */ React99.createElement(
|
|
27540
27817
|
FileEditToolDiff,
|
|
27541
27818
|
{
|
|
27542
27819
|
file_path: input.data.file_path,
|
|
@@ -27552,7 +27829,7 @@ function AdditionalContext({
|
|
|
27552
27829
|
if (!input.success) {
|
|
27553
27830
|
return null;
|
|
27554
27831
|
}
|
|
27555
|
-
return /* @__PURE__ */
|
|
27832
|
+
return /* @__PURE__ */ React99.createElement(
|
|
27556
27833
|
FileWriteToolDiff,
|
|
27557
27834
|
{
|
|
27558
27835
|
file_path: input.data.file_path,
|
|
@@ -27617,8 +27894,8 @@ function BinaryFeedbackView({
|
|
|
27617
27894
|
onChoose?.("neither");
|
|
27618
27895
|
}
|
|
27619
27896
|
});
|
|
27620
|
-
return /* @__PURE__ */
|
|
27621
|
-
|
|
27897
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(
|
|
27898
|
+
Box76,
|
|
27622
27899
|
{
|
|
27623
27900
|
flexDirection: "column",
|
|
27624
27901
|
height: "100%",
|
|
@@ -27626,9 +27903,9 @@ function BinaryFeedbackView({
|
|
|
27626
27903
|
borderStyle: "round",
|
|
27627
27904
|
borderColor: theme.permission
|
|
27628
27905
|
},
|
|
27629
|
-
/* @__PURE__ */
|
|
27630
|
-
/* @__PURE__ */
|
|
27631
|
-
|
|
27906
|
+
/* @__PURE__ */ React100.createElement(Box76, { width: "100%", justifyContent: "space-between", paddingX: 1 }, /* @__PURE__ */ React100.createElement(Text80, { bold: true, color: theme.permission }, "[ANT-ONLY] Help train ", PRODUCT_NAME), /* @__PURE__ */ React100.createElement(Text80, null, /* @__PURE__ */ React100.createElement(Link2, { url: HELP_URL }, "[?]"))),
|
|
27907
|
+
/* @__PURE__ */ React100.createElement(Box76, { flexDirection: "row", width: "100%", flexGrow: 1, paddingTop: 1 }, /* @__PURE__ */ React100.createElement(
|
|
27908
|
+
Box76,
|
|
27632
27909
|
{
|
|
27633
27910
|
flexDirection: "column",
|
|
27634
27911
|
flexGrow: 1,
|
|
@@ -27639,7 +27916,7 @@ function BinaryFeedbackView({
|
|
|
27639
27916
|
marginRight: 1,
|
|
27640
27917
|
padding: 1
|
|
27641
27918
|
},
|
|
27642
|
-
/* @__PURE__ */
|
|
27919
|
+
/* @__PURE__ */ React100.createElement(
|
|
27643
27920
|
BinaryFeedbackOption,
|
|
27644
27921
|
{
|
|
27645
27922
|
erroredToolUseIDs,
|
|
@@ -27652,8 +27929,8 @@ function BinaryFeedbackView({
|
|
|
27652
27929
|
verbose
|
|
27653
27930
|
}
|
|
27654
27931
|
)
|
|
27655
|
-
), /* @__PURE__ */
|
|
27656
|
-
|
|
27932
|
+
), /* @__PURE__ */ React100.createElement(
|
|
27933
|
+
Box76,
|
|
27657
27934
|
{
|
|
27658
27935
|
flexDirection: "column",
|
|
27659
27936
|
flexGrow: 1,
|
|
@@ -27664,7 +27941,7 @@ function BinaryFeedbackView({
|
|
|
27664
27941
|
marginLeft: 1,
|
|
27665
27942
|
padding: 1
|
|
27666
27943
|
},
|
|
27667
|
-
/* @__PURE__ */
|
|
27944
|
+
/* @__PURE__ */ React100.createElement(
|
|
27668
27945
|
BinaryFeedbackOption,
|
|
27669
27946
|
{
|
|
27670
27947
|
erroredToolUseIDs,
|
|
@@ -27678,7 +27955,7 @@ function BinaryFeedbackView({
|
|
|
27678
27955
|
}
|
|
27679
27956
|
)
|
|
27680
27957
|
)),
|
|
27681
|
-
/* @__PURE__ */
|
|
27958
|
+
/* @__PURE__ */ React100.createElement(Box76, { flexDirection: "column", paddingTop: 1, paddingX: 1 }, /* @__PURE__ */ React100.createElement(Text80, null, "How do you want to proceed?"), /* @__PURE__ */ React100.createElement(
|
|
27682
27959
|
Select,
|
|
27683
27960
|
{
|
|
27684
27961
|
options: getOptions2(),
|
|
@@ -27687,7 +27964,7 @@ function BinaryFeedbackView({
|
|
|
27687
27964
|
onChange: onChoose
|
|
27688
27965
|
}
|
|
27689
27966
|
))
|
|
27690
|
-
), exitState.pending ? /* @__PURE__ */
|
|
27967
|
+
), exitState.pending ? /* @__PURE__ */ React100.createElement(Box76, { marginLeft: 3 }, /* @__PURE__ */ React100.createElement(Text80, { dimColor: true }, "Press ", exitState.keyName, " again to exit")) : /* @__PURE__ */ React100.createElement(Text80, null, " "));
|
|
27691
27968
|
}
|
|
27692
27969
|
|
|
27693
27970
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
@@ -27713,7 +27990,7 @@ function BinaryFeedback({
|
|
|
27713
27990
|
useNotifyAfterTimeout(
|
|
27714
27991
|
`${PRODUCT_NAME} needs your input on a response comparison`
|
|
27715
27992
|
);
|
|
27716
|
-
return /* @__PURE__ */
|
|
27993
|
+
return /* @__PURE__ */ React101.createElement(
|
|
27717
27994
|
BinaryFeedbackView,
|
|
27718
27995
|
{
|
|
27719
27996
|
debug: debug2,
|
|
@@ -27784,6 +28061,7 @@ async function getReasoningEffort(modelProfile, messages) {
|
|
|
27784
28061
|
}
|
|
27785
28062
|
|
|
27786
28063
|
// src/ui/screens/REPL.tsx
|
|
28064
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
27787
28065
|
function REPL({
|
|
27788
28066
|
commands,
|
|
27789
28067
|
safeMode,
|
|
@@ -27821,6 +28099,8 @@ function REPL({
|
|
|
27821
28099
|
null
|
|
27822
28100
|
);
|
|
27823
28101
|
const [messages, setMessages2] = useState28(initialMessages ?? []);
|
|
28102
|
+
const [queuedMessages, setQueuedMessages] = useState28([]);
|
|
28103
|
+
const queuedMessagesRef = useRef13([]);
|
|
27824
28104
|
const [inputValue, setInputValue] = useState28("");
|
|
27825
28105
|
const [inputMode, setInputMode] = useState28(
|
|
27826
28106
|
"prompt"
|
|
@@ -27847,6 +28127,113 @@ function REPL({
|
|
|
27847
28127
|
[]
|
|
27848
28128
|
);
|
|
27849
28129
|
const readFileTimestamps = useRef13({});
|
|
28130
|
+
const queueMergeWindowMs = getGlobalConfig().queueMergeWindowMs ?? 500;
|
|
28131
|
+
const updateQueuedMessages = useCallback16(
|
|
28132
|
+
(next) => {
|
|
28133
|
+
queuedMessagesRef.current = next;
|
|
28134
|
+
setQueuedMessages(next);
|
|
28135
|
+
},
|
|
28136
|
+
[]
|
|
28137
|
+
);
|
|
28138
|
+
const enqueueQueuedMessage = useCallback16(
|
|
28139
|
+
(args) => {
|
|
28140
|
+
if (args.replaceId) {
|
|
28141
|
+
const next = applyQueuedEdit({
|
|
28142
|
+
entries: queuedMessagesRef.current,
|
|
28143
|
+
replaceId: args.replaceId,
|
|
28144
|
+
content: args.content,
|
|
28145
|
+
mode: args.mode,
|
|
28146
|
+
delete: args.delete
|
|
28147
|
+
});
|
|
28148
|
+
updateQueuedMessages(next);
|
|
28149
|
+
return;
|
|
28150
|
+
}
|
|
28151
|
+
const entry = {
|
|
28152
|
+
id: randomUUID5(),
|
|
28153
|
+
content: args.content,
|
|
28154
|
+
queuedAt: Date.now(),
|
|
28155
|
+
activeTurnId: getLastAssistantMessageId(messages),
|
|
28156
|
+
mode: args.mode
|
|
28157
|
+
};
|
|
28158
|
+
updateQueuedMessages([...queuedMessagesRef.current, entry]);
|
|
28159
|
+
},
|
|
28160
|
+
[messages, updateQueuedMessages]
|
|
28161
|
+
);
|
|
28162
|
+
const dequeueQueuedMessageForEdit = useCallback16(
|
|
28163
|
+
(currentEditId) => {
|
|
28164
|
+
const current = queuedMessagesRef.current;
|
|
28165
|
+
if (current.length === 0) return null;
|
|
28166
|
+
if (!currentEditId) {
|
|
28167
|
+
const last2 = current[current.length - 1];
|
|
28168
|
+
return { id: last2.id, content: last2.content, mode: last2.mode };
|
|
28169
|
+
}
|
|
28170
|
+
const index = current.findIndex((entry) => entry.id === currentEditId);
|
|
28171
|
+
if (index > 0) {
|
|
28172
|
+
const prev = current[index - 1];
|
|
28173
|
+
return { id: prev.id, content: prev.content, mode: prev.mode };
|
|
28174
|
+
}
|
|
28175
|
+
const fallback = current[current.length - 1];
|
|
28176
|
+
return fallback ? { id: fallback.id, content: fallback.content, mode: fallback.mode } : null;
|
|
28177
|
+
},
|
|
28178
|
+
[]
|
|
28179
|
+
);
|
|
28180
|
+
const dequeueQueuedMessagesForNextTurn = useCallback16(
|
|
28181
|
+
async (activeTurnId) => {
|
|
28182
|
+
const { batch, remaining } = takeQueuedBatch({
|
|
28183
|
+
entries: queuedMessagesRef.current,
|
|
28184
|
+
activeTurnId,
|
|
28185
|
+
windowMs: queueMergeWindowMs
|
|
28186
|
+
});
|
|
28187
|
+
if (!batch) return null;
|
|
28188
|
+
updateQueuedMessages(remaining);
|
|
28189
|
+
const combinedContent = batch.entries.length === 1 ? batch.entries[0].content : batch.entries.map((entry, index) => `${index + 1}) ${entry.content}`).join("\n");
|
|
28190
|
+
const wrappedContent = batch.mode === "bash" ? combinedContent : wrapQueuedContent({
|
|
28191
|
+
content: combinedContent,
|
|
28192
|
+
queuedAt: new Date(batch.queuedAt).toISOString(),
|
|
28193
|
+
activeTurnId: batch.activeTurnId
|
|
28194
|
+
});
|
|
28195
|
+
const generatedMessages = await processUserInput(
|
|
28196
|
+
wrappedContent,
|
|
28197
|
+
batch.mode,
|
|
28198
|
+
setToolJSX,
|
|
28199
|
+
{
|
|
28200
|
+
options: {
|
|
28201
|
+
commands,
|
|
28202
|
+
forkNumber,
|
|
28203
|
+
messageLogName,
|
|
28204
|
+
tools,
|
|
28205
|
+
verbose,
|
|
28206
|
+
maxThinkingTokens: 0,
|
|
28207
|
+
safeMode,
|
|
28208
|
+
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
28209
|
+
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
28210
|
+
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
28211
|
+
})
|
|
28212
|
+
},
|
|
28213
|
+
messageId: batch.activeTurnId,
|
|
28214
|
+
setForkConvoWithMessagesOnTheNextRender,
|
|
28215
|
+
readFileTimestamps: readFileTimestamps.current,
|
|
28216
|
+
abortController: abortController || new AbortController()
|
|
28217
|
+
},
|
|
28218
|
+
null
|
|
28219
|
+
);
|
|
28220
|
+
return generatedMessages;
|
|
28221
|
+
},
|
|
28222
|
+
[
|
|
28223
|
+
commands,
|
|
28224
|
+
forkNumber,
|
|
28225
|
+
messageLogName,
|
|
28226
|
+
tools,
|
|
28227
|
+
verbose,
|
|
28228
|
+
safeMode,
|
|
28229
|
+
setToolJSX,
|
|
28230
|
+
setForkConvoWithMessagesOnTheNextRender,
|
|
28231
|
+
messages,
|
|
28232
|
+
abortController,
|
|
28233
|
+
queueMergeWindowMs,
|
|
28234
|
+
updateQueuedMessages
|
|
28235
|
+
]
|
|
28236
|
+
);
|
|
27850
28237
|
const { status: apiKeyStatus, reverify } = useApiKeyVerification();
|
|
27851
28238
|
function onCancel() {
|
|
27852
28239
|
if (!isLoading) {
|
|
@@ -27964,6 +28351,7 @@ function REPL({
|
|
|
27964
28351
|
verbose,
|
|
27965
28352
|
safeMode,
|
|
27966
28353
|
maxThinkingTokens,
|
|
28354
|
+
dequeueQueuedMessagesForNextTurn,
|
|
27967
28355
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
27968
28356
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
27969
28357
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -28028,6 +28416,7 @@ function REPL({
|
|
|
28028
28416
|
safeMode,
|
|
28029
28417
|
maxThinkingTokens,
|
|
28030
28418
|
isPybRequest: isPybRequest || void 0,
|
|
28419
|
+
dequeueQueuedMessagesForNextTurn,
|
|
28031
28420
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
28032
28421
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
28033
28422
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -28116,7 +28505,7 @@ function REPL({
|
|
|
28116
28505
|
const messagesJSX = useMemo26(() => {
|
|
28117
28506
|
return orderedMessages.map((_, index) => {
|
|
28118
28507
|
const toolUseID = getToolUseID(_);
|
|
28119
|
-
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */
|
|
28508
|
+
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */ React102.createElement(
|
|
28120
28509
|
Message,
|
|
28121
28510
|
{
|
|
28122
28511
|
message: _.content,
|
|
@@ -28131,10 +28520,10 @@ function REPL({
|
|
|
28131
28520
|
shouldAnimate: false,
|
|
28132
28521
|
shouldShowDot: false
|
|
28133
28522
|
}
|
|
28134
|
-
) : /* @__PURE__ */
|
|
28523
|
+
) : /* @__PURE__ */ React102.createElement(
|
|
28135
28524
|
MessageResponse,
|
|
28136
28525
|
{
|
|
28137
|
-
children: /* @__PURE__ */
|
|
28526
|
+
children: /* @__PURE__ */ React102.createElement(
|
|
28138
28527
|
Message,
|
|
28139
28528
|
{
|
|
28140
28529
|
message: _.content,
|
|
@@ -28153,7 +28542,7 @@ function REPL({
|
|
|
28153
28542
|
}
|
|
28154
28543
|
)
|
|
28155
28544
|
}
|
|
28156
|
-
) : /* @__PURE__ */
|
|
28545
|
+
) : /* @__PURE__ */ React102.createElement(
|
|
28157
28546
|
Message,
|
|
28158
28547
|
{
|
|
28159
28548
|
message: _,
|
|
@@ -28172,8 +28561,8 @@ function REPL({
|
|
|
28172
28561
|
const isInStaticPrefix = index < replStaticPrefixLength;
|
|
28173
28562
|
if (debug2) {
|
|
28174
28563
|
return {
|
|
28175
|
-
jsx: /* @__PURE__ */
|
|
28176
|
-
|
|
28564
|
+
jsx: /* @__PURE__ */ React102.createElement(
|
|
28565
|
+
Box77,
|
|
28177
28566
|
{
|
|
28178
28567
|
borderStyle: "single",
|
|
28179
28568
|
borderColor: isInStaticPrefix ? "green" : "red",
|
|
@@ -28185,7 +28574,7 @@ function REPL({
|
|
|
28185
28574
|
};
|
|
28186
28575
|
}
|
|
28187
28576
|
return {
|
|
28188
|
-
jsx: /* @__PURE__ */
|
|
28577
|
+
jsx: /* @__PURE__ */ React102.createElement(Box77, { key: _.uuid, width: "100%" }, message)
|
|
28189
28578
|
};
|
|
28190
28579
|
});
|
|
28191
28580
|
}, [
|
|
@@ -28208,7 +28597,7 @@ function REPL({
|
|
|
28208
28597
|
const staticItems = useMemo26(
|
|
28209
28598
|
() => [
|
|
28210
28599
|
{
|
|
28211
|
-
jsx: /* @__PURE__ */
|
|
28600
|
+
jsx: /* @__PURE__ */ React102.createElement(Box77, { flexDirection: "column", key: `logo${forkNumber}` }, /* @__PURE__ */ React102.createElement(
|
|
28212
28601
|
Logo,
|
|
28213
28602
|
{
|
|
28214
28603
|
mcpClients,
|
|
@@ -28216,7 +28605,7 @@ function REPL({
|
|
|
28216
28605
|
updateBannerVersion: updateAvailableVersion,
|
|
28217
28606
|
updateBannerCommands: updateCommands
|
|
28218
28607
|
}
|
|
28219
|
-
), /* @__PURE__ */
|
|
28608
|
+
), /* @__PURE__ */ React102.createElement(ProjectOnboarding, { workspaceDir: getOriginalCwd() }))
|
|
28220
28609
|
},
|
|
28221
28610
|
...messagesJSX.slice(0, replStaticPrefixLength)
|
|
28222
28611
|
],
|
|
@@ -28236,23 +28625,24 @@ function REPL({
|
|
|
28236
28625
|
);
|
|
28237
28626
|
const showingCostDialog = !isLoading && showCostDialog;
|
|
28238
28627
|
const conversationKey = `${messageLogName}:${forkNumber}`;
|
|
28239
|
-
|
|
28628
|
+
const hasQueuedMessages = queuedMessages.length > 0;
|
|
28629
|
+
return /* @__PURE__ */ React102.createElement(
|
|
28240
28630
|
PermissionProvider,
|
|
28241
28631
|
{
|
|
28242
28632
|
conversationKey,
|
|
28243
28633
|
isBypassPermissionsModeAvailable: !safeMode
|
|
28244
28634
|
},
|
|
28245
|
-
/* @__PURE__ */
|
|
28246
|
-
|
|
28635
|
+
/* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(React102.Fragment, { key: `static-messages-${forkNumber}` }, /* @__PURE__ */ React102.createElement(Static2, { items: staticItems, children: (item) => item.jsx })), /* @__PURE__ */ React102.createElement(TaskPanel, null), transientItems.map((_) => _.jsx), /* @__PURE__ */ React102.createElement(
|
|
28636
|
+
Box77,
|
|
28247
28637
|
{
|
|
28248
28638
|
borderColor: "red",
|
|
28249
28639
|
borderStyle: debug2 ? "single" : void 0,
|
|
28250
28640
|
flexDirection: "column",
|
|
28251
28641
|
width: "100%"
|
|
28252
28642
|
},
|
|
28253
|
-
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */
|
|
28643
|
+
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */ React102.createElement(RequestStatusIndicator, null),
|
|
28254
28644
|
toolJSX ? toolJSX.jsx : null,
|
|
28255
|
-
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */
|
|
28645
|
+
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */ React102.createElement(
|
|
28256
28646
|
BinaryFeedback,
|
|
28257
28647
|
{
|
|
28258
28648
|
m1: binaryFeedbackContext.m1,
|
|
@@ -28270,7 +28660,7 @@ function REPL({
|
|
|
28270
28660
|
unresolvedToolUseIDs
|
|
28271
28661
|
}
|
|
28272
28662
|
),
|
|
28273
|
-
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */
|
|
28663
|
+
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */ React102.createElement(
|
|
28274
28664
|
PermissionRequest,
|
|
28275
28665
|
{
|
|
28276
28666
|
toolUseConfirm,
|
|
@@ -28278,7 +28668,7 @@ function REPL({
|
|
|
28278
28668
|
verbose
|
|
28279
28669
|
}
|
|
28280
28670
|
),
|
|
28281
|
-
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */
|
|
28671
|
+
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */ React102.createElement(
|
|
28282
28672
|
CostThresholdDialog,
|
|
28283
28673
|
{
|
|
28284
28674
|
onDone: () => {
|
|
@@ -28292,7 +28682,17 @@ function REPL({
|
|
|
28292
28682
|
}
|
|
28293
28683
|
}
|
|
28294
28684
|
),
|
|
28295
|
-
|
|
28685
|
+
/* @__PURE__ */ React102.createElement(
|
|
28686
|
+
QueuedMessageList,
|
|
28687
|
+
{
|
|
28688
|
+
items: queuedMessages.map((item) => ({
|
|
28689
|
+
id: item.id,
|
|
28690
|
+
content: item.content
|
|
28691
|
+
}))
|
|
28692
|
+
}
|
|
28693
|
+
),
|
|
28694
|
+
/* @__PURE__ */ React102.createElement(QueuedHintLine, { show: hasQueuedMessages && isLoading }),
|
|
28695
|
+
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(
|
|
28296
28696
|
PromptInput_default,
|
|
28297
28697
|
{
|
|
28298
28698
|
commands,
|
|
@@ -28319,10 +28719,13 @@ function REPL({
|
|
|
28319
28719
|
onShowMessageSelector: () => setIsMessageSelectorVisible((prev) => !prev),
|
|
28320
28720
|
setForkConvoWithMessagesOnTheNextRender,
|
|
28321
28721
|
readFileTimestamps: readFileTimestamps.current,
|
|
28322
|
-
abortController
|
|
28722
|
+
abortController,
|
|
28723
|
+
onQueueMessage: enqueueQueuedMessage,
|
|
28724
|
+
onQueueEditRequest: dequeueQueuedMessageForEdit,
|
|
28725
|
+
hasQueuedMessages
|
|
28323
28726
|
}
|
|
28324
28727
|
))
|
|
28325
|
-
), isMessageSelectorVisible && /* @__PURE__ */
|
|
28728
|
+
), isMessageSelectorVisible && /* @__PURE__ */ React102.createElement(
|
|
28326
28729
|
MessageSelector,
|
|
28327
28730
|
{
|
|
28328
28731
|
erroredToolUseIDs,
|
|
@@ -28348,13 +28751,13 @@ function REPL({
|
|
|
28348
28751
|
onEscape: () => setIsMessageSelectorVisible(false),
|
|
28349
28752
|
tools
|
|
28350
28753
|
}
|
|
28351
|
-
), /* @__PURE__ */
|
|
28754
|
+
), /* @__PURE__ */ React102.createElement(Newline4, null))
|
|
28352
28755
|
);
|
|
28353
28756
|
}
|
|
28354
28757
|
|
|
28355
28758
|
// src/ui/components/SessionSelector.tsx
|
|
28356
|
-
import
|
|
28357
|
-
import { Box as
|
|
28759
|
+
import React103 from "react";
|
|
28760
|
+
import { Box as Box78, Text as Text82 } from "ink";
|
|
28358
28761
|
function SessionSelector({
|
|
28359
28762
|
sessions,
|
|
28360
28763
|
onSelect
|
|
@@ -28382,18 +28785,18 @@ function SessionSelector({
|
|
|
28382
28785
|
const truncated = labelTxt.length > columns - 2 ? `${labelTxt.slice(0, columns - 5)}...` : labelTxt;
|
|
28383
28786
|
return { label: truncated, value: String(i) };
|
|
28384
28787
|
});
|
|
28385
|
-
return /* @__PURE__ */
|
|
28788
|
+
return /* @__PURE__ */ React103.createElement(Box78, { flexDirection: "column", height: "100%", width: "100%" }, /* @__PURE__ */ React103.createElement(Box78, { paddingLeft: 9 }, /* @__PURE__ */ React103.createElement(Text82, { bold: true, color: getTheme().text }, "Modified"), /* @__PURE__ */ React103.createElement(Text82, null, " "), /* @__PURE__ */ React103.createElement(Text82, { bold: true, color: getTheme().text }, "Created"), /* @__PURE__ */ React103.createElement(Text82, null, " "), /* @__PURE__ */ React103.createElement(Text82, { bold: true, color: getTheme().text }, "Tag"), /* @__PURE__ */ React103.createElement(Text82, null, " "), /* @__PURE__ */ React103.createElement(Text82, { bold: true, color: getTheme().text }, "Session")), /* @__PURE__ */ React103.createElement(
|
|
28386
28789
|
Select,
|
|
28387
28790
|
{
|
|
28388
28791
|
options,
|
|
28389
28792
|
onChange: (value) => onSelect(parseInt(value, 10)),
|
|
28390
28793
|
visibleOptionCount: visibleCount
|
|
28391
28794
|
}
|
|
28392
|
-
), hiddenCount > 0 && /* @__PURE__ */
|
|
28795
|
+
), hiddenCount > 0 && /* @__PURE__ */ React103.createElement(Box78, { paddingLeft: 2 }, /* @__PURE__ */ React103.createElement(Text82, { color: getTheme().secondaryText }, "and ", hiddenCount, " more\u2026")));
|
|
28393
28796
|
}
|
|
28394
28797
|
|
|
28395
28798
|
// src/ui/screens/ResumeConversation.tsx
|
|
28396
|
-
import { randomUUID as
|
|
28799
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
28397
28800
|
function ResumeConversation({
|
|
28398
28801
|
cwd,
|
|
28399
28802
|
context,
|
|
@@ -28417,7 +28820,7 @@ function ResumeConversation({
|
|
|
28417
28820
|
if (!selected) return;
|
|
28418
28821
|
context.unmount?.();
|
|
28419
28822
|
const resumedFromSessionId = selected.sessionId;
|
|
28420
|
-
const effectiveSessionId = forkSession ? forkSessionId?.trim() ||
|
|
28823
|
+
const effectiveSessionId = forkSession ? forkSessionId?.trim() || randomUUID6() : resumedFromSessionId;
|
|
28421
28824
|
setPybAgentSessionId(effectiveSessionId);
|
|
28422
28825
|
const messages = loadPybAgentSessionMessages({
|
|
28423
28826
|
cwd,
|
|
@@ -28425,7 +28828,7 @@ function ResumeConversation({
|
|
|
28425
28828
|
});
|
|
28426
28829
|
const isDefaultModel = await isDefaultSlowAndCapableModel();
|
|
28427
28830
|
render(
|
|
28428
|
-
/* @__PURE__ */
|
|
28831
|
+
/* @__PURE__ */ React104.createElement(
|
|
28429
28832
|
REPL,
|
|
28430
28833
|
{
|
|
28431
28834
|
commands,
|
|
@@ -28453,7 +28856,7 @@ function ResumeConversation({
|
|
|
28453
28856
|
throw e;
|
|
28454
28857
|
}
|
|
28455
28858
|
}
|
|
28456
|
-
return /* @__PURE__ */
|
|
28859
|
+
return /* @__PURE__ */ React104.createElement(SessionSelector, { sessions, onSelect });
|
|
28457
28860
|
}
|
|
28458
28861
|
|
|
28459
28862
|
// src/commands/resume.tsx
|
|
@@ -28476,7 +28879,7 @@ var resume_default = {
|
|
|
28476
28879
|
return null;
|
|
28477
28880
|
}
|
|
28478
28881
|
render2(
|
|
28479
|
-
/* @__PURE__ */
|
|
28882
|
+
/* @__PURE__ */ React105.createElement(
|
|
28480
28883
|
ResumeConversation,
|
|
28481
28884
|
{
|
|
28482
28885
|
cwd,
|
|
@@ -28493,11 +28896,11 @@ var resume_default = {
|
|
|
28493
28896
|
};
|
|
28494
28897
|
|
|
28495
28898
|
// src/commands/agents.tsx
|
|
28496
|
-
import
|
|
28899
|
+
import React107 from "react";
|
|
28497
28900
|
|
|
28498
28901
|
// src/commands/agents/ui.tsx
|
|
28499
|
-
import
|
|
28500
|
-
import { Box as
|
|
28902
|
+
import React106, { useCallback as useCallback17, useEffect as useEffect27, useMemo as useMemo27, useRef as useRef14, useState as useState29 } from "react";
|
|
28903
|
+
import { Box as Box79, Text as Text83, useInput as useInput30 } from "ink";
|
|
28501
28904
|
import figures9 from "figures";
|
|
28502
28905
|
import chalk15 from "chalk";
|
|
28503
28906
|
import { join as join13 } from "path";
|
|
@@ -28565,9 +28968,9 @@ import { join as join12 } from "path";
|
|
|
28565
28968
|
import { homedir as homedir8 } from "os";
|
|
28566
28969
|
|
|
28567
28970
|
// src/commands/agents/generation.ts
|
|
28568
|
-
import { randomUUID as
|
|
28971
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
28569
28972
|
async function generateAgentWithClaude(prompt) {
|
|
28570
|
-
const { queryModel } = await import("./llm-
|
|
28973
|
+
const { queryModel } = await import("./llm-B56E7A3E.js");
|
|
28571
28974
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
28572
28975
|
|
|
28573
28976
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -28580,7 +28983,7 @@ Make the agent highly specialized and effective for the described use case.`;
|
|
|
28580
28983
|
const messages = [
|
|
28581
28984
|
{
|
|
28582
28985
|
type: "user",
|
|
28583
|
-
uuid:
|
|
28986
|
+
uuid: randomUUID7(),
|
|
28584
28987
|
message: { role: "user", content: prompt }
|
|
28585
28988
|
}
|
|
28586
28989
|
];
|
|
@@ -28949,21 +29352,21 @@ function panelBorderColor(kind) {
|
|
|
28949
29352
|
}
|
|
28950
29353
|
function Panel(props) {
|
|
28951
29354
|
const theme = getTheme();
|
|
28952
|
-
return /* @__PURE__ */
|
|
28953
|
-
|
|
29355
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29356
|
+
Box79,
|
|
28954
29357
|
{
|
|
28955
29358
|
borderStyle: "round",
|
|
28956
29359
|
borderColor: props.borderColor ?? theme.suggestion,
|
|
28957
29360
|
flexDirection: "column"
|
|
28958
29361
|
},
|
|
28959
|
-
/* @__PURE__ */
|
|
28960
|
-
/* @__PURE__ */
|
|
29362
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React106.createElement(Text83, { bold: true, color: props.titleColor ?? theme.text }, props.title), props.subtitle ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, props.subtitle) : null),
|
|
29363
|
+
/* @__PURE__ */ React106.createElement(Box79, { paddingX: 1, flexDirection: "column" }, props.children)
|
|
28961
29364
|
);
|
|
28962
29365
|
}
|
|
28963
29366
|
function Instructions({
|
|
28964
29367
|
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
28965
29368
|
}) {
|
|
28966
|
-
return /* @__PURE__ */
|
|
29369
|
+
return /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 3 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, instructions));
|
|
28967
29370
|
}
|
|
28968
29371
|
function computeOverrides(args) {
|
|
28969
29372
|
const activeByType = /* @__PURE__ */ new Map();
|
|
@@ -29042,38 +29445,38 @@ function AgentsListView(props) {
|
|
|
29042
29445
|
setSelectedAgent(nextAgent);
|
|
29043
29446
|
}
|
|
29044
29447
|
});
|
|
29045
|
-
const renderCreateNew = () => /* @__PURE__ */
|
|
29448
|
+
const renderCreateNew = () => /* @__PURE__ */ React106.createElement(Box79, null, /* @__PURE__ */ React106.createElement(Text83, { color: onCreateOption ? theme.suggestion : void 0 }, onCreateOption ? `${figures9.pointer} ` : " "), /* @__PURE__ */ React106.createElement(Text83, { color: onCreateOption ? theme.suggestion : void 0 }, "Create new agent"));
|
|
29046
29449
|
const renderAgentRow = (agent) => {
|
|
29047
29450
|
const isBuiltIn = agent.source === "built-in";
|
|
29048
29451
|
const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.source === agent.source;
|
|
29049
29452
|
const dimmed = Boolean(isBuiltIn || agent.overriddenBy);
|
|
29050
29453
|
const rowColor = isSelected ? theme.suggestion : void 0;
|
|
29051
29454
|
const pointer = isBuiltIn ? "" : isSelected ? `${figures9.pointer} ` : " ";
|
|
29052
|
-
return /* @__PURE__ */
|
|
29455
|
+
return /* @__PURE__ */ React106.createElement(Box79, { key: `${agent.agentType}-${agent.source}`, flexDirection: "row" }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: dimmed && !isSelected, color: rowColor }, pointer), /* @__PURE__ */ React106.createElement(Text83, { dimColor: dimmed && !isSelected, color: rowColor }, agent.agentType), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true, color: rowColor }, " \xB7 ", formatModelShort(agent.model)), agent.overriddenBy ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: !isSelected, color: isSelected ? theme.warning : void 0 }, " ", figures9.warning, " overridden by ", agent.overriddenBy) : null);
|
|
29053
29456
|
};
|
|
29054
29457
|
const group = (label, agents) => {
|
|
29055
29458
|
if (agents.length === 0) return null;
|
|
29056
29459
|
const baseDir = agents[0]?.baseDir;
|
|
29057
|
-
return /* @__PURE__ */
|
|
29460
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React106.createElement(Box79, { paddingLeft: 2 }, /* @__PURE__ */ React106.createElement(Text83, { bold: true, dimColor: true }, label), baseDir ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, " ", "(", baseDir, ")") : null), agents.map(renderAgentRow));
|
|
29058
29461
|
};
|
|
29059
29462
|
const builtInSection = (label = "Built-in (always available):") => {
|
|
29060
29463
|
const builtIn = props.agents.filter((a) => a.source === "built-in");
|
|
29061
29464
|
if (builtIn.length === 0) return null;
|
|
29062
|
-
return /* @__PURE__ */
|
|
29465
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React106.createElement(Text83, { bold: true, dimColor: true }, label), builtIn.map(renderAgentRow));
|
|
29063
29466
|
};
|
|
29064
29467
|
const notOverriddenCount = props.agents.filter((a) => !a.overriddenBy).length;
|
|
29065
29468
|
const title = titleForSource(props.source);
|
|
29066
29469
|
if (props.agents.length === 0 || props.source !== "built-in" && !props.agents.some((a) => a.source !== "built-in")) {
|
|
29067
|
-
return /* @__PURE__ */
|
|
29470
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title, subtitle: "No agents found" }, props.onCreateNew ? /* @__PURE__ */ React106.createElement(Box79, { marginY: 1 }, renderCreateNew()) : null, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "No agents found. Create specialized subagents that Claude can delegate to."), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Each subagent has its own context window, custom system prompt, and specific tools."), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer."), props.source !== "built-in" && props.agents.some((a) => a.source === "built-in") ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "\u2500".repeat(40))), builtInSection()) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29068
29471
|
}
|
|
29069
|
-
return /* @__PURE__ */
|
|
29472
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
29070
29473
|
Panel,
|
|
29071
29474
|
{
|
|
29072
29475
|
title,
|
|
29073
29476
|
subtitle: `${notOverriddenCount} agents`
|
|
29074
29477
|
},
|
|
29075
|
-
props.changes.length > 0 ? /* @__PURE__ */
|
|
29076
|
-
/* @__PURE__ */
|
|
29478
|
+
props.changes.length > 0 ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, props.changes[props.changes.length - 1])) : null,
|
|
29479
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1 }, props.onCreateNew ? /* @__PURE__ */ React106.createElement(Box79, { marginBottom: 1 }, renderCreateNew()) : null, props.source === "all" ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, group(
|
|
29077
29480
|
"User agents",
|
|
29078
29481
|
props.agents.filter((a) => a.source === "userSettings")
|
|
29079
29482
|
), group(
|
|
@@ -29088,8 +29491,8 @@ function AgentsListView(props) {
|
|
|
29088
29491
|
), group(
|
|
29089
29492
|
"CLI arg agents",
|
|
29090
29493
|
props.agents.filter((a) => a.source === "flagSettings")
|
|
29091
|
-
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */
|
|
29092
|
-
), /* @__PURE__ */
|
|
29494
|
+
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true, italic: true }, "Built-in agents are provided by default and cannot be modified."), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, props.agents.map(renderAgentRow))) : /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column" }, props.agents.filter((a) => a.source !== "built-in").map(renderAgentRow)))
|
|
29495
|
+
), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29093
29496
|
}
|
|
29094
29497
|
function wizardLocationToStorageLocation(location) {
|
|
29095
29498
|
return location === "projectSettings" ? "project" : "user";
|
|
@@ -29180,16 +29583,16 @@ function Wizard(props) {
|
|
|
29180
29583
|
cancel
|
|
29181
29584
|
]
|
|
29182
29585
|
);
|
|
29183
|
-
return /* @__PURE__ */
|
|
29586
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, props.steps[stepIndex]?.(ctx) ?? null);
|
|
29184
29587
|
}
|
|
29185
29588
|
function WizardPanel(props) {
|
|
29186
|
-
return /* @__PURE__ */
|
|
29589
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Create new agent", subtitle: props.subtitle }, props.children), /* @__PURE__ */ React106.createElement(Instructions, { instructions: props.footerText }));
|
|
29187
29590
|
}
|
|
29188
29591
|
function StepChooseLocation({ ctx }) {
|
|
29189
29592
|
useInput30((_input, key) => {
|
|
29190
29593
|
if (key.escape) ctx.cancel();
|
|
29191
29594
|
});
|
|
29192
|
-
return /* @__PURE__ */
|
|
29595
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose location", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to cancel" }, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
29193
29596
|
Select,
|
|
29194
29597
|
{
|
|
29195
29598
|
options: [
|
|
@@ -29208,7 +29611,7 @@ function StepChooseMethod({ ctx }) {
|
|
|
29208
29611
|
useInput30((_input, key) => {
|
|
29209
29612
|
if (key.escape) ctx.goBack();
|
|
29210
29613
|
});
|
|
29211
|
-
return /* @__PURE__ */
|
|
29614
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
29212
29615
|
Select,
|
|
29213
29616
|
{
|
|
29214
29617
|
options: [
|
|
@@ -29292,7 +29695,7 @@ function StepGenerationPrompt(props) {
|
|
|
29292
29695
|
abortRef.current = null;
|
|
29293
29696
|
}
|
|
29294
29697
|
};
|
|
29295
|
-
return /* @__PURE__ */
|
|
29698
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Describe the agent you want" }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "What should this agent do?"), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Describe a role like \u201Ccode reviewer\u201D, \u201Csecurity auditor\u201D, or \u201Ctech lead\u201D."), /* @__PURE__ */ React106.createElement(
|
|
29296
29699
|
TextInput,
|
|
29297
29700
|
{
|
|
29298
29701
|
value,
|
|
@@ -29303,7 +29706,7 @@ function StepGenerationPrompt(props) {
|
|
|
29303
29706
|
cursorOffset,
|
|
29304
29707
|
onChangeCursorOffset: setCursorOffset
|
|
29305
29708
|
}
|
|
29306
|
-
), error ? /* @__PURE__ */
|
|
29709
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null, isGenerating ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Generating\u2026") : null));
|
|
29307
29710
|
}
|
|
29308
29711
|
function themeColor(kind) {
|
|
29309
29712
|
const theme = getTheme();
|
|
@@ -29339,13 +29742,13 @@ function StepAgentType(props) {
|
|
|
29339
29742
|
ctx.updateWizardData({ agentType: trimmed });
|
|
29340
29743
|
ctx.goNext();
|
|
29341
29744
|
};
|
|
29342
|
-
return /* @__PURE__ */
|
|
29745
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29343
29746
|
WizardPanel,
|
|
29344
29747
|
{
|
|
29345
29748
|
subtitle: "Agent type (identifier)",
|
|
29346
29749
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29347
29750
|
},
|
|
29348
|
-
/* @__PURE__ */
|
|
29751
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "Enter a unique identifier for your agent:"), /* @__PURE__ */ React106.createElement(
|
|
29349
29752
|
TextInput,
|
|
29350
29753
|
{
|
|
29351
29754
|
value,
|
|
@@ -29355,7 +29758,7 @@ function StepAgentType(props) {
|
|
|
29355
29758
|
cursorOffset,
|
|
29356
29759
|
onChangeCursorOffset: setCursorOffset
|
|
29357
29760
|
}
|
|
29358
|
-
), /* @__PURE__ */
|
|
29761
|
+
), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "e.g., code-reviewer, tech-lead, etc"), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29359
29762
|
);
|
|
29360
29763
|
}
|
|
29361
29764
|
function StepSystemPrompt({ ctx }) {
|
|
@@ -29376,13 +29779,13 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29376
29779
|
ctx.updateWizardData({ systemPrompt: trimmed });
|
|
29377
29780
|
ctx.goNext();
|
|
29378
29781
|
};
|
|
29379
|
-
return /* @__PURE__ */
|
|
29782
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29380
29783
|
WizardPanel,
|
|
29381
29784
|
{
|
|
29382
29785
|
subtitle: "System prompt",
|
|
29383
29786
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29384
29787
|
},
|
|
29385
|
-
/* @__PURE__ */
|
|
29788
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "Enter the system prompt for your agent:"), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Be comprehensive for best results"), /* @__PURE__ */ React106.createElement(
|
|
29386
29789
|
TextInput,
|
|
29387
29790
|
{
|
|
29388
29791
|
value,
|
|
@@ -29393,7 +29796,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29393
29796
|
cursorOffset,
|
|
29394
29797
|
onChangeCursorOffset: setCursorOffset
|
|
29395
29798
|
}
|
|
29396
|
-
), error ? /* @__PURE__ */
|
|
29799
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29397
29800
|
);
|
|
29398
29801
|
}
|
|
29399
29802
|
function StepDescription({ ctx }) {
|
|
@@ -29414,13 +29817,13 @@ function StepDescription({ ctx }) {
|
|
|
29414
29817
|
ctx.updateWizardData({ whenToUse: trimmed });
|
|
29415
29818
|
ctx.goNext();
|
|
29416
29819
|
};
|
|
29417
|
-
return /* @__PURE__ */
|
|
29820
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29418
29821
|
WizardPanel,
|
|
29419
29822
|
{
|
|
29420
29823
|
subtitle: "Description (tell Claude when to use this agent)",
|
|
29421
29824
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29422
29825
|
},
|
|
29423
|
-
/* @__PURE__ */
|
|
29826
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "When should Claude use this agent?"), /* @__PURE__ */ React106.createElement(
|
|
29424
29827
|
TextInput,
|
|
29425
29828
|
{
|
|
29426
29829
|
value,
|
|
@@ -29431,7 +29834,7 @@ function StepDescription({ ctx }) {
|
|
|
29431
29834
|
cursorOffset,
|
|
29432
29835
|
onChangeCursorOffset: setCursorOffset
|
|
29433
29836
|
}
|
|
29434
|
-
), error ? /* @__PURE__ */
|
|
29837
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29435
29838
|
);
|
|
29436
29839
|
}
|
|
29437
29840
|
function ToolPicker(props) {
|
|
@@ -29590,12 +29993,12 @@ function ToolPicker(props) {
|
|
|
29590
29993
|
return;
|
|
29591
29994
|
}
|
|
29592
29995
|
});
|
|
29593
|
-
return /* @__PURE__ */
|
|
29996
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: cursorIndex === 0 ? themeColor("suggestion") : void 0, bold: cursorIndex === 0 }, cursorIndex === 0 ? `${figures9.pointer} ` : " ", "[ Continue ]"), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "\u2500".repeat(40)), items.slice(1).map((item, idx) => {
|
|
29594
29997
|
const index = idx + 1;
|
|
29595
29998
|
const focused = index === cursorIndex;
|
|
29596
29999
|
const prefix = item.isHeader ? "" : focused ? `${figures9.pointer} ` : " ";
|
|
29597
|
-
return /* @__PURE__ */
|
|
29598
|
-
|
|
30000
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "\u2500".repeat(40)) : null, /* @__PURE__ */ React106.createElement(
|
|
30001
|
+
Text83,
|
|
29599
30002
|
{
|
|
29600
30003
|
dimColor: item.isHeader,
|
|
29601
30004
|
color: !item.isHeader && focused ? themeColor("suggestion") : void 0,
|
|
@@ -29603,12 +30006,12 @@ function ToolPicker(props) {
|
|
|
29603
30006
|
},
|
|
29604
30007
|
item.isToggle ? `${prefix}[ ${item.label} ]` : `${prefix}${item.label}`
|
|
29605
30008
|
));
|
|
29606
|
-
}), /* @__PURE__ */
|
|
30009
|
+
}), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, isAllSelected ? "All tools selected" : `${selectedSet.size} of ${allToolNames.length} tools selected`)));
|
|
29607
30010
|
}
|
|
29608
30011
|
function StepSelectTools(props) {
|
|
29609
30012
|
const { ctx } = props;
|
|
29610
30013
|
const initialTools = ctx.wizardData.selectedTools;
|
|
29611
|
-
return /* @__PURE__ */
|
|
30014
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Create new agent", subtitle: "Select tools" }, /* @__PURE__ */ React106.createElement(
|
|
29612
30015
|
ToolPicker,
|
|
29613
30016
|
{
|
|
29614
30017
|
tools: props.tools,
|
|
@@ -29619,7 +30022,7 @@ function StepSelectTools(props) {
|
|
|
29619
30022
|
},
|
|
29620
30023
|
onCancel: ctx.goBack
|
|
29621
30024
|
}
|
|
29622
|
-
)), /* @__PURE__ */
|
|
30025
|
+
)), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
29623
30026
|
}
|
|
29624
30027
|
function StepSelectModel({ ctx }) {
|
|
29625
30028
|
useInput30((_input, key) => {
|
|
@@ -29627,7 +30030,7 @@ function StepSelectModel({ ctx }) {
|
|
|
29627
30030
|
});
|
|
29628
30031
|
const options = modelOptions();
|
|
29629
30032
|
const defaultValue = ctx.wizardData.selectedModel ?? DEFAULT_AGENT_MODEL;
|
|
29630
|
-
return /* @__PURE__ */
|
|
30033
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Select model", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React106.createElement(
|
|
29631
30034
|
Select,
|
|
29632
30035
|
{
|
|
29633
30036
|
options,
|
|
@@ -29648,12 +30051,12 @@ function ColorPicker(props) {
|
|
|
29648
30051
|
else if (key.downArrow) setIndex((i) => i < COLOR_OPTIONS.length - 1 ? i + 1 : 0);
|
|
29649
30052
|
else if (key.return) props.onConfirm(COLOR_OPTIONS[index] ?? "automatic");
|
|
29650
30053
|
});
|
|
29651
|
-
return /* @__PURE__ */
|
|
30054
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", gap: 1 }, COLOR_OPTIONS.map((color, i) => {
|
|
29652
30055
|
const focused = i === index;
|
|
29653
30056
|
const prefix = focused ? figures9.pointer : " ";
|
|
29654
30057
|
const label = color === "automatic" ? "Automatic color" : color.charAt(0).toUpperCase() + color.slice(1);
|
|
29655
|
-
return /* @__PURE__ */
|
|
29656
|
-
|
|
30058
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: color }, /* @__PURE__ */ React106.createElement(
|
|
30059
|
+
Text83,
|
|
29657
30060
|
{
|
|
29658
30061
|
color: focused ? themeColor("suggestion") : void 0,
|
|
29659
30062
|
bold: focused
|
|
@@ -29686,7 +30089,7 @@ function StepChooseColor({ ctx }) {
|
|
|
29686
30089
|
});
|
|
29687
30090
|
ctx.goNext();
|
|
29688
30091
|
};
|
|
29689
|
-
return /* @__PURE__ */
|
|
30092
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose background color", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(ColorPicker, { agentName: agentType, currentColor: "automatic", onConfirm })));
|
|
29690
30093
|
}
|
|
29691
30094
|
function validateFinalAgent(args) {
|
|
29692
30095
|
const errors = [];
|
|
@@ -29751,28 +30154,28 @@ function StepConfirm(props) {
|
|
|
29751
30154
|
});
|
|
29752
30155
|
const locationPath = finalAgent.source === "projectSettings" ? getPrimaryAgentFilePath("project", finalAgent.agentType) : getPrimaryAgentFilePath("user", finalAgent.agentType);
|
|
29753
30156
|
const truncate = (text) => text.length > 240 ? `${text.slice(0, 240)}\u2026` : text;
|
|
29754
|
-
return /* @__PURE__ */
|
|
30157
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29755
30158
|
WizardPanel,
|
|
29756
30159
|
{
|
|
29757
30160
|
subtitle: "Confirm and save",
|
|
29758
30161
|
footerText: "Press s/Enter to save \xB7 e to edit in your editor \xB7 Esc to cancel"
|
|
29759
30162
|
},
|
|
29760
|
-
/* @__PURE__ */
|
|
30163
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Name"), ": ", finalAgent.agentType), /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Location"), ": ", locationPath), /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Tools"), ": ", toolSummary(finalAgent.tools)), /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Model"), ": ", formatModelLong(finalAgent.model)), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, truncate(finalAgent.whenToUse)))), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, truncate(finalAgent.systemPrompt)))), validation.warnings.length > 0 ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("warning") }, "Warnings:"), validation.warnings.map((w, i) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: i }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, " ", "\u2022 ", w)))) : null, validation.errors.length > 0 ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, "Errors:"), validation.errors.map((e, i) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: i }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, " ", "\u2022 ", e)))) : null, error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null)
|
|
29761
30164
|
);
|
|
29762
30165
|
}
|
|
29763
30166
|
function CreateAgentWizard(props) {
|
|
29764
30167
|
const steps = useMemo27(() => {
|
|
29765
30168
|
return [
|
|
29766
|
-
(ctx) => /* @__PURE__ */
|
|
29767
|
-
(ctx) => /* @__PURE__ */
|
|
29768
|
-
(ctx) => /* @__PURE__ */
|
|
29769
|
-
(ctx) => /* @__PURE__ */
|
|
29770
|
-
(ctx) => /* @__PURE__ */
|
|
29771
|
-
(ctx) => /* @__PURE__ */
|
|
29772
|
-
(ctx) => /* @__PURE__ */
|
|
29773
|
-
(ctx) => /* @__PURE__ */
|
|
29774
|
-
(ctx) => /* @__PURE__ */
|
|
29775
|
-
(ctx) => /* @__PURE__ */
|
|
30169
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseLocation, { ctx }),
|
|
30170
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseMethod, { ctx }),
|
|
30171
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepGenerationPrompt, { ctx, existingAgents: props.existingAgents }),
|
|
30172
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepAgentType, { ctx, existingAgents: props.existingAgents }),
|
|
30173
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSystemPrompt, { ctx }),
|
|
30174
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepDescription, { ctx }),
|
|
30175
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSelectTools, { ctx, tools: props.tools }),
|
|
30176
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSelectModel, { ctx }),
|
|
30177
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseColor, { ctx }),
|
|
30178
|
+
(ctx) => /* @__PURE__ */ React106.createElement(
|
|
29776
30179
|
StepConfirm,
|
|
29777
30180
|
{
|
|
29778
30181
|
ctx,
|
|
@@ -29805,7 +30208,7 @@ function CreateAgentWizard(props) {
|
|
|
29805
30208
|
)
|
|
29806
30209
|
];
|
|
29807
30210
|
}, [props]);
|
|
29808
|
-
return /* @__PURE__ */
|
|
30211
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29809
30212
|
Wizard,
|
|
29810
30213
|
{
|
|
29811
30214
|
steps,
|
|
@@ -29828,13 +30231,13 @@ function AgentMenu(props) {
|
|
|
29828
30231
|
],
|
|
29829
30232
|
{ label: "Back", value: "back" }
|
|
29830
30233
|
];
|
|
29831
|
-
return /* @__PURE__ */
|
|
30234
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
29832
30235
|
Select,
|
|
29833
30236
|
{
|
|
29834
30237
|
options,
|
|
29835
30238
|
onChange: (value) => props.onChoose(value)
|
|
29836
30239
|
}
|
|
29837
|
-
))), /* @__PURE__ */
|
|
30240
|
+
))), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29838
30241
|
}
|
|
29839
30242
|
function ViewAgent(props) {
|
|
29840
30243
|
useInput30((_input, key) => {
|
|
@@ -29870,9 +30273,9 @@ function ViewAgent(props) {
|
|
|
29870
30273
|
const toolsSummary = () => {
|
|
29871
30274
|
if (parsedTools.hasWildcard) return "All tools";
|
|
29872
30275
|
if (!props.agent.tools || props.agent.tools === "*" || props.agent.tools.length === 0) return "None";
|
|
29873
|
-
return /* @__PURE__ */
|
|
30276
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, parsedTools.valid.length > 0 ? parsedTools.valid.join(", ") : null, parsedTools.invalid.length > 0 ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("warning") }, " ", figures9.warning, " Unrecognized: ", parsedTools.invalid.join(", "))) : null);
|
|
29874
30277
|
};
|
|
29875
|
-
return /* @__PURE__ */
|
|
30278
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, sourceLine), /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 2 }, /* @__PURE__ */ React106.createElement(Text83, null, props.agent.whenToUse))), /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Tools"), ": ", toolsSummary()), /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Model"), ": ", formatModelLong(props.agent.model)), props.agent.color ? /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "Color"), ": ", props.agent.color) : null, props.agent.systemPrompt ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text83, null, /* @__PURE__ */ React106.createElement(Text83, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 2, marginRight: 2 }, /* @__PURE__ */ React106.createElement(Text83, null, props.agent.systemPrompt))) : null)), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter or Esc to go back" }));
|
|
29876
30279
|
}
|
|
29877
30280
|
function EditAgent(props) {
|
|
29878
30281
|
const [mode, setMode] = useState29("menu");
|
|
@@ -29937,7 +30340,7 @@ function EditAgent(props) {
|
|
|
29937
30340
|
}
|
|
29938
30341
|
});
|
|
29939
30342
|
if (mode === "edit-tools") {
|
|
29940
|
-
return /* @__PURE__ */
|
|
30343
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(
|
|
29941
30344
|
ToolPicker,
|
|
29942
30345
|
{
|
|
29943
30346
|
tools: props.tools,
|
|
@@ -29949,10 +30352,10 @@ function EditAgent(props) {
|
|
|
29949
30352
|
},
|
|
29950
30353
|
onCancel: () => setMode("menu")
|
|
29951
30354
|
}
|
|
29952
|
-
), error ? /* @__PURE__ */
|
|
30355
|
+
), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
29953
30356
|
}
|
|
29954
30357
|
if (mode === "edit-model") {
|
|
29955
|
-
return /* @__PURE__ */
|
|
30358
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", gap: 1, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React106.createElement(
|
|
29956
30359
|
Select,
|
|
29957
30360
|
{
|
|
29958
30361
|
options: modelOptions(),
|
|
@@ -29962,10 +30365,10 @@ function EditAgent(props) {
|
|
|
29962
30365
|
setMode("menu");
|
|
29963
30366
|
}
|
|
29964
30367
|
}
|
|
29965
|
-
)), error ? /* @__PURE__ */
|
|
30368
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29966
30369
|
}
|
|
29967
30370
|
if (mode === "edit-color") {
|
|
29968
|
-
return /* @__PURE__ */
|
|
30371
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
29969
30372
|
ColorPicker,
|
|
29970
30373
|
{
|
|
29971
30374
|
agentName: props.agent.agentType,
|
|
@@ -29975,29 +30378,29 @@ function EditAgent(props) {
|
|
|
29975
30378
|
setMode("menu");
|
|
29976
30379
|
}
|
|
29977
30380
|
}
|
|
29978
|
-
)), error ? /* @__PURE__ */
|
|
30381
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29979
30382
|
}
|
|
29980
|
-
return /* @__PURE__ */
|
|
29981
|
-
|
|
30383
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Source: ", titleForSource(props.agent.source)), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1, flexDirection: "column" }, menuItems.map((item, idx) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.label }, /* @__PURE__ */ React106.createElement(
|
|
30384
|
+
Text83,
|
|
29982
30385
|
{
|
|
29983
30386
|
color: idx === selectedIndex ? themeColor("suggestion") : void 0
|
|
29984
30387
|
},
|
|
29985
30388
|
idx === selectedIndex ? `${figures9.pointer} ` : " ",
|
|
29986
30389
|
item.label
|
|
29987
|
-
)))), error ? /* @__PURE__ */
|
|
30390
|
+
)))), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null)), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29988
30391
|
}
|
|
29989
30392
|
function DeleteConfirm(props) {
|
|
29990
30393
|
useInput30((_input, key) => {
|
|
29991
30394
|
if (key.escape) props.onCancel();
|
|
29992
30395
|
});
|
|
29993
|
-
return /* @__PURE__ */
|
|
30396
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
29994
30397
|
Panel,
|
|
29995
30398
|
{
|
|
29996
30399
|
title: "Delete agent",
|
|
29997
30400
|
borderColor: panelBorderColor("error"),
|
|
29998
30401
|
titleColor: themeColor("error")
|
|
29999
30402
|
},
|
|
30000
|
-
/* @__PURE__ */
|
|
30403
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "Are you sure you want to delete the agent ", /* @__PURE__ */ React106.createElement(Text83, { bold: true }, props.agent.agentType), "?"), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Source: ", props.agent.source)), /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
30001
30404
|
Select,
|
|
30002
30405
|
{
|
|
30003
30406
|
options: [
|
|
@@ -30010,7 +30413,7 @@ function DeleteConfirm(props) {
|
|
|
30010
30413
|
}
|
|
30011
30414
|
}
|
|
30012
30415
|
)))
|
|
30013
|
-
), /* @__PURE__ */
|
|
30416
|
+
), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press \u2191\u2193 to navigate, Enter to select, Esc to cancel" }));
|
|
30014
30417
|
}
|
|
30015
30418
|
function AgentsUI({ onExit }) {
|
|
30016
30419
|
const [mode, setMode] = useState29({ mode: "list-agents", source: "all" });
|
|
@@ -30081,10 +30484,10 @@ ${changes.join("\n")}`);
|
|
|
30081
30484
|
onExit("Agents dialog dismissed");
|
|
30082
30485
|
}, [changes, onExit]);
|
|
30083
30486
|
if (loading) {
|
|
30084
|
-
return /* @__PURE__ */
|
|
30487
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Agents", subtitle: "Loading\u2026" }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Loading agents\u2026")), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
30085
30488
|
}
|
|
30086
30489
|
if (mode.mode === "list-agents") {
|
|
30087
|
-
return /* @__PURE__ */
|
|
30490
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30088
30491
|
AgentsListView,
|
|
30089
30492
|
{
|
|
30090
30493
|
source: mode.source,
|
|
@@ -30097,7 +30500,7 @@ ${changes.join("\n")}`);
|
|
|
30097
30500
|
);
|
|
30098
30501
|
}
|
|
30099
30502
|
if (mode.mode === "create-agent") {
|
|
30100
|
-
return /* @__PURE__ */
|
|
30503
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30101
30504
|
CreateAgentWizard,
|
|
30102
30505
|
{
|
|
30103
30506
|
tools,
|
|
@@ -30112,7 +30515,7 @@ ${changes.join("\n")}`);
|
|
|
30112
30515
|
);
|
|
30113
30516
|
}
|
|
30114
30517
|
if (mode.mode === "agent-menu") {
|
|
30115
|
-
return /* @__PURE__ */
|
|
30518
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30116
30519
|
AgentMenu,
|
|
30117
30520
|
{
|
|
30118
30521
|
agent: mode.agent,
|
|
@@ -30127,7 +30530,7 @@ ${changes.join("\n")}`);
|
|
|
30127
30530
|
);
|
|
30128
30531
|
}
|
|
30129
30532
|
if (mode.mode === "view-agent") {
|
|
30130
|
-
return /* @__PURE__ */
|
|
30533
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30131
30534
|
ViewAgent,
|
|
30132
30535
|
{
|
|
30133
30536
|
agent: mode.agent,
|
|
@@ -30137,7 +30540,7 @@ ${changes.join("\n")}`);
|
|
|
30137
30540
|
);
|
|
30138
30541
|
}
|
|
30139
30542
|
if (mode.mode === "edit-agent") {
|
|
30140
|
-
return /* @__PURE__ */
|
|
30543
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30141
30544
|
EditAgent,
|
|
30142
30545
|
{
|
|
30143
30546
|
agent: mode.agent,
|
|
@@ -30152,7 +30555,7 @@ ${changes.join("\n")}`);
|
|
|
30152
30555
|
);
|
|
30153
30556
|
}
|
|
30154
30557
|
if (mode.mode === "delete-confirm") {
|
|
30155
|
-
return /* @__PURE__ */
|
|
30558
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30156
30559
|
DeleteConfirm,
|
|
30157
30560
|
{
|
|
30158
30561
|
agent: mode.agent,
|
|
@@ -30177,7 +30580,7 @@ var agents_default = {
|
|
|
30177
30580
|
isEnabled: true,
|
|
30178
30581
|
isHidden: false,
|
|
30179
30582
|
async call(onExit) {
|
|
30180
|
-
return /* @__PURE__ */
|
|
30583
|
+
return /* @__PURE__ */ React107.createElement(AgentsUI, { onExit });
|
|
30181
30584
|
},
|
|
30182
30585
|
userFacingName() {
|
|
30183
30586
|
return "agents";
|
|
@@ -30338,7 +30741,7 @@ ${availableLines}${truncatedNotice}
|
|
|
30338
30741
|
return command4 || "";
|
|
30339
30742
|
},
|
|
30340
30743
|
renderToolUseRejectedMessage() {
|
|
30341
|
-
return /* @__PURE__ */
|
|
30744
|
+
return /* @__PURE__ */ React108.createElement(FallbackToolUseRejectedMessage, null);
|
|
30342
30745
|
},
|
|
30343
30746
|
renderResultForAssistant(output) {
|
|
30344
30747
|
return `Launching command: /${output.commandName}`;
|
|
@@ -30494,8 +30897,8 @@ function parseMcpToolName2(name3) {
|
|
|
30494
30897
|
}
|
|
30495
30898
|
|
|
30496
30899
|
// src/tools/system/KillShellTool/KillShellTool.tsx
|
|
30497
|
-
import { Box as
|
|
30498
|
-
import
|
|
30900
|
+
import { Box as Box80, Text as Text84 } from "ink";
|
|
30901
|
+
import React109 from "react";
|
|
30499
30902
|
import { z as z14 } from "zod";
|
|
30500
30903
|
|
|
30501
30904
|
// src/tools/system/KillShellTool/prompt.ts
|
|
@@ -30541,10 +30944,10 @@ var KillShellTool = {
|
|
|
30541
30944
|
return `Kill shell: ${shell_id}`;
|
|
30542
30945
|
},
|
|
30543
30946
|
renderToolUseRejectedMessage() {
|
|
30544
|
-
return /* @__PURE__ */
|
|
30947
|
+
return /* @__PURE__ */ React109.createElement(FallbackToolUseRejectedMessage, null);
|
|
30545
30948
|
},
|
|
30546
30949
|
renderToolResultMessage(output) {
|
|
30547
|
-
return /* @__PURE__ */
|
|
30950
|
+
return /* @__PURE__ */ React109.createElement(Box80, { flexDirection: "row" }, /* @__PURE__ */ React109.createElement(Text84, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React109.createElement(Text84, null, "Shell ", output.shell_id, " killed"));
|
|
30548
30951
|
},
|
|
30549
30952
|
renderResultForAssistant(output) {
|
|
30550
30953
|
return JSON.stringify(output);
|
|
@@ -31271,8 +31674,8 @@ function WebFetchPermissionRequest({
|
|
|
31271
31674
|
reject();
|
|
31272
31675
|
}
|
|
31273
31676
|
});
|
|
31274
|
-
return /* @__PURE__ */
|
|
31275
|
-
|
|
31677
|
+
return /* @__PURE__ */ React110.createElement(
|
|
31678
|
+
Box81,
|
|
31276
31679
|
{
|
|
31277
31680
|
flexDirection: "column",
|
|
31278
31681
|
borderStyle: "round",
|
|
@@ -31282,14 +31685,14 @@ function WebFetchPermissionRequest({
|
|
|
31282
31685
|
paddingRight: 1,
|
|
31283
31686
|
paddingBottom: 1
|
|
31284
31687
|
},
|
|
31285
|
-
/* @__PURE__ */
|
|
31688
|
+
/* @__PURE__ */ React110.createElement(
|
|
31286
31689
|
PermissionRequestTitle,
|
|
31287
31690
|
{
|
|
31288
31691
|
title: "Network request outside of sandbox",
|
|
31289
31692
|
riskScore: null
|
|
31290
31693
|
}
|
|
31291
31694
|
),
|
|
31292
|
-
/* @__PURE__ */
|
|
31695
|
+
/* @__PURE__ */ React110.createElement(Box81, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React110.createElement(Box81, null, /* @__PURE__ */ React110.createElement(Text85, { dimColor: true }, "Host:"), /* @__PURE__ */ React110.createElement(Text85, null, " ", hostLabel)), /* @__PURE__ */ React110.createElement(Box81, { marginTop: 1 }, /* @__PURE__ */ React110.createElement(Text85, null, "Do you want to allow this connection?")), /* @__PURE__ */ React110.createElement(Box81, { marginTop: 1 }, /* @__PURE__ */ React110.createElement(
|
|
31293
31696
|
Select,
|
|
31294
31697
|
{
|
|
31295
31698
|
options: [
|
|
@@ -31661,10 +32064,10 @@ var BashTool = {
|
|
|
31661
32064
|
return withDescription(base.trim());
|
|
31662
32065
|
},
|
|
31663
32066
|
renderToolUseRejectedMessage() {
|
|
31664
|
-
return /* @__PURE__ */
|
|
32067
|
+
return /* @__PURE__ */ React111.createElement(FallbackToolUseRejectedMessage, null);
|
|
31665
32068
|
},
|
|
31666
32069
|
renderToolResultMessage(content) {
|
|
31667
|
-
return /* @__PURE__ */
|
|
32070
|
+
return /* @__PURE__ */ React111.createElement(BashToolResultMessage_default, { content, verbose: false });
|
|
31668
32071
|
},
|
|
31669
32072
|
renderResultForAssistant({
|
|
31670
32073
|
interrupted,
|
|
@@ -31905,7 +32308,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
|
|
|
31905
32308
|
}
|
|
31906
32309
|
};
|
|
31907
32310
|
setToolJSX({
|
|
31908
|
-
jsx: /* @__PURE__ */
|
|
32311
|
+
jsx: /* @__PURE__ */ React111.createElement(
|
|
31909
32312
|
WebFetchPermissionRequest,
|
|
31910
32313
|
{
|
|
31911
32314
|
toolUseConfirm,
|
|
@@ -32101,7 +32504,7 @@ ${footerParts.join(" ")}`;
|
|
|
32101
32504
|
if (!overlayShown && setToolJSX && Date.now() - startedAt >= PROGRESS_INITIAL_DELAY_MS) {
|
|
32102
32505
|
overlayShown = true;
|
|
32103
32506
|
setToolJSX({
|
|
32104
|
-
jsx: /* @__PURE__ */
|
|
32507
|
+
jsx: /* @__PURE__ */ React111.createElement(
|
|
32105
32508
|
BashToolRunInBackgroundOverlay,
|
|
32106
32509
|
{
|
|
32107
32510
|
onBackground: requestBackground
|