pybao-cli 1.4.59 → 1.4.61
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-D2V54PR2.js +46 -0
- package/dist/{acp-KP7O2JPK.js → acp-6XO6DZ4K.js} +29 -29
- package/dist/{agentsValidate-KLUQQGOD.js → agentsValidate-N6USTEX6.js} +7 -7
- package/dist/{ask-JZQ2MP3L.js → ask-U7Z3DDMS.js} +28 -28
- package/dist/{autoUpdater-5OG5UVQA.js → autoUpdater-SKABKEDG.js} +3 -3
- package/dist/{chunk-SKO7QBCJ.js → chunk-2EAKAXE7.js} +4 -4
- package/dist/{chunk-H22XKBZW.js → chunk-3C6TCPTK.js} +2 -2
- package/dist/{chunk-65BSN3CB.js → chunk-56F6HFV3.js} +2 -2
- package/dist/{chunk-HF7QLI25.js → chunk-7MDERGB4.js} +1 -1
- package/dist/{chunk-QV7EGC5K.js → chunk-7OTUXO44.js} +3 -3
- package/dist/{chunk-DC2LQ4ZJ.js → chunk-7SI5GFRV.js} +1 -1
- package/dist/{chunk-OUQ6XAQE.js → chunk-7XB7B6Z4.js} +2 -2
- package/dist/{chunk-ZSNJ7HNK.js → chunk-BZP4S26C.js} +3 -3
- package/dist/{chunk-M5SLHPYX.js → chunk-E5ITVDNO.js} +2 -2
- package/dist/{chunk-3JA4N4EG.js → chunk-EV3XWHXP.js} +1 -1
- package/dist/{chunk-3VQCQFCA.js → chunk-F3GKVQH4.js} +16 -16
- package/dist/{chunk-KB5EPNBC.js → chunk-FVVMATKZ.js} +3 -3
- package/dist/{chunk-MHTECT7D.js → chunk-GJ5MQLQW.js} +3 -3
- package/dist/{chunk-NXZD33LF.js → chunk-IEYYJQSN.js} +4 -4
- package/dist/{chunk-WE72JSC5.js → chunk-KHHFZVFT.js} +1 -1
- package/dist/{chunk-5QFMQPF7.js → chunk-M7TC4PYX.js} +4 -4
- package/dist/{chunk-U7YEDOQH.js → chunk-N4XJF5KW.js} +3 -3
- package/dist/{chunk-W575XX3E.js → chunk-PTFRX47Q.js} +1 -1
- package/dist/{chunk-VC32AKCN.js → chunk-QFHNNIRB.js} +1 -1
- package/dist/{chunk-VC32AKCN.js.map → chunk-QFHNNIRB.js.map} +1 -1
- package/dist/{chunk-MXFJEOIZ.js → chunk-QLOVB5WV.js} +1 -1
- package/dist/{chunk-ILXKA3BE.js → chunk-RPQSFP52.js} +2 -2
- package/dist/{chunk-XL7FHFH2.js → chunk-RRVFQN7A.js} +846 -407
- package/dist/chunk-RRVFQN7A.js.map +7 -0
- package/dist/{chunk-LZQFAGUJ.js → chunk-RTIGJSOG.js} +2 -2
- package/dist/{chunk-OGO24BIR.js → chunk-SEYAHQLM.js} +4 -4
- package/dist/{chunk-2EXG6TVG.js → chunk-UQT43SRL.js} +1 -1
- package/dist/{chunk-4SSVUQR7.js → chunk-UVTCQRSO.js} +1 -1
- package/dist/{chunk-SVM54HCL.js → chunk-V5RQSF7R.js} +2 -2
- package/dist/{chunk-JO3WZP2Z.js → chunk-WEYGVSI3.js} +1 -1
- package/dist/{chunk-NWRPLZBR.js → chunk-WIEHMZHA.js} +3 -3
- package/dist/{chunk-F4PNKE3B.js → chunk-Z75JN5D5.js} +3 -3
- package/dist/{cli-ASEK3FYF.js → cli-ARZZZJMR.js} +87 -87
- package/dist/commands-N5UWETIS.js +50 -0
- package/dist/{config-4NGWNMMS.js → config-YTD2SOEU.js} +4 -4
- package/dist/{context-W3EDXZ54.js → context-Y3W46GSA.js} +6 -6
- package/dist/{customCommands-V4MFE2NZ.js → customCommands-25ZCNKDR.js} +4 -4
- package/dist/{env-TSW3U4QR.js → env-RIIPJMJB.js} +2 -2
- package/dist/{file-PUFXGDKG.js → file-7HEQVJ73.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-JGOQBZV5.js → llm-VHGMLUMA.js} +29 -29
- package/dist/{llmLazy-EDVHLXKF.js → llmLazy-XKTD2R72.js} +1 -1
- package/dist/{loader-CZUZSV3L.js → loader-XYKXQ4H5.js} +4 -4
- package/dist/{lsp-KQEL2Z5B.js → lsp-VYNRCIOT.js} +6 -6
- package/dist/{lspAnchor-CMN2EAXA.js → lspAnchor-Z763O5JV.js} +6 -6
- package/dist/{mcp-2ZQDHS4I.js → mcp-LVJ3GFBK.js} +7 -7
- package/dist/{mentionProcessor-55XPH4H5.js → mentionProcessor-I4DOMLGV.js} +5 -5
- package/dist/{messages-ZXH34O7C.js → messages-2QDFFJNL.js} +1 -1
- package/dist/{model-HRZLFI6N.js → model-6SZVFU73.js} +5 -5
- package/dist/{openai-27I7Z3ZC.js → openai-C3ZO5ZGQ.js} +5 -5
- package/dist/{outputStyles-7IT3PJEV.js → outputStyles-QYM3GK47.js} +4 -4
- package/dist/{pluginRuntime-JR2W7YNN.js → pluginRuntime-ZIW6JAIM.js} +6 -6
- package/dist/{pluginValidation-74GSAD5Y.js → pluginValidation-4VYKYFQA.js} +6 -6
- package/dist/prompts-M5SGMYVA.js +52 -0
- package/dist/{pybAgentSessionLoad-OG476637.js → pybAgentSessionLoad-6MBKOFXS.js} +4 -4
- package/dist/{pybAgentSessionResume-OZN6FL2B.js → pybAgentSessionResume-H7PXL2LX.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-DZYU3CCN.js → pybAgentStreamJsonSession-SBEDAJNJ.js} +1 -1
- package/dist/{pybHooks-JFX4FQYP.js → pybHooks-GD2MFXKZ.js} +4 -4
- package/dist/query-DQOO54O2.js +54 -0
- package/dist/{registry-AEHL3QOI.js → registry-YGBXA7SH.js} +5 -5
- package/dist/{ripgrep-577TAST7.js → ripgrep-VSVJH453.js} +3 -3
- package/dist/{skillMarketplace-MHQ3OILT.js → skillMarketplace-LIZJ4ZIQ.js} +3 -3
- package/dist/{state-U2UXOFJE.js → state-OQTB4HM4.js} +2 -2
- package/dist/{theme-LRDBOK7Q.js → theme-RJQIICNA.js} +5 -5
- package/dist/{toolPermissionSettings-BY5S2F4S.js → toolPermissionSettings-D6JZFF7R.js} +6 -6
- package/dist/tools-YPKSRUWZ.js +51 -0
- package/dist/{userInput-IZPOKNLE.js → userInput-Y4QSHHCF.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-Q57PDXOC.js +0 -46
- package/dist/chunk-XL7FHFH2.js.map +0 -7
- package/dist/commands-4C3KBKN2.js +0 -50
- package/dist/prompts-WEICROHR.js +0 -52
- package/dist/query-R3Y2PHEF.js +0 -54
- package/dist/tools-REPDA4UL.js +0 -51
- /package/dist/{REPL-Q57PDXOC.js.map → REPL-D2V54PR2.js.map} +0 -0
- /package/dist/{acp-KP7O2JPK.js.map → acp-6XO6DZ4K.js.map} +0 -0
- /package/dist/{agentsValidate-KLUQQGOD.js.map → agentsValidate-N6USTEX6.js.map} +0 -0
- /package/dist/{ask-JZQ2MP3L.js.map → ask-U7Z3DDMS.js.map} +0 -0
- /package/dist/{autoUpdater-5OG5UVQA.js.map → autoUpdater-SKABKEDG.js.map} +0 -0
- /package/dist/{chunk-SKO7QBCJ.js.map → chunk-2EAKAXE7.js.map} +0 -0
- /package/dist/{chunk-H22XKBZW.js.map → chunk-3C6TCPTK.js.map} +0 -0
- /package/dist/{chunk-65BSN3CB.js.map → chunk-56F6HFV3.js.map} +0 -0
- /package/dist/{chunk-HF7QLI25.js.map → chunk-7MDERGB4.js.map} +0 -0
- /package/dist/{chunk-QV7EGC5K.js.map → chunk-7OTUXO44.js.map} +0 -0
- /package/dist/{chunk-DC2LQ4ZJ.js.map → chunk-7SI5GFRV.js.map} +0 -0
- /package/dist/{chunk-OUQ6XAQE.js.map → chunk-7XB7B6Z4.js.map} +0 -0
- /package/dist/{chunk-ZSNJ7HNK.js.map → chunk-BZP4S26C.js.map} +0 -0
- /package/dist/{chunk-M5SLHPYX.js.map → chunk-E5ITVDNO.js.map} +0 -0
- /package/dist/{chunk-3JA4N4EG.js.map → chunk-EV3XWHXP.js.map} +0 -0
- /package/dist/{chunk-3VQCQFCA.js.map → chunk-F3GKVQH4.js.map} +0 -0
- /package/dist/{chunk-KB5EPNBC.js.map → chunk-FVVMATKZ.js.map} +0 -0
- /package/dist/{chunk-MHTECT7D.js.map → chunk-GJ5MQLQW.js.map} +0 -0
- /package/dist/{chunk-NXZD33LF.js.map → chunk-IEYYJQSN.js.map} +0 -0
- /package/dist/{chunk-WE72JSC5.js.map → chunk-KHHFZVFT.js.map} +0 -0
- /package/dist/{chunk-5QFMQPF7.js.map → chunk-M7TC4PYX.js.map} +0 -0
- /package/dist/{chunk-U7YEDOQH.js.map → chunk-N4XJF5KW.js.map} +0 -0
- /package/dist/{chunk-W575XX3E.js.map → chunk-PTFRX47Q.js.map} +0 -0
- /package/dist/{chunk-MXFJEOIZ.js.map → chunk-QLOVB5WV.js.map} +0 -0
- /package/dist/{chunk-ILXKA3BE.js.map → chunk-RPQSFP52.js.map} +0 -0
- /package/dist/{chunk-LZQFAGUJ.js.map → chunk-RTIGJSOG.js.map} +0 -0
- /package/dist/{chunk-OGO24BIR.js.map → chunk-SEYAHQLM.js.map} +0 -0
- /package/dist/{chunk-2EXG6TVG.js.map → chunk-UQT43SRL.js.map} +0 -0
- /package/dist/{chunk-4SSVUQR7.js.map → chunk-UVTCQRSO.js.map} +0 -0
- /package/dist/{chunk-SVM54HCL.js.map → chunk-V5RQSF7R.js.map} +0 -0
- /package/dist/{chunk-JO3WZP2Z.js.map → chunk-WEYGVSI3.js.map} +0 -0
- /package/dist/{chunk-NWRPLZBR.js.map → chunk-WIEHMZHA.js.map} +0 -0
- /package/dist/{chunk-F4PNKE3B.js.map → chunk-Z75JN5D5.js.map} +0 -0
- /package/dist/{cli-ASEK3FYF.js.map → cli-ARZZZJMR.js.map} +0 -0
- /package/dist/{commands-4C3KBKN2.js.map → commands-N5UWETIS.js.map} +0 -0
- /package/dist/{config-4NGWNMMS.js.map → config-YTD2SOEU.js.map} +0 -0
- /package/dist/{context-W3EDXZ54.js.map → context-Y3W46GSA.js.map} +0 -0
- /package/dist/{customCommands-V4MFE2NZ.js.map → customCommands-25ZCNKDR.js.map} +0 -0
- /package/dist/{env-TSW3U4QR.js.map → env-RIIPJMJB.js.map} +0 -0
- /package/dist/{file-PUFXGDKG.js.map → file-7HEQVJ73.js.map} +0 -0
- /package/dist/{llm-JGOQBZV5.js.map → llm-VHGMLUMA.js.map} +0 -0
- /package/dist/{llmLazy-EDVHLXKF.js.map → llmLazy-XKTD2R72.js.map} +0 -0
- /package/dist/{loader-CZUZSV3L.js.map → loader-XYKXQ4H5.js.map} +0 -0
- /package/dist/{lsp-KQEL2Z5B.js.map → lsp-VYNRCIOT.js.map} +0 -0
- /package/dist/{lspAnchor-CMN2EAXA.js.map → lspAnchor-Z763O5JV.js.map} +0 -0
- /package/dist/{mcp-2ZQDHS4I.js.map → mcp-LVJ3GFBK.js.map} +0 -0
- /package/dist/{mentionProcessor-55XPH4H5.js.map → mentionProcessor-I4DOMLGV.js.map} +0 -0
- /package/dist/{messages-ZXH34O7C.js.map → messages-2QDFFJNL.js.map} +0 -0
- /package/dist/{model-HRZLFI6N.js.map → model-6SZVFU73.js.map} +0 -0
- /package/dist/{openai-27I7Z3ZC.js.map → openai-C3ZO5ZGQ.js.map} +0 -0
- /package/dist/{outputStyles-7IT3PJEV.js.map → outputStyles-QYM3GK47.js.map} +0 -0
- /package/dist/{pluginRuntime-JR2W7YNN.js.map → pluginRuntime-ZIW6JAIM.js.map} +0 -0
- /package/dist/{pluginValidation-74GSAD5Y.js.map → pluginValidation-4VYKYFQA.js.map} +0 -0
- /package/dist/{prompts-WEICROHR.js.map → prompts-M5SGMYVA.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-OG476637.js.map → pybAgentSessionLoad-6MBKOFXS.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-OZN6FL2B.js.map → pybAgentSessionResume-H7PXL2LX.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-DZYU3CCN.js.map → pybAgentStreamJsonSession-SBEDAJNJ.js.map} +0 -0
- /package/dist/{pybHooks-JFX4FQYP.js.map → pybHooks-GD2MFXKZ.js.map} +0 -0
- /package/dist/{query-R3Y2PHEF.js.map → query-DQOO54O2.js.map} +0 -0
- /package/dist/{registry-AEHL3QOI.js.map → registry-YGBXA7SH.js.map} +0 -0
- /package/dist/{ripgrep-577TAST7.js.map → ripgrep-VSVJH453.js.map} +0 -0
- /package/dist/{skillMarketplace-MHQ3OILT.js.map → skillMarketplace-LIZJ4ZIQ.js.map} +0 -0
- /package/dist/{state-U2UXOFJE.js.map → state-OQTB4HM4.js.map} +0 -0
- /package/dist/{theme-LRDBOK7Q.js.map → theme-RJQIICNA.js.map} +0 -0
- /package/dist/{toolPermissionSettings-BY5S2F4S.js.map → toolPermissionSettings-D6JZFF7R.js.map} +0 -0
- /package/dist/{tools-REPDA4UL.js.map → tools-YPKSRUWZ.js.map} +0 -0
- /package/dist/{userInput-IZPOKNLE.js.map → userInput-Y4QSHHCF.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-WIEHMZHA.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7SI5GFRV.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UQT43SRL.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-56F6HFV3.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-FVVMATKZ.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-RTIGJSOG.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures,
|
|
42
42
|
getSessionState
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-3C6TCPTK.js";
|
|
44
44
|
import {
|
|
45
45
|
queryLLM,
|
|
46
46
|
queryQuick,
|
|
47
47
|
verifyApiKey
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-M7TC4PYX.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-2EAKAXE7.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-7MDERGB4.js";
|
|
76
76
|
import {
|
|
77
77
|
loadToolPermissionContextFromDisk,
|
|
78
78
|
persistToolPermissionUpdateToDisk
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-N4XJF5KW.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-V5RQSF7R.js";
|
|
91
91
|
import {
|
|
92
92
|
clearAgentCache,
|
|
93
93
|
getActiveAgents,
|
|
94
94
|
getAgentByType,
|
|
95
95
|
getAllAgents
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-RPQSFP52.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-UVTCQRSO.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-7XB7B6Z4.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-IEYYJQSN.js";
|
|
168
168
|
import {
|
|
169
169
|
getSettingsFileCandidates,
|
|
170
170
|
loadSettingsWithLegacyFallback,
|
|
171
171
|
readSettingsFile
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-WEYGVSI3.js";
|
|
173
173
|
import {
|
|
174
174
|
getCustomCommandDirectories,
|
|
175
175
|
hasCustomCommands,
|
|
176
176
|
loadCustomCommands,
|
|
177
177
|
reloadCustomCommands
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-E5ITVDNO.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-7OTUXO44.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-SEYAHQLM.js";
|
|
195
195
|
import {
|
|
196
196
|
ripGrep
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-PTFRX47Q.js";
|
|
198
198
|
import {
|
|
199
199
|
getTheme
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-EV3XWHXP.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-BZP4S26C.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-QLOVB5WV.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-KHHFZVFT.js";
|
|
264
264
|
import {
|
|
265
265
|
MACRO
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-QFHNNIRB.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-VHGMLUMA.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-VHGMLUMA.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,8 +4776,11 @@ 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;
|
|
4781
|
+
var MAX_TIMEOUT_MS = 12e4;
|
|
4757
4782
|
var MAX_URL_LENGTH = 2e3;
|
|
4758
|
-
var MAX_RESPONSE_BYTES =
|
|
4783
|
+
var MAX_RESPONSE_BYTES = 5 * 1024 * 1024;
|
|
4759
4784
|
var MAX_CONTENT_CHARS = 1e5;
|
|
4760
4785
|
function formatBytes(bytes) {
|
|
4761
4786
|
if (!Number.isFinite(bytes)) return `${bytes}B`;
|
|
@@ -4779,6 +4804,25 @@ function normalizeUrl(url2) {
|
|
|
4779
4804
|
function normalizeHostname(hostname) {
|
|
4780
4805
|
return hostname.replace(/^www\./i, "").toLowerCase();
|
|
4781
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
|
+
}
|
|
4782
4826
|
function isSameHost(originalUrl, redirectUrl) {
|
|
4783
4827
|
try {
|
|
4784
4828
|
const original = new URL(originalUrl);
|
|
@@ -4791,7 +4835,7 @@ function isSameHost(originalUrl, redirectUrl) {
|
|
|
4791
4835
|
return false;
|
|
4792
4836
|
}
|
|
4793
4837
|
}
|
|
4794
|
-
function createTimeoutSignal(parent, timeoutMs) {
|
|
4838
|
+
function createTimeoutSignal(parent, timeoutMs, onTimeout) {
|
|
4795
4839
|
const controller = new AbortController();
|
|
4796
4840
|
const onAbort = () => controller.abort();
|
|
4797
4841
|
if (parent.aborted) {
|
|
@@ -4799,7 +4843,10 @@ function createTimeoutSignal(parent, timeoutMs) {
|
|
|
4799
4843
|
} else {
|
|
4800
4844
|
parent.addEventListener("abort", onAbort, { once: true });
|
|
4801
4845
|
}
|
|
4802
|
-
const timeout = setTimeout(() =>
|
|
4846
|
+
const timeout = setTimeout(() => {
|
|
4847
|
+
if (onTimeout) onTimeout();
|
|
4848
|
+
controller.abort();
|
|
4849
|
+
}, timeoutMs);
|
|
4803
4850
|
return {
|
|
4804
4851
|
signal: controller.signal,
|
|
4805
4852
|
cleanup: () => {
|
|
@@ -4808,14 +4855,27 @@ function createTimeoutSignal(parent, timeoutMs) {
|
|
|
4808
4855
|
}
|
|
4809
4856
|
};
|
|
4810
4857
|
}
|
|
4811
|
-
async function readResponseTextLimited(response, maxBytes) {
|
|
4858
|
+
async function readResponseTextLimited(response, maxBytes, signal) {
|
|
4812
4859
|
if (!response.body) return { text: "", bytes: 0 };
|
|
4813
4860
|
const reader = response.body.getReader();
|
|
4814
4861
|
const chunks = [];
|
|
4815
4862
|
let bytes = 0;
|
|
4863
|
+
const abortError = new Error("Response reading aborted");
|
|
4864
|
+
let onAbort = null;
|
|
4865
|
+
let abortPromise = null;
|
|
4866
|
+
if (signal) {
|
|
4867
|
+
if (signal.aborted) {
|
|
4868
|
+
throw abortError;
|
|
4869
|
+
}
|
|
4870
|
+
abortPromise = new Promise((_, reject) => {
|
|
4871
|
+
onAbort = () => reject(abortError);
|
|
4872
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
4873
|
+
});
|
|
4874
|
+
}
|
|
4816
4875
|
try {
|
|
4817
4876
|
while (true) {
|
|
4818
|
-
const
|
|
4877
|
+
const readPromise = reader.read();
|
|
4878
|
+
const { value, done } = abortPromise ? await Promise.race([readPromise, abortPromise]) : await readPromise;
|
|
4819
4879
|
if (done) break;
|
|
4820
4880
|
if (!value) continue;
|
|
4821
4881
|
bytes += value.byteLength;
|
|
@@ -4830,11 +4890,23 @@ async function readResponseTextLimited(response, maxBytes) {
|
|
|
4830
4890
|
}
|
|
4831
4891
|
chunks.push(value);
|
|
4832
4892
|
}
|
|
4893
|
+
} catch (error) {
|
|
4894
|
+
if (signal?.aborted) {
|
|
4895
|
+
try {
|
|
4896
|
+
await reader.cancel();
|
|
4897
|
+
} catch {
|
|
4898
|
+
}
|
|
4899
|
+
throw abortError;
|
|
4900
|
+
}
|
|
4901
|
+
throw error;
|
|
4833
4902
|
} finally {
|
|
4834
4903
|
try {
|
|
4835
4904
|
reader.releaseLock();
|
|
4836
4905
|
} catch {
|
|
4837
4906
|
}
|
|
4907
|
+
if (signal && onAbort) {
|
|
4908
|
+
signal.removeEventListener("abort", onAbort);
|
|
4909
|
+
}
|
|
4838
4910
|
}
|
|
4839
4911
|
const buffer = Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));
|
|
4840
4912
|
return { text: buffer.toString("utf-8"), bytes };
|
|
@@ -4895,23 +4967,37 @@ ${allowBroaderQuoting ? "Provide a concise response based on the content above.
|
|
|
4895
4967
|
- Never produce or reproduce exact song lyrics.`}
|
|
4896
4968
|
`;
|
|
4897
4969
|
}
|
|
4898
|
-
async function fetchWithRedirectDetection(url2, signal) {
|
|
4970
|
+
async function fetchWithRedirectDetection(url2, signal, connectTimeoutMs) {
|
|
4899
4971
|
let current = url2;
|
|
4900
4972
|
for (let i = 0; i < 10; i++) {
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
"User-Agent": "Mozilla/5.0 (compatible; WebFetch/1.0)",
|
|
4905
|
-
Accept: "text/markdown, text/html, */*",
|
|
4906
|
-
"Accept-Language": "en-US,en;q=0.5"
|
|
4907
|
-
},
|
|
4908
|
-
signal,
|
|
4909
|
-
redirect: "manual"
|
|
4973
|
+
let connectTimeoutTriggered2 = false;
|
|
4974
|
+
const connectTimeout2 = createTimeoutSignal(signal, connectTimeoutMs, () => {
|
|
4975
|
+
connectTimeoutTriggered2 = true;
|
|
4910
4976
|
});
|
|
4911
|
-
|
|
4912
|
-
|
|
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");
|
|
4913
4999
|
if (!location) {
|
|
4914
|
-
return { type: "response", response
|
|
5000
|
+
return { type: "response", response, finalUrl: current };
|
|
4915
5001
|
}
|
|
4916
5002
|
const redirectUrl = new URL(location, current).toString();
|
|
4917
5003
|
if (isSameHost(current, redirectUrl)) {
|
|
@@ -4922,13 +5008,26 @@ async function fetchWithRedirectDetection(url2, signal) {
|
|
|
4922
5008
|
type: "redirect",
|
|
4923
5009
|
originalUrl: url2,
|
|
4924
5010
|
redirectUrl,
|
|
4925
|
-
statusCode:
|
|
5011
|
+
statusCode: response.status
|
|
4926
5012
|
};
|
|
4927
5013
|
}
|
|
4928
|
-
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();
|
|
4929
5030
|
}
|
|
4930
|
-
const response = await fetch(current, { signal });
|
|
4931
|
-
return { type: "response", response, finalUrl: current };
|
|
4932
5031
|
}
|
|
4933
5032
|
var WebFetchTool = {
|
|
4934
5033
|
name: TOOL_NAME_FOR_PROMPT,
|
|
@@ -5003,13 +5102,25 @@ ${output.result}`;
|
|
|
5003
5102
|
async *call({ url: url2, prompt, format: format3, timeout }, context) {
|
|
5004
5103
|
const normalizedUrl = normalizeUrl(url2);
|
|
5005
5104
|
const start = Date.now();
|
|
5105
|
+
const timeoutSeconds = Math.min(
|
|
5106
|
+
Math.max(
|
|
5107
|
+
1,
|
|
5108
|
+
Number.isFinite(timeout) ? Number(timeout) : FETCH_TIMEOUT_MS / 1e3
|
|
5109
|
+
),
|
|
5110
|
+
MAX_TIMEOUT_MS / 1e3
|
|
5111
|
+
);
|
|
5006
5112
|
const timeoutSignal = createTimeoutSignal(
|
|
5007
5113
|
context.abortController.signal,
|
|
5008
|
-
|
|
5114
|
+
timeoutSeconds * 1e3
|
|
5009
5115
|
);
|
|
5116
|
+
const connectTimeoutMs = Math.min(CONNECT_TIMEOUT_MS, timeoutSeconds * 1e3);
|
|
5010
5117
|
try {
|
|
5011
5118
|
const cached = urlCache.get(normalizedUrl);
|
|
5012
|
-
const fetched = cached ? null : await fetchWithRedirectDetection(
|
|
5119
|
+
const fetched = cached ? null : await fetchWithRedirectDetection(
|
|
5120
|
+
normalizedUrl,
|
|
5121
|
+
timeoutSignal.signal,
|
|
5122
|
+
connectTimeoutMs
|
|
5123
|
+
);
|
|
5013
5124
|
if (fetched && fetched.type === "redirect") {
|
|
5014
5125
|
const codeText2 = fetched.statusCode === 301 ? "Moved Permanently" : fetched.statusCode === 308 ? "Permanent Redirect" : fetched.statusCode === 307 ? "Temporary Redirect" : "Found";
|
|
5015
5126
|
const result2 = `REDIRECT DETECTED: The URL redirects to a different host.
|
|
@@ -5049,7 +5160,11 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5049
5160
|
code = response.status;
|
|
5050
5161
|
codeText = response.statusText || "OK";
|
|
5051
5162
|
contentType = response.headers.get("content-type") || "";
|
|
5052
|
-
const { text: raw, bytes: responseBytes } = await readResponseTextLimited(
|
|
5163
|
+
const { text: raw, bytes: responseBytes } = await readResponseTextLimited(
|
|
5164
|
+
response,
|
|
5165
|
+
MAX_RESPONSE_BYTES,
|
|
5166
|
+
timeoutSignal.signal
|
|
5167
|
+
);
|
|
5053
5168
|
bytes = responseBytes;
|
|
5054
5169
|
rawContent = raw;
|
|
5055
5170
|
urlCache.set(normalizedUrl, {
|
|
@@ -5073,14 +5188,41 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5073
5188
|
prompt,
|
|
5074
5189
|
allowBroaderQuoting
|
|
5075
5190
|
);
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
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
|
+
}
|
|
5084
5226
|
}
|
|
5085
5227
|
const output = {
|
|
5086
5228
|
bytes,
|
|
@@ -5123,8 +5265,8 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5123
5265
|
};
|
|
5124
5266
|
|
|
5125
5267
|
// src/ui/components/permissions/web-fetch-permission-request/WebFetchPermissionRequest.tsx
|
|
5126
|
-
import { Box as
|
|
5127
|
-
import
|
|
5268
|
+
import { Box as Box81, Text as Text85, useInput as useInput31 } from "ink";
|
|
5269
|
+
import React110, { useMemo as useMemo28 } from "react";
|
|
5128
5270
|
import chalk16 from "chalk";
|
|
5129
5271
|
|
|
5130
5272
|
// src/ui/components/custom-select/select.tsx
|
|
@@ -6501,7 +6643,7 @@ var FileEditTool = {
|
|
|
6501
6643
|
const originalFileContent = currentFileContent;
|
|
6502
6644
|
let totalPatch = [];
|
|
6503
6645
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6504
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6646
|
+
const { findLspAnchor } = await import("./lspAnchor-Z763O5JV.js");
|
|
6505
6647
|
for (const op of editOperations) {
|
|
6506
6648
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6507
6649
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -8767,7 +8909,7 @@ var WebSearchTool = {
|
|
|
8767
8909
|
|
|
8768
8910
|
// src/tools/interaction/SlashCommandTool/SlashCommandTool.tsx
|
|
8769
8911
|
import { z as z13 } from "zod";
|
|
8770
|
-
import * as
|
|
8912
|
+
import * as React108 from "react";
|
|
8771
8913
|
|
|
8772
8914
|
// src/ui/components/Bug.tsx
|
|
8773
8915
|
import { Box as Box17, Text as Text19, useInput as useInput5 } from "ink";
|
|
@@ -11136,7 +11278,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11136
11278
|
}
|
|
11137
11279
|
saveGlobalConfig(config2);
|
|
11138
11280
|
try {
|
|
11139
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11281
|
+
const { resetAnthropicClient } = await import("./llm-VHGMLUMA.js");
|
|
11140
11282
|
resetAnthropicClient();
|
|
11141
11283
|
} catch {
|
|
11142
11284
|
}
|
|
@@ -15503,7 +15645,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15503
15645
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15504
15646
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15505
15647
|
if (dirs.length === 0) return [];
|
|
15506
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15648
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-ZIW6JAIM.js");
|
|
15507
15649
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15508
15650
|
return errors;
|
|
15509
15651
|
}
|
|
@@ -16172,7 +16314,7 @@ async function call(onDone, context) {
|
|
|
16172
16314
|
ModelConfig,
|
|
16173
16315
|
{
|
|
16174
16316
|
onClose: () => {
|
|
16175
|
-
import("./model-
|
|
16317
|
+
import("./model-6SZVFU73.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
16176
16318
|
reloadModelManager2();
|
|
16177
16319
|
triggerModelConfigChange();
|
|
16178
16320
|
onDone();
|
|
@@ -17306,14 +17448,14 @@ async function call2(onDone, context) {
|
|
|
17306
17448
|
}
|
|
17307
17449
|
|
|
17308
17450
|
// src/commands/resume.tsx
|
|
17309
|
-
import * as
|
|
17451
|
+
import * as React105 from "react";
|
|
17310
17452
|
|
|
17311
17453
|
// src/ui/screens/ResumeConversation.tsx
|
|
17312
|
-
import
|
|
17454
|
+
import React104 from "react";
|
|
17313
17455
|
import { render } from "ink";
|
|
17314
17456
|
|
|
17315
17457
|
// src/ui/screens/REPL.tsx
|
|
17316
|
-
import { Box as
|
|
17458
|
+
import { Box as Box77, Newline as Newline4, Static as Static2 } from "ink";
|
|
17317
17459
|
|
|
17318
17460
|
// src/ui/components/CostThresholdDialog.tsx
|
|
17319
17461
|
import { Box as Box37, Text as Text42, useInput as useInput17 } from "ink";
|
|
@@ -17366,7 +17508,7 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17366
17508
|
}
|
|
17367
17509
|
|
|
17368
17510
|
// src/ui/screens/REPL.tsx
|
|
17369
|
-
import * as
|
|
17511
|
+
import * as React102 from "react";
|
|
17370
17512
|
import { useEffect as useEffect26, useMemo as useMemo26, useRef as useRef13, useState as useState28, useCallback as useCallback16 } from "react";
|
|
17371
17513
|
|
|
17372
17514
|
// src/ui/components/Message.tsx
|
|
@@ -19620,15 +19762,29 @@ function TaskPanel({
|
|
|
19620
19762
|
}), hidden.length > 0 ? /* @__PURE__ */ React74.createElement(Text59, null, "\u2026 +", hiddenPending > 0 ? hiddenPending : hidden.length, " pending") : null);
|
|
19621
19763
|
}
|
|
19622
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
|
+
|
|
19623
19779
|
// src/ui/components/permissions/PermissionRequest.tsx
|
|
19624
19780
|
import { useInput as useInput25 } from "ink";
|
|
19625
|
-
import * as
|
|
19781
|
+
import * as React93 from "react";
|
|
19626
19782
|
|
|
19627
19783
|
// src/ui/components/permissions/file-edit-permission-request/FileEditPermissionRequest.tsx
|
|
19628
19784
|
import chalk7 from "chalk";
|
|
19629
|
-
import { Box as
|
|
19785
|
+
import { Box as Box58, Text as Text63, useInput as useInput19 } from "ink";
|
|
19630
19786
|
import { basename, dirname as dirname5, extname as extname6 } from "path";
|
|
19631
|
-
import
|
|
19787
|
+
import React78, { useCallback as useCallback8, useMemo as useMemo15 } from "react";
|
|
19632
19788
|
|
|
19633
19789
|
// src/ui/hooks/usePermissionRequestLogging.ts
|
|
19634
19790
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -19656,8 +19812,8 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) {
|
|
|
19656
19812
|
}
|
|
19657
19813
|
|
|
19658
19814
|
// src/ui/components/permissions/PermissionRequestTitle.tsx
|
|
19659
|
-
import * as
|
|
19660
|
-
import { Box as
|
|
19815
|
+
import * as React76 from "react";
|
|
19816
|
+
import { Box as Box56, Text as Text61 } from "ink";
|
|
19661
19817
|
function categoryForRiskScore(riskScore) {
|
|
19662
19818
|
return riskScore >= 70 ? "high" : riskScore >= 30 ? "moderate" : "low";
|
|
19663
19819
|
}
|
|
@@ -19692,20 +19848,20 @@ function PermissionRiskScore({
|
|
|
19692
19848
|
riskScore
|
|
19693
19849
|
}) {
|
|
19694
19850
|
const category = categoryForRiskScore(riskScore);
|
|
19695
|
-
return /* @__PURE__ */
|
|
19851
|
+
return /* @__PURE__ */ React76.createElement(Text61, { color: textColorForRiskScore(riskScore) }, "Risk: ", category);
|
|
19696
19852
|
}
|
|
19697
19853
|
function PermissionRequestTitle({
|
|
19698
19854
|
title,
|
|
19699
19855
|
riskScore
|
|
19700
19856
|
}) {
|
|
19701
|
-
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 }));
|
|
19702
19858
|
}
|
|
19703
19859
|
|
|
19704
19860
|
// src/ui/components/permissions/file-edit-permission-request/FileEditToolDiff.tsx
|
|
19705
|
-
import * as
|
|
19861
|
+
import * as React77 from "react";
|
|
19706
19862
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
19707
19863
|
import { useMemo as useMemo14 } from "react";
|
|
19708
|
-
import { Box as
|
|
19864
|
+
import { Box as Box57, Text as Text62 } from "ink";
|
|
19709
19865
|
import { relative as relative10 } from "path";
|
|
19710
19866
|
function FileEditToolDiff({
|
|
19711
19867
|
file_path,
|
|
@@ -19728,17 +19884,17 @@ function FileEditToolDiff({
|
|
|
19728
19884
|
}),
|
|
19729
19885
|
[file_path, file, old_string, new_string]
|
|
19730
19886
|
);
|
|
19731
|
-
return /* @__PURE__ */
|
|
19732
|
-
|
|
19887
|
+
return /* @__PURE__ */ React77.createElement(Box57, { flexDirection: "column" }, /* @__PURE__ */ React77.createElement(
|
|
19888
|
+
Box57,
|
|
19733
19889
|
{
|
|
19734
19890
|
borderColor: getTheme().secondaryBorder,
|
|
19735
19891
|
borderStyle: useBorder ? "round" : void 0,
|
|
19736
19892
|
flexDirection: "column",
|
|
19737
19893
|
paddingX: 1
|
|
19738
19894
|
},
|
|
19739
|
-
/* @__PURE__ */
|
|
19895
|
+
/* @__PURE__ */ React77.createElement(Box57, { paddingBottom: 1 }, /* @__PURE__ */ React77.createElement(Text62, { bold: true }, verbose ? file_path : relative10(getCwd(), file_path))),
|
|
19740
19896
|
intersperse(
|
|
19741
|
-
patch.map((_) => /* @__PURE__ */
|
|
19897
|
+
patch.map((_) => /* @__PURE__ */ React77.createElement(
|
|
19742
19898
|
StructuredDiff,
|
|
19743
19899
|
{
|
|
19744
19900
|
key: _.newStart,
|
|
@@ -19747,7 +19903,7 @@ function FileEditToolDiff({
|
|
|
19747
19903
|
width
|
|
19748
19904
|
}
|
|
19749
19905
|
)),
|
|
19750
|
-
(i) => /* @__PURE__ */
|
|
19906
|
+
(i) => /* @__PURE__ */ React77.createElement(React77.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React77.createElement(Text62, { color: getTheme().secondaryText }, "..."))
|
|
19751
19907
|
)
|
|
19752
19908
|
));
|
|
19753
19909
|
}
|
|
@@ -19929,8 +20085,8 @@ function FileEditPermissionRequest({
|
|
|
19929
20085
|
handleChoice("yes-session");
|
|
19930
20086
|
return true;
|
|
19931
20087
|
});
|
|
19932
|
-
return /* @__PURE__ */
|
|
19933
|
-
|
|
20088
|
+
return /* @__PURE__ */ React78.createElement(
|
|
20089
|
+
Box58,
|
|
19934
20090
|
{
|
|
19935
20091
|
flexDirection: "column",
|
|
19936
20092
|
borderStyle: "round",
|
|
@@ -19940,14 +20096,14 @@ function FileEditPermissionRequest({
|
|
|
19940
20096
|
paddingRight: 1,
|
|
19941
20097
|
paddingBottom: 1
|
|
19942
20098
|
},
|
|
19943
|
-
/* @__PURE__ */
|
|
20099
|
+
/* @__PURE__ */ React78.createElement(
|
|
19944
20100
|
PermissionRequestTitle,
|
|
19945
20101
|
{
|
|
19946
20102
|
title: "Edit file",
|
|
19947
20103
|
riskScore: toolUseConfirm.riskScore
|
|
19948
20104
|
}
|
|
19949
20105
|
),
|
|
19950
|
-
/* @__PURE__ */
|
|
20106
|
+
/* @__PURE__ */ React78.createElement(
|
|
19951
20107
|
FileEditToolDiff,
|
|
19952
20108
|
{
|
|
19953
20109
|
file_path,
|
|
@@ -19957,7 +20113,7 @@ function FileEditPermissionRequest({
|
|
|
19957
20113
|
width: columns - 12
|
|
19958
20114
|
}
|
|
19959
20115
|
),
|
|
19960
|
-
/* @__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(
|
|
19961
20117
|
Select,
|
|
19962
20118
|
{
|
|
19963
20119
|
options: getOptions({
|
|
@@ -19981,8 +20137,8 @@ async function extractLanguageName(file_path) {
|
|
|
19981
20137
|
}
|
|
19982
20138
|
|
|
19983
20139
|
// src/ui/components/permissions/bash-permission-request/BashPermissionRequest.tsx
|
|
19984
|
-
import { Box as
|
|
19985
|
-
import
|
|
20140
|
+
import { Box as Box59, Text as Text64 } from "ink";
|
|
20141
|
+
import React79, { useMemo as useMemo16 } from "react";
|
|
19986
20142
|
|
|
19987
20143
|
// src/ui/components/permissions/hooks.ts
|
|
19988
20144
|
import { useEffect as useEffect18 } from "react";
|
|
@@ -20087,8 +20243,8 @@ function BashPermissionRequest({
|
|
|
20087
20243
|
[]
|
|
20088
20244
|
);
|
|
20089
20245
|
usePermissionRequestLogging2(toolUseConfirm, unaryEvent);
|
|
20090
|
-
return /* @__PURE__ */
|
|
20091
|
-
|
|
20246
|
+
return /* @__PURE__ */ React79.createElement(
|
|
20247
|
+
Box59,
|
|
20092
20248
|
{
|
|
20093
20249
|
flexDirection: "column",
|
|
20094
20250
|
borderStyle: "round",
|
|
@@ -20098,19 +20254,19 @@ function BashPermissionRequest({
|
|
|
20098
20254
|
paddingRight: 1,
|
|
20099
20255
|
paddingBottom: 1
|
|
20100
20256
|
},
|
|
20101
|
-
/* @__PURE__ */
|
|
20257
|
+
/* @__PURE__ */ React79.createElement(
|
|
20102
20258
|
PermissionRequestTitle,
|
|
20103
20259
|
{
|
|
20104
20260
|
title: "Bash command",
|
|
20105
20261
|
riskScore: toolUseConfirm.riskScore
|
|
20106
20262
|
}
|
|
20107
20263
|
),
|
|
20108
|
-
/* @__PURE__ */
|
|
20264
|
+
/* @__PURE__ */ React79.createElement(Box59, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React79.createElement(Text64, null, BashTool.renderToolUseMessage({
|
|
20109
20265
|
command: command4,
|
|
20110
20266
|
run_in_background,
|
|
20111
20267
|
description: description3
|
|
20112
|
-
})), /* @__PURE__ */
|
|
20113
|
-
/* @__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(
|
|
20114
20270
|
Select,
|
|
20115
20271
|
{
|
|
20116
20272
|
options: toolUseOptions({ toolUseConfirm, command: command4 }),
|
|
@@ -20178,8 +20334,8 @@ function BashPermissionRequest({
|
|
|
20178
20334
|
}
|
|
20179
20335
|
|
|
20180
20336
|
// src/ui/components/permissions/FallbackPermissionRequest.tsx
|
|
20181
|
-
import { Box as
|
|
20182
|
-
import
|
|
20337
|
+
import { Box as Box60, Text as Text65 } from "ink";
|
|
20338
|
+
import React80, { useMemo as useMemo17 } from "react";
|
|
20183
20339
|
import chalk9 from "chalk";
|
|
20184
20340
|
function __getFallbackPermissionInputForTests(tool, input) {
|
|
20185
20341
|
return tool === WebSearchTool ? { query: "" } : input;
|
|
@@ -20200,8 +20356,8 @@ function FallbackPermissionRequest({
|
|
|
20200
20356
|
[]
|
|
20201
20357
|
);
|
|
20202
20358
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
20203
|
-
return /* @__PURE__ */
|
|
20204
|
-
|
|
20359
|
+
return /* @__PURE__ */ React80.createElement(
|
|
20360
|
+
Box60,
|
|
20205
20361
|
{
|
|
20206
20362
|
flexDirection: "column",
|
|
20207
20363
|
borderStyle: "round",
|
|
@@ -20211,18 +20367,18 @@ function FallbackPermissionRequest({
|
|
|
20211
20367
|
paddingRight: 1,
|
|
20212
20368
|
paddingBottom: 1
|
|
20213
20369
|
},
|
|
20214
|
-
/* @__PURE__ */
|
|
20370
|
+
/* @__PURE__ */ React80.createElement(
|
|
20215
20371
|
PermissionRequestTitle,
|
|
20216
20372
|
{
|
|
20217
20373
|
title: "Tool use",
|
|
20218
20374
|
riskScore: toolUseConfirm.riskScore
|
|
20219
20375
|
}
|
|
20220
20376
|
),
|
|
20221
|
-
/* @__PURE__ */
|
|
20377
|
+
/* @__PURE__ */ React80.createElement(Box60, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React80.createElement(Text65, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20222
20378
|
toolUseConfirm.input,
|
|
20223
20379
|
{ verbose }
|
|
20224
|
-
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */
|
|
20225
|
-
/* @__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(
|
|
20226
20382
|
Select,
|
|
20227
20383
|
{
|
|
20228
20384
|
options: [
|
|
@@ -20338,17 +20494,17 @@ function useNotifyAfterTimeout(message, timeout = DEFAULT_INTERACTION_THRESHOLD_
|
|
|
20338
20494
|
}
|
|
20339
20495
|
|
|
20340
20496
|
// src/ui/components/permissions/file-write-permission-request/FileWritePermissionRequest.tsx
|
|
20341
|
-
import { Box as
|
|
20342
|
-
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";
|
|
20343
20499
|
import { basename as basename2, dirname as dirname6, extname as extname8 } from "path";
|
|
20344
20500
|
import { existsSync as existsSync12 } from "fs";
|
|
20345
20501
|
import chalk10 from "chalk";
|
|
20346
20502
|
|
|
20347
20503
|
// src/ui/components/permissions/file-write-permission-request/FileWriteToolDiff.tsx
|
|
20348
|
-
import * as
|
|
20504
|
+
import * as React81 from "react";
|
|
20349
20505
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "fs";
|
|
20350
20506
|
import { useMemo as useMemo18 } from "react";
|
|
20351
|
-
import { Box as
|
|
20507
|
+
import { Box as Box61, Text as Text66 } from "ink";
|
|
20352
20508
|
import { extname as extname7, relative as relative11 } from "path";
|
|
20353
20509
|
function FileWriteToolDiff({
|
|
20354
20510
|
file_path,
|
|
@@ -20375,17 +20531,17 @@ function FileWriteToolDiff({
|
|
|
20375
20531
|
newStr: content
|
|
20376
20532
|
});
|
|
20377
20533
|
}, [fileExists, file_path, oldContent, content]);
|
|
20378
|
-
return /* @__PURE__ */
|
|
20379
|
-
|
|
20534
|
+
return /* @__PURE__ */ React81.createElement(
|
|
20535
|
+
Box61,
|
|
20380
20536
|
{
|
|
20381
20537
|
borderColor: getTheme().secondaryBorder,
|
|
20382
20538
|
borderStyle: "round",
|
|
20383
20539
|
flexDirection: "column",
|
|
20384
20540
|
paddingX: 1
|
|
20385
20541
|
},
|
|
20386
|
-
/* @__PURE__ */
|
|
20542
|
+
/* @__PURE__ */ React81.createElement(Box61, { paddingBottom: 1 }, /* @__PURE__ */ React81.createElement(Text66, { bold: true }, verbose ? file_path : relative11(getCwd(), file_path))),
|
|
20387
20543
|
hunks ? intersperse(
|
|
20388
|
-
hunks.map((_) => /* @__PURE__ */
|
|
20544
|
+
hunks.map((_) => /* @__PURE__ */ React81.createElement(
|
|
20389
20545
|
StructuredDiff,
|
|
20390
20546
|
{
|
|
20391
20547
|
key: _.newStart,
|
|
@@ -20394,8 +20550,8 @@ function FileWriteToolDiff({
|
|
|
20394
20550
|
width
|
|
20395
20551
|
}
|
|
20396
20552
|
)),
|
|
20397
|
-
(i) => /* @__PURE__ */
|
|
20398
|
-
) : /* @__PURE__ */
|
|
20553
|
+
(i) => /* @__PURE__ */ React81.createElement(React81.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React81.createElement(Text66, { color: getTheme().secondaryText }, "..."))
|
|
20554
|
+
) : /* @__PURE__ */ React81.createElement(
|
|
20399
20555
|
HighlightedCode,
|
|
20400
20556
|
{
|
|
20401
20557
|
code: content || "(No content)",
|
|
@@ -20530,8 +20686,8 @@ function FileWritePermissionRequest({
|
|
|
20530
20686
|
handleChoice("yes-session");
|
|
20531
20687
|
return true;
|
|
20532
20688
|
});
|
|
20533
|
-
return /* @__PURE__ */
|
|
20534
|
-
|
|
20689
|
+
return /* @__PURE__ */ React82.createElement(
|
|
20690
|
+
Box62,
|
|
20535
20691
|
{
|
|
20536
20692
|
flexDirection: "column",
|
|
20537
20693
|
borderStyle: "round",
|
|
@@ -20541,14 +20697,14 @@ function FileWritePermissionRequest({
|
|
|
20541
20697
|
paddingRight: 1,
|
|
20542
20698
|
paddingBottom: 1
|
|
20543
20699
|
},
|
|
20544
|
-
/* @__PURE__ */
|
|
20700
|
+
/* @__PURE__ */ React82.createElement(
|
|
20545
20701
|
PermissionRequestTitle,
|
|
20546
20702
|
{
|
|
20547
20703
|
title: `${fileExists ? "Edit" : "Create"} file`,
|
|
20548
20704
|
riskScore: toolUseConfirm.riskScore
|
|
20549
20705
|
}
|
|
20550
20706
|
),
|
|
20551
|
-
/* @__PURE__ */
|
|
20707
|
+
/* @__PURE__ */ React82.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(
|
|
20552
20708
|
FileWriteToolDiff,
|
|
20553
20709
|
{
|
|
20554
20710
|
file_path,
|
|
@@ -20557,7 +20713,7 @@ function FileWritePermissionRequest({
|
|
|
20557
20713
|
width: columns - 12
|
|
20558
20714
|
}
|
|
20559
20715
|
)),
|
|
20560
|
-
/* @__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(
|
|
20561
20717
|
Select,
|
|
20562
20718
|
{
|
|
20563
20719
|
options: [
|
|
@@ -20591,8 +20747,8 @@ async function extractLanguageName2(file_path) {
|
|
|
20591
20747
|
}
|
|
20592
20748
|
|
|
20593
20749
|
// src/ui/components/permissions/filesystem-permission-request/FilesystemPermissionRequest.tsx
|
|
20594
|
-
import { Box as
|
|
20595
|
-
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";
|
|
20596
20752
|
import chalk11 from "chalk";
|
|
20597
20753
|
import { basename as basename3, dirname as dirname7 } from "path";
|
|
20598
20754
|
import { statSync as statSync10 } from "fs";
|
|
@@ -20649,7 +20805,7 @@ function FilesystemPermissionRequest({
|
|
|
20649
20805
|
}) {
|
|
20650
20806
|
const path5 = pathFromToolUse(toolUseConfirm);
|
|
20651
20807
|
if (!path5) {
|
|
20652
|
-
return /* @__PURE__ */
|
|
20808
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20653
20809
|
FallbackPermissionRequest,
|
|
20654
20810
|
{
|
|
20655
20811
|
toolUseConfirm,
|
|
@@ -20658,7 +20814,7 @@ function FilesystemPermissionRequest({
|
|
|
20658
20814
|
}
|
|
20659
20815
|
);
|
|
20660
20816
|
}
|
|
20661
|
-
return /* @__PURE__ */
|
|
20817
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20662
20818
|
FilesystemPermissionRequestImpl,
|
|
20663
20819
|
{
|
|
20664
20820
|
toolUseConfirm,
|
|
@@ -20800,8 +20956,8 @@ function FilesystemPermissionRequestImpl({
|
|
|
20800
20956
|
handleChoice("yes-session");
|
|
20801
20957
|
return true;
|
|
20802
20958
|
});
|
|
20803
|
-
return /* @__PURE__ */
|
|
20804
|
-
|
|
20959
|
+
return /* @__PURE__ */ React83.createElement(
|
|
20960
|
+
Box63,
|
|
20805
20961
|
{
|
|
20806
20962
|
flexDirection: "column",
|
|
20807
20963
|
borderStyle: "round",
|
|
@@ -20811,18 +20967,18 @@ function FilesystemPermissionRequestImpl({
|
|
|
20811
20967
|
paddingRight: 1,
|
|
20812
20968
|
paddingBottom: 1
|
|
20813
20969
|
},
|
|
20814
|
-
/* @__PURE__ */
|
|
20970
|
+
/* @__PURE__ */ React83.createElement(
|
|
20815
20971
|
PermissionRequestTitle,
|
|
20816
20972
|
{
|
|
20817
20973
|
title,
|
|
20818
20974
|
riskScore: toolUseConfirm.riskScore
|
|
20819
20975
|
}
|
|
20820
20976
|
),
|
|
20821
|
-
/* @__PURE__ */
|
|
20977
|
+
/* @__PURE__ */ React83.createElement(Box63, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React83.createElement(Text68, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20822
20978
|
toolUseConfirm.input,
|
|
20823
20979
|
{ verbose }
|
|
20824
20980
|
), ")")),
|
|
20825
|
-
/* @__PURE__ */
|
|
20981
|
+
/* @__PURE__ */ React83.createElement(Box63, { flexDirection: "column" }, /* @__PURE__ */ React83.createElement(Text68, null, "Do you want to proceed?"), /* @__PURE__ */ React83.createElement(
|
|
20826
20982
|
Select,
|
|
20827
20983
|
{
|
|
20828
20984
|
options: [
|
|
@@ -20850,7 +21006,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
20850
21006
|
|
|
20851
21007
|
// src/tools/ai/SkillTool/SkillTool.tsx
|
|
20852
21008
|
import { z as z9 } from "zod";
|
|
20853
|
-
import * as
|
|
21009
|
+
import * as React84 from "react";
|
|
20854
21010
|
|
|
20855
21011
|
// src/tools/ai/SkillTool/prompt.ts
|
|
20856
21012
|
var TOOL_NAME_FOR_PROMPT5 = "Skill";
|
|
@@ -20947,7 +21103,7 @@ ${availableSkills}${truncatedNotice}
|
|
|
20947
21103
|
return skill || "";
|
|
20948
21104
|
},
|
|
20949
21105
|
renderToolUseRejectedMessage() {
|
|
20950
|
-
return /* @__PURE__ */
|
|
21106
|
+
return /* @__PURE__ */ React84.createElement(FallbackToolUseRejectedMessage, null);
|
|
20951
21107
|
},
|
|
20952
21108
|
renderResultForAssistant(output) {
|
|
20953
21109
|
return `Launching skill: ${output.commandName}`;
|
|
@@ -21082,8 +21238,8 @@ function findCommand(commandName, commands) {
|
|
|
21082
21238
|
}
|
|
21083
21239
|
|
|
21084
21240
|
// src/ui/components/permissions/slash-command-permission-request/SlashCommandPermissionRequest.tsx
|
|
21085
|
-
import { Box as
|
|
21086
|
-
import
|
|
21241
|
+
import { Box as Box64, Text as Text69 } from "ink";
|
|
21242
|
+
import React85, { useMemo as useMemo21 } from "react";
|
|
21087
21243
|
import chalk12 from "chalk";
|
|
21088
21244
|
function parsePrefix(command4) {
|
|
21089
21245
|
const trimmed = command4.trim();
|
|
@@ -21108,8 +21264,8 @@ function SlashCommandPermissionRequest({
|
|
|
21108
21264
|
const command4 = typeof toolUseConfirm.input.command === "string" ? toolUseConfirm.input.command : "";
|
|
21109
21265
|
const prefix = parsePrefix(command4);
|
|
21110
21266
|
const showPrefixOption = !!prefix && hasArgs(command4);
|
|
21111
|
-
return /* @__PURE__ */
|
|
21112
|
-
|
|
21267
|
+
return /* @__PURE__ */ React85.createElement(
|
|
21268
|
+
Box64,
|
|
21113
21269
|
{
|
|
21114
21270
|
flexDirection: "column",
|
|
21115
21271
|
borderStyle: "round",
|
|
@@ -21119,14 +21275,14 @@ function SlashCommandPermissionRequest({
|
|
|
21119
21275
|
paddingRight: 1,
|
|
21120
21276
|
paddingBottom: 1
|
|
21121
21277
|
},
|
|
21122
|
-
/* @__PURE__ */
|
|
21123
|
-
/* @__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(
|
|
21124
21280
|
toolUseConfirm.input,
|
|
21125
21281
|
{
|
|
21126
21282
|
verbose
|
|
21127
21283
|
}
|
|
21128
|
-
), ")"), /* @__PURE__ */
|
|
21129
|
-
/* @__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(
|
|
21130
21286
|
Select,
|
|
21131
21287
|
{
|
|
21132
21288
|
options: [
|
|
@@ -21227,8 +21383,8 @@ function SlashCommandPermissionRequest({
|
|
|
21227
21383
|
}
|
|
21228
21384
|
|
|
21229
21385
|
// src/ui/components/permissions/skill-permission-request/SkillPermissionRequest.tsx
|
|
21230
|
-
import { Box as
|
|
21231
|
-
import
|
|
21386
|
+
import { Box as Box65, Text as Text70 } from "ink";
|
|
21387
|
+
import React86, { useMemo as useMemo22 } from "react";
|
|
21232
21388
|
import chalk13 from "chalk";
|
|
21233
21389
|
function SkillPermissionRequest({
|
|
21234
21390
|
toolUseConfirm,
|
|
@@ -21243,8 +21399,8 @@ function SkillPermissionRequest({
|
|
|
21243
21399
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
21244
21400
|
const raw = typeof toolUseConfirm.input.skill === "string" ? toolUseConfirm.input.skill : "";
|
|
21245
21401
|
const skill = raw.trim().replace(/^\//, "");
|
|
21246
|
-
return /* @__PURE__ */
|
|
21247
|
-
|
|
21402
|
+
return /* @__PURE__ */ React86.createElement(
|
|
21403
|
+
Box65,
|
|
21248
21404
|
{
|
|
21249
21405
|
flexDirection: "column",
|
|
21250
21406
|
borderStyle: "round",
|
|
@@ -21254,14 +21410,14 @@ function SkillPermissionRequest({
|
|
|
21254
21410
|
paddingRight: 1,
|
|
21255
21411
|
paddingBottom: 1
|
|
21256
21412
|
},
|
|
21257
|
-
/* @__PURE__ */
|
|
21258
|
-
/* @__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(
|
|
21259
21415
|
toolUseConfirm.input,
|
|
21260
21416
|
{
|
|
21261
21417
|
verbose
|
|
21262
21418
|
}
|
|
21263
|
-
), ")"), /* @__PURE__ */
|
|
21264
|
-
/* @__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(
|
|
21265
21421
|
Select,
|
|
21266
21422
|
{
|
|
21267
21423
|
options: [
|
|
@@ -21331,8 +21487,8 @@ function SkillPermissionRequest({
|
|
|
21331
21487
|
}
|
|
21332
21488
|
|
|
21333
21489
|
// src/tools/agent/PlanModeTool/EnterPlanModeTool.tsx
|
|
21334
|
-
import { Box as
|
|
21335
|
-
import
|
|
21490
|
+
import { Box as Box66, Text as Text71 } from "ink";
|
|
21491
|
+
import React87 from "react";
|
|
21336
21492
|
import { z as z10 } from "zod";
|
|
21337
21493
|
|
|
21338
21494
|
// src/tools/agent/PlanModeTool/prompt.ts
|
|
@@ -21484,11 +21640,11 @@ var EnterPlanModeTool = {
|
|
|
21484
21640
|
},
|
|
21485
21641
|
renderToolUseRejectedMessage() {
|
|
21486
21642
|
const theme = getTheme();
|
|
21487
|
-
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"));
|
|
21488
21644
|
},
|
|
21489
21645
|
renderToolResultMessage(_output) {
|
|
21490
21646
|
const theme = getTheme();
|
|
21491
|
-
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.")));
|
|
21492
21648
|
},
|
|
21493
21649
|
renderResultForAssistant(output) {
|
|
21494
21650
|
return `${output.message}
|
|
@@ -21521,8 +21677,8 @@ Remember: DO NOT write or edit any files yet. This is a read-only exploration an
|
|
|
21521
21677
|
};
|
|
21522
21678
|
|
|
21523
21679
|
// src/tools/agent/PlanModeTool/ExitPlanModeTool.tsx
|
|
21524
|
-
import { Box as
|
|
21525
|
-
import
|
|
21680
|
+
import { Box as Box67, Text as Text72 } from "ink";
|
|
21681
|
+
import React88 from "react";
|
|
21526
21682
|
import { z as z11 } from "zod";
|
|
21527
21683
|
function getExitPlanModePlanText(conversationKey) {
|
|
21528
21684
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
@@ -21567,8 +21723,8 @@ var ExitPlanModeTool = {
|
|
|
21567
21723
|
const conversationKey = typeof options.conversationKey === "string" && options.conversationKey.trim() ? options.conversationKey.trim() : void 0;
|
|
21568
21724
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
21569
21725
|
const plan = getExitPlanModePlanText(conversationKey);
|
|
21570
|
-
return /* @__PURE__ */
|
|
21571
|
-
|
|
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,
|
|
21572
21728
|
{
|
|
21573
21729
|
borderStyle: "round",
|
|
21574
21730
|
borderColor: theme.planMode,
|
|
@@ -21576,14 +21732,14 @@ var ExitPlanModeTool = {
|
|
|
21576
21732
|
paddingX: 1,
|
|
21577
21733
|
overflow: "hidden"
|
|
21578
21734
|
},
|
|
21579
|
-
/* @__PURE__ */
|
|
21735
|
+
/* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, plan)
|
|
21580
21736
|
))));
|
|
21581
21737
|
},
|
|
21582
21738
|
renderToolResultMessage(output) {
|
|
21583
21739
|
const theme = getTheme();
|
|
21584
21740
|
const planPath = typeof output.filePath === "string" ? output.filePath : null;
|
|
21585
21741
|
const plan = output.plan || "No plan found";
|
|
21586
|
-
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))));
|
|
21587
21743
|
},
|
|
21588
21744
|
renderResultForAssistant(output) {
|
|
21589
21745
|
if (output.isAgent) {
|
|
@@ -21667,8 +21823,8 @@ ${output.plan}`;
|
|
|
21667
21823
|
};
|
|
21668
21824
|
|
|
21669
21825
|
// src/ui/components/permissions/plan-mode-permission-request/EnterPlanModePermissionRequest.tsx
|
|
21670
|
-
import { Box as
|
|
21671
|
-
import
|
|
21826
|
+
import { Box as Box68, Text as Text73, useInput as useInput22 } from "ink";
|
|
21827
|
+
import React89 from "react";
|
|
21672
21828
|
function EnterPlanModePermissionRequest({
|
|
21673
21829
|
toolUseConfirm,
|
|
21674
21830
|
onDone
|
|
@@ -21681,8 +21837,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21681
21837
|
onDone();
|
|
21682
21838
|
}
|
|
21683
21839
|
});
|
|
21684
|
-
return /* @__PURE__ */
|
|
21685
|
-
|
|
21840
|
+
return /* @__PURE__ */ React89.createElement(
|
|
21841
|
+
Box68,
|
|
21686
21842
|
{
|
|
21687
21843
|
flexDirection: "column",
|
|
21688
21844
|
borderStyle: "round",
|
|
@@ -21692,11 +21848,11 @@ function EnterPlanModePermissionRequest({
|
|
|
21692
21848
|
paddingRight: 1,
|
|
21693
21849
|
paddingBottom: 1
|
|
21694
21850
|
},
|
|
21695
|
-
/* @__PURE__ */
|
|
21696
|
-
/* @__PURE__ */
|
|
21697
|
-
/* @__PURE__ */
|
|
21698
|
-
/* @__PURE__ */
|
|
21699
|
-
/* @__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(
|
|
21700
21856
|
Select,
|
|
21701
21857
|
{
|
|
21702
21858
|
options: [
|
|
@@ -21719,8 +21875,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21719
21875
|
}
|
|
21720
21876
|
|
|
21721
21877
|
// src/ui/components/permissions/plan-mode-permission-request/ExitPlanModePermissionRequest.tsx
|
|
21722
|
-
import { Box as
|
|
21723
|
-
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";
|
|
21724
21880
|
|
|
21725
21881
|
// src/utils/system/externalEditor.ts
|
|
21726
21882
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -22027,8 +22183,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22027
22183
|
[bypassAvailable, launchSwarmAvailable, teammateCount]
|
|
22028
22184
|
);
|
|
22029
22185
|
if (showRejectInput) {
|
|
22030
|
-
return /* @__PURE__ */
|
|
22031
|
-
|
|
22186
|
+
return /* @__PURE__ */ React90.createElement(
|
|
22187
|
+
Box69,
|
|
22032
22188
|
{
|
|
22033
22189
|
flexDirection: "column",
|
|
22034
22190
|
borderStyle: "round",
|
|
@@ -22038,8 +22194,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22038
22194
|
paddingRight: 1,
|
|
22039
22195
|
paddingBottom: 1
|
|
22040
22196
|
},
|
|
22041
|
-
/* @__PURE__ */
|
|
22042
|
-
/* @__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(
|
|
22043
22199
|
TextInput,
|
|
22044
22200
|
{
|
|
22045
22201
|
value: rejectFeedback,
|
|
@@ -22068,8 +22224,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22068
22224
|
))
|
|
22069
22225
|
);
|
|
22070
22226
|
}
|
|
22071
|
-
return /* @__PURE__ */
|
|
22072
|
-
|
|
22227
|
+
return /* @__PURE__ */ React90.createElement(
|
|
22228
|
+
Box69,
|
|
22073
22229
|
{
|
|
22074
22230
|
flexDirection: "column",
|
|
22075
22231
|
borderStyle: "round",
|
|
@@ -22079,9 +22235,9 @@ function ExitPlanModePermissionRequest({
|
|
|
22079
22235
|
paddingRight: 1,
|
|
22080
22236
|
paddingBottom: 1
|
|
22081
22237
|
},
|
|
22082
|
-
/* @__PURE__ */
|
|
22083
|
-
/* @__PURE__ */
|
|
22084
|
-
|
|
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,
|
|
22085
22241
|
{
|
|
22086
22242
|
borderStyle: "dashed",
|
|
22087
22243
|
borderColor: theme.secondaryBorder,
|
|
@@ -22093,10 +22249,10 @@ function ExitPlanModePermissionRequest({
|
|
|
22093
22249
|
marginBottom: 1,
|
|
22094
22250
|
flexDirection: "column"
|
|
22095
22251
|
},
|
|
22096
|
-
/* @__PURE__ */
|
|
22252
|
+
/* @__PURE__ */ React90.createElement(Text74, null, planText)
|
|
22097
22253
|
)),
|
|
22098
|
-
/* @__PURE__ */
|
|
22099
|
-
/* @__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(
|
|
22100
22256
|
Select,
|
|
22101
22257
|
{
|
|
22102
22258
|
options,
|
|
@@ -22122,8 +22278,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22122
22278
|
}
|
|
22123
22279
|
|
|
22124
22280
|
// src/tools/interaction/AskUserQuestionTool/AskUserQuestionTool.tsx
|
|
22125
|
-
import { Box as
|
|
22126
|
-
import
|
|
22281
|
+
import { Box as Box70, Text as Text75 } from "ink";
|
|
22282
|
+
import React91 from "react";
|
|
22127
22283
|
import { z as z12 } from "zod";
|
|
22128
22284
|
|
|
22129
22285
|
// src/tools/interaction/AskUserQuestionTool/prompt.ts
|
|
@@ -22200,11 +22356,11 @@ var AskUserQuestionTool = {
|
|
|
22200
22356
|
},
|
|
22201
22357
|
renderToolUseRejectedMessage() {
|
|
22202
22358
|
const theme = getTheme();
|
|
22203
|
-
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"));
|
|
22204
22360
|
},
|
|
22205
22361
|
renderToolResultMessage(output, _options) {
|
|
22206
22362
|
const theme = getTheme();
|
|
22207
|
-
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)))));
|
|
22208
22364
|
},
|
|
22209
22365
|
renderResultForAssistant(output) {
|
|
22210
22366
|
const formatted = Object.entries(output.answers).map(([question, answer]) => `"${question}"="${answer}"`).join(", ");
|
|
@@ -22221,8 +22377,8 @@ var AskUserQuestionTool = {
|
|
|
22221
22377
|
};
|
|
22222
22378
|
|
|
22223
22379
|
// src/ui/components/permissions/ask-user-question-permission-request/AskUserQuestionPermissionRequest.tsx
|
|
22224
|
-
import
|
|
22225
|
-
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";
|
|
22226
22382
|
import figures8 from "figures";
|
|
22227
22383
|
import stringWidth from "string-width";
|
|
22228
22384
|
function isTextInputChar(input, key) {
|
|
@@ -22576,18 +22732,18 @@ function AskUserQuestionPermissionRequest({
|
|
|
22576
22732
|
const rightArrowInactive = currentQuestionIndex === maxTabIndex;
|
|
22577
22733
|
const allQuestionsAnswered = questions.every((q) => q?.question && Boolean(answers[q.question])) ?? false;
|
|
22578
22734
|
if (questions.length === 0) {
|
|
22579
|
-
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."));
|
|
22580
22736
|
}
|
|
22581
|
-
return /* @__PURE__ */
|
|
22582
|
-
|
|
22737
|
+
return /* @__PURE__ */ React92.createElement(Box71, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(
|
|
22738
|
+
Box71,
|
|
22583
22739
|
{
|
|
22584
22740
|
borderTop: true,
|
|
22585
22741
|
borderColor: theme.secondaryText,
|
|
22586
22742
|
flexDirection: "column",
|
|
22587
22743
|
paddingTop: 0
|
|
22588
22744
|
},
|
|
22589
|
-
/* @__PURE__ */
|
|
22590
|
-
|
|
22745
|
+
/* @__PURE__ */ React92.createElement(Box71, { flexDirection: "row", marginBottom: 1 }, showArrows && /* @__PURE__ */ React92.createElement(
|
|
22746
|
+
Text76,
|
|
22591
22747
|
{
|
|
22592
22748
|
color: currentQuestionIndex === 0 ? theme.secondaryText : void 0
|
|
22593
22749
|
},
|
|
@@ -22598,16 +22754,16 @@ function AskUserQuestionPermissionRequest({
|
|
|
22598
22754
|
const checkbox = question.question && answers[question.question] ? figures8.checkboxOn : figures8.checkboxOff;
|
|
22599
22755
|
const headerText = tabHeaders[index] ?? question.header ?? `Q${index + 1}`;
|
|
22600
22756
|
const tabText = ` ${checkbox} ${headerText} `;
|
|
22601
|
-
return /* @__PURE__ */
|
|
22602
|
-
|
|
22757
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, { key: question.question || `question-${index}` }, /* @__PURE__ */ React92.createElement(
|
|
22758
|
+
Text76,
|
|
22603
22759
|
{
|
|
22604
22760
|
backgroundColor: isSelected ? theme.permission : void 0,
|
|
22605
22761
|
color: isSelected ? inverseText : void 0
|
|
22606
22762
|
},
|
|
22607
22763
|
tabText
|
|
22608
22764
|
));
|
|
22609
|
-
}), !hideSubmitTab && /* @__PURE__ */
|
|
22610
|
-
|
|
22765
|
+
}), !hideSubmitTab && /* @__PURE__ */ React92.createElement(
|
|
22766
|
+
Text76,
|
|
22611
22767
|
{
|
|
22612
22768
|
backgroundColor: isSubmitTab ? theme.permission : void 0,
|
|
22613
22769
|
color: isSubmitTab ? inverseText : void 0
|
|
@@ -22616,23 +22772,23 @@ function AskUserQuestionPermissionRequest({
|
|
|
22616
22772
|
figures8.tick,
|
|
22617
22773
|
" Submit",
|
|
22618
22774
|
" "
|
|
22619
|
-
), showArrows && /* @__PURE__ */
|
|
22620
|
-
!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 }, (() => {
|
|
22621
22777
|
const rawSelected = activeQuestionState?.selectedValue;
|
|
22622
22778
|
const selectedValues = Array.isArray(rawSelected) ? rawSelected : [];
|
|
22623
22779
|
const otherSelected = currentQuestion.multiSelect ? selectedValues.includes("__other__") : rawSelected === "__other__";
|
|
22624
22780
|
const otherText = questionStates[currentQuestion.question]?.textInputValue ?? "";
|
|
22625
22781
|
const otherPlaceholder = currentQuestion.multiSelect ? "Type something" : "Type something.";
|
|
22626
22782
|
const otherLine = otherText.length > 0 ? otherText : isOtherFocused || otherSelected ? otherPlaceholder : "";
|
|
22627
|
-
return /* @__PURE__ */
|
|
22783
|
+
return /* @__PURE__ */ React92.createElement(React92.Fragment, null, currentQuestion.options.map((option, index) => {
|
|
22628
22784
|
const isFocused = !isMultiSelectSubmitFocused && index === focusedOptionIndex;
|
|
22629
22785
|
const isSelected = currentQuestion.multiSelect ? selectedValues.includes(option.label) : rawSelected === option.label;
|
|
22630
22786
|
const pointer = isFocused ? figures8.pointer : " ";
|
|
22631
22787
|
const color = isFocused ? theme.pyb : theme.text;
|
|
22632
22788
|
const indicator = currentQuestion.multiSelect ? isSelected ? figures8.checkboxOn : figures8.checkboxOff : isSelected ? figures8.tick : " ";
|
|
22633
|
-
return /* @__PURE__ */
|
|
22634
|
-
}), /* @__PURE__ */
|
|
22635
|
-
|
|
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,
|
|
22636
22792
|
{
|
|
22637
22793
|
color: isMultiSelectSubmitFocused ? theme.pyb : theme.text,
|
|
22638
22794
|
bold: isMultiSelectSubmitFocused
|
|
@@ -22640,9 +22796,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
22640
22796
|
isMultiSelectSubmitFocused ? figures8.pointer : " ",
|
|
22641
22797
|
" ",
|
|
22642
22798
|
currentQuestionIndex === questions.length - 1 ? "Submit" : "Next"
|
|
22643
|
-
)), /* @__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")));
|
|
22644
22800
|
})())),
|
|
22645
|
-
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(
|
|
22646
22802
|
Select,
|
|
22647
22803
|
{
|
|
22648
22804
|
options: [
|
|
@@ -22712,7 +22868,7 @@ function PermissionRequest({
|
|
|
22712
22868
|
`${PRODUCT_NAME} needs your permission to use ${toolName}`
|
|
22713
22869
|
);
|
|
22714
22870
|
const PermissionComponent = permissionComponentForTool(toolUseConfirm.tool);
|
|
22715
|
-
return /* @__PURE__ */
|
|
22871
|
+
return /* @__PURE__ */ React93.createElement(
|
|
22716
22872
|
PermissionComponent,
|
|
22717
22873
|
{
|
|
22718
22874
|
toolUseConfirm,
|
|
@@ -22723,8 +22879,8 @@ function PermissionRequest({
|
|
|
22723
22879
|
}
|
|
22724
22880
|
|
|
22725
22881
|
// src/ui/components/PromptInput.tsx
|
|
22726
|
-
import { Box as
|
|
22727
|
-
import * as
|
|
22882
|
+
import { Box as Box74, Text as Text79, useInput as useInput27 } from "ink";
|
|
22883
|
+
import * as React97 from "react";
|
|
22728
22884
|
|
|
22729
22885
|
// src/ui/hooks/useArrowKeyHistory.ts
|
|
22730
22886
|
import { useState as useState23 } from "react";
|
|
@@ -24758,8 +24914,8 @@ function countTokens(messages) {
|
|
|
24758
24914
|
}
|
|
24759
24915
|
|
|
24760
24916
|
// src/ui/components/SentryErrorBoundary.ts
|
|
24761
|
-
import * as
|
|
24762
|
-
var SentryErrorBoundary = class extends
|
|
24917
|
+
import * as React94 from "react";
|
|
24918
|
+
var SentryErrorBoundary = class extends React94.Component {
|
|
24763
24919
|
constructor(props) {
|
|
24764
24920
|
super(props);
|
|
24765
24921
|
this.state = { hasError: false };
|
|
@@ -24782,8 +24938,8 @@ var SentryErrorBoundary = class extends React93.Component {
|
|
|
24782
24938
|
};
|
|
24783
24939
|
|
|
24784
24940
|
// src/ui/components/TokenWarning.tsx
|
|
24785
|
-
import { Box as
|
|
24786
|
-
import * as
|
|
24941
|
+
import { Box as Box72, Text as Text77 } from "ink";
|
|
24942
|
+
import * as React95 from "react";
|
|
24787
24943
|
var MAX_TOKENS = 19e4;
|
|
24788
24944
|
var WARNING_THRESHOLD = MAX_TOKENS * 0.6;
|
|
24789
24945
|
var ERROR_THRESHOLD = MAX_TOKENS * 0.8;
|
|
@@ -24793,7 +24949,7 @@ function TokenWarning({ tokenUsage }) {
|
|
|
24793
24949
|
return null;
|
|
24794
24950
|
}
|
|
24795
24951
|
const isError = tokenUsage >= ERROR_THRESHOLD;
|
|
24796
|
-
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"));
|
|
24797
24953
|
}
|
|
24798
24954
|
|
|
24799
24955
|
// src/utils/commands/hashCommand.ts
|
|
@@ -24839,8 +24995,8 @@ _Added on ${now.toLocaleString()} ${timezone}_`;
|
|
|
24839
24995
|
}
|
|
24840
24996
|
|
|
24841
24997
|
// src/ui/components/ModeIndicator.tsx
|
|
24842
|
-
import
|
|
24843
|
-
import { Box as
|
|
24998
|
+
import React96 from "react";
|
|
24999
|
+
import { Box as Box73, Text as Text78 } from "ink";
|
|
24844
25000
|
function __getModeIndicatorDisplayForTests(args) {
|
|
24845
25001
|
if (args.mode === "default") {
|
|
24846
25002
|
return {
|
|
@@ -24911,7 +25067,7 @@ function CompactModeIndicator() {
|
|
|
24911
25067
|
shortcutDisplayText: shortcut.displayText,
|
|
24912
25068
|
theme
|
|
24913
25069
|
});
|
|
24914
|
-
return /* @__PURE__ */
|
|
25070
|
+
return /* @__PURE__ */ React96.createElement(Text78, { color: indicator.color }, indicator.mainText, /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, indicator.shortcutHintText));
|
|
24915
25071
|
}
|
|
24916
25072
|
|
|
24917
25073
|
// src/utils/terminal/promptInputSpecialKey.ts
|
|
@@ -25038,7 +25194,7 @@ function useStatusLine() {
|
|
|
25038
25194
|
// src/ui/components/PromptInput.tsx
|
|
25039
25195
|
async function interpretHashCommand(input) {
|
|
25040
25196
|
try {
|
|
25041
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
25197
|
+
const { queryQuick: queryQuick2 } = await import("./llm-VHGMLUMA.js");
|
|
25042
25198
|
const systemPrompt = [
|
|
25043
25199
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
25044
25200
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -25089,7 +25245,10 @@ function PromptInput({
|
|
|
25089
25245
|
onShowMessageSelector,
|
|
25090
25246
|
setForkConvoWithMessagesOnTheNextRender,
|
|
25091
25247
|
readFileTimestamps,
|
|
25092
|
-
onModelChange
|
|
25248
|
+
onModelChange,
|
|
25249
|
+
onQueueMessage,
|
|
25250
|
+
onQueueEditRequest,
|
|
25251
|
+
hasQueuedMessages
|
|
25093
25252
|
}) {
|
|
25094
25253
|
useEffect23(() => {
|
|
25095
25254
|
if (!isDisabled && !isLoading) {
|
|
@@ -25110,8 +25269,9 @@ function PromptInput({
|
|
|
25110
25269
|
const [pastedImages, setPastedImages] = useState26([]);
|
|
25111
25270
|
const [isEditingExternally, setIsEditingExternally] = useState26(false);
|
|
25112
25271
|
const [currentPwd, setCurrentPwd] = useState26(process.cwd());
|
|
25113
|
-
const
|
|
25114
|
-
const
|
|
25272
|
+
const [editingQueuedId, setEditingQueuedId] = useState26(null);
|
|
25273
|
+
const pastedTextCounter = React97.useRef(1);
|
|
25274
|
+
const pastedImageCounter = React97.useRef(1);
|
|
25115
25275
|
const { cycleMode, currentMode, toolPermissionContext } = usePermissionContext();
|
|
25116
25276
|
const modeCycleShortcut = useMemo25(() => getPermissionModeCycleShortcut(), []);
|
|
25117
25277
|
const showQuickModelSwitchShortcut = modeCycleShortcut.displayText !== "alt+m";
|
|
@@ -25146,13 +25306,13 @@ function PromptInput({
|
|
|
25146
25306
|
const isSelected = index === selectedIndex;
|
|
25147
25307
|
const isAgent = suggestion.type === "agent";
|
|
25148
25308
|
const displayColor = isSelected ? theme.suggestion : isAgent && suggestion.metadata?.color ? suggestion.metadata.color : void 0;
|
|
25149
|
-
return /* @__PURE__ */
|
|
25150
|
-
|
|
25309
|
+
return /* @__PURE__ */ React97.createElement(
|
|
25310
|
+
Box74,
|
|
25151
25311
|
{
|
|
25152
25312
|
key: `${suggestion.type}-${suggestion.value}-${index}`,
|
|
25153
25313
|
flexDirection: "row"
|
|
25154
25314
|
},
|
|
25155
|
-
/* @__PURE__ */
|
|
25315
|
+
/* @__PURE__ */ React97.createElement(Text79, { color: displayColor, dimColor: !isSelected && !displayColor }, isSelected ? "\u25C6 " : " ", suggestion.displayValue)
|
|
25156
25316
|
);
|
|
25157
25317
|
});
|
|
25158
25318
|
}, [suggestions, selectedIndex, theme.suggestion]);
|
|
@@ -25219,6 +25379,16 @@ function PromptInput({
|
|
|
25219
25379
|
);
|
|
25220
25380
|
const handleHistoryUp = () => {
|
|
25221
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
|
+
}
|
|
25222
25392
|
onHistoryUp();
|
|
25223
25393
|
}
|
|
25224
25394
|
};
|
|
@@ -25231,6 +25401,47 @@ function PromptInput({
|
|
|
25231
25401
|
if (!isSubmittingSlashCommand && completionActive && suggestions.length > 0) {
|
|
25232
25402
|
return;
|
|
25233
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
|
+
}
|
|
25234
25445
|
if ((mode === "pyb" || input2.startsWith("#")) && input2.match(/^(#\s*)?(put|create|generate|write|give|provide)/i)) {
|
|
25235
25446
|
try {
|
|
25236
25447
|
const originalInput = input2;
|
|
@@ -25297,15 +25508,6 @@ function PromptInput({
|
|
|
25297
25508
|
onModeChange("prompt");
|
|
25298
25509
|
return;
|
|
25299
25510
|
}
|
|
25300
|
-
if (input2 === "") {
|
|
25301
|
-
return;
|
|
25302
|
-
}
|
|
25303
|
-
if (isDisabled) {
|
|
25304
|
-
return;
|
|
25305
|
-
}
|
|
25306
|
-
if (isLoading) {
|
|
25307
|
-
return;
|
|
25308
|
-
}
|
|
25309
25511
|
if (["exit", "quit", ":q", ":q!", ":wq", ":wq!"].includes(input2.trim())) {
|
|
25310
25512
|
exit();
|
|
25311
25513
|
}
|
|
@@ -25351,7 +25553,7 @@ function PromptInput({
|
|
|
25351
25553
|
if (messages2.length) {
|
|
25352
25554
|
if (mode === "bash") {
|
|
25353
25555
|
onQuery(messages2, newAbortController).then(async () => {
|
|
25354
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
25556
|
+
const { getCwd: getCwd2 } = await import("./state-OQTB4HM4.js");
|
|
25355
25557
|
setCurrentPwd(getCwd2());
|
|
25356
25558
|
});
|
|
25357
25559
|
} else {
|
|
@@ -25403,6 +25605,12 @@ function PromptInput({
|
|
|
25403
25605
|
}, [input]);
|
|
25404
25606
|
useInput27(
|
|
25405
25607
|
(inputChar, key) => {
|
|
25608
|
+
if (key.escape && isLoading && editingQueuedId) {
|
|
25609
|
+
setEditingQueuedId(null);
|
|
25610
|
+
onInputChange("");
|
|
25611
|
+
setCursorOffset(0);
|
|
25612
|
+
return true;
|
|
25613
|
+
}
|
|
25406
25614
|
if (mode === "bash" && (key.backspace || key.delete)) {
|
|
25407
25615
|
if (input === "") {
|
|
25408
25616
|
onModeChange("prompt");
|
|
@@ -25507,17 +25715,17 @@ function PromptInput({
|
|
|
25507
25715
|
currentTokens: tokenUsage
|
|
25508
25716
|
};
|
|
25509
25717
|
}, [tokenUsage, modelSwitchMessage.show, submitCount, currentModelId]);
|
|
25510
|
-
return /* @__PURE__ */
|
|
25511
|
-
|
|
25718
|
+
return /* @__PURE__ */ React97.createElement(Box74, { flexDirection: "column" }, (mode === "bash" || modelInfo) && /* @__PURE__ */ React97.createElement(
|
|
25719
|
+
Box74,
|
|
25512
25720
|
{
|
|
25513
25721
|
justifyContent: "space-between",
|
|
25514
25722
|
marginBottom: 1,
|
|
25515
25723
|
flexDirection: "row"
|
|
25516
25724
|
},
|
|
25517
|
-
mode === "bash" ? /* @__PURE__ */
|
|
25518
|
-
modelInfo && /* @__PURE__ */
|
|
25519
|
-
), /* @__PURE__ */
|
|
25520
|
-
|
|
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,
|
|
25521
25729
|
{
|
|
25522
25730
|
alignItems: "flex-start",
|
|
25523
25731
|
justifyContent: "flex-start",
|
|
@@ -25531,8 +25739,8 @@ function PromptInput({
|
|
|
25531
25739
|
marginTop: 1,
|
|
25532
25740
|
width: "100%"
|
|
25533
25741
|
},
|
|
25534
|
-
/* @__PURE__ */
|
|
25535
|
-
|
|
25742
|
+
/* @__PURE__ */ React97.createElement(
|
|
25743
|
+
Box74,
|
|
25536
25744
|
{
|
|
25537
25745
|
alignItems: "flex-start",
|
|
25538
25746
|
alignSelf: "flex-start",
|
|
@@ -25540,9 +25748,9 @@ function PromptInput({
|
|
|
25540
25748
|
justifyContent: "flex-start",
|
|
25541
25749
|
width: 3
|
|
25542
25750
|
},
|
|
25543
|
-
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")
|
|
25544
25752
|
),
|
|
25545
|
-
/* @__PURE__ */
|
|
25753
|
+
/* @__PURE__ */ React97.createElement(Box74, { paddingRight: 1 }, /* @__PURE__ */ React97.createElement(
|
|
25546
25754
|
TextInput,
|
|
25547
25755
|
{
|
|
25548
25756
|
multiline: true,
|
|
@@ -25567,44 +25775,44 @@ function PromptInput({
|
|
|
25567
25775
|
onSpecialKey: handleSpecialKey
|
|
25568
25776
|
}
|
|
25569
25777
|
))
|
|
25570
|
-
), !completionActive && suggestions.length === 0 && /* @__PURE__ */
|
|
25571
|
-
|
|
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,
|
|
25572
25780
|
{
|
|
25573
25781
|
color: mode === "bash" ? theme.bashBorder : void 0,
|
|
25574
25782
|
dimColor: mode !== "bash"
|
|
25575
25783
|
},
|
|
25576
25784
|
"! run some shell command"
|
|
25577
|
-
), /* @__PURE__ */
|
|
25578
|
-
|
|
25785
|
+
), /* @__PURE__ */ React97.createElement(Text79, { dimColor: true }, " \xB7 / for commands"), /* @__PURE__ */ React97.createElement(
|
|
25786
|
+
Text79,
|
|
25579
25787
|
{
|
|
25580
25788
|
color: mode === "pyb" ? theme.noting : void 0,
|
|
25581
25789
|
dimColor: mode !== "pyb"
|
|
25582
25790
|
},
|
|
25583
25791
|
" ",
|
|
25584
25792
|
"\xB7 # tell agent something to remember forever"
|
|
25585
|
-
))), /* @__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(
|
|
25586
25794
|
SentryErrorBoundary,
|
|
25587
25795
|
{
|
|
25588
|
-
children: /* @__PURE__ */
|
|
25796
|
+
children: /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage }))
|
|
25589
25797
|
}
|
|
25590
|
-
))), suggestions.length > 0 && /* @__PURE__ */
|
|
25591
|
-
|
|
25798
|
+
))), suggestions.length > 0 && /* @__PURE__ */ React97.createElement(
|
|
25799
|
+
Box74,
|
|
25592
25800
|
{
|
|
25593
25801
|
flexDirection: "row",
|
|
25594
25802
|
justifyContent: "space-between",
|
|
25595
25803
|
paddingX: 2,
|
|
25596
25804
|
paddingY: 0
|
|
25597
25805
|
},
|
|
25598
|
-
/* @__PURE__ */
|
|
25599
|
-
|
|
25806
|
+
/* @__PURE__ */ React97.createElement(Box74, { flexDirection: "column" }, renderedSuggestions, /* @__PURE__ */ React97.createElement(
|
|
25807
|
+
Box74,
|
|
25600
25808
|
{
|
|
25601
25809
|
marginTop: 1,
|
|
25602
25810
|
paddingX: 3,
|
|
25603
25811
|
borderStyle: "round",
|
|
25604
25812
|
borderColor: "gray"
|
|
25605
25813
|
},
|
|
25606
|
-
/* @__PURE__ */
|
|
25607
|
-
|
|
25814
|
+
/* @__PURE__ */ React97.createElement(
|
|
25815
|
+
Text79,
|
|
25608
25816
|
{
|
|
25609
25817
|
dimColor: !emptyDirMessage,
|
|
25610
25818
|
color: emptyDirMessage ? "yellow" : void 0
|
|
@@ -25624,10 +25832,10 @@ function PromptInput({
|
|
|
25624
25832
|
})()
|
|
25625
25833
|
)
|
|
25626
25834
|
)),
|
|
25627
|
-
/* @__PURE__ */
|
|
25835
|
+
/* @__PURE__ */ React97.createElement(
|
|
25628
25836
|
SentryErrorBoundary,
|
|
25629
25837
|
{
|
|
25630
|
-
children: /* @__PURE__ */
|
|
25838
|
+
children: /* @__PURE__ */ React97.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage: countTokens(messages) }))
|
|
25631
25839
|
}
|
|
25632
25840
|
)
|
|
25633
25841
|
));
|
|
@@ -26983,6 +27191,22 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
26983
27191
|
return;
|
|
26984
27192
|
}
|
|
26985
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
|
+
}
|
|
26986
27210
|
yield assistantMessage;
|
|
26987
27211
|
return;
|
|
26988
27212
|
}
|
|
@@ -27011,8 +27235,17 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
27011
27235
|
return;
|
|
27012
27236
|
}
|
|
27013
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];
|
|
27014
27247
|
yield* await queryCore(
|
|
27015
|
-
|
|
27248
|
+
nextMessages,
|
|
27016
27249
|
systemPrompt,
|
|
27017
27250
|
context,
|
|
27018
27251
|
canUseTool,
|
|
@@ -27428,18 +27661,99 @@ function createErrorToolResultBlock(args) {
|
|
|
27428
27661
|
};
|
|
27429
27662
|
}
|
|
27430
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
|
+
|
|
27431
27745
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
27432
|
-
import { default as
|
|
27746
|
+
import { default as React101, useCallback as useCallback15 } from "react";
|
|
27433
27747
|
|
|
27434
27748
|
// src/ui/components/binary-feedback/BinaryFeedbackView.tsx
|
|
27435
27749
|
import chalk14 from "chalk";
|
|
27436
|
-
import { Box as
|
|
27750
|
+
import { Box as Box76, Text as Text80, useInput as useInput29 } from "ink";
|
|
27437
27751
|
import Link2 from "ink-link";
|
|
27438
|
-
import
|
|
27752
|
+
import React100, { useState as useState27 } from "react";
|
|
27439
27753
|
|
|
27440
27754
|
// src/ui/components/binary-feedback/BinaryFeedbackOption.tsx
|
|
27441
|
-
import * as
|
|
27442
|
-
import { Box as
|
|
27755
|
+
import * as React99 from "react";
|
|
27756
|
+
import { Box as Box75 } from "ink";
|
|
27443
27757
|
function BinaryFeedbackOption({
|
|
27444
27758
|
debug: debug2,
|
|
27445
27759
|
erroredToolUseIDs,
|
|
@@ -27451,7 +27765,7 @@ function BinaryFeedbackOption({
|
|
|
27451
27765
|
verbose
|
|
27452
27766
|
}) {
|
|
27453
27767
|
const { columns } = useTerminalSize();
|
|
27454
|
-
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(
|
|
27455
27769
|
Message,
|
|
27456
27770
|
{
|
|
27457
27771
|
addMargin: false,
|
|
@@ -27467,7 +27781,7 @@ function BinaryFeedbackOption({
|
|
|
27467
27781
|
verbose,
|
|
27468
27782
|
width: columns / 2 - 6
|
|
27469
27783
|
}
|
|
27470
|
-
), /* @__PURE__ */
|
|
27784
|
+
), /* @__PURE__ */ React99.createElement(AdditionalContext, { message: _, verbose })));
|
|
27471
27785
|
}
|
|
27472
27786
|
function AdditionalContext({
|
|
27473
27787
|
message,
|
|
@@ -27499,7 +27813,7 @@ function AdditionalContext({
|
|
|
27499
27813
|
} catch {
|
|
27500
27814
|
return null;
|
|
27501
27815
|
}
|
|
27502
|
-
return /* @__PURE__ */
|
|
27816
|
+
return /* @__PURE__ */ React99.createElement(
|
|
27503
27817
|
FileEditToolDiff,
|
|
27504
27818
|
{
|
|
27505
27819
|
file_path: input.data.file_path,
|
|
@@ -27515,7 +27829,7 @@ function AdditionalContext({
|
|
|
27515
27829
|
if (!input.success) {
|
|
27516
27830
|
return null;
|
|
27517
27831
|
}
|
|
27518
|
-
return /* @__PURE__ */
|
|
27832
|
+
return /* @__PURE__ */ React99.createElement(
|
|
27519
27833
|
FileWriteToolDiff,
|
|
27520
27834
|
{
|
|
27521
27835
|
file_path: input.data.file_path,
|
|
@@ -27580,8 +27894,8 @@ function BinaryFeedbackView({
|
|
|
27580
27894
|
onChoose?.("neither");
|
|
27581
27895
|
}
|
|
27582
27896
|
});
|
|
27583
|
-
return /* @__PURE__ */
|
|
27584
|
-
|
|
27897
|
+
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(
|
|
27898
|
+
Box76,
|
|
27585
27899
|
{
|
|
27586
27900
|
flexDirection: "column",
|
|
27587
27901
|
height: "100%",
|
|
@@ -27589,9 +27903,9 @@ function BinaryFeedbackView({
|
|
|
27589
27903
|
borderStyle: "round",
|
|
27590
27904
|
borderColor: theme.permission
|
|
27591
27905
|
},
|
|
27592
|
-
/* @__PURE__ */
|
|
27593
|
-
/* @__PURE__ */
|
|
27594
|
-
|
|
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,
|
|
27595
27909
|
{
|
|
27596
27910
|
flexDirection: "column",
|
|
27597
27911
|
flexGrow: 1,
|
|
@@ -27602,7 +27916,7 @@ function BinaryFeedbackView({
|
|
|
27602
27916
|
marginRight: 1,
|
|
27603
27917
|
padding: 1
|
|
27604
27918
|
},
|
|
27605
|
-
/* @__PURE__ */
|
|
27919
|
+
/* @__PURE__ */ React100.createElement(
|
|
27606
27920
|
BinaryFeedbackOption,
|
|
27607
27921
|
{
|
|
27608
27922
|
erroredToolUseIDs,
|
|
@@ -27615,8 +27929,8 @@ function BinaryFeedbackView({
|
|
|
27615
27929
|
verbose
|
|
27616
27930
|
}
|
|
27617
27931
|
)
|
|
27618
|
-
), /* @__PURE__ */
|
|
27619
|
-
|
|
27932
|
+
), /* @__PURE__ */ React100.createElement(
|
|
27933
|
+
Box76,
|
|
27620
27934
|
{
|
|
27621
27935
|
flexDirection: "column",
|
|
27622
27936
|
flexGrow: 1,
|
|
@@ -27627,7 +27941,7 @@ function BinaryFeedbackView({
|
|
|
27627
27941
|
marginLeft: 1,
|
|
27628
27942
|
padding: 1
|
|
27629
27943
|
},
|
|
27630
|
-
/* @__PURE__ */
|
|
27944
|
+
/* @__PURE__ */ React100.createElement(
|
|
27631
27945
|
BinaryFeedbackOption,
|
|
27632
27946
|
{
|
|
27633
27947
|
erroredToolUseIDs,
|
|
@@ -27641,7 +27955,7 @@ function BinaryFeedbackView({
|
|
|
27641
27955
|
}
|
|
27642
27956
|
)
|
|
27643
27957
|
)),
|
|
27644
|
-
/* @__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(
|
|
27645
27959
|
Select,
|
|
27646
27960
|
{
|
|
27647
27961
|
options: getOptions2(),
|
|
@@ -27650,7 +27964,7 @@ function BinaryFeedbackView({
|
|
|
27650
27964
|
onChange: onChoose
|
|
27651
27965
|
}
|
|
27652
27966
|
))
|
|
27653
|
-
), 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, " "));
|
|
27654
27968
|
}
|
|
27655
27969
|
|
|
27656
27970
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
@@ -27676,7 +27990,7 @@ function BinaryFeedback({
|
|
|
27676
27990
|
useNotifyAfterTimeout(
|
|
27677
27991
|
`${PRODUCT_NAME} needs your input on a response comparison`
|
|
27678
27992
|
);
|
|
27679
|
-
return /* @__PURE__ */
|
|
27993
|
+
return /* @__PURE__ */ React101.createElement(
|
|
27680
27994
|
BinaryFeedbackView,
|
|
27681
27995
|
{
|
|
27682
27996
|
debug: debug2,
|
|
@@ -27747,6 +28061,7 @@ async function getReasoningEffort(modelProfile, messages) {
|
|
|
27747
28061
|
}
|
|
27748
28062
|
|
|
27749
28063
|
// src/ui/screens/REPL.tsx
|
|
28064
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
27750
28065
|
function REPL({
|
|
27751
28066
|
commands,
|
|
27752
28067
|
safeMode,
|
|
@@ -27784,6 +28099,8 @@ function REPL({
|
|
|
27784
28099
|
null
|
|
27785
28100
|
);
|
|
27786
28101
|
const [messages, setMessages2] = useState28(initialMessages ?? []);
|
|
28102
|
+
const [queuedMessages, setQueuedMessages] = useState28([]);
|
|
28103
|
+
const queuedMessagesRef = useRef13([]);
|
|
27787
28104
|
const [inputValue, setInputValue] = useState28("");
|
|
27788
28105
|
const [inputMode, setInputMode] = useState28(
|
|
27789
28106
|
"prompt"
|
|
@@ -27810,6 +28127,112 @@ function REPL({
|
|
|
27810
28127
|
[]
|
|
27811
28128
|
);
|
|
27812
28129
|
const readFileTimestamps = useRef13({});
|
|
28130
|
+
const QUEUE_MERGE_WINDOW_MS = 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: QUEUE_MERGE_WINDOW_MS
|
|
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
|
+
updateQueuedMessages
|
|
28234
|
+
]
|
|
28235
|
+
);
|
|
27813
28236
|
const { status: apiKeyStatus, reverify } = useApiKeyVerification();
|
|
27814
28237
|
function onCancel() {
|
|
27815
28238
|
if (!isLoading) {
|
|
@@ -27927,6 +28350,7 @@ function REPL({
|
|
|
27927
28350
|
verbose,
|
|
27928
28351
|
safeMode,
|
|
27929
28352
|
maxThinkingTokens,
|
|
28353
|
+
dequeueQueuedMessagesForNextTurn,
|
|
27930
28354
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
27931
28355
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
27932
28356
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -27991,6 +28415,7 @@ function REPL({
|
|
|
27991
28415
|
safeMode,
|
|
27992
28416
|
maxThinkingTokens,
|
|
27993
28417
|
isPybRequest: isPybRequest || void 0,
|
|
28418
|
+
dequeueQueuedMessagesForNextTurn,
|
|
27994
28419
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
27995
28420
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
27996
28421
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -28079,7 +28504,7 @@ function REPL({
|
|
|
28079
28504
|
const messagesJSX = useMemo26(() => {
|
|
28080
28505
|
return orderedMessages.map((_, index) => {
|
|
28081
28506
|
const toolUseID = getToolUseID(_);
|
|
28082
|
-
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */
|
|
28507
|
+
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */ React102.createElement(
|
|
28083
28508
|
Message,
|
|
28084
28509
|
{
|
|
28085
28510
|
message: _.content,
|
|
@@ -28094,10 +28519,10 @@ function REPL({
|
|
|
28094
28519
|
shouldAnimate: false,
|
|
28095
28520
|
shouldShowDot: false
|
|
28096
28521
|
}
|
|
28097
|
-
) : /* @__PURE__ */
|
|
28522
|
+
) : /* @__PURE__ */ React102.createElement(
|
|
28098
28523
|
MessageResponse,
|
|
28099
28524
|
{
|
|
28100
|
-
children: /* @__PURE__ */
|
|
28525
|
+
children: /* @__PURE__ */ React102.createElement(
|
|
28101
28526
|
Message,
|
|
28102
28527
|
{
|
|
28103
28528
|
message: _.content,
|
|
@@ -28116,7 +28541,7 @@ function REPL({
|
|
|
28116
28541
|
}
|
|
28117
28542
|
)
|
|
28118
28543
|
}
|
|
28119
|
-
) : /* @__PURE__ */
|
|
28544
|
+
) : /* @__PURE__ */ React102.createElement(
|
|
28120
28545
|
Message,
|
|
28121
28546
|
{
|
|
28122
28547
|
message: _,
|
|
@@ -28135,8 +28560,8 @@ function REPL({
|
|
|
28135
28560
|
const isInStaticPrefix = index < replStaticPrefixLength;
|
|
28136
28561
|
if (debug2) {
|
|
28137
28562
|
return {
|
|
28138
|
-
jsx: /* @__PURE__ */
|
|
28139
|
-
|
|
28563
|
+
jsx: /* @__PURE__ */ React102.createElement(
|
|
28564
|
+
Box77,
|
|
28140
28565
|
{
|
|
28141
28566
|
borderStyle: "single",
|
|
28142
28567
|
borderColor: isInStaticPrefix ? "green" : "red",
|
|
@@ -28148,7 +28573,7 @@ function REPL({
|
|
|
28148
28573
|
};
|
|
28149
28574
|
}
|
|
28150
28575
|
return {
|
|
28151
|
-
jsx: /* @__PURE__ */
|
|
28576
|
+
jsx: /* @__PURE__ */ React102.createElement(Box77, { key: _.uuid, width: "100%" }, message)
|
|
28152
28577
|
};
|
|
28153
28578
|
});
|
|
28154
28579
|
}, [
|
|
@@ -28171,7 +28596,7 @@ function REPL({
|
|
|
28171
28596
|
const staticItems = useMemo26(
|
|
28172
28597
|
() => [
|
|
28173
28598
|
{
|
|
28174
|
-
jsx: /* @__PURE__ */
|
|
28599
|
+
jsx: /* @__PURE__ */ React102.createElement(Box77, { flexDirection: "column", key: `logo${forkNumber}` }, /* @__PURE__ */ React102.createElement(
|
|
28175
28600
|
Logo,
|
|
28176
28601
|
{
|
|
28177
28602
|
mcpClients,
|
|
@@ -28179,7 +28604,7 @@ function REPL({
|
|
|
28179
28604
|
updateBannerVersion: updateAvailableVersion,
|
|
28180
28605
|
updateBannerCommands: updateCommands
|
|
28181
28606
|
}
|
|
28182
|
-
), /* @__PURE__ */
|
|
28607
|
+
), /* @__PURE__ */ React102.createElement(ProjectOnboarding, { workspaceDir: getOriginalCwd() }))
|
|
28183
28608
|
},
|
|
28184
28609
|
...messagesJSX.slice(0, replStaticPrefixLength)
|
|
28185
28610
|
],
|
|
@@ -28199,23 +28624,24 @@ function REPL({
|
|
|
28199
28624
|
);
|
|
28200
28625
|
const showingCostDialog = !isLoading && showCostDialog;
|
|
28201
28626
|
const conversationKey = `${messageLogName}:${forkNumber}`;
|
|
28202
|
-
|
|
28627
|
+
const hasQueuedMessages = queuedMessages.length > 0;
|
|
28628
|
+
return /* @__PURE__ */ React102.createElement(
|
|
28203
28629
|
PermissionProvider,
|
|
28204
28630
|
{
|
|
28205
28631
|
conversationKey,
|
|
28206
28632
|
isBypassPermissionsModeAvailable: !safeMode
|
|
28207
28633
|
},
|
|
28208
|
-
/* @__PURE__ */
|
|
28209
|
-
|
|
28634
|
+
/* @__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(
|
|
28635
|
+
Box77,
|
|
28210
28636
|
{
|
|
28211
28637
|
borderColor: "red",
|
|
28212
28638
|
borderStyle: debug2 ? "single" : void 0,
|
|
28213
28639
|
flexDirection: "column",
|
|
28214
28640
|
width: "100%"
|
|
28215
28641
|
},
|
|
28216
|
-
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */
|
|
28642
|
+
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */ React102.createElement(RequestStatusIndicator, null),
|
|
28217
28643
|
toolJSX ? toolJSX.jsx : null,
|
|
28218
|
-
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */
|
|
28644
|
+
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */ React102.createElement(
|
|
28219
28645
|
BinaryFeedback,
|
|
28220
28646
|
{
|
|
28221
28647
|
m1: binaryFeedbackContext.m1,
|
|
@@ -28233,7 +28659,7 @@ function REPL({
|
|
|
28233
28659
|
unresolvedToolUseIDs
|
|
28234
28660
|
}
|
|
28235
28661
|
),
|
|
28236
|
-
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */
|
|
28662
|
+
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */ React102.createElement(
|
|
28237
28663
|
PermissionRequest,
|
|
28238
28664
|
{
|
|
28239
28665
|
toolUseConfirm,
|
|
@@ -28241,7 +28667,7 @@ function REPL({
|
|
|
28241
28667
|
verbose
|
|
28242
28668
|
}
|
|
28243
28669
|
),
|
|
28244
|
-
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */
|
|
28670
|
+
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */ React102.createElement(
|
|
28245
28671
|
CostThresholdDialog,
|
|
28246
28672
|
{
|
|
28247
28673
|
onDone: () => {
|
|
@@ -28255,7 +28681,17 @@ function REPL({
|
|
|
28255
28681
|
}
|
|
28256
28682
|
}
|
|
28257
28683
|
),
|
|
28258
|
-
|
|
28684
|
+
/* @__PURE__ */ React102.createElement(
|
|
28685
|
+
QueuedMessageList,
|
|
28686
|
+
{
|
|
28687
|
+
items: queuedMessages.map((item) => ({
|
|
28688
|
+
id: item.id,
|
|
28689
|
+
content: item.content
|
|
28690
|
+
}))
|
|
28691
|
+
}
|
|
28692
|
+
),
|
|
28693
|
+
/* @__PURE__ */ React102.createElement(QueuedHintLine, { show: hasQueuedMessages && isLoading }),
|
|
28694
|
+
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(
|
|
28259
28695
|
PromptInput_default,
|
|
28260
28696
|
{
|
|
28261
28697
|
commands,
|
|
@@ -28282,10 +28718,13 @@ function REPL({
|
|
|
28282
28718
|
onShowMessageSelector: () => setIsMessageSelectorVisible((prev) => !prev),
|
|
28283
28719
|
setForkConvoWithMessagesOnTheNextRender,
|
|
28284
28720
|
readFileTimestamps: readFileTimestamps.current,
|
|
28285
|
-
abortController
|
|
28721
|
+
abortController,
|
|
28722
|
+
onQueueMessage: enqueueQueuedMessage,
|
|
28723
|
+
onQueueEditRequest: dequeueQueuedMessageForEdit,
|
|
28724
|
+
hasQueuedMessages
|
|
28286
28725
|
}
|
|
28287
28726
|
))
|
|
28288
|
-
), isMessageSelectorVisible && /* @__PURE__ */
|
|
28727
|
+
), isMessageSelectorVisible && /* @__PURE__ */ React102.createElement(
|
|
28289
28728
|
MessageSelector,
|
|
28290
28729
|
{
|
|
28291
28730
|
erroredToolUseIDs,
|
|
@@ -28311,13 +28750,13 @@ function REPL({
|
|
|
28311
28750
|
onEscape: () => setIsMessageSelectorVisible(false),
|
|
28312
28751
|
tools
|
|
28313
28752
|
}
|
|
28314
|
-
), /* @__PURE__ */
|
|
28753
|
+
), /* @__PURE__ */ React102.createElement(Newline4, null))
|
|
28315
28754
|
);
|
|
28316
28755
|
}
|
|
28317
28756
|
|
|
28318
28757
|
// src/ui/components/SessionSelector.tsx
|
|
28319
|
-
import
|
|
28320
|
-
import { Box as
|
|
28758
|
+
import React103 from "react";
|
|
28759
|
+
import { Box as Box78, Text as Text82 } from "ink";
|
|
28321
28760
|
function SessionSelector({
|
|
28322
28761
|
sessions,
|
|
28323
28762
|
onSelect
|
|
@@ -28345,18 +28784,18 @@ function SessionSelector({
|
|
|
28345
28784
|
const truncated = labelTxt.length > columns - 2 ? `${labelTxt.slice(0, columns - 5)}...` : labelTxt;
|
|
28346
28785
|
return { label: truncated, value: String(i) };
|
|
28347
28786
|
});
|
|
28348
|
-
return /* @__PURE__ */
|
|
28787
|
+
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(
|
|
28349
28788
|
Select,
|
|
28350
28789
|
{
|
|
28351
28790
|
options,
|
|
28352
28791
|
onChange: (value) => onSelect(parseInt(value, 10)),
|
|
28353
28792
|
visibleOptionCount: visibleCount
|
|
28354
28793
|
}
|
|
28355
|
-
), hiddenCount > 0 && /* @__PURE__ */
|
|
28794
|
+
), hiddenCount > 0 && /* @__PURE__ */ React103.createElement(Box78, { paddingLeft: 2 }, /* @__PURE__ */ React103.createElement(Text82, { color: getTheme().secondaryText }, "and ", hiddenCount, " more\u2026")));
|
|
28356
28795
|
}
|
|
28357
28796
|
|
|
28358
28797
|
// src/ui/screens/ResumeConversation.tsx
|
|
28359
|
-
import { randomUUID as
|
|
28798
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
28360
28799
|
function ResumeConversation({
|
|
28361
28800
|
cwd,
|
|
28362
28801
|
context,
|
|
@@ -28380,7 +28819,7 @@ function ResumeConversation({
|
|
|
28380
28819
|
if (!selected) return;
|
|
28381
28820
|
context.unmount?.();
|
|
28382
28821
|
const resumedFromSessionId = selected.sessionId;
|
|
28383
|
-
const effectiveSessionId = forkSession ? forkSessionId?.trim() ||
|
|
28822
|
+
const effectiveSessionId = forkSession ? forkSessionId?.trim() || randomUUID6() : resumedFromSessionId;
|
|
28384
28823
|
setPybAgentSessionId(effectiveSessionId);
|
|
28385
28824
|
const messages = loadPybAgentSessionMessages({
|
|
28386
28825
|
cwd,
|
|
@@ -28388,7 +28827,7 @@ function ResumeConversation({
|
|
|
28388
28827
|
});
|
|
28389
28828
|
const isDefaultModel = await isDefaultSlowAndCapableModel();
|
|
28390
28829
|
render(
|
|
28391
|
-
/* @__PURE__ */
|
|
28830
|
+
/* @__PURE__ */ React104.createElement(
|
|
28392
28831
|
REPL,
|
|
28393
28832
|
{
|
|
28394
28833
|
commands,
|
|
@@ -28416,7 +28855,7 @@ function ResumeConversation({
|
|
|
28416
28855
|
throw e;
|
|
28417
28856
|
}
|
|
28418
28857
|
}
|
|
28419
|
-
return /* @__PURE__ */
|
|
28858
|
+
return /* @__PURE__ */ React104.createElement(SessionSelector, { sessions, onSelect });
|
|
28420
28859
|
}
|
|
28421
28860
|
|
|
28422
28861
|
// src/commands/resume.tsx
|
|
@@ -28439,7 +28878,7 @@ var resume_default = {
|
|
|
28439
28878
|
return null;
|
|
28440
28879
|
}
|
|
28441
28880
|
render2(
|
|
28442
|
-
/* @__PURE__ */
|
|
28881
|
+
/* @__PURE__ */ React105.createElement(
|
|
28443
28882
|
ResumeConversation,
|
|
28444
28883
|
{
|
|
28445
28884
|
cwd,
|
|
@@ -28456,11 +28895,11 @@ var resume_default = {
|
|
|
28456
28895
|
};
|
|
28457
28896
|
|
|
28458
28897
|
// src/commands/agents.tsx
|
|
28459
|
-
import
|
|
28898
|
+
import React107 from "react";
|
|
28460
28899
|
|
|
28461
28900
|
// src/commands/agents/ui.tsx
|
|
28462
|
-
import
|
|
28463
|
-
import { Box as
|
|
28901
|
+
import React106, { useCallback as useCallback17, useEffect as useEffect27, useMemo as useMemo27, useRef as useRef14, useState as useState29 } from "react";
|
|
28902
|
+
import { Box as Box79, Text as Text83, useInput as useInput30 } from "ink";
|
|
28464
28903
|
import figures9 from "figures";
|
|
28465
28904
|
import chalk15 from "chalk";
|
|
28466
28905
|
import { join as join13 } from "path";
|
|
@@ -28528,9 +28967,9 @@ import { join as join12 } from "path";
|
|
|
28528
28967
|
import { homedir as homedir8 } from "os";
|
|
28529
28968
|
|
|
28530
28969
|
// src/commands/agents/generation.ts
|
|
28531
|
-
import { randomUUID as
|
|
28970
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
28532
28971
|
async function generateAgentWithClaude(prompt) {
|
|
28533
|
-
const { queryModel } = await import("./llm-
|
|
28972
|
+
const { queryModel } = await import("./llm-VHGMLUMA.js");
|
|
28534
28973
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
28535
28974
|
|
|
28536
28975
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -28543,7 +28982,7 @@ Make the agent highly specialized and effective for the described use case.`;
|
|
|
28543
28982
|
const messages = [
|
|
28544
28983
|
{
|
|
28545
28984
|
type: "user",
|
|
28546
|
-
uuid:
|
|
28985
|
+
uuid: randomUUID7(),
|
|
28547
28986
|
message: { role: "user", content: prompt }
|
|
28548
28987
|
}
|
|
28549
28988
|
];
|
|
@@ -28912,21 +29351,21 @@ function panelBorderColor(kind) {
|
|
|
28912
29351
|
}
|
|
28913
29352
|
function Panel(props) {
|
|
28914
29353
|
const theme = getTheme();
|
|
28915
|
-
return /* @__PURE__ */
|
|
28916
|
-
|
|
29354
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29355
|
+
Box79,
|
|
28917
29356
|
{
|
|
28918
29357
|
borderStyle: "round",
|
|
28919
29358
|
borderColor: props.borderColor ?? theme.suggestion,
|
|
28920
29359
|
flexDirection: "column"
|
|
28921
29360
|
},
|
|
28922
|
-
/* @__PURE__ */
|
|
28923
|
-
/* @__PURE__ */
|
|
29361
|
+
/* @__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),
|
|
29362
|
+
/* @__PURE__ */ React106.createElement(Box79, { paddingX: 1, flexDirection: "column" }, props.children)
|
|
28924
29363
|
);
|
|
28925
29364
|
}
|
|
28926
29365
|
function Instructions({
|
|
28927
29366
|
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
28928
29367
|
}) {
|
|
28929
|
-
return /* @__PURE__ */
|
|
29368
|
+
return /* @__PURE__ */ React106.createElement(Box79, { marginLeft: 3 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, instructions));
|
|
28930
29369
|
}
|
|
28931
29370
|
function computeOverrides(args) {
|
|
28932
29371
|
const activeByType = /* @__PURE__ */ new Map();
|
|
@@ -29005,38 +29444,38 @@ function AgentsListView(props) {
|
|
|
29005
29444
|
setSelectedAgent(nextAgent);
|
|
29006
29445
|
}
|
|
29007
29446
|
});
|
|
29008
|
-
const renderCreateNew = () => /* @__PURE__ */
|
|
29447
|
+
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"));
|
|
29009
29448
|
const renderAgentRow = (agent) => {
|
|
29010
29449
|
const isBuiltIn = agent.source === "built-in";
|
|
29011
29450
|
const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.source === agent.source;
|
|
29012
29451
|
const dimmed = Boolean(isBuiltIn || agent.overriddenBy);
|
|
29013
29452
|
const rowColor = isSelected ? theme.suggestion : void 0;
|
|
29014
29453
|
const pointer = isBuiltIn ? "" : isSelected ? `${figures9.pointer} ` : " ";
|
|
29015
|
-
return /* @__PURE__ */
|
|
29454
|
+
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);
|
|
29016
29455
|
};
|
|
29017
29456
|
const group = (label, agents) => {
|
|
29018
29457
|
if (agents.length === 0) return null;
|
|
29019
29458
|
const baseDir = agents[0]?.baseDir;
|
|
29020
|
-
return /* @__PURE__ */
|
|
29459
|
+
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));
|
|
29021
29460
|
};
|
|
29022
29461
|
const builtInSection = (label = "Built-in (always available):") => {
|
|
29023
29462
|
const builtIn = props.agents.filter((a) => a.source === "built-in");
|
|
29024
29463
|
if (builtIn.length === 0) return null;
|
|
29025
|
-
return /* @__PURE__ */
|
|
29464
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React106.createElement(Text83, { bold: true, dimColor: true }, label), builtIn.map(renderAgentRow));
|
|
29026
29465
|
};
|
|
29027
29466
|
const notOverriddenCount = props.agents.filter((a) => !a.overriddenBy).length;
|
|
29028
29467
|
const title = titleForSource(props.source);
|
|
29029
29468
|
if (props.agents.length === 0 || props.source !== "built-in" && !props.agents.some((a) => a.source !== "built-in")) {
|
|
29030
|
-
return /* @__PURE__ */
|
|
29469
|
+
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));
|
|
29031
29470
|
}
|
|
29032
|
-
return /* @__PURE__ */
|
|
29471
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
29033
29472
|
Panel,
|
|
29034
29473
|
{
|
|
29035
29474
|
title,
|
|
29036
29475
|
subtitle: `${notOverriddenCount} agents`
|
|
29037
29476
|
},
|
|
29038
|
-
props.changes.length > 0 ? /* @__PURE__ */
|
|
29039
|
-
/* @__PURE__ */
|
|
29477
|
+
props.changes.length > 0 ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, props.changes[props.changes.length - 1])) : null,
|
|
29478
|
+
/* @__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(
|
|
29040
29479
|
"User agents",
|
|
29041
29480
|
props.agents.filter((a) => a.source === "userSettings")
|
|
29042
29481
|
), group(
|
|
@@ -29051,8 +29490,8 @@ function AgentsListView(props) {
|
|
|
29051
29490
|
), group(
|
|
29052
29491
|
"CLI arg agents",
|
|
29053
29492
|
props.agents.filter((a) => a.source === "flagSettings")
|
|
29054
|
-
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */
|
|
29055
|
-
), /* @__PURE__ */
|
|
29493
|
+
), 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)))
|
|
29494
|
+
), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29056
29495
|
}
|
|
29057
29496
|
function wizardLocationToStorageLocation(location) {
|
|
29058
29497
|
return location === "projectSettings" ? "project" : "user";
|
|
@@ -29143,16 +29582,16 @@ function Wizard(props) {
|
|
|
29143
29582
|
cancel
|
|
29144
29583
|
]
|
|
29145
29584
|
);
|
|
29146
|
-
return /* @__PURE__ */
|
|
29585
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, props.steps[stepIndex]?.(ctx) ?? null);
|
|
29147
29586
|
}
|
|
29148
29587
|
function WizardPanel(props) {
|
|
29149
|
-
return /* @__PURE__ */
|
|
29588
|
+
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 }));
|
|
29150
29589
|
}
|
|
29151
29590
|
function StepChooseLocation({ ctx }) {
|
|
29152
29591
|
useInput30((_input, key) => {
|
|
29153
29592
|
if (key.escape) ctx.cancel();
|
|
29154
29593
|
});
|
|
29155
|
-
return /* @__PURE__ */
|
|
29594
|
+
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(
|
|
29156
29595
|
Select,
|
|
29157
29596
|
{
|
|
29158
29597
|
options: [
|
|
@@ -29171,7 +29610,7 @@ function StepChooseMethod({ ctx }) {
|
|
|
29171
29610
|
useInput30((_input, key) => {
|
|
29172
29611
|
if (key.escape) ctx.goBack();
|
|
29173
29612
|
});
|
|
29174
|
-
return /* @__PURE__ */
|
|
29613
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
29175
29614
|
Select,
|
|
29176
29615
|
{
|
|
29177
29616
|
options: [
|
|
@@ -29255,7 +29694,7 @@ function StepGenerationPrompt(props) {
|
|
|
29255
29694
|
abortRef.current = null;
|
|
29256
29695
|
}
|
|
29257
29696
|
};
|
|
29258
|
-
return /* @__PURE__ */
|
|
29697
|
+
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(
|
|
29259
29698
|
TextInput,
|
|
29260
29699
|
{
|
|
29261
29700
|
value,
|
|
@@ -29266,7 +29705,7 @@ function StepGenerationPrompt(props) {
|
|
|
29266
29705
|
cursorOffset,
|
|
29267
29706
|
onChangeCursorOffset: setCursorOffset
|
|
29268
29707
|
}
|
|
29269
|
-
), error ? /* @__PURE__ */
|
|
29708
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null, isGenerating ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "Generating\u2026") : null));
|
|
29270
29709
|
}
|
|
29271
29710
|
function themeColor(kind) {
|
|
29272
29711
|
const theme = getTheme();
|
|
@@ -29302,13 +29741,13 @@ function StepAgentType(props) {
|
|
|
29302
29741
|
ctx.updateWizardData({ agentType: trimmed });
|
|
29303
29742
|
ctx.goNext();
|
|
29304
29743
|
};
|
|
29305
|
-
return /* @__PURE__ */
|
|
29744
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29306
29745
|
WizardPanel,
|
|
29307
29746
|
{
|
|
29308
29747
|
subtitle: "Agent type (identifier)",
|
|
29309
29748
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29310
29749
|
},
|
|
29311
|
-
/* @__PURE__ */
|
|
29750
|
+
/* @__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(
|
|
29312
29751
|
TextInput,
|
|
29313
29752
|
{
|
|
29314
29753
|
value,
|
|
@@ -29318,7 +29757,7 @@ function StepAgentType(props) {
|
|
|
29318
29757
|
cursorOffset,
|
|
29319
29758
|
onChangeCursorOffset: setCursorOffset
|
|
29320
29759
|
}
|
|
29321
|
-
), /* @__PURE__ */
|
|
29760
|
+
), /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "e.g., code-reviewer, tech-lead, etc"), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29322
29761
|
);
|
|
29323
29762
|
}
|
|
29324
29763
|
function StepSystemPrompt({ ctx }) {
|
|
@@ -29339,13 +29778,13 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29339
29778
|
ctx.updateWizardData({ systemPrompt: trimmed });
|
|
29340
29779
|
ctx.goNext();
|
|
29341
29780
|
};
|
|
29342
|
-
return /* @__PURE__ */
|
|
29781
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29343
29782
|
WizardPanel,
|
|
29344
29783
|
{
|
|
29345
29784
|
subtitle: "System prompt",
|
|
29346
29785
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29347
29786
|
},
|
|
29348
|
-
/* @__PURE__ */
|
|
29787
|
+
/* @__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(
|
|
29349
29788
|
TextInput,
|
|
29350
29789
|
{
|
|
29351
29790
|
value,
|
|
@@ -29356,7 +29795,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29356
29795
|
cursorOffset,
|
|
29357
29796
|
onChangeCursorOffset: setCursorOffset
|
|
29358
29797
|
}
|
|
29359
|
-
), error ? /* @__PURE__ */
|
|
29798
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29360
29799
|
);
|
|
29361
29800
|
}
|
|
29362
29801
|
function StepDescription({ ctx }) {
|
|
@@ -29377,13 +29816,13 @@ function StepDescription({ ctx }) {
|
|
|
29377
29816
|
ctx.updateWizardData({ whenToUse: trimmed });
|
|
29378
29817
|
ctx.goNext();
|
|
29379
29818
|
};
|
|
29380
|
-
return /* @__PURE__ */
|
|
29819
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29381
29820
|
WizardPanel,
|
|
29382
29821
|
{
|
|
29383
29822
|
subtitle: "Description (tell Claude when to use this agent)",
|
|
29384
29823
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29385
29824
|
},
|
|
29386
|
-
/* @__PURE__ */
|
|
29825
|
+
/* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text83, null, "When should Claude use this agent?"), /* @__PURE__ */ React106.createElement(
|
|
29387
29826
|
TextInput,
|
|
29388
29827
|
{
|
|
29389
29828
|
value,
|
|
@@ -29394,7 +29833,7 @@ function StepDescription({ ctx }) {
|
|
|
29394
29833
|
cursorOffset,
|
|
29395
29834
|
onChangeCursorOffset: setCursorOffset
|
|
29396
29835
|
}
|
|
29397
|
-
), error ? /* @__PURE__ */
|
|
29836
|
+
), error ? /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
29398
29837
|
);
|
|
29399
29838
|
}
|
|
29400
29839
|
function ToolPicker(props) {
|
|
@@ -29553,12 +29992,12 @@ function ToolPicker(props) {
|
|
|
29553
29992
|
return;
|
|
29554
29993
|
}
|
|
29555
29994
|
});
|
|
29556
|
-
return /* @__PURE__ */
|
|
29995
|
+
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) => {
|
|
29557
29996
|
const index = idx + 1;
|
|
29558
29997
|
const focused = index === cursorIndex;
|
|
29559
29998
|
const prefix = item.isHeader ? "" : focused ? `${figures9.pointer} ` : " ";
|
|
29560
|
-
return /* @__PURE__ */
|
|
29561
|
-
|
|
29999
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React106.createElement(Text83, { dimColor: true }, "\u2500".repeat(40)) : null, /* @__PURE__ */ React106.createElement(
|
|
30000
|
+
Text83,
|
|
29562
30001
|
{
|
|
29563
30002
|
dimColor: item.isHeader,
|
|
29564
30003
|
color: !item.isHeader && focused ? themeColor("suggestion") : void 0,
|
|
@@ -29566,12 +30005,12 @@ function ToolPicker(props) {
|
|
|
29566
30005
|
},
|
|
29567
30006
|
item.isToggle ? `${prefix}[ ${item.label} ]` : `${prefix}${item.label}`
|
|
29568
30007
|
));
|
|
29569
|
-
}), /* @__PURE__ */
|
|
30008
|
+
}), /* @__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`)));
|
|
29570
30009
|
}
|
|
29571
30010
|
function StepSelectTools(props) {
|
|
29572
30011
|
const { ctx } = props;
|
|
29573
30012
|
const initialTools = ctx.wizardData.selectedTools;
|
|
29574
|
-
return /* @__PURE__ */
|
|
30013
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Create new agent", subtitle: "Select tools" }, /* @__PURE__ */ React106.createElement(
|
|
29575
30014
|
ToolPicker,
|
|
29576
30015
|
{
|
|
29577
30016
|
tools: props.tools,
|
|
@@ -29582,7 +30021,7 @@ function StepSelectTools(props) {
|
|
|
29582
30021
|
},
|
|
29583
30022
|
onCancel: ctx.goBack
|
|
29584
30023
|
}
|
|
29585
|
-
)), /* @__PURE__ */
|
|
30024
|
+
)), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
29586
30025
|
}
|
|
29587
30026
|
function StepSelectModel({ ctx }) {
|
|
29588
30027
|
useInput30((_input, key) => {
|
|
@@ -29590,7 +30029,7 @@ function StepSelectModel({ ctx }) {
|
|
|
29590
30029
|
});
|
|
29591
30030
|
const options = modelOptions();
|
|
29592
30031
|
const defaultValue = ctx.wizardData.selectedModel ?? DEFAULT_AGENT_MODEL;
|
|
29593
|
-
return /* @__PURE__ */
|
|
30032
|
+
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(
|
|
29594
30033
|
Select,
|
|
29595
30034
|
{
|
|
29596
30035
|
options,
|
|
@@ -29611,12 +30050,12 @@ function ColorPicker(props) {
|
|
|
29611
30050
|
else if (key.downArrow) setIndex((i) => i < COLOR_OPTIONS.length - 1 ? i + 1 : 0);
|
|
29612
30051
|
else if (key.return) props.onConfirm(COLOR_OPTIONS[index] ?? "automatic");
|
|
29613
30052
|
});
|
|
29614
|
-
return /* @__PURE__ */
|
|
30053
|
+
return /* @__PURE__ */ React106.createElement(Box79, { flexDirection: "column", gap: 1 }, COLOR_OPTIONS.map((color, i) => {
|
|
29615
30054
|
const focused = i === index;
|
|
29616
30055
|
const prefix = focused ? figures9.pointer : " ";
|
|
29617
30056
|
const label = color === "automatic" ? "Automatic color" : color.charAt(0).toUpperCase() + color.slice(1);
|
|
29618
|
-
return /* @__PURE__ */
|
|
29619
|
-
|
|
30057
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: color }, /* @__PURE__ */ React106.createElement(
|
|
30058
|
+
Text83,
|
|
29620
30059
|
{
|
|
29621
30060
|
color: focused ? themeColor("suggestion") : void 0,
|
|
29622
30061
|
bold: focused
|
|
@@ -29649,7 +30088,7 @@ function StepChooseColor({ ctx }) {
|
|
|
29649
30088
|
});
|
|
29650
30089
|
ctx.goNext();
|
|
29651
30090
|
};
|
|
29652
|
-
return /* @__PURE__ */
|
|
30091
|
+
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 })));
|
|
29653
30092
|
}
|
|
29654
30093
|
function validateFinalAgent(args) {
|
|
29655
30094
|
const errors = [];
|
|
@@ -29714,28 +30153,28 @@ function StepConfirm(props) {
|
|
|
29714
30153
|
});
|
|
29715
30154
|
const locationPath = finalAgent.source === "projectSettings" ? getPrimaryAgentFilePath("project", finalAgent.agentType) : getPrimaryAgentFilePath("user", finalAgent.agentType);
|
|
29716
30155
|
const truncate = (text) => text.length > 240 ? `${text.slice(0, 240)}\u2026` : text;
|
|
29717
|
-
return /* @__PURE__ */
|
|
30156
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29718
30157
|
WizardPanel,
|
|
29719
30158
|
{
|
|
29720
30159
|
subtitle: "Confirm and save",
|
|
29721
30160
|
footerText: "Press s/Enter to save \xB7 e to edit in your editor \xB7 Esc to cancel"
|
|
29722
30161
|
},
|
|
29723
|
-
/* @__PURE__ */
|
|
30162
|
+
/* @__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)
|
|
29724
30163
|
);
|
|
29725
30164
|
}
|
|
29726
30165
|
function CreateAgentWizard(props) {
|
|
29727
30166
|
const steps = useMemo27(() => {
|
|
29728
30167
|
return [
|
|
29729
|
-
(ctx) => /* @__PURE__ */
|
|
29730
|
-
(ctx) => /* @__PURE__ */
|
|
29731
|
-
(ctx) => /* @__PURE__ */
|
|
29732
|
-
(ctx) => /* @__PURE__ */
|
|
29733
|
-
(ctx) => /* @__PURE__ */
|
|
29734
|
-
(ctx) => /* @__PURE__ */
|
|
29735
|
-
(ctx) => /* @__PURE__ */
|
|
29736
|
-
(ctx) => /* @__PURE__ */
|
|
29737
|
-
(ctx) => /* @__PURE__ */
|
|
29738
|
-
(ctx) => /* @__PURE__ */
|
|
30168
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseLocation, { ctx }),
|
|
30169
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseMethod, { ctx }),
|
|
30170
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepGenerationPrompt, { ctx, existingAgents: props.existingAgents }),
|
|
30171
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepAgentType, { ctx, existingAgents: props.existingAgents }),
|
|
30172
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSystemPrompt, { ctx }),
|
|
30173
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepDescription, { ctx }),
|
|
30174
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSelectTools, { ctx, tools: props.tools }),
|
|
30175
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepSelectModel, { ctx }),
|
|
30176
|
+
(ctx) => /* @__PURE__ */ React106.createElement(StepChooseColor, { ctx }),
|
|
30177
|
+
(ctx) => /* @__PURE__ */ React106.createElement(
|
|
29739
30178
|
StepConfirm,
|
|
29740
30179
|
{
|
|
29741
30180
|
ctx,
|
|
@@ -29768,7 +30207,7 @@ function CreateAgentWizard(props) {
|
|
|
29768
30207
|
)
|
|
29769
30208
|
];
|
|
29770
30209
|
}, [props]);
|
|
29771
|
-
return /* @__PURE__ */
|
|
30210
|
+
return /* @__PURE__ */ React106.createElement(
|
|
29772
30211
|
Wizard,
|
|
29773
30212
|
{
|
|
29774
30213
|
steps,
|
|
@@ -29791,13 +30230,13 @@ function AgentMenu(props) {
|
|
|
29791
30230
|
],
|
|
29792
30231
|
{ label: "Back", value: "back" }
|
|
29793
30232
|
];
|
|
29794
|
-
return /* @__PURE__ */
|
|
30233
|
+
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(
|
|
29795
30234
|
Select,
|
|
29796
30235
|
{
|
|
29797
30236
|
options,
|
|
29798
30237
|
onChange: (value) => props.onChoose(value)
|
|
29799
30238
|
}
|
|
29800
|
-
))), /* @__PURE__ */
|
|
30239
|
+
))), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29801
30240
|
}
|
|
29802
30241
|
function ViewAgent(props) {
|
|
29803
30242
|
useInput30((_input, key) => {
|
|
@@ -29833,9 +30272,9 @@ function ViewAgent(props) {
|
|
|
29833
30272
|
const toolsSummary = () => {
|
|
29834
30273
|
if (parsedTools.hasWildcard) return "All tools";
|
|
29835
30274
|
if (!props.agent.tools || props.agent.tools === "*" || props.agent.tools.length === 0) return "None";
|
|
29836
|
-
return /* @__PURE__ */
|
|
30275
|
+
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);
|
|
29837
30276
|
};
|
|
29838
|
-
return /* @__PURE__ */
|
|
30277
|
+
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" }));
|
|
29839
30278
|
}
|
|
29840
30279
|
function EditAgent(props) {
|
|
29841
30280
|
const [mode, setMode] = useState29("menu");
|
|
@@ -29900,7 +30339,7 @@ function EditAgent(props) {
|
|
|
29900
30339
|
}
|
|
29901
30340
|
});
|
|
29902
30341
|
if (mode === "edit-tools") {
|
|
29903
|
-
return /* @__PURE__ */
|
|
30342
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(
|
|
29904
30343
|
ToolPicker,
|
|
29905
30344
|
{
|
|
29906
30345
|
tools: props.tools,
|
|
@@ -29912,10 +30351,10 @@ function EditAgent(props) {
|
|
|
29912
30351
|
},
|
|
29913
30352
|
onCancel: () => setMode("menu")
|
|
29914
30353
|
}
|
|
29915
|
-
), error ? /* @__PURE__ */
|
|
30354
|
+
), 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" }));
|
|
29916
30355
|
}
|
|
29917
30356
|
if (mode === "edit-model") {
|
|
29918
|
-
return /* @__PURE__ */
|
|
30357
|
+
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(
|
|
29919
30358
|
Select,
|
|
29920
30359
|
{
|
|
29921
30360
|
options: modelOptions(),
|
|
@@ -29925,10 +30364,10 @@ function EditAgent(props) {
|
|
|
29925
30364
|
setMode("menu");
|
|
29926
30365
|
}
|
|
29927
30366
|
}
|
|
29928
|
-
)), error ? /* @__PURE__ */
|
|
30367
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29929
30368
|
}
|
|
29930
30369
|
if (mode === "edit-color") {
|
|
29931
|
-
return /* @__PURE__ */
|
|
30370
|
+
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(
|
|
29932
30371
|
ColorPicker,
|
|
29933
30372
|
{
|
|
29934
30373
|
agentName: props.agent.agentType,
|
|
@@ -29938,29 +30377,29 @@ function EditAgent(props) {
|
|
|
29938
30377
|
setMode("menu");
|
|
29939
30378
|
}
|
|
29940
30379
|
}
|
|
29941
|
-
)), error ? /* @__PURE__ */
|
|
30380
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29942
30381
|
}
|
|
29943
|
-
return /* @__PURE__ */
|
|
29944
|
-
|
|
30382
|
+
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(
|
|
30383
|
+
Text83,
|
|
29945
30384
|
{
|
|
29946
30385
|
color: idx === selectedIndex ? themeColor("suggestion") : void 0
|
|
29947
30386
|
},
|
|
29948
30387
|
idx === selectedIndex ? `${figures9.pointer} ` : " ",
|
|
29949
30388
|
item.label
|
|
29950
|
-
)))), error ? /* @__PURE__ */
|
|
30389
|
+
)))), error ? /* @__PURE__ */ React106.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text83, { color: themeColor("error") }, error)) : null)), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29951
30390
|
}
|
|
29952
30391
|
function DeleteConfirm(props) {
|
|
29953
30392
|
useInput30((_input, key) => {
|
|
29954
30393
|
if (key.escape) props.onCancel();
|
|
29955
30394
|
});
|
|
29956
|
-
return /* @__PURE__ */
|
|
30395
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
29957
30396
|
Panel,
|
|
29958
30397
|
{
|
|
29959
30398
|
title: "Delete agent",
|
|
29960
30399
|
borderColor: panelBorderColor("error"),
|
|
29961
30400
|
titleColor: themeColor("error")
|
|
29962
30401
|
},
|
|
29963
|
-
/* @__PURE__ */
|
|
30402
|
+
/* @__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(
|
|
29964
30403
|
Select,
|
|
29965
30404
|
{
|
|
29966
30405
|
options: [
|
|
@@ -29973,7 +30412,7 @@ function DeleteConfirm(props) {
|
|
|
29973
30412
|
}
|
|
29974
30413
|
}
|
|
29975
30414
|
)))
|
|
29976
|
-
), /* @__PURE__ */
|
|
30415
|
+
), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press \u2191\u2193 to navigate, Enter to select, Esc to cancel" }));
|
|
29977
30416
|
}
|
|
29978
30417
|
function AgentsUI({ onExit }) {
|
|
29979
30418
|
const [mode, setMode] = useState29({ mode: "list-agents", source: "all" });
|
|
@@ -30044,10 +30483,10 @@ ${changes.join("\n")}`);
|
|
|
30044
30483
|
onExit("Agents dialog dismissed");
|
|
30045
30484
|
}, [changes, onExit]);
|
|
30046
30485
|
if (loading) {
|
|
30047
|
-
return /* @__PURE__ */
|
|
30486
|
+
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));
|
|
30048
30487
|
}
|
|
30049
30488
|
if (mode.mode === "list-agents") {
|
|
30050
|
-
return /* @__PURE__ */
|
|
30489
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30051
30490
|
AgentsListView,
|
|
30052
30491
|
{
|
|
30053
30492
|
source: mode.source,
|
|
@@ -30060,7 +30499,7 @@ ${changes.join("\n")}`);
|
|
|
30060
30499
|
);
|
|
30061
30500
|
}
|
|
30062
30501
|
if (mode.mode === "create-agent") {
|
|
30063
|
-
return /* @__PURE__ */
|
|
30502
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30064
30503
|
CreateAgentWizard,
|
|
30065
30504
|
{
|
|
30066
30505
|
tools,
|
|
@@ -30075,7 +30514,7 @@ ${changes.join("\n")}`);
|
|
|
30075
30514
|
);
|
|
30076
30515
|
}
|
|
30077
30516
|
if (mode.mode === "agent-menu") {
|
|
30078
|
-
return /* @__PURE__ */
|
|
30517
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30079
30518
|
AgentMenu,
|
|
30080
30519
|
{
|
|
30081
30520
|
agent: mode.agent,
|
|
@@ -30090,7 +30529,7 @@ ${changes.join("\n")}`);
|
|
|
30090
30529
|
);
|
|
30091
30530
|
}
|
|
30092
30531
|
if (mode.mode === "view-agent") {
|
|
30093
|
-
return /* @__PURE__ */
|
|
30532
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30094
30533
|
ViewAgent,
|
|
30095
30534
|
{
|
|
30096
30535
|
agent: mode.agent,
|
|
@@ -30100,7 +30539,7 @@ ${changes.join("\n")}`);
|
|
|
30100
30539
|
);
|
|
30101
30540
|
}
|
|
30102
30541
|
if (mode.mode === "edit-agent") {
|
|
30103
|
-
return /* @__PURE__ */
|
|
30542
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30104
30543
|
EditAgent,
|
|
30105
30544
|
{
|
|
30106
30545
|
agent: mode.agent,
|
|
@@ -30115,7 +30554,7 @@ ${changes.join("\n")}`);
|
|
|
30115
30554
|
);
|
|
30116
30555
|
}
|
|
30117
30556
|
if (mode.mode === "delete-confirm") {
|
|
30118
|
-
return /* @__PURE__ */
|
|
30557
|
+
return /* @__PURE__ */ React106.createElement(
|
|
30119
30558
|
DeleteConfirm,
|
|
30120
30559
|
{
|
|
30121
30560
|
agent: mode.agent,
|
|
@@ -30140,7 +30579,7 @@ var agents_default = {
|
|
|
30140
30579
|
isEnabled: true,
|
|
30141
30580
|
isHidden: false,
|
|
30142
30581
|
async call(onExit) {
|
|
30143
|
-
return /* @__PURE__ */
|
|
30582
|
+
return /* @__PURE__ */ React107.createElement(AgentsUI, { onExit });
|
|
30144
30583
|
},
|
|
30145
30584
|
userFacingName() {
|
|
30146
30585
|
return "agents";
|
|
@@ -30301,7 +30740,7 @@ ${availableLines}${truncatedNotice}
|
|
|
30301
30740
|
return command4 || "";
|
|
30302
30741
|
},
|
|
30303
30742
|
renderToolUseRejectedMessage() {
|
|
30304
|
-
return /* @__PURE__ */
|
|
30743
|
+
return /* @__PURE__ */ React108.createElement(FallbackToolUseRejectedMessage, null);
|
|
30305
30744
|
},
|
|
30306
30745
|
renderResultForAssistant(output) {
|
|
30307
30746
|
return `Launching command: /${output.commandName}`;
|
|
@@ -30457,8 +30896,8 @@ function parseMcpToolName2(name3) {
|
|
|
30457
30896
|
}
|
|
30458
30897
|
|
|
30459
30898
|
// src/tools/system/KillShellTool/KillShellTool.tsx
|
|
30460
|
-
import { Box as
|
|
30461
|
-
import
|
|
30899
|
+
import { Box as Box80, Text as Text84 } from "ink";
|
|
30900
|
+
import React109 from "react";
|
|
30462
30901
|
import { z as z14 } from "zod";
|
|
30463
30902
|
|
|
30464
30903
|
// src/tools/system/KillShellTool/prompt.ts
|
|
@@ -30504,10 +30943,10 @@ var KillShellTool = {
|
|
|
30504
30943
|
return `Kill shell: ${shell_id}`;
|
|
30505
30944
|
},
|
|
30506
30945
|
renderToolUseRejectedMessage() {
|
|
30507
|
-
return /* @__PURE__ */
|
|
30946
|
+
return /* @__PURE__ */ React109.createElement(FallbackToolUseRejectedMessage, null);
|
|
30508
30947
|
},
|
|
30509
30948
|
renderToolResultMessage(output) {
|
|
30510
|
-
return /* @__PURE__ */
|
|
30949
|
+
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"));
|
|
30511
30950
|
},
|
|
30512
30951
|
renderResultForAssistant(output) {
|
|
30513
30952
|
return JSON.stringify(output);
|
|
@@ -31234,8 +31673,8 @@ function WebFetchPermissionRequest({
|
|
|
31234
31673
|
reject();
|
|
31235
31674
|
}
|
|
31236
31675
|
});
|
|
31237
|
-
return /* @__PURE__ */
|
|
31238
|
-
|
|
31676
|
+
return /* @__PURE__ */ React110.createElement(
|
|
31677
|
+
Box81,
|
|
31239
31678
|
{
|
|
31240
31679
|
flexDirection: "column",
|
|
31241
31680
|
borderStyle: "round",
|
|
@@ -31245,14 +31684,14 @@ function WebFetchPermissionRequest({
|
|
|
31245
31684
|
paddingRight: 1,
|
|
31246
31685
|
paddingBottom: 1
|
|
31247
31686
|
},
|
|
31248
|
-
/* @__PURE__ */
|
|
31687
|
+
/* @__PURE__ */ React110.createElement(
|
|
31249
31688
|
PermissionRequestTitle,
|
|
31250
31689
|
{
|
|
31251
31690
|
title: "Network request outside of sandbox",
|
|
31252
31691
|
riskScore: null
|
|
31253
31692
|
}
|
|
31254
31693
|
),
|
|
31255
|
-
/* @__PURE__ */
|
|
31694
|
+
/* @__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(
|
|
31256
31695
|
Select,
|
|
31257
31696
|
{
|
|
31258
31697
|
options: [
|
|
@@ -31624,10 +32063,10 @@ var BashTool = {
|
|
|
31624
32063
|
return withDescription(base.trim());
|
|
31625
32064
|
},
|
|
31626
32065
|
renderToolUseRejectedMessage() {
|
|
31627
|
-
return /* @__PURE__ */
|
|
32066
|
+
return /* @__PURE__ */ React111.createElement(FallbackToolUseRejectedMessage, null);
|
|
31628
32067
|
},
|
|
31629
32068
|
renderToolResultMessage(content) {
|
|
31630
|
-
return /* @__PURE__ */
|
|
32069
|
+
return /* @__PURE__ */ React111.createElement(BashToolResultMessage_default, { content, verbose: false });
|
|
31631
32070
|
},
|
|
31632
32071
|
renderResultForAssistant({
|
|
31633
32072
|
interrupted,
|
|
@@ -31868,7 +32307,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
|
|
|
31868
32307
|
}
|
|
31869
32308
|
};
|
|
31870
32309
|
setToolJSX({
|
|
31871
|
-
jsx: /* @__PURE__ */
|
|
32310
|
+
jsx: /* @__PURE__ */ React111.createElement(
|
|
31872
32311
|
WebFetchPermissionRequest,
|
|
31873
32312
|
{
|
|
31874
32313
|
toolUseConfirm,
|
|
@@ -32064,7 +32503,7 @@ ${footerParts.join(" ")}`;
|
|
|
32064
32503
|
if (!overlayShown && setToolJSX && Date.now() - startedAt >= PROGRESS_INITIAL_DELAY_MS) {
|
|
32065
32504
|
overlayShown = true;
|
|
32066
32505
|
setToolJSX({
|
|
32067
|
-
jsx: /* @__PURE__ */
|
|
32506
|
+
jsx: /* @__PURE__ */ React111.createElement(
|
|
32068
32507
|
BashToolRunInBackgroundOverlay,
|
|
32069
32508
|
{
|
|
32070
32509
|
onBackground: requestBackground
|