pybao-cli 1.4.63 → 1.4.68
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-6LXLSOII.js +46 -0
- package/dist/{acp-5QDBNRRE.js → acp-RBZLK5I5.js} +29 -29
- package/dist/{agentsValidate-B367IG6U.js → agentsValidate-4WPUQRIU.js} +7 -7
- package/dist/{ask-3CPXGOLO.js → ask-E7CHIPZA.js} +28 -28
- package/dist/{autoUpdater-35UXWLT6.js → autoUpdater-VJML5LAO.js} +3 -3
- package/dist/{chunk-DGRO3L2U.js → chunk-2EJTMBGJ.js} +1 -1
- package/dist/{chunk-J3JUMIML.js → chunk-2V6NJ7DW.js} +2 -2
- package/dist/{chunk-S3NCVAKW.js → chunk-3PPYB2AK.js} +2 -2
- package/dist/{chunk-U5DK6DKX.js → chunk-5AIERJLG.js} +1 -1
- package/dist/{chunk-575TOTN2.js → chunk-5O3GVP7Z.js} +4 -4
- package/dist/{chunk-YNQF2C25.js → chunk-7LDPOZZ6.js} +2 -2
- package/dist/{chunk-V34SLB5U.js → chunk-7NCAJ2EJ.js} +2 -2
- package/dist/{chunk-UTOIHV4R.js → chunk-BEQTINGU.js} +2 -2
- package/dist/{chunk-MU6B2VQ4.js → chunk-C5LUBN6T.js} +2 -2
- package/dist/{chunk-5SKQV673.js → chunk-DDHVXTMC.js} +2 -2
- package/dist/{chunk-HT2QSRG6.js → chunk-EE2HU2RS.js} +1 -1
- package/dist/{chunk-MHTCXNXA.js → chunk-FQBUFFT7.js} +1 -1
- package/dist/{chunk-K3MMFNWK.js → chunk-GF57CLFI.js} +1 -1
- package/dist/{chunk-K3MMFNWK.js.map → chunk-GF57CLFI.js.map} +1 -1
- package/dist/{chunk-JMV4MDYP.js → chunk-HPWXOI2K.js} +17 -17
- package/dist/{chunk-JMV4MDYP.js.map → chunk-HPWXOI2K.js.map} +1 -1
- package/dist/{chunk-G4UKRVHC.js → chunk-ISBXNGQB.js} +1 -1
- package/dist/{chunk-ELMOCWI7.js → chunk-KLSIXVFM.js} +373 -671
- package/dist/{chunk-ELMOCWI7.js.map → chunk-KLSIXVFM.js.map} +4 -4
- package/dist/{chunk-MINE35O7.js → chunk-KVHO4FHL.js} +1 -1
- package/dist/{chunk-VTL4JKRR.js → chunk-LYA52DLL.js} +1 -1
- package/dist/{chunk-XKDUG5NH.js → chunk-NN2VFVIX.js} +3 -3
- package/dist/{chunk-O35VWHXM.js → chunk-OGXQURMW.js} +4 -4
- package/dist/{chunk-26XVUVWY.js → chunk-PYASW53S.js} +3 -3
- package/dist/{chunk-EGHZGCL6.js → chunk-QEV4V7JC.js} +3 -3
- package/dist/{chunk-CV67HJEB.js → chunk-UDEREIRJ.js} +4 -4
- package/dist/{chunk-COUDVAGK.js → chunk-XOSFFE2Y.js} +3 -3
- package/dist/{chunk-EKFYPTGN.js → chunk-XSR4HZ53.js} +3 -3
- package/dist/{chunk-AT4J7MOM.js → chunk-Y4PZVDDV.js} +4 -4
- package/dist/{chunk-32Q7FT7L.js → chunk-Y7FNVY2D.js} +1 -1
- package/dist/{chunk-54AMRMDD.js → chunk-Z37IW5CA.js} +3 -5
- package/dist/chunk-Z37IW5CA.js.map +7 -0
- package/dist/{chunk-JHXV6Q6F.js → chunk-ZHVCG35Z.js} +1 -1
- package/dist/{chunk-GCJ4WAVU.js → chunk-ZQCSH2AL.js} +3 -3
- package/dist/{cli-I6IZLYZL.js → cli-F74NJUHW.js} +87 -87
- package/dist/commands-HL6HBYHQ.js +50 -0
- package/dist/{config-6YHGZWHJ.js → config-U6OMMOIX.js} +4 -4
- package/dist/{context-CKDOG72T.js → context-SRTP4GIV.js} +6 -6
- package/dist/{customCommands-6AKUHGFZ.js → customCommands-UQ7GWOJ4.js} +4 -4
- package/dist/{env-YLAC6QCC.js → env-RSGBO3MI.js} +2 -2
- package/dist/{file-QUKVDIUZ.js → file-DDLPA2J4.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-Y7Q634YT.js → llm-VY6RXJY7.js} +29 -29
- package/dist/{llmLazy-IGTRWGRN.js → llmLazy-LQ6IPPZV.js} +1 -1
- package/dist/{loader-5M2R3M2D.js → loader-WVZDAGRL.js} +4 -4
- package/dist/{lsp-QIOSQUNB.js → lsp-2PB45IFR.js} +6 -6
- package/dist/{lspAnchor-R66G3QH6.js → lspAnchor-FK5YBDE6.js} +6 -6
- package/dist/{mcp-LDR2HGAG.js → mcp-CDUXVXDY.js} +7 -7
- package/dist/{mentionProcessor-ZTUWMWSM.js → mentionProcessor-5JPXBDX4.js} +5 -5
- package/dist/{messages-CUXTZ7R4.js → messages-ALZZJK3V.js} +1 -1
- package/dist/{model-NX4M2CNS.js → model-BVFVXXKO.js} +5 -5
- package/dist/{openai-UXLA5ELC.js → openai-OJOPD7MA.js} +5 -5
- package/dist/{outputStyles-HPVGQS3R.js → outputStyles-HFX7LO4Y.js} +4 -4
- package/dist/{pluginRuntime-DPSLKXM4.js → pluginRuntime-PWEYBXJ4.js} +6 -6
- package/dist/{pluginValidation-DDTUIJZA.js → pluginValidation-UOPYDU5C.js} +6 -6
- package/dist/prompts-MGPNIHJM.js +52 -0
- package/dist/{pybAgentSessionLoad-ONZSDTU4.js → pybAgentSessionLoad-KL57MVY7.js} +4 -4
- package/dist/{pybAgentSessionResume-3EOMMP23.js → pybAgentSessionResume-BR77W4UQ.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-QHFHCC2H.js → pybAgentStreamJsonSession-4PNNMAVB.js} +1 -1
- package/dist/{pybHooks-5QNPMWGV.js → pybHooks-Z4C23UQN.js} +4 -4
- package/dist/query-SGRPX3AO.js +54 -0
- package/dist/{registry-HHOZIHLX.js → registry-3YHU4UGY.js} +5 -5
- package/dist/{ripgrep-RZRBKALT.js → ripgrep-DU7WTPTQ.js} +3 -3
- package/dist/{skillMarketplace-76KSG4RM.js → skillMarketplace-D4I6ZI53.js} +3 -3
- package/dist/{state-2FQS3U4Y.js → state-GH6RNHJT.js} +2 -2
- package/dist/{theme-XPR5FD3R.js → theme-GS3EV5EN.js} +5 -5
- package/dist/{toolPermissionSettings-QJMDUL2C.js → toolPermissionSettings-X2E6BA4Z.js} +6 -6
- package/dist/tools-57A33JBX.js +51 -0
- package/dist/{userInput-SFXIUTPN.js → userInput-H2LOGQOX.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-VVHH2KM2.js +0 -46
- package/dist/chunk-54AMRMDD.js.map +0 -7
- package/dist/commands-MYVU5L6Z.js +0 -50
- package/dist/prompts-33SUBTAU.js +0 -52
- package/dist/query-B3OWD6AW.js +0 -54
- package/dist/tools-MB5YZ2II.js +0 -51
- /package/dist/{REPL-VVHH2KM2.js.map → REPL-6LXLSOII.js.map} +0 -0
- /package/dist/{acp-5QDBNRRE.js.map → acp-RBZLK5I5.js.map} +0 -0
- /package/dist/{agentsValidate-B367IG6U.js.map → agentsValidate-4WPUQRIU.js.map} +0 -0
- /package/dist/{ask-3CPXGOLO.js.map → ask-E7CHIPZA.js.map} +0 -0
- /package/dist/{autoUpdater-35UXWLT6.js.map → autoUpdater-VJML5LAO.js.map} +0 -0
- /package/dist/{chunk-DGRO3L2U.js.map → chunk-2EJTMBGJ.js.map} +0 -0
- /package/dist/{chunk-J3JUMIML.js.map → chunk-2V6NJ7DW.js.map} +0 -0
- /package/dist/{chunk-S3NCVAKW.js.map → chunk-3PPYB2AK.js.map} +0 -0
- /package/dist/{chunk-U5DK6DKX.js.map → chunk-5AIERJLG.js.map} +0 -0
- /package/dist/{chunk-575TOTN2.js.map → chunk-5O3GVP7Z.js.map} +0 -0
- /package/dist/{chunk-YNQF2C25.js.map → chunk-7LDPOZZ6.js.map} +0 -0
- /package/dist/{chunk-V34SLB5U.js.map → chunk-7NCAJ2EJ.js.map} +0 -0
- /package/dist/{chunk-UTOIHV4R.js.map → chunk-BEQTINGU.js.map} +0 -0
- /package/dist/{chunk-MU6B2VQ4.js.map → chunk-C5LUBN6T.js.map} +0 -0
- /package/dist/{chunk-5SKQV673.js.map → chunk-DDHVXTMC.js.map} +0 -0
- /package/dist/{chunk-HT2QSRG6.js.map → chunk-EE2HU2RS.js.map} +0 -0
- /package/dist/{chunk-MHTCXNXA.js.map → chunk-FQBUFFT7.js.map} +0 -0
- /package/dist/{chunk-G4UKRVHC.js.map → chunk-ISBXNGQB.js.map} +0 -0
- /package/dist/{chunk-MINE35O7.js.map → chunk-KVHO4FHL.js.map} +0 -0
- /package/dist/{chunk-VTL4JKRR.js.map → chunk-LYA52DLL.js.map} +0 -0
- /package/dist/{chunk-XKDUG5NH.js.map → chunk-NN2VFVIX.js.map} +0 -0
- /package/dist/{chunk-O35VWHXM.js.map → chunk-OGXQURMW.js.map} +0 -0
- /package/dist/{chunk-26XVUVWY.js.map → chunk-PYASW53S.js.map} +0 -0
- /package/dist/{chunk-EGHZGCL6.js.map → chunk-QEV4V7JC.js.map} +0 -0
- /package/dist/{chunk-CV67HJEB.js.map → chunk-UDEREIRJ.js.map} +0 -0
- /package/dist/{chunk-COUDVAGK.js.map → chunk-XOSFFE2Y.js.map} +0 -0
- /package/dist/{chunk-EKFYPTGN.js.map → chunk-XSR4HZ53.js.map} +0 -0
- /package/dist/{chunk-AT4J7MOM.js.map → chunk-Y4PZVDDV.js.map} +0 -0
- /package/dist/{chunk-32Q7FT7L.js.map → chunk-Y7FNVY2D.js.map} +0 -0
- /package/dist/{chunk-JHXV6Q6F.js.map → chunk-ZHVCG35Z.js.map} +0 -0
- /package/dist/{chunk-GCJ4WAVU.js.map → chunk-ZQCSH2AL.js.map} +0 -0
- /package/dist/{cli-I6IZLYZL.js.map → cli-F74NJUHW.js.map} +0 -0
- /package/dist/{commands-MYVU5L6Z.js.map → commands-HL6HBYHQ.js.map} +0 -0
- /package/dist/{config-6YHGZWHJ.js.map → config-U6OMMOIX.js.map} +0 -0
- /package/dist/{context-CKDOG72T.js.map → context-SRTP4GIV.js.map} +0 -0
- /package/dist/{customCommands-6AKUHGFZ.js.map → customCommands-UQ7GWOJ4.js.map} +0 -0
- /package/dist/{env-YLAC6QCC.js.map → env-RSGBO3MI.js.map} +0 -0
- /package/dist/{file-QUKVDIUZ.js.map → file-DDLPA2J4.js.map} +0 -0
- /package/dist/{llm-Y7Q634YT.js.map → llm-VY6RXJY7.js.map} +0 -0
- /package/dist/{llmLazy-IGTRWGRN.js.map → llmLazy-LQ6IPPZV.js.map} +0 -0
- /package/dist/{loader-5M2R3M2D.js.map → loader-WVZDAGRL.js.map} +0 -0
- /package/dist/{lsp-QIOSQUNB.js.map → lsp-2PB45IFR.js.map} +0 -0
- /package/dist/{lspAnchor-R66G3QH6.js.map → lspAnchor-FK5YBDE6.js.map} +0 -0
- /package/dist/{mcp-LDR2HGAG.js.map → mcp-CDUXVXDY.js.map} +0 -0
- /package/dist/{mentionProcessor-ZTUWMWSM.js.map → mentionProcessor-5JPXBDX4.js.map} +0 -0
- /package/dist/{messages-CUXTZ7R4.js.map → messages-ALZZJK3V.js.map} +0 -0
- /package/dist/{model-NX4M2CNS.js.map → model-BVFVXXKO.js.map} +0 -0
- /package/dist/{openai-UXLA5ELC.js.map → openai-OJOPD7MA.js.map} +0 -0
- /package/dist/{outputStyles-HPVGQS3R.js.map → outputStyles-HFX7LO4Y.js.map} +0 -0
- /package/dist/{pluginRuntime-DPSLKXM4.js.map → pluginRuntime-PWEYBXJ4.js.map} +0 -0
- /package/dist/{pluginValidation-DDTUIJZA.js.map → pluginValidation-UOPYDU5C.js.map} +0 -0
- /package/dist/{prompts-33SUBTAU.js.map → prompts-MGPNIHJM.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-ONZSDTU4.js.map → pybAgentSessionLoad-KL57MVY7.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-3EOMMP23.js.map → pybAgentSessionResume-BR77W4UQ.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-QHFHCC2H.js.map → pybAgentStreamJsonSession-4PNNMAVB.js.map} +0 -0
- /package/dist/{pybHooks-5QNPMWGV.js.map → pybHooks-Z4C23UQN.js.map} +0 -0
- /package/dist/{query-B3OWD6AW.js.map → query-SGRPX3AO.js.map} +0 -0
- /package/dist/{registry-HHOZIHLX.js.map → registry-3YHU4UGY.js.map} +0 -0
- /package/dist/{ripgrep-RZRBKALT.js.map → ripgrep-DU7WTPTQ.js.map} +0 -0
- /package/dist/{skillMarketplace-76KSG4RM.js.map → skillMarketplace-D4I6ZI53.js.map} +0 -0
- /package/dist/{state-2FQS3U4Y.js.map → state-GH6RNHJT.js.map} +0 -0
- /package/dist/{theme-XPR5FD3R.js.map → theme-GS3EV5EN.js.map} +0 -0
- /package/dist/{toolPermissionSettings-QJMDUL2C.js.map → toolPermissionSettings-X2E6BA4Z.js.map} +0 -0
- /package/dist/{tools-MB5YZ2II.js.map → tools-57A33JBX.js.map} +0 -0
- /package/dist/{userInput-SFXIUTPN.js.map → userInput-H2LOGQOX.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-QEV4V7JC.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Y7FNVY2D.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FQBUFFT7.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DDHVXTMC.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-NN2VFVIX.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-7NCAJ2EJ.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures,
|
|
42
42
|
getSessionState
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-3PPYB2AK.js";
|
|
44
44
|
import {
|
|
45
45
|
queryLLM,
|
|
46
46
|
queryQuick,
|
|
47
47
|
verifyApiKey
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-5O3GVP7Z.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-OGXQURMW.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-KVHO4FHL.js";
|
|
76
76
|
import {
|
|
77
77
|
loadToolPermissionContextFromDisk,
|
|
78
78
|
persistToolPermissionUpdateToDisk
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-XOSFFE2Y.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-C5LUBN6T.js";
|
|
91
91
|
import {
|
|
92
92
|
clearAgentCache,
|
|
93
93
|
getActiveAgents,
|
|
94
94
|
getAgentByType,
|
|
95
95
|
getAllAgents
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-7LDPOZZ6.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-EE2HU2RS.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-BEQTINGU.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-UDEREIRJ.js";
|
|
168
168
|
import {
|
|
169
169
|
getSettingsFileCandidates,
|
|
170
170
|
loadSettingsWithLegacyFallback,
|
|
171
171
|
readSettingsFile
|
|
172
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-ISBXNGQB.js";
|
|
173
173
|
import {
|
|
174
174
|
getCustomCommandDirectories,
|
|
175
175
|
hasCustomCommands,
|
|
176
176
|
loadCustomCommands,
|
|
177
177
|
reloadCustomCommands
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-2V6NJ7DW.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-PYASW53S.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-Y4PZVDDV.js";
|
|
195
195
|
import {
|
|
196
196
|
ripGrep
|
|
197
|
-
} from "./chunk-
|
|
197
|
+
} from "./chunk-2EJTMBGJ.js";
|
|
198
198
|
import {
|
|
199
199
|
getTheme
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-5AIERJLG.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-Z37IW5CA.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-ZHVCG35Z.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-LYA52DLL.js";
|
|
264
264
|
import {
|
|
265
265
|
MACRO
|
|
266
|
-
} from "./chunk-
|
|
266
|
+
} from "./chunk-GF57CLFI.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 React110 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-VY6RXJY7.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-VY6RXJY7.js");
|
|
4250
4250
|
const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
|
|
4251
4251
|
const messages = [
|
|
4252
4252
|
{
|
|
@@ -5265,8 +5265,8 @@ ${formatted}`;
|
|
|
5265
5265
|
};
|
|
5266
5266
|
|
|
5267
5267
|
// src/ui/components/permissions/web-fetch-permission-request/WebFetchPermissionRequest.tsx
|
|
5268
|
-
import { Box as
|
|
5269
|
-
import
|
|
5268
|
+
import { Box as Box80, Text as Text84, useInput as useInput31 } from "ink";
|
|
5269
|
+
import React109, { useMemo as useMemo28 } from "react";
|
|
5270
5270
|
import chalk16 from "chalk";
|
|
5271
5271
|
|
|
5272
5272
|
// src/ui/components/custom-select/select.tsx
|
|
@@ -6643,7 +6643,7 @@ var FileEditTool = {
|
|
|
6643
6643
|
const originalFileContent = currentFileContent;
|
|
6644
6644
|
let totalPatch = [];
|
|
6645
6645
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6646
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6646
|
+
const { findLspAnchor } = await import("./lspAnchor-FK5YBDE6.js");
|
|
6647
6647
|
for (const op of editOperations) {
|
|
6648
6648
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6649
6649
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -8909,7 +8909,7 @@ var WebSearchTool = {
|
|
|
8909
8909
|
|
|
8910
8910
|
// src/tools/interaction/SlashCommandTool/SlashCommandTool.tsx
|
|
8911
8911
|
import { z as z13 } from "zod";
|
|
8912
|
-
import * as
|
|
8912
|
+
import * as React107 from "react";
|
|
8913
8913
|
|
|
8914
8914
|
// src/ui/components/Bug.tsx
|
|
8915
8915
|
import { Box as Box17, Text as Text19, useInput as useInput5 } from "ink";
|
|
@@ -11278,7 +11278,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11278
11278
|
}
|
|
11279
11279
|
saveGlobalConfig(config2);
|
|
11280
11280
|
try {
|
|
11281
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11281
|
+
const { resetAnthropicClient } = await import("./llm-VY6RXJY7.js");
|
|
11282
11282
|
resetAnthropicClient();
|
|
11283
11283
|
} catch {
|
|
11284
11284
|
}
|
|
@@ -15645,7 +15645,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15645
15645
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15646
15646
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15647
15647
|
if (dirs.length === 0) return [];
|
|
15648
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15648
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-PWEYBXJ4.js");
|
|
15649
15649
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15650
15650
|
return errors;
|
|
15651
15651
|
}
|
|
@@ -16314,7 +16314,7 @@ async function call(onDone, context) {
|
|
|
16314
16314
|
ModelConfig,
|
|
16315
16315
|
{
|
|
16316
16316
|
onClose: () => {
|
|
16317
|
-
import("./model-
|
|
16317
|
+
import("./model-BVFVXXKO.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
16318
16318
|
reloadModelManager2();
|
|
16319
16319
|
triggerModelConfigChange();
|
|
16320
16320
|
onDone();
|
|
@@ -17448,14 +17448,14 @@ async function call2(onDone, context) {
|
|
|
17448
17448
|
}
|
|
17449
17449
|
|
|
17450
17450
|
// src/commands/resume.tsx
|
|
17451
|
-
import * as
|
|
17451
|
+
import * as React104 from "react";
|
|
17452
17452
|
|
|
17453
17453
|
// src/ui/screens/ResumeConversation.tsx
|
|
17454
|
-
import
|
|
17454
|
+
import React103 from "react";
|
|
17455
17455
|
import { render } from "ink";
|
|
17456
17456
|
|
|
17457
17457
|
// src/ui/screens/REPL.tsx
|
|
17458
|
-
import { Box as
|
|
17458
|
+
import { Box as Box76, Newline as Newline4, Static as Static2 } from "ink";
|
|
17459
17459
|
|
|
17460
17460
|
// src/ui/components/CostThresholdDialog.tsx
|
|
17461
17461
|
import { Box as Box37, Text as Text42, useInput as useInput17 } from "ink";
|
|
@@ -17508,7 +17508,7 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17508
17508
|
}
|
|
17509
17509
|
|
|
17510
17510
|
// src/ui/screens/REPL.tsx
|
|
17511
|
-
import * as
|
|
17511
|
+
import * as React101 from "react";
|
|
17512
17512
|
import { useEffect as useEffect26, useMemo as useMemo26, useRef as useRef13, useState as useState28, useCallback as useCallback16 } from "react";
|
|
17513
17513
|
|
|
17514
17514
|
// src/ui/components/Message.tsx
|
|
@@ -19762,29 +19762,15 @@ function TaskPanel({
|
|
|
19762
19762
|
}), hidden.length > 0 ? /* @__PURE__ */ React74.createElement(Text59, null, "\u2026 +", hiddenPending > 0 ? hiddenPending : hidden.length, " pending") : null);
|
|
19763
19763
|
}
|
|
19764
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
|
-
|
|
19779
19765
|
// src/ui/components/permissions/PermissionRequest.tsx
|
|
19780
19766
|
import { useInput as useInput25 } from "ink";
|
|
19781
|
-
import * as
|
|
19767
|
+
import * as React92 from "react";
|
|
19782
19768
|
|
|
19783
19769
|
// src/ui/components/permissions/file-edit-permission-request/FileEditPermissionRequest.tsx
|
|
19784
19770
|
import chalk7 from "chalk";
|
|
19785
|
-
import { Box as
|
|
19771
|
+
import { Box as Box57, Text as Text62, useInput as useInput19 } from "ink";
|
|
19786
19772
|
import { basename, dirname as dirname5, extname as extname6 } from "path";
|
|
19787
|
-
import
|
|
19773
|
+
import React77, { useCallback as useCallback8, useMemo as useMemo15 } from "react";
|
|
19788
19774
|
|
|
19789
19775
|
// src/ui/hooks/usePermissionRequestLogging.ts
|
|
19790
19776
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -19812,8 +19798,8 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) {
|
|
|
19812
19798
|
}
|
|
19813
19799
|
|
|
19814
19800
|
// src/ui/components/permissions/PermissionRequestTitle.tsx
|
|
19815
|
-
import * as
|
|
19816
|
-
import { Box as
|
|
19801
|
+
import * as React75 from "react";
|
|
19802
|
+
import { Box as Box55, Text as Text60 } from "ink";
|
|
19817
19803
|
function categoryForRiskScore(riskScore) {
|
|
19818
19804
|
return riskScore >= 70 ? "high" : riskScore >= 30 ? "moderate" : "low";
|
|
19819
19805
|
}
|
|
@@ -19848,20 +19834,20 @@ function PermissionRiskScore({
|
|
|
19848
19834
|
riskScore
|
|
19849
19835
|
}) {
|
|
19850
19836
|
const category = categoryForRiskScore(riskScore);
|
|
19851
|
-
return /* @__PURE__ */
|
|
19837
|
+
return /* @__PURE__ */ React75.createElement(Text60, { color: textColorForRiskScore(riskScore) }, "Risk: ", category);
|
|
19852
19838
|
}
|
|
19853
19839
|
function PermissionRequestTitle({
|
|
19854
19840
|
title,
|
|
19855
19841
|
riskScore
|
|
19856
19842
|
}) {
|
|
19857
|
-
return /* @__PURE__ */
|
|
19843
|
+
return /* @__PURE__ */ React75.createElement(Box55, { flexDirection: "column" }, /* @__PURE__ */ React75.createElement(Text60, { bold: true, color: getTheme().permission }, title), riskScore !== null && /* @__PURE__ */ React75.createElement(PermissionRiskScore, { riskScore }));
|
|
19858
19844
|
}
|
|
19859
19845
|
|
|
19860
19846
|
// src/ui/components/permissions/file-edit-permission-request/FileEditToolDiff.tsx
|
|
19861
|
-
import * as
|
|
19847
|
+
import * as React76 from "react";
|
|
19862
19848
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
19863
19849
|
import { useMemo as useMemo14 } from "react";
|
|
19864
|
-
import { Box as
|
|
19850
|
+
import { Box as Box56, Text as Text61 } from "ink";
|
|
19865
19851
|
import { relative as relative10 } from "path";
|
|
19866
19852
|
function FileEditToolDiff({
|
|
19867
19853
|
file_path,
|
|
@@ -19884,17 +19870,17 @@ function FileEditToolDiff({
|
|
|
19884
19870
|
}),
|
|
19885
19871
|
[file_path, file, old_string, new_string]
|
|
19886
19872
|
);
|
|
19887
|
-
return /* @__PURE__ */
|
|
19888
|
-
|
|
19873
|
+
return /* @__PURE__ */ React76.createElement(Box56, { flexDirection: "column" }, /* @__PURE__ */ React76.createElement(
|
|
19874
|
+
Box56,
|
|
19889
19875
|
{
|
|
19890
19876
|
borderColor: getTheme().secondaryBorder,
|
|
19891
19877
|
borderStyle: useBorder ? "round" : void 0,
|
|
19892
19878
|
flexDirection: "column",
|
|
19893
19879
|
paddingX: 1
|
|
19894
19880
|
},
|
|
19895
|
-
/* @__PURE__ */
|
|
19881
|
+
/* @__PURE__ */ React76.createElement(Box56, { paddingBottom: 1 }, /* @__PURE__ */ React76.createElement(Text61, { bold: true }, verbose ? file_path : relative10(getCwd(), file_path))),
|
|
19896
19882
|
intersperse(
|
|
19897
|
-
patch.map((_) => /* @__PURE__ */
|
|
19883
|
+
patch.map((_) => /* @__PURE__ */ React76.createElement(
|
|
19898
19884
|
StructuredDiff,
|
|
19899
19885
|
{
|
|
19900
19886
|
key: _.newStart,
|
|
@@ -19903,7 +19889,7 @@ function FileEditToolDiff({
|
|
|
19903
19889
|
width
|
|
19904
19890
|
}
|
|
19905
19891
|
)),
|
|
19906
|
-
(i) => /* @__PURE__ */
|
|
19892
|
+
(i) => /* @__PURE__ */ React76.createElement(React76.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React76.createElement(Text61, { color: getTheme().secondaryText }, "..."))
|
|
19907
19893
|
)
|
|
19908
19894
|
));
|
|
19909
19895
|
}
|
|
@@ -20085,8 +20071,8 @@ function FileEditPermissionRequest({
|
|
|
20085
20071
|
handleChoice("yes-session");
|
|
20086
20072
|
return true;
|
|
20087
20073
|
});
|
|
20088
|
-
return /* @__PURE__ */
|
|
20089
|
-
|
|
20074
|
+
return /* @__PURE__ */ React77.createElement(
|
|
20075
|
+
Box57,
|
|
20090
20076
|
{
|
|
20091
20077
|
flexDirection: "column",
|
|
20092
20078
|
borderStyle: "round",
|
|
@@ -20096,14 +20082,14 @@ function FileEditPermissionRequest({
|
|
|
20096
20082
|
paddingRight: 1,
|
|
20097
20083
|
paddingBottom: 1
|
|
20098
20084
|
},
|
|
20099
|
-
/* @__PURE__ */
|
|
20085
|
+
/* @__PURE__ */ React77.createElement(
|
|
20100
20086
|
PermissionRequestTitle,
|
|
20101
20087
|
{
|
|
20102
20088
|
title: "Edit file",
|
|
20103
20089
|
riskScore: toolUseConfirm.riskScore
|
|
20104
20090
|
}
|
|
20105
20091
|
),
|
|
20106
|
-
/* @__PURE__ */
|
|
20092
|
+
/* @__PURE__ */ React77.createElement(
|
|
20107
20093
|
FileEditToolDiff,
|
|
20108
20094
|
{
|
|
20109
20095
|
file_path,
|
|
@@ -20113,7 +20099,7 @@ function FileEditPermissionRequest({
|
|
|
20113
20099
|
width: columns - 12
|
|
20114
20100
|
}
|
|
20115
20101
|
),
|
|
20116
|
-
/* @__PURE__ */
|
|
20102
|
+
/* @__PURE__ */ React77.createElement(Box57, { flexDirection: "column" }, /* @__PURE__ */ React77.createElement(Text62, null, "Do you want to make this edit to", " ", /* @__PURE__ */ React77.createElement(Text62, { bold: true }, basename(file_path)), "?"), /* @__PURE__ */ React77.createElement(
|
|
20117
20103
|
Select,
|
|
20118
20104
|
{
|
|
20119
20105
|
options: getOptions({
|
|
@@ -20137,8 +20123,8 @@ async function extractLanguageName(file_path) {
|
|
|
20137
20123
|
}
|
|
20138
20124
|
|
|
20139
20125
|
// src/ui/components/permissions/bash-permission-request/BashPermissionRequest.tsx
|
|
20140
|
-
import { Box as
|
|
20141
|
-
import
|
|
20126
|
+
import { Box as Box58, Text as Text63 } from "ink";
|
|
20127
|
+
import React78, { useMemo as useMemo16 } from "react";
|
|
20142
20128
|
|
|
20143
20129
|
// src/ui/components/permissions/hooks.ts
|
|
20144
20130
|
import { useEffect as useEffect18 } from "react";
|
|
@@ -20243,8 +20229,8 @@ function BashPermissionRequest({
|
|
|
20243
20229
|
[]
|
|
20244
20230
|
);
|
|
20245
20231
|
usePermissionRequestLogging2(toolUseConfirm, unaryEvent);
|
|
20246
|
-
return /* @__PURE__ */
|
|
20247
|
-
|
|
20232
|
+
return /* @__PURE__ */ React78.createElement(
|
|
20233
|
+
Box58,
|
|
20248
20234
|
{
|
|
20249
20235
|
flexDirection: "column",
|
|
20250
20236
|
borderStyle: "round",
|
|
@@ -20254,19 +20240,19 @@ function BashPermissionRequest({
|
|
|
20254
20240
|
paddingRight: 1,
|
|
20255
20241
|
paddingBottom: 1
|
|
20256
20242
|
},
|
|
20257
|
-
/* @__PURE__ */
|
|
20243
|
+
/* @__PURE__ */ React78.createElement(
|
|
20258
20244
|
PermissionRequestTitle,
|
|
20259
20245
|
{
|
|
20260
20246
|
title: "Bash command",
|
|
20261
20247
|
riskScore: toolUseConfirm.riskScore
|
|
20262
20248
|
}
|
|
20263
20249
|
),
|
|
20264
|
-
/* @__PURE__ */
|
|
20250
|
+
/* @__PURE__ */ React78.createElement(Box58, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React78.createElement(Text63, null, BashTool.renderToolUseMessage({
|
|
20265
20251
|
command: command4,
|
|
20266
20252
|
run_in_background,
|
|
20267
20253
|
description: description3
|
|
20268
|
-
})), /* @__PURE__ */
|
|
20269
|
-
/* @__PURE__ */
|
|
20254
|
+
})), /* @__PURE__ */ React78.createElement(Text63, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20255
|
+
/* @__PURE__ */ React78.createElement(Box58, { flexDirection: "column" }, /* @__PURE__ */ React78.createElement(Text63, null, "Do you want to proceed?"), /* @__PURE__ */ React78.createElement(
|
|
20270
20256
|
Select,
|
|
20271
20257
|
{
|
|
20272
20258
|
options: toolUseOptions({ toolUseConfirm, command: command4 }),
|
|
@@ -20334,8 +20320,8 @@ function BashPermissionRequest({
|
|
|
20334
20320
|
}
|
|
20335
20321
|
|
|
20336
20322
|
// src/ui/components/permissions/FallbackPermissionRequest.tsx
|
|
20337
|
-
import { Box as
|
|
20338
|
-
import
|
|
20323
|
+
import { Box as Box59, Text as Text64 } from "ink";
|
|
20324
|
+
import React79, { useMemo as useMemo17 } from "react";
|
|
20339
20325
|
import chalk9 from "chalk";
|
|
20340
20326
|
function __getFallbackPermissionInputForTests(tool, input) {
|
|
20341
20327
|
return tool === WebSearchTool ? { query: "" } : input;
|
|
@@ -20356,8 +20342,8 @@ function FallbackPermissionRequest({
|
|
|
20356
20342
|
[]
|
|
20357
20343
|
);
|
|
20358
20344
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
20359
|
-
return /* @__PURE__ */
|
|
20360
|
-
|
|
20345
|
+
return /* @__PURE__ */ React79.createElement(
|
|
20346
|
+
Box59,
|
|
20361
20347
|
{
|
|
20362
20348
|
flexDirection: "column",
|
|
20363
20349
|
borderStyle: "round",
|
|
@@ -20367,18 +20353,18 @@ function FallbackPermissionRequest({
|
|
|
20367
20353
|
paddingRight: 1,
|
|
20368
20354
|
paddingBottom: 1
|
|
20369
20355
|
},
|
|
20370
|
-
/* @__PURE__ */
|
|
20356
|
+
/* @__PURE__ */ React79.createElement(
|
|
20371
20357
|
PermissionRequestTitle,
|
|
20372
20358
|
{
|
|
20373
20359
|
title: "Tool use",
|
|
20374
20360
|
riskScore: toolUseConfirm.riskScore
|
|
20375
20361
|
}
|
|
20376
20362
|
),
|
|
20377
|
-
/* @__PURE__ */
|
|
20363
|
+
/* @__PURE__ */ React79.createElement(Box59, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React79.createElement(Text64, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20378
20364
|
toolUseConfirm.input,
|
|
20379
20365
|
{ verbose }
|
|
20380
|
-
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */
|
|
20381
|
-
/* @__PURE__ */
|
|
20366
|
+
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */ React79.createElement(Text64, { color: theme.secondaryText }, " (MCP)") : ""), /* @__PURE__ */ React79.createElement(Text64, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20367
|
+
/* @__PURE__ */ React79.createElement(Box59, { flexDirection: "column" }, /* @__PURE__ */ React79.createElement(Text64, null, "Do you want to proceed?"), /* @__PURE__ */ React79.createElement(
|
|
20382
20368
|
Select,
|
|
20383
20369
|
{
|
|
20384
20370
|
options: [
|
|
@@ -20494,17 +20480,17 @@ function useNotifyAfterTimeout(message, timeout = DEFAULT_INTERACTION_THRESHOLD_
|
|
|
20494
20480
|
}
|
|
20495
20481
|
|
|
20496
20482
|
// src/ui/components/permissions/file-write-permission-request/FileWritePermissionRequest.tsx
|
|
20497
|
-
import { Box as
|
|
20498
|
-
import
|
|
20483
|
+
import { Box as Box61, Text as Text66, useInput as useInput20 } from "ink";
|
|
20484
|
+
import React81, { useCallback as useCallback9, useMemo as useMemo19 } from "react";
|
|
20499
20485
|
import { basename as basename2, dirname as dirname6, extname as extname8 } from "path";
|
|
20500
20486
|
import { existsSync as existsSync12 } from "fs";
|
|
20501
20487
|
import chalk10 from "chalk";
|
|
20502
20488
|
|
|
20503
20489
|
// src/ui/components/permissions/file-write-permission-request/FileWriteToolDiff.tsx
|
|
20504
|
-
import * as
|
|
20490
|
+
import * as React80 from "react";
|
|
20505
20491
|
import { existsSync as existsSync11, readFileSync as readFileSync8 } from "fs";
|
|
20506
20492
|
import { useMemo as useMemo18 } from "react";
|
|
20507
|
-
import { Box as
|
|
20493
|
+
import { Box as Box60, Text as Text65 } from "ink";
|
|
20508
20494
|
import { extname as extname7, relative as relative11 } from "path";
|
|
20509
20495
|
function FileWriteToolDiff({
|
|
20510
20496
|
file_path,
|
|
@@ -20531,17 +20517,17 @@ function FileWriteToolDiff({
|
|
|
20531
20517
|
newStr: content
|
|
20532
20518
|
});
|
|
20533
20519
|
}, [fileExists, file_path, oldContent, content]);
|
|
20534
|
-
return /* @__PURE__ */
|
|
20535
|
-
|
|
20520
|
+
return /* @__PURE__ */ React80.createElement(
|
|
20521
|
+
Box60,
|
|
20536
20522
|
{
|
|
20537
20523
|
borderColor: getTheme().secondaryBorder,
|
|
20538
20524
|
borderStyle: "round",
|
|
20539
20525
|
flexDirection: "column",
|
|
20540
20526
|
paddingX: 1
|
|
20541
20527
|
},
|
|
20542
|
-
/* @__PURE__ */
|
|
20528
|
+
/* @__PURE__ */ React80.createElement(Box60, { paddingBottom: 1 }, /* @__PURE__ */ React80.createElement(Text65, { bold: true }, verbose ? file_path : relative11(getCwd(), file_path))),
|
|
20543
20529
|
hunks ? intersperse(
|
|
20544
|
-
hunks.map((_) => /* @__PURE__ */
|
|
20530
|
+
hunks.map((_) => /* @__PURE__ */ React80.createElement(
|
|
20545
20531
|
StructuredDiff,
|
|
20546
20532
|
{
|
|
20547
20533
|
key: _.newStart,
|
|
@@ -20550,8 +20536,8 @@ function FileWriteToolDiff({
|
|
|
20550
20536
|
width
|
|
20551
20537
|
}
|
|
20552
20538
|
)),
|
|
20553
|
-
(i) => /* @__PURE__ */
|
|
20554
|
-
) : /* @__PURE__ */
|
|
20539
|
+
(i) => /* @__PURE__ */ React80.createElement(React80.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React80.createElement(Text65, { color: getTheme().secondaryText }, "..."))
|
|
20540
|
+
) : /* @__PURE__ */ React80.createElement(
|
|
20555
20541
|
HighlightedCode,
|
|
20556
20542
|
{
|
|
20557
20543
|
code: content || "(No content)",
|
|
@@ -20686,8 +20672,8 @@ function FileWritePermissionRequest({
|
|
|
20686
20672
|
handleChoice("yes-session");
|
|
20687
20673
|
return true;
|
|
20688
20674
|
});
|
|
20689
|
-
return /* @__PURE__ */
|
|
20690
|
-
|
|
20675
|
+
return /* @__PURE__ */ React81.createElement(
|
|
20676
|
+
Box61,
|
|
20691
20677
|
{
|
|
20692
20678
|
flexDirection: "column",
|
|
20693
20679
|
borderStyle: "round",
|
|
@@ -20697,14 +20683,14 @@ function FileWritePermissionRequest({
|
|
|
20697
20683
|
paddingRight: 1,
|
|
20698
20684
|
paddingBottom: 1
|
|
20699
20685
|
},
|
|
20700
|
-
/* @__PURE__ */
|
|
20686
|
+
/* @__PURE__ */ React81.createElement(
|
|
20701
20687
|
PermissionRequestTitle,
|
|
20702
20688
|
{
|
|
20703
20689
|
title: `${fileExists ? "Edit" : "Create"} file`,
|
|
20704
20690
|
riskScore: toolUseConfirm.riskScore
|
|
20705
20691
|
}
|
|
20706
20692
|
),
|
|
20707
|
-
/* @__PURE__ */
|
|
20693
|
+
/* @__PURE__ */ React81.createElement(Box61, { flexDirection: "column" }, /* @__PURE__ */ React81.createElement(
|
|
20708
20694
|
FileWriteToolDiff,
|
|
20709
20695
|
{
|
|
20710
20696
|
file_path,
|
|
@@ -20713,7 +20699,7 @@ function FileWritePermissionRequest({
|
|
|
20713
20699
|
width: columns - 12
|
|
20714
20700
|
}
|
|
20715
20701
|
)),
|
|
20716
|
-
/* @__PURE__ */
|
|
20702
|
+
/* @__PURE__ */ React81.createElement(Box61, { flexDirection: "column" }, /* @__PURE__ */ React81.createElement(Text66, null, "Do you want to ", fileExists ? "make this edit to" : "create", " ", /* @__PURE__ */ React81.createElement(Text66, { bold: true }, basename2(file_path)), "?"), /* @__PURE__ */ React81.createElement(
|
|
20717
20703
|
Select,
|
|
20718
20704
|
{
|
|
20719
20705
|
options: [
|
|
@@ -20747,8 +20733,8 @@ async function extractLanguageName2(file_path) {
|
|
|
20747
20733
|
}
|
|
20748
20734
|
|
|
20749
20735
|
// src/ui/components/permissions/filesystem-permission-request/FilesystemPermissionRequest.tsx
|
|
20750
|
-
import { Box as
|
|
20751
|
-
import
|
|
20736
|
+
import { Box as Box62, Text as Text67, useInput as useInput21 } from "ink";
|
|
20737
|
+
import React82, { useCallback as useCallback10, useMemo as useMemo20 } from "react";
|
|
20752
20738
|
import chalk11 from "chalk";
|
|
20753
20739
|
import { basename as basename3, dirname as dirname7 } from "path";
|
|
20754
20740
|
import { statSync as statSync10 } from "fs";
|
|
@@ -20805,7 +20791,7 @@ function FilesystemPermissionRequest({
|
|
|
20805
20791
|
}) {
|
|
20806
20792
|
const path5 = pathFromToolUse(toolUseConfirm);
|
|
20807
20793
|
if (!path5) {
|
|
20808
|
-
return /* @__PURE__ */
|
|
20794
|
+
return /* @__PURE__ */ React82.createElement(
|
|
20809
20795
|
FallbackPermissionRequest,
|
|
20810
20796
|
{
|
|
20811
20797
|
toolUseConfirm,
|
|
@@ -20814,7 +20800,7 @@ function FilesystemPermissionRequest({
|
|
|
20814
20800
|
}
|
|
20815
20801
|
);
|
|
20816
20802
|
}
|
|
20817
|
-
return /* @__PURE__ */
|
|
20803
|
+
return /* @__PURE__ */ React82.createElement(
|
|
20818
20804
|
FilesystemPermissionRequestImpl,
|
|
20819
20805
|
{
|
|
20820
20806
|
toolUseConfirm,
|
|
@@ -20956,8 +20942,8 @@ function FilesystemPermissionRequestImpl({
|
|
|
20956
20942
|
handleChoice("yes-session");
|
|
20957
20943
|
return true;
|
|
20958
20944
|
});
|
|
20959
|
-
return /* @__PURE__ */
|
|
20960
|
-
|
|
20945
|
+
return /* @__PURE__ */ React82.createElement(
|
|
20946
|
+
Box62,
|
|
20961
20947
|
{
|
|
20962
20948
|
flexDirection: "column",
|
|
20963
20949
|
borderStyle: "round",
|
|
@@ -20967,18 +20953,18 @@ function FilesystemPermissionRequestImpl({
|
|
|
20967
20953
|
paddingRight: 1,
|
|
20968
20954
|
paddingBottom: 1
|
|
20969
20955
|
},
|
|
20970
|
-
/* @__PURE__ */
|
|
20956
|
+
/* @__PURE__ */ React82.createElement(
|
|
20971
20957
|
PermissionRequestTitle,
|
|
20972
20958
|
{
|
|
20973
20959
|
title,
|
|
20974
20960
|
riskScore: toolUseConfirm.riskScore
|
|
20975
20961
|
}
|
|
20976
20962
|
),
|
|
20977
|
-
/* @__PURE__ */
|
|
20963
|
+
/* @__PURE__ */ React82.createElement(Box62, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React82.createElement(Text67, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20978
20964
|
toolUseConfirm.input,
|
|
20979
20965
|
{ verbose }
|
|
20980
20966
|
), ")")),
|
|
20981
|
-
/* @__PURE__ */
|
|
20967
|
+
/* @__PURE__ */ React82.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(Text67, null, "Do you want to proceed?"), /* @__PURE__ */ React82.createElement(
|
|
20982
20968
|
Select,
|
|
20983
20969
|
{
|
|
20984
20970
|
options: [
|
|
@@ -21006,7 +20992,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
21006
20992
|
|
|
21007
20993
|
// src/tools/ai/SkillTool/SkillTool.tsx
|
|
21008
20994
|
import { z as z9 } from "zod";
|
|
21009
|
-
import * as
|
|
20995
|
+
import * as React83 from "react";
|
|
21010
20996
|
|
|
21011
20997
|
// src/tools/ai/SkillTool/prompt.ts
|
|
21012
20998
|
var TOOL_NAME_FOR_PROMPT5 = "Skill";
|
|
@@ -21103,7 +21089,7 @@ ${availableSkills}${truncatedNotice}
|
|
|
21103
21089
|
return skill || "";
|
|
21104
21090
|
},
|
|
21105
21091
|
renderToolUseRejectedMessage() {
|
|
21106
|
-
return /* @__PURE__ */
|
|
21092
|
+
return /* @__PURE__ */ React83.createElement(FallbackToolUseRejectedMessage, null);
|
|
21107
21093
|
},
|
|
21108
21094
|
renderResultForAssistant(output) {
|
|
21109
21095
|
return `Launching skill: ${output.commandName}`;
|
|
@@ -21238,8 +21224,8 @@ function findCommand(commandName, commands) {
|
|
|
21238
21224
|
}
|
|
21239
21225
|
|
|
21240
21226
|
// src/ui/components/permissions/slash-command-permission-request/SlashCommandPermissionRequest.tsx
|
|
21241
|
-
import { Box as
|
|
21242
|
-
import
|
|
21227
|
+
import { Box as Box63, Text as Text68 } from "ink";
|
|
21228
|
+
import React84, { useMemo as useMemo21 } from "react";
|
|
21243
21229
|
import chalk12 from "chalk";
|
|
21244
21230
|
function parsePrefix(command4) {
|
|
21245
21231
|
const trimmed = command4.trim();
|
|
@@ -21264,8 +21250,8 @@ function SlashCommandPermissionRequest({
|
|
|
21264
21250
|
const command4 = typeof toolUseConfirm.input.command === "string" ? toolUseConfirm.input.command : "";
|
|
21265
21251
|
const prefix = parsePrefix(command4);
|
|
21266
21252
|
const showPrefixOption = !!prefix && hasArgs(command4);
|
|
21267
|
-
return /* @__PURE__ */
|
|
21268
|
-
|
|
21253
|
+
return /* @__PURE__ */ React84.createElement(
|
|
21254
|
+
Box63,
|
|
21269
21255
|
{
|
|
21270
21256
|
flexDirection: "column",
|
|
21271
21257
|
borderStyle: "round",
|
|
@@ -21275,14 +21261,14 @@ function SlashCommandPermissionRequest({
|
|
|
21275
21261
|
paddingRight: 1,
|
|
21276
21262
|
paddingBottom: 1
|
|
21277
21263
|
},
|
|
21278
|
-
/* @__PURE__ */
|
|
21279
|
-
/* @__PURE__ */
|
|
21264
|
+
/* @__PURE__ */ React84.createElement(PermissionRequestTitle, { title: "Slash command", riskScore: null }),
|
|
21265
|
+
/* @__PURE__ */ React84.createElement(Box63, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React84.createElement(Text68, null, toolUseConfirm.tool.userFacingName?.() || "SlashCommand", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
21280
21266
|
toolUseConfirm.input,
|
|
21281
21267
|
{
|
|
21282
21268
|
verbose
|
|
21283
21269
|
}
|
|
21284
|
-
), ")"), /* @__PURE__ */
|
|
21285
|
-
/* @__PURE__ */
|
|
21270
|
+
), ")"), /* @__PURE__ */ React84.createElement(Text68, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
21271
|
+
/* @__PURE__ */ React84.createElement(Box63, { flexDirection: "column" }, /* @__PURE__ */ React84.createElement(Text68, null, "Do you want to proceed?"), /* @__PURE__ */ React84.createElement(
|
|
21286
21272
|
Select,
|
|
21287
21273
|
{
|
|
21288
21274
|
options: [
|
|
@@ -21383,8 +21369,8 @@ function SlashCommandPermissionRequest({
|
|
|
21383
21369
|
}
|
|
21384
21370
|
|
|
21385
21371
|
// src/ui/components/permissions/skill-permission-request/SkillPermissionRequest.tsx
|
|
21386
|
-
import { Box as
|
|
21387
|
-
import
|
|
21372
|
+
import { Box as Box64, Text as Text69 } from "ink";
|
|
21373
|
+
import React85, { useMemo as useMemo22 } from "react";
|
|
21388
21374
|
import chalk13 from "chalk";
|
|
21389
21375
|
function SkillPermissionRequest({
|
|
21390
21376
|
toolUseConfirm,
|
|
@@ -21399,8 +21385,8 @@ function SkillPermissionRequest({
|
|
|
21399
21385
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
21400
21386
|
const raw = typeof toolUseConfirm.input.skill === "string" ? toolUseConfirm.input.skill : "";
|
|
21401
21387
|
const skill = raw.trim().replace(/^\//, "");
|
|
21402
|
-
return /* @__PURE__ */
|
|
21403
|
-
|
|
21388
|
+
return /* @__PURE__ */ React85.createElement(
|
|
21389
|
+
Box64,
|
|
21404
21390
|
{
|
|
21405
21391
|
flexDirection: "column",
|
|
21406
21392
|
borderStyle: "round",
|
|
@@ -21410,14 +21396,14 @@ function SkillPermissionRequest({
|
|
|
21410
21396
|
paddingRight: 1,
|
|
21411
21397
|
paddingBottom: 1
|
|
21412
21398
|
},
|
|
21413
|
-
/* @__PURE__ */
|
|
21414
|
-
/* @__PURE__ */
|
|
21399
|
+
/* @__PURE__ */ React85.createElement(PermissionRequestTitle, { title: "Skill", riskScore: null }),
|
|
21400
|
+
/* @__PURE__ */ React85.createElement(Box64, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React85.createElement(Text69, null, toolUseConfirm.tool.userFacingName?.() || "Skill", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
21415
21401
|
toolUseConfirm.input,
|
|
21416
21402
|
{
|
|
21417
21403
|
verbose
|
|
21418
21404
|
}
|
|
21419
|
-
), ")"), /* @__PURE__ */
|
|
21420
|
-
/* @__PURE__ */
|
|
21405
|
+
), ")"), /* @__PURE__ */ React85.createElement(Text69, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
21406
|
+
/* @__PURE__ */ React85.createElement(Box64, { flexDirection: "column" }, /* @__PURE__ */ React85.createElement(Text69, null, "Do you want to proceed?"), /* @__PURE__ */ React85.createElement(
|
|
21421
21407
|
Select,
|
|
21422
21408
|
{
|
|
21423
21409
|
options: [
|
|
@@ -21487,8 +21473,8 @@ function SkillPermissionRequest({
|
|
|
21487
21473
|
}
|
|
21488
21474
|
|
|
21489
21475
|
// src/tools/agent/PlanModeTool/EnterPlanModeTool.tsx
|
|
21490
|
-
import { Box as
|
|
21491
|
-
import
|
|
21476
|
+
import { Box as Box65, Text as Text70 } from "ink";
|
|
21477
|
+
import React86 from "react";
|
|
21492
21478
|
import { z as z10 } from "zod";
|
|
21493
21479
|
|
|
21494
21480
|
// src/tools/agent/PlanModeTool/prompt.ts
|
|
@@ -21640,11 +21626,11 @@ var EnterPlanModeTool = {
|
|
|
21640
21626
|
},
|
|
21641
21627
|
renderToolUseRejectedMessage() {
|
|
21642
21628
|
const theme = getTheme();
|
|
21643
|
-
return /* @__PURE__ */
|
|
21629
|
+
return /* @__PURE__ */ React86.createElement(Box65, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React86.createElement(Text70, { color: theme.text }, BLACK_CIRCLE), /* @__PURE__ */ React86.createElement(Text70, null, " User declined to enter plan mode"));
|
|
21644
21630
|
},
|
|
21645
21631
|
renderToolResultMessage(_output) {
|
|
21646
21632
|
const theme = getTheme();
|
|
21647
|
-
return /* @__PURE__ */
|
|
21633
|
+
return /* @__PURE__ */ React86.createElement(Box65, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React86.createElement(Box65, { flexDirection: "row" }, /* @__PURE__ */ React86.createElement(Text70, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React86.createElement(Text70, null, " Entered plan mode")), /* @__PURE__ */ React86.createElement(Box65, { paddingLeft: 2 }, /* @__PURE__ */ React86.createElement(Text70, { dimColor: true }, "Pyb Agent is now exploring and designing an implementation approach.")));
|
|
21648
21634
|
},
|
|
21649
21635
|
renderResultForAssistant(output) {
|
|
21650
21636
|
return `${output.message}
|
|
@@ -21677,8 +21663,8 @@ Remember: DO NOT write or edit any files yet. This is a read-only exploration an
|
|
|
21677
21663
|
};
|
|
21678
21664
|
|
|
21679
21665
|
// src/tools/agent/PlanModeTool/ExitPlanModeTool.tsx
|
|
21680
|
-
import { Box as
|
|
21681
|
-
import
|
|
21666
|
+
import { Box as Box66, Text as Text71 } from "ink";
|
|
21667
|
+
import React87 from "react";
|
|
21682
21668
|
import { z as z11 } from "zod";
|
|
21683
21669
|
function getExitPlanModePlanText(conversationKey) {
|
|
21684
21670
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
@@ -21723,8 +21709,8 @@ var ExitPlanModeTool = {
|
|
|
21723
21709
|
const conversationKey = typeof options.conversationKey === "string" && options.conversationKey.trim() ? options.conversationKey.trim() : void 0;
|
|
21724
21710
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
21725
21711
|
const plan = getExitPlanModePlanText(conversationKey);
|
|
21726
|
-
return /* @__PURE__ */
|
|
21727
|
-
|
|
21712
|
+
return /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React87.createElement(Text71, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React87.createElement(Text71, { color: theme.error }, "User rejected Pyb Agent's plan:"), /* @__PURE__ */ React87.createElement(
|
|
21713
|
+
Box66,
|
|
21728
21714
|
{
|
|
21729
21715
|
borderStyle: "round",
|
|
21730
21716
|
borderColor: theme.planMode,
|
|
@@ -21732,14 +21718,14 @@ var ExitPlanModeTool = {
|
|
|
21732
21718
|
paddingX: 1,
|
|
21733
21719
|
overflow: "hidden"
|
|
21734
21720
|
},
|
|
21735
|
-
/* @__PURE__ */
|
|
21721
|
+
/* @__PURE__ */ React87.createElement(Text71, { dimColor: true }, plan)
|
|
21736
21722
|
))));
|
|
21737
21723
|
},
|
|
21738
21724
|
renderToolResultMessage(output) {
|
|
21739
21725
|
const theme = getTheme();
|
|
21740
21726
|
const planPath = typeof output.filePath === "string" ? output.filePath : null;
|
|
21741
21727
|
const plan = output.plan || "No plan found";
|
|
21742
|
-
return /* @__PURE__ */
|
|
21728
|
+
return /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React87.createElement(Text71, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React87.createElement(Text71, null, " User approved Pyb Agent's plan")), /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React87.createElement(Text71, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React87.createElement(Box66, { flexDirection: "column" }, planPath ? /* @__PURE__ */ React87.createElement(Text71, { dimColor: true }, "Plan saved to: ", planPath, " \xB7 /plan to edit") : null, /* @__PURE__ */ React87.createElement(Text71, { dimColor: true }, plan))));
|
|
21743
21729
|
},
|
|
21744
21730
|
renderResultForAssistant(output) {
|
|
21745
21731
|
if (output.isAgent) {
|
|
@@ -21823,8 +21809,8 @@ ${output.plan}`;
|
|
|
21823
21809
|
};
|
|
21824
21810
|
|
|
21825
21811
|
// src/ui/components/permissions/plan-mode-permission-request/EnterPlanModePermissionRequest.tsx
|
|
21826
|
-
import { Box as
|
|
21827
|
-
import
|
|
21812
|
+
import { Box as Box67, Text as Text72, useInput as useInput22 } from "ink";
|
|
21813
|
+
import React88 from "react";
|
|
21828
21814
|
function EnterPlanModePermissionRequest({
|
|
21829
21815
|
toolUseConfirm,
|
|
21830
21816
|
onDone
|
|
@@ -21837,8 +21823,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21837
21823
|
onDone();
|
|
21838
21824
|
}
|
|
21839
21825
|
});
|
|
21840
|
-
return /* @__PURE__ */
|
|
21841
|
-
|
|
21826
|
+
return /* @__PURE__ */ React88.createElement(
|
|
21827
|
+
Box67,
|
|
21842
21828
|
{
|
|
21843
21829
|
flexDirection: "column",
|
|
21844
21830
|
borderStyle: "round",
|
|
@@ -21848,11 +21834,11 @@ function EnterPlanModePermissionRequest({
|
|
|
21848
21834
|
paddingRight: 1,
|
|
21849
21835
|
paddingBottom: 1
|
|
21850
21836
|
},
|
|
21851
|
-
/* @__PURE__ */
|
|
21852
|
-
/* @__PURE__ */
|
|
21853
|
-
/* @__PURE__ */
|
|
21854
|
-
/* @__PURE__ */
|
|
21855
|
-
/* @__PURE__ */
|
|
21837
|
+
/* @__PURE__ */ React88.createElement(PermissionRequestTitle, { title: "Enter plan mode?", riskScore: null }),
|
|
21838
|
+
/* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React88.createElement(Text72, null, "The assistant wants to enter plan mode to explore and design an implementation approach.")),
|
|
21839
|
+
/* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, "In plan mode, the assistant will:"), /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, " \xB7 Explore the codebase thoroughly"), /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, " \xB7 Identify existing patterns"), /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, " \xB7 Design an implementation strategy"), /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, " \xB7 Present a plan for your approval")),
|
|
21840
|
+
/* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column", paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React88.createElement(Text72, { dimColor: true }, "No code changes will be made until you approve the plan.")),
|
|
21841
|
+
/* @__PURE__ */ React88.createElement(Box67, { flexDirection: "column" }, /* @__PURE__ */ React88.createElement(Text72, null, "Would you like to proceed?"), /* @__PURE__ */ React88.createElement(
|
|
21856
21842
|
Select,
|
|
21857
21843
|
{
|
|
21858
21844
|
options: [
|
|
@@ -21875,8 +21861,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21875
21861
|
}
|
|
21876
21862
|
|
|
21877
21863
|
// src/ui/components/permissions/plan-mode-permission-request/ExitPlanModePermissionRequest.tsx
|
|
21878
|
-
import { Box as
|
|
21879
|
-
import
|
|
21864
|
+
import { Box as Box68, Text as Text73, useInput as useInput23 } from "ink";
|
|
21865
|
+
import React89, { useEffect as useEffect20, useMemo as useMemo23, useState as useState21 } from "react";
|
|
21880
21866
|
|
|
21881
21867
|
// src/utils/system/externalEditor.ts
|
|
21882
21868
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -22183,8 +22169,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22183
22169
|
[bypassAvailable, launchSwarmAvailable, teammateCount]
|
|
22184
22170
|
);
|
|
22185
22171
|
if (showRejectInput) {
|
|
22186
|
-
return /* @__PURE__ */
|
|
22187
|
-
|
|
22172
|
+
return /* @__PURE__ */ React89.createElement(
|
|
22173
|
+
Box68,
|
|
22188
22174
|
{
|
|
22189
22175
|
flexDirection: "column",
|
|
22190
22176
|
borderStyle: "round",
|
|
@@ -22194,8 +22180,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22194
22180
|
paddingRight: 1,
|
|
22195
22181
|
paddingBottom: 1
|
|
22196
22182
|
},
|
|
22197
|
-
/* @__PURE__ */
|
|
22198
|
-
/* @__PURE__ */
|
|
22183
|
+
/* @__PURE__ */ React89.createElement(PermissionRequestTitle, { title: "No, keep planning", riskScore: null }),
|
|
22184
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, "Type here to tell Pyb Agent what to change (Enter submits, Esc cancels)"), rejectError ? /* @__PURE__ */ React89.createElement(Text73, { color: theme.error }, rejectError) : null, /* @__PURE__ */ React89.createElement(
|
|
22199
22185
|
TextInput,
|
|
22200
22186
|
{
|
|
22201
22187
|
value: rejectFeedback,
|
|
@@ -22224,8 +22210,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22224
22210
|
))
|
|
22225
22211
|
);
|
|
22226
22212
|
}
|
|
22227
|
-
return /* @__PURE__ */
|
|
22228
|
-
|
|
22213
|
+
return /* @__PURE__ */ React89.createElement(
|
|
22214
|
+
Box68,
|
|
22229
22215
|
{
|
|
22230
22216
|
flexDirection: "column",
|
|
22231
22217
|
borderStyle: "round",
|
|
@@ -22235,9 +22221,9 @@ function ExitPlanModePermissionRequest({
|
|
|
22235
22221
|
paddingRight: 1,
|
|
22236
22222
|
paddingBottom: 1
|
|
22237
22223
|
},
|
|
22238
|
-
/* @__PURE__ */
|
|
22239
|
-
/* @__PURE__ */
|
|
22240
|
-
|
|
22224
|
+
/* @__PURE__ */ React89.createElement(PermissionRequestTitle, { title: "Ready to code?", riskScore: null }),
|
|
22225
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React89.createElement(Text73, null, "Here is Pyb Agent's plan:"), /* @__PURE__ */ React89.createElement(
|
|
22226
|
+
Box68,
|
|
22241
22227
|
{
|
|
22242
22228
|
borderStyle: "dashed",
|
|
22243
22229
|
borderColor: theme.secondaryBorder,
|
|
@@ -22249,10 +22235,10 @@ function ExitPlanModePermissionRequest({
|
|
|
22249
22235
|
marginBottom: 1,
|
|
22250
22236
|
flexDirection: "column"
|
|
22251
22237
|
},
|
|
22252
|
-
/* @__PURE__ */
|
|
22238
|
+
/* @__PURE__ */ React89.createElement(Text73, null, planText)
|
|
22253
22239
|
)),
|
|
22254
|
-
/* @__PURE__ */
|
|
22255
|
-
/* @__PURE__ */
|
|
22240
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, "Tip: Press ctrl+g to edit", " ", planSource === "file" ? `plan file: ${planFilePath}` : "plan text", planSaved ? " \xB7 Plan saved!" : "")),
|
|
22241
|
+
/* @__PURE__ */ React89.createElement(Box68, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React89.createElement(Text73, { dimColor: true }, "Would you like to proceed?"), /* @__PURE__ */ React89.createElement(
|
|
22256
22242
|
Select,
|
|
22257
22243
|
{
|
|
22258
22244
|
options,
|
|
@@ -22278,8 +22264,8 @@ function ExitPlanModePermissionRequest({
|
|
|
22278
22264
|
}
|
|
22279
22265
|
|
|
22280
22266
|
// src/tools/interaction/AskUserQuestionTool/AskUserQuestionTool.tsx
|
|
22281
|
-
import { Box as
|
|
22282
|
-
import
|
|
22267
|
+
import { Box as Box69, Text as Text74 } from "ink";
|
|
22268
|
+
import React90 from "react";
|
|
22283
22269
|
import { z as z12 } from "zod";
|
|
22284
22270
|
|
|
22285
22271
|
// src/tools/interaction/AskUserQuestionTool/prompt.ts
|
|
@@ -22356,11 +22342,11 @@ var AskUserQuestionTool = {
|
|
|
22356
22342
|
},
|
|
22357
22343
|
renderToolUseRejectedMessage() {
|
|
22358
22344
|
const theme = getTheme();
|
|
22359
|
-
return /* @__PURE__ */
|
|
22345
|
+
return /* @__PURE__ */ React90.createElement(Box69, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React90.createElement(Text74, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React90.createElement(Text74, null, "User declined to answer questions"));
|
|
22360
22346
|
},
|
|
22361
22347
|
renderToolResultMessage(output, _options) {
|
|
22362
22348
|
const theme = getTheme();
|
|
22363
|
-
return /* @__PURE__ */
|
|
22349
|
+
return /* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React90.createElement(Box69, { flexDirection: "row" }, /* @__PURE__ */ React90.createElement(Text74, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React90.createElement(Text74, null, "User answered Pyb Agent's questions:")), /* @__PURE__ */ React90.createElement(Box69, { flexDirection: "column", paddingLeft: 2 }, Object.entries(output.answers).map(([question, answer]) => /* @__PURE__ */ React90.createElement(Box69, { key: question }, /* @__PURE__ */ React90.createElement(Text74, { dimColor: true }, "\xB7 ", question, " \u2192 ", answer)))));
|
|
22364
22350
|
},
|
|
22365
22351
|
renderResultForAssistant(output) {
|
|
22366
22352
|
const formatted = Object.entries(output.answers).map(([question, answer]) => `"${question}"="${answer}"`).join(", ");
|
|
@@ -22377,8 +22363,8 @@ var AskUserQuestionTool = {
|
|
|
22377
22363
|
};
|
|
22378
22364
|
|
|
22379
22365
|
// src/ui/components/permissions/ask-user-question-permission-request/AskUserQuestionPermissionRequest.tsx
|
|
22380
|
-
import
|
|
22381
|
-
import { Box as
|
|
22366
|
+
import React91, { useCallback as useCallback11, useMemo as useMemo24, useState as useState22 } from "react";
|
|
22367
|
+
import { Box as Box70, Text as Text75, useInput as useInput24 } from "ink";
|
|
22382
22368
|
import figures8 from "figures";
|
|
22383
22369
|
import stringWidth from "string-width";
|
|
22384
22370
|
function isTextInputChar(input, key) {
|
|
@@ -22732,18 +22718,18 @@ function AskUserQuestionPermissionRequest({
|
|
|
22732
22718
|
const rightArrowInactive = currentQuestionIndex === maxTabIndex;
|
|
22733
22719
|
const allQuestionsAnswered = questions.every((q) => q?.question && Boolean(answers[q.question])) ?? false;
|
|
22734
22720
|
if (questions.length === 0) {
|
|
22735
|
-
return /* @__PURE__ */
|
|
22721
|
+
return /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.error }, "Invalid AskUserQuestion input."), /* @__PURE__ */ React91.createElement(Text75, { dimColor: true }, "Press Esc to cancel."));
|
|
22736
22722
|
}
|
|
22737
|
-
return /* @__PURE__ */
|
|
22738
|
-
|
|
22723
|
+
return /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React91.createElement(
|
|
22724
|
+
Box70,
|
|
22739
22725
|
{
|
|
22740
22726
|
borderTop: true,
|
|
22741
22727
|
borderColor: theme.secondaryText,
|
|
22742
22728
|
flexDirection: "column",
|
|
22743
22729
|
paddingTop: 0
|
|
22744
22730
|
},
|
|
22745
|
-
/* @__PURE__ */
|
|
22746
|
-
|
|
22731
|
+
/* @__PURE__ */ React91.createElement(Box70, { flexDirection: "row", marginBottom: 1 }, showArrows && /* @__PURE__ */ React91.createElement(
|
|
22732
|
+
Text75,
|
|
22747
22733
|
{
|
|
22748
22734
|
color: currentQuestionIndex === 0 ? theme.secondaryText : void 0
|
|
22749
22735
|
},
|
|
@@ -22754,16 +22740,16 @@ function AskUserQuestionPermissionRequest({
|
|
|
22754
22740
|
const checkbox = question.question && answers[question.question] ? figures8.checkboxOn : figures8.checkboxOff;
|
|
22755
22741
|
const headerText = tabHeaders[index] ?? question.header ?? `Q${index + 1}`;
|
|
22756
22742
|
const tabText = ` ${checkbox} ${headerText} `;
|
|
22757
|
-
return /* @__PURE__ */
|
|
22758
|
-
|
|
22743
|
+
return /* @__PURE__ */ React91.createElement(React91.Fragment, { key: question.question || `question-${index}` }, /* @__PURE__ */ React91.createElement(
|
|
22744
|
+
Text75,
|
|
22759
22745
|
{
|
|
22760
22746
|
backgroundColor: isSelected ? theme.permission : void 0,
|
|
22761
22747
|
color: isSelected ? inverseText : void 0
|
|
22762
22748
|
},
|
|
22763
22749
|
tabText
|
|
22764
22750
|
));
|
|
22765
|
-
}), !hideSubmitTab && /* @__PURE__ */
|
|
22766
|
-
|
|
22751
|
+
}), !hideSubmitTab && /* @__PURE__ */ React91.createElement(
|
|
22752
|
+
Text75,
|
|
22767
22753
|
{
|
|
22768
22754
|
backgroundColor: isSubmitTab ? theme.permission : void 0,
|
|
22769
22755
|
color: isSubmitTab ? inverseText : void 0
|
|
@@ -22772,23 +22758,23 @@ function AskUserQuestionPermissionRequest({
|
|
|
22772
22758
|
figures8.tick,
|
|
22773
22759
|
" Submit",
|
|
22774
22760
|
" "
|
|
22775
|
-
), showArrows && /* @__PURE__ */
|
|
22776
|
-
!isSubmitTab && currentQuestion && /* @__PURE__ */
|
|
22761
|
+
), showArrows && /* @__PURE__ */ React91.createElement(Text75, { color: rightArrowInactive ? theme.secondaryText : void 0 }, " ", "\u2192")),
|
|
22762
|
+
!isSubmitTab && currentQuestion && /* @__PURE__ */ React91.createElement(React91.Fragment, null, /* @__PURE__ */ React91.createElement(Text75, { bold: true }, currentQuestion.question), /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", marginTop: 1 }, (() => {
|
|
22777
22763
|
const rawSelected = activeQuestionState?.selectedValue;
|
|
22778
22764
|
const selectedValues = Array.isArray(rawSelected) ? rawSelected : [];
|
|
22779
22765
|
const otherSelected = currentQuestion.multiSelect ? selectedValues.includes("__other__") : rawSelected === "__other__";
|
|
22780
22766
|
const otherText = questionStates[currentQuestion.question]?.textInputValue ?? "";
|
|
22781
22767
|
const otherPlaceholder = currentQuestion.multiSelect ? "Type something" : "Type something.";
|
|
22782
22768
|
const otherLine = otherText.length > 0 ? otherText : isOtherFocused || otherSelected ? otherPlaceholder : "";
|
|
22783
|
-
return /* @__PURE__ */
|
|
22769
|
+
return /* @__PURE__ */ React91.createElement(React91.Fragment, null, currentQuestion.options.map((option, index) => {
|
|
22784
22770
|
const isFocused = !isMultiSelectSubmitFocused && index === focusedOptionIndex;
|
|
22785
22771
|
const isSelected = currentQuestion.multiSelect ? selectedValues.includes(option.label) : rawSelected === option.label;
|
|
22786
22772
|
const pointer = isFocused ? figures8.pointer : " ";
|
|
22787
22773
|
const color = isFocused ? theme.pyb : theme.text;
|
|
22788
22774
|
const indicator = currentQuestion.multiSelect ? isSelected ? figures8.checkboxOn : figures8.checkboxOff : isSelected ? figures8.tick : " ";
|
|
22789
|
-
return /* @__PURE__ */
|
|
22790
|
-
}), /* @__PURE__ */
|
|
22791
|
-
|
|
22775
|
+
return /* @__PURE__ */ React91.createElement(Box70, { key: option.label, flexDirection: "column" }, /* @__PURE__ */ React91.createElement(Text75, { color }, pointer, " ", indicator, " ", option.label), /* @__PURE__ */ React91.createElement(Text75, { color: theme.secondaryText }, " ", option.description));
|
|
22776
|
+
}), /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column" }, /* @__PURE__ */ React91.createElement(Text75, { 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__ */ React91.createElement(Text75, { color: theme.secondaryText }, otherLine, isOtherFocused && /* @__PURE__ */ React91.createElement(Text75, { color: "gray" }, "\u258C"))), currentQuestion.multiSelect && /* @__PURE__ */ React91.createElement(Box70, { marginTop: 0 }, /* @__PURE__ */ React91.createElement(
|
|
22777
|
+
Text75,
|
|
22792
22778
|
{
|
|
22793
22779
|
color: isMultiSelectSubmitFocused ? theme.pyb : theme.text,
|
|
22794
22780
|
bold: isMultiSelectSubmitFocused
|
|
@@ -22796,9 +22782,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
22796
22782
|
isMultiSelectSubmitFocused ? figures8.pointer : " ",
|
|
22797
22783
|
" ",
|
|
22798
22784
|
currentQuestionIndex === questions.length - 1 ? "Submit" : "Next"
|
|
22799
|
-
)), /* @__PURE__ */
|
|
22785
|
+
)), /* @__PURE__ */ React91.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.secondaryText, dimColor: true }, "Enter to select \xB7 Tab/Arrow keys to navigate \xB7 Esc to cancel")));
|
|
22800
22786
|
})())),
|
|
22801
|
-
isSubmitTab && /* @__PURE__ */
|
|
22787
|
+
isSubmitTab && /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column" }, /* @__PURE__ */ React91.createElement(Text75, { bold: true }, "Review your answers"), !allQuestionsAnswered && /* @__PURE__ */ React91.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.warning }, figures8.warning, " You have not answered all questions")), /* @__PURE__ */ React91.createElement(Box70, { flexDirection: "column", marginTop: 1 }, questions.filter((q) => q?.question && answers[q.question]).map((q) => /* @__PURE__ */ React91.createElement(Box70, { key: q.question, flexDirection: "column", marginLeft: 1 }, /* @__PURE__ */ React91.createElement(Text75, null, figures8.bullet, " ", q.question), /* @__PURE__ */ React91.createElement(Box70, { marginLeft: 2 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.success }, figures8.arrowRight, " ", answers[q.question]))))), /* @__PURE__ */ React91.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text75, { color: theme.secondaryText }, "Ready to submit your answers?")), /* @__PURE__ */ React91.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React91.createElement(
|
|
22802
22788
|
Select,
|
|
22803
22789
|
{
|
|
22804
22790
|
options: [
|
|
@@ -22868,7 +22854,7 @@ function PermissionRequest({
|
|
|
22868
22854
|
`${PRODUCT_NAME} needs your permission to use ${toolName}`
|
|
22869
22855
|
);
|
|
22870
22856
|
const PermissionComponent = permissionComponentForTool(toolUseConfirm.tool);
|
|
22871
|
-
return /* @__PURE__ */
|
|
22857
|
+
return /* @__PURE__ */ React92.createElement(
|
|
22872
22858
|
PermissionComponent,
|
|
22873
22859
|
{
|
|
22874
22860
|
toolUseConfirm,
|
|
@@ -22879,8 +22865,8 @@ function PermissionRequest({
|
|
|
22879
22865
|
}
|
|
22880
22866
|
|
|
22881
22867
|
// src/ui/components/PromptInput.tsx
|
|
22882
|
-
import { Box as
|
|
22883
|
-
import * as
|
|
22868
|
+
import { Box as Box73, Text as Text78, useInput as useInput27 } from "ink";
|
|
22869
|
+
import * as React96 from "react";
|
|
22884
22870
|
|
|
22885
22871
|
// src/ui/hooks/useArrowKeyHistory.ts
|
|
22886
22872
|
import { useState as useState23 } from "react";
|
|
@@ -24914,8 +24900,8 @@ function countTokens(messages) {
|
|
|
24914
24900
|
}
|
|
24915
24901
|
|
|
24916
24902
|
// src/ui/components/SentryErrorBoundary.ts
|
|
24917
|
-
import * as
|
|
24918
|
-
var SentryErrorBoundary = class extends
|
|
24903
|
+
import * as React93 from "react";
|
|
24904
|
+
var SentryErrorBoundary = class extends React93.Component {
|
|
24919
24905
|
constructor(props) {
|
|
24920
24906
|
super(props);
|
|
24921
24907
|
this.state = { hasError: false };
|
|
@@ -24938,8 +24924,8 @@ var SentryErrorBoundary = class extends React94.Component {
|
|
|
24938
24924
|
};
|
|
24939
24925
|
|
|
24940
24926
|
// src/ui/components/TokenWarning.tsx
|
|
24941
|
-
import { Box as
|
|
24942
|
-
import * as
|
|
24927
|
+
import { Box as Box71, Text as Text76 } from "ink";
|
|
24928
|
+
import * as React94 from "react";
|
|
24943
24929
|
var MAX_TOKENS = 19e4;
|
|
24944
24930
|
var WARNING_THRESHOLD = MAX_TOKENS * 0.6;
|
|
24945
24931
|
var ERROR_THRESHOLD = MAX_TOKENS * 0.8;
|
|
@@ -24949,7 +24935,7 @@ function TokenWarning({ tokenUsage }) {
|
|
|
24949
24935
|
return null;
|
|
24950
24936
|
}
|
|
24951
24937
|
const isError = tokenUsage >= ERROR_THRESHOLD;
|
|
24952
|
-
return /* @__PURE__ */
|
|
24938
|
+
return /* @__PURE__ */ React94.createElement(Box71, { flexDirection: "row" }, /* @__PURE__ */ React94.createElement(Text76, { 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"));
|
|
24953
24939
|
}
|
|
24954
24940
|
|
|
24955
24941
|
// src/utils/commands/hashCommand.ts
|
|
@@ -24995,8 +24981,8 @@ _Added on ${now.toLocaleString()} ${timezone}_`;
|
|
|
24995
24981
|
}
|
|
24996
24982
|
|
|
24997
24983
|
// src/ui/components/ModeIndicator.tsx
|
|
24998
|
-
import
|
|
24999
|
-
import { Box as
|
|
24984
|
+
import React95 from "react";
|
|
24985
|
+
import { Box as Box72, Text as Text77 } from "ink";
|
|
25000
24986
|
function __getModeIndicatorDisplayForTests(args) {
|
|
25001
24987
|
if (args.mode === "default") {
|
|
25002
24988
|
return {
|
|
@@ -25067,7 +25053,7 @@ function CompactModeIndicator() {
|
|
|
25067
25053
|
shortcutDisplayText: shortcut.displayText,
|
|
25068
25054
|
theme
|
|
25069
25055
|
});
|
|
25070
|
-
return /* @__PURE__ */
|
|
25056
|
+
return /* @__PURE__ */ React95.createElement(Text77, { color: indicator.color }, indicator.mainText, /* @__PURE__ */ React95.createElement(Text77, { dimColor: true }, indicator.shortcutHintText));
|
|
25071
25057
|
}
|
|
25072
25058
|
|
|
25073
25059
|
// src/utils/terminal/promptInputSpecialKey.ts
|
|
@@ -25194,7 +25180,7 @@ function useStatusLine() {
|
|
|
25194
25180
|
// src/ui/components/PromptInput.tsx
|
|
25195
25181
|
async function interpretHashCommand(input) {
|
|
25196
25182
|
try {
|
|
25197
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
25183
|
+
const { queryQuick: queryQuick2 } = await import("./llm-VY6RXJY7.js");
|
|
25198
25184
|
const systemPrompt = [
|
|
25199
25185
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
25200
25186
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -25245,10 +25231,7 @@ function PromptInput({
|
|
|
25245
25231
|
onShowMessageSelector,
|
|
25246
25232
|
setForkConvoWithMessagesOnTheNextRender,
|
|
25247
25233
|
readFileTimestamps,
|
|
25248
|
-
onModelChange
|
|
25249
|
-
onQueueMessage,
|
|
25250
|
-
onQueueEditRequest,
|
|
25251
|
-
hasQueuedMessages
|
|
25234
|
+
onModelChange
|
|
25252
25235
|
}) {
|
|
25253
25236
|
useEffect23(() => {
|
|
25254
25237
|
if (!isDisabled && !isLoading) {
|
|
@@ -25269,9 +25252,8 @@ function PromptInput({
|
|
|
25269
25252
|
const [pastedImages, setPastedImages] = useState26([]);
|
|
25270
25253
|
const [isEditingExternally, setIsEditingExternally] = useState26(false);
|
|
25271
25254
|
const [currentPwd, setCurrentPwd] = useState26(process.cwd());
|
|
25272
|
-
const
|
|
25273
|
-
const
|
|
25274
|
-
const pastedImageCounter = React97.useRef(1);
|
|
25255
|
+
const pastedTextCounter = React96.useRef(1);
|
|
25256
|
+
const pastedImageCounter = React96.useRef(1);
|
|
25275
25257
|
const { cycleMode, currentMode, toolPermissionContext } = usePermissionContext();
|
|
25276
25258
|
const modeCycleShortcut = useMemo25(() => getPermissionModeCycleShortcut(), []);
|
|
25277
25259
|
const showQuickModelSwitchShortcut = modeCycleShortcut.displayText !== "alt+m";
|
|
@@ -25306,13 +25288,13 @@ function PromptInput({
|
|
|
25306
25288
|
const isSelected = index === selectedIndex;
|
|
25307
25289
|
const isAgent = suggestion.type === "agent";
|
|
25308
25290
|
const displayColor = isSelected ? theme.suggestion : isAgent && suggestion.metadata?.color ? suggestion.metadata.color : void 0;
|
|
25309
|
-
return /* @__PURE__ */
|
|
25310
|
-
|
|
25291
|
+
return /* @__PURE__ */ React96.createElement(
|
|
25292
|
+
Box73,
|
|
25311
25293
|
{
|
|
25312
25294
|
key: `${suggestion.type}-${suggestion.value}-${index}`,
|
|
25313
25295
|
flexDirection: "row"
|
|
25314
25296
|
},
|
|
25315
|
-
/* @__PURE__ */
|
|
25297
|
+
/* @__PURE__ */ React96.createElement(Text78, { color: displayColor, dimColor: !isSelected && !displayColor }, isSelected ? "\u25C6 " : " ", suggestion.displayValue)
|
|
25316
25298
|
);
|
|
25317
25299
|
});
|
|
25318
25300
|
}, [suggestions, selectedIndex, theme.suggestion]);
|
|
@@ -25379,16 +25361,6 @@ function PromptInput({
|
|
|
25379
25361
|
);
|
|
25380
25362
|
const handleHistoryUp = () => {
|
|
25381
25363
|
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
|
-
}
|
|
25392
25364
|
onHistoryUp();
|
|
25393
25365
|
}
|
|
25394
25366
|
};
|
|
@@ -25401,47 +25373,6 @@ function PromptInput({
|
|
|
25401
25373
|
if (!isSubmittingSlashCommand && completionActive && suggestions.length > 0) {
|
|
25402
25374
|
return;
|
|
25403
25375
|
}
|
|
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
|
-
}
|
|
25445
25376
|
if ((mode === "pyb" || input2.startsWith("#")) && input2.match(/^(#\s*)?(put|create|generate|write|give|provide)/i)) {
|
|
25446
25377
|
try {
|
|
25447
25378
|
const originalInput = input2;
|
|
@@ -25508,6 +25439,15 @@ function PromptInput({
|
|
|
25508
25439
|
onModeChange("prompt");
|
|
25509
25440
|
return;
|
|
25510
25441
|
}
|
|
25442
|
+
if (input2 === "") {
|
|
25443
|
+
return;
|
|
25444
|
+
}
|
|
25445
|
+
if (isDisabled) {
|
|
25446
|
+
return;
|
|
25447
|
+
}
|
|
25448
|
+
if (isLoading) {
|
|
25449
|
+
return;
|
|
25450
|
+
}
|
|
25511
25451
|
if (["exit", "quit", ":q", ":q!", ":wq", ":wq!"].includes(input2.trim())) {
|
|
25512
25452
|
exit();
|
|
25513
25453
|
}
|
|
@@ -25553,7 +25493,7 @@ function PromptInput({
|
|
|
25553
25493
|
if (messages2.length) {
|
|
25554
25494
|
if (mode === "bash") {
|
|
25555
25495
|
onQuery(messages2, newAbortController).then(async () => {
|
|
25556
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
25496
|
+
const { getCwd: getCwd2 } = await import("./state-GH6RNHJT.js");
|
|
25557
25497
|
setCurrentPwd(getCwd2());
|
|
25558
25498
|
});
|
|
25559
25499
|
} else {
|
|
@@ -25605,12 +25545,6 @@ function PromptInput({
|
|
|
25605
25545
|
}, [input]);
|
|
25606
25546
|
useInput27(
|
|
25607
25547
|
(inputChar, key) => {
|
|
25608
|
-
if (key.escape && isLoading && editingQueuedId) {
|
|
25609
|
-
setEditingQueuedId(null);
|
|
25610
|
-
onInputChange("");
|
|
25611
|
-
setCursorOffset(0);
|
|
25612
|
-
return true;
|
|
25613
|
-
}
|
|
25614
25548
|
if (mode === "bash" && (key.backspace || key.delete)) {
|
|
25615
25549
|
if (input === "") {
|
|
25616
25550
|
onModeChange("prompt");
|
|
@@ -25715,17 +25649,17 @@ function PromptInput({
|
|
|
25715
25649
|
currentTokens: tokenUsage
|
|
25716
25650
|
};
|
|
25717
25651
|
}, [tokenUsage, modelSwitchMessage.show, submitCount, currentModelId]);
|
|
25718
|
-
return /* @__PURE__ */
|
|
25719
|
-
|
|
25652
|
+
return /* @__PURE__ */ React96.createElement(Box73, { flexDirection: "column" }, (mode === "bash" || modelInfo) && /* @__PURE__ */ React96.createElement(
|
|
25653
|
+
Box73,
|
|
25720
25654
|
{
|
|
25721
25655
|
justifyContent: "space-between",
|
|
25722
25656
|
marginBottom: 1,
|
|
25723
25657
|
flexDirection: "row"
|
|
25724
25658
|
},
|
|
25725
|
-
mode === "bash" ? /* @__PURE__ */
|
|
25726
|
-
modelInfo && /* @__PURE__ */
|
|
25727
|
-
), /* @__PURE__ */
|
|
25728
|
-
|
|
25659
|
+
mode === "bash" ? /* @__PURE__ */ React96.createElement(Text78, { color: theme.bashBorder }, "Shell PWD: ", currentPwd) : /* @__PURE__ */ React96.createElement(Text78, null, " "),
|
|
25660
|
+
modelInfo && /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, "[", modelInfo.provider, "] ", modelInfo.name, ":", " ", Math.round(modelInfo.currentTokens / 1e3), "k /", " ", Math.round(modelInfo.contextLength / 1e3), "k")
|
|
25661
|
+
), /* @__PURE__ */ React96.createElement(
|
|
25662
|
+
Box73,
|
|
25729
25663
|
{
|
|
25730
25664
|
alignItems: "flex-start",
|
|
25731
25665
|
justifyContent: "flex-start",
|
|
@@ -25739,8 +25673,8 @@ function PromptInput({
|
|
|
25739
25673
|
marginTop: 1,
|
|
25740
25674
|
width: "100%"
|
|
25741
25675
|
},
|
|
25742
|
-
/* @__PURE__ */
|
|
25743
|
-
|
|
25676
|
+
/* @__PURE__ */ React96.createElement(
|
|
25677
|
+
Box73,
|
|
25744
25678
|
{
|
|
25745
25679
|
alignItems: "flex-start",
|
|
25746
25680
|
alignSelf: "flex-start",
|
|
@@ -25748,9 +25682,9 @@ function PromptInput({
|
|
|
25748
25682
|
justifyContent: "flex-start",
|
|
25749
25683
|
width: 3
|
|
25750
25684
|
},
|
|
25751
|
-
mode === "bash" ? /* @__PURE__ */
|
|
25685
|
+
mode === "bash" ? /* @__PURE__ */ React96.createElement(Text78, { color: theme.bashBorder }, "\xA0!\xA0") : mode === "pyb" ? /* @__PURE__ */ React96.createElement(Text78, { color: theme.noting }, "\xA0#\xA0") : /* @__PURE__ */ React96.createElement(Text78, { color: isLoading ? theme.secondaryText : void 0 }, "P>\xA0")
|
|
25752
25686
|
),
|
|
25753
|
-
/* @__PURE__ */
|
|
25687
|
+
/* @__PURE__ */ React96.createElement(Box73, { paddingRight: 1 }, /* @__PURE__ */ React96.createElement(
|
|
25754
25688
|
TextInput,
|
|
25755
25689
|
{
|
|
25756
25690
|
multiline: true,
|
|
@@ -25775,44 +25709,44 @@ function PromptInput({
|
|
|
25775
25709
|
onSpecialKey: handleSpecialKey
|
|
25776
25710
|
}
|
|
25777
25711
|
))
|
|
25778
|
-
), !completionActive && suggestions.length === 0 && /* @__PURE__ */
|
|
25779
|
-
|
|
25712
|
+
), !completionActive && suggestions.length === 0 && /* @__PURE__ */ React96.createElement(Box73, { flexDirection: "column", paddingX: 2, paddingY: 0 }, /* @__PURE__ */ React96.createElement(Box73, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React96.createElement(Box73, { justifyContent: "flex-start", gap: 1 }, exitMessage.show ? /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, "Press ", exitMessage.key, " again to exit") : message.show ? /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, message.text) : rewindMessagePending ? /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, "Press Escape again to undo") : modelSwitchMessage.show ? /* @__PURE__ */ React96.createElement(Text78, { color: theme.success }, modelSwitchMessage.text) : mode === "prompt" && currentMode !== "default" ? /* @__PURE__ */ React96.createElement(CompactModeIndicator, null) : /* @__PURE__ */ React96.createElement(React96.Fragment, null, /* @__PURE__ */ React96.createElement(
|
|
25713
|
+
Text78,
|
|
25780
25714
|
{
|
|
25781
25715
|
color: mode === "bash" ? theme.bashBorder : void 0,
|
|
25782
25716
|
dimColor: mode !== "bash"
|
|
25783
25717
|
},
|
|
25784
25718
|
"! run some shell command"
|
|
25785
|
-
), /* @__PURE__ */
|
|
25786
|
-
|
|
25719
|
+
), /* @__PURE__ */ React96.createElement(Text78, { dimColor: true }, " \xB7 / for commands"), /* @__PURE__ */ React96.createElement(
|
|
25720
|
+
Text78,
|
|
25787
25721
|
{
|
|
25788
25722
|
color: mode === "pyb" ? theme.noting : void 0,
|
|
25789
25723
|
dimColor: mode !== "pyb"
|
|
25790
25724
|
},
|
|
25791
25725
|
" ",
|
|
25792
25726
|
"\xB7 # tell agent something to remember forever"
|
|
25793
|
-
))), /* @__PURE__ */
|
|
25727
|
+
))), /* @__PURE__ */ React96.createElement(Box73, { justifyContent: "flex-end" }, /* @__PURE__ */ React96.createElement(Text78, { 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__ */ React96.createElement(Box73, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React96.createElement(Box73, { justifyContent: "flex-start", gap: 1 }, /* @__PURE__ */ React96.createElement(Text78, { 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__ */ React96.createElement(
|
|
25794
25728
|
SentryErrorBoundary,
|
|
25795
25729
|
{
|
|
25796
|
-
children: /* @__PURE__ */
|
|
25730
|
+
children: /* @__PURE__ */ React96.createElement(Box73, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React96.createElement(TokenWarning, { tokenUsage }))
|
|
25797
25731
|
}
|
|
25798
|
-
))), suggestions.length > 0 && /* @__PURE__ */
|
|
25799
|
-
|
|
25732
|
+
))), suggestions.length > 0 && /* @__PURE__ */ React96.createElement(
|
|
25733
|
+
Box73,
|
|
25800
25734
|
{
|
|
25801
25735
|
flexDirection: "row",
|
|
25802
25736
|
justifyContent: "space-between",
|
|
25803
25737
|
paddingX: 2,
|
|
25804
25738
|
paddingY: 0
|
|
25805
25739
|
},
|
|
25806
|
-
/* @__PURE__ */
|
|
25807
|
-
|
|
25740
|
+
/* @__PURE__ */ React96.createElement(Box73, { flexDirection: "column" }, renderedSuggestions, /* @__PURE__ */ React96.createElement(
|
|
25741
|
+
Box73,
|
|
25808
25742
|
{
|
|
25809
25743
|
marginTop: 1,
|
|
25810
25744
|
paddingX: 3,
|
|
25811
25745
|
borderStyle: "round",
|
|
25812
25746
|
borderColor: "gray"
|
|
25813
25747
|
},
|
|
25814
|
-
/* @__PURE__ */
|
|
25815
|
-
|
|
25748
|
+
/* @__PURE__ */ React96.createElement(
|
|
25749
|
+
Text78,
|
|
25816
25750
|
{
|
|
25817
25751
|
dimColor: !emptyDirMessage,
|
|
25818
25752
|
color: emptyDirMessage ? "yellow" : void 0
|
|
@@ -25832,10 +25766,10 @@ function PromptInput({
|
|
|
25832
25766
|
})()
|
|
25833
25767
|
)
|
|
25834
25768
|
)),
|
|
25835
|
-
/* @__PURE__ */
|
|
25769
|
+
/* @__PURE__ */ React96.createElement(
|
|
25836
25770
|
SentryErrorBoundary,
|
|
25837
25771
|
{
|
|
25838
|
-
children: /* @__PURE__ */
|
|
25772
|
+
children: /* @__PURE__ */ React96.createElement(Box73, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React96.createElement(TokenWarning, { tokenUsage: countTokens(messages) }))
|
|
25839
25773
|
}
|
|
25840
25774
|
)
|
|
25841
25775
|
));
|
|
@@ -27191,22 +27125,6 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
27191
27125
|
return;
|
|
27192
27126
|
}
|
|
27193
27127
|
}
|
|
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
|
-
}
|
|
27210
27128
|
yield assistantMessage;
|
|
27211
27129
|
return;
|
|
27212
27130
|
}
|
|
@@ -27235,17 +27153,8 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
27235
27153
|
return;
|
|
27236
27154
|
}
|
|
27237
27155
|
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];
|
|
27247
27156
|
yield* await queryCore(
|
|
27248
|
-
|
|
27157
|
+
[...messages, assistantMessage, ...toolMessagesForNextTurn],
|
|
27249
27158
|
systemPrompt,
|
|
27250
27159
|
context,
|
|
27251
27160
|
canUseTool,
|
|
@@ -27661,99 +27570,18 @@ function createErrorToolResultBlock(args) {
|
|
|
27661
27570
|
};
|
|
27662
27571
|
}
|
|
27663
27572
|
|
|
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
|
-
|
|
27745
27573
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
27746
|
-
import { default as
|
|
27574
|
+
import { default as React100, useCallback as useCallback15 } from "react";
|
|
27747
27575
|
|
|
27748
27576
|
// src/ui/components/binary-feedback/BinaryFeedbackView.tsx
|
|
27749
27577
|
import chalk14 from "chalk";
|
|
27750
|
-
import { Box as
|
|
27578
|
+
import { Box as Box75, Text as Text79, useInput as useInput29 } from "ink";
|
|
27751
27579
|
import Link2 from "ink-link";
|
|
27752
|
-
import
|
|
27580
|
+
import React99, { useState as useState27 } from "react";
|
|
27753
27581
|
|
|
27754
27582
|
// src/ui/components/binary-feedback/BinaryFeedbackOption.tsx
|
|
27755
|
-
import * as
|
|
27756
|
-
import { Box as
|
|
27583
|
+
import * as React98 from "react";
|
|
27584
|
+
import { Box as Box74 } from "ink";
|
|
27757
27585
|
function BinaryFeedbackOption({
|
|
27758
27586
|
debug: debug2,
|
|
27759
27587
|
erroredToolUseIDs,
|
|
@@ -27765,7 +27593,7 @@ function BinaryFeedbackOption({
|
|
|
27765
27593
|
verbose
|
|
27766
27594
|
}) {
|
|
27767
27595
|
const { columns } = useTerminalSize();
|
|
27768
|
-
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */
|
|
27596
|
+
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */ React98.createElement(Box74, { flexDirection: "column", key: index }, /* @__PURE__ */ React98.createElement(
|
|
27769
27597
|
Message,
|
|
27770
27598
|
{
|
|
27771
27599
|
addMargin: false,
|
|
@@ -27781,7 +27609,7 @@ function BinaryFeedbackOption({
|
|
|
27781
27609
|
verbose,
|
|
27782
27610
|
width: columns / 2 - 6
|
|
27783
27611
|
}
|
|
27784
|
-
), /* @__PURE__ */
|
|
27612
|
+
), /* @__PURE__ */ React98.createElement(AdditionalContext, { message: _, verbose })));
|
|
27785
27613
|
}
|
|
27786
27614
|
function AdditionalContext({
|
|
27787
27615
|
message,
|
|
@@ -27813,7 +27641,7 @@ function AdditionalContext({
|
|
|
27813
27641
|
} catch {
|
|
27814
27642
|
return null;
|
|
27815
27643
|
}
|
|
27816
|
-
return /* @__PURE__ */
|
|
27644
|
+
return /* @__PURE__ */ React98.createElement(
|
|
27817
27645
|
FileEditToolDiff,
|
|
27818
27646
|
{
|
|
27819
27647
|
file_path: input.data.file_path,
|
|
@@ -27829,7 +27657,7 @@ function AdditionalContext({
|
|
|
27829
27657
|
if (!input.success) {
|
|
27830
27658
|
return null;
|
|
27831
27659
|
}
|
|
27832
|
-
return /* @__PURE__ */
|
|
27660
|
+
return /* @__PURE__ */ React98.createElement(
|
|
27833
27661
|
FileWriteToolDiff,
|
|
27834
27662
|
{
|
|
27835
27663
|
file_path: input.data.file_path,
|
|
@@ -27894,8 +27722,8 @@ function BinaryFeedbackView({
|
|
|
27894
27722
|
onChoose?.("neither");
|
|
27895
27723
|
}
|
|
27896
27724
|
});
|
|
27897
|
-
return /* @__PURE__ */
|
|
27898
|
-
|
|
27725
|
+
return /* @__PURE__ */ React99.createElement(React99.Fragment, null, /* @__PURE__ */ React99.createElement(
|
|
27726
|
+
Box75,
|
|
27899
27727
|
{
|
|
27900
27728
|
flexDirection: "column",
|
|
27901
27729
|
height: "100%",
|
|
@@ -27903,9 +27731,9 @@ function BinaryFeedbackView({
|
|
|
27903
27731
|
borderStyle: "round",
|
|
27904
27732
|
borderColor: theme.permission
|
|
27905
27733
|
},
|
|
27906
|
-
/* @__PURE__ */
|
|
27907
|
-
/* @__PURE__ */
|
|
27908
|
-
|
|
27734
|
+
/* @__PURE__ */ React99.createElement(Box75, { width: "100%", justifyContent: "space-between", paddingX: 1 }, /* @__PURE__ */ React99.createElement(Text79, { bold: true, color: theme.permission }, "[ANT-ONLY] Help train ", PRODUCT_NAME), /* @__PURE__ */ React99.createElement(Text79, null, /* @__PURE__ */ React99.createElement(Link2, { url: HELP_URL }, "[?]"))),
|
|
27735
|
+
/* @__PURE__ */ React99.createElement(Box75, { flexDirection: "row", width: "100%", flexGrow: 1, paddingTop: 1 }, /* @__PURE__ */ React99.createElement(
|
|
27736
|
+
Box75,
|
|
27909
27737
|
{
|
|
27910
27738
|
flexDirection: "column",
|
|
27911
27739
|
flexGrow: 1,
|
|
@@ -27916,7 +27744,7 @@ function BinaryFeedbackView({
|
|
|
27916
27744
|
marginRight: 1,
|
|
27917
27745
|
padding: 1
|
|
27918
27746
|
},
|
|
27919
|
-
/* @__PURE__ */
|
|
27747
|
+
/* @__PURE__ */ React99.createElement(
|
|
27920
27748
|
BinaryFeedbackOption,
|
|
27921
27749
|
{
|
|
27922
27750
|
erroredToolUseIDs,
|
|
@@ -27929,8 +27757,8 @@ function BinaryFeedbackView({
|
|
|
27929
27757
|
verbose
|
|
27930
27758
|
}
|
|
27931
27759
|
)
|
|
27932
|
-
), /* @__PURE__ */
|
|
27933
|
-
|
|
27760
|
+
), /* @__PURE__ */ React99.createElement(
|
|
27761
|
+
Box75,
|
|
27934
27762
|
{
|
|
27935
27763
|
flexDirection: "column",
|
|
27936
27764
|
flexGrow: 1,
|
|
@@ -27941,7 +27769,7 @@ function BinaryFeedbackView({
|
|
|
27941
27769
|
marginLeft: 1,
|
|
27942
27770
|
padding: 1
|
|
27943
27771
|
},
|
|
27944
|
-
/* @__PURE__ */
|
|
27772
|
+
/* @__PURE__ */ React99.createElement(
|
|
27945
27773
|
BinaryFeedbackOption,
|
|
27946
27774
|
{
|
|
27947
27775
|
erroredToolUseIDs,
|
|
@@ -27955,7 +27783,7 @@ function BinaryFeedbackView({
|
|
|
27955
27783
|
}
|
|
27956
27784
|
)
|
|
27957
27785
|
)),
|
|
27958
|
-
/* @__PURE__ */
|
|
27786
|
+
/* @__PURE__ */ React99.createElement(Box75, { flexDirection: "column", paddingTop: 1, paddingX: 1 }, /* @__PURE__ */ React99.createElement(Text79, null, "How do you want to proceed?"), /* @__PURE__ */ React99.createElement(
|
|
27959
27787
|
Select,
|
|
27960
27788
|
{
|
|
27961
27789
|
options: getOptions2(),
|
|
@@ -27964,7 +27792,7 @@ function BinaryFeedbackView({
|
|
|
27964
27792
|
onChange: onChoose
|
|
27965
27793
|
}
|
|
27966
27794
|
))
|
|
27967
|
-
), exitState.pending ? /* @__PURE__ */
|
|
27795
|
+
), exitState.pending ? /* @__PURE__ */ React99.createElement(Box75, { marginLeft: 3 }, /* @__PURE__ */ React99.createElement(Text79, { dimColor: true }, "Press ", exitState.keyName, " again to exit")) : /* @__PURE__ */ React99.createElement(Text79, null, " "));
|
|
27968
27796
|
}
|
|
27969
27797
|
|
|
27970
27798
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
@@ -27990,7 +27818,7 @@ function BinaryFeedback({
|
|
|
27990
27818
|
useNotifyAfterTimeout(
|
|
27991
27819
|
`${PRODUCT_NAME} needs your input on a response comparison`
|
|
27992
27820
|
);
|
|
27993
|
-
return /* @__PURE__ */
|
|
27821
|
+
return /* @__PURE__ */ React100.createElement(
|
|
27994
27822
|
BinaryFeedbackView,
|
|
27995
27823
|
{
|
|
27996
27824
|
debug: debug2,
|
|
@@ -28061,7 +27889,6 @@ async function getReasoningEffort(modelProfile, messages) {
|
|
|
28061
27889
|
}
|
|
28062
27890
|
|
|
28063
27891
|
// src/ui/screens/REPL.tsx
|
|
28064
|
-
import { randomUUID as randomUUID5 } from "crypto";
|
|
28065
27892
|
function REPL({
|
|
28066
27893
|
commands,
|
|
28067
27894
|
safeMode,
|
|
@@ -28099,8 +27926,6 @@ function REPL({
|
|
|
28099
27926
|
null
|
|
28100
27927
|
);
|
|
28101
27928
|
const [messages, setMessages2] = useState28(initialMessages ?? []);
|
|
28102
|
-
const [queuedMessages, setQueuedMessages] = useState28([]);
|
|
28103
|
-
const queuedMessagesRef = useRef13([]);
|
|
28104
27929
|
const [inputValue, setInputValue] = useState28("");
|
|
28105
27930
|
const [inputMode, setInputMode] = useState28(
|
|
28106
27931
|
"prompt"
|
|
@@ -28127,113 +27952,6 @@ function REPL({
|
|
|
28127
27952
|
[]
|
|
28128
27953
|
);
|
|
28129
27954
|
const readFileTimestamps = useRef13({});
|
|
28130
|
-
const queueMergeWindowMs = getGlobalConfig().queueMergeWindowMs ?? 500;
|
|
28131
|
-
const updateQueuedMessages = useCallback16(
|
|
28132
|
-
(next) => {
|
|
28133
|
-
queuedMessagesRef.current = next;
|
|
28134
|
-
setQueuedMessages(next);
|
|
28135
|
-
},
|
|
28136
|
-
[]
|
|
28137
|
-
);
|
|
28138
|
-
const enqueueQueuedMessage = useCallback16(
|
|
28139
|
-
(args) => {
|
|
28140
|
-
if (args.replaceId) {
|
|
28141
|
-
const next = applyQueuedEdit({
|
|
28142
|
-
entries: queuedMessagesRef.current,
|
|
28143
|
-
replaceId: args.replaceId,
|
|
28144
|
-
content: args.content,
|
|
28145
|
-
mode: args.mode,
|
|
28146
|
-
delete: args.delete
|
|
28147
|
-
});
|
|
28148
|
-
updateQueuedMessages(next);
|
|
28149
|
-
return;
|
|
28150
|
-
}
|
|
28151
|
-
const entry = {
|
|
28152
|
-
id: randomUUID5(),
|
|
28153
|
-
content: args.content,
|
|
28154
|
-
queuedAt: Date.now(),
|
|
28155
|
-
activeTurnId: getLastAssistantMessageId(messages),
|
|
28156
|
-
mode: args.mode
|
|
28157
|
-
};
|
|
28158
|
-
updateQueuedMessages([...queuedMessagesRef.current, entry]);
|
|
28159
|
-
},
|
|
28160
|
-
[messages, updateQueuedMessages]
|
|
28161
|
-
);
|
|
28162
|
-
const dequeueQueuedMessageForEdit = useCallback16(
|
|
28163
|
-
(currentEditId) => {
|
|
28164
|
-
const current = queuedMessagesRef.current;
|
|
28165
|
-
if (current.length === 0) return null;
|
|
28166
|
-
if (!currentEditId) {
|
|
28167
|
-
const last2 = current[current.length - 1];
|
|
28168
|
-
return { id: last2.id, content: last2.content, mode: last2.mode };
|
|
28169
|
-
}
|
|
28170
|
-
const index = current.findIndex((entry) => entry.id === currentEditId);
|
|
28171
|
-
if (index > 0) {
|
|
28172
|
-
const prev = current[index - 1];
|
|
28173
|
-
return { id: prev.id, content: prev.content, mode: prev.mode };
|
|
28174
|
-
}
|
|
28175
|
-
const fallback = current[current.length - 1];
|
|
28176
|
-
return fallback ? { id: fallback.id, content: fallback.content, mode: fallback.mode } : null;
|
|
28177
|
-
},
|
|
28178
|
-
[]
|
|
28179
|
-
);
|
|
28180
|
-
const dequeueQueuedMessagesForNextTurn = useCallback16(
|
|
28181
|
-
async (activeTurnId) => {
|
|
28182
|
-
const { batch, remaining } = takeQueuedBatch({
|
|
28183
|
-
entries: queuedMessagesRef.current,
|
|
28184
|
-
activeTurnId,
|
|
28185
|
-
windowMs: queueMergeWindowMs
|
|
28186
|
-
});
|
|
28187
|
-
if (!batch) return null;
|
|
28188
|
-
updateQueuedMessages(remaining);
|
|
28189
|
-
const combinedContent = batch.entries.length === 1 ? batch.entries[0].content : batch.entries.map((entry, index) => `${index + 1}) ${entry.content}`).join("\n");
|
|
28190
|
-
const wrappedContent = batch.mode === "bash" ? combinedContent : wrapQueuedContent({
|
|
28191
|
-
content: combinedContent,
|
|
28192
|
-
queuedAt: new Date(batch.queuedAt).toISOString(),
|
|
28193
|
-
activeTurnId: batch.activeTurnId
|
|
28194
|
-
});
|
|
28195
|
-
const generatedMessages = await processUserInput(
|
|
28196
|
-
wrappedContent,
|
|
28197
|
-
batch.mode,
|
|
28198
|
-
setToolJSX,
|
|
28199
|
-
{
|
|
28200
|
-
options: {
|
|
28201
|
-
commands,
|
|
28202
|
-
forkNumber,
|
|
28203
|
-
messageLogName,
|
|
28204
|
-
tools,
|
|
28205
|
-
verbose,
|
|
28206
|
-
maxThinkingTokens: 0,
|
|
28207
|
-
safeMode,
|
|
28208
|
-
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
28209
|
-
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
28210
|
-
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
28211
|
-
})
|
|
28212
|
-
},
|
|
28213
|
-
messageId: batch.activeTurnId,
|
|
28214
|
-
setForkConvoWithMessagesOnTheNextRender,
|
|
28215
|
-
readFileTimestamps: readFileTimestamps.current,
|
|
28216
|
-
abortController: abortController || new AbortController()
|
|
28217
|
-
},
|
|
28218
|
-
null
|
|
28219
|
-
);
|
|
28220
|
-
return generatedMessages;
|
|
28221
|
-
},
|
|
28222
|
-
[
|
|
28223
|
-
commands,
|
|
28224
|
-
forkNumber,
|
|
28225
|
-
messageLogName,
|
|
28226
|
-
tools,
|
|
28227
|
-
verbose,
|
|
28228
|
-
safeMode,
|
|
28229
|
-
setToolJSX,
|
|
28230
|
-
setForkConvoWithMessagesOnTheNextRender,
|
|
28231
|
-
messages,
|
|
28232
|
-
abortController,
|
|
28233
|
-
queueMergeWindowMs,
|
|
28234
|
-
updateQueuedMessages
|
|
28235
|
-
]
|
|
28236
|
-
);
|
|
28237
27955
|
const { status: apiKeyStatus, reverify } = useApiKeyVerification();
|
|
28238
27956
|
function onCancel() {
|
|
28239
27957
|
if (!isLoading) {
|
|
@@ -28351,7 +28069,6 @@ function REPL({
|
|
|
28351
28069
|
verbose,
|
|
28352
28070
|
safeMode,
|
|
28353
28071
|
maxThinkingTokens,
|
|
28354
|
-
dequeueQueuedMessagesForNextTurn,
|
|
28355
28072
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
28356
28073
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
28357
28074
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -28416,7 +28133,6 @@ function REPL({
|
|
|
28416
28133
|
safeMode,
|
|
28417
28134
|
maxThinkingTokens,
|
|
28418
28135
|
isPybRequest: isPybRequest || void 0,
|
|
28419
|
-
dequeueQueuedMessagesForNextTurn,
|
|
28420
28136
|
toolPermissionContext: getToolPermissionContextForConversationKey({
|
|
28421
28137
|
conversationKey: `${messageLogName}:${forkNumber}`,
|
|
28422
28138
|
isBypassPermissionsModeAvailable: !(safeMode ?? false)
|
|
@@ -28505,7 +28221,7 @@ function REPL({
|
|
|
28505
28221
|
const messagesJSX = useMemo26(() => {
|
|
28506
28222
|
return orderedMessages.map((_, index) => {
|
|
28507
28223
|
const toolUseID = getToolUseID(_);
|
|
28508
|
-
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */
|
|
28224
|
+
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */ React101.createElement(
|
|
28509
28225
|
Message,
|
|
28510
28226
|
{
|
|
28511
28227
|
message: _.content,
|
|
@@ -28520,10 +28236,10 @@ function REPL({
|
|
|
28520
28236
|
shouldAnimate: false,
|
|
28521
28237
|
shouldShowDot: false
|
|
28522
28238
|
}
|
|
28523
|
-
) : /* @__PURE__ */
|
|
28239
|
+
) : /* @__PURE__ */ React101.createElement(
|
|
28524
28240
|
MessageResponse,
|
|
28525
28241
|
{
|
|
28526
|
-
children: /* @__PURE__ */
|
|
28242
|
+
children: /* @__PURE__ */ React101.createElement(
|
|
28527
28243
|
Message,
|
|
28528
28244
|
{
|
|
28529
28245
|
message: _.content,
|
|
@@ -28542,7 +28258,7 @@ function REPL({
|
|
|
28542
28258
|
}
|
|
28543
28259
|
)
|
|
28544
28260
|
}
|
|
28545
|
-
) : /* @__PURE__ */
|
|
28261
|
+
) : /* @__PURE__ */ React101.createElement(
|
|
28546
28262
|
Message,
|
|
28547
28263
|
{
|
|
28548
28264
|
message: _,
|
|
@@ -28561,8 +28277,8 @@ function REPL({
|
|
|
28561
28277
|
const isInStaticPrefix = index < replStaticPrefixLength;
|
|
28562
28278
|
if (debug2) {
|
|
28563
28279
|
return {
|
|
28564
|
-
jsx: /* @__PURE__ */
|
|
28565
|
-
|
|
28280
|
+
jsx: /* @__PURE__ */ React101.createElement(
|
|
28281
|
+
Box76,
|
|
28566
28282
|
{
|
|
28567
28283
|
borderStyle: "single",
|
|
28568
28284
|
borderColor: isInStaticPrefix ? "green" : "red",
|
|
@@ -28574,7 +28290,7 @@ function REPL({
|
|
|
28574
28290
|
};
|
|
28575
28291
|
}
|
|
28576
28292
|
return {
|
|
28577
|
-
jsx: /* @__PURE__ */
|
|
28293
|
+
jsx: /* @__PURE__ */ React101.createElement(Box76, { key: _.uuid, width: "100%" }, message)
|
|
28578
28294
|
};
|
|
28579
28295
|
});
|
|
28580
28296
|
}, [
|
|
@@ -28597,7 +28313,7 @@ function REPL({
|
|
|
28597
28313
|
const staticItems = useMemo26(
|
|
28598
28314
|
() => [
|
|
28599
28315
|
{
|
|
28600
|
-
jsx: /* @__PURE__ */
|
|
28316
|
+
jsx: /* @__PURE__ */ React101.createElement(Box76, { flexDirection: "column", key: `logo${forkNumber}` }, /* @__PURE__ */ React101.createElement(
|
|
28601
28317
|
Logo,
|
|
28602
28318
|
{
|
|
28603
28319
|
mcpClients,
|
|
@@ -28605,7 +28321,7 @@ function REPL({
|
|
|
28605
28321
|
updateBannerVersion: updateAvailableVersion,
|
|
28606
28322
|
updateBannerCommands: updateCommands
|
|
28607
28323
|
}
|
|
28608
|
-
), /* @__PURE__ */
|
|
28324
|
+
), /* @__PURE__ */ React101.createElement(ProjectOnboarding, { workspaceDir: getOriginalCwd() }))
|
|
28609
28325
|
},
|
|
28610
28326
|
...messagesJSX.slice(0, replStaticPrefixLength)
|
|
28611
28327
|
],
|
|
@@ -28625,24 +28341,23 @@ function REPL({
|
|
|
28625
28341
|
);
|
|
28626
28342
|
const showingCostDialog = !isLoading && showCostDialog;
|
|
28627
28343
|
const conversationKey = `${messageLogName}:${forkNumber}`;
|
|
28628
|
-
|
|
28629
|
-
return /* @__PURE__ */ React102.createElement(
|
|
28344
|
+
return /* @__PURE__ */ React101.createElement(
|
|
28630
28345
|
PermissionProvider,
|
|
28631
28346
|
{
|
|
28632
28347
|
conversationKey,
|
|
28633
28348
|
isBypassPermissionsModeAvailable: !safeMode
|
|
28634
28349
|
},
|
|
28635
|
-
/* @__PURE__ */
|
|
28636
|
-
|
|
28350
|
+
/* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(React101.Fragment, { key: `static-messages-${forkNumber}` }, /* @__PURE__ */ React101.createElement(Static2, { items: staticItems, children: (item) => item.jsx })), /* @__PURE__ */ React101.createElement(TaskPanel, null), transientItems.map((_) => _.jsx), /* @__PURE__ */ React101.createElement(
|
|
28351
|
+
Box76,
|
|
28637
28352
|
{
|
|
28638
28353
|
borderColor: "red",
|
|
28639
28354
|
borderStyle: debug2 ? "single" : void 0,
|
|
28640
28355
|
flexDirection: "column",
|
|
28641
28356
|
width: "100%"
|
|
28642
28357
|
},
|
|
28643
|
-
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */
|
|
28358
|
+
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */ React101.createElement(RequestStatusIndicator, null),
|
|
28644
28359
|
toolJSX ? toolJSX.jsx : null,
|
|
28645
|
-
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */
|
|
28360
|
+
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */ React101.createElement(
|
|
28646
28361
|
BinaryFeedback,
|
|
28647
28362
|
{
|
|
28648
28363
|
m1: binaryFeedbackContext.m1,
|
|
@@ -28660,7 +28375,7 @@ function REPL({
|
|
|
28660
28375
|
unresolvedToolUseIDs
|
|
28661
28376
|
}
|
|
28662
28377
|
),
|
|
28663
|
-
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */
|
|
28378
|
+
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */ React101.createElement(
|
|
28664
28379
|
PermissionRequest,
|
|
28665
28380
|
{
|
|
28666
28381
|
toolUseConfirm,
|
|
@@ -28668,7 +28383,7 @@ function REPL({
|
|
|
28668
28383
|
verbose
|
|
28669
28384
|
}
|
|
28670
28385
|
),
|
|
28671
|
-
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */
|
|
28386
|
+
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */ React101.createElement(
|
|
28672
28387
|
CostThresholdDialog,
|
|
28673
28388
|
{
|
|
28674
28389
|
onDone: () => {
|
|
@@ -28682,17 +28397,7 @@ function REPL({
|
|
|
28682
28397
|
}
|
|
28683
28398
|
}
|
|
28684
28399
|
),
|
|
28685
|
-
/* @__PURE__ */
|
|
28686
|
-
QueuedMessageList,
|
|
28687
|
-
{
|
|
28688
|
-
items: queuedMessages.map((item) => ({
|
|
28689
|
-
id: item.id,
|
|
28690
|
-
content: item.content
|
|
28691
|
-
}))
|
|
28692
|
-
}
|
|
28693
|
-
),
|
|
28694
|
-
/* @__PURE__ */ React102.createElement(QueuedHintLine, { show: hasQueuedMessages && isLoading }),
|
|
28695
|
-
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(
|
|
28400
|
+
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(
|
|
28696
28401
|
PromptInput_default,
|
|
28697
28402
|
{
|
|
28698
28403
|
commands,
|
|
@@ -28719,13 +28424,10 @@ function REPL({
|
|
|
28719
28424
|
onShowMessageSelector: () => setIsMessageSelectorVisible((prev) => !prev),
|
|
28720
28425
|
setForkConvoWithMessagesOnTheNextRender,
|
|
28721
28426
|
readFileTimestamps: readFileTimestamps.current,
|
|
28722
|
-
abortController
|
|
28723
|
-
onQueueMessage: enqueueQueuedMessage,
|
|
28724
|
-
onQueueEditRequest: dequeueQueuedMessageForEdit,
|
|
28725
|
-
hasQueuedMessages
|
|
28427
|
+
abortController
|
|
28726
28428
|
}
|
|
28727
28429
|
))
|
|
28728
|
-
), isMessageSelectorVisible && /* @__PURE__ */
|
|
28430
|
+
), isMessageSelectorVisible && /* @__PURE__ */ React101.createElement(
|
|
28729
28431
|
MessageSelector,
|
|
28730
28432
|
{
|
|
28731
28433
|
erroredToolUseIDs,
|
|
@@ -28751,13 +28453,13 @@ function REPL({
|
|
|
28751
28453
|
onEscape: () => setIsMessageSelectorVisible(false),
|
|
28752
28454
|
tools
|
|
28753
28455
|
}
|
|
28754
|
-
), /* @__PURE__ */
|
|
28456
|
+
), /* @__PURE__ */ React101.createElement(Newline4, null))
|
|
28755
28457
|
);
|
|
28756
28458
|
}
|
|
28757
28459
|
|
|
28758
28460
|
// src/ui/components/SessionSelector.tsx
|
|
28759
|
-
import
|
|
28760
|
-
import { Box as
|
|
28461
|
+
import React102 from "react";
|
|
28462
|
+
import { Box as Box77, Text as Text81 } from "ink";
|
|
28761
28463
|
function SessionSelector({
|
|
28762
28464
|
sessions,
|
|
28763
28465
|
onSelect
|
|
@@ -28785,18 +28487,18 @@ function SessionSelector({
|
|
|
28785
28487
|
const truncated = labelTxt.length > columns - 2 ? `${labelTxt.slice(0, columns - 5)}...` : labelTxt;
|
|
28786
28488
|
return { label: truncated, value: String(i) };
|
|
28787
28489
|
});
|
|
28788
|
-
return /* @__PURE__ */
|
|
28490
|
+
return /* @__PURE__ */ React102.createElement(Box77, { flexDirection: "column", height: "100%", width: "100%" }, /* @__PURE__ */ React102.createElement(Box77, { paddingLeft: 9 }, /* @__PURE__ */ React102.createElement(Text81, { bold: true, color: getTheme().text }, "Modified"), /* @__PURE__ */ React102.createElement(Text81, null, " "), /* @__PURE__ */ React102.createElement(Text81, { bold: true, color: getTheme().text }, "Created"), /* @__PURE__ */ React102.createElement(Text81, null, " "), /* @__PURE__ */ React102.createElement(Text81, { bold: true, color: getTheme().text }, "Tag"), /* @__PURE__ */ React102.createElement(Text81, null, " "), /* @__PURE__ */ React102.createElement(Text81, { bold: true, color: getTheme().text }, "Session")), /* @__PURE__ */ React102.createElement(
|
|
28789
28491
|
Select,
|
|
28790
28492
|
{
|
|
28791
28493
|
options,
|
|
28792
28494
|
onChange: (value) => onSelect(parseInt(value, 10)),
|
|
28793
28495
|
visibleOptionCount: visibleCount
|
|
28794
28496
|
}
|
|
28795
|
-
), hiddenCount > 0 && /* @__PURE__ */
|
|
28497
|
+
), hiddenCount > 0 && /* @__PURE__ */ React102.createElement(Box77, { paddingLeft: 2 }, /* @__PURE__ */ React102.createElement(Text81, { color: getTheme().secondaryText }, "and ", hiddenCount, " more\u2026")));
|
|
28796
28498
|
}
|
|
28797
28499
|
|
|
28798
28500
|
// src/ui/screens/ResumeConversation.tsx
|
|
28799
|
-
import { randomUUID as
|
|
28501
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
28800
28502
|
function ResumeConversation({
|
|
28801
28503
|
cwd,
|
|
28802
28504
|
context,
|
|
@@ -28820,7 +28522,7 @@ function ResumeConversation({
|
|
|
28820
28522
|
if (!selected) return;
|
|
28821
28523
|
context.unmount?.();
|
|
28822
28524
|
const resumedFromSessionId = selected.sessionId;
|
|
28823
|
-
const effectiveSessionId = forkSession ? forkSessionId?.trim() ||
|
|
28525
|
+
const effectiveSessionId = forkSession ? forkSessionId?.trim() || randomUUID5() : resumedFromSessionId;
|
|
28824
28526
|
setPybAgentSessionId(effectiveSessionId);
|
|
28825
28527
|
const messages = loadPybAgentSessionMessages({
|
|
28826
28528
|
cwd,
|
|
@@ -28828,7 +28530,7 @@ function ResumeConversation({
|
|
|
28828
28530
|
});
|
|
28829
28531
|
const isDefaultModel = await isDefaultSlowAndCapableModel();
|
|
28830
28532
|
render(
|
|
28831
|
-
/* @__PURE__ */
|
|
28533
|
+
/* @__PURE__ */ React103.createElement(
|
|
28832
28534
|
REPL,
|
|
28833
28535
|
{
|
|
28834
28536
|
commands,
|
|
@@ -28856,7 +28558,7 @@ function ResumeConversation({
|
|
|
28856
28558
|
throw e;
|
|
28857
28559
|
}
|
|
28858
28560
|
}
|
|
28859
|
-
return /* @__PURE__ */
|
|
28561
|
+
return /* @__PURE__ */ React103.createElement(SessionSelector, { sessions, onSelect });
|
|
28860
28562
|
}
|
|
28861
28563
|
|
|
28862
28564
|
// src/commands/resume.tsx
|
|
@@ -28879,7 +28581,7 @@ var resume_default = {
|
|
|
28879
28581
|
return null;
|
|
28880
28582
|
}
|
|
28881
28583
|
render2(
|
|
28882
|
-
/* @__PURE__ */
|
|
28584
|
+
/* @__PURE__ */ React104.createElement(
|
|
28883
28585
|
ResumeConversation,
|
|
28884
28586
|
{
|
|
28885
28587
|
cwd,
|
|
@@ -28896,11 +28598,11 @@ var resume_default = {
|
|
|
28896
28598
|
};
|
|
28897
28599
|
|
|
28898
28600
|
// src/commands/agents.tsx
|
|
28899
|
-
import
|
|
28601
|
+
import React106 from "react";
|
|
28900
28602
|
|
|
28901
28603
|
// src/commands/agents/ui.tsx
|
|
28902
|
-
import
|
|
28903
|
-
import { Box as
|
|
28604
|
+
import React105, { useCallback as useCallback17, useEffect as useEffect27, useMemo as useMemo27, useRef as useRef14, useState as useState29 } from "react";
|
|
28605
|
+
import { Box as Box78, Text as Text82, useInput as useInput30 } from "ink";
|
|
28904
28606
|
import figures9 from "figures";
|
|
28905
28607
|
import chalk15 from "chalk";
|
|
28906
28608
|
import { join as join13 } from "path";
|
|
@@ -28968,9 +28670,9 @@ import { join as join12 } from "path";
|
|
|
28968
28670
|
import { homedir as homedir8 } from "os";
|
|
28969
28671
|
|
|
28970
28672
|
// src/commands/agents/generation.ts
|
|
28971
|
-
import { randomUUID as
|
|
28673
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
28972
28674
|
async function generateAgentWithClaude(prompt) {
|
|
28973
|
-
const { queryModel } = await import("./llm-
|
|
28675
|
+
const { queryModel } = await import("./llm-VY6RXJY7.js");
|
|
28974
28676
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
28975
28677
|
|
|
28976
28678
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -28983,7 +28685,7 @@ Make the agent highly specialized and effective for the described use case.`;
|
|
|
28983
28685
|
const messages = [
|
|
28984
28686
|
{
|
|
28985
28687
|
type: "user",
|
|
28986
|
-
uuid:
|
|
28688
|
+
uuid: randomUUID6(),
|
|
28987
28689
|
message: { role: "user", content: prompt }
|
|
28988
28690
|
}
|
|
28989
28691
|
];
|
|
@@ -29352,21 +29054,21 @@ function panelBorderColor(kind) {
|
|
|
29352
29054
|
}
|
|
29353
29055
|
function Panel(props) {
|
|
29354
29056
|
const theme = getTheme();
|
|
29355
|
-
return /* @__PURE__ */
|
|
29356
|
-
|
|
29057
|
+
return /* @__PURE__ */ React105.createElement(
|
|
29058
|
+
Box78,
|
|
29357
29059
|
{
|
|
29358
29060
|
borderStyle: "round",
|
|
29359
29061
|
borderColor: props.borderColor ?? theme.suggestion,
|
|
29360
29062
|
flexDirection: "column"
|
|
29361
29063
|
},
|
|
29362
|
-
/* @__PURE__ */
|
|
29363
|
-
/* @__PURE__ */
|
|
29064
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React105.createElement(Text82, { bold: true, color: props.titleColor ?? theme.text }, props.title), props.subtitle ? /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, props.subtitle) : null),
|
|
29065
|
+
/* @__PURE__ */ React105.createElement(Box78, { paddingX: 1, flexDirection: "column" }, props.children)
|
|
29364
29066
|
);
|
|
29365
29067
|
}
|
|
29366
29068
|
function Instructions({
|
|
29367
29069
|
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
29368
29070
|
}) {
|
|
29369
|
-
return /* @__PURE__ */
|
|
29071
|
+
return /* @__PURE__ */ React105.createElement(Box78, { marginLeft: 3 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, instructions));
|
|
29370
29072
|
}
|
|
29371
29073
|
function computeOverrides(args) {
|
|
29372
29074
|
const activeByType = /* @__PURE__ */ new Map();
|
|
@@ -29445,38 +29147,38 @@ function AgentsListView(props) {
|
|
|
29445
29147
|
setSelectedAgent(nextAgent);
|
|
29446
29148
|
}
|
|
29447
29149
|
});
|
|
29448
|
-
const renderCreateNew = () => /* @__PURE__ */
|
|
29150
|
+
const renderCreateNew = () => /* @__PURE__ */ React105.createElement(Box78, null, /* @__PURE__ */ React105.createElement(Text82, { color: onCreateOption ? theme.suggestion : void 0 }, onCreateOption ? `${figures9.pointer} ` : " "), /* @__PURE__ */ React105.createElement(Text82, { color: onCreateOption ? theme.suggestion : void 0 }, "Create new agent"));
|
|
29449
29151
|
const renderAgentRow = (agent) => {
|
|
29450
29152
|
const isBuiltIn = agent.source === "built-in";
|
|
29451
29153
|
const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.source === agent.source;
|
|
29452
29154
|
const dimmed = Boolean(isBuiltIn || agent.overriddenBy);
|
|
29453
29155
|
const rowColor = isSelected ? theme.suggestion : void 0;
|
|
29454
29156
|
const pointer = isBuiltIn ? "" : isSelected ? `${figures9.pointer} ` : " ";
|
|
29455
|
-
return /* @__PURE__ */
|
|
29157
|
+
return /* @__PURE__ */ React105.createElement(Box78, { key: `${agent.agentType}-${agent.source}`, flexDirection: "row" }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: dimmed && !isSelected, color: rowColor }, pointer), /* @__PURE__ */ React105.createElement(Text82, { dimColor: dimmed && !isSelected, color: rowColor }, agent.agentType), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true, color: rowColor }, " \xB7 ", formatModelShort(agent.model)), agent.overriddenBy ? /* @__PURE__ */ React105.createElement(Text82, { dimColor: !isSelected, color: isSelected ? theme.warning : void 0 }, " ", figures9.warning, " overridden by ", agent.overriddenBy) : null);
|
|
29456
29158
|
};
|
|
29457
29159
|
const group = (label, agents) => {
|
|
29458
29160
|
if (agents.length === 0) return null;
|
|
29459
29161
|
const baseDir = agents[0]?.baseDir;
|
|
29460
|
-
return /* @__PURE__ */
|
|
29162
|
+
return /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React105.createElement(Box78, { paddingLeft: 2 }, /* @__PURE__ */ React105.createElement(Text82, { bold: true, dimColor: true }, label), baseDir ? /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, " ", "(", baseDir, ")") : null), agents.map(renderAgentRow));
|
|
29461
29163
|
};
|
|
29462
29164
|
const builtInSection = (label = "Built-in (always available):") => {
|
|
29463
29165
|
const builtIn = props.agents.filter((a) => a.source === "built-in");
|
|
29464
29166
|
if (builtIn.length === 0) return null;
|
|
29465
|
-
return /* @__PURE__ */
|
|
29167
|
+
return /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React105.createElement(Text82, { bold: true, dimColor: true }, label), builtIn.map(renderAgentRow));
|
|
29466
29168
|
};
|
|
29467
29169
|
const notOverriddenCount = props.agents.filter((a) => !a.overriddenBy).length;
|
|
29468
29170
|
const title = titleForSource(props.source);
|
|
29469
29171
|
if (props.agents.length === 0 || props.source !== "built-in" && !props.agents.some((a) => a.source !== "built-in")) {
|
|
29470
|
-
return /* @__PURE__ */
|
|
29172
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title, subtitle: "No agents found" }, props.onCreateNew ? /* @__PURE__ */ React105.createElement(Box78, { marginY: 1 }, renderCreateNew()) : null, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "No agents found. Create specialized subagents that Claude can delegate to."), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Each subagent has its own context window, custom system prompt, and specific tools."), /* @__PURE__ */ React105.createElement(Text82, { 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__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "\u2500".repeat(40))), builtInSection()) : null), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
29471
29173
|
}
|
|
29472
|
-
return /* @__PURE__ */
|
|
29174
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
29473
29175
|
Panel,
|
|
29474
29176
|
{
|
|
29475
29177
|
title,
|
|
29476
29178
|
subtitle: `${notOverriddenCount} agents`
|
|
29477
29179
|
},
|
|
29478
|
-
props.changes.length > 0 ? /* @__PURE__ */
|
|
29479
|
-
/* @__PURE__ */
|
|
29180
|
+
props.changes.length > 0 ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, props.changes[props.changes.length - 1])) : null,
|
|
29181
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1 }, props.onCreateNew ? /* @__PURE__ */ React105.createElement(Box78, { marginBottom: 1 }, renderCreateNew()) : null, props.source === "all" ? /* @__PURE__ */ React105.createElement(React105.Fragment, null, group(
|
|
29480
29182
|
"User agents",
|
|
29481
29183
|
props.agents.filter((a) => a.source === "userSettings")
|
|
29482
29184
|
), group(
|
|
@@ -29491,8 +29193,8 @@ function AgentsListView(props) {
|
|
|
29491
29193
|
), group(
|
|
29492
29194
|
"CLI arg agents",
|
|
29493
29195
|
props.agents.filter((a) => a.source === "flagSettings")
|
|
29494
|
-
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */
|
|
29495
|
-
), /* @__PURE__ */
|
|
29196
|
+
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true, italic: true }, "Built-in agents are provided by default and cannot be modified."), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, props.agents.map(renderAgentRow))) : /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column" }, props.agents.filter((a) => a.source !== "built-in").map(renderAgentRow)))
|
|
29197
|
+
), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
29496
29198
|
}
|
|
29497
29199
|
function wizardLocationToStorageLocation(location) {
|
|
29498
29200
|
return location === "projectSettings" ? "project" : "user";
|
|
@@ -29583,16 +29285,16 @@ function Wizard(props) {
|
|
|
29583
29285
|
cancel
|
|
29584
29286
|
]
|
|
29585
29287
|
);
|
|
29586
|
-
return /* @__PURE__ */
|
|
29288
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, props.steps[stepIndex]?.(ctx) ?? null);
|
|
29587
29289
|
}
|
|
29588
29290
|
function WizardPanel(props) {
|
|
29589
|
-
return /* @__PURE__ */
|
|
29291
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: "Create new agent", subtitle: props.subtitle }, props.children), /* @__PURE__ */ React105.createElement(Instructions, { instructions: props.footerText }));
|
|
29590
29292
|
}
|
|
29591
29293
|
function StepChooseLocation({ ctx }) {
|
|
29592
29294
|
useInput30((_input, key) => {
|
|
29593
29295
|
if (key.escape) ctx.cancel();
|
|
29594
29296
|
});
|
|
29595
|
-
return /* @__PURE__ */
|
|
29297
|
+
return /* @__PURE__ */ React105.createElement(WizardPanel, { subtitle: "Choose location", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to cancel" }, /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(
|
|
29596
29298
|
Select,
|
|
29597
29299
|
{
|
|
29598
29300
|
options: [
|
|
@@ -29611,7 +29313,7 @@ function StepChooseMethod({ ctx }) {
|
|
|
29611
29313
|
useInput30((_input, key) => {
|
|
29612
29314
|
if (key.escape) ctx.goBack();
|
|
29613
29315
|
});
|
|
29614
|
-
return /* @__PURE__ */
|
|
29316
|
+
return /* @__PURE__ */ React105.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(
|
|
29615
29317
|
Select,
|
|
29616
29318
|
{
|
|
29617
29319
|
options: [
|
|
@@ -29695,7 +29397,7 @@ function StepGenerationPrompt(props) {
|
|
|
29695
29397
|
abortRef.current = null;
|
|
29696
29398
|
}
|
|
29697
29399
|
};
|
|
29698
|
-
return /* @__PURE__ */
|
|
29400
|
+
return /* @__PURE__ */ React105.createElement(WizardPanel, { subtitle: "Describe the agent you want" }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, "What should this agent do?"), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Describe a role like \u201Ccode reviewer\u201D, \u201Csecurity auditor\u201D, or \u201Ctech lead\u201D."), /* @__PURE__ */ React105.createElement(
|
|
29699
29401
|
TextInput,
|
|
29700
29402
|
{
|
|
29701
29403
|
value,
|
|
@@ -29706,7 +29408,7 @@ function StepGenerationPrompt(props) {
|
|
|
29706
29408
|
cursorOffset,
|
|
29707
29409
|
onChangeCursorOffset: setCursorOffset
|
|
29708
29410
|
}
|
|
29709
|
-
), error ? /* @__PURE__ */
|
|
29411
|
+
), error ? /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error) : null, isGenerating ? /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Generating\u2026") : null));
|
|
29710
29412
|
}
|
|
29711
29413
|
function themeColor(kind) {
|
|
29712
29414
|
const theme = getTheme();
|
|
@@ -29742,13 +29444,13 @@ function StepAgentType(props) {
|
|
|
29742
29444
|
ctx.updateWizardData({ agentType: trimmed });
|
|
29743
29445
|
ctx.goNext();
|
|
29744
29446
|
};
|
|
29745
|
-
return /* @__PURE__ */
|
|
29447
|
+
return /* @__PURE__ */ React105.createElement(
|
|
29746
29448
|
WizardPanel,
|
|
29747
29449
|
{
|
|
29748
29450
|
subtitle: "Agent type (identifier)",
|
|
29749
29451
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29750
29452
|
},
|
|
29751
|
-
/* @__PURE__ */
|
|
29453
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, "Enter a unique identifier for your agent:"), /* @__PURE__ */ React105.createElement(
|
|
29752
29454
|
TextInput,
|
|
29753
29455
|
{
|
|
29754
29456
|
value,
|
|
@@ -29758,7 +29460,7 @@ function StepAgentType(props) {
|
|
|
29758
29460
|
cursorOffset,
|
|
29759
29461
|
onChangeCursorOffset: setCursorOffset
|
|
29760
29462
|
}
|
|
29761
|
-
), /* @__PURE__ */
|
|
29463
|
+
), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "e.g., code-reviewer, tech-lead, etc"), error ? /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
29762
29464
|
);
|
|
29763
29465
|
}
|
|
29764
29466
|
function StepSystemPrompt({ ctx }) {
|
|
@@ -29779,13 +29481,13 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29779
29481
|
ctx.updateWizardData({ systemPrompt: trimmed });
|
|
29780
29482
|
ctx.goNext();
|
|
29781
29483
|
};
|
|
29782
|
-
return /* @__PURE__ */
|
|
29484
|
+
return /* @__PURE__ */ React105.createElement(
|
|
29783
29485
|
WizardPanel,
|
|
29784
29486
|
{
|
|
29785
29487
|
subtitle: "System prompt",
|
|
29786
29488
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29787
29489
|
},
|
|
29788
|
-
/* @__PURE__ */
|
|
29490
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, "Enter the system prompt for your agent:"), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Be comprehensive for best results"), /* @__PURE__ */ React105.createElement(
|
|
29789
29491
|
TextInput,
|
|
29790
29492
|
{
|
|
29791
29493
|
value,
|
|
@@ -29796,7 +29498,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
29796
29498
|
cursorOffset,
|
|
29797
29499
|
onChangeCursorOffset: setCursorOffset
|
|
29798
29500
|
}
|
|
29799
|
-
), error ? /* @__PURE__ */
|
|
29501
|
+
), error ? /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
29800
29502
|
);
|
|
29801
29503
|
}
|
|
29802
29504
|
function StepDescription({ ctx }) {
|
|
@@ -29817,13 +29519,13 @@ function StepDescription({ ctx }) {
|
|
|
29817
29519
|
ctx.updateWizardData({ whenToUse: trimmed });
|
|
29818
29520
|
ctx.goNext();
|
|
29819
29521
|
};
|
|
29820
|
-
return /* @__PURE__ */
|
|
29522
|
+
return /* @__PURE__ */ React105.createElement(
|
|
29821
29523
|
WizardPanel,
|
|
29822
29524
|
{
|
|
29823
29525
|
subtitle: "Description (tell Claude when to use this agent)",
|
|
29824
29526
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
29825
29527
|
},
|
|
29826
|
-
/* @__PURE__ */
|
|
29528
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, "When should Claude use this agent?"), /* @__PURE__ */ React105.createElement(
|
|
29827
29529
|
TextInput,
|
|
29828
29530
|
{
|
|
29829
29531
|
value,
|
|
@@ -29834,7 +29536,7 @@ function StepDescription({ ctx }) {
|
|
|
29834
29536
|
cursorOffset,
|
|
29835
29537
|
onChangeCursorOffset: setCursorOffset
|
|
29836
29538
|
}
|
|
29837
|
-
), error ? /* @__PURE__ */
|
|
29539
|
+
), error ? /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
29838
29540
|
);
|
|
29839
29541
|
}
|
|
29840
29542
|
function ToolPicker(props) {
|
|
@@ -29993,12 +29695,12 @@ function ToolPicker(props) {
|
|
|
29993
29695
|
return;
|
|
29994
29696
|
}
|
|
29995
29697
|
});
|
|
29996
|
-
return /* @__PURE__ */
|
|
29698
|
+
return /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: cursorIndex === 0 ? themeColor("suggestion") : void 0, bold: cursorIndex === 0 }, cursorIndex === 0 ? `${figures9.pointer} ` : " ", "[ Continue ]"), /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "\u2500".repeat(40)), items.slice(1).map((item, idx) => {
|
|
29997
29699
|
const index = idx + 1;
|
|
29998
29700
|
const focused = index === cursorIndex;
|
|
29999
29701
|
const prefix = item.isHeader ? "" : focused ? `${figures9.pointer} ` : " ";
|
|
30000
|
-
return /* @__PURE__ */
|
|
30001
|
-
|
|
29702
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "\u2500".repeat(40)) : null, /* @__PURE__ */ React105.createElement(
|
|
29703
|
+
Text82,
|
|
30002
29704
|
{
|
|
30003
29705
|
dimColor: item.isHeader,
|
|
30004
29706
|
color: !item.isHeader && focused ? themeColor("suggestion") : void 0,
|
|
@@ -30006,12 +29708,12 @@ function ToolPicker(props) {
|
|
|
30006
29708
|
},
|
|
30007
29709
|
item.isToggle ? `${prefix}[ ${item.label} ]` : `${prefix}${item.label}`
|
|
30008
29710
|
));
|
|
30009
|
-
}), /* @__PURE__ */
|
|
29711
|
+
}), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, isAllSelected ? "All tools selected" : `${selectedSet.size} of ${allToolNames.length} tools selected`)));
|
|
30010
29712
|
}
|
|
30011
29713
|
function StepSelectTools(props) {
|
|
30012
29714
|
const { ctx } = props;
|
|
30013
29715
|
const initialTools = ctx.wizardData.selectedTools;
|
|
30014
|
-
return /* @__PURE__ */
|
|
29716
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: "Create new agent", subtitle: "Select tools" }, /* @__PURE__ */ React105.createElement(
|
|
30015
29717
|
ToolPicker,
|
|
30016
29718
|
{
|
|
30017
29719
|
tools: props.tools,
|
|
@@ -30022,7 +29724,7 @@ function StepSelectTools(props) {
|
|
|
30022
29724
|
},
|
|
30023
29725
|
onCancel: ctx.goBack
|
|
30024
29726
|
}
|
|
30025
|
-
)), /* @__PURE__ */
|
|
29727
|
+
)), /* @__PURE__ */ React105.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
30026
29728
|
}
|
|
30027
29729
|
function StepSelectModel({ ctx }) {
|
|
30028
29730
|
useInput30((_input, key) => {
|
|
@@ -30030,7 +29732,7 @@ function StepSelectModel({ ctx }) {
|
|
|
30030
29732
|
});
|
|
30031
29733
|
const options = modelOptions();
|
|
30032
29734
|
const defaultValue = ctx.wizardData.selectedModel ?? DEFAULT_AGENT_MODEL;
|
|
30033
|
-
return /* @__PURE__ */
|
|
29735
|
+
return /* @__PURE__ */ React105.createElement(WizardPanel, { subtitle: "Select model", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React105.createElement(
|
|
30034
29736
|
Select,
|
|
30035
29737
|
{
|
|
30036
29738
|
options,
|
|
@@ -30051,12 +29753,12 @@ function ColorPicker(props) {
|
|
|
30051
29753
|
else if (key.downArrow) setIndex((i) => i < COLOR_OPTIONS.length - 1 ? i + 1 : 0);
|
|
30052
29754
|
else if (key.return) props.onConfirm(COLOR_OPTIONS[index] ?? "automatic");
|
|
30053
29755
|
});
|
|
30054
|
-
return /* @__PURE__ */
|
|
29756
|
+
return /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", gap: 1 }, COLOR_OPTIONS.map((color, i) => {
|
|
30055
29757
|
const focused = i === index;
|
|
30056
29758
|
const prefix = focused ? figures9.pointer : " ";
|
|
30057
29759
|
const label = color === "automatic" ? "Automatic color" : color.charAt(0).toUpperCase() + color.slice(1);
|
|
30058
|
-
return /* @__PURE__ */
|
|
30059
|
-
|
|
29760
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, { key: color }, /* @__PURE__ */ React105.createElement(
|
|
29761
|
+
Text82,
|
|
30060
29762
|
{
|
|
30061
29763
|
color: focused ? themeColor("suggestion") : void 0,
|
|
30062
29764
|
bold: focused
|
|
@@ -30089,7 +29791,7 @@ function StepChooseColor({ ctx }) {
|
|
|
30089
29791
|
});
|
|
30090
29792
|
ctx.goNext();
|
|
30091
29793
|
};
|
|
30092
|
-
return /* @__PURE__ */
|
|
29794
|
+
return /* @__PURE__ */ React105.createElement(WizardPanel, { subtitle: "Choose background color", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(ColorPicker, { agentName: agentType, currentColor: "automatic", onConfirm })));
|
|
30093
29795
|
}
|
|
30094
29796
|
function validateFinalAgent(args) {
|
|
30095
29797
|
const errors = [];
|
|
@@ -30154,28 +29856,28 @@ function StepConfirm(props) {
|
|
|
30154
29856
|
});
|
|
30155
29857
|
const locationPath = finalAgent.source === "projectSettings" ? getPrimaryAgentFilePath("project", finalAgent.agentType) : getPrimaryAgentFilePath("user", finalAgent.agentType);
|
|
30156
29858
|
const truncate = (text) => text.length > 240 ? `${text.slice(0, 240)}\u2026` : text;
|
|
30157
|
-
return /* @__PURE__ */
|
|
29859
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30158
29860
|
WizardPanel,
|
|
30159
29861
|
{
|
|
30160
29862
|
subtitle: "Confirm and save",
|
|
30161
29863
|
footerText: "Press s/Enter to save \xB7 e to edit in your editor \xB7 Esc to cancel"
|
|
30162
29864
|
},
|
|
30163
|
-
/* @__PURE__ */
|
|
29865
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Name"), ": ", finalAgent.agentType), /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Location"), ": ", locationPath), /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Tools"), ": ", toolSummary(finalAgent.tools)), /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Model"), ": ", formatModelLong(finalAgent.model)), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React105.createElement(Box78, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, truncate(finalAgent.whenToUse)))), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React105.createElement(Box78, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, truncate(finalAgent.systemPrompt)))), validation.warnings.length > 0 ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("warning") }, "Warnings:"), validation.warnings.map((w, i) => /* @__PURE__ */ React105.createElement(React105.Fragment, { key: i }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, " ", "\u2022 ", w)))) : null, validation.errors.length > 0 ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, "Errors:"), validation.errors.map((e, i) => /* @__PURE__ */ React105.createElement(React105.Fragment, { key: i }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, " ", "\u2022 ", e)))) : null, error ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error)) : null)
|
|
30164
29866
|
);
|
|
30165
29867
|
}
|
|
30166
29868
|
function CreateAgentWizard(props) {
|
|
30167
29869
|
const steps = useMemo27(() => {
|
|
30168
29870
|
return [
|
|
30169
|
-
(ctx) => /* @__PURE__ */
|
|
30170
|
-
(ctx) => /* @__PURE__ */
|
|
30171
|
-
(ctx) => /* @__PURE__ */
|
|
30172
|
-
(ctx) => /* @__PURE__ */
|
|
30173
|
-
(ctx) => /* @__PURE__ */
|
|
30174
|
-
(ctx) => /* @__PURE__ */
|
|
30175
|
-
(ctx) => /* @__PURE__ */
|
|
30176
|
-
(ctx) => /* @__PURE__ */
|
|
30177
|
-
(ctx) => /* @__PURE__ */
|
|
30178
|
-
(ctx) => /* @__PURE__ */
|
|
29871
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepChooseLocation, { ctx }),
|
|
29872
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepChooseMethod, { ctx }),
|
|
29873
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepGenerationPrompt, { ctx, existingAgents: props.existingAgents }),
|
|
29874
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepAgentType, { ctx, existingAgents: props.existingAgents }),
|
|
29875
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepSystemPrompt, { ctx }),
|
|
29876
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepDescription, { ctx }),
|
|
29877
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepSelectTools, { ctx, tools: props.tools }),
|
|
29878
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepSelectModel, { ctx }),
|
|
29879
|
+
(ctx) => /* @__PURE__ */ React105.createElement(StepChooseColor, { ctx }),
|
|
29880
|
+
(ctx) => /* @__PURE__ */ React105.createElement(
|
|
30179
29881
|
StepConfirm,
|
|
30180
29882
|
{
|
|
30181
29883
|
ctx,
|
|
@@ -30208,7 +29910,7 @@ function CreateAgentWizard(props) {
|
|
|
30208
29910
|
)
|
|
30209
29911
|
];
|
|
30210
29912
|
}, [props]);
|
|
30211
|
-
return /* @__PURE__ */
|
|
29913
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30212
29914
|
Wizard,
|
|
30213
29915
|
{
|
|
30214
29916
|
steps,
|
|
@@ -30231,13 +29933,13 @@ function AgentMenu(props) {
|
|
|
30231
29933
|
],
|
|
30232
29934
|
{ label: "Back", value: "back" }
|
|
30233
29935
|
];
|
|
30234
|
-
return /* @__PURE__ */
|
|
29936
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React105.createElement(
|
|
30235
29937
|
Select,
|
|
30236
29938
|
{
|
|
30237
29939
|
options,
|
|
30238
29940
|
onChange: (value) => props.onChoose(value)
|
|
30239
29941
|
}
|
|
30240
|
-
))), /* @__PURE__ */
|
|
29942
|
+
))), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
30241
29943
|
}
|
|
30242
29944
|
function ViewAgent(props) {
|
|
30243
29945
|
useInput30((_input, key) => {
|
|
@@ -30273,9 +29975,9 @@ function ViewAgent(props) {
|
|
|
30273
29975
|
const toolsSummary = () => {
|
|
30274
29976
|
if (parsedTools.hasWildcard) return "All tools";
|
|
30275
29977
|
if (!props.agent.tools || props.agent.tools === "*" || props.agent.tools.length === 0) return "None";
|
|
30276
|
-
return /* @__PURE__ */
|
|
29978
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, parsedTools.valid.length > 0 ? parsedTools.valid.join(", ") : null, parsedTools.invalid.length > 0 ? /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("warning") }, " ", figures9.warning, " Unrecognized: ", parsedTools.invalid.join(", "))) : null);
|
|
30277
29979
|
};
|
|
30278
|
-
return /* @__PURE__ */
|
|
29980
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, sourceLine), /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React105.createElement(Box78, { marginLeft: 2 }, /* @__PURE__ */ React105.createElement(Text82, null, props.agent.whenToUse))), /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Tools"), ": ", toolsSummary()), /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Model"), ": ", formatModelLong(props.agent.model)), props.agent.color ? /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "Color"), ": ", props.agent.color) : null, props.agent.systemPrompt ? /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Text82, null, /* @__PURE__ */ React105.createElement(Text82, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React105.createElement(Box78, { marginLeft: 2, marginRight: 2 }, /* @__PURE__ */ React105.createElement(Text82, null, props.agent.systemPrompt))) : null)), /* @__PURE__ */ React105.createElement(Instructions, { instructions: "Press Enter or Esc to go back" }));
|
|
30279
29981
|
}
|
|
30280
29982
|
function EditAgent(props) {
|
|
30281
29983
|
const [mode, setMode] = useState29("menu");
|
|
@@ -30340,7 +30042,7 @@ function EditAgent(props) {
|
|
|
30340
30042
|
}
|
|
30341
30043
|
});
|
|
30342
30044
|
if (mode === "edit-tools") {
|
|
30343
|
-
return /* @__PURE__ */
|
|
30045
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React105.createElement(
|
|
30344
30046
|
ToolPicker,
|
|
30345
30047
|
{
|
|
30346
30048
|
tools: props.tools,
|
|
@@ -30352,10 +30054,10 @@ function EditAgent(props) {
|
|
|
30352
30054
|
},
|
|
30353
30055
|
onCancel: () => setMode("menu")
|
|
30354
30056
|
}
|
|
30355
|
-
), error ? /* @__PURE__ */
|
|
30057
|
+
), error ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React105.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
30356
30058
|
}
|
|
30357
30059
|
if (mode === "edit-model") {
|
|
30358
|
-
return /* @__PURE__ */
|
|
30060
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", gap: 1, marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React105.createElement(
|
|
30359
30061
|
Select,
|
|
30360
30062
|
{
|
|
30361
30063
|
options: modelOptions(),
|
|
@@ -30365,10 +30067,10 @@ function EditAgent(props) {
|
|
|
30365
30067
|
setMode("menu");
|
|
30366
30068
|
}
|
|
30367
30069
|
}
|
|
30368
|
-
)), error ? /* @__PURE__ */
|
|
30070
|
+
)), error ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
30369
30071
|
}
|
|
30370
30072
|
if (mode === "edit-color") {
|
|
30371
|
-
return /* @__PURE__ */
|
|
30073
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(
|
|
30372
30074
|
ColorPicker,
|
|
30373
30075
|
{
|
|
30374
30076
|
agentName: props.agent.agentType,
|
|
@@ -30378,29 +30080,29 @@ function EditAgent(props) {
|
|
|
30378
30080
|
setMode("menu");
|
|
30379
30081
|
}
|
|
30380
30082
|
}
|
|
30381
|
-
)), error ? /* @__PURE__ */
|
|
30083
|
+
)), error ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
30382
30084
|
}
|
|
30383
|
-
return /* @__PURE__ */
|
|
30384
|
-
|
|
30085
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column" }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Source: ", titleForSource(props.agent.source)), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1, flexDirection: "column" }, menuItems.map((item, idx) => /* @__PURE__ */ React105.createElement(React105.Fragment, { key: item.label }, /* @__PURE__ */ React105.createElement(
|
|
30086
|
+
Text82,
|
|
30385
30087
|
{
|
|
30386
30088
|
color: idx === selectedIndex ? themeColor("suggestion") : void 0
|
|
30387
30089
|
},
|
|
30388
30090
|
idx === selectedIndex ? `${figures9.pointer} ` : " ",
|
|
30389
30091
|
item.label
|
|
30390
|
-
)))), error ? /* @__PURE__ */
|
|
30092
|
+
)))), error ? /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { color: themeColor("error") }, error)) : null)), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
30391
30093
|
}
|
|
30392
30094
|
function DeleteConfirm(props) {
|
|
30393
30095
|
useInput30((_input, key) => {
|
|
30394
30096
|
if (key.escape) props.onCancel();
|
|
30395
30097
|
});
|
|
30396
|
-
return /* @__PURE__ */
|
|
30098
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(
|
|
30397
30099
|
Panel,
|
|
30398
30100
|
{
|
|
30399
30101
|
title: "Delete agent",
|
|
30400
30102
|
borderColor: panelBorderColor("error"),
|
|
30401
30103
|
titleColor: themeColor("error")
|
|
30402
30104
|
},
|
|
30403
|
-
/* @__PURE__ */
|
|
30105
|
+
/* @__PURE__ */ React105.createElement(Box78, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React105.createElement(Text82, null, "Are you sure you want to delete the agent ", /* @__PURE__ */ React105.createElement(Text82, { bold: true }, props.agent.agentType), "?"), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Source: ", props.agent.source)), /* @__PURE__ */ React105.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React105.createElement(
|
|
30404
30106
|
Select,
|
|
30405
30107
|
{
|
|
30406
30108
|
options: [
|
|
@@ -30413,7 +30115,7 @@ function DeleteConfirm(props) {
|
|
|
30413
30115
|
}
|
|
30414
30116
|
}
|
|
30415
30117
|
)))
|
|
30416
|
-
), /* @__PURE__ */
|
|
30118
|
+
), /* @__PURE__ */ React105.createElement(Instructions, { instructions: "Press \u2191\u2193 to navigate, Enter to select, Esc to cancel" }));
|
|
30417
30119
|
}
|
|
30418
30120
|
function AgentsUI({ onExit }) {
|
|
30419
30121
|
const [mode, setMode] = useState29({ mode: "list-agents", source: "all" });
|
|
@@ -30484,10 +30186,10 @@ ${changes.join("\n")}`);
|
|
|
30484
30186
|
onExit("Agents dialog dismissed");
|
|
30485
30187
|
}, [changes, onExit]);
|
|
30486
30188
|
if (loading) {
|
|
30487
|
-
return /* @__PURE__ */
|
|
30189
|
+
return /* @__PURE__ */ React105.createElement(React105.Fragment, null, /* @__PURE__ */ React105.createElement(Panel, { title: "Agents", subtitle: "Loading\u2026" }, /* @__PURE__ */ React105.createElement(Text82, { dimColor: true }, "Loading agents\u2026")), /* @__PURE__ */ React105.createElement(Instructions, null));
|
|
30488
30190
|
}
|
|
30489
30191
|
if (mode.mode === "list-agents") {
|
|
30490
|
-
return /* @__PURE__ */
|
|
30192
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30491
30193
|
AgentsListView,
|
|
30492
30194
|
{
|
|
30493
30195
|
source: mode.source,
|
|
@@ -30500,7 +30202,7 @@ ${changes.join("\n")}`);
|
|
|
30500
30202
|
);
|
|
30501
30203
|
}
|
|
30502
30204
|
if (mode.mode === "create-agent") {
|
|
30503
|
-
return /* @__PURE__ */
|
|
30205
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30504
30206
|
CreateAgentWizard,
|
|
30505
30207
|
{
|
|
30506
30208
|
tools,
|
|
@@ -30515,7 +30217,7 @@ ${changes.join("\n")}`);
|
|
|
30515
30217
|
);
|
|
30516
30218
|
}
|
|
30517
30219
|
if (mode.mode === "agent-menu") {
|
|
30518
|
-
return /* @__PURE__ */
|
|
30220
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30519
30221
|
AgentMenu,
|
|
30520
30222
|
{
|
|
30521
30223
|
agent: mode.agent,
|
|
@@ -30530,7 +30232,7 @@ ${changes.join("\n")}`);
|
|
|
30530
30232
|
);
|
|
30531
30233
|
}
|
|
30532
30234
|
if (mode.mode === "view-agent") {
|
|
30533
|
-
return /* @__PURE__ */
|
|
30235
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30534
30236
|
ViewAgent,
|
|
30535
30237
|
{
|
|
30536
30238
|
agent: mode.agent,
|
|
@@ -30540,7 +30242,7 @@ ${changes.join("\n")}`);
|
|
|
30540
30242
|
);
|
|
30541
30243
|
}
|
|
30542
30244
|
if (mode.mode === "edit-agent") {
|
|
30543
|
-
return /* @__PURE__ */
|
|
30245
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30544
30246
|
EditAgent,
|
|
30545
30247
|
{
|
|
30546
30248
|
agent: mode.agent,
|
|
@@ -30555,7 +30257,7 @@ ${changes.join("\n")}`);
|
|
|
30555
30257
|
);
|
|
30556
30258
|
}
|
|
30557
30259
|
if (mode.mode === "delete-confirm") {
|
|
30558
|
-
return /* @__PURE__ */
|
|
30260
|
+
return /* @__PURE__ */ React105.createElement(
|
|
30559
30261
|
DeleteConfirm,
|
|
30560
30262
|
{
|
|
30561
30263
|
agent: mode.agent,
|
|
@@ -30580,7 +30282,7 @@ var agents_default = {
|
|
|
30580
30282
|
isEnabled: true,
|
|
30581
30283
|
isHidden: false,
|
|
30582
30284
|
async call(onExit) {
|
|
30583
|
-
return /* @__PURE__ */
|
|
30285
|
+
return /* @__PURE__ */ React106.createElement(AgentsUI, { onExit });
|
|
30584
30286
|
},
|
|
30585
30287
|
userFacingName() {
|
|
30586
30288
|
return "agents";
|
|
@@ -30741,7 +30443,7 @@ ${availableLines}${truncatedNotice}
|
|
|
30741
30443
|
return command4 || "";
|
|
30742
30444
|
},
|
|
30743
30445
|
renderToolUseRejectedMessage() {
|
|
30744
|
-
return /* @__PURE__ */
|
|
30446
|
+
return /* @__PURE__ */ React107.createElement(FallbackToolUseRejectedMessage, null);
|
|
30745
30447
|
},
|
|
30746
30448
|
renderResultForAssistant(output) {
|
|
30747
30449
|
return `Launching command: /${output.commandName}`;
|
|
@@ -30897,8 +30599,8 @@ function parseMcpToolName2(name3) {
|
|
|
30897
30599
|
}
|
|
30898
30600
|
|
|
30899
30601
|
// src/tools/system/KillShellTool/KillShellTool.tsx
|
|
30900
|
-
import { Box as
|
|
30901
|
-
import
|
|
30602
|
+
import { Box as Box79, Text as Text83 } from "ink";
|
|
30603
|
+
import React108 from "react";
|
|
30902
30604
|
import { z as z14 } from "zod";
|
|
30903
30605
|
|
|
30904
30606
|
// src/tools/system/KillShellTool/prompt.ts
|
|
@@ -30944,10 +30646,10 @@ var KillShellTool = {
|
|
|
30944
30646
|
return `Kill shell: ${shell_id}`;
|
|
30945
30647
|
},
|
|
30946
30648
|
renderToolUseRejectedMessage() {
|
|
30947
|
-
return /* @__PURE__ */
|
|
30649
|
+
return /* @__PURE__ */ React108.createElement(FallbackToolUseRejectedMessage, null);
|
|
30948
30650
|
},
|
|
30949
30651
|
renderToolResultMessage(output) {
|
|
30950
|
-
return /* @__PURE__ */
|
|
30652
|
+
return /* @__PURE__ */ React108.createElement(Box79, { flexDirection: "row" }, /* @__PURE__ */ React108.createElement(Text83, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React108.createElement(Text83, null, "Shell ", output.shell_id, " killed"));
|
|
30951
30653
|
},
|
|
30952
30654
|
renderResultForAssistant(output) {
|
|
30953
30655
|
return JSON.stringify(output);
|
|
@@ -31674,8 +31376,8 @@ function WebFetchPermissionRequest({
|
|
|
31674
31376
|
reject();
|
|
31675
31377
|
}
|
|
31676
31378
|
});
|
|
31677
|
-
return /* @__PURE__ */
|
|
31678
|
-
|
|
31379
|
+
return /* @__PURE__ */ React109.createElement(
|
|
31380
|
+
Box80,
|
|
31679
31381
|
{
|
|
31680
31382
|
flexDirection: "column",
|
|
31681
31383
|
borderStyle: "round",
|
|
@@ -31685,14 +31387,14 @@ function WebFetchPermissionRequest({
|
|
|
31685
31387
|
paddingRight: 1,
|
|
31686
31388
|
paddingBottom: 1
|
|
31687
31389
|
},
|
|
31688
|
-
/* @__PURE__ */
|
|
31390
|
+
/* @__PURE__ */ React109.createElement(
|
|
31689
31391
|
PermissionRequestTitle,
|
|
31690
31392
|
{
|
|
31691
31393
|
title: "Network request outside of sandbox",
|
|
31692
31394
|
riskScore: null
|
|
31693
31395
|
}
|
|
31694
31396
|
),
|
|
31695
|
-
/* @__PURE__ */
|
|
31397
|
+
/* @__PURE__ */ React109.createElement(Box80, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React109.createElement(Box80, null, /* @__PURE__ */ React109.createElement(Text84, { dimColor: true }, "Host:"), /* @__PURE__ */ React109.createElement(Text84, null, " ", hostLabel)), /* @__PURE__ */ React109.createElement(Box80, { marginTop: 1 }, /* @__PURE__ */ React109.createElement(Text84, null, "Do you want to allow this connection?")), /* @__PURE__ */ React109.createElement(Box80, { marginTop: 1 }, /* @__PURE__ */ React109.createElement(
|
|
31696
31398
|
Select,
|
|
31697
31399
|
{
|
|
31698
31400
|
options: [
|
|
@@ -32064,10 +31766,10 @@ var BashTool = {
|
|
|
32064
31766
|
return withDescription(base.trim());
|
|
32065
31767
|
},
|
|
32066
31768
|
renderToolUseRejectedMessage() {
|
|
32067
|
-
return /* @__PURE__ */
|
|
31769
|
+
return /* @__PURE__ */ React110.createElement(FallbackToolUseRejectedMessage, null);
|
|
32068
31770
|
},
|
|
32069
31771
|
renderToolResultMessage(content) {
|
|
32070
|
-
return /* @__PURE__ */
|
|
31772
|
+
return /* @__PURE__ */ React110.createElement(BashToolResultMessage_default, { content, verbose: false });
|
|
32071
31773
|
},
|
|
32072
31774
|
renderResultForAssistant({
|
|
32073
31775
|
interrupted,
|
|
@@ -32308,7 +32010,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
|
|
|
32308
32010
|
}
|
|
32309
32011
|
};
|
|
32310
32012
|
setToolJSX({
|
|
32311
|
-
jsx: /* @__PURE__ */
|
|
32013
|
+
jsx: /* @__PURE__ */ React110.createElement(
|
|
32312
32014
|
WebFetchPermissionRequest,
|
|
32313
32015
|
{
|
|
32314
32016
|
toolUseConfirm,
|
|
@@ -32504,7 +32206,7 @@ ${footerParts.join(" ")}`;
|
|
|
32504
32206
|
if (!overlayShown && setToolJSX && Date.now() - startedAt >= PROGRESS_INITIAL_DELAY_MS) {
|
|
32505
32207
|
overlayShown = true;
|
|
32506
32208
|
setToolJSX({
|
|
32507
|
-
jsx: /* @__PURE__ */
|
|
32209
|
+
jsx: /* @__PURE__ */ React110.createElement(
|
|
32508
32210
|
BashToolRunInBackgroundOverlay,
|
|
32509
32211
|
{
|
|
32510
32212
|
onBackground: requestBackground
|