pybao-cli 1.4.43 → 1.4.45
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-MWC7RKTH.js +47 -0
- package/dist/{acp-KQ5SYBCC.js → acp-NQQWCE6I.js} +29 -29
- package/dist/{agentsValidate-SJFVDKUZ.js → agentsValidate-4RWRD7GX.js} +7 -7
- package/dist/{ask-A6QHZ5U4.js → ask-NT5AU6PG.js} +28 -28
- package/dist/{autoUpdater-BBZVYPRI.js → autoUpdater-27VMHRIW.js} +3 -3
- package/dist/{chunk-YKWQF7PT.js → chunk-4WQPA6KJ.js} +1 -1
- package/dist/{chunk-WUCVC3QT.js → chunk-4XD5ZHAP.js} +161 -76
- package/dist/{chunk-WUCVC3QT.js.map → chunk-4XD5ZHAP.js.map} +3 -3
- package/dist/{chunk-ZJXLGVQQ.js → chunk-5BKLRHQ5.js} +3 -3
- package/dist/{chunk-MU5SIPBA.js → chunk-7AQEFP6S.js} +4 -4
- package/dist/{chunk-VTHYZQ4P.js → chunk-A4FM24JV.js} +2 -2
- package/dist/{chunk-NH7SWX57.js → chunk-D4WFVW5A.js} +3 -3
- package/dist/{chunk-YQAWSNBK.js → chunk-DFPWDMWF.js} +1 -1
- package/dist/{chunk-BGMXYCEG.js → chunk-DHOM7ZG7.js} +1 -1
- package/dist/{chunk-4ZYN5JOV.js → chunk-FY33EKD2.js} +1 -1
- package/dist/{chunk-6YLH7AMI.js → chunk-GWGTKMHL.js} +4 -4
- package/dist/{chunk-I52DKV6I.js → chunk-JTNNU6AH.js} +3 -3
- package/dist/{chunk-VIGMIQJS.js → chunk-K4XQFGVW.js} +4 -4
- package/dist/{chunk-F2TALCDM.js → chunk-KTCMDKTK.js} +1 -1
- package/dist/{chunk-2AV6L5GN.js → chunk-LKWFKXSV.js} +1 -1
- package/dist/{chunk-JFGQ5LGD.js → chunk-LZEVQLVC.js} +1 -1
- package/dist/{chunk-ETXZ5OPA.js → chunk-M6H3DZ65.js} +43 -14
- package/dist/chunk-M6H3DZ65.js.map +7 -0
- package/dist/{chunk-ELBWGYTR.js → chunk-MBSRHORQ.js} +3 -3
- package/dist/{chunk-TRYEQHHB.js → chunk-MMFLDFEZ.js} +2 -2
- package/dist/{chunk-OIWM647G.js → chunk-N242HITL.js} +1 -1
- package/dist/{chunk-CGJFRSE7.js → chunk-NKDRET5K.js} +2 -2
- package/dist/{chunk-VPQZQRSR.js → chunk-OPJPQHBD.js} +600 -580
- package/dist/{chunk-VPQZQRSR.js.map → chunk-OPJPQHBD.js.map} +4 -4
- package/dist/{chunk-BHHF247Q.js → chunk-RKBKT4VL.js} +2 -2
- package/dist/{chunk-I5KAA66I.js → chunk-VGEX5UAB.js} +3 -3
- package/dist/{chunk-YMF3HIKQ.js → chunk-VJHLW5BR.js} +1 -1
- package/dist/{chunk-YMF3HIKQ.js.map → chunk-VJHLW5BR.js.map} +1 -1
- package/dist/{chunk-D2YR3LSF.js → chunk-VYGP6UEJ.js} +4 -4
- package/dist/{chunk-BEQU37HJ.js → chunk-YHMGDUI2.js} +3 -3
- package/dist/{chunk-UTVCNV53.js → chunk-YJ3CGHCY.js} +2 -2
- package/dist/{chunk-UJ76NKSF.js → chunk-YZ2X5A6U.js} +3 -3
- package/dist/{chunk-37RJWRLG.js → chunk-Z6MQJ4P7.js} +2 -2
- package/dist/{chunk-Z2P4A76S.js → chunk-ZYCVBMPM.js} +1 -1
- package/dist/{cli-PAJXMDW5.js → cli-FZVC3FYD.js} +87 -87
- package/dist/commands-HJ3NKPNM.js +51 -0
- package/dist/{config-WDRMJEUV.js → config-RMUD7VZA.js} +4 -4
- package/dist/{context-4M45WV6Z.js → context-KSG57YHS.js} +6 -6
- package/dist/{customCommands-2J4CP34P.js → customCommands-W7Z63GJT.js} +4 -4
- package/dist/{env-3BNULBTS.js → env-O63FHSAU.js} +2 -2
- package/dist/{file-WG4PBI2E.js → file-RVZP33QD.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-54EXVPB4.js → llm-7FKEPBX3.js} +29 -29
- package/dist/{llmLazy-YSFGCQ5F.js → llmLazy-U4QRG2SA.js} +1 -1
- package/dist/{loader-2CD5GCGC.js → loader-FBUYOOWY.js} +4 -4
- package/dist/{lsp-6ZD5473F.js → lsp-J7AOBAOF.js} +6 -6
- package/dist/{lspAnchor-TUWC4LL6.js → lspAnchor-2CF7ACGD.js} +6 -6
- package/dist/{mcp-HFVYJYXK.js → mcp-BPILVUKJ.js} +7 -7
- package/dist/{mentionProcessor-D2GK5QFP.js → mentionProcessor-UYF5Y3W7.js} +6 -6
- package/dist/{messages-BSQOXWT5.js → messages-5KIK22BZ.js} +1 -1
- package/dist/{model-563AI4RO.js → model-IIDWEMQF.js} +5 -5
- package/dist/{openai-WZQPCVLM.js → openai-66I2ACE7.js} +5 -5
- package/dist/{outputStyles-K4SQQTC3.js → outputStyles-AWMBRL5J.js} +4 -4
- package/dist/{pluginRuntime-JGIUUE5F.js → pluginRuntime-STMVT5SH.js} +6 -6
- package/dist/{pluginValidation-D7WFKFMO.js → pluginValidation-YGFLCUSI.js} +6 -6
- package/dist/prompts-KNNEGMID.js +53 -0
- package/dist/{pybAgentSessionLoad-FG7J7G3O.js → pybAgentSessionLoad-U7IMOVF7.js} +4 -4
- package/dist/{pybAgentSessionResume-PRUHVKEY.js → pybAgentSessionResume-MORKC42X.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-F3DNZDTX.js → pybAgentStreamJsonSession-DBVI64JT.js} +1 -1
- package/dist/{pybHooks-NBIDAWW2.js → pybHooks-GR5RDDUJ.js} +4 -4
- package/dist/query-SALFQHDS.js +55 -0
- package/dist/{registry-EZF7OENP.js → registry-K7PM6GEJ.js} +5 -5
- package/dist/{ripgrep-XQV6T7IY.js → ripgrep-ARBQAPW5.js} +3 -3
- package/dist/{skillMarketplace-MC26442G.js → skillMarketplace-5JETIWMW.js} +3 -3
- package/dist/{state-4CMVIHK4.js → state-VJMBMXXW.js} +2 -2
- package/dist/{theme-PQTQKLCM.js → theme-WOSRFEFP.js} +5 -5
- package/dist/{toolPermissionSettings-XB5JDDOK.js → toolPermissionSettings-LG6TR22N.js} +6 -6
- package/dist/tools-GMKTDTHW.js +52 -0
- package/dist/{userInput-DYHMKGOR.js → userInput-HVFQNVL7.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-YY7ZK4DX.js +0 -47
- package/dist/chunk-ETXZ5OPA.js.map +0 -7
- package/dist/commands-NYISCZQN.js +0 -51
- package/dist/prompts-7FVIWVGF.js +0 -53
- package/dist/query-A2H7UU7Y.js +0 -55
- package/dist/tools-ED7TYE2A.js +0 -52
- /package/dist/{REPL-YY7ZK4DX.js.map → REPL-MWC7RKTH.js.map} +0 -0
- /package/dist/{acp-KQ5SYBCC.js.map → acp-NQQWCE6I.js.map} +0 -0
- /package/dist/{agentsValidate-SJFVDKUZ.js.map → agentsValidate-4RWRD7GX.js.map} +0 -0
- /package/dist/{ask-A6QHZ5U4.js.map → ask-NT5AU6PG.js.map} +0 -0
- /package/dist/{autoUpdater-BBZVYPRI.js.map → autoUpdater-27VMHRIW.js.map} +0 -0
- /package/dist/{chunk-YKWQF7PT.js.map → chunk-4WQPA6KJ.js.map} +0 -0
- /package/dist/{chunk-ZJXLGVQQ.js.map → chunk-5BKLRHQ5.js.map} +0 -0
- /package/dist/{chunk-MU5SIPBA.js.map → chunk-7AQEFP6S.js.map} +0 -0
- /package/dist/{chunk-VTHYZQ4P.js.map → chunk-A4FM24JV.js.map} +0 -0
- /package/dist/{chunk-NH7SWX57.js.map → chunk-D4WFVW5A.js.map} +0 -0
- /package/dist/{chunk-YQAWSNBK.js.map → chunk-DFPWDMWF.js.map} +0 -0
- /package/dist/{chunk-BGMXYCEG.js.map → chunk-DHOM7ZG7.js.map} +0 -0
- /package/dist/{chunk-4ZYN5JOV.js.map → chunk-FY33EKD2.js.map} +0 -0
- /package/dist/{chunk-6YLH7AMI.js.map → chunk-GWGTKMHL.js.map} +0 -0
- /package/dist/{chunk-I52DKV6I.js.map → chunk-JTNNU6AH.js.map} +0 -0
- /package/dist/{chunk-VIGMIQJS.js.map → chunk-K4XQFGVW.js.map} +0 -0
- /package/dist/{chunk-F2TALCDM.js.map → chunk-KTCMDKTK.js.map} +0 -0
- /package/dist/{chunk-2AV6L5GN.js.map → chunk-LKWFKXSV.js.map} +0 -0
- /package/dist/{chunk-JFGQ5LGD.js.map → chunk-LZEVQLVC.js.map} +0 -0
- /package/dist/{chunk-ELBWGYTR.js.map → chunk-MBSRHORQ.js.map} +0 -0
- /package/dist/{chunk-TRYEQHHB.js.map → chunk-MMFLDFEZ.js.map} +0 -0
- /package/dist/{chunk-OIWM647G.js.map → chunk-N242HITL.js.map} +0 -0
- /package/dist/{chunk-CGJFRSE7.js.map → chunk-NKDRET5K.js.map} +0 -0
- /package/dist/{chunk-BHHF247Q.js.map → chunk-RKBKT4VL.js.map} +0 -0
- /package/dist/{chunk-I5KAA66I.js.map → chunk-VGEX5UAB.js.map} +0 -0
- /package/dist/{chunk-D2YR3LSF.js.map → chunk-VYGP6UEJ.js.map} +0 -0
- /package/dist/{chunk-BEQU37HJ.js.map → chunk-YHMGDUI2.js.map} +0 -0
- /package/dist/{chunk-UTVCNV53.js.map → chunk-YJ3CGHCY.js.map} +0 -0
- /package/dist/{chunk-UJ76NKSF.js.map → chunk-YZ2X5A6U.js.map} +0 -0
- /package/dist/{chunk-37RJWRLG.js.map → chunk-Z6MQJ4P7.js.map} +0 -0
- /package/dist/{chunk-Z2P4A76S.js.map → chunk-ZYCVBMPM.js.map} +0 -0
- /package/dist/{cli-PAJXMDW5.js.map → cli-FZVC3FYD.js.map} +0 -0
- /package/dist/{commands-NYISCZQN.js.map → commands-HJ3NKPNM.js.map} +0 -0
- /package/dist/{config-WDRMJEUV.js.map → config-RMUD7VZA.js.map} +0 -0
- /package/dist/{context-4M45WV6Z.js.map → context-KSG57YHS.js.map} +0 -0
- /package/dist/{customCommands-2J4CP34P.js.map → customCommands-W7Z63GJT.js.map} +0 -0
- /package/dist/{env-3BNULBTS.js.map → env-O63FHSAU.js.map} +0 -0
- /package/dist/{file-WG4PBI2E.js.map → file-RVZP33QD.js.map} +0 -0
- /package/dist/{llm-54EXVPB4.js.map → llm-7FKEPBX3.js.map} +0 -0
- /package/dist/{llmLazy-YSFGCQ5F.js.map → llmLazy-U4QRG2SA.js.map} +0 -0
- /package/dist/{loader-2CD5GCGC.js.map → loader-FBUYOOWY.js.map} +0 -0
- /package/dist/{lsp-6ZD5473F.js.map → lsp-J7AOBAOF.js.map} +0 -0
- /package/dist/{lspAnchor-TUWC4LL6.js.map → lspAnchor-2CF7ACGD.js.map} +0 -0
- /package/dist/{mcp-HFVYJYXK.js.map → mcp-BPILVUKJ.js.map} +0 -0
- /package/dist/{mentionProcessor-D2GK5QFP.js.map → mentionProcessor-UYF5Y3W7.js.map} +0 -0
- /package/dist/{messages-BSQOXWT5.js.map → messages-5KIK22BZ.js.map} +0 -0
- /package/dist/{model-563AI4RO.js.map → model-IIDWEMQF.js.map} +0 -0
- /package/dist/{openai-WZQPCVLM.js.map → openai-66I2ACE7.js.map} +0 -0
- /package/dist/{outputStyles-K4SQQTC3.js.map → outputStyles-AWMBRL5J.js.map} +0 -0
- /package/dist/{pluginRuntime-JGIUUE5F.js.map → pluginRuntime-STMVT5SH.js.map} +0 -0
- /package/dist/{pluginValidation-D7WFKFMO.js.map → pluginValidation-YGFLCUSI.js.map} +0 -0
- /package/dist/{prompts-7FVIWVGF.js.map → prompts-KNNEGMID.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-FG7J7G3O.js.map → pybAgentSessionLoad-U7IMOVF7.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-PRUHVKEY.js.map → pybAgentSessionResume-MORKC42X.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-F3DNZDTX.js.map → pybAgentStreamJsonSession-DBVI64JT.js.map} +0 -0
- /package/dist/{pybHooks-NBIDAWW2.js.map → pybHooks-GR5RDDUJ.js.map} +0 -0
- /package/dist/{query-A2H7UU7Y.js.map → query-SALFQHDS.js.map} +0 -0
- /package/dist/{registry-EZF7OENP.js.map → registry-K7PM6GEJ.js.map} +0 -0
- /package/dist/{ripgrep-XQV6T7IY.js.map → ripgrep-ARBQAPW5.js.map} +0 -0
- /package/dist/{skillMarketplace-MC26442G.js.map → skillMarketplace-5JETIWMW.js.map} +0 -0
- /package/dist/{state-4CMVIHK4.js.map → state-VJMBMXXW.js.map} +0 -0
- /package/dist/{theme-PQTQKLCM.js.map → theme-WOSRFEFP.js.map} +0 -0
- /package/dist/{toolPermissionSettings-XB5JDDOK.js.map → toolPermissionSettings-LG6TR22N.js.map} +0 -0
- /package/dist/{tools-ED7TYE2A.js.map → tools-GMKTDTHW.js.map} +0 -0
- /package/dist/{userInput-DYHMKGOR.js.map → userInput-HVFQNVL7.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-JTNNU6AH.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4WQPA6KJ.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KTCMDKTK.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Z6MQJ4P7.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-MBSRHORQ.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_OUTPUT_STYLE,
|
|
32
32
|
getAvailableOutputStyles,
|
|
@@ -35,16 +35,16 @@ import {
|
|
|
35
35
|
getOutputStyleSystemPromptAdditions,
|
|
36
36
|
resolveOutputStyleName,
|
|
37
37
|
setCurrentOutputStyle
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-A4FM24JV.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MMFLDFEZ.js";
|
|
43
43
|
import {
|
|
44
44
|
queryLLM,
|
|
45
45
|
queryQuick,
|
|
46
46
|
verifyApiKey
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GWGTKMHL.js";
|
|
48
48
|
import {
|
|
49
49
|
DEFAULT_TIMEOUT_MS,
|
|
50
50
|
FallbackToolUseRejectedMessage,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
listMCPServers,
|
|
59
59
|
loadMergedSettings,
|
|
60
60
|
normalizeSandboxRuntimeConfigFromSettings
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-K4XQFGVW.js";
|
|
62
62
|
import {
|
|
63
63
|
addMarketplace,
|
|
64
64
|
disableSkillPlugin,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
refreshMarketplaceAsync,
|
|
72
72
|
removeMarketplace,
|
|
73
73
|
uninstallSkillPlugin
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-N242HITL.js";
|
|
75
75
|
import {
|
|
76
76
|
loadToolPermissionContextFromDisk,
|
|
77
77
|
persistToolPermissionUpdateToDisk
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-5BKLRHQ5.js";
|
|
79
79
|
import {
|
|
80
80
|
applyToolPermissionContextUpdate,
|
|
81
81
|
applyToolPermissionContextUpdates,
|
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
setTodos,
|
|
96
96
|
syncTodosToTasks,
|
|
97
97
|
systemReminderService
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-M6H3DZ65.js";
|
|
99
99
|
import {
|
|
100
100
|
getSessionState
|
|
101
101
|
} from "./chunk-ERMQRV55.js";
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
getActiveAgents,
|
|
105
105
|
getAgentByType,
|
|
106
106
|
getAllAgents
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-RKBKT4VL.js";
|
|
108
108
|
import {
|
|
109
109
|
API_ERROR_MESSAGE_PREFIX,
|
|
110
110
|
CANCEL_MESSAGE,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
processUserInput,
|
|
135
135
|
reorderMessages,
|
|
136
136
|
stripSystemMessages
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-DHOM7ZG7.js";
|
|
138
138
|
import {
|
|
139
139
|
getRequestStatus,
|
|
140
140
|
setRequestStatus,
|
|
@@ -164,7 +164,7 @@ import {
|
|
|
164
164
|
normalizeFilePath,
|
|
165
165
|
readTextContent,
|
|
166
166
|
writeTextContent
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-NKDRET5K.js";
|
|
168
168
|
import {
|
|
169
169
|
parseBlockEdits
|
|
170
170
|
} from "./chunk-QWIBSCDN.js";
|
|
@@ -174,18 +174,18 @@ import {
|
|
|
174
174
|
ParserRegistry,
|
|
175
175
|
initParser,
|
|
176
176
|
loadLanguage
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-VYGP6UEJ.js";
|
|
178
178
|
import {
|
|
179
179
|
getSettingsFileCandidates,
|
|
180
180
|
loadSettingsWithLegacyFallback,
|
|
181
181
|
readSettingsFile
|
|
182
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-DFPWDMWF.js";
|
|
183
183
|
import {
|
|
184
184
|
getCustomCommandDirectories,
|
|
185
185
|
hasCustomCommands,
|
|
186
186
|
loadCustomCommands,
|
|
187
187
|
reloadCustomCommands
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-YJ3CGHCY.js";
|
|
189
189
|
import {
|
|
190
190
|
getSessionPlugins
|
|
191
191
|
} from "./chunk-BJSWTHRM.js";
|
|
@@ -193,7 +193,7 @@ import {
|
|
|
193
193
|
ModelManager,
|
|
194
194
|
getModelManager,
|
|
195
195
|
isDefaultSlowAndCapableModel
|
|
196
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-YZ2X5A6U.js";
|
|
197
197
|
import {
|
|
198
198
|
getCodeStyle,
|
|
199
199
|
getContext,
|
|
@@ -201,13 +201,13 @@ import {
|
|
|
201
201
|
getIsGit,
|
|
202
202
|
getProjectDocs,
|
|
203
203
|
getProjectStructureStatisticsBlock
|
|
204
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-7AQEFP6S.js";
|
|
205
205
|
import {
|
|
206
206
|
ripGrep
|
|
207
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-ZYCVBMPM.js";
|
|
208
208
|
import {
|
|
209
209
|
getTheme
|
|
210
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-LKWFKXSV.js";
|
|
211
211
|
import {
|
|
212
212
|
DEFAULT_GLOBAL_CONFIG,
|
|
213
213
|
enableConfigs,
|
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
saveGlobalConfig,
|
|
221
221
|
setAllPointersToModel,
|
|
222
222
|
setModelPointer
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-VGEX5UAB.js";
|
|
224
224
|
import {
|
|
225
225
|
AbortError
|
|
226
226
|
} from "./chunk-RQVLBMP7.js";
|
|
@@ -229,7 +229,7 @@ import {
|
|
|
229
229
|
getCurrentRequest,
|
|
230
230
|
logUserFriendly,
|
|
231
231
|
markPhase
|
|
232
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-FY33EKD2.js";
|
|
233
233
|
import {
|
|
234
234
|
ASCII_LOGO,
|
|
235
235
|
BunShell,
|
|
@@ -270,10 +270,10 @@ import {
|
|
|
270
270
|
setCwd,
|
|
271
271
|
shouldApplyToolOutputTruncation,
|
|
272
272
|
truncateToolOutput
|
|
273
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-LZEVQLVC.js";
|
|
274
274
|
import {
|
|
275
275
|
MACRO
|
|
276
|
-
} from "./chunk-
|
|
276
|
+
} from "./chunk-VJHLW5BR.js";
|
|
277
277
|
import {
|
|
278
278
|
__export
|
|
279
279
|
} from "./chunk-I3J4JYES.js";
|
|
@@ -454,7 +454,7 @@ var getCommandSubcommandPrefix = memoize(
|
|
|
454
454
|
var getCommandPrefix = memoize(
|
|
455
455
|
async (command4, abortSignal) => {
|
|
456
456
|
const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
|
|
457
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-
|
|
457
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryQuick: queryQuick2 } = await import("./llm-7FKEPBX3.js");
|
|
458
458
|
const response = await queryQuick2({
|
|
459
459
|
systemPrompt,
|
|
460
460
|
userPrompt,
|
|
@@ -4256,7 +4256,7 @@ function formatParseError(error) {
|
|
|
4256
4256
|
return error instanceof Error ? error.message : String(error);
|
|
4257
4257
|
}
|
|
4258
4258
|
async function defaultGateQuery(args) {
|
|
4259
|
-
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-
|
|
4259
|
+
const { API_ERROR_MESSAGE_PREFIX: API_ERROR_MESSAGE_PREFIX2, queryLLM: queryLLM2 } = await import("./llm-7FKEPBX3.js");
|
|
4260
4260
|
const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
|
|
4261
4261
|
const messages = [
|
|
4262
4262
|
{
|
|
@@ -6571,7 +6571,7 @@ var FileEditTool = {
|
|
|
6571
6571
|
const originalFileContent = currentFileContent;
|
|
6572
6572
|
let totalPatch = [];
|
|
6573
6573
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6574
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6574
|
+
const { findLspAnchor } = await import("./lspAnchor-2CF7ACGD.js");
|
|
6575
6575
|
for (const op of editOperations) {
|
|
6576
6576
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6577
6577
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -8837,7 +8837,7 @@ var WebSearchTool = {
|
|
|
8837
8837
|
|
|
8838
8838
|
// src/tools/interaction/SlashCommandTool/SlashCommandTool.tsx
|
|
8839
8839
|
import { z as z13 } from "zod";
|
|
8840
|
-
import * as
|
|
8840
|
+
import * as React109 from "react";
|
|
8841
8841
|
|
|
8842
8842
|
// src/ui/components/Bug.tsx
|
|
8843
8843
|
import { Box as Box17, Text as Text19, useInput as useInput5 } from "ink";
|
|
@@ -11206,7 +11206,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11206
11206
|
}
|
|
11207
11207
|
saveGlobalConfig(config2);
|
|
11208
11208
|
try {
|
|
11209
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11209
|
+
const { resetAnthropicClient } = await import("./llm-7FKEPBX3.js");
|
|
11210
11210
|
resetAnthropicClient();
|
|
11211
11211
|
} catch {
|
|
11212
11212
|
}
|
|
@@ -15488,7 +15488,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15488
15488
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15489
15489
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15490
15490
|
if (dirs.length === 0) return [];
|
|
15491
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15491
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-STMVT5SH.js");
|
|
15492
15492
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15493
15493
|
return errors;
|
|
15494
15494
|
}
|
|
@@ -16157,7 +16157,7 @@ async function call(onDone, context) {
|
|
|
16157
16157
|
ModelConfig,
|
|
16158
16158
|
{
|
|
16159
16159
|
onClose: () => {
|
|
16160
|
-
import("./model-
|
|
16160
|
+
import("./model-IIDWEMQF.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
16161
16161
|
reloadModelManager2();
|
|
16162
16162
|
triggerModelConfigChange();
|
|
16163
16163
|
onDone();
|
|
@@ -16980,11 +16980,11 @@ var tag_default = tag;
|
|
|
16980
16980
|
|
|
16981
16981
|
// src/commands/todos.tsx
|
|
16982
16982
|
import { useInput as useInput16 } from "ink";
|
|
16983
|
-
import * as
|
|
16983
|
+
import * as React49 from "react";
|
|
16984
16984
|
|
|
16985
16985
|
// src/ui/components/TaskList.tsx
|
|
16986
|
-
import { Box as
|
|
16987
|
-
import
|
|
16986
|
+
import { Box as Box37, Text as Text41 } from "ink";
|
|
16987
|
+
import React48 from "react";
|
|
16988
16988
|
|
|
16989
16989
|
// src/utils/session/taskGraph.ts
|
|
16990
16990
|
function buildTaskGraph(tasks) {
|
|
@@ -17068,7 +17068,7 @@ function isTaskBlocked(task, tasksById) {
|
|
|
17068
17068
|
return false;
|
|
17069
17069
|
}
|
|
17070
17070
|
function isReadyStatus(status) {
|
|
17071
|
-
return status === "
|
|
17071
|
+
return status === "pending";
|
|
17072
17072
|
}
|
|
17073
17073
|
function calculateReadyBlocked(tasks) {
|
|
17074
17074
|
const tasksById = new Map(tasks.map((task) => [task.id, task]));
|
|
@@ -17092,53 +17092,86 @@ function calculateReadyBlocked(tasks) {
|
|
|
17092
17092
|
return { ready, blocked };
|
|
17093
17093
|
}
|
|
17094
17094
|
|
|
17095
|
+
// src/ui/components/TodoItem.tsx
|
|
17096
|
+
import React47 from "react";
|
|
17097
|
+
import { Box as Box36, Text as Text40 } from "ink";
|
|
17098
|
+
var TodoItem = ({
|
|
17099
|
+
todo,
|
|
17100
|
+
children,
|
|
17101
|
+
showPriority = true
|
|
17102
|
+
}) => {
|
|
17103
|
+
const statusIconMap = {
|
|
17104
|
+
completed: "\u2705",
|
|
17105
|
+
in_progress: "\u{1F504}",
|
|
17106
|
+
pending: "\u23F8\uFE0F"
|
|
17107
|
+
};
|
|
17108
|
+
const statusColorMap = {
|
|
17109
|
+
completed: void 0,
|
|
17110
|
+
// Use default color (will be dimmed)
|
|
17111
|
+
in_progress: "#FFA500",
|
|
17112
|
+
pending: "#FFD700"
|
|
17113
|
+
};
|
|
17114
|
+
const priorityIconMap = {
|
|
17115
|
+
high: "\u{1F534}",
|
|
17116
|
+
medium: "\u{1F7E1}",
|
|
17117
|
+
low: "\u{1F7E2}"
|
|
17118
|
+
};
|
|
17119
|
+
const icon = statusIconMap[todo.status];
|
|
17120
|
+
const color = statusColorMap[todo.status];
|
|
17121
|
+
const priorityIcon = showPriority && todo.priority ? priorityIconMap[todo.priority] : "";
|
|
17122
|
+
return /* @__PURE__ */ React47.createElement(Box36, { flexDirection: "column" }, /* @__PURE__ */ React47.createElement(Box36, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React47.createElement(Text40, null, "\u23BF"), /* @__PURE__ */ React47.createElement(Text40, { color, dimColor: todo.status === "completed" }, icon), priorityIcon && /* @__PURE__ */ React47.createElement(Text40, null, priorityIcon), /* @__PURE__ */ React47.createElement(
|
|
17123
|
+
Text40,
|
|
17124
|
+
{
|
|
17125
|
+
color,
|
|
17126
|
+
dimColor: todo.status === "completed",
|
|
17127
|
+
strikethrough: todo.status === "completed",
|
|
17128
|
+
bold: todo.status === "in_progress"
|
|
17129
|
+
},
|
|
17130
|
+
todo.content
|
|
17131
|
+
), children), todo.status === "in_progress" && todo.activeForm && /* @__PURE__ */ React47.createElement(Box36, { marginLeft: 4 }, /* @__PURE__ */ React47.createElement(Text40, { color: "gray" }, "\u21B3 Action: ", todo.activeForm)));
|
|
17132
|
+
};
|
|
17133
|
+
function ListRenderer({
|
|
17134
|
+
items,
|
|
17135
|
+
emptyMessage,
|
|
17136
|
+
dimEmpty,
|
|
17137
|
+
header,
|
|
17138
|
+
renderItem
|
|
17139
|
+
}) {
|
|
17140
|
+
if (items.length === 0) {
|
|
17141
|
+
return /* @__PURE__ */ React47.createElement(Box36, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React47.createElement(Text40, { dimColor: dimEmpty }, emptyMessage));
|
|
17142
|
+
}
|
|
17143
|
+
return /* @__PURE__ */ React47.createElement(Box36, { flexDirection: "column" }, header ? /* @__PURE__ */ React47.createElement(Box36, null, header) : null, /* @__PURE__ */ React47.createElement(Box36, { marginTop: 1, flexDirection: "column" }, items.map((item, index) => renderItem(item, index))));
|
|
17144
|
+
}
|
|
17145
|
+
|
|
17095
17146
|
// src/ui/components/TaskList.tsx
|
|
17096
|
-
function
|
|
17097
|
-
if (status === "done") return "
|
|
17098
|
-
if (status === "
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
17105
|
-
|
|
17106
|
-
if (status === "blocked") return "#FF5555";
|
|
17107
|
-
return "#FFD700";
|
|
17147
|
+
function mapStatus(status) {
|
|
17148
|
+
if (status === "done" || status === "archived") return "completed";
|
|
17149
|
+
if (status === "in_progress") return "in_progress";
|
|
17150
|
+
return "pending";
|
|
17151
|
+
}
|
|
17152
|
+
function formatBlockedBy(task) {
|
|
17153
|
+
const blockedBy = (task.blockedBy ?? []).filter(Boolean);
|
|
17154
|
+
if (blockedBy.length === 0) return null;
|
|
17155
|
+
const blockers = blockedBy.map((id) => `#${id}`).join(", ");
|
|
17156
|
+
return `> blocked by ${blockers}`;
|
|
17108
17157
|
}
|
|
17109
17158
|
function formatTaskDetails(task) {
|
|
17110
17159
|
const description3 = task.description?.trim();
|
|
17111
|
-
const
|
|
17112
|
-
if (!description3 &&
|
|
17113
|
-
if (
|
|
17114
|
-
|
|
17115
|
-
if (description3) return `${description3} | ${blockedText}`;
|
|
17116
|
-
return blockedText;
|
|
17160
|
+
const blockedText = formatBlockedBy(task);
|
|
17161
|
+
if (!description3 && !blockedText) return null;
|
|
17162
|
+
if (description3 && blockedText) return `${description3} | ${blockedText}`;
|
|
17163
|
+
return description3 ?? blockedText;
|
|
17117
17164
|
}
|
|
17118
17165
|
function renderTask(task) {
|
|
17119
|
-
const color = getStatusColor(task.status);
|
|
17120
|
-
const isFinished = task.status === "done" || task.status === "archived";
|
|
17121
17166
|
const details = formatTaskDetails(task);
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17126
|
-
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
|
|
17130
|
-
task.subject
|
|
17131
|
-
), details ? /* @__PURE__ */ React47.createElement(
|
|
17132
|
-
Text40,
|
|
17133
|
-
{
|
|
17134
|
-
color,
|
|
17135
|
-
dimColor: isFinished,
|
|
17136
|
-
strikethrough: isFinished,
|
|
17137
|
-
bold: task.status === "in_progress"
|
|
17138
|
-
},
|
|
17139
|
-
" - ",
|
|
17140
|
-
details
|
|
17141
|
-
) : null);
|
|
17167
|
+
const todo = {
|
|
17168
|
+
id: task.id,
|
|
17169
|
+
content: task.subject,
|
|
17170
|
+
status: mapStatus(task.status),
|
|
17171
|
+
activeForm: task.activeForm ?? task.subject,
|
|
17172
|
+
priority: "medium"
|
|
17173
|
+
};
|
|
17174
|
+
return /* @__PURE__ */ React48.createElement(TodoItem, { key: task.id, todo, showPriority: false }, details ? /* @__PURE__ */ React48.createElement(Text41, null, " - ", details) : null);
|
|
17142
17175
|
}
|
|
17143
17176
|
function TaskList(props) {
|
|
17144
17177
|
const tasks = props.tasks ?? listTasks({ listId: props.listId });
|
|
@@ -17152,9 +17185,25 @@ function TaskList(props) {
|
|
|
17152
17185
|
);
|
|
17153
17186
|
const total = visibleTasks.length;
|
|
17154
17187
|
if (total === 0) {
|
|
17155
|
-
return /* @__PURE__ */
|
|
17188
|
+
return /* @__PURE__ */ React48.createElement(Text41, null, "No tasks currently tracked");
|
|
17156
17189
|
}
|
|
17157
|
-
return /* @__PURE__ */
|
|
17190
|
+
return /* @__PURE__ */ React48.createElement(Box37, { flexDirection: "column" }, /* @__PURE__ */ React48.createElement(Text41, null, /* @__PURE__ */ React48.createElement(Text41, { bold: true }, ready.length, " ready"), /* @__PURE__ */ React48.createElement(Text41, null, " / "), /* @__PURE__ */ React48.createElement(Text41, { bold: true }, blocked.length, " blocked")), /* @__PURE__ */ React48.createElement(Box37, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React48.createElement(Text41, { bold: true }, "Ready"), /* @__PURE__ */ React48.createElement(Box37, { marginLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React48.createElement(
|
|
17191
|
+
ListRenderer,
|
|
17192
|
+
{
|
|
17193
|
+
items: ready,
|
|
17194
|
+
emptyMessage: "none",
|
|
17195
|
+
dimEmpty: true,
|
|
17196
|
+
renderItem: (task) => renderTask(task)
|
|
17197
|
+
}
|
|
17198
|
+
)), /* @__PURE__ */ React48.createElement(Box37, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React48.createElement(Text41, { bold: true }, "Blocked"), /* @__PURE__ */ React48.createElement(Box37, { marginLeft: 2, flexDirection: "column" }, /* @__PURE__ */ React48.createElement(
|
|
17199
|
+
ListRenderer,
|
|
17200
|
+
{
|
|
17201
|
+
items: blocked,
|
|
17202
|
+
emptyMessage: "none",
|
|
17203
|
+
dimEmpty: true,
|
|
17204
|
+
renderItem: (task) => renderTask(task)
|
|
17205
|
+
}
|
|
17206
|
+
)))));
|
|
17158
17207
|
}
|
|
17159
17208
|
|
|
17160
17209
|
// src/commands/todos.tsx
|
|
@@ -17168,7 +17217,7 @@ function TodosView({
|
|
|
17168
17217
|
}
|
|
17169
17218
|
});
|
|
17170
17219
|
const tasks = injectedTasks ?? listTasks();
|
|
17171
|
-
return /* @__PURE__ */
|
|
17220
|
+
return /* @__PURE__ */ React49.createElement(TaskList, { tasks });
|
|
17172
17221
|
}
|
|
17173
17222
|
var todos = {
|
|
17174
17223
|
type: "local-jsx",
|
|
@@ -17179,7 +17228,7 @@ var todos = {
|
|
|
17179
17228
|
async call(onDone, context) {
|
|
17180
17229
|
migrateTodosToTasks();
|
|
17181
17230
|
const tasks = listTasks();
|
|
17182
|
-
return /* @__PURE__ */
|
|
17231
|
+
return /* @__PURE__ */ React49.createElement(TodosView, { tasks, onClose: onDone });
|
|
17183
17232
|
},
|
|
17184
17233
|
userFacingName() {
|
|
17185
17234
|
return "todos";
|
|
@@ -17199,11 +17248,11 @@ __export(websearch_exports, {
|
|
|
17199
17248
|
type: () => type2,
|
|
17200
17249
|
userFacingName: () => userFacingName2
|
|
17201
17250
|
});
|
|
17202
|
-
import
|
|
17251
|
+
import React51 from "react";
|
|
17203
17252
|
|
|
17204
17253
|
// src/ui/components/WebSearchConfig.tsx
|
|
17205
|
-
import { Box as
|
|
17206
|
-
import
|
|
17254
|
+
import { Box as Box38, Text as Text42, useInput as useInput17 } from "ink";
|
|
17255
|
+
import React50, { useMemo as useMemo9, useState as useState16 } from "react";
|
|
17207
17256
|
import figures6 from "figures";
|
|
17208
17257
|
var providerOptions = [
|
|
17209
17258
|
{
|
|
@@ -17444,8 +17493,8 @@ function WebSearchConfig({ onClose }) {
|
|
|
17444
17493
|
}
|
|
17445
17494
|
});
|
|
17446
17495
|
const cwd = getCwd();
|
|
17447
|
-
return /* @__PURE__ */
|
|
17448
|
-
|
|
17496
|
+
return /* @__PURE__ */ React50.createElement(Box38, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React50.createElement(
|
|
17497
|
+
Box38,
|
|
17449
17498
|
{
|
|
17450
17499
|
flexDirection: "column",
|
|
17451
17500
|
borderStyle: "round",
|
|
@@ -17454,30 +17503,30 @@ function WebSearchConfig({ onClose }) {
|
|
|
17454
17503
|
paddingY: 1,
|
|
17455
17504
|
gap: 1
|
|
17456
17505
|
},
|
|
17457
|
-
/* @__PURE__ */
|
|
17458
|
-
/* @__PURE__ */
|
|
17506
|
+
/* @__PURE__ */ React50.createElement(Text42, { bold: true }, "Web Search Configuration", " ", exitState.pending ? `(press ${exitState.keyName} again to exit)` : ""),
|
|
17507
|
+
/* @__PURE__ */ React50.createElement(Box38, { flexDirection: "column" }, menuItems.map((item, index) => {
|
|
17459
17508
|
const isSelected = index === selectedIndex;
|
|
17460
|
-
return /* @__PURE__ */
|
|
17461
|
-
|
|
17509
|
+
return /* @__PURE__ */ React50.createElement(Box38, { key: item.id, flexDirection: "column" }, /* @__PURE__ */ React50.createElement(Box38, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React50.createElement(Text42, { color: isSelected ? theme.success : theme.text }, isSelected ? figures6.pointer : " ", " ", item.label), /* @__PURE__ */ React50.createElement(
|
|
17510
|
+
Text42,
|
|
17462
17511
|
{
|
|
17463
17512
|
color: item.value === "Not set" ? theme.warning : theme.success
|
|
17464
17513
|
},
|
|
17465
17514
|
item.value
|
|
17466
|
-
), isSelected && /* @__PURE__ */
|
|
17515
|
+
), isSelected && /* @__PURE__ */ React50.createElement(Text42, { color: theme.suggestion }, item.id === "tavily-key" ? " [Enter to edit]" : " [Enter/Space to change]")), isSelected && /* @__PURE__ */ React50.createElement(Box38, { paddingLeft: 2, marginBottom: 1 }, /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, item.description)));
|
|
17467
17516
|
})),
|
|
17468
|
-
isEditingKey && /* @__PURE__ */
|
|
17469
|
-
/* @__PURE__ */
|
|
17470
|
-
/* @__PURE__ */
|
|
17471
|
-
/* @__PURE__ */
|
|
17472
|
-
/* @__PURE__ */
|
|
17473
|
-
|
|
17517
|
+
isEditingKey && /* @__PURE__ */ React50.createElement(Box38, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React50.createElement(Text42, { bold: true, color: theme.success }, "Enter Tavily API Key (", scope === "project" ? "Project" : "Global", ")"), /* @__PURE__ */ React50.createElement(Text42, { color: theme.secondaryText }, keyInput.replace(/./g, "\u2022")), /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Press Enter to save, Esc to cancel, empty input clears the key")),
|
|
17518
|
+
/* @__PURE__ */ React50.createElement(Box38, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Provider source: ", formatSourceLabel(sources.provider.source)), /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Tavily key source: ", formatSourceLabel(sources.tavilyKey.source))),
|
|
17519
|
+
/* @__PURE__ */ React50.createElement(Box38, { marginTop: 1 }, /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Project scope saves to the exact path: ", cwd)),
|
|
17520
|
+
/* @__PURE__ */ React50.createElement(Box38, null, /* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Running from a subdirectory uses a different project scope entry")),
|
|
17521
|
+
/* @__PURE__ */ React50.createElement(
|
|
17522
|
+
Box38,
|
|
17474
17523
|
{
|
|
17475
17524
|
marginTop: 1,
|
|
17476
17525
|
paddingTop: 1,
|
|
17477
17526
|
borderTopColor: theme.secondaryBorder,
|
|
17478
17527
|
borderTopStyle: "single"
|
|
17479
17528
|
},
|
|
17480
|
-
/* @__PURE__ */
|
|
17529
|
+
/* @__PURE__ */ React50.createElement(Text42, { dimColor: true }, "Use \u2191/\u2193 to navigate, Enter/Space to change, Esc to exit")
|
|
17481
17530
|
)
|
|
17482
17531
|
));
|
|
17483
17532
|
}
|
|
@@ -17496,35 +17545,35 @@ async function call2(onDone, context) {
|
|
|
17496
17545
|
const { abortController } = context;
|
|
17497
17546
|
enableConfigs();
|
|
17498
17547
|
abortController?.abort?.();
|
|
17499
|
-
return /* @__PURE__ */
|
|
17548
|
+
return /* @__PURE__ */ React51.createElement(WebSearchConfig, { onClose: onDone });
|
|
17500
17549
|
}
|
|
17501
17550
|
|
|
17502
17551
|
// src/commands/resume.tsx
|
|
17503
|
-
import * as
|
|
17552
|
+
import * as React106 from "react";
|
|
17504
17553
|
|
|
17505
17554
|
// src/ui/screens/ResumeConversation.tsx
|
|
17506
|
-
import
|
|
17555
|
+
import React105 from "react";
|
|
17507
17556
|
import { render } from "ink";
|
|
17508
17557
|
|
|
17509
17558
|
// src/ui/screens/REPL.tsx
|
|
17510
|
-
import { Box as
|
|
17559
|
+
import { Box as Box77, Newline as Newline4, Static as Static2 } from "ink";
|
|
17511
17560
|
|
|
17512
17561
|
// src/ui/components/CostThresholdDialog.tsx
|
|
17513
|
-
import { Box as
|
|
17514
|
-
import
|
|
17562
|
+
import { Box as Box39, Text as Text44, useInput as useInput18 } from "ink";
|
|
17563
|
+
import React53 from "react";
|
|
17515
17564
|
|
|
17516
17565
|
// src/ui/components/Link.tsx
|
|
17517
17566
|
import InkLink from "ink-link";
|
|
17518
|
-
import { Text as
|
|
17519
|
-
import
|
|
17567
|
+
import { Text as Text43 } from "ink";
|
|
17568
|
+
import React52 from "react";
|
|
17520
17569
|
var LINK_SUPPORTING_TERMINALS = ["iTerm.app", "WezTerm", "Hyper", "VSCode"];
|
|
17521
17570
|
function Link({ url: url2, children }) {
|
|
17522
17571
|
const supportsLinks = LINK_SUPPORTING_TERMINALS.includes(env.terminal ?? "");
|
|
17523
17572
|
const displayContent = children || url2;
|
|
17524
17573
|
if (supportsLinks || displayContent !== url2) {
|
|
17525
|
-
return /* @__PURE__ */
|
|
17574
|
+
return /* @__PURE__ */ React52.createElement(InkLink, { url: url2 }, /* @__PURE__ */ React52.createElement(Text43, null, displayContent));
|
|
17526
17575
|
} else {
|
|
17527
|
-
return /* @__PURE__ */
|
|
17576
|
+
return /* @__PURE__ */ React52.createElement(Text43, { underline: true }, displayContent);
|
|
17528
17577
|
}
|
|
17529
17578
|
}
|
|
17530
17579
|
|
|
@@ -17535,16 +17584,16 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17535
17584
|
onDone();
|
|
17536
17585
|
}
|
|
17537
17586
|
});
|
|
17538
|
-
return /* @__PURE__ */
|
|
17539
|
-
|
|
17587
|
+
return /* @__PURE__ */ React53.createElement(
|
|
17588
|
+
Box39,
|
|
17540
17589
|
{
|
|
17541
17590
|
flexDirection: "column",
|
|
17542
17591
|
borderStyle: "round",
|
|
17543
17592
|
padding: 1,
|
|
17544
17593
|
borderColor: getTheme().secondaryBorder
|
|
17545
17594
|
},
|
|
17546
|
-
/* @__PURE__ */
|
|
17547
|
-
/* @__PURE__ */
|
|
17595
|
+
/* @__PURE__ */ React53.createElement(Box39, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React53.createElement(Text44, { bold: true }, "You've spent $5 on AI model API calls this session."), /* @__PURE__ */ React53.createElement(Text44, null, "Learn more about monitoring your AI usage costs:"), /* @__PURE__ */ React53.createElement(Link, { url: "https://github.com/pyb-xc/pyb-ts/blob/main/README.md" })),
|
|
17596
|
+
/* @__PURE__ */ React53.createElement(Box39, null, /* @__PURE__ */ React53.createElement(
|
|
17548
17597
|
Select,
|
|
17549
17598
|
{
|
|
17550
17599
|
options: [
|
|
@@ -17560,37 +17609,37 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17560
17609
|
}
|
|
17561
17610
|
|
|
17562
17611
|
// src/ui/screens/REPL.tsx
|
|
17563
|
-
import * as
|
|
17612
|
+
import * as React103 from "react";
|
|
17564
17613
|
import { useEffect as useEffect25, useMemo as useMemo25, useRef as useRef13, useState as useState27, useCallback as useCallback16 } from "react";
|
|
17565
17614
|
|
|
17566
17615
|
// src/ui/components/Message.tsx
|
|
17567
|
-
import { Box as
|
|
17568
|
-
import * as
|
|
17616
|
+
import { Box as Box53 } from "ink";
|
|
17617
|
+
import * as React74 from "react";
|
|
17569
17618
|
|
|
17570
17619
|
// src/ui/components/messages/user-tool-result-message/UserToolResultMessage.tsx
|
|
17571
|
-
import * as
|
|
17620
|
+
import * as React59 from "react";
|
|
17572
17621
|
|
|
17573
17622
|
// src/ui/components/messages/user-tool-result-message/UserToolCanceledMessage.tsx
|
|
17574
|
-
import { Text as
|
|
17575
|
-
import * as
|
|
17623
|
+
import { Text as Text45 } from "ink";
|
|
17624
|
+
import * as React54 from "react";
|
|
17576
17625
|
function UserToolCanceledMessage() {
|
|
17577
|
-
return /* @__PURE__ */
|
|
17626
|
+
return /* @__PURE__ */ React54.createElement(Text45, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React54.createElement(Text45, { color: getTheme().error }, "Interrupted by user"));
|
|
17578
17627
|
}
|
|
17579
17628
|
|
|
17580
17629
|
// src/ui/components/messages/user-tool-result-message/UserToolErrorMessage.tsx
|
|
17581
|
-
import { Box as
|
|
17582
|
-
import * as
|
|
17630
|
+
import { Box as Box40, Text as Text46 } from "ink";
|
|
17631
|
+
import * as React55 from "react";
|
|
17583
17632
|
var MAX_RENDERED_LINES = 10;
|
|
17584
17633
|
function UserToolErrorMessage({
|
|
17585
17634
|
param,
|
|
17586
17635
|
verbose
|
|
17587
17636
|
}) {
|
|
17588
17637
|
const error = typeof param.content === "string" ? param.content.trim() : "Error";
|
|
17589
|
-
return /* @__PURE__ */
|
|
17638
|
+
return /* @__PURE__ */ React55.createElement(Box40, { flexDirection: "row", width: "100%" }, /* @__PURE__ */ React55.createElement(Text46, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React55.createElement(Box40, { flexDirection: "column" }, /* @__PURE__ */ React55.createElement(Text46, { color: getTheme().error }, verbose ? error : error.split("\n").slice(0, MAX_RENDERED_LINES).join("\n") || ""), !verbose && error.split("\n").length > MAX_RENDERED_LINES && /* @__PURE__ */ React55.createElement(Text46, { color: getTheme().secondaryText }, "... (+", error.split("\n").length - MAX_RENDERED_LINES, " lines)")));
|
|
17590
17639
|
}
|
|
17591
17640
|
|
|
17592
17641
|
// src/ui/components/messages/user-tool-result-message/UserToolRejectMessage.tsx
|
|
17593
|
-
import * as
|
|
17642
|
+
import * as React57 from "react";
|
|
17594
17643
|
|
|
17595
17644
|
// src/ui/components/messages/user-tool-result-message/utils.tsx
|
|
17596
17645
|
import { useMemo as useMemo10 } from "react";
|
|
@@ -17629,7 +17678,7 @@ function useGetToolFromMessages(toolUseID, tools, messages) {
|
|
|
17629
17678
|
}
|
|
17630
17679
|
|
|
17631
17680
|
// src/context/PermissionContext.tsx
|
|
17632
|
-
import
|
|
17681
|
+
import React56, {
|
|
17633
17682
|
createContext,
|
|
17634
17683
|
useContext,
|
|
17635
17684
|
useState as useState17,
|
|
@@ -18020,7 +18069,7 @@ function PermissionProvider({
|
|
|
18020
18069
|
isToolAllowed,
|
|
18021
18070
|
getModeConfig
|
|
18022
18071
|
};
|
|
18023
|
-
return /* @__PURE__ */
|
|
18072
|
+
return /* @__PURE__ */ React56.createElement(PermissionContext.Provider, { value }, children);
|
|
18024
18073
|
}
|
|
18025
18074
|
function usePermissionContext() {
|
|
18026
18075
|
const context = useContext(PermissionContext);
|
|
@@ -18050,12 +18099,12 @@ function UserToolRejectMessage({
|
|
|
18050
18099
|
conversationKey
|
|
18051
18100
|
});
|
|
18052
18101
|
}
|
|
18053
|
-
return /* @__PURE__ */
|
|
18102
|
+
return /* @__PURE__ */ React57.createElement(FallbackToolUseRejectedMessage, null);
|
|
18054
18103
|
}
|
|
18055
18104
|
|
|
18056
18105
|
// src/ui/components/messages/user-tool-result-message/UserToolSuccessMessage.tsx
|
|
18057
|
-
import { Box as
|
|
18058
|
-
import * as
|
|
18106
|
+
import { Box as Box41 } from "ink";
|
|
18107
|
+
import * as React58 from "react";
|
|
18059
18108
|
function UserToolSuccessMessage({
|
|
18060
18109
|
param,
|
|
18061
18110
|
message,
|
|
@@ -18065,7 +18114,7 @@ function UserToolSuccessMessage({
|
|
|
18065
18114
|
width
|
|
18066
18115
|
}) {
|
|
18067
18116
|
const { tool } = useGetToolFromMessages(param.tool_use_id, tools, messages);
|
|
18068
|
-
return /* @__PURE__ */
|
|
18117
|
+
return /* @__PURE__ */ React58.createElement(Box41, { flexDirection: "column", width }, tool.renderToolResultMessage?.(message.toolUseResult.data, {
|
|
18069
18118
|
verbose
|
|
18070
18119
|
}));
|
|
18071
18120
|
}
|
|
@@ -18081,10 +18130,10 @@ function UserToolResultMessage({
|
|
|
18081
18130
|
}) {
|
|
18082
18131
|
const content = typeof param.content === "string" ? param.content : null;
|
|
18083
18132
|
if (content === CANCEL_MESSAGE) {
|
|
18084
|
-
return /* @__PURE__ */
|
|
18133
|
+
return /* @__PURE__ */ React59.createElement(UserToolCanceledMessage, null);
|
|
18085
18134
|
}
|
|
18086
18135
|
if (content === REJECT_MESSAGE || param.is_error === true && typeof content === "string" && content.startsWith(REJECT_MESSAGE_WITH_FEEDBACK_PREFIX)) {
|
|
18087
|
-
return /* @__PURE__ */
|
|
18136
|
+
return /* @__PURE__ */ React59.createElement(
|
|
18088
18137
|
UserToolRejectMessage,
|
|
18089
18138
|
{
|
|
18090
18139
|
toolUseID: param.tool_use_id,
|
|
@@ -18095,9 +18144,9 @@ function UserToolResultMessage({
|
|
|
18095
18144
|
);
|
|
18096
18145
|
}
|
|
18097
18146
|
if (param.is_error) {
|
|
18098
|
-
return /* @__PURE__ */
|
|
18147
|
+
return /* @__PURE__ */ React59.createElement(UserToolErrorMessage, { param, verbose });
|
|
18099
18148
|
}
|
|
18100
|
-
return /* @__PURE__ */
|
|
18149
|
+
return /* @__PURE__ */ React59.createElement(
|
|
18101
18150
|
UserToolSuccessMessage,
|
|
18102
18151
|
{
|
|
18103
18152
|
param,
|
|
@@ -18111,12 +18160,12 @@ function UserToolResultMessage({
|
|
|
18111
18160
|
}
|
|
18112
18161
|
|
|
18113
18162
|
// src/ui/components/messages/AssistantToolUseMessage.tsx
|
|
18114
|
-
import { Box as
|
|
18115
|
-
import
|
|
18163
|
+
import { Box as Box43, Text as Text49 } from "ink";
|
|
18164
|
+
import React62 from "react";
|
|
18116
18165
|
|
|
18117
18166
|
// src/ui/components/ToolUseLoader.tsx
|
|
18118
|
-
import { Box as
|
|
18119
|
-
import
|
|
18167
|
+
import { Box as Box42, Text as Text47 } from "ink";
|
|
18168
|
+
import React60 from "react";
|
|
18120
18169
|
|
|
18121
18170
|
// src/ui/hooks/useInterval.ts
|
|
18122
18171
|
import { useEffect as useEffect13, useRef as useRef8 } from "react";
|
|
@@ -18143,7 +18192,7 @@ function ToolUseLoader({
|
|
|
18143
18192
|
isUnresolved,
|
|
18144
18193
|
shouldAnimate
|
|
18145
18194
|
}) {
|
|
18146
|
-
const [isVisible, setIsVisible] =
|
|
18195
|
+
const [isVisible, setIsVisible] = React60.useState(true);
|
|
18147
18196
|
useInterval(() => {
|
|
18148
18197
|
if (!shouldAnimate) {
|
|
18149
18198
|
return;
|
|
@@ -18151,12 +18200,12 @@ function ToolUseLoader({
|
|
|
18151
18200
|
setIsVisible((_) => !_);
|
|
18152
18201
|
}, 600);
|
|
18153
18202
|
const color = isUnresolved ? getTheme().secondaryText : isError ? getTheme().error : getTheme().success;
|
|
18154
|
-
return /* @__PURE__ */
|
|
18203
|
+
return /* @__PURE__ */ React60.createElement(Box42, { minWidth: 2 }, /* @__PURE__ */ React60.createElement(Text47, { color }, isVisible ? BLACK_CIRCLE : " "));
|
|
18155
18204
|
}
|
|
18156
18205
|
|
|
18157
18206
|
// src/ui/components/messages/TaskToolMessage.tsx
|
|
18158
|
-
import
|
|
18159
|
-
import { Text as
|
|
18207
|
+
import React61, { useEffect as useEffect14, useState as useState18, useMemo as useMemo11 } from "react";
|
|
18208
|
+
import { Text as Text48 } from "ink";
|
|
18160
18209
|
var agentConfigCache = /* @__PURE__ */ new Map();
|
|
18161
18210
|
function TaskToolMessage({ agentType, children, bold = true }) {
|
|
18162
18211
|
const theme = getTheme();
|
|
@@ -18186,7 +18235,7 @@ function TaskToolMessage({ agentType, children, bold = true }) {
|
|
|
18186
18235
|
const color = useMemo11(() => {
|
|
18187
18236
|
return agentConfig?.color || theme.text;
|
|
18188
18237
|
}, [agentConfig?.color, theme.text]);
|
|
18189
|
-
return /* @__PURE__ */
|
|
18238
|
+
return /* @__PURE__ */ React61.createElement(Text48, { color, bold }, children);
|
|
18190
18239
|
}
|
|
18191
18240
|
|
|
18192
18241
|
// src/utils/tooling/toolNameAliases.ts
|
|
@@ -18230,25 +18279,25 @@ function AssistantToolUseMessage({
|
|
|
18230
18279
|
const hasToolName = userFacingToolName.trim().length > 0;
|
|
18231
18280
|
const hasInputObject = param.input && typeof param.input === "object" && Object.keys(param.input).length > 0;
|
|
18232
18281
|
const toolMessage = hasInputObject ? tool.renderToolUseMessage(param.input, { verbose }) : null;
|
|
18233
|
-
const hasToolMessage =
|
|
18282
|
+
const hasToolMessage = React62.isValidElement(toolMessage) || typeof toolMessage === "string" && toolMessage.trim().length > 0;
|
|
18234
18283
|
if (!hasToolName && !hasToolMessage) {
|
|
18235
18284
|
return null;
|
|
18236
18285
|
}
|
|
18237
|
-
return /* @__PURE__ */
|
|
18238
|
-
|
|
18286
|
+
return /* @__PURE__ */ React62.createElement(
|
|
18287
|
+
Box43,
|
|
18239
18288
|
{
|
|
18240
18289
|
flexDirection: "row",
|
|
18241
18290
|
justifyContent: "space-between",
|
|
18242
18291
|
marginTop: addMargin ? 1 : 0,
|
|
18243
18292
|
width: "100%"
|
|
18244
18293
|
},
|
|
18245
|
-
/* @__PURE__ */
|
|
18246
|
-
|
|
18294
|
+
/* @__PURE__ */ React62.createElement(Box43, null, /* @__PURE__ */ React62.createElement(
|
|
18295
|
+
Box43,
|
|
18247
18296
|
{
|
|
18248
18297
|
flexWrap: "nowrap",
|
|
18249
18298
|
minWidth: userFacingToolName.length + (shouldShowDot ? 2 : 0)
|
|
18250
18299
|
},
|
|
18251
|
-
shouldShowDot && (isQueued ? /* @__PURE__ */
|
|
18300
|
+
shouldShowDot && (isQueued ? /* @__PURE__ */ React62.createElement(Box43, { minWidth: 2 }, /* @__PURE__ */ React62.createElement(Text49, { color }, BLACK_CIRCLE)) : /* @__PURE__ */ React62.createElement(
|
|
18252
18301
|
ToolUseLoader,
|
|
18253
18302
|
{
|
|
18254
18303
|
shouldAnimate,
|
|
@@ -18256,7 +18305,7 @@ function AssistantToolUseMessage({
|
|
|
18256
18305
|
isError: erroredToolUseIDs.has(param.id)
|
|
18257
18306
|
}
|
|
18258
18307
|
)),
|
|
18259
|
-
tool.name === "Task" && param.input ? /* @__PURE__ */
|
|
18308
|
+
tool.name === "Task" && param.input ? /* @__PURE__ */ React62.createElement(
|
|
18260
18309
|
TaskToolMessage,
|
|
18261
18310
|
{
|
|
18262
18311
|
agentType: parsedInput.success ? String(
|
|
@@ -18265,27 +18314,27 @@ function AssistantToolUseMessage({
|
|
|
18265
18314
|
bold: Boolean(!isQueued),
|
|
18266
18315
|
children: String(userFacingToolName || "")
|
|
18267
18316
|
}
|
|
18268
|
-
) : hasToolName && /* @__PURE__ */
|
|
18269
|
-
), /* @__PURE__ */
|
|
18270
|
-
if (
|
|
18317
|
+
) : hasToolName && /* @__PURE__ */ React62.createElement(Text49, { color, bold: !isQueued }, userFacingToolName)
|
|
18318
|
+
), /* @__PURE__ */ React62.createElement(Box43, { flexWrap: "nowrap" }, hasToolMessage && (() => {
|
|
18319
|
+
if (React62.isValidElement(toolMessage)) {
|
|
18271
18320
|
if (!hasToolName) return toolMessage;
|
|
18272
|
-
return /* @__PURE__ */
|
|
18321
|
+
return /* @__PURE__ */ React62.createElement(Box43, { flexDirection: "row" }, /* @__PURE__ */ React62.createElement(Text49, { color }, "("), toolMessage, /* @__PURE__ */ React62.createElement(Text49, { color }, ")"));
|
|
18273
18322
|
}
|
|
18274
18323
|
if (typeof toolMessage !== "string") return null;
|
|
18275
18324
|
if (!hasToolName) {
|
|
18276
|
-
return /* @__PURE__ */
|
|
18325
|
+
return /* @__PURE__ */ React62.createElement(Text49, { color }, toolMessage);
|
|
18277
18326
|
}
|
|
18278
|
-
return /* @__PURE__ */
|
|
18279
|
-
})(), /* @__PURE__ */
|
|
18280
|
-
/* @__PURE__ */
|
|
18327
|
+
return /* @__PURE__ */ React62.createElement(Text49, { color }, "(", toolMessage, ")");
|
|
18328
|
+
})(), /* @__PURE__ */ React62.createElement(Text49, { color }, "\u2026"))),
|
|
18329
|
+
/* @__PURE__ */ React62.createElement(Cost, { costUSD, durationMs, debug: debug2 })
|
|
18281
18330
|
);
|
|
18282
18331
|
}
|
|
18283
18332
|
|
|
18284
18333
|
// src/ui/components/messages/AssistantTextMessage.tsx
|
|
18285
|
-
import
|
|
18334
|
+
import React65 from "react";
|
|
18286
18335
|
|
|
18287
18336
|
// src/ui/components/messages/AssistantBashOutputMessage.tsx
|
|
18288
|
-
import * as
|
|
18337
|
+
import * as React63 from "react";
|
|
18289
18338
|
function AssistantBashOutputMessage({
|
|
18290
18339
|
content,
|
|
18291
18340
|
verbose
|
|
@@ -18294,7 +18343,7 @@ function AssistantBashOutputMessage({
|
|
|
18294
18343
|
const stderr = extractTag(content, "bash-stderr") ?? "";
|
|
18295
18344
|
const stdoutLines = stdout.split("\n").length;
|
|
18296
18345
|
const stderrLines = stderr.split("\n").length;
|
|
18297
|
-
return /* @__PURE__ */
|
|
18346
|
+
return /* @__PURE__ */ React63.createElement(
|
|
18298
18347
|
BashToolResultMessage_default,
|
|
18299
18348
|
{
|
|
18300
18349
|
content: { stdout, stdoutLines, stderr, stderrLines },
|
|
@@ -18304,8 +18353,8 @@ function AssistantBashOutputMessage({
|
|
|
18304
18353
|
}
|
|
18305
18354
|
|
|
18306
18355
|
// src/ui/components/messages/AssistantLocalCommandOutputMessage.tsx
|
|
18307
|
-
import * as
|
|
18308
|
-
import { Box as
|
|
18356
|
+
import * as React64 from "react";
|
|
18357
|
+
import { Box as Box44, Text as Text50 } from "ink";
|
|
18309
18358
|
function AssistantLocalCommandOutputMessage({
|
|
18310
18359
|
content
|
|
18311
18360
|
}) {
|
|
@@ -18321,22 +18370,22 @@ function AssistantLocalCommandOutputMessage({
|
|
|
18321
18370
|
].filter(Boolean);
|
|
18322
18371
|
if (insides.length === 0) {
|
|
18323
18372
|
insides = [
|
|
18324
|
-
/* @__PURE__ */
|
|
18373
|
+
/* @__PURE__ */ React64.createElement(React64.Fragment, { key: "0" }, /* @__PURE__ */ React64.createElement(Text50, null, "(No output)"))
|
|
18325
18374
|
];
|
|
18326
18375
|
}
|
|
18327
18376
|
return [
|
|
18328
|
-
/* @__PURE__ */
|
|
18377
|
+
/* @__PURE__ */ React64.createElement(Box44, { key: "0", gap: 1 }, /* @__PURE__ */ React64.createElement(Box44, null, /* @__PURE__ */ React64.createElement(Text50, { color: theme.secondaryText }, " ", "\u23BF ")), insides.map((_, index) => /* @__PURE__ */ React64.createElement(Box44, { key: index, flexDirection: "column" }, _)))
|
|
18329
18378
|
];
|
|
18330
18379
|
}
|
|
18331
18380
|
function format(content, color) {
|
|
18332
18381
|
if (!content) {
|
|
18333
18382
|
return null;
|
|
18334
18383
|
}
|
|
18335
|
-
return /* @__PURE__ */
|
|
18384
|
+
return /* @__PURE__ */ React64.createElement(Text50, { color }, content);
|
|
18336
18385
|
}
|
|
18337
18386
|
|
|
18338
18387
|
// src/ui/components/messages/AssistantTextMessage.tsx
|
|
18339
|
-
import { Box as
|
|
18388
|
+
import { Box as Box45, Text as Text51 } from "ink";
|
|
18340
18389
|
|
|
18341
18390
|
// src/utils/text/markdown.ts
|
|
18342
18391
|
import { marked } from "marked";
|
|
@@ -18536,7 +18585,7 @@ function AssistantTextMessage({
|
|
|
18536
18585
|
if (text.startsWith("<tool-progress>")) {
|
|
18537
18586
|
const raw = extractTag(text, "tool-progress") ?? "";
|
|
18538
18587
|
if (raw.trim().length === 0) return null;
|
|
18539
|
-
return /* @__PURE__ */
|
|
18588
|
+
return /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().secondaryText }, raw);
|
|
18540
18589
|
}
|
|
18541
18590
|
if (text.startsWith("<bash-notification>")) {
|
|
18542
18591
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18544,7 +18593,7 @@ function AssistantTextMessage({
|
|
|
18544
18593
|
if (!summary) return null;
|
|
18545
18594
|
const theme = getTheme();
|
|
18546
18595
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18547
|
-
return /* @__PURE__ */
|
|
18596
|
+
return /* @__PURE__ */ React65.createElement(Box45, null, /* @__PURE__ */ React65.createElement(Text51, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React65.createElement(Text51, null, summary));
|
|
18548
18597
|
}
|
|
18549
18598
|
if (text.startsWith("<agent-notification>")) {
|
|
18550
18599
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18552,7 +18601,7 @@ function AssistantTextMessage({
|
|
|
18552
18601
|
if (!summary) return null;
|
|
18553
18602
|
const theme = getTheme();
|
|
18554
18603
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18555
|
-
return /* @__PURE__ */
|
|
18604
|
+
return /* @__PURE__ */ React65.createElement(Box45, null, /* @__PURE__ */ React65.createElement(Text51, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React65.createElement(Text51, null, summary));
|
|
18556
18605
|
}
|
|
18557
18606
|
if (text.startsWith("<task-notification>")) {
|
|
18558
18607
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18560,16 +18609,16 @@ function AssistantTextMessage({
|
|
|
18560
18609
|
if (!summary) return null;
|
|
18561
18610
|
const theme = getTheme();
|
|
18562
18611
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18563
|
-
return /* @__PURE__ */
|
|
18612
|
+
return /* @__PURE__ */ React65.createElement(Box45, null, /* @__PURE__ */ React65.createElement(Text51, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React65.createElement(Text51, null, summary));
|
|
18564
18613
|
}
|
|
18565
18614
|
if (text.startsWith("<bash-stdout") || text.startsWith("<bash-stderr")) {
|
|
18566
|
-
return /* @__PURE__ */
|
|
18615
|
+
return /* @__PURE__ */ React65.createElement(AssistantBashOutputMessage, { content: text, verbose });
|
|
18567
18616
|
}
|
|
18568
18617
|
if (text.startsWith("<local-command-stdout") || text.startsWith("<local-command-stderr")) {
|
|
18569
|
-
return /* @__PURE__ */
|
|
18618
|
+
return /* @__PURE__ */ React65.createElement(AssistantLocalCommandOutputMessage, { content: text });
|
|
18570
18619
|
}
|
|
18571
18620
|
if (text.startsWith(API_ERROR_MESSAGE_PREFIX)) {
|
|
18572
|
-
return /* @__PURE__ */
|
|
18621
|
+
return /* @__PURE__ */ React65.createElement(Text51, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().error }, text === API_ERROR_MESSAGE_PREFIX ? `${API_ERROR_MESSAGE_PREFIX}: Please wait a moment and try again.` : text));
|
|
18573
18622
|
}
|
|
18574
18623
|
switch (text) {
|
|
18575
18624
|
case NO_RESPONSE_REQUESTED:
|
|
@@ -18577,16 +18626,16 @@ function AssistantTextMessage({
|
|
|
18577
18626
|
return null;
|
|
18578
18627
|
case INTERRUPT_MESSAGE:
|
|
18579
18628
|
case CANCEL_MESSAGE:
|
|
18580
|
-
return /* @__PURE__ */
|
|
18629
|
+
return /* @__PURE__ */ React65.createElement(Text51, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().error }, "Interrupted by user"));
|
|
18581
18630
|
case PROMPT_TOO_LONG_ERROR_MESSAGE:
|
|
18582
|
-
return /* @__PURE__ */
|
|
18631
|
+
return /* @__PURE__ */ React65.createElement(Text51, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().error }, "Context low \xB7 Run /compact to compact & continue"));
|
|
18583
18632
|
case CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE:
|
|
18584
|
-
return /* @__PURE__ */
|
|
18633
|
+
return /* @__PURE__ */ React65.createElement(Text51, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().error }, "Credit balance too low \xB7 Add funds in your provider billing settings"));
|
|
18585
18634
|
case INVALID_API_KEY_ERROR_MESSAGE:
|
|
18586
|
-
return /* @__PURE__ */
|
|
18635
|
+
return /* @__PURE__ */ React65.createElement(Text51, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().error }, INVALID_API_KEY_ERROR_MESSAGE));
|
|
18587
18636
|
default:
|
|
18588
|
-
return /* @__PURE__ */
|
|
18589
|
-
|
|
18637
|
+
return /* @__PURE__ */ React65.createElement(
|
|
18638
|
+
Box45,
|
|
18590
18639
|
{
|
|
18591
18640
|
alignItems: "flex-start",
|
|
18592
18641
|
flexDirection: "row",
|
|
@@ -18594,15 +18643,15 @@ function AssistantTextMessage({
|
|
|
18594
18643
|
marginTop: addMargin ? 1 : 0,
|
|
18595
18644
|
width: "100%"
|
|
18596
18645
|
},
|
|
18597
|
-
/* @__PURE__ */
|
|
18598
|
-
/* @__PURE__ */
|
|
18646
|
+
/* @__PURE__ */ React65.createElement(Box45, { flexDirection: "row" }, shouldShowDot && /* @__PURE__ */ React65.createElement(Box45, { minWidth: 2 }, /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().text }, BLACK_CIRCLE)), /* @__PURE__ */ React65.createElement(Box45, { flexDirection: "column", width: columns - 6 }, /* @__PURE__ */ React65.createElement(Text51, null, applyMarkdown(text)))),
|
|
18647
|
+
/* @__PURE__ */ React65.createElement(Cost, { costUSD, durationMs, debug: debug2 })
|
|
18599
18648
|
);
|
|
18600
18649
|
}
|
|
18601
18650
|
}
|
|
18602
18651
|
|
|
18603
18652
|
// src/ui/components/messages/UserBashInputMessage.tsx
|
|
18604
|
-
import { Box as
|
|
18605
|
-
import * as
|
|
18653
|
+
import { Box as Box46, Text as Text52 } from "ink";
|
|
18654
|
+
import * as React66 from "react";
|
|
18606
18655
|
function UserBashInputMessage({
|
|
18607
18656
|
param: { text },
|
|
18608
18657
|
addMargin
|
|
@@ -18611,12 +18660,12 @@ function UserBashInputMessage({
|
|
|
18611
18660
|
if (!input) {
|
|
18612
18661
|
return null;
|
|
18613
18662
|
}
|
|
18614
|
-
return /* @__PURE__ */
|
|
18663
|
+
return /* @__PURE__ */ React66.createElement(Box46, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React66.createElement(Box46, null, /* @__PURE__ */ React66.createElement(Text52, { color: getTheme().bashBorder }, "!"), /* @__PURE__ */ React66.createElement(Text52, { color: getTheme().secondaryText }, " ", input)));
|
|
18615
18664
|
}
|
|
18616
18665
|
|
|
18617
18666
|
// src/ui/components/messages/UserPybInputMessage.tsx
|
|
18618
|
-
import { Box as
|
|
18619
|
-
import * as
|
|
18667
|
+
import { Box as Box47, Text as Text53 } from "ink";
|
|
18668
|
+
import * as React67 from "react";
|
|
18620
18669
|
function UserPybInputMessage({
|
|
18621
18670
|
param: { text },
|
|
18622
18671
|
addMargin
|
|
@@ -18625,12 +18674,12 @@ function UserPybInputMessage({
|
|
|
18625
18674
|
if (!input) {
|
|
18626
18675
|
return null;
|
|
18627
18676
|
}
|
|
18628
|
-
return /* @__PURE__ */
|
|
18677
|
+
return /* @__PURE__ */ React67.createElement(Box47, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React67.createElement(Box47, null, /* @__PURE__ */ React67.createElement(Text53, { color: getTheme().noting }, "#"), /* @__PURE__ */ React67.createElement(Text53, { color: getTheme().secondaryText }, " ", input)));
|
|
18629
18678
|
}
|
|
18630
18679
|
|
|
18631
18680
|
// src/ui/components/messages/UserCommandMessage.tsx
|
|
18632
|
-
import { Box as
|
|
18633
|
-
import * as
|
|
18681
|
+
import { Box as Box48, Text as Text54 } from "ink";
|
|
18682
|
+
import * as React68 from "react";
|
|
18634
18683
|
function UserCommandMessage({
|
|
18635
18684
|
addMargin,
|
|
18636
18685
|
param: { text }
|
|
@@ -18641,12 +18690,12 @@ function UserCommandMessage({
|
|
|
18641
18690
|
return null;
|
|
18642
18691
|
}
|
|
18643
18692
|
const theme = getTheme();
|
|
18644
|
-
return /* @__PURE__ */
|
|
18693
|
+
return /* @__PURE__ */ React68.createElement(Box48, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React68.createElement(Text54, { color: theme.secondaryText }, "> /", commandName, " ", args));
|
|
18645
18694
|
}
|
|
18646
18695
|
|
|
18647
18696
|
// src/ui/components/messages/UserPromptMessage.tsx
|
|
18648
|
-
import
|
|
18649
|
-
import { Box as
|
|
18697
|
+
import React69 from "react";
|
|
18698
|
+
import { Box as Box49, Text as Text55 } from "ink";
|
|
18650
18699
|
function UserPromptMessage({
|
|
18651
18700
|
addMargin,
|
|
18652
18701
|
param: { text }
|
|
@@ -18656,30 +18705,30 @@ function UserPromptMessage({
|
|
|
18656
18705
|
logError("No content found in user prompt message");
|
|
18657
18706
|
return null;
|
|
18658
18707
|
}
|
|
18659
|
-
return /* @__PURE__ */
|
|
18708
|
+
return /* @__PURE__ */ React69.createElement(Box49, { flexDirection: "row", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React69.createElement(Box49, { minWidth: 2, width: 2 }, /* @__PURE__ */ React69.createElement(Text55, { color: getTheme().secondaryText }, ">")), /* @__PURE__ */ React69.createElement(Box49, { flexDirection: "column", width: columns - 4 }, /* @__PURE__ */ React69.createElement(Text55, { color: getTheme().secondaryText, wrap: "wrap" }, text)));
|
|
18660
18709
|
}
|
|
18661
18710
|
|
|
18662
18711
|
// src/ui/components/messages/UserTextMessage.tsx
|
|
18663
|
-
import * as
|
|
18712
|
+
import * as React70 from "react";
|
|
18664
18713
|
function UserTextMessage({ addMargin, param }) {
|
|
18665
18714
|
if (param.text.trim() === NO_CONTENT_MESSAGE) {
|
|
18666
18715
|
return null;
|
|
18667
18716
|
}
|
|
18668
18717
|
if (param.text.includes("<pyb-input>")) {
|
|
18669
|
-
return /* @__PURE__ */
|
|
18718
|
+
return /* @__PURE__ */ React70.createElement(UserPybInputMessage, { addMargin, param });
|
|
18670
18719
|
}
|
|
18671
18720
|
if (param.text.includes("<bash-input>")) {
|
|
18672
|
-
return /* @__PURE__ */
|
|
18721
|
+
return /* @__PURE__ */ React70.createElement(UserBashInputMessage, { addMargin, param });
|
|
18673
18722
|
}
|
|
18674
18723
|
if (param.text.includes("<command-name>") || param.text.includes("<command-message>")) {
|
|
18675
|
-
return /* @__PURE__ */
|
|
18724
|
+
return /* @__PURE__ */ React70.createElement(UserCommandMessage, { addMargin, param });
|
|
18676
18725
|
}
|
|
18677
|
-
return /* @__PURE__ */
|
|
18726
|
+
return /* @__PURE__ */ React70.createElement(UserPromptMessage, { addMargin, param });
|
|
18678
18727
|
}
|
|
18679
18728
|
|
|
18680
18729
|
// src/ui/components/messages/UserImageMessage.tsx
|
|
18681
|
-
import
|
|
18682
|
-
import { Box as
|
|
18730
|
+
import React71 from "react";
|
|
18731
|
+
import { Box as Box50, Text as Text56 } from "ink";
|
|
18683
18732
|
function formatBytes2(bytes) {
|
|
18684
18733
|
if (!Number.isFinite(bytes) || bytes <= 0) return "";
|
|
18685
18734
|
const units = ["B", "KB", "MB", "GB"];
|
|
@@ -18698,12 +18747,12 @@ function UserImageMessage({ addMargin, param }) {
|
|
|
18698
18747
|
const approxBytes = param.source && typeof param.source === "object" && param.source.type === "base64" && typeof param.source.data === "string" ? Math.floor(param.source.data.length * 3 / 4) : 0;
|
|
18699
18748
|
const sizeLabel = formatBytes2(approxBytes);
|
|
18700
18749
|
const details = [mediaType, sizeLabel].filter(Boolean).join(" \xB7 ");
|
|
18701
|
-
return /* @__PURE__ */
|
|
18750
|
+
return /* @__PURE__ */ React71.createElement(Box50, { flexDirection: "row", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React71.createElement(Box50, { minWidth: 2, width: 2 }, /* @__PURE__ */ React71.createElement(Text56, { color: theme.secondaryText }, ">")), /* @__PURE__ */ React71.createElement(Text56, { color: theme.secondaryText }, "[Image]", details ? ` ${details}` : ""));
|
|
18702
18751
|
}
|
|
18703
18752
|
|
|
18704
18753
|
// src/ui/components/messages/AssistantThinkingMessage.tsx
|
|
18705
|
-
import
|
|
18706
|
-
import { Box as
|
|
18754
|
+
import React72 from "react";
|
|
18755
|
+
import { Box as Box51, Text as Text57 } from "ink";
|
|
18707
18756
|
function AssistantThinkingMessage({
|
|
18708
18757
|
param: { thinking },
|
|
18709
18758
|
addMargin = false
|
|
@@ -18711,26 +18760,26 @@ function AssistantThinkingMessage({
|
|
|
18711
18760
|
if (!thinking || thinking.trim().length === 0) {
|
|
18712
18761
|
return null;
|
|
18713
18762
|
}
|
|
18714
|
-
return /* @__PURE__ */
|
|
18715
|
-
|
|
18763
|
+
return /* @__PURE__ */ React72.createElement(
|
|
18764
|
+
Box51,
|
|
18716
18765
|
{
|
|
18717
18766
|
flexDirection: "column",
|
|
18718
18767
|
gap: 1,
|
|
18719
18768
|
marginTop: addMargin ? 1 : 0,
|
|
18720
18769
|
width: "100%"
|
|
18721
18770
|
},
|
|
18722
|
-
/* @__PURE__ */
|
|
18723
|
-
/* @__PURE__ */
|
|
18771
|
+
/* @__PURE__ */ React72.createElement(Text57, { color: getTheme().secondaryText, italic: true }, "\u273B Thinking\u2026"),
|
|
18772
|
+
/* @__PURE__ */ React72.createElement(Box51, { paddingLeft: 2 }, /* @__PURE__ */ React72.createElement(Text57, { color: getTheme().secondaryText, italic: true }, applyMarkdown(thinking)))
|
|
18724
18773
|
);
|
|
18725
18774
|
}
|
|
18726
18775
|
|
|
18727
18776
|
// src/ui/components/messages/AssistantRedactedThinkingMessage.tsx
|
|
18728
|
-
import
|
|
18729
|
-
import { Box as
|
|
18777
|
+
import React73 from "react";
|
|
18778
|
+
import { Box as Box52, Text as Text58 } from "ink";
|
|
18730
18779
|
function AssistantRedactedThinkingMessage({
|
|
18731
18780
|
addMargin = false
|
|
18732
18781
|
}) {
|
|
18733
|
-
return /* @__PURE__ */
|
|
18782
|
+
return /* @__PURE__ */ React73.createElement(Box52, { marginTop: addMargin ? 1 : 0 }, /* @__PURE__ */ React73.createElement(Text58, { color: getTheme().secondaryText, italic: true }, "\u273B Thinking\u2026"));
|
|
18734
18783
|
}
|
|
18735
18784
|
|
|
18736
18785
|
// src/ui/components/Message.tsx
|
|
@@ -18749,7 +18798,7 @@ function Message({
|
|
|
18749
18798
|
width
|
|
18750
18799
|
}) {
|
|
18751
18800
|
if (message.type === "assistant") {
|
|
18752
|
-
return /* @__PURE__ */
|
|
18801
|
+
return /* @__PURE__ */ React74.createElement(Box53, { flexDirection: "column", width: "100%" }, message.message.content.map((_, index) => /* @__PURE__ */ React74.createElement(
|
|
18753
18802
|
AssistantMessage,
|
|
18754
18803
|
{
|
|
18755
18804
|
key: index,
|
|
@@ -18770,7 +18819,7 @@ function Message({
|
|
|
18770
18819
|
)));
|
|
18771
18820
|
}
|
|
18772
18821
|
const content = typeof message.message.content === "string" ? [{ type: "text", text: message.message.content }] : message.message.content;
|
|
18773
|
-
return /* @__PURE__ */
|
|
18822
|
+
return /* @__PURE__ */ React74.createElement(Box53, { flexDirection: "column", width: "100%" }, content.map((_, index) => /* @__PURE__ */ React74.createElement(
|
|
18774
18823
|
UserMessage,
|
|
18775
18824
|
{
|
|
18776
18825
|
key: index,
|
|
@@ -18794,11 +18843,11 @@ function UserMessage({
|
|
|
18794
18843
|
const { columns } = useTerminalSize();
|
|
18795
18844
|
switch (param.type) {
|
|
18796
18845
|
case "text":
|
|
18797
|
-
return /* @__PURE__ */
|
|
18846
|
+
return /* @__PURE__ */ React74.createElement(UserTextMessage, { addMargin, param });
|
|
18798
18847
|
case "image":
|
|
18799
|
-
return /* @__PURE__ */
|
|
18848
|
+
return /* @__PURE__ */ React74.createElement(UserImageMessage, { addMargin, param });
|
|
18800
18849
|
case "tool_result":
|
|
18801
|
-
return /* @__PURE__ */
|
|
18850
|
+
return /* @__PURE__ */ React74.createElement(
|
|
18802
18851
|
UserToolResultMessage,
|
|
18803
18852
|
{
|
|
18804
18853
|
param,
|
|
@@ -18830,7 +18879,7 @@ function AssistantMessage({
|
|
|
18830
18879
|
case "tool_use":
|
|
18831
18880
|
case "server_tool_use":
|
|
18832
18881
|
case "mcp_tool_use":
|
|
18833
|
-
return /* @__PURE__ */
|
|
18882
|
+
return /* @__PURE__ */ React74.createElement(
|
|
18834
18883
|
AssistantToolUseMessage,
|
|
18835
18884
|
{
|
|
18836
18885
|
param,
|
|
@@ -18848,7 +18897,7 @@ function AssistantMessage({
|
|
|
18848
18897
|
}
|
|
18849
18898
|
);
|
|
18850
18899
|
case "text":
|
|
18851
|
-
return /* @__PURE__ */
|
|
18900
|
+
return /* @__PURE__ */ React74.createElement(
|
|
18852
18901
|
AssistantTextMessage,
|
|
18853
18902
|
{
|
|
18854
18903
|
param,
|
|
@@ -18862,9 +18911,9 @@ function AssistantMessage({
|
|
|
18862
18911
|
}
|
|
18863
18912
|
);
|
|
18864
18913
|
case "redacted_thinking":
|
|
18865
|
-
return /* @__PURE__ */
|
|
18914
|
+
return /* @__PURE__ */ React74.createElement(AssistantRedactedThinkingMessage, { addMargin });
|
|
18866
18915
|
case "thinking":
|
|
18867
|
-
return /* @__PURE__ */
|
|
18916
|
+
return /* @__PURE__ */ React74.createElement(AssistantThinkingMessage, { addMargin, param });
|
|
18868
18917
|
default:
|
|
18869
18918
|
logError(`Unable to render message type: ${param.type}`);
|
|
18870
18919
|
return null;
|
|
@@ -18872,15 +18921,15 @@ function AssistantMessage({
|
|
|
18872
18921
|
}
|
|
18873
18922
|
|
|
18874
18923
|
// src/ui/components/MessageResponse.tsx
|
|
18875
|
-
import { Box as
|
|
18876
|
-
import * as
|
|
18924
|
+
import { Box as Box54, Text as Text59 } from "ink";
|
|
18925
|
+
import * as React75 from "react";
|
|
18877
18926
|
function MessageResponse({ children }) {
|
|
18878
|
-
return /* @__PURE__ */
|
|
18927
|
+
return /* @__PURE__ */ React75.createElement(Box54, { flexDirection: "row" }, /* @__PURE__ */ React75.createElement(Text59, null, " ", "\u23BF \xA0"), /* @__PURE__ */ React75.createElement(Box54, { flexDirection: "column", flexGrow: 1 }, children));
|
|
18879
18928
|
}
|
|
18880
18929
|
|
|
18881
18930
|
// src/ui/components/MessageSelector.tsx
|
|
18882
|
-
import { Box as
|
|
18883
|
-
import * as
|
|
18931
|
+
import { Box as Box55, Text as Text60, useInput as useInput19 } from "ink";
|
|
18932
|
+
import * as React76 from "react";
|
|
18884
18933
|
import { useMemo as useMemo12, useState as useState19, useEffect as useEffect15 } from "react";
|
|
18885
18934
|
import figures7 from "figures";
|
|
18886
18935
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
@@ -18956,8 +19005,8 @@ function MessageSelector({
|
|
|
18956
19005
|
() => normalizeMessages(messages).filter(isNotEmptyMessage),
|
|
18957
19006
|
[messages]
|
|
18958
19007
|
);
|
|
18959
|
-
return /* @__PURE__ */
|
|
18960
|
-
|
|
19008
|
+
return /* @__PURE__ */ React76.createElement(React76.Fragment, null, /* @__PURE__ */ React76.createElement(
|
|
19009
|
+
Box55,
|
|
18961
19010
|
{
|
|
18962
19011
|
flexDirection: "column",
|
|
18963
19012
|
borderStyle: "round",
|
|
@@ -18966,12 +19015,12 @@ function MessageSelector({
|
|
|
18966
19015
|
paddingX: 1,
|
|
18967
19016
|
marginTop: 1
|
|
18968
19017
|
},
|
|
18969
|
-
/* @__PURE__ */
|
|
19018
|
+
/* @__PURE__ */ React76.createElement(Box55, { flexDirection: "column", minHeight: 2, marginBottom: 1 }, /* @__PURE__ */ React76.createElement(Text60, { bold: true }, "Jump to a previous message"), /* @__PURE__ */ React76.createElement(Text60, { dimColor: true }, "This will fork the conversation")),
|
|
18970
19019
|
allItems.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, index) => {
|
|
18971
19020
|
const actualIndex = firstVisibleIndex + index;
|
|
18972
19021
|
const isSelected = actualIndex === selectedIndex;
|
|
18973
19022
|
const isCurrent = msg.uuid === currentUUID;
|
|
18974
|
-
return /* @__PURE__ */
|
|
19023
|
+
return /* @__PURE__ */ React76.createElement(Box55, { key: msg.uuid, flexDirection: "row", height: 2, minHeight: 2 }, /* @__PURE__ */ React76.createElement(Box55, { width: 7 }, isSelected ? /* @__PURE__ */ React76.createElement(Text60, { color: "blue", bold: true }, figures7.pointer, " ", firstVisibleIndex + index + 1, " ") : /* @__PURE__ */ React76.createElement(Text60, null, " ", firstVisibleIndex + index + 1, " ")), /* @__PURE__ */ React76.createElement(Box55, { height: 1, overflow: "hidden", width: 100 }, isCurrent ? /* @__PURE__ */ React76.createElement(Box55, { width: "100%" }, /* @__PURE__ */ React76.createElement(Text60, { dimColor: true, italic: true }, "(current)")) : Array.isArray(msg.message.content) && msg.message.content[0]?.type === "text" && isEmptyMessageText(msg.message.content[0].text) ? /* @__PURE__ */ React76.createElement(Text60, { dimColor: true, italic: true }, "(empty message)") : /* @__PURE__ */ React76.createElement(
|
|
18975
19024
|
Message,
|
|
18976
19025
|
{
|
|
18977
19026
|
message: msg,
|
|
@@ -18988,18 +19037,18 @@ function MessageSelector({
|
|
|
18988
19037
|
}
|
|
18989
19038
|
)));
|
|
18990
19039
|
})
|
|
18991
|
-
), /* @__PURE__ */
|
|
19040
|
+
), /* @__PURE__ */ React76.createElement(Box55, { marginLeft: 3 }, /* @__PURE__ */ React76.createElement(Text60, { dimColor: true }, exitState.pending ? /* @__PURE__ */ React76.createElement(React76.Fragment, null, "Press ", exitState.keyName, " again to exit") : /* @__PURE__ */ React76.createElement(React76.Fragment, null, "\u2191/\u2193 to select \xB7 Enter to confirm \xB7 Tab/Esc to cancel"))));
|
|
18992
19041
|
}
|
|
18993
19042
|
|
|
18994
19043
|
// src/ui/components/permissions/PermissionRequest.tsx
|
|
18995
19044
|
import { useInput as useInput26 } from "ink";
|
|
18996
|
-
import * as
|
|
19045
|
+
import * as React94 from "react";
|
|
18997
19046
|
|
|
18998
19047
|
// src/ui/components/permissions/file-edit-permission-request/FileEditPermissionRequest.tsx
|
|
18999
19048
|
import chalk7 from "chalk";
|
|
19000
|
-
import { Box as
|
|
19049
|
+
import { Box as Box58, Text as Text63, useInput as useInput20 } from "ink";
|
|
19001
19050
|
import { basename, dirname as dirname5, extname as extname6 } from "path";
|
|
19002
|
-
import
|
|
19051
|
+
import React79, { useCallback as useCallback8, useMemo as useMemo14 } from "react";
|
|
19003
19052
|
|
|
19004
19053
|
// src/ui/hooks/usePermissionRequestLogging.ts
|
|
19005
19054
|
import { useEffect as useEffect16 } from "react";
|
|
@@ -19027,8 +19076,8 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) {
|
|
|
19027
19076
|
}
|
|
19028
19077
|
|
|
19029
19078
|
// src/ui/components/permissions/PermissionRequestTitle.tsx
|
|
19030
|
-
import * as
|
|
19031
|
-
import { Box as
|
|
19079
|
+
import * as React77 from "react";
|
|
19080
|
+
import { Box as Box56, Text as Text61 } from "ink";
|
|
19032
19081
|
function categoryForRiskScore(riskScore) {
|
|
19033
19082
|
return riskScore >= 70 ? "high" : riskScore >= 30 ? "moderate" : "low";
|
|
19034
19083
|
}
|
|
@@ -19063,20 +19112,20 @@ function PermissionRiskScore({
|
|
|
19063
19112
|
riskScore
|
|
19064
19113
|
}) {
|
|
19065
19114
|
const category = categoryForRiskScore(riskScore);
|
|
19066
|
-
return /* @__PURE__ */
|
|
19115
|
+
return /* @__PURE__ */ React77.createElement(Text61, { color: textColorForRiskScore(riskScore) }, "Risk: ", category);
|
|
19067
19116
|
}
|
|
19068
19117
|
function PermissionRequestTitle({
|
|
19069
19118
|
title,
|
|
19070
19119
|
riskScore
|
|
19071
19120
|
}) {
|
|
19072
|
-
return /* @__PURE__ */
|
|
19121
|
+
return /* @__PURE__ */ React77.createElement(Box56, { flexDirection: "column" }, /* @__PURE__ */ React77.createElement(Text61, { bold: true, color: getTheme().permission }, title), riskScore !== null && /* @__PURE__ */ React77.createElement(PermissionRiskScore, { riskScore }));
|
|
19073
19122
|
}
|
|
19074
19123
|
|
|
19075
19124
|
// src/ui/components/permissions/file-edit-permission-request/FileEditToolDiff.tsx
|
|
19076
|
-
import * as
|
|
19125
|
+
import * as React78 from "react";
|
|
19077
19126
|
import { existsSync as existsSync9, readFileSync as readFileSync6 } from "fs";
|
|
19078
19127
|
import { useMemo as useMemo13 } from "react";
|
|
19079
|
-
import { Box as
|
|
19128
|
+
import { Box as Box57, Text as Text62 } from "ink";
|
|
19080
19129
|
import { relative as relative10 } from "path";
|
|
19081
19130
|
function FileEditToolDiff({
|
|
19082
19131
|
file_path,
|
|
@@ -19099,17 +19148,17 @@ function FileEditToolDiff({
|
|
|
19099
19148
|
}),
|
|
19100
19149
|
[file_path, file, old_string, new_string]
|
|
19101
19150
|
);
|
|
19102
|
-
return /* @__PURE__ */
|
|
19103
|
-
|
|
19151
|
+
return /* @__PURE__ */ React78.createElement(Box57, { flexDirection: "column" }, /* @__PURE__ */ React78.createElement(
|
|
19152
|
+
Box57,
|
|
19104
19153
|
{
|
|
19105
19154
|
borderColor: getTheme().secondaryBorder,
|
|
19106
19155
|
borderStyle: useBorder ? "round" : void 0,
|
|
19107
19156
|
flexDirection: "column",
|
|
19108
19157
|
paddingX: 1
|
|
19109
19158
|
},
|
|
19110
|
-
/* @__PURE__ */
|
|
19159
|
+
/* @__PURE__ */ React78.createElement(Box57, { paddingBottom: 1 }, /* @__PURE__ */ React78.createElement(Text62, { bold: true }, verbose ? file_path : relative10(getCwd(), file_path))),
|
|
19111
19160
|
intersperse(
|
|
19112
|
-
patch.map((_) => /* @__PURE__ */
|
|
19161
|
+
patch.map((_) => /* @__PURE__ */ React78.createElement(
|
|
19113
19162
|
StructuredDiff,
|
|
19114
19163
|
{
|
|
19115
19164
|
key: _.newStart,
|
|
@@ -19118,7 +19167,7 @@ function FileEditToolDiff({
|
|
|
19118
19167
|
width
|
|
19119
19168
|
}
|
|
19120
19169
|
)),
|
|
19121
|
-
(i) => /* @__PURE__ */
|
|
19170
|
+
(i) => /* @__PURE__ */ React78.createElement(React78.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React78.createElement(Text62, { color: getTheme().secondaryText }, "..."))
|
|
19122
19171
|
)
|
|
19123
19172
|
));
|
|
19124
19173
|
}
|
|
@@ -19300,8 +19349,8 @@ function FileEditPermissionRequest({
|
|
|
19300
19349
|
handleChoice("yes-session");
|
|
19301
19350
|
return true;
|
|
19302
19351
|
});
|
|
19303
|
-
return /* @__PURE__ */
|
|
19304
|
-
|
|
19352
|
+
return /* @__PURE__ */ React79.createElement(
|
|
19353
|
+
Box58,
|
|
19305
19354
|
{
|
|
19306
19355
|
flexDirection: "column",
|
|
19307
19356
|
borderStyle: "round",
|
|
@@ -19311,14 +19360,14 @@ function FileEditPermissionRequest({
|
|
|
19311
19360
|
paddingRight: 1,
|
|
19312
19361
|
paddingBottom: 1
|
|
19313
19362
|
},
|
|
19314
|
-
/* @__PURE__ */
|
|
19363
|
+
/* @__PURE__ */ React79.createElement(
|
|
19315
19364
|
PermissionRequestTitle,
|
|
19316
19365
|
{
|
|
19317
19366
|
title: "Edit file",
|
|
19318
19367
|
riskScore: toolUseConfirm.riskScore
|
|
19319
19368
|
}
|
|
19320
19369
|
),
|
|
19321
|
-
/* @__PURE__ */
|
|
19370
|
+
/* @__PURE__ */ React79.createElement(
|
|
19322
19371
|
FileEditToolDiff,
|
|
19323
19372
|
{
|
|
19324
19373
|
file_path,
|
|
@@ -19328,7 +19377,7 @@ function FileEditPermissionRequest({
|
|
|
19328
19377
|
width: columns - 12
|
|
19329
19378
|
}
|
|
19330
19379
|
),
|
|
19331
|
-
/* @__PURE__ */
|
|
19380
|
+
/* @__PURE__ */ React79.createElement(Box58, { flexDirection: "column" }, /* @__PURE__ */ React79.createElement(Text63, null, "Do you want to make this edit to", " ", /* @__PURE__ */ React79.createElement(Text63, { bold: true }, basename(file_path)), "?"), /* @__PURE__ */ React79.createElement(
|
|
19332
19381
|
Select,
|
|
19333
19382
|
{
|
|
19334
19383
|
options: getOptions({
|
|
@@ -19352,8 +19401,8 @@ async function extractLanguageName(file_path) {
|
|
|
19352
19401
|
}
|
|
19353
19402
|
|
|
19354
19403
|
// src/ui/components/permissions/bash-permission-request/BashPermissionRequest.tsx
|
|
19355
|
-
import { Box as
|
|
19356
|
-
import
|
|
19404
|
+
import { Box as Box59, Text as Text64 } from "ink";
|
|
19405
|
+
import React80, { useMemo as useMemo15 } from "react";
|
|
19357
19406
|
|
|
19358
19407
|
// src/ui/components/permissions/hooks.ts
|
|
19359
19408
|
import { useEffect as useEffect17 } from "react";
|
|
@@ -19458,8 +19507,8 @@ function BashPermissionRequest({
|
|
|
19458
19507
|
[]
|
|
19459
19508
|
);
|
|
19460
19509
|
usePermissionRequestLogging2(toolUseConfirm, unaryEvent);
|
|
19461
|
-
return /* @__PURE__ */
|
|
19462
|
-
|
|
19510
|
+
return /* @__PURE__ */ React80.createElement(
|
|
19511
|
+
Box59,
|
|
19463
19512
|
{
|
|
19464
19513
|
flexDirection: "column",
|
|
19465
19514
|
borderStyle: "round",
|
|
@@ -19469,19 +19518,19 @@ function BashPermissionRequest({
|
|
|
19469
19518
|
paddingRight: 1,
|
|
19470
19519
|
paddingBottom: 1
|
|
19471
19520
|
},
|
|
19472
|
-
/* @__PURE__ */
|
|
19521
|
+
/* @__PURE__ */ React80.createElement(
|
|
19473
19522
|
PermissionRequestTitle,
|
|
19474
19523
|
{
|
|
19475
19524
|
title: "Bash command",
|
|
19476
19525
|
riskScore: toolUseConfirm.riskScore
|
|
19477
19526
|
}
|
|
19478
19527
|
),
|
|
19479
|
-
/* @__PURE__ */
|
|
19528
|
+
/* @__PURE__ */ React80.createElement(Box59, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React80.createElement(Text64, null, BashTool.renderToolUseMessage({
|
|
19480
19529
|
command: command4,
|
|
19481
19530
|
run_in_background,
|
|
19482
19531
|
description: description3
|
|
19483
|
-
})), /* @__PURE__ */
|
|
19484
|
-
/* @__PURE__ */
|
|
19532
|
+
})), /* @__PURE__ */ React80.createElement(Text64, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
19533
|
+
/* @__PURE__ */ React80.createElement(Box59, { flexDirection: "column" }, /* @__PURE__ */ React80.createElement(Text64, null, "Do you want to proceed?"), /* @__PURE__ */ React80.createElement(
|
|
19485
19534
|
Select,
|
|
19486
19535
|
{
|
|
19487
19536
|
options: toolUseOptions({ toolUseConfirm, command: command4 }),
|
|
@@ -19549,8 +19598,8 @@ function BashPermissionRequest({
|
|
|
19549
19598
|
}
|
|
19550
19599
|
|
|
19551
19600
|
// src/ui/components/permissions/FallbackPermissionRequest.tsx
|
|
19552
|
-
import { Box as
|
|
19553
|
-
import
|
|
19601
|
+
import { Box as Box60, Text as Text65 } from "ink";
|
|
19602
|
+
import React81, { useMemo as useMemo16 } from "react";
|
|
19554
19603
|
import chalk9 from "chalk";
|
|
19555
19604
|
function __getFallbackPermissionInputForTests(tool, input) {
|
|
19556
19605
|
return tool === WebSearchTool ? { query: "" } : input;
|
|
@@ -19571,8 +19620,8 @@ function FallbackPermissionRequest({
|
|
|
19571
19620
|
[]
|
|
19572
19621
|
);
|
|
19573
19622
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
19574
|
-
return /* @__PURE__ */
|
|
19575
|
-
|
|
19623
|
+
return /* @__PURE__ */ React81.createElement(
|
|
19624
|
+
Box60,
|
|
19576
19625
|
{
|
|
19577
19626
|
flexDirection: "column",
|
|
19578
19627
|
borderStyle: "round",
|
|
@@ -19582,18 +19631,18 @@ function FallbackPermissionRequest({
|
|
|
19582
19631
|
paddingRight: 1,
|
|
19583
19632
|
paddingBottom: 1
|
|
19584
19633
|
},
|
|
19585
|
-
/* @__PURE__ */
|
|
19634
|
+
/* @__PURE__ */ React81.createElement(
|
|
19586
19635
|
PermissionRequestTitle,
|
|
19587
19636
|
{
|
|
19588
19637
|
title: "Tool use",
|
|
19589
19638
|
riskScore: toolUseConfirm.riskScore
|
|
19590
19639
|
}
|
|
19591
19640
|
),
|
|
19592
|
-
/* @__PURE__ */
|
|
19641
|
+
/* @__PURE__ */ React81.createElement(Box60, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React81.createElement(Text65, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
19593
19642
|
toolUseConfirm.input,
|
|
19594
19643
|
{ verbose }
|
|
19595
|
-
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */
|
|
19596
|
-
/* @__PURE__ */
|
|
19644
|
+
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */ React81.createElement(Text65, { color: theme.secondaryText }, " (MCP)") : ""), /* @__PURE__ */ React81.createElement(Text65, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
19645
|
+
/* @__PURE__ */ React81.createElement(Box60, { flexDirection: "column" }, /* @__PURE__ */ React81.createElement(Text65, null, "Do you want to proceed?"), /* @__PURE__ */ React81.createElement(
|
|
19597
19646
|
Select,
|
|
19598
19647
|
{
|
|
19599
19648
|
options: [
|
|
@@ -19709,17 +19758,17 @@ function useNotifyAfterTimeout(message, timeout = DEFAULT_INTERACTION_THRESHOLD_
|
|
|
19709
19758
|
}
|
|
19710
19759
|
|
|
19711
19760
|
// src/ui/components/permissions/file-write-permission-request/FileWritePermissionRequest.tsx
|
|
19712
|
-
import { Box as
|
|
19713
|
-
import
|
|
19761
|
+
import { Box as Box62, Text as Text67, useInput as useInput21 } from "ink";
|
|
19762
|
+
import React83, { useCallback as useCallback9, useMemo as useMemo18 } from "react";
|
|
19714
19763
|
import { basename as basename2, dirname as dirname6, extname as extname8 } from "path";
|
|
19715
19764
|
import { existsSync as existsSync11 } from "fs";
|
|
19716
19765
|
import chalk10 from "chalk";
|
|
19717
19766
|
|
|
19718
19767
|
// src/ui/components/permissions/file-write-permission-request/FileWriteToolDiff.tsx
|
|
19719
|
-
import * as
|
|
19768
|
+
import * as React82 from "react";
|
|
19720
19769
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
19721
19770
|
import { useMemo as useMemo17 } from "react";
|
|
19722
|
-
import { Box as
|
|
19771
|
+
import { Box as Box61, Text as Text66 } from "ink";
|
|
19723
19772
|
import { extname as extname7, relative as relative11 } from "path";
|
|
19724
19773
|
function FileWriteToolDiff({
|
|
19725
19774
|
file_path,
|
|
@@ -19746,17 +19795,17 @@ function FileWriteToolDiff({
|
|
|
19746
19795
|
newStr: content
|
|
19747
19796
|
});
|
|
19748
19797
|
}, [fileExists, file_path, oldContent, content]);
|
|
19749
|
-
return /* @__PURE__ */
|
|
19750
|
-
|
|
19798
|
+
return /* @__PURE__ */ React82.createElement(
|
|
19799
|
+
Box61,
|
|
19751
19800
|
{
|
|
19752
19801
|
borderColor: getTheme().secondaryBorder,
|
|
19753
19802
|
borderStyle: "round",
|
|
19754
19803
|
flexDirection: "column",
|
|
19755
19804
|
paddingX: 1
|
|
19756
19805
|
},
|
|
19757
|
-
/* @__PURE__ */
|
|
19806
|
+
/* @__PURE__ */ React82.createElement(Box61, { paddingBottom: 1 }, /* @__PURE__ */ React82.createElement(Text66, { bold: true }, verbose ? file_path : relative11(getCwd(), file_path))),
|
|
19758
19807
|
hunks ? intersperse(
|
|
19759
|
-
hunks.map((_) => /* @__PURE__ */
|
|
19808
|
+
hunks.map((_) => /* @__PURE__ */ React82.createElement(
|
|
19760
19809
|
StructuredDiff,
|
|
19761
19810
|
{
|
|
19762
19811
|
key: _.newStart,
|
|
@@ -19765,8 +19814,8 @@ function FileWriteToolDiff({
|
|
|
19765
19814
|
width
|
|
19766
19815
|
}
|
|
19767
19816
|
)),
|
|
19768
|
-
(i) => /* @__PURE__ */
|
|
19769
|
-
) : /* @__PURE__ */
|
|
19817
|
+
(i) => /* @__PURE__ */ React82.createElement(React82.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React82.createElement(Text66, { color: getTheme().secondaryText }, "..."))
|
|
19818
|
+
) : /* @__PURE__ */ React82.createElement(
|
|
19770
19819
|
HighlightedCode,
|
|
19771
19820
|
{
|
|
19772
19821
|
code: content || "(No content)",
|
|
@@ -19901,8 +19950,8 @@ function FileWritePermissionRequest({
|
|
|
19901
19950
|
handleChoice("yes-session");
|
|
19902
19951
|
return true;
|
|
19903
19952
|
});
|
|
19904
|
-
return /* @__PURE__ */
|
|
19905
|
-
|
|
19953
|
+
return /* @__PURE__ */ React83.createElement(
|
|
19954
|
+
Box62,
|
|
19906
19955
|
{
|
|
19907
19956
|
flexDirection: "column",
|
|
19908
19957
|
borderStyle: "round",
|
|
@@ -19912,14 +19961,14 @@ function FileWritePermissionRequest({
|
|
|
19912
19961
|
paddingRight: 1,
|
|
19913
19962
|
paddingBottom: 1
|
|
19914
19963
|
},
|
|
19915
|
-
/* @__PURE__ */
|
|
19964
|
+
/* @__PURE__ */ React83.createElement(
|
|
19916
19965
|
PermissionRequestTitle,
|
|
19917
19966
|
{
|
|
19918
19967
|
title: `${fileExists ? "Edit" : "Create"} file`,
|
|
19919
19968
|
riskScore: toolUseConfirm.riskScore
|
|
19920
19969
|
}
|
|
19921
19970
|
),
|
|
19922
|
-
/* @__PURE__ */
|
|
19971
|
+
/* @__PURE__ */ React83.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React83.createElement(
|
|
19923
19972
|
FileWriteToolDiff,
|
|
19924
19973
|
{
|
|
19925
19974
|
file_path,
|
|
@@ -19928,7 +19977,7 @@ function FileWritePermissionRequest({
|
|
|
19928
19977
|
width: columns - 12
|
|
19929
19978
|
}
|
|
19930
19979
|
)),
|
|
19931
|
-
/* @__PURE__ */
|
|
19980
|
+
/* @__PURE__ */ React83.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React83.createElement(Text67, null, "Do you want to ", fileExists ? "make this edit to" : "create", " ", /* @__PURE__ */ React83.createElement(Text67, { bold: true }, basename2(file_path)), "?"), /* @__PURE__ */ React83.createElement(
|
|
19932
19981
|
Select,
|
|
19933
19982
|
{
|
|
19934
19983
|
options: [
|
|
@@ -19962,8 +20011,8 @@ async function extractLanguageName2(file_path) {
|
|
|
19962
20011
|
}
|
|
19963
20012
|
|
|
19964
20013
|
// src/ui/components/permissions/filesystem-permission-request/FilesystemPermissionRequest.tsx
|
|
19965
|
-
import { Box as
|
|
19966
|
-
import
|
|
20014
|
+
import { Box as Box63, Text as Text68, useInput as useInput22 } from "ink";
|
|
20015
|
+
import React84, { useCallback as useCallback10, useMemo as useMemo19 } from "react";
|
|
19967
20016
|
import chalk11 from "chalk";
|
|
19968
20017
|
import { basename as basename3, dirname as dirname7 } from "path";
|
|
19969
20018
|
import { statSync as statSync10 } from "fs";
|
|
@@ -20020,7 +20069,7 @@ function FilesystemPermissionRequest({
|
|
|
20020
20069
|
}) {
|
|
20021
20070
|
const path5 = pathFromToolUse(toolUseConfirm);
|
|
20022
20071
|
if (!path5) {
|
|
20023
|
-
return /* @__PURE__ */
|
|
20072
|
+
return /* @__PURE__ */ React84.createElement(
|
|
20024
20073
|
FallbackPermissionRequest,
|
|
20025
20074
|
{
|
|
20026
20075
|
toolUseConfirm,
|
|
@@ -20029,7 +20078,7 @@ function FilesystemPermissionRequest({
|
|
|
20029
20078
|
}
|
|
20030
20079
|
);
|
|
20031
20080
|
}
|
|
20032
|
-
return /* @__PURE__ */
|
|
20081
|
+
return /* @__PURE__ */ React84.createElement(
|
|
20033
20082
|
FilesystemPermissionRequestImpl,
|
|
20034
20083
|
{
|
|
20035
20084
|
toolUseConfirm,
|
|
@@ -20171,8 +20220,8 @@ function FilesystemPermissionRequestImpl({
|
|
|
20171
20220
|
handleChoice("yes-session");
|
|
20172
20221
|
return true;
|
|
20173
20222
|
});
|
|
20174
|
-
return /* @__PURE__ */
|
|
20175
|
-
|
|
20223
|
+
return /* @__PURE__ */ React84.createElement(
|
|
20224
|
+
Box63,
|
|
20176
20225
|
{
|
|
20177
20226
|
flexDirection: "column",
|
|
20178
20227
|
borderStyle: "round",
|
|
@@ -20182,18 +20231,18 @@ function FilesystemPermissionRequestImpl({
|
|
|
20182
20231
|
paddingRight: 1,
|
|
20183
20232
|
paddingBottom: 1
|
|
20184
20233
|
},
|
|
20185
|
-
/* @__PURE__ */
|
|
20234
|
+
/* @__PURE__ */ React84.createElement(
|
|
20186
20235
|
PermissionRequestTitle,
|
|
20187
20236
|
{
|
|
20188
20237
|
title,
|
|
20189
20238
|
riskScore: toolUseConfirm.riskScore
|
|
20190
20239
|
}
|
|
20191
20240
|
),
|
|
20192
|
-
/* @__PURE__ */
|
|
20241
|
+
/* @__PURE__ */ React84.createElement(Box63, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React84.createElement(Text68, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20193
20242
|
toolUseConfirm.input,
|
|
20194
20243
|
{ verbose }
|
|
20195
20244
|
), ")")),
|
|
20196
|
-
/* @__PURE__ */
|
|
20245
|
+
/* @__PURE__ */ React84.createElement(Box63, { flexDirection: "column" }, /* @__PURE__ */ React84.createElement(Text68, null, "Do you want to proceed?"), /* @__PURE__ */ React84.createElement(
|
|
20197
20246
|
Select,
|
|
20198
20247
|
{
|
|
20199
20248
|
options: [
|
|
@@ -20221,7 +20270,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
20221
20270
|
|
|
20222
20271
|
// src/tools/ai/SkillTool/SkillTool.tsx
|
|
20223
20272
|
import { z as z9 } from "zod";
|
|
20224
|
-
import * as
|
|
20273
|
+
import * as React85 from "react";
|
|
20225
20274
|
|
|
20226
20275
|
// src/tools/ai/SkillTool/prompt.ts
|
|
20227
20276
|
var TOOL_NAME_FOR_PROMPT5 = "Skill";
|
|
@@ -20318,7 +20367,7 @@ ${availableSkills}${truncatedNotice}
|
|
|
20318
20367
|
return skill || "";
|
|
20319
20368
|
},
|
|
20320
20369
|
renderToolUseRejectedMessage() {
|
|
20321
|
-
return /* @__PURE__ */
|
|
20370
|
+
return /* @__PURE__ */ React85.createElement(FallbackToolUseRejectedMessage, null);
|
|
20322
20371
|
},
|
|
20323
20372
|
renderResultForAssistant(output) {
|
|
20324
20373
|
return `Launching skill: ${output.commandName}`;
|
|
@@ -20453,8 +20502,8 @@ function findCommand(commandName, commands) {
|
|
|
20453
20502
|
}
|
|
20454
20503
|
|
|
20455
20504
|
// src/ui/components/permissions/slash-command-permission-request/SlashCommandPermissionRequest.tsx
|
|
20456
|
-
import { Box as
|
|
20457
|
-
import
|
|
20505
|
+
import { Box as Box64, Text as Text69 } from "ink";
|
|
20506
|
+
import React86, { useMemo as useMemo20 } from "react";
|
|
20458
20507
|
import chalk12 from "chalk";
|
|
20459
20508
|
function parsePrefix(command4) {
|
|
20460
20509
|
const trimmed = command4.trim();
|
|
@@ -20479,8 +20528,8 @@ function SlashCommandPermissionRequest({
|
|
|
20479
20528
|
const command4 = typeof toolUseConfirm.input.command === "string" ? toolUseConfirm.input.command : "";
|
|
20480
20529
|
const prefix = parsePrefix(command4);
|
|
20481
20530
|
const showPrefixOption = !!prefix && hasArgs(command4);
|
|
20482
|
-
return /* @__PURE__ */
|
|
20483
|
-
|
|
20531
|
+
return /* @__PURE__ */ React86.createElement(
|
|
20532
|
+
Box64,
|
|
20484
20533
|
{
|
|
20485
20534
|
flexDirection: "column",
|
|
20486
20535
|
borderStyle: "round",
|
|
@@ -20490,14 +20539,14 @@ function SlashCommandPermissionRequest({
|
|
|
20490
20539
|
paddingRight: 1,
|
|
20491
20540
|
paddingBottom: 1
|
|
20492
20541
|
},
|
|
20493
|
-
/* @__PURE__ */
|
|
20494
|
-
/* @__PURE__ */
|
|
20542
|
+
/* @__PURE__ */ React86.createElement(PermissionRequestTitle, { title: "Slash command", riskScore: null }),
|
|
20543
|
+
/* @__PURE__ */ React86.createElement(Box64, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React86.createElement(Text69, null, toolUseConfirm.tool.userFacingName?.() || "SlashCommand", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20495
20544
|
toolUseConfirm.input,
|
|
20496
20545
|
{
|
|
20497
20546
|
verbose
|
|
20498
20547
|
}
|
|
20499
|
-
), ")"), /* @__PURE__ */
|
|
20500
|
-
/* @__PURE__ */
|
|
20548
|
+
), ")"), /* @__PURE__ */ React86.createElement(Text69, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20549
|
+
/* @__PURE__ */ React86.createElement(Box64, { flexDirection: "column" }, /* @__PURE__ */ React86.createElement(Text69, null, "Do you want to proceed?"), /* @__PURE__ */ React86.createElement(
|
|
20501
20550
|
Select,
|
|
20502
20551
|
{
|
|
20503
20552
|
options: [
|
|
@@ -20598,8 +20647,8 @@ function SlashCommandPermissionRequest({
|
|
|
20598
20647
|
}
|
|
20599
20648
|
|
|
20600
20649
|
// src/ui/components/permissions/skill-permission-request/SkillPermissionRequest.tsx
|
|
20601
|
-
import { Box as
|
|
20602
|
-
import
|
|
20650
|
+
import { Box as Box65, Text as Text70 } from "ink";
|
|
20651
|
+
import React87, { useMemo as useMemo21 } from "react";
|
|
20603
20652
|
import chalk13 from "chalk";
|
|
20604
20653
|
function SkillPermissionRequest({
|
|
20605
20654
|
toolUseConfirm,
|
|
@@ -20614,8 +20663,8 @@ function SkillPermissionRequest({
|
|
|
20614
20663
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
20615
20664
|
const raw = typeof toolUseConfirm.input.skill === "string" ? toolUseConfirm.input.skill : "";
|
|
20616
20665
|
const skill = raw.trim().replace(/^\//, "");
|
|
20617
|
-
return /* @__PURE__ */
|
|
20618
|
-
|
|
20666
|
+
return /* @__PURE__ */ React87.createElement(
|
|
20667
|
+
Box65,
|
|
20619
20668
|
{
|
|
20620
20669
|
flexDirection: "column",
|
|
20621
20670
|
borderStyle: "round",
|
|
@@ -20625,14 +20674,14 @@ function SkillPermissionRequest({
|
|
|
20625
20674
|
paddingRight: 1,
|
|
20626
20675
|
paddingBottom: 1
|
|
20627
20676
|
},
|
|
20628
|
-
/* @__PURE__ */
|
|
20629
|
-
/* @__PURE__ */
|
|
20677
|
+
/* @__PURE__ */ React87.createElement(PermissionRequestTitle, { title: "Skill", riskScore: null }),
|
|
20678
|
+
/* @__PURE__ */ React87.createElement(Box65, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React87.createElement(Text70, null, toolUseConfirm.tool.userFacingName?.() || "Skill", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20630
20679
|
toolUseConfirm.input,
|
|
20631
20680
|
{
|
|
20632
20681
|
verbose
|
|
20633
20682
|
}
|
|
20634
|
-
), ")"), /* @__PURE__ */
|
|
20635
|
-
/* @__PURE__ */
|
|
20683
|
+
), ")"), /* @__PURE__ */ React87.createElement(Text70, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20684
|
+
/* @__PURE__ */ React87.createElement(Box65, { flexDirection: "column" }, /* @__PURE__ */ React87.createElement(Text70, null, "Do you want to proceed?"), /* @__PURE__ */ React87.createElement(
|
|
20636
20685
|
Select,
|
|
20637
20686
|
{
|
|
20638
20687
|
options: [
|
|
@@ -20702,8 +20751,8 @@ function SkillPermissionRequest({
|
|
|
20702
20751
|
}
|
|
20703
20752
|
|
|
20704
20753
|
// src/tools/agent/PlanModeTool/EnterPlanModeTool.tsx
|
|
20705
|
-
import { Box as
|
|
20706
|
-
import
|
|
20754
|
+
import { Box as Box66, Text as Text71 } from "ink";
|
|
20755
|
+
import React88 from "react";
|
|
20707
20756
|
import { z as z10 } from "zod";
|
|
20708
20757
|
|
|
20709
20758
|
// src/tools/agent/PlanModeTool/prompt.ts
|
|
@@ -20855,11 +20904,11 @@ var EnterPlanModeTool = {
|
|
|
20855
20904
|
},
|
|
20856
20905
|
renderToolUseRejectedMessage() {
|
|
20857
20906
|
const theme = getTheme();
|
|
20858
|
-
return /* @__PURE__ */
|
|
20907
|
+
return /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React88.createElement(Text71, { color: theme.text }, BLACK_CIRCLE), /* @__PURE__ */ React88.createElement(Text71, null, " User declined to enter plan mode"));
|
|
20859
20908
|
},
|
|
20860
20909
|
renderToolResultMessage(_output) {
|
|
20861
20910
|
const theme = getTheme();
|
|
20862
|
-
return /* @__PURE__ */
|
|
20911
|
+
return /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text71, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React88.createElement(Text71, null, " Entered plan mode")), /* @__PURE__ */ React88.createElement(Box66, { paddingLeft: 2 }, /* @__PURE__ */ React88.createElement(Text71, { dimColor: true }, "Pyb Agent is now exploring and designing an implementation approach.")));
|
|
20863
20912
|
},
|
|
20864
20913
|
renderResultForAssistant(output) {
|
|
20865
20914
|
return `${output.message}
|
|
@@ -20892,8 +20941,8 @@ Remember: DO NOT write or edit any files yet. This is a read-only exploration an
|
|
|
20892
20941
|
};
|
|
20893
20942
|
|
|
20894
20943
|
// src/tools/agent/PlanModeTool/ExitPlanModeTool.tsx
|
|
20895
|
-
import { Box as
|
|
20896
|
-
import
|
|
20944
|
+
import { Box as Box67, Text as Text72 } from "ink";
|
|
20945
|
+
import React89 from "react";
|
|
20897
20946
|
import { z as z11 } from "zod";
|
|
20898
20947
|
function getExitPlanModePlanText(conversationKey) {
|
|
20899
20948
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
@@ -20938,8 +20987,8 @@ var ExitPlanModeTool = {
|
|
|
20938
20987
|
const conversationKey = typeof options.conversationKey === "string" && options.conversationKey.trim() ? options.conversationKey.trim() : void 0;
|
|
20939
20988
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
20940
20989
|
const plan = getExitPlanModePlanText(conversationKey);
|
|
20941
|
-
return /* @__PURE__ */
|
|
20942
|
-
|
|
20990
|
+
return /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React89.createElement(Text72, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React89.createElement(Text72, { color: theme.error }, "User rejected Pyb Agent's plan:"), /* @__PURE__ */ React89.createElement(
|
|
20991
|
+
Box67,
|
|
20943
20992
|
{
|
|
20944
20993
|
borderStyle: "round",
|
|
20945
20994
|
borderColor: theme.planMode,
|
|
@@ -20947,14 +20996,14 @@ var ExitPlanModeTool = {
|
|
|
20947
20996
|
paddingX: 1,
|
|
20948
20997
|
overflow: "hidden"
|
|
20949
20998
|
},
|
|
20950
|
-
/* @__PURE__ */
|
|
20999
|
+
/* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, plan)
|
|
20951
21000
|
))));
|
|
20952
21001
|
},
|
|
20953
21002
|
renderToolResultMessage(output) {
|
|
20954
21003
|
const theme = getTheme();
|
|
20955
21004
|
const planPath = typeof output.filePath === "string" ? output.filePath : null;
|
|
20956
21005
|
const plan = output.plan || "No plan found";
|
|
20957
|
-
return /* @__PURE__ */
|
|
21006
|
+
return /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React89.createElement(Text72, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React89.createElement(Text72, null, " User approved Pyb Agent's plan")), /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "row" }, /* @__PURE__ */ React89.createElement(Text72, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column" }, planPath ? /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, "Plan saved to: ", planPath, " \xB7 /plan to edit") : null, /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, plan))));
|
|
20958
21007
|
},
|
|
20959
21008
|
renderResultForAssistant(output) {
|
|
20960
21009
|
if (output.isAgent) {
|
|
@@ -21038,8 +21087,8 @@ ${output.plan}`;
|
|
|
21038
21087
|
};
|
|
21039
21088
|
|
|
21040
21089
|
// src/ui/components/permissions/plan-mode-permission-request/EnterPlanModePermissionRequest.tsx
|
|
21041
|
-
import { Box as
|
|
21042
|
-
import
|
|
21090
|
+
import { Box as Box68, Text as Text73, useInput as useInput23 } from "ink";
|
|
21091
|
+
import React90 from "react";
|
|
21043
21092
|
function EnterPlanModePermissionRequest({
|
|
21044
21093
|
toolUseConfirm,
|
|
21045
21094
|
onDone
|
|
@@ -21052,8 +21101,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21052
21101
|
onDone();
|
|
21053
21102
|
}
|
|
21054
21103
|
});
|
|
21055
|
-
return /* @__PURE__ */
|
|
21056
|
-
|
|
21104
|
+
return /* @__PURE__ */ React90.createElement(
|
|
21105
|
+
Box68,
|
|
21057
21106
|
{
|
|
21058
21107
|
flexDirection: "column",
|
|
21059
21108
|
borderStyle: "round",
|
|
@@ -21063,11 +21112,11 @@ function EnterPlanModePermissionRequest({
|
|
|
21063
21112
|
paddingRight: 1,
|
|
21064
21113
|
paddingBottom: 1
|
|
21065
21114
|
},
|
|
21066
|
-
/* @__PURE__ */
|
|
21067
|
-
/* @__PURE__ */
|
|
21068
|
-
/* @__PURE__ */
|
|
21069
|
-
/* @__PURE__ */
|
|
21070
|
-
/* @__PURE__ */
|
|
21115
|
+
/* @__PURE__ */ React90.createElement(PermissionRequestTitle, { title: "Enter plan mode?", riskScore: null }),
|
|
21116
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React90.createElement(Text73, null, "The assistant wants to enter plan mode to explore and design an implementation approach.")),
|
|
21117
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, "In plan mode, the assistant will:"), /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, " \xB7 Explore the codebase thoroughly"), /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, " \xB7 Identify existing patterns"), /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, " \xB7 Design an implementation strategy"), /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, " \xB7 Present a plan for your approval")),
|
|
21118
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, "No code changes will be made until you approve the plan.")),
|
|
21119
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column" }, /* @__PURE__ */ React90.createElement(Text73, null, "Would you like to proceed?"), /* @__PURE__ */ React90.createElement(
|
|
21071
21120
|
Select,
|
|
21072
21121
|
{
|
|
21073
21122
|
options: [
|
|
@@ -21090,8 +21139,8 @@ function EnterPlanModePermissionRequest({
|
|
|
21090
21139
|
}
|
|
21091
21140
|
|
|
21092
21141
|
// src/ui/components/permissions/plan-mode-permission-request/ExitPlanModePermissionRequest.tsx
|
|
21093
|
-
import { Box as
|
|
21094
|
-
import
|
|
21142
|
+
import { Box as Box69, Text as Text74, useInput as useInput24 } from "ink";
|
|
21143
|
+
import React91, { useEffect as useEffect19, useMemo as useMemo22, useState as useState20 } from "react";
|
|
21095
21144
|
|
|
21096
21145
|
// src/utils/system/externalEditor.ts
|
|
21097
21146
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -21398,8 +21447,8 @@ function ExitPlanModePermissionRequest({
|
|
|
21398
21447
|
[bypassAvailable, launchSwarmAvailable, teammateCount]
|
|
21399
21448
|
);
|
|
21400
21449
|
if (showRejectInput) {
|
|
21401
|
-
return /* @__PURE__ */
|
|
21402
|
-
|
|
21450
|
+
return /* @__PURE__ */ React91.createElement(
|
|
21451
|
+
Box69,
|
|
21403
21452
|
{
|
|
21404
21453
|
flexDirection: "column",
|
|
21405
21454
|
borderStyle: "round",
|
|
@@ -21409,8 +21458,8 @@ function ExitPlanModePermissionRequest({
|
|
|
21409
21458
|
paddingRight: 1,
|
|
21410
21459
|
paddingBottom: 1
|
|
21411
21460
|
},
|
|
21412
|
-
/* @__PURE__ */
|
|
21413
|
-
/* @__PURE__ */
|
|
21461
|
+
/* @__PURE__ */ React91.createElement(PermissionRequestTitle, { title: "No, keep planning", riskScore: null }),
|
|
21462
|
+
/* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React91.createElement(Text74, { dimColor: true }, "Type here to tell Pyb Agent what to change (Enter submits, Esc cancels)"), rejectError ? /* @__PURE__ */ React91.createElement(Text74, { color: theme.error }, rejectError) : null, /* @__PURE__ */ React91.createElement(
|
|
21414
21463
|
TextInput,
|
|
21415
21464
|
{
|
|
21416
21465
|
value: rejectFeedback,
|
|
@@ -21439,8 +21488,8 @@ function ExitPlanModePermissionRequest({
|
|
|
21439
21488
|
))
|
|
21440
21489
|
);
|
|
21441
21490
|
}
|
|
21442
|
-
return /* @__PURE__ */
|
|
21443
|
-
|
|
21491
|
+
return /* @__PURE__ */ React91.createElement(
|
|
21492
|
+
Box69,
|
|
21444
21493
|
{
|
|
21445
21494
|
flexDirection: "column",
|
|
21446
21495
|
borderStyle: "round",
|
|
@@ -21450,9 +21499,9 @@ function ExitPlanModePermissionRequest({
|
|
|
21450
21499
|
paddingRight: 1,
|
|
21451
21500
|
paddingBottom: 1
|
|
21452
21501
|
},
|
|
21453
|
-
/* @__PURE__ */
|
|
21454
|
-
/* @__PURE__ */
|
|
21455
|
-
|
|
21502
|
+
/* @__PURE__ */ React91.createElement(PermissionRequestTitle, { title: "Ready to code?", riskScore: null }),
|
|
21503
|
+
/* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React91.createElement(Text74, null, "Here is Pyb Agent's plan:"), /* @__PURE__ */ React91.createElement(
|
|
21504
|
+
Box69,
|
|
21456
21505
|
{
|
|
21457
21506
|
borderStyle: "dashed",
|
|
21458
21507
|
borderColor: theme.secondaryBorder,
|
|
@@ -21464,10 +21513,10 @@ function ExitPlanModePermissionRequest({
|
|
|
21464
21513
|
marginBottom: 1,
|
|
21465
21514
|
flexDirection: "column"
|
|
21466
21515
|
},
|
|
21467
|
-
/* @__PURE__ */
|
|
21516
|
+
/* @__PURE__ */ React91.createElement(Text74, null, planText)
|
|
21468
21517
|
)),
|
|
21469
|
-
/* @__PURE__ */
|
|
21470
|
-
/* @__PURE__ */
|
|
21518
|
+
/* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React91.createElement(Text74, { dimColor: true }, "Tip: Press ctrl+g to edit", " ", planSource === "file" ? `plan file: ${planFilePath}` : "plan text", planSaved ? " \xB7 Plan saved!" : "")),
|
|
21519
|
+
/* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text74, { dimColor: true }, "Would you like to proceed?"), /* @__PURE__ */ React91.createElement(
|
|
21471
21520
|
Select,
|
|
21472
21521
|
{
|
|
21473
21522
|
options,
|
|
@@ -21493,8 +21542,8 @@ function ExitPlanModePermissionRequest({
|
|
|
21493
21542
|
}
|
|
21494
21543
|
|
|
21495
21544
|
// src/tools/interaction/AskUserQuestionTool/AskUserQuestionTool.tsx
|
|
21496
|
-
import { Box as
|
|
21497
|
-
import
|
|
21545
|
+
import { Box as Box70, Text as Text75 } from "ink";
|
|
21546
|
+
import React92 from "react";
|
|
21498
21547
|
import { z as z12 } from "zod";
|
|
21499
21548
|
|
|
21500
21549
|
// src/tools/interaction/AskUserQuestionTool/prompt.ts
|
|
@@ -21571,11 +21620,11 @@ var AskUserQuestionTool = {
|
|
|
21571
21620
|
},
|
|
21572
21621
|
renderToolUseRejectedMessage() {
|
|
21573
21622
|
const theme = getTheme();
|
|
21574
|
-
return /* @__PURE__ */
|
|
21623
|
+
return /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React92.createElement(Text75, null, "User declined to answer questions"));
|
|
21575
21624
|
},
|
|
21576
21625
|
renderToolResultMessage(output, _options) {
|
|
21577
21626
|
const theme = getTheme();
|
|
21578
|
-
return /* @__PURE__ */
|
|
21627
|
+
return /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "row" }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React92.createElement(Text75, null, "User answered Pyb Agent's questions:")), /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", paddingLeft: 2 }, Object.entries(output.answers).map(([question, answer]) => /* @__PURE__ */ React92.createElement(Box70, { key: question }, /* @__PURE__ */ React92.createElement(Text75, { dimColor: true }, "\xB7 ", question, " \u2192 ", answer)))));
|
|
21579
21628
|
},
|
|
21580
21629
|
renderResultForAssistant(output) {
|
|
21581
21630
|
const formatted = Object.entries(output.answers).map(([question, answer]) => `"${question}"="${answer}"`).join(", ");
|
|
@@ -21592,8 +21641,8 @@ var AskUserQuestionTool = {
|
|
|
21592
21641
|
};
|
|
21593
21642
|
|
|
21594
21643
|
// src/ui/components/permissions/ask-user-question-permission-request/AskUserQuestionPermissionRequest.tsx
|
|
21595
|
-
import
|
|
21596
|
-
import { Box as
|
|
21644
|
+
import React93, { useCallback as useCallback11, useMemo as useMemo23, useState as useState21 } from "react";
|
|
21645
|
+
import { Box as Box71, Text as Text76, useInput as useInput25 } from "ink";
|
|
21597
21646
|
import figures8 from "figures";
|
|
21598
21647
|
import stringWidth from "string-width";
|
|
21599
21648
|
function isTextInputChar(input, key) {
|
|
@@ -21947,18 +21996,18 @@ function AskUserQuestionPermissionRequest({
|
|
|
21947
21996
|
const rightArrowInactive = currentQuestionIndex === maxTabIndex;
|
|
21948
21997
|
const allQuestionsAnswered = questions.every((q) => q?.question && Boolean(answers[q.question])) ?? false;
|
|
21949
21998
|
if (questions.length === 0) {
|
|
21950
|
-
return /* @__PURE__ */
|
|
21999
|
+
return /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React93.createElement(Text76, { color: theme.error }, "Invalid AskUserQuestion input."), /* @__PURE__ */ React93.createElement(Text76, { dimColor: true }, "Press Esc to cancel."));
|
|
21951
22000
|
}
|
|
21952
|
-
return /* @__PURE__ */
|
|
21953
|
-
|
|
22001
|
+
return /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React93.createElement(
|
|
22002
|
+
Box71,
|
|
21954
22003
|
{
|
|
21955
22004
|
borderTop: true,
|
|
21956
22005
|
borderColor: theme.secondaryText,
|
|
21957
22006
|
flexDirection: "column",
|
|
21958
22007
|
paddingTop: 0
|
|
21959
22008
|
},
|
|
21960
|
-
/* @__PURE__ */
|
|
21961
|
-
|
|
22009
|
+
/* @__PURE__ */ React93.createElement(Box71, { flexDirection: "row", marginBottom: 1 }, showArrows && /* @__PURE__ */ React93.createElement(
|
|
22010
|
+
Text76,
|
|
21962
22011
|
{
|
|
21963
22012
|
color: currentQuestionIndex === 0 ? theme.secondaryText : void 0
|
|
21964
22013
|
},
|
|
@@ -21969,16 +22018,16 @@ function AskUserQuestionPermissionRequest({
|
|
|
21969
22018
|
const checkbox = question.question && answers[question.question] ? figures8.checkboxOn : figures8.checkboxOff;
|
|
21970
22019
|
const headerText = tabHeaders[index] ?? question.header ?? `Q${index + 1}`;
|
|
21971
22020
|
const tabText = ` ${checkbox} ${headerText} `;
|
|
21972
|
-
return /* @__PURE__ */
|
|
21973
|
-
|
|
22021
|
+
return /* @__PURE__ */ React93.createElement(React93.Fragment, { key: question.question || `question-${index}` }, /* @__PURE__ */ React93.createElement(
|
|
22022
|
+
Text76,
|
|
21974
22023
|
{
|
|
21975
22024
|
backgroundColor: isSelected ? theme.permission : void 0,
|
|
21976
22025
|
color: isSelected ? inverseText : void 0
|
|
21977
22026
|
},
|
|
21978
22027
|
tabText
|
|
21979
22028
|
));
|
|
21980
|
-
}), !hideSubmitTab && /* @__PURE__ */
|
|
21981
|
-
|
|
22029
|
+
}), !hideSubmitTab && /* @__PURE__ */ React93.createElement(
|
|
22030
|
+
Text76,
|
|
21982
22031
|
{
|
|
21983
22032
|
backgroundColor: isSubmitTab ? theme.permission : void 0,
|
|
21984
22033
|
color: isSubmitTab ? inverseText : void 0
|
|
@@ -21987,23 +22036,23 @@ function AskUserQuestionPermissionRequest({
|
|
|
21987
22036
|
figures8.tick,
|
|
21988
22037
|
" Submit",
|
|
21989
22038
|
" "
|
|
21990
|
-
), showArrows && /* @__PURE__ */
|
|
21991
|
-
!isSubmitTab && currentQuestion && /* @__PURE__ */
|
|
22039
|
+
), showArrows && /* @__PURE__ */ React93.createElement(Text76, { color: rightArrowInactive ? theme.secondaryText : void 0 }, " ", "\u2192")),
|
|
22040
|
+
!isSubmitTab && currentQuestion && /* @__PURE__ */ React93.createElement(React93.Fragment, null, /* @__PURE__ */ React93.createElement(Text76, { bold: true }, currentQuestion.question), /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column", marginTop: 1 }, (() => {
|
|
21992
22041
|
const rawSelected = activeQuestionState?.selectedValue;
|
|
21993
22042
|
const selectedValues = Array.isArray(rawSelected) ? rawSelected : [];
|
|
21994
22043
|
const otherSelected = currentQuestion.multiSelect ? selectedValues.includes("__other__") : rawSelected === "__other__";
|
|
21995
22044
|
const otherText = questionStates[currentQuestion.question]?.textInputValue ?? "";
|
|
21996
22045
|
const otherPlaceholder = currentQuestion.multiSelect ? "Type something" : "Type something.";
|
|
21997
22046
|
const otherLine = otherText.length > 0 ? otherText : isOtherFocused || otherSelected ? otherPlaceholder : "";
|
|
21998
|
-
return /* @__PURE__ */
|
|
22047
|
+
return /* @__PURE__ */ React93.createElement(React93.Fragment, null, currentQuestion.options.map((option, index) => {
|
|
21999
22048
|
const isFocused = !isMultiSelectSubmitFocused && index === focusedOptionIndex;
|
|
22000
22049
|
const isSelected = currentQuestion.multiSelect ? selectedValues.includes(option.label) : rawSelected === option.label;
|
|
22001
22050
|
const pointer = isFocused ? figures8.pointer : " ";
|
|
22002
22051
|
const color = isFocused ? theme.pyb : theme.text;
|
|
22003
22052
|
const indicator = currentQuestion.multiSelect ? isSelected ? figures8.checkboxOn : figures8.checkboxOff : isSelected ? figures8.tick : " ";
|
|
22004
|
-
return /* @__PURE__ */
|
|
22005
|
-
}), /* @__PURE__ */
|
|
22006
|
-
|
|
22053
|
+
return /* @__PURE__ */ React93.createElement(Box71, { key: option.label, flexDirection: "column" }, /* @__PURE__ */ React93.createElement(Text76, { color }, pointer, " ", indicator, " ", option.label), /* @__PURE__ */ React93.createElement(Text76, { color: theme.secondaryText }, " ", option.description));
|
|
22054
|
+
}), /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column" }, /* @__PURE__ */ React93.createElement(Text76, { color: isOtherFocused ? theme.pyb : theme.text }, isOtherFocused ? figures8.pointer : " ", " ", currentQuestion.multiSelect ? otherSelected ? figures8.checkboxOn : figures8.checkboxOff : otherSelected ? figures8.tick : " ", " ", "Other"), (isOtherFocused || otherSelected || otherText.trim().length > 0) && /* @__PURE__ */ React93.createElement(Text76, { color: theme.secondaryText }, otherLine, isOtherFocused && /* @__PURE__ */ React93.createElement(Text76, { color: "gray" }, "\u258C"))), currentQuestion.multiSelect && /* @__PURE__ */ React93.createElement(Box71, { marginTop: 0 }, /* @__PURE__ */ React93.createElement(
|
|
22055
|
+
Text76,
|
|
22007
22056
|
{
|
|
22008
22057
|
color: isMultiSelectSubmitFocused ? theme.pyb : theme.text,
|
|
22009
22058
|
bold: isMultiSelectSubmitFocused
|
|
@@ -22011,9 +22060,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
22011
22060
|
isMultiSelectSubmitFocused ? figures8.pointer : " ",
|
|
22012
22061
|
" ",
|
|
22013
22062
|
currentQuestionIndex === questions.length - 1 ? "Submit" : "Next"
|
|
22014
|
-
)), /* @__PURE__ */
|
|
22063
|
+
)), /* @__PURE__ */ React93.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React93.createElement(Text76, { color: theme.secondaryText, dimColor: true }, "Enter to select \xB7 Tab/Arrow keys to navigate \xB7 Esc to cancel")));
|
|
22015
22064
|
})())),
|
|
22016
|
-
isSubmitTab && /* @__PURE__ */
|
|
22065
|
+
isSubmitTab && /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column" }, /* @__PURE__ */ React93.createElement(Text76, { bold: true }, "Review your answers"), !allQuestionsAnswered && /* @__PURE__ */ React93.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React93.createElement(Text76, { color: theme.warning }, figures8.warning, " You have not answered all questions")), /* @__PURE__ */ React93.createElement(Box71, { flexDirection: "column", marginTop: 1 }, questions.filter((q) => q?.question && answers[q.question]).map((q) => /* @__PURE__ */ React93.createElement(Box71, { key: q.question, flexDirection: "column", marginLeft: 1 }, /* @__PURE__ */ React93.createElement(Text76, null, figures8.bullet, " ", q.question), /* @__PURE__ */ React93.createElement(Box71, { marginLeft: 2 }, /* @__PURE__ */ React93.createElement(Text76, { color: theme.success }, figures8.arrowRight, " ", answers[q.question]))))), /* @__PURE__ */ React93.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React93.createElement(Text76, { color: theme.secondaryText }, "Ready to submit your answers?")), /* @__PURE__ */ React93.createElement(Box71, { marginTop: 1 }, /* @__PURE__ */ React93.createElement(
|
|
22017
22066
|
Select,
|
|
22018
22067
|
{
|
|
22019
22068
|
options: [
|
|
@@ -22083,7 +22132,7 @@ function PermissionRequest({
|
|
|
22083
22132
|
`${PRODUCT_NAME} needs your permission to use ${toolName}`
|
|
22084
22133
|
);
|
|
22085
22134
|
const PermissionComponent = permissionComponentForTool(toolUseConfirm.tool);
|
|
22086
|
-
return /* @__PURE__ */
|
|
22135
|
+
return /* @__PURE__ */ React94.createElement(
|
|
22087
22136
|
PermissionComponent,
|
|
22088
22137
|
{
|
|
22089
22138
|
toolUseConfirm,
|
|
@@ -22094,8 +22143,8 @@ function PermissionRequest({
|
|
|
22094
22143
|
}
|
|
22095
22144
|
|
|
22096
22145
|
// src/ui/components/PromptInput.tsx
|
|
22097
|
-
import { Box as
|
|
22098
|
-
import * as
|
|
22146
|
+
import { Box as Box74, Text as Text79, useInput as useInput28 } from "ink";
|
|
22147
|
+
import * as React98 from "react";
|
|
22099
22148
|
|
|
22100
22149
|
// src/ui/hooks/useArrowKeyHistory.ts
|
|
22101
22150
|
import { useState as useState22 } from "react";
|
|
@@ -24129,8 +24178,8 @@ function countTokens(messages) {
|
|
|
24129
24178
|
}
|
|
24130
24179
|
|
|
24131
24180
|
// src/ui/components/SentryErrorBoundary.ts
|
|
24132
|
-
import * as
|
|
24133
|
-
var SentryErrorBoundary = class extends
|
|
24181
|
+
import * as React95 from "react";
|
|
24182
|
+
var SentryErrorBoundary = class extends React95.Component {
|
|
24134
24183
|
constructor(props) {
|
|
24135
24184
|
super(props);
|
|
24136
24185
|
this.state = { hasError: false };
|
|
@@ -24153,8 +24202,8 @@ var SentryErrorBoundary = class extends React94.Component {
|
|
|
24153
24202
|
};
|
|
24154
24203
|
|
|
24155
24204
|
// src/ui/components/TokenWarning.tsx
|
|
24156
|
-
import { Box as
|
|
24157
|
-
import * as
|
|
24205
|
+
import { Box as Box72, Text as Text77 } from "ink";
|
|
24206
|
+
import * as React96 from "react";
|
|
24158
24207
|
var MAX_TOKENS = 19e4;
|
|
24159
24208
|
var WARNING_THRESHOLD = MAX_TOKENS * 0.6;
|
|
24160
24209
|
var ERROR_THRESHOLD = MAX_TOKENS * 0.8;
|
|
@@ -24164,7 +24213,7 @@ function TokenWarning({ tokenUsage }) {
|
|
|
24164
24213
|
return null;
|
|
24165
24214
|
}
|
|
24166
24215
|
const isError = tokenUsage >= ERROR_THRESHOLD;
|
|
24167
|
-
return /* @__PURE__ */
|
|
24216
|
+
return /* @__PURE__ */ React96.createElement(Box72, { flexDirection: "row" }, /* @__PURE__ */ React96.createElement(Text77, { color: isError ? theme.error : theme.warning }, "Context low (", Math.max(0, 100 - Math.round(tokenUsage / MAX_TOKENS * 100)), "% remaining) \xB7 Run /compact to compact & continue"));
|
|
24168
24217
|
}
|
|
24169
24218
|
|
|
24170
24219
|
// src/utils/commands/hashCommand.ts
|
|
@@ -24210,8 +24259,8 @@ _Added on ${now.toLocaleString()} ${timezone}_`;
|
|
|
24210
24259
|
}
|
|
24211
24260
|
|
|
24212
24261
|
// src/ui/components/ModeIndicator.tsx
|
|
24213
|
-
import
|
|
24214
|
-
import { Box as
|
|
24262
|
+
import React97 from "react";
|
|
24263
|
+
import { Box as Box73, Text as Text78 } from "ink";
|
|
24215
24264
|
function __getModeIndicatorDisplayForTests(args) {
|
|
24216
24265
|
if (args.mode === "default") {
|
|
24217
24266
|
return {
|
|
@@ -24282,7 +24331,7 @@ function CompactModeIndicator() {
|
|
|
24282
24331
|
shortcutDisplayText: shortcut.displayText,
|
|
24283
24332
|
theme
|
|
24284
24333
|
});
|
|
24285
|
-
return /* @__PURE__ */
|
|
24334
|
+
return /* @__PURE__ */ React97.createElement(Text78, { color: indicator.color }, indicator.mainText, /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, indicator.shortcutHintText));
|
|
24286
24335
|
}
|
|
24287
24336
|
|
|
24288
24337
|
// src/utils/terminal/promptInputSpecialKey.ts
|
|
@@ -24409,7 +24458,7 @@ function useStatusLine() {
|
|
|
24409
24458
|
// src/ui/components/PromptInput.tsx
|
|
24410
24459
|
async function interpretHashCommand(input) {
|
|
24411
24460
|
try {
|
|
24412
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
24461
|
+
const { queryQuick: queryQuick2 } = await import("./llm-7FKEPBX3.js");
|
|
24413
24462
|
const systemPrompt = [
|
|
24414
24463
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
24415
24464
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -24481,8 +24530,8 @@ function PromptInput({
|
|
|
24481
24530
|
const [pastedImages, setPastedImages] = useState25([]);
|
|
24482
24531
|
const [isEditingExternally, setIsEditingExternally] = useState25(false);
|
|
24483
24532
|
const [currentPwd, setCurrentPwd] = useState25(process.cwd());
|
|
24484
|
-
const pastedTextCounter =
|
|
24485
|
-
const pastedImageCounter =
|
|
24533
|
+
const pastedTextCounter = React98.useRef(1);
|
|
24534
|
+
const pastedImageCounter = React98.useRef(1);
|
|
24486
24535
|
const { cycleMode, currentMode, toolPermissionContext } = usePermissionContext();
|
|
24487
24536
|
const modeCycleShortcut = useMemo24(() => getPermissionModeCycleShortcut(), []);
|
|
24488
24537
|
const showQuickModelSwitchShortcut = modeCycleShortcut.displayText !== "alt+m";
|
|
@@ -24517,13 +24566,13 @@ function PromptInput({
|
|
|
24517
24566
|
const isSelected = index === selectedIndex;
|
|
24518
24567
|
const isAgent = suggestion.type === "agent";
|
|
24519
24568
|
const displayColor = isSelected ? theme.suggestion : isAgent && suggestion.metadata?.color ? suggestion.metadata.color : void 0;
|
|
24520
|
-
return /* @__PURE__ */
|
|
24521
|
-
|
|
24569
|
+
return /* @__PURE__ */ React98.createElement(
|
|
24570
|
+
Box74,
|
|
24522
24571
|
{
|
|
24523
24572
|
key: `${suggestion.type}-${suggestion.value}-${index}`,
|
|
24524
24573
|
flexDirection: "row"
|
|
24525
24574
|
},
|
|
24526
|
-
/* @__PURE__ */
|
|
24575
|
+
/* @__PURE__ */ React98.createElement(Text79, { color: displayColor, dimColor: !isSelected && !displayColor }, isSelected ? "\u25C6 " : " ", suggestion.displayValue)
|
|
24527
24576
|
);
|
|
24528
24577
|
});
|
|
24529
24578
|
}, [suggestions, selectedIndex, theme.suggestion]);
|
|
@@ -24722,7 +24771,7 @@ function PromptInput({
|
|
|
24722
24771
|
if (messages2.length) {
|
|
24723
24772
|
if (mode === "bash") {
|
|
24724
24773
|
onQuery(messages2, newAbortController).then(async () => {
|
|
24725
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
24774
|
+
const { getCwd: getCwd2 } = await import("./state-VJMBMXXW.js");
|
|
24726
24775
|
setCurrentPwd(getCwd2());
|
|
24727
24776
|
});
|
|
24728
24777
|
} else {
|
|
@@ -24878,17 +24927,17 @@ function PromptInput({
|
|
|
24878
24927
|
currentTokens: tokenUsage
|
|
24879
24928
|
};
|
|
24880
24929
|
}, [tokenUsage, modelSwitchMessage.show, submitCount, currentModelId]);
|
|
24881
|
-
return /* @__PURE__ */
|
|
24882
|
-
|
|
24930
|
+
return /* @__PURE__ */ React98.createElement(Box74, { flexDirection: "column" }, (mode === "bash" || modelInfo) && /* @__PURE__ */ React98.createElement(
|
|
24931
|
+
Box74,
|
|
24883
24932
|
{
|
|
24884
24933
|
justifyContent: "space-between",
|
|
24885
24934
|
marginBottom: 1,
|
|
24886
24935
|
flexDirection: "row"
|
|
24887
24936
|
},
|
|
24888
|
-
mode === "bash" ? /* @__PURE__ */
|
|
24889
|
-
modelInfo && /* @__PURE__ */
|
|
24890
|
-
), /* @__PURE__ */
|
|
24891
|
-
|
|
24937
|
+
mode === "bash" ? /* @__PURE__ */ React98.createElement(Text79, { color: theme.bashBorder }, "Shell PWD: ", currentPwd) : /* @__PURE__ */ React98.createElement(Text79, null, " "),
|
|
24938
|
+
modelInfo && /* @__PURE__ */ React98.createElement(Text79, { dimColor: true }, "[", modelInfo.provider, "] ", modelInfo.name, ":", " ", Math.round(modelInfo.currentTokens / 1e3), "k /", " ", Math.round(modelInfo.contextLength / 1e3), "k")
|
|
24939
|
+
), /* @__PURE__ */ React98.createElement(
|
|
24940
|
+
Box74,
|
|
24892
24941
|
{
|
|
24893
24942
|
alignItems: "flex-start",
|
|
24894
24943
|
justifyContent: "flex-start",
|
|
@@ -24902,8 +24951,8 @@ function PromptInput({
|
|
|
24902
24951
|
marginTop: 1,
|
|
24903
24952
|
width: "100%"
|
|
24904
24953
|
},
|
|
24905
|
-
/* @__PURE__ */
|
|
24906
|
-
|
|
24954
|
+
/* @__PURE__ */ React98.createElement(
|
|
24955
|
+
Box74,
|
|
24907
24956
|
{
|
|
24908
24957
|
alignItems: "flex-start",
|
|
24909
24958
|
alignSelf: "flex-start",
|
|
@@ -24911,9 +24960,9 @@ function PromptInput({
|
|
|
24911
24960
|
justifyContent: "flex-start",
|
|
24912
24961
|
width: 3
|
|
24913
24962
|
},
|
|
24914
|
-
mode === "bash" ? /* @__PURE__ */
|
|
24963
|
+
mode === "bash" ? /* @__PURE__ */ React98.createElement(Text79, { color: theme.bashBorder }, "\xA0!\xA0") : mode === "pyb" ? /* @__PURE__ */ React98.createElement(Text79, { color: theme.noting }, "\xA0#\xA0") : /* @__PURE__ */ React98.createElement(Text79, { color: isLoading ? theme.secondaryText : void 0 }, "P>\xA0")
|
|
24915
24964
|
),
|
|
24916
|
-
/* @__PURE__ */
|
|
24965
|
+
/* @__PURE__ */ React98.createElement(Box74, { paddingRight: 1 }, /* @__PURE__ */ React98.createElement(
|
|
24917
24966
|
TextInput,
|
|
24918
24967
|
{
|
|
24919
24968
|
multiline: true,
|
|
@@ -24938,44 +24987,44 @@ function PromptInput({
|
|
|
24938
24987
|
onSpecialKey: handleSpecialKey
|
|
24939
24988
|
}
|
|
24940
24989
|
))
|
|
24941
|
-
), !completionActive && suggestions.length === 0 && /* @__PURE__ */
|
|
24942
|
-
|
|
24990
|
+
), !completionActive && suggestions.length === 0 && /* @__PURE__ */ React98.createElement(Box74, { flexDirection: "column", paddingX: 2, paddingY: 0 }, /* @__PURE__ */ React98.createElement(Box74, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React98.createElement(Box74, { justifyContent: "flex-start", gap: 1 }, exitMessage.show ? /* @__PURE__ */ React98.createElement(Text79, { dimColor: true }, "Press ", exitMessage.key, " again to exit") : message.show ? /* @__PURE__ */ React98.createElement(Text79, { dimColor: true }, message.text) : rewindMessagePending ? /* @__PURE__ */ React98.createElement(Text79, { dimColor: true }, "Press Escape again to undo") : modelSwitchMessage.show ? /* @__PURE__ */ React98.createElement(Text79, { color: theme.success }, modelSwitchMessage.text) : mode === "prompt" && currentMode !== "default" ? /* @__PURE__ */ React98.createElement(CompactModeIndicator, null) : /* @__PURE__ */ React98.createElement(React98.Fragment, null, /* @__PURE__ */ React98.createElement(
|
|
24991
|
+
Text79,
|
|
24943
24992
|
{
|
|
24944
24993
|
color: mode === "bash" ? theme.bashBorder : void 0,
|
|
24945
24994
|
dimColor: mode !== "bash"
|
|
24946
24995
|
},
|
|
24947
24996
|
"! run some shell command"
|
|
24948
|
-
), /* @__PURE__ */
|
|
24949
|
-
|
|
24997
|
+
), /* @__PURE__ */ React98.createElement(Text79, { dimColor: true }, " \xB7 / for commands"), /* @__PURE__ */ React98.createElement(
|
|
24998
|
+
Text79,
|
|
24950
24999
|
{
|
|
24951
25000
|
color: mode === "pyb" ? theme.noting : void 0,
|
|
24952
25001
|
dimColor: mode !== "pyb"
|
|
24953
25002
|
},
|
|
24954
25003
|
" ",
|
|
24955
25004
|
"\xB7 # tell agent something to remember forever"
|
|
24956
|
-
))), /* @__PURE__ */
|
|
25005
|
+
))), /* @__PURE__ */ React98.createElement(Box74, { justifyContent: "flex-end" }, /* @__PURE__ */ React98.createElement(Text79, { dimColor: true, wrap: "truncate-end" }, statusLine ? `${statusLine} \xB7 ESC to interrupt \xB7 2\xD7ESC for undo` : "ESC to interrupt \xB7 2\xD7ESC for undo"))), !exitMessage.show && !message.show && !modelSwitchMessage.show && !rewindMessagePending && /* @__PURE__ */ React98.createElement(Box74, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React98.createElement(Box74, { justifyContent: "flex-start", gap: 1 }, /* @__PURE__ */ React98.createElement(Text79, { dimColor: true, wrap: "truncate-end" }, "option+enter: newline \xB7", " ", showQuickModelSwitchShortcut ? "option+m: switch model \xB7 " : "", "option+g: external editor \xB7 ", modeCycleShortcut.displayText, ": switch mode")), /* @__PURE__ */ React98.createElement(
|
|
24957
25006
|
SentryErrorBoundary,
|
|
24958
25007
|
{
|
|
24959
|
-
children: /* @__PURE__ */
|
|
25008
|
+
children: /* @__PURE__ */ React98.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React98.createElement(TokenWarning, { tokenUsage }))
|
|
24960
25009
|
}
|
|
24961
|
-
))), suggestions.length > 0 && /* @__PURE__ */
|
|
24962
|
-
|
|
25010
|
+
))), suggestions.length > 0 && /* @__PURE__ */ React98.createElement(
|
|
25011
|
+
Box74,
|
|
24963
25012
|
{
|
|
24964
25013
|
flexDirection: "row",
|
|
24965
25014
|
justifyContent: "space-between",
|
|
24966
25015
|
paddingX: 2,
|
|
24967
25016
|
paddingY: 0
|
|
24968
25017
|
},
|
|
24969
|
-
/* @__PURE__ */
|
|
24970
|
-
|
|
25018
|
+
/* @__PURE__ */ React98.createElement(Box74, { flexDirection: "column" }, renderedSuggestions, /* @__PURE__ */ React98.createElement(
|
|
25019
|
+
Box74,
|
|
24971
25020
|
{
|
|
24972
25021
|
marginTop: 1,
|
|
24973
25022
|
paddingX: 3,
|
|
24974
25023
|
borderStyle: "round",
|
|
24975
25024
|
borderColor: "gray"
|
|
24976
25025
|
},
|
|
24977
|
-
/* @__PURE__ */
|
|
24978
|
-
|
|
25026
|
+
/* @__PURE__ */ React98.createElement(
|
|
25027
|
+
Text79,
|
|
24979
25028
|
{
|
|
24980
25029
|
dimColor: !emptyDirMessage,
|
|
24981
25030
|
color: emptyDirMessage ? "yellow" : void 0
|
|
@@ -24995,10 +25044,10 @@ function PromptInput({
|
|
|
24995
25044
|
})()
|
|
24996
25045
|
)
|
|
24997
25046
|
)),
|
|
24998
|
-
/* @__PURE__ */
|
|
25047
|
+
/* @__PURE__ */ React98.createElement(
|
|
24999
25048
|
SentryErrorBoundary,
|
|
25000
25049
|
{
|
|
25001
|
-
children: /* @__PURE__ */
|
|
25050
|
+
children: /* @__PURE__ */ React98.createElement(Box74, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React98.createElement(TokenWarning, { tokenUsage: countTokens(messages) }))
|
|
25002
25051
|
}
|
|
25003
25052
|
)
|
|
25004
25053
|
));
|
|
@@ -25467,7 +25516,7 @@ function emitListChanged(listId) {
|
|
|
25467
25516
|
blocked: readyBlocked.blocked.length,
|
|
25468
25517
|
done: tasks.filter((task) => task.status === "done").length,
|
|
25469
25518
|
inProgress: tasks.filter((task) => task.status === "in_progress").length,
|
|
25470
|
-
|
|
25519
|
+
pending: tasks.filter((task) => task.status === "pending").length,
|
|
25471
25520
|
archived: tasks.filter((task) => task.status === "archived").length
|
|
25472
25521
|
}
|
|
25473
25522
|
});
|
|
@@ -26779,17 +26828,17 @@ function createErrorToolResultBlock(args) {
|
|
|
26779
26828
|
}
|
|
26780
26829
|
|
|
26781
26830
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
26782
|
-
import { default as
|
|
26831
|
+
import { default as React102, useCallback as useCallback15 } from "react";
|
|
26783
26832
|
|
|
26784
26833
|
// src/ui/components/binary-feedback/BinaryFeedbackView.tsx
|
|
26785
26834
|
import chalk14 from "chalk";
|
|
26786
|
-
import { Box as
|
|
26835
|
+
import { Box as Box76, Text as Text80, useInput as useInput30 } from "ink";
|
|
26787
26836
|
import Link2 from "ink-link";
|
|
26788
|
-
import
|
|
26837
|
+
import React101, { useState as useState26 } from "react";
|
|
26789
26838
|
|
|
26790
26839
|
// src/ui/components/binary-feedback/BinaryFeedbackOption.tsx
|
|
26791
|
-
import * as
|
|
26792
|
-
import { Box as
|
|
26840
|
+
import * as React100 from "react";
|
|
26841
|
+
import { Box as Box75 } from "ink";
|
|
26793
26842
|
function BinaryFeedbackOption({
|
|
26794
26843
|
debug: debug2,
|
|
26795
26844
|
erroredToolUseIDs,
|
|
@@ -26801,7 +26850,7 @@ function BinaryFeedbackOption({
|
|
|
26801
26850
|
verbose
|
|
26802
26851
|
}) {
|
|
26803
26852
|
const { columns } = useTerminalSize();
|
|
26804
|
-
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */
|
|
26853
|
+
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */ React100.createElement(Box75, { flexDirection: "column", key: index }, /* @__PURE__ */ React100.createElement(
|
|
26805
26854
|
Message,
|
|
26806
26855
|
{
|
|
26807
26856
|
addMargin: false,
|
|
@@ -26817,7 +26866,7 @@ function BinaryFeedbackOption({
|
|
|
26817
26866
|
verbose,
|
|
26818
26867
|
width: columns / 2 - 6
|
|
26819
26868
|
}
|
|
26820
|
-
), /* @__PURE__ */
|
|
26869
|
+
), /* @__PURE__ */ React100.createElement(AdditionalContext, { message: _, verbose })));
|
|
26821
26870
|
}
|
|
26822
26871
|
function AdditionalContext({
|
|
26823
26872
|
message,
|
|
@@ -26849,7 +26898,7 @@ function AdditionalContext({
|
|
|
26849
26898
|
} catch {
|
|
26850
26899
|
return null;
|
|
26851
26900
|
}
|
|
26852
|
-
return /* @__PURE__ */
|
|
26901
|
+
return /* @__PURE__ */ React100.createElement(
|
|
26853
26902
|
FileEditToolDiff,
|
|
26854
26903
|
{
|
|
26855
26904
|
file_path: input.data.file_path,
|
|
@@ -26865,7 +26914,7 @@ function AdditionalContext({
|
|
|
26865
26914
|
if (!input.success) {
|
|
26866
26915
|
return null;
|
|
26867
26916
|
}
|
|
26868
|
-
return /* @__PURE__ */
|
|
26917
|
+
return /* @__PURE__ */ React100.createElement(
|
|
26869
26918
|
FileWriteToolDiff,
|
|
26870
26919
|
{
|
|
26871
26920
|
file_path: input.data.file_path,
|
|
@@ -26930,8 +26979,8 @@ function BinaryFeedbackView({
|
|
|
26930
26979
|
onChoose?.("neither");
|
|
26931
26980
|
}
|
|
26932
26981
|
});
|
|
26933
|
-
return /* @__PURE__ */
|
|
26934
|
-
|
|
26982
|
+
return /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(
|
|
26983
|
+
Box76,
|
|
26935
26984
|
{
|
|
26936
26985
|
flexDirection: "column",
|
|
26937
26986
|
height: "100%",
|
|
@@ -26939,9 +26988,9 @@ function BinaryFeedbackView({
|
|
|
26939
26988
|
borderStyle: "round",
|
|
26940
26989
|
borderColor: theme.permission
|
|
26941
26990
|
},
|
|
26942
|
-
/* @__PURE__ */
|
|
26943
|
-
/* @__PURE__ */
|
|
26944
|
-
|
|
26991
|
+
/* @__PURE__ */ React101.createElement(Box76, { width: "100%", justifyContent: "space-between", paddingX: 1 }, /* @__PURE__ */ React101.createElement(Text80, { bold: true, color: theme.permission }, "[ANT-ONLY] Help train ", PRODUCT_NAME), /* @__PURE__ */ React101.createElement(Text80, null, /* @__PURE__ */ React101.createElement(Link2, { url: HELP_URL }, "[?]"))),
|
|
26992
|
+
/* @__PURE__ */ React101.createElement(Box76, { flexDirection: "row", width: "100%", flexGrow: 1, paddingTop: 1 }, /* @__PURE__ */ React101.createElement(
|
|
26993
|
+
Box76,
|
|
26945
26994
|
{
|
|
26946
26995
|
flexDirection: "column",
|
|
26947
26996
|
flexGrow: 1,
|
|
@@ -26952,7 +27001,7 @@ function BinaryFeedbackView({
|
|
|
26952
27001
|
marginRight: 1,
|
|
26953
27002
|
padding: 1
|
|
26954
27003
|
},
|
|
26955
|
-
/* @__PURE__ */
|
|
27004
|
+
/* @__PURE__ */ React101.createElement(
|
|
26956
27005
|
BinaryFeedbackOption,
|
|
26957
27006
|
{
|
|
26958
27007
|
erroredToolUseIDs,
|
|
@@ -26965,8 +27014,8 @@ function BinaryFeedbackView({
|
|
|
26965
27014
|
verbose
|
|
26966
27015
|
}
|
|
26967
27016
|
)
|
|
26968
|
-
), /* @__PURE__ */
|
|
26969
|
-
|
|
27017
|
+
), /* @__PURE__ */ React101.createElement(
|
|
27018
|
+
Box76,
|
|
26970
27019
|
{
|
|
26971
27020
|
flexDirection: "column",
|
|
26972
27021
|
flexGrow: 1,
|
|
@@ -26977,7 +27026,7 @@ function BinaryFeedbackView({
|
|
|
26977
27026
|
marginLeft: 1,
|
|
26978
27027
|
padding: 1
|
|
26979
27028
|
},
|
|
26980
|
-
/* @__PURE__ */
|
|
27029
|
+
/* @__PURE__ */ React101.createElement(
|
|
26981
27030
|
BinaryFeedbackOption,
|
|
26982
27031
|
{
|
|
26983
27032
|
erroredToolUseIDs,
|
|
@@ -26991,7 +27040,7 @@ function BinaryFeedbackView({
|
|
|
26991
27040
|
}
|
|
26992
27041
|
)
|
|
26993
27042
|
)),
|
|
26994
|
-
/* @__PURE__ */
|
|
27043
|
+
/* @__PURE__ */ React101.createElement(Box76, { flexDirection: "column", paddingTop: 1, paddingX: 1 }, /* @__PURE__ */ React101.createElement(Text80, null, "How do you want to proceed?"), /* @__PURE__ */ React101.createElement(
|
|
26995
27044
|
Select,
|
|
26996
27045
|
{
|
|
26997
27046
|
options: getOptions2(),
|
|
@@ -27000,7 +27049,7 @@ function BinaryFeedbackView({
|
|
|
27000
27049
|
onChange: onChoose
|
|
27001
27050
|
}
|
|
27002
27051
|
))
|
|
27003
|
-
), exitState.pending ? /* @__PURE__ */
|
|
27052
|
+
), exitState.pending ? /* @__PURE__ */ React101.createElement(Box76, { marginLeft: 3 }, /* @__PURE__ */ React101.createElement(Text80, { dimColor: true }, "Press ", exitState.keyName, " again to exit")) : /* @__PURE__ */ React101.createElement(Text80, null, " "));
|
|
27004
27053
|
}
|
|
27005
27054
|
|
|
27006
27055
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
@@ -27026,7 +27075,7 @@ function BinaryFeedback({
|
|
|
27026
27075
|
useNotifyAfterTimeout(
|
|
27027
27076
|
`${PRODUCT_NAME} needs your input on a response comparison`
|
|
27028
27077
|
);
|
|
27029
|
-
return /* @__PURE__ */
|
|
27078
|
+
return /* @__PURE__ */ React102.createElement(
|
|
27030
27079
|
BinaryFeedbackView,
|
|
27031
27080
|
{
|
|
27032
27081
|
debug: debug2,
|
|
@@ -27420,7 +27469,7 @@ function REPL({
|
|
|
27420
27469
|
const messagesJSX = useMemo25(() => {
|
|
27421
27470
|
return orderedMessages.map((_, index) => {
|
|
27422
27471
|
const toolUseID = getToolUseID(_);
|
|
27423
|
-
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */
|
|
27472
|
+
const message = _.type === "progress" ? _.content.message.content[0]?.type === "text" && _.content.message.content[0].text === INTERRUPT_MESSAGE ? /* @__PURE__ */ React103.createElement(
|
|
27424
27473
|
Message,
|
|
27425
27474
|
{
|
|
27426
27475
|
message: _.content,
|
|
@@ -27435,10 +27484,10 @@ function REPL({
|
|
|
27435
27484
|
shouldAnimate: false,
|
|
27436
27485
|
shouldShowDot: false
|
|
27437
27486
|
}
|
|
27438
|
-
) : /* @__PURE__ */
|
|
27487
|
+
) : /* @__PURE__ */ React103.createElement(
|
|
27439
27488
|
MessageResponse,
|
|
27440
27489
|
{
|
|
27441
|
-
children: /* @__PURE__ */
|
|
27490
|
+
children: /* @__PURE__ */ React103.createElement(
|
|
27442
27491
|
Message,
|
|
27443
27492
|
{
|
|
27444
27493
|
message: _.content,
|
|
@@ -27457,7 +27506,7 @@ function REPL({
|
|
|
27457
27506
|
}
|
|
27458
27507
|
)
|
|
27459
27508
|
}
|
|
27460
|
-
) : /* @__PURE__ */
|
|
27509
|
+
) : /* @__PURE__ */ React103.createElement(
|
|
27461
27510
|
Message,
|
|
27462
27511
|
{
|
|
27463
27512
|
message: _,
|
|
@@ -27476,8 +27525,8 @@ function REPL({
|
|
|
27476
27525
|
const isInStaticPrefix = index < replStaticPrefixLength;
|
|
27477
27526
|
if (debug2) {
|
|
27478
27527
|
return {
|
|
27479
|
-
jsx: /* @__PURE__ */
|
|
27480
|
-
|
|
27528
|
+
jsx: /* @__PURE__ */ React103.createElement(
|
|
27529
|
+
Box77,
|
|
27481
27530
|
{
|
|
27482
27531
|
borderStyle: "single",
|
|
27483
27532
|
borderColor: isInStaticPrefix ? "green" : "red",
|
|
@@ -27489,7 +27538,7 @@ function REPL({
|
|
|
27489
27538
|
};
|
|
27490
27539
|
}
|
|
27491
27540
|
return {
|
|
27492
|
-
jsx: /* @__PURE__ */
|
|
27541
|
+
jsx: /* @__PURE__ */ React103.createElement(Box77, { key: _.uuid, width: "100%" }, message)
|
|
27493
27542
|
};
|
|
27494
27543
|
});
|
|
27495
27544
|
}, [
|
|
@@ -27512,7 +27561,7 @@ function REPL({
|
|
|
27512
27561
|
const staticItems = useMemo25(
|
|
27513
27562
|
() => [
|
|
27514
27563
|
{
|
|
27515
|
-
jsx: /* @__PURE__ */
|
|
27564
|
+
jsx: /* @__PURE__ */ React103.createElement(Box77, { flexDirection: "column", key: `logo${forkNumber}` }, /* @__PURE__ */ React103.createElement(
|
|
27516
27565
|
Logo,
|
|
27517
27566
|
{
|
|
27518
27567
|
mcpClients,
|
|
@@ -27520,7 +27569,7 @@ function REPL({
|
|
|
27520
27569
|
updateBannerVersion: updateAvailableVersion,
|
|
27521
27570
|
updateBannerCommands: updateCommands
|
|
27522
27571
|
}
|
|
27523
|
-
), /* @__PURE__ */
|
|
27572
|
+
), /* @__PURE__ */ React103.createElement(ProjectOnboarding, { workspaceDir: getOriginalCwd() }))
|
|
27524
27573
|
},
|
|
27525
27574
|
...messagesJSX.slice(0, replStaticPrefixLength)
|
|
27526
27575
|
],
|
|
@@ -27540,23 +27589,23 @@ function REPL({
|
|
|
27540
27589
|
);
|
|
27541
27590
|
const showingCostDialog = !isLoading && showCostDialog;
|
|
27542
27591
|
const conversationKey = `${messageLogName}:${forkNumber}`;
|
|
27543
|
-
return /* @__PURE__ */
|
|
27592
|
+
return /* @__PURE__ */ React103.createElement(
|
|
27544
27593
|
PermissionProvider,
|
|
27545
27594
|
{
|
|
27546
27595
|
conversationKey,
|
|
27547
27596
|
isBypassPermissionsModeAvailable: !safeMode
|
|
27548
27597
|
},
|
|
27549
|
-
/* @__PURE__ */
|
|
27550
|
-
|
|
27598
|
+
/* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(React103.Fragment, { key: `static-messages-${forkNumber}` }, /* @__PURE__ */ React103.createElement(Static2, { items: staticItems, children: (item) => item.jsx })), transientItems.map((_) => _.jsx), /* @__PURE__ */ React103.createElement(
|
|
27599
|
+
Box77,
|
|
27551
27600
|
{
|
|
27552
27601
|
borderColor: "red",
|
|
27553
27602
|
borderStyle: debug2 ? "single" : void 0,
|
|
27554
27603
|
flexDirection: "column",
|
|
27555
27604
|
width: "100%"
|
|
27556
27605
|
},
|
|
27557
|
-
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */
|
|
27606
|
+
!toolJSX && !toolUseConfirm && !binaryFeedbackContext && isLoading && /* @__PURE__ */ React103.createElement(RequestStatusIndicator, null),
|
|
27558
27607
|
toolJSX ? toolJSX.jsx : null,
|
|
27559
|
-
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */
|
|
27608
|
+
!toolJSX && binaryFeedbackContext && !isMessageSelectorVisible && /* @__PURE__ */ React103.createElement(
|
|
27560
27609
|
BinaryFeedback,
|
|
27561
27610
|
{
|
|
27562
27611
|
m1: binaryFeedbackContext.m1,
|
|
@@ -27574,7 +27623,7 @@ function REPL({
|
|
|
27574
27623
|
unresolvedToolUseIDs
|
|
27575
27624
|
}
|
|
27576
27625
|
),
|
|
27577
|
-
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */
|
|
27626
|
+
!toolJSX && toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && /* @__PURE__ */ React103.createElement(
|
|
27578
27627
|
PermissionRequest,
|
|
27579
27628
|
{
|
|
27580
27629
|
toolUseConfirm,
|
|
@@ -27582,7 +27631,7 @@ function REPL({
|
|
|
27582
27631
|
verbose
|
|
27583
27632
|
}
|
|
27584
27633
|
),
|
|
27585
|
-
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */
|
|
27634
|
+
!toolJSX && !toolUseConfirm && !isMessageSelectorVisible && !binaryFeedbackContext && showingCostDialog && /* @__PURE__ */ React103.createElement(
|
|
27586
27635
|
CostThresholdDialog,
|
|
27587
27636
|
{
|
|
27588
27637
|
onDone: () => {
|
|
@@ -27596,7 +27645,7 @@ function REPL({
|
|
|
27596
27645
|
}
|
|
27597
27646
|
}
|
|
27598
27647
|
),
|
|
27599
|
-
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */
|
|
27648
|
+
!toolUseConfirm && !toolJSX?.shouldHidePromptInput && shouldShowPromptInput && !isMessageSelectorVisible && !binaryFeedbackContext && !showingCostDialog && /* @__PURE__ */ React103.createElement(React103.Fragment, null, /* @__PURE__ */ React103.createElement(
|
|
27600
27649
|
PromptInput_default,
|
|
27601
27650
|
{
|
|
27602
27651
|
commands,
|
|
@@ -27626,7 +27675,7 @@ function REPL({
|
|
|
27626
27675
|
abortController
|
|
27627
27676
|
}
|
|
27628
27677
|
))
|
|
27629
|
-
), isMessageSelectorVisible && /* @__PURE__ */
|
|
27678
|
+
), isMessageSelectorVisible && /* @__PURE__ */ React103.createElement(
|
|
27630
27679
|
MessageSelector,
|
|
27631
27680
|
{
|
|
27632
27681
|
erroredToolUseIDs,
|
|
@@ -27652,13 +27701,13 @@ function REPL({
|
|
|
27652
27701
|
onEscape: () => setIsMessageSelectorVisible(false),
|
|
27653
27702
|
tools
|
|
27654
27703
|
}
|
|
27655
|
-
), /* @__PURE__ */
|
|
27704
|
+
), /* @__PURE__ */ React103.createElement(Newline4, null))
|
|
27656
27705
|
);
|
|
27657
27706
|
}
|
|
27658
27707
|
|
|
27659
27708
|
// src/ui/components/SessionSelector.tsx
|
|
27660
|
-
import
|
|
27661
|
-
import { Box as
|
|
27709
|
+
import React104 from "react";
|
|
27710
|
+
import { Box as Box78, Text as Text82 } from "ink";
|
|
27662
27711
|
function SessionSelector({
|
|
27663
27712
|
sessions,
|
|
27664
27713
|
onSelect
|
|
@@ -27686,14 +27735,14 @@ function SessionSelector({
|
|
|
27686
27735
|
const truncated = labelTxt.length > columns - 2 ? `${labelTxt.slice(0, columns - 5)}...` : labelTxt;
|
|
27687
27736
|
return { label: truncated, value: String(i) };
|
|
27688
27737
|
});
|
|
27689
|
-
return /* @__PURE__ */
|
|
27738
|
+
return /* @__PURE__ */ React104.createElement(Box78, { flexDirection: "column", height: "100%", width: "100%" }, /* @__PURE__ */ React104.createElement(Box78, { paddingLeft: 9 }, /* @__PURE__ */ React104.createElement(Text82, { bold: true, color: getTheme().text }, "Modified"), /* @__PURE__ */ React104.createElement(Text82, null, " "), /* @__PURE__ */ React104.createElement(Text82, { bold: true, color: getTheme().text }, "Created"), /* @__PURE__ */ React104.createElement(Text82, null, " "), /* @__PURE__ */ React104.createElement(Text82, { bold: true, color: getTheme().text }, "Tag"), /* @__PURE__ */ React104.createElement(Text82, null, " "), /* @__PURE__ */ React104.createElement(Text82, { bold: true, color: getTheme().text }, "Session")), /* @__PURE__ */ React104.createElement(
|
|
27690
27739
|
Select,
|
|
27691
27740
|
{
|
|
27692
27741
|
options,
|
|
27693
27742
|
onChange: (value) => onSelect(parseInt(value, 10)),
|
|
27694
27743
|
visibleOptionCount: visibleCount
|
|
27695
27744
|
}
|
|
27696
|
-
), hiddenCount > 0 && /* @__PURE__ */
|
|
27745
|
+
), hiddenCount > 0 && /* @__PURE__ */ React104.createElement(Box78, { paddingLeft: 2 }, /* @__PURE__ */ React104.createElement(Text82, { color: getTheme().secondaryText }, "and ", hiddenCount, " more\u2026")));
|
|
27697
27746
|
}
|
|
27698
27747
|
|
|
27699
27748
|
// src/ui/screens/ResumeConversation.tsx
|
|
@@ -27729,7 +27778,7 @@ function ResumeConversation({
|
|
|
27729
27778
|
});
|
|
27730
27779
|
const isDefaultModel = await isDefaultSlowAndCapableModel();
|
|
27731
27780
|
render(
|
|
27732
|
-
/* @__PURE__ */
|
|
27781
|
+
/* @__PURE__ */ React105.createElement(
|
|
27733
27782
|
REPL,
|
|
27734
27783
|
{
|
|
27735
27784
|
commands,
|
|
@@ -27757,7 +27806,7 @@ function ResumeConversation({
|
|
|
27757
27806
|
throw e;
|
|
27758
27807
|
}
|
|
27759
27808
|
}
|
|
27760
|
-
return /* @__PURE__ */
|
|
27809
|
+
return /* @__PURE__ */ React105.createElement(SessionSelector, { sessions, onSelect });
|
|
27761
27810
|
}
|
|
27762
27811
|
|
|
27763
27812
|
// src/commands/resume.tsx
|
|
@@ -27780,7 +27829,7 @@ var resume_default = {
|
|
|
27780
27829
|
return null;
|
|
27781
27830
|
}
|
|
27782
27831
|
render2(
|
|
27783
|
-
/* @__PURE__ */
|
|
27832
|
+
/* @__PURE__ */ React106.createElement(
|
|
27784
27833
|
ResumeConversation,
|
|
27785
27834
|
{
|
|
27786
27835
|
cwd,
|
|
@@ -27797,11 +27846,11 @@ var resume_default = {
|
|
|
27797
27846
|
};
|
|
27798
27847
|
|
|
27799
27848
|
// src/commands/agents.tsx
|
|
27800
|
-
import
|
|
27849
|
+
import React108 from "react";
|
|
27801
27850
|
|
|
27802
27851
|
// src/commands/agents/ui.tsx
|
|
27803
|
-
import
|
|
27804
|
-
import { Box as
|
|
27852
|
+
import React107, { useCallback as useCallback17, useEffect as useEffect26, useMemo as useMemo26, useRef as useRef14, useState as useState28 } from "react";
|
|
27853
|
+
import { Box as Box79, Text as Text83, useInput as useInput31 } from "ink";
|
|
27805
27854
|
import figures9 from "figures";
|
|
27806
27855
|
import chalk15 from "chalk";
|
|
27807
27856
|
import { join as join12 } from "path";
|
|
@@ -27855,7 +27904,7 @@ import { homedir as homedir7 } from "os";
|
|
|
27855
27904
|
// src/commands/agents/generation.ts
|
|
27856
27905
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
27857
27906
|
async function generateAgentWithClaude(prompt) {
|
|
27858
|
-
const { queryModel } = await import("./llm-
|
|
27907
|
+
const { queryModel } = await import("./llm-7FKEPBX3.js");
|
|
27859
27908
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
27860
27909
|
|
|
27861
27910
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -28237,21 +28286,21 @@ function panelBorderColor(kind) {
|
|
|
28237
28286
|
}
|
|
28238
28287
|
function Panel(props) {
|
|
28239
28288
|
const theme = getTheme();
|
|
28240
|
-
return /* @__PURE__ */
|
|
28241
|
-
|
|
28289
|
+
return /* @__PURE__ */ React107.createElement(
|
|
28290
|
+
Box79,
|
|
28242
28291
|
{
|
|
28243
28292
|
borderStyle: "round",
|
|
28244
28293
|
borderColor: props.borderColor ?? theme.suggestion,
|
|
28245
28294
|
flexDirection: "column"
|
|
28246
28295
|
},
|
|
28247
|
-
/* @__PURE__ */
|
|
28248
|
-
/* @__PURE__ */
|
|
28296
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React107.createElement(Text83, { bold: true, color: props.titleColor ?? theme.text }, props.title), props.subtitle ? /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, props.subtitle) : null),
|
|
28297
|
+
/* @__PURE__ */ React107.createElement(Box79, { paddingX: 1, flexDirection: "column" }, props.children)
|
|
28249
28298
|
);
|
|
28250
28299
|
}
|
|
28251
28300
|
function Instructions({
|
|
28252
28301
|
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
28253
28302
|
}) {
|
|
28254
|
-
return /* @__PURE__ */
|
|
28303
|
+
return /* @__PURE__ */ React107.createElement(Box79, { marginLeft: 3 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, instructions));
|
|
28255
28304
|
}
|
|
28256
28305
|
function computeOverrides(args) {
|
|
28257
28306
|
const activeByType = /* @__PURE__ */ new Map();
|
|
@@ -28330,38 +28379,38 @@ function AgentsListView(props) {
|
|
|
28330
28379
|
setSelectedAgent(nextAgent);
|
|
28331
28380
|
}
|
|
28332
28381
|
});
|
|
28333
|
-
const renderCreateNew = () => /* @__PURE__ */
|
|
28382
|
+
const renderCreateNew = () => /* @__PURE__ */ React107.createElement(Box79, null, /* @__PURE__ */ React107.createElement(Text83, { color: onCreateOption ? theme.suggestion : void 0 }, onCreateOption ? `${figures9.pointer} ` : " "), /* @__PURE__ */ React107.createElement(Text83, { color: onCreateOption ? theme.suggestion : void 0 }, "Create new agent"));
|
|
28334
28383
|
const renderAgentRow = (agent) => {
|
|
28335
28384
|
const isBuiltIn = agent.source === "built-in";
|
|
28336
28385
|
const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.source === agent.source;
|
|
28337
28386
|
const dimmed = Boolean(isBuiltIn || agent.overriddenBy);
|
|
28338
28387
|
const rowColor = isSelected ? theme.suggestion : void 0;
|
|
28339
28388
|
const pointer = isBuiltIn ? "" : isSelected ? `${figures9.pointer} ` : " ";
|
|
28340
|
-
return /* @__PURE__ */
|
|
28389
|
+
return /* @__PURE__ */ React107.createElement(Box79, { key: `${agent.agentType}-${agent.source}`, flexDirection: "row" }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: dimmed && !isSelected, color: rowColor }, pointer), /* @__PURE__ */ React107.createElement(Text83, { dimColor: dimmed && !isSelected, color: rowColor }, agent.agentType), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true, color: rowColor }, " \xB7 ", formatModelShort(agent.model)), agent.overriddenBy ? /* @__PURE__ */ React107.createElement(Text83, { dimColor: !isSelected, color: isSelected ? theme.warning : void 0 }, " ", figures9.warning, " overridden by ", agent.overriddenBy) : null);
|
|
28341
28390
|
};
|
|
28342
28391
|
const group = (label, agents) => {
|
|
28343
28392
|
if (agents.length === 0) return null;
|
|
28344
28393
|
const baseDir = agents[0]?.baseDir;
|
|
28345
|
-
return /* @__PURE__ */
|
|
28394
|
+
return /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React107.createElement(Box79, { paddingLeft: 2 }, /* @__PURE__ */ React107.createElement(Text83, { bold: true, dimColor: true }, label), baseDir ? /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, " ", "(", baseDir, ")") : null), agents.map(renderAgentRow));
|
|
28346
28395
|
};
|
|
28347
28396
|
const builtInSection = (label = "Built-in (always available):") => {
|
|
28348
28397
|
const builtIn = props.agents.filter((a) => a.source === "built-in");
|
|
28349
28398
|
if (builtIn.length === 0) return null;
|
|
28350
|
-
return /* @__PURE__ */
|
|
28399
|
+
return /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React107.createElement(Text83, { bold: true, dimColor: true }, label), builtIn.map(renderAgentRow));
|
|
28351
28400
|
};
|
|
28352
28401
|
const notOverriddenCount = props.agents.filter((a) => !a.overriddenBy).length;
|
|
28353
28402
|
const title = titleForSource(props.source);
|
|
28354
28403
|
if (props.agents.length === 0 || props.source !== "built-in" && !props.agents.some((a) => a.source !== "built-in")) {
|
|
28355
|
-
return /* @__PURE__ */
|
|
28404
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title, subtitle: "No agents found" }, props.onCreateNew ? /* @__PURE__ */ React107.createElement(Box79, { marginY: 1 }, renderCreateNew()) : null, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "No agents found. Create specialized subagents that Claude can delegate to."), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Each subagent has its own context window, custom system prompt, and specific tools."), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer."), props.source !== "built-in" && props.agents.some((a) => a.source === "built-in") ? /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "\u2500".repeat(40))), builtInSection()) : null), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
28356
28405
|
}
|
|
28357
|
-
return /* @__PURE__ */
|
|
28406
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
|
|
28358
28407
|
Panel,
|
|
28359
28408
|
{
|
|
28360
28409
|
title,
|
|
28361
28410
|
subtitle: `${notOverriddenCount} agents`
|
|
28362
28411
|
},
|
|
28363
|
-
props.changes.length > 0 ? /* @__PURE__ */
|
|
28364
|
-
/* @__PURE__ */
|
|
28412
|
+
props.changes.length > 0 ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, props.changes[props.changes.length - 1])) : null,
|
|
28413
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1 }, props.onCreateNew ? /* @__PURE__ */ React107.createElement(Box79, { marginBottom: 1 }, renderCreateNew()) : null, props.source === "all" ? /* @__PURE__ */ React107.createElement(React107.Fragment, null, group(
|
|
28365
28414
|
"User agents",
|
|
28366
28415
|
props.agents.filter((a) => a.source === "userSettings")
|
|
28367
28416
|
), group(
|
|
@@ -28376,8 +28425,8 @@ function AgentsListView(props) {
|
|
|
28376
28425
|
), group(
|
|
28377
28426
|
"CLI arg agents",
|
|
28378
28427
|
props.agents.filter((a) => a.source === "flagSettings")
|
|
28379
|
-
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */
|
|
28380
|
-
), /* @__PURE__ */
|
|
28428
|
+
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true, italic: true }, "Built-in agents are provided by default and cannot be modified."), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, props.agents.map(renderAgentRow))) : /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column" }, props.agents.filter((a) => a.source !== "built-in").map(renderAgentRow)))
|
|
28429
|
+
), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
28381
28430
|
}
|
|
28382
28431
|
function wizardLocationToStorageLocation(location) {
|
|
28383
28432
|
return location === "projectSettings" ? "project" : "user";
|
|
@@ -28468,16 +28517,16 @@ function Wizard(props) {
|
|
|
28468
28517
|
cancel
|
|
28469
28518
|
]
|
|
28470
28519
|
);
|
|
28471
|
-
return /* @__PURE__ */
|
|
28520
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, props.steps[stepIndex]?.(ctx) ?? null);
|
|
28472
28521
|
}
|
|
28473
28522
|
function WizardPanel(props) {
|
|
28474
|
-
return /* @__PURE__ */
|
|
28523
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: "Create new agent", subtitle: props.subtitle }, props.children), /* @__PURE__ */ React107.createElement(Instructions, { instructions: props.footerText }));
|
|
28475
28524
|
}
|
|
28476
28525
|
function StepChooseLocation({ ctx }) {
|
|
28477
28526
|
useInput31((_input, key) => {
|
|
28478
28527
|
if (key.escape) ctx.cancel();
|
|
28479
28528
|
});
|
|
28480
|
-
return /* @__PURE__ */
|
|
28529
|
+
return /* @__PURE__ */ React107.createElement(WizardPanel, { subtitle: "Choose location", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to cancel" }, /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(
|
|
28481
28530
|
Select,
|
|
28482
28531
|
{
|
|
28483
28532
|
options: [
|
|
@@ -28496,7 +28545,7 @@ function StepChooseMethod({ ctx }) {
|
|
|
28496
28545
|
useInput31((_input, key) => {
|
|
28497
28546
|
if (key.escape) ctx.goBack();
|
|
28498
28547
|
});
|
|
28499
|
-
return /* @__PURE__ */
|
|
28548
|
+
return /* @__PURE__ */ React107.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(
|
|
28500
28549
|
Select,
|
|
28501
28550
|
{
|
|
28502
28551
|
options: [
|
|
@@ -28580,7 +28629,7 @@ function StepGenerationPrompt(props) {
|
|
|
28580
28629
|
abortRef.current = null;
|
|
28581
28630
|
}
|
|
28582
28631
|
};
|
|
28583
|
-
return /* @__PURE__ */
|
|
28632
|
+
return /* @__PURE__ */ React107.createElement(WizardPanel, { subtitle: "Describe the agent you want" }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, "What should this agent do?"), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Describe a role like \u201Ccode reviewer\u201D, \u201Csecurity auditor\u201D, or \u201Ctech lead\u201D."), /* @__PURE__ */ React107.createElement(
|
|
28584
28633
|
TextInput,
|
|
28585
28634
|
{
|
|
28586
28635
|
value,
|
|
@@ -28591,7 +28640,7 @@ function StepGenerationPrompt(props) {
|
|
|
28591
28640
|
cursorOffset,
|
|
28592
28641
|
onChangeCursorOffset: setCursorOffset
|
|
28593
28642
|
}
|
|
28594
|
-
), error ? /* @__PURE__ */
|
|
28643
|
+
), error ? /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error) : null, isGenerating ? /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Generating\u2026") : null));
|
|
28595
28644
|
}
|
|
28596
28645
|
function themeColor(kind) {
|
|
28597
28646
|
const theme = getTheme();
|
|
@@ -28627,13 +28676,13 @@ function StepAgentType(props) {
|
|
|
28627
28676
|
ctx.updateWizardData({ agentType: trimmed });
|
|
28628
28677
|
ctx.goNext();
|
|
28629
28678
|
};
|
|
28630
|
-
return /* @__PURE__ */
|
|
28679
|
+
return /* @__PURE__ */ React107.createElement(
|
|
28631
28680
|
WizardPanel,
|
|
28632
28681
|
{
|
|
28633
28682
|
subtitle: "Agent type (identifier)",
|
|
28634
28683
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28635
28684
|
},
|
|
28636
|
-
/* @__PURE__ */
|
|
28685
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, "Enter a unique identifier for your agent:"), /* @__PURE__ */ React107.createElement(
|
|
28637
28686
|
TextInput,
|
|
28638
28687
|
{
|
|
28639
28688
|
value,
|
|
@@ -28643,7 +28692,7 @@ function StepAgentType(props) {
|
|
|
28643
28692
|
cursorOffset,
|
|
28644
28693
|
onChangeCursorOffset: setCursorOffset
|
|
28645
28694
|
}
|
|
28646
|
-
), /* @__PURE__ */
|
|
28695
|
+
), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "e.g., code-reviewer, tech-lead, etc"), error ? /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
28647
28696
|
);
|
|
28648
28697
|
}
|
|
28649
28698
|
function StepSystemPrompt({ ctx }) {
|
|
@@ -28664,13 +28713,13 @@ function StepSystemPrompt({ ctx }) {
|
|
|
28664
28713
|
ctx.updateWizardData({ systemPrompt: trimmed });
|
|
28665
28714
|
ctx.goNext();
|
|
28666
28715
|
};
|
|
28667
|
-
return /* @__PURE__ */
|
|
28716
|
+
return /* @__PURE__ */ React107.createElement(
|
|
28668
28717
|
WizardPanel,
|
|
28669
28718
|
{
|
|
28670
28719
|
subtitle: "System prompt",
|
|
28671
28720
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28672
28721
|
},
|
|
28673
|
-
/* @__PURE__ */
|
|
28722
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, "Enter the system prompt for your agent:"), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Be comprehensive for best results"), /* @__PURE__ */ React107.createElement(
|
|
28674
28723
|
TextInput,
|
|
28675
28724
|
{
|
|
28676
28725
|
value,
|
|
@@ -28681,7 +28730,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
28681
28730
|
cursorOffset,
|
|
28682
28731
|
onChangeCursorOffset: setCursorOffset
|
|
28683
28732
|
}
|
|
28684
|
-
), error ? /* @__PURE__ */
|
|
28733
|
+
), error ? /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
28685
28734
|
);
|
|
28686
28735
|
}
|
|
28687
28736
|
function StepDescription({ ctx }) {
|
|
@@ -28702,13 +28751,13 @@ function StepDescription({ ctx }) {
|
|
|
28702
28751
|
ctx.updateWizardData({ whenToUse: trimmed });
|
|
28703
28752
|
ctx.goNext();
|
|
28704
28753
|
};
|
|
28705
|
-
return /* @__PURE__ */
|
|
28754
|
+
return /* @__PURE__ */ React107.createElement(
|
|
28706
28755
|
WizardPanel,
|
|
28707
28756
|
{
|
|
28708
28757
|
subtitle: "Description (tell Claude when to use this agent)",
|
|
28709
28758
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28710
28759
|
},
|
|
28711
|
-
/* @__PURE__ */
|
|
28760
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, "When should Claude use this agent?"), /* @__PURE__ */ React107.createElement(
|
|
28712
28761
|
TextInput,
|
|
28713
28762
|
{
|
|
28714
28763
|
value,
|
|
@@ -28719,7 +28768,7 @@ function StepDescription({ ctx }) {
|
|
|
28719
28768
|
cursorOffset,
|
|
28720
28769
|
onChangeCursorOffset: setCursorOffset
|
|
28721
28770
|
}
|
|
28722
|
-
), error ? /* @__PURE__ */
|
|
28771
|
+
), error ? /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error) : null)
|
|
28723
28772
|
);
|
|
28724
28773
|
}
|
|
28725
28774
|
function ToolPicker(props) {
|
|
@@ -28878,12 +28927,12 @@ function ToolPicker(props) {
|
|
|
28878
28927
|
return;
|
|
28879
28928
|
}
|
|
28880
28929
|
});
|
|
28881
|
-
return /* @__PURE__ */
|
|
28930
|
+
return /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: cursorIndex === 0 ? themeColor("suggestion") : void 0, bold: cursorIndex === 0 }, cursorIndex === 0 ? `${figures9.pointer} ` : " ", "[ Continue ]"), /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "\u2500".repeat(40)), items.slice(1).map((item, idx) => {
|
|
28882
28931
|
const index = idx + 1;
|
|
28883
28932
|
const focused = index === cursorIndex;
|
|
28884
28933
|
const prefix = item.isHeader ? "" : focused ? `${figures9.pointer} ` : " ";
|
|
28885
|
-
return /* @__PURE__ */
|
|
28886
|
-
|
|
28934
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "\u2500".repeat(40)) : null, /* @__PURE__ */ React107.createElement(
|
|
28935
|
+
Text83,
|
|
28887
28936
|
{
|
|
28888
28937
|
dimColor: item.isHeader,
|
|
28889
28938
|
color: !item.isHeader && focused ? themeColor("suggestion") : void 0,
|
|
@@ -28891,12 +28940,12 @@ function ToolPicker(props) {
|
|
|
28891
28940
|
},
|
|
28892
28941
|
item.isToggle ? `${prefix}[ ${item.label} ]` : `${prefix}${item.label}`
|
|
28893
28942
|
));
|
|
28894
|
-
}), /* @__PURE__ */
|
|
28943
|
+
}), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, isAllSelected ? "All tools selected" : `${selectedSet.size} of ${allToolNames.length} tools selected`)));
|
|
28895
28944
|
}
|
|
28896
28945
|
function StepSelectTools(props) {
|
|
28897
28946
|
const { ctx } = props;
|
|
28898
28947
|
const initialTools = ctx.wizardData.selectedTools;
|
|
28899
|
-
return /* @__PURE__ */
|
|
28948
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: "Create new agent", subtitle: "Select tools" }, /* @__PURE__ */ React107.createElement(
|
|
28900
28949
|
ToolPicker,
|
|
28901
28950
|
{
|
|
28902
28951
|
tools: props.tools,
|
|
@@ -28907,7 +28956,7 @@ function StepSelectTools(props) {
|
|
|
28907
28956
|
},
|
|
28908
28957
|
onCancel: ctx.goBack
|
|
28909
28958
|
}
|
|
28910
|
-
)), /* @__PURE__ */
|
|
28959
|
+
)), /* @__PURE__ */ React107.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
28911
28960
|
}
|
|
28912
28961
|
function StepSelectModel({ ctx }) {
|
|
28913
28962
|
useInput31((_input, key) => {
|
|
@@ -28915,7 +28964,7 @@ function StepSelectModel({ ctx }) {
|
|
|
28915
28964
|
});
|
|
28916
28965
|
const options = modelOptions();
|
|
28917
28966
|
const defaultValue = ctx.wizardData.selectedModel ?? DEFAULT_AGENT_MODEL;
|
|
28918
|
-
return /* @__PURE__ */
|
|
28967
|
+
return /* @__PURE__ */ React107.createElement(WizardPanel, { subtitle: "Select model", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React107.createElement(
|
|
28919
28968
|
Select,
|
|
28920
28969
|
{
|
|
28921
28970
|
options,
|
|
@@ -28936,12 +28985,12 @@ function ColorPicker(props) {
|
|
|
28936
28985
|
else if (key.downArrow) setIndex((i) => i < COLOR_OPTIONS.length - 1 ? i + 1 : 0);
|
|
28937
28986
|
else if (key.return) props.onConfirm(COLOR_OPTIONS[index] ?? "automatic");
|
|
28938
28987
|
});
|
|
28939
|
-
return /* @__PURE__ */
|
|
28988
|
+
return /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", gap: 1 }, COLOR_OPTIONS.map((color, i) => {
|
|
28940
28989
|
const focused = i === index;
|
|
28941
28990
|
const prefix = focused ? figures9.pointer : " ";
|
|
28942
28991
|
const label = color === "automatic" ? "Automatic color" : color.charAt(0).toUpperCase() + color.slice(1);
|
|
28943
|
-
return /* @__PURE__ */
|
|
28944
|
-
|
|
28992
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, { key: color }, /* @__PURE__ */ React107.createElement(
|
|
28993
|
+
Text83,
|
|
28945
28994
|
{
|
|
28946
28995
|
color: focused ? themeColor("suggestion") : void 0,
|
|
28947
28996
|
bold: focused
|
|
@@ -28974,7 +29023,7 @@ function StepChooseColor({ ctx }) {
|
|
|
28974
29023
|
});
|
|
28975
29024
|
ctx.goNext();
|
|
28976
29025
|
};
|
|
28977
|
-
return /* @__PURE__ */
|
|
29026
|
+
return /* @__PURE__ */ React107.createElement(WizardPanel, { subtitle: "Choose background color", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(ColorPicker, { agentName: agentType, currentColor: "automatic", onConfirm })));
|
|
28978
29027
|
}
|
|
28979
29028
|
function validateFinalAgent(args) {
|
|
28980
29029
|
const errors = [];
|
|
@@ -29039,28 +29088,28 @@ function StepConfirm(props) {
|
|
|
29039
29088
|
});
|
|
29040
29089
|
const locationPath = finalAgent.source === "projectSettings" ? getPrimaryAgentFilePath("project", finalAgent.agentType) : getPrimaryAgentFilePath("user", finalAgent.agentType);
|
|
29041
29090
|
const truncate = (text) => text.length > 240 ? `${text.slice(0, 240)}\u2026` : text;
|
|
29042
|
-
return /* @__PURE__ */
|
|
29091
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29043
29092
|
WizardPanel,
|
|
29044
29093
|
{
|
|
29045
29094
|
subtitle: "Confirm and save",
|
|
29046
29095
|
footerText: "Press s/Enter to save \xB7 e to edit in your editor \xB7 Esc to cancel"
|
|
29047
29096
|
},
|
|
29048
|
-
/* @__PURE__ */
|
|
29097
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Name"), ": ", finalAgent.agentType), /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Location"), ": ", locationPath), /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Tools"), ": ", toolSummary(finalAgent.tools)), /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Model"), ": ", formatModelLong(finalAgent.model)), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React107.createElement(Box79, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, truncate(finalAgent.whenToUse)))), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React107.createElement(Box79, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, truncate(finalAgent.systemPrompt)))), validation.warnings.length > 0 ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("warning") }, "Warnings:"), validation.warnings.map((w, i) => /* @__PURE__ */ React107.createElement(React107.Fragment, { key: i }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, " ", "\u2022 ", w)))) : null, validation.errors.length > 0 ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, "Errors:"), validation.errors.map((e, i) => /* @__PURE__ */ React107.createElement(React107.Fragment, { key: i }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, " ", "\u2022 ", e)))) : null, error ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error)) : null)
|
|
29049
29098
|
);
|
|
29050
29099
|
}
|
|
29051
29100
|
function CreateAgentWizard(props) {
|
|
29052
29101
|
const steps = useMemo26(() => {
|
|
29053
29102
|
return [
|
|
29054
|
-
(ctx) => /* @__PURE__ */
|
|
29055
|
-
(ctx) => /* @__PURE__ */
|
|
29056
|
-
(ctx) => /* @__PURE__ */
|
|
29057
|
-
(ctx) => /* @__PURE__ */
|
|
29058
|
-
(ctx) => /* @__PURE__ */
|
|
29059
|
-
(ctx) => /* @__PURE__ */
|
|
29060
|
-
(ctx) => /* @__PURE__ */
|
|
29061
|
-
(ctx) => /* @__PURE__ */
|
|
29062
|
-
(ctx) => /* @__PURE__ */
|
|
29063
|
-
(ctx) => /* @__PURE__ */
|
|
29103
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepChooseLocation, { ctx }),
|
|
29104
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepChooseMethod, { ctx }),
|
|
29105
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepGenerationPrompt, { ctx, existingAgents: props.existingAgents }),
|
|
29106
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepAgentType, { ctx, existingAgents: props.existingAgents }),
|
|
29107
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepSystemPrompt, { ctx }),
|
|
29108
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepDescription, { ctx }),
|
|
29109
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepSelectTools, { ctx, tools: props.tools }),
|
|
29110
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepSelectModel, { ctx }),
|
|
29111
|
+
(ctx) => /* @__PURE__ */ React107.createElement(StepChooseColor, { ctx }),
|
|
29112
|
+
(ctx) => /* @__PURE__ */ React107.createElement(
|
|
29064
29113
|
StepConfirm,
|
|
29065
29114
|
{
|
|
29066
29115
|
ctx,
|
|
@@ -29093,7 +29142,7 @@ function CreateAgentWizard(props) {
|
|
|
29093
29142
|
)
|
|
29094
29143
|
];
|
|
29095
29144
|
}, [props]);
|
|
29096
|
-
return /* @__PURE__ */
|
|
29145
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29097
29146
|
Wizard,
|
|
29098
29147
|
{
|
|
29099
29148
|
steps,
|
|
@@ -29116,13 +29165,13 @@ function AgentMenu(props) {
|
|
|
29116
29165
|
],
|
|
29117
29166
|
{ label: "Back", value: "back" }
|
|
29118
29167
|
];
|
|
29119
|
-
return /* @__PURE__ */
|
|
29168
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React107.createElement(
|
|
29120
29169
|
Select,
|
|
29121
29170
|
{
|
|
29122
29171
|
options,
|
|
29123
29172
|
onChange: (value) => props.onChoose(value)
|
|
29124
29173
|
}
|
|
29125
|
-
))), /* @__PURE__ */
|
|
29174
|
+
))), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
29126
29175
|
}
|
|
29127
29176
|
function ViewAgent(props) {
|
|
29128
29177
|
useInput31((_input, key) => {
|
|
@@ -29158,9 +29207,9 @@ function ViewAgent(props) {
|
|
|
29158
29207
|
const toolsSummary = () => {
|
|
29159
29208
|
if (parsedTools.hasWildcard) return "All tools";
|
|
29160
29209
|
if (!props.agent.tools || props.agent.tools === "*" || props.agent.tools.length === 0) return "None";
|
|
29161
|
-
return /* @__PURE__ */
|
|
29210
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, parsedTools.valid.length > 0 ? parsedTools.valid.join(", ") : null, parsedTools.invalid.length > 0 ? /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("warning") }, " ", figures9.warning, " Unrecognized: ", parsedTools.invalid.join(", "))) : null);
|
|
29162
29211
|
};
|
|
29163
|
-
return /* @__PURE__ */
|
|
29212
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, sourceLine), /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React107.createElement(Box79, { marginLeft: 2 }, /* @__PURE__ */ React107.createElement(Text83, null, props.agent.whenToUse))), /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Tools"), ": ", toolsSummary()), /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Model"), ": ", formatModelLong(props.agent.model)), props.agent.color ? /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "Color"), ": ", props.agent.color) : null, props.agent.systemPrompt ? /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Text83, null, /* @__PURE__ */ React107.createElement(Text83, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React107.createElement(Box79, { marginLeft: 2, marginRight: 2 }, /* @__PURE__ */ React107.createElement(Text83, null, props.agent.systemPrompt))) : null)), /* @__PURE__ */ React107.createElement(Instructions, { instructions: "Press Enter or Esc to go back" }));
|
|
29164
29213
|
}
|
|
29165
29214
|
function EditAgent(props) {
|
|
29166
29215
|
const [mode, setMode] = useState28("menu");
|
|
@@ -29225,7 +29274,7 @@ function EditAgent(props) {
|
|
|
29225
29274
|
}
|
|
29226
29275
|
});
|
|
29227
29276
|
if (mode === "edit-tools") {
|
|
29228
|
-
return /* @__PURE__ */
|
|
29277
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React107.createElement(
|
|
29229
29278
|
ToolPicker,
|
|
29230
29279
|
{
|
|
29231
29280
|
tools: props.tools,
|
|
@@ -29237,10 +29286,10 @@ function EditAgent(props) {
|
|
|
29237
29286
|
},
|
|
29238
29287
|
onCancel: () => setMode("menu")
|
|
29239
29288
|
}
|
|
29240
|
-
), error ? /* @__PURE__ */
|
|
29289
|
+
), error ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React107.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
29241
29290
|
}
|
|
29242
29291
|
if (mode === "edit-model") {
|
|
29243
|
-
return /* @__PURE__ */
|
|
29292
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", gap: 1, marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React107.createElement(
|
|
29244
29293
|
Select,
|
|
29245
29294
|
{
|
|
29246
29295
|
options: modelOptions(),
|
|
@@ -29250,10 +29299,10 @@ function EditAgent(props) {
|
|
|
29250
29299
|
setMode("menu");
|
|
29251
29300
|
}
|
|
29252
29301
|
}
|
|
29253
|
-
)), error ? /* @__PURE__ */
|
|
29302
|
+
)), error ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
29254
29303
|
}
|
|
29255
29304
|
if (mode === "edit-color") {
|
|
29256
|
-
return /* @__PURE__ */
|
|
29305
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(
|
|
29257
29306
|
ColorPicker,
|
|
29258
29307
|
{
|
|
29259
29308
|
agentName: props.agent.agentType,
|
|
@@ -29263,29 +29312,29 @@ function EditAgent(props) {
|
|
|
29263
29312
|
setMode("menu");
|
|
29264
29313
|
}
|
|
29265
29314
|
}
|
|
29266
|
-
)), error ? /* @__PURE__ */
|
|
29315
|
+
)), error ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
29267
29316
|
}
|
|
29268
|
-
return /* @__PURE__ */
|
|
29269
|
-
|
|
29317
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column" }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Source: ", titleForSource(props.agent.source)), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1, flexDirection: "column" }, menuItems.map((item, idx) => /* @__PURE__ */ React107.createElement(React107.Fragment, { key: item.label }, /* @__PURE__ */ React107.createElement(
|
|
29318
|
+
Text83,
|
|
29270
29319
|
{
|
|
29271
29320
|
color: idx === selectedIndex ? themeColor("suggestion") : void 0
|
|
29272
29321
|
},
|
|
29273
29322
|
idx === selectedIndex ? `${figures9.pointer} ` : " ",
|
|
29274
29323
|
item.label
|
|
29275
|
-
)))), error ? /* @__PURE__ */
|
|
29324
|
+
)))), error ? /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { color: themeColor("error") }, error)) : null)), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
29276
29325
|
}
|
|
29277
29326
|
function DeleteConfirm(props) {
|
|
29278
29327
|
useInput31((_input, key) => {
|
|
29279
29328
|
if (key.escape) props.onCancel();
|
|
29280
29329
|
});
|
|
29281
|
-
return /* @__PURE__ */
|
|
29330
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(
|
|
29282
29331
|
Panel,
|
|
29283
29332
|
{
|
|
29284
29333
|
title: "Delete agent",
|
|
29285
29334
|
borderColor: panelBorderColor("error"),
|
|
29286
29335
|
titleColor: themeColor("error")
|
|
29287
29336
|
},
|
|
29288
|
-
/* @__PURE__ */
|
|
29337
|
+
/* @__PURE__ */ React107.createElement(Box79, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React107.createElement(Text83, null, "Are you sure you want to delete the agent ", /* @__PURE__ */ React107.createElement(Text83, { bold: true }, props.agent.agentType), "?"), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Source: ", props.agent.source)), /* @__PURE__ */ React107.createElement(Box79, { marginTop: 1 }, /* @__PURE__ */ React107.createElement(
|
|
29289
29338
|
Select,
|
|
29290
29339
|
{
|
|
29291
29340
|
options: [
|
|
@@ -29298,7 +29347,7 @@ function DeleteConfirm(props) {
|
|
|
29298
29347
|
}
|
|
29299
29348
|
}
|
|
29300
29349
|
)))
|
|
29301
|
-
), /* @__PURE__ */
|
|
29350
|
+
), /* @__PURE__ */ React107.createElement(Instructions, { instructions: "Press \u2191\u2193 to navigate, Enter to select, Esc to cancel" }));
|
|
29302
29351
|
}
|
|
29303
29352
|
function AgentsUI({ onExit }) {
|
|
29304
29353
|
const [mode, setMode] = useState28({ mode: "list-agents", source: "all" });
|
|
@@ -29369,10 +29418,10 @@ ${changes.join("\n")}`);
|
|
|
29369
29418
|
onExit("Agents dialog dismissed");
|
|
29370
29419
|
}, [changes, onExit]);
|
|
29371
29420
|
if (loading) {
|
|
29372
|
-
return /* @__PURE__ */
|
|
29421
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(Panel, { title: "Agents", subtitle: "Loading\u2026" }, /* @__PURE__ */ React107.createElement(Text83, { dimColor: true }, "Loading agents\u2026")), /* @__PURE__ */ React107.createElement(Instructions, null));
|
|
29373
29422
|
}
|
|
29374
29423
|
if (mode.mode === "list-agents") {
|
|
29375
|
-
return /* @__PURE__ */
|
|
29424
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29376
29425
|
AgentsListView,
|
|
29377
29426
|
{
|
|
29378
29427
|
source: mode.source,
|
|
@@ -29385,7 +29434,7 @@ ${changes.join("\n")}`);
|
|
|
29385
29434
|
);
|
|
29386
29435
|
}
|
|
29387
29436
|
if (mode.mode === "create-agent") {
|
|
29388
|
-
return /* @__PURE__ */
|
|
29437
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29389
29438
|
CreateAgentWizard,
|
|
29390
29439
|
{
|
|
29391
29440
|
tools,
|
|
@@ -29400,7 +29449,7 @@ ${changes.join("\n")}`);
|
|
|
29400
29449
|
);
|
|
29401
29450
|
}
|
|
29402
29451
|
if (mode.mode === "agent-menu") {
|
|
29403
|
-
return /* @__PURE__ */
|
|
29452
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29404
29453
|
AgentMenu,
|
|
29405
29454
|
{
|
|
29406
29455
|
agent: mode.agent,
|
|
@@ -29415,7 +29464,7 @@ ${changes.join("\n")}`);
|
|
|
29415
29464
|
);
|
|
29416
29465
|
}
|
|
29417
29466
|
if (mode.mode === "view-agent") {
|
|
29418
|
-
return /* @__PURE__ */
|
|
29467
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29419
29468
|
ViewAgent,
|
|
29420
29469
|
{
|
|
29421
29470
|
agent: mode.agent,
|
|
@@ -29425,7 +29474,7 @@ ${changes.join("\n")}`);
|
|
|
29425
29474
|
);
|
|
29426
29475
|
}
|
|
29427
29476
|
if (mode.mode === "edit-agent") {
|
|
29428
|
-
return /* @__PURE__ */
|
|
29477
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29429
29478
|
EditAgent,
|
|
29430
29479
|
{
|
|
29431
29480
|
agent: mode.agent,
|
|
@@ -29440,7 +29489,7 @@ ${changes.join("\n")}`);
|
|
|
29440
29489
|
);
|
|
29441
29490
|
}
|
|
29442
29491
|
if (mode.mode === "delete-confirm") {
|
|
29443
|
-
return /* @__PURE__ */
|
|
29492
|
+
return /* @__PURE__ */ React107.createElement(
|
|
29444
29493
|
DeleteConfirm,
|
|
29445
29494
|
{
|
|
29446
29495
|
agent: mode.agent,
|
|
@@ -29465,7 +29514,7 @@ var agents_default = {
|
|
|
29465
29514
|
isEnabled: true,
|
|
29466
29515
|
isHidden: false,
|
|
29467
29516
|
async call(onExit) {
|
|
29468
|
-
return /* @__PURE__ */
|
|
29517
|
+
return /* @__PURE__ */ React108.createElement(AgentsUI, { onExit });
|
|
29469
29518
|
},
|
|
29470
29519
|
userFacingName() {
|
|
29471
29520
|
return "agents";
|
|
@@ -29627,7 +29676,7 @@ ${availableLines}${truncatedNotice}
|
|
|
29627
29676
|
return command4 || "";
|
|
29628
29677
|
},
|
|
29629
29678
|
renderToolUseRejectedMessage() {
|
|
29630
|
-
return /* @__PURE__ */
|
|
29679
|
+
return /* @__PURE__ */ React109.createElement(FallbackToolUseRejectedMessage, null);
|
|
29631
29680
|
},
|
|
29632
29681
|
renderResultForAssistant(output) {
|
|
29633
29682
|
return `Launching command: /${output.commandName}`;
|
|
@@ -29783,8 +29832,8 @@ function parseMcpToolName2(name3) {
|
|
|
29783
29832
|
}
|
|
29784
29833
|
|
|
29785
29834
|
// src/tools/system/KillShellTool/KillShellTool.tsx
|
|
29786
|
-
import { Box as
|
|
29787
|
-
import
|
|
29835
|
+
import { Box as Box80, Text as Text84 } from "ink";
|
|
29836
|
+
import React110 from "react";
|
|
29788
29837
|
import { z as z14 } from "zod";
|
|
29789
29838
|
|
|
29790
29839
|
// src/tools/system/KillShellTool/prompt.ts
|
|
@@ -29830,10 +29879,10 @@ var KillShellTool = {
|
|
|
29830
29879
|
return `Kill shell: ${shell_id}`;
|
|
29831
29880
|
},
|
|
29832
29881
|
renderToolUseRejectedMessage() {
|
|
29833
|
-
return /* @__PURE__ */
|
|
29882
|
+
return /* @__PURE__ */ React110.createElement(FallbackToolUseRejectedMessage, null);
|
|
29834
29883
|
},
|
|
29835
29884
|
renderToolResultMessage(output) {
|
|
29836
|
-
return /* @__PURE__ */
|
|
29885
|
+
return /* @__PURE__ */ React110.createElement(Box80, { flexDirection: "row" }, /* @__PURE__ */ React110.createElement(Text84, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React110.createElement(Text84, null, "Shell ", output.shell_id, " killed"));
|
|
29837
29886
|
},
|
|
29838
29887
|
renderResultForAssistant(output) {
|
|
29839
29888
|
return JSON.stringify(output);
|
|
@@ -30095,41 +30144,6 @@ The assistant did not use the todo list because this is a single command executi
|
|
|
30095
30144
|
When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
|
|
30096
30145
|
`;
|
|
30097
30146
|
|
|
30098
|
-
// src/ui/components/TodoItem.tsx
|
|
30099
|
-
import React110 from "react";
|
|
30100
|
-
import { Box as Box80, Text as Text84 } from "ink";
|
|
30101
|
-
var TodoItem = ({ todo, children }) => {
|
|
30102
|
-
const statusIconMap = {
|
|
30103
|
-
completed: "\u2705",
|
|
30104
|
-
in_progress: "\u{1F504}",
|
|
30105
|
-
pending: "\u23F8\uFE0F"
|
|
30106
|
-
};
|
|
30107
|
-
const statusColorMap = {
|
|
30108
|
-
completed: void 0,
|
|
30109
|
-
// Use default color (will be dimmed)
|
|
30110
|
-
in_progress: "#FFA500",
|
|
30111
|
-
pending: "#FFD700"
|
|
30112
|
-
};
|
|
30113
|
-
const priorityIconMap = {
|
|
30114
|
-
high: "\u{1F534}",
|
|
30115
|
-
medium: "\u{1F7E1}",
|
|
30116
|
-
low: "\u{1F7E2}"
|
|
30117
|
-
};
|
|
30118
|
-
const icon = statusIconMap[todo.status];
|
|
30119
|
-
const color = statusColorMap[todo.status];
|
|
30120
|
-
const priorityIcon = todo.priority ? priorityIconMap[todo.priority] : "";
|
|
30121
|
-
return /* @__PURE__ */ React110.createElement(Box80, { flexDirection: "column" }, /* @__PURE__ */ React110.createElement(Box80, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React110.createElement(Text84, null, "\u23BF"), /* @__PURE__ */ React110.createElement(Text84, { color, dimColor: todo.status === "completed" }, icon), priorityIcon && /* @__PURE__ */ React110.createElement(Text84, null, priorityIcon), /* @__PURE__ */ React110.createElement(
|
|
30122
|
-
Text84,
|
|
30123
|
-
{
|
|
30124
|
-
color,
|
|
30125
|
-
dimColor: todo.status === "completed",
|
|
30126
|
-
strikethrough: todo.status === "completed",
|
|
30127
|
-
bold: todo.status === "in_progress"
|
|
30128
|
-
},
|
|
30129
|
-
todo.content
|
|
30130
|
-
), children), todo.status === "in_progress" && todo.activeForm && /* @__PURE__ */ React110.createElement(Box80, { marginLeft: 4 }, /* @__PURE__ */ React110.createElement(Text84, { color: "gray" }, "\u21B3 Action: ", todo.activeForm)));
|
|
30131
|
-
};
|
|
30132
|
-
|
|
30133
30147
|
// src/tools/interaction/TodoWriteTool/TodoWriteTool.tsx
|
|
30134
30148
|
var TodoItemSchema = z15.object({
|
|
30135
30149
|
content: z15.string().min(1, "Content cannot be empty").describe("The task description or content"),
|
|
@@ -30223,12 +30237,17 @@ var TodoWriteTool = {
|
|
|
30223
30237
|
return /* @__PURE__ */ React111.createElement(Box81, { flexDirection: "row" }, /* @__PURE__ */ React111.createElement(Text85, null, output));
|
|
30224
30238
|
}
|
|
30225
30239
|
const todos2 = getTodos(output.agentId);
|
|
30226
|
-
if (todos2.length === 0) {
|
|
30227
|
-
return /* @__PURE__ */ React111.createElement(Box81, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React111.createElement(Text85, null, "No todos currently tracked"));
|
|
30228
|
-
}
|
|
30229
30240
|
const count = todos2.length;
|
|
30230
30241
|
const label = count === 1 ? "todo" : "todos";
|
|
30231
|
-
return /* @__PURE__ */ React111.createElement(
|
|
30242
|
+
return /* @__PURE__ */ React111.createElement(
|
|
30243
|
+
ListRenderer,
|
|
30244
|
+
{
|
|
30245
|
+
items: todos2,
|
|
30246
|
+
emptyMessage: "No todos currently tracked",
|
|
30247
|
+
header: /* @__PURE__ */ React111.createElement(Text85, null, /* @__PURE__ */ React111.createElement(Text85, { bold: true }, count, " ", label), /* @__PURE__ */ React111.createElement(Text85, null, ":")),
|
|
30248
|
+
renderItem: (item) => /* @__PURE__ */ React111.createElement(TodoItem, { key: item.id, todo: item })
|
|
30249
|
+
}
|
|
30250
|
+
);
|
|
30232
30251
|
},
|
|
30233
30252
|
async validateInput({ todos: todos2 }) {
|
|
30234
30253
|
const validation = validateTodos(todos2);
|
|
@@ -31890,8 +31909,8 @@ To give feedback, users should ${MACRO.ISSUES_EXPLAINER}.
|
|
|
31890
31909
|
# Task Management
|
|
31891
31910
|
You have access to the Task tools (TaskCreate, TaskUpdate, TaskList, TaskGet) to help you manage and plan tasks. Using these tools is a Best Practice for complex workflows, as it ensures you are tracking your tasks and giving the user visibility into your progress.
|
|
31892
31911
|
These tools are powerful for planning tasks and for breaking down larger complex tasks into smaller steps. For multi-step work, start by creating tasks with TaskCreate, then use TaskUpdate as you progress. Use TaskList to review readiness and blockers, and TaskGet for details. TaskList only returns id/subject/status/owner/blockedBy.
|
|
31893
|
-
For multi-step plans, you
|
|
31894
|
-
Single-task work does not require a dependency chain.
|
|
31912
|
+
For multi-step plans, you may create the list first and add blockedBy later. You can create a structured task list first and set up the task dependencies blockedBy later via TaskUpdate to ensure the previous structured task list completed in the right order.
|
|
31913
|
+
Single-task work does not require a dependency chain. When dependencies are ready, set metadata.planFinalized="true" with TaskUpdate to trigger global validation.
|
|
31895
31914
|
|
|
31896
31915
|
**Dynamic Planning**: You are encouraged to update your plan dynamically. If you encounter unexpected issues or new requirements, pause the current task, add new items (e.g., "Fix dependency issue"), and adjust your plan accordingly.
|
|
31897
31916
|
|
|
@@ -32127,6 +32146,7 @@ export {
|
|
|
32127
32146
|
buildTaskGraph,
|
|
32128
32147
|
findTaskCycles,
|
|
32129
32148
|
calculateReadyBlocked,
|
|
32149
|
+
TaskList,
|
|
32130
32150
|
applyMarkdown,
|
|
32131
32151
|
EnterPlanModeTool,
|
|
32132
32152
|
AskUserQuestionTool,
|