pybao-cli 1.4.37 → 1.4.39
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-N62XVC35.js +47 -0
- package/dist/{acp-4DJD7KGT.js → acp-6LBQJVMX.js} +29 -29
- package/dist/{agentsValidate-V3NT6CXM.js → agentsValidate-SLBW2ESZ.js} +7 -7
- package/dist/{ask-QGVRR66V.js → ask-DB4F3WJG.js} +28 -28
- package/dist/{autoUpdater-JM7WBEUQ.js → autoUpdater-CYDJVIEC.js} +3 -3
- package/dist/{chunk-BCQJMOSS.js → chunk-3LNPU7WH.js} +3 -3
- package/dist/{chunk-5EVKZGDP.js → chunk-4LXZDGCO.js} +3 -3
- package/dist/{chunk-CWSAGAMM.js → chunk-6KSM5M7T.js} +1 -1
- package/dist/{chunk-42XD5HC6.js → chunk-7TGWBYFN.js} +4 -4
- package/dist/{chunk-JBJ6V6LD.js → chunk-7WCSSH3C.js} +3 -3
- package/dist/chunk-AI7FJQR4.js +1262 -0
- package/dist/chunk-AI7FJQR4.js.map +7 -0
- package/dist/{chunk-3PUKLCTC.js → chunk-DEYAAT6H.js} +3 -3
- package/dist/{chunk-A6CGJVI5.js → chunk-DLBWS3IW.js} +1 -1
- package/dist/{chunk-VLPRSVXT.js → chunk-E5EB22W4.js} +4 -4
- package/dist/{chunk-C5PFCHI6.js → chunk-GD43B2GV.js} +1 -1
- package/dist/{chunk-U3BHVYM7.js → chunk-GL3ZM7F3.js} +3 -3
- package/dist/{chunk-WZFW5MLS.js → chunk-GXHSGPIF.js} +4 -4
- package/dist/{chunk-EAYSPMFV.js → chunk-HD4IO3I5.js} +783 -19
- package/dist/chunk-HD4IO3I5.js.map +7 -0
- package/dist/{chunk-N4AX7MAG.js → chunk-KNLFFHBT.js} +2 -2
- package/dist/{chunk-R5K32NWJ.js → chunk-KWPH7MSB.js} +1 -1
- package/dist/{chunk-QTT5PAF5.js → chunk-N4GXGPVA.js} +1 -1
- package/dist/{chunk-VNOOSZ37.js → chunk-NMJYV37P.js} +2 -2
- package/dist/{chunk-N73EEVKP.js → chunk-NNE44UHQ.js} +2 -2
- package/dist/{chunk-ADVVJQQL.js → chunk-O5OT26P6.js} +1 -1
- package/dist/{chunk-LKVOJGOX.js → chunk-RS2N2KBH.js} +753 -379
- package/dist/{chunk-LKVOJGOX.js.map → chunk-RS2N2KBH.js.map} +4 -4
- package/dist/{chunk-S2J5L7W6.js → chunk-SBPVAFBQ.js} +2 -2
- package/dist/{chunk-AAN4ZB7D.js → chunk-SSKQUKI7.js} +1 -1
- package/dist/{chunk-XQQXJDZ6.js → chunk-TNAAGT3Q.js} +3 -3
- package/dist/chunk-TNAAGT3Q.js.map +7 -0
- package/dist/{chunk-N3P77GAY.js → chunk-UK4IHZU3.js} +2 -2
- package/dist/{chunk-T2TNKXYE.js → chunk-UUWI4VWU.js} +1 -1
- package/dist/{chunk-T2TNKXYE.js.map → chunk-UUWI4VWU.js.map} +1 -1
- package/dist/{chunk-3UUOVYVA.js → chunk-VFQU3JSH.js} +4 -4
- package/dist/{chunk-2SXOBJO3.js → chunk-VHTIDAOJ.js} +2 -2
- package/dist/{chunk-W3I3SWXY.js → chunk-VXQMCAPS.js} +1 -1
- package/dist/{chunk-E7P4TM6T.js → chunk-YJ2WXW2J.js} +3 -3
- package/dist/{chunk-YA6QWTQZ.js → chunk-ZGVGFR4C.js} +1 -1
- package/dist/{cli-FVTA2UNT.js → cli-FMCSS5QE.js} +87 -87
- package/dist/commands-IJTOU4P3.js +51 -0
- package/dist/{config-PDX3ENJS.js → config-YRHKZJO6.js} +4 -4
- package/dist/{context-QCXL3UHB.js → context-ZZO64MRN.js} +6 -6
- package/dist/{customCommands-LIL44EIW.js → customCommands-2S7LYMG7.js} +4 -4
- package/dist/{env-JKAUQPAX.js → env-PQDRZBAW.js} +2 -2
- package/dist/{file-OKOAVL6I.js → file-X7BE3MNR.js} +4 -4
- package/dist/index.js +3 -3
- package/dist/{llm-24B7GPL4.js → llm-3KCTIVOM.js} +29 -29
- package/dist/{llmLazy-J4YVR6MG.js → llmLazy-HCTXTHRZ.js} +1 -1
- package/dist/{loader-GUY3VKKS.js → loader-DKMJSH4V.js} +4 -4
- package/dist/{lsp-36PBULHA.js → lsp-IXEAYT4K.js} +6 -6
- package/dist/{lspAnchor-VW755MJ7.js → lspAnchor-FKXOKCQZ.js} +6 -6
- package/dist/{mcp-5CYKIC44.js → mcp-ZUJD3E4V.js} +7 -7
- package/dist/{mentionProcessor-WTPRNMI7.js → mentionProcessor-7GXI47P3.js} +7 -5
- package/dist/{mentionProcessor-WTPRNMI7.js.map → mentionProcessor-7GXI47P3.js.map} +1 -1
- package/dist/{messages-35GUJR23.js → messages-55HNRTQC.js} +1 -1
- package/dist/{model-Z22IGTCI.js → model-R5X6XP7I.js} +5 -5
- package/dist/{openai-IFMVI4HW.js → openai-FM7DX3GB.js} +5 -5
- package/dist/{outputStyles-GISTOUSR.js → outputStyles-ZLGIDCCJ.js} +4 -4
- package/dist/{pluginRuntime-YKAYG7LI.js → pluginRuntime-REF3E5F5.js} +6 -6
- package/dist/{pluginValidation-WMUMEOFR.js → pluginValidation-E33USDYW.js} +6 -6
- package/dist/prompts-W7TUXY74.js +53 -0
- package/dist/{pybAgentSessionLoad-U2PAPG2T.js → pybAgentSessionLoad-PGTH6SZH.js} +4 -4
- package/dist/{pybAgentSessionResume-VKO7BF5R.js → pybAgentSessionResume-IVBY65PN.js} +4 -4
- package/dist/{pybAgentStreamJsonSession-3B3FBBV2.js → pybAgentStreamJsonSession-N2Q6LQHX.js} +1 -1
- package/dist/{pybHooks-PKSWIXQR.js → pybHooks-WIA5KKVN.js} +4 -4
- package/dist/query-BTG2T7NV.js +55 -0
- package/dist/{registry-ZEALEPQA.js → registry-PT3XVAT6.js} +5 -5
- package/dist/{ripgrep-KLZFIFVE.js → ripgrep-2VWCSPH4.js} +3 -3
- package/dist/{skillMarketplace-GTMGSI2S.js → skillMarketplace-NHPAPZTS.js} +3 -3
- package/dist/{state-A5SI47U2.js → state-4AIVX6VM.js} +2 -2
- package/dist/{theme-VS7GUKLU.js → theme-LKZFY5TU.js} +5 -5
- package/dist/{toolPermissionSettings-ZF4WVDXG.js → toolPermissionSettings-OVFT6D3R.js} +6 -6
- package/dist/tools-6ONPKOSL.js +52 -0
- package/dist/{userInput-VZEUNZ4X.js → userInput-RHGZ225B.js} +30 -30
- package/package.json +1 -1
- package/dist/REPL-XHCMVEGW.js +0 -47
- package/dist/chunk-5N7MDY6T.js +0 -517
- package/dist/chunk-5N7MDY6T.js.map +0 -7
- package/dist/chunk-EAYSPMFV.js.map +0 -7
- package/dist/chunk-XQQXJDZ6.js.map +0 -7
- package/dist/commands-ZXIPHHLY.js +0 -51
- package/dist/prompts-ANODLYMR.js +0 -53
- package/dist/query-E6AUJBMK.js +0 -55
- package/dist/tools-VTVBSLQ5.js +0 -52
- /package/dist/{REPL-XHCMVEGW.js.map → REPL-N62XVC35.js.map} +0 -0
- /package/dist/{acp-4DJD7KGT.js.map → acp-6LBQJVMX.js.map} +0 -0
- /package/dist/{agentsValidate-V3NT6CXM.js.map → agentsValidate-SLBW2ESZ.js.map} +0 -0
- /package/dist/{ask-QGVRR66V.js.map → ask-DB4F3WJG.js.map} +0 -0
- /package/dist/{autoUpdater-JM7WBEUQ.js.map → autoUpdater-CYDJVIEC.js.map} +0 -0
- /package/dist/{chunk-BCQJMOSS.js.map → chunk-3LNPU7WH.js.map} +0 -0
- /package/dist/{chunk-5EVKZGDP.js.map → chunk-4LXZDGCO.js.map} +0 -0
- /package/dist/{chunk-CWSAGAMM.js.map → chunk-6KSM5M7T.js.map} +0 -0
- /package/dist/{chunk-42XD5HC6.js.map → chunk-7TGWBYFN.js.map} +0 -0
- /package/dist/{chunk-JBJ6V6LD.js.map → chunk-7WCSSH3C.js.map} +0 -0
- /package/dist/{chunk-3PUKLCTC.js.map → chunk-DEYAAT6H.js.map} +0 -0
- /package/dist/{chunk-A6CGJVI5.js.map → chunk-DLBWS3IW.js.map} +0 -0
- /package/dist/{chunk-VLPRSVXT.js.map → chunk-E5EB22W4.js.map} +0 -0
- /package/dist/{chunk-C5PFCHI6.js.map → chunk-GD43B2GV.js.map} +0 -0
- /package/dist/{chunk-U3BHVYM7.js.map → chunk-GL3ZM7F3.js.map} +0 -0
- /package/dist/{chunk-WZFW5MLS.js.map → chunk-GXHSGPIF.js.map} +0 -0
- /package/dist/{chunk-N4AX7MAG.js.map → chunk-KNLFFHBT.js.map} +0 -0
- /package/dist/{chunk-R5K32NWJ.js.map → chunk-KWPH7MSB.js.map} +0 -0
- /package/dist/{chunk-QTT5PAF5.js.map → chunk-N4GXGPVA.js.map} +0 -0
- /package/dist/{chunk-VNOOSZ37.js.map → chunk-NMJYV37P.js.map} +0 -0
- /package/dist/{chunk-N73EEVKP.js.map → chunk-NNE44UHQ.js.map} +0 -0
- /package/dist/{chunk-ADVVJQQL.js.map → chunk-O5OT26P6.js.map} +0 -0
- /package/dist/{chunk-S2J5L7W6.js.map → chunk-SBPVAFBQ.js.map} +0 -0
- /package/dist/{chunk-AAN4ZB7D.js.map → chunk-SSKQUKI7.js.map} +0 -0
- /package/dist/{chunk-N3P77GAY.js.map → chunk-UK4IHZU3.js.map} +0 -0
- /package/dist/{chunk-3UUOVYVA.js.map → chunk-VFQU3JSH.js.map} +0 -0
- /package/dist/{chunk-2SXOBJO3.js.map → chunk-VHTIDAOJ.js.map} +0 -0
- /package/dist/{chunk-W3I3SWXY.js.map → chunk-VXQMCAPS.js.map} +0 -0
- /package/dist/{chunk-E7P4TM6T.js.map → chunk-YJ2WXW2J.js.map} +0 -0
- /package/dist/{chunk-YA6QWTQZ.js.map → chunk-ZGVGFR4C.js.map} +0 -0
- /package/dist/{cli-FVTA2UNT.js.map → cli-FMCSS5QE.js.map} +0 -0
- /package/dist/{commands-ZXIPHHLY.js.map → commands-IJTOU4P3.js.map} +0 -0
- /package/dist/{config-PDX3ENJS.js.map → config-YRHKZJO6.js.map} +0 -0
- /package/dist/{context-QCXL3UHB.js.map → context-ZZO64MRN.js.map} +0 -0
- /package/dist/{customCommands-LIL44EIW.js.map → customCommands-2S7LYMG7.js.map} +0 -0
- /package/dist/{env-JKAUQPAX.js.map → env-PQDRZBAW.js.map} +0 -0
- /package/dist/{file-OKOAVL6I.js.map → file-X7BE3MNR.js.map} +0 -0
- /package/dist/{llm-24B7GPL4.js.map → llm-3KCTIVOM.js.map} +0 -0
- /package/dist/{llmLazy-J4YVR6MG.js.map → llmLazy-HCTXTHRZ.js.map} +0 -0
- /package/dist/{loader-GUY3VKKS.js.map → loader-DKMJSH4V.js.map} +0 -0
- /package/dist/{lsp-36PBULHA.js.map → lsp-IXEAYT4K.js.map} +0 -0
- /package/dist/{lspAnchor-VW755MJ7.js.map → lspAnchor-FKXOKCQZ.js.map} +0 -0
- /package/dist/{mcp-5CYKIC44.js.map → mcp-ZUJD3E4V.js.map} +0 -0
- /package/dist/{messages-35GUJR23.js.map → messages-55HNRTQC.js.map} +0 -0
- /package/dist/{model-Z22IGTCI.js.map → model-R5X6XP7I.js.map} +0 -0
- /package/dist/{openai-IFMVI4HW.js.map → openai-FM7DX3GB.js.map} +0 -0
- /package/dist/{outputStyles-GISTOUSR.js.map → outputStyles-ZLGIDCCJ.js.map} +0 -0
- /package/dist/{pluginRuntime-YKAYG7LI.js.map → pluginRuntime-REF3E5F5.js.map} +0 -0
- /package/dist/{pluginValidation-WMUMEOFR.js.map → pluginValidation-E33USDYW.js.map} +0 -0
- /package/dist/{prompts-ANODLYMR.js.map → prompts-W7TUXY74.js.map} +0 -0
- /package/dist/{pybAgentSessionLoad-U2PAPG2T.js.map → pybAgentSessionLoad-PGTH6SZH.js.map} +0 -0
- /package/dist/{pybAgentSessionResume-VKO7BF5R.js.map → pybAgentSessionResume-IVBY65PN.js.map} +0 -0
- /package/dist/{pybAgentStreamJsonSession-3B3FBBV2.js.map → pybAgentStreamJsonSession-N2Q6LQHX.js.map} +0 -0
- /package/dist/{pybHooks-PKSWIXQR.js.map → pybHooks-WIA5KKVN.js.map} +0 -0
- /package/dist/{query-E6AUJBMK.js.map → query-BTG2T7NV.js.map} +0 -0
- /package/dist/{registry-ZEALEPQA.js.map → registry-PT3XVAT6.js.map} +0 -0
- /package/dist/{ripgrep-KLZFIFVE.js.map → ripgrep-2VWCSPH4.js.map} +0 -0
- /package/dist/{skillMarketplace-GTMGSI2S.js.map → skillMarketplace-NHPAPZTS.js.map} +0 -0
- /package/dist/{state-A5SI47U2.js.map → state-4AIVX6VM.js.map} +0 -0
- /package/dist/{theme-VS7GUKLU.js.map → theme-LKZFY5TU.js.map} +0 -0
- /package/dist/{toolPermissionSettings-ZF4WVDXG.js.map → toolPermissionSettings-OVFT6D3R.js.map} +0 -0
- /package/dist/{tools-VTVBSLQ5.js.map → tools-6ONPKOSL.js.map} +0 -0
- /package/dist/{userInput-VZEUNZ4X.js.map → userInput-RHGZ225B.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-YJ2WXW2J.js";
|
|
7
7
|
import {
|
|
8
8
|
loadPybAgentSessionMessages
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KWPH7MSB.js";
|
|
10
10
|
import {
|
|
11
11
|
listPybAgentSessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SSKQUKI7.js";
|
|
13
13
|
import {
|
|
14
14
|
appendSessionCustomTitleRecord,
|
|
15
15
|
appendSessionJsonlFromMessage,
|
|
16
16
|
appendSessionTagRecord
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NNE44UHQ.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-DEYAAT6H.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-VHTIDAOJ.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchCustomModels,
|
|
41
41
|
getModelFeatures
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-UK4IHZU3.js";
|
|
43
43
|
import {
|
|
44
44
|
queryLLM,
|
|
45
45
|
queryQuick,
|
|
46
46
|
verifyApiKey
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-E5EB22W4.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-VFQU3JSH.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-VXQMCAPS.js";
|
|
75
75
|
import {
|
|
76
76
|
loadToolPermissionContextFromDisk,
|
|
77
77
|
persistToolPermissionUpdateToDisk
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-7WCSSH3C.js";
|
|
79
79
|
import {
|
|
80
80
|
applyToolPermissionContextUpdate,
|
|
81
81
|
applyToolPermissionContextUpdates,
|
|
@@ -85,11 +85,17 @@ import {
|
|
|
85
85
|
emitReminderEvent,
|
|
86
86
|
generateSystemReminders,
|
|
87
87
|
getAgentFilePath,
|
|
88
|
+
getTaskListPaths,
|
|
88
89
|
getTodos,
|
|
90
|
+
isTodoCompatEnabled,
|
|
91
|
+
listTasks,
|
|
92
|
+
migrateTodosToTasks,
|
|
93
|
+
readTaskEventLog,
|
|
89
94
|
resetReminderSession,
|
|
90
95
|
setTodos,
|
|
96
|
+
syncTodosToTasks,
|
|
91
97
|
systemReminderService
|
|
92
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-AI7FJQR4.js";
|
|
93
99
|
import {
|
|
94
100
|
getSessionState
|
|
95
101
|
} from "./chunk-ERMQRV55.js";
|
|
@@ -98,7 +104,7 @@ import {
|
|
|
98
104
|
getActiveAgents,
|
|
99
105
|
getAgentByType,
|
|
100
106
|
getAllAgents
|
|
101
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-KNLFFHBT.js";
|
|
102
108
|
import {
|
|
103
109
|
API_ERROR_MESSAGE_PREFIX,
|
|
104
110
|
CANCEL_MESSAGE,
|
|
@@ -128,7 +134,7 @@ import {
|
|
|
128
134
|
processUserInput,
|
|
129
135
|
reorderMessages,
|
|
130
136
|
stripSystemMessages
|
|
131
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-DLBWS3IW.js";
|
|
132
138
|
import {
|
|
133
139
|
getRequestStatus,
|
|
134
140
|
setRequestStatus,
|
|
@@ -158,7 +164,7 @@ import {
|
|
|
158
164
|
normalizeFilePath,
|
|
159
165
|
readTextContent,
|
|
160
166
|
writeTextContent
|
|
161
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-NMJYV37P.js";
|
|
162
168
|
import {
|
|
163
169
|
parseBlockEdits
|
|
164
170
|
} from "./chunk-QWIBSCDN.js";
|
|
@@ -168,18 +174,18 @@ import {
|
|
|
168
174
|
ParserRegistry,
|
|
169
175
|
initParser,
|
|
170
176
|
loadLanguage
|
|
171
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-7TGWBYFN.js";
|
|
172
178
|
import {
|
|
173
179
|
getSettingsFileCandidates,
|
|
174
180
|
loadSettingsWithLegacyFallback,
|
|
175
181
|
readSettingsFile
|
|
176
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-N4GXGPVA.js";
|
|
177
183
|
import {
|
|
178
184
|
getCustomCommandDirectories,
|
|
179
185
|
hasCustomCommands,
|
|
180
186
|
loadCustomCommands,
|
|
181
187
|
reloadCustomCommands
|
|
182
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-SBPVAFBQ.js";
|
|
183
189
|
import {
|
|
184
190
|
getSessionPlugins
|
|
185
191
|
} from "./chunk-BJSWTHRM.js";
|
|
@@ -187,7 +193,7 @@ import {
|
|
|
187
193
|
ModelManager,
|
|
188
194
|
getModelManager,
|
|
189
195
|
isDefaultSlowAndCapableModel
|
|
190
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-4LXZDGCO.js";
|
|
191
197
|
import {
|
|
192
198
|
getCodeStyle,
|
|
193
199
|
getContext,
|
|
@@ -195,13 +201,13 @@ import {
|
|
|
195
201
|
getIsGit,
|
|
196
202
|
getProjectDocs,
|
|
197
203
|
getProjectStructureStatisticsBlock
|
|
198
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-GXHSGPIF.js";
|
|
199
205
|
import {
|
|
200
206
|
ripGrep
|
|
201
|
-
} from "./chunk-
|
|
207
|
+
} from "./chunk-6KSM5M7T.js";
|
|
202
208
|
import {
|
|
203
209
|
getTheme
|
|
204
|
-
} from "./chunk-
|
|
210
|
+
} from "./chunk-GD43B2GV.js";
|
|
205
211
|
import {
|
|
206
212
|
DEFAULT_GLOBAL_CONFIG,
|
|
207
213
|
enableConfigs,
|
|
@@ -214,7 +220,7 @@ import {
|
|
|
214
220
|
saveGlobalConfig,
|
|
215
221
|
setAllPointersToModel,
|
|
216
222
|
setModelPointer
|
|
217
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-TNAAGT3Q.js";
|
|
218
224
|
import {
|
|
219
225
|
AbortError
|
|
220
226
|
} from "./chunk-RQVLBMP7.js";
|
|
@@ -223,7 +229,7 @@ import {
|
|
|
223
229
|
getCurrentRequest,
|
|
224
230
|
logUserFriendly,
|
|
225
231
|
markPhase
|
|
226
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-O5OT26P6.js";
|
|
227
233
|
import {
|
|
228
234
|
ASCII_LOGO,
|
|
229
235
|
BunShell,
|
|
@@ -264,19 +270,19 @@ import {
|
|
|
264
270
|
setCwd,
|
|
265
271
|
shouldApplyToolOutputTruncation,
|
|
266
272
|
truncateToolOutput
|
|
267
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-ZGVGFR4C.js";
|
|
268
274
|
import {
|
|
269
275
|
MACRO
|
|
270
|
-
} from "./chunk-
|
|
276
|
+
} from "./chunk-UUWI4VWU.js";
|
|
271
277
|
import {
|
|
272
278
|
__export
|
|
273
279
|
} from "./chunk-I3J4JYES.js";
|
|
274
280
|
|
|
275
281
|
// src/tools/system/BashTool/BashTool.tsx
|
|
276
|
-
import { statSync as
|
|
282
|
+
import { statSync as statSync13 } from "fs";
|
|
277
283
|
import { EOL as EOL3 } from "os";
|
|
278
284
|
import { isAbsolute as isAbsolute8, relative as relative12, resolve as resolve10 } from "path";
|
|
279
|
-
import * as
|
|
285
|
+
import * as React113 from "react";
|
|
280
286
|
import { z as z16 } from "zod";
|
|
281
287
|
|
|
282
288
|
// src/utils/commands/index.ts
|
|
@@ -448,7 +454,7 @@ var getCommandSubcommandPrefix = memoize(
|
|
|
448
454
|
var getCommandPrefix = memoize(
|
|
449
455
|
async (command4, abortSignal) => {
|
|
450
456
|
const { systemPrompt, userPrompt } = buildBashCommandPrefixDetectionPrompt(command4);
|
|
451
|
-
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-3KCTIVOM.js");
|
|
452
458
|
const response = await queryQuick2({
|
|
453
459
|
systemPrompt,
|
|
454
460
|
userPrompt,
|
|
@@ -4250,7 +4256,7 @@ function formatParseError(error) {
|
|
|
4250
4256
|
return error instanceof Error ? error.message : String(error);
|
|
4251
4257
|
}
|
|
4252
4258
|
async function defaultGateQuery(args) {
|
|
4253
|
-
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-3KCTIVOM.js");
|
|
4254
4260
|
const queryLLMFn = args.queryLLMOverride ?? queryLLM2;
|
|
4255
4261
|
const messages = [
|
|
4256
4262
|
{
|
|
@@ -5128,7 +5134,7 @@ To complete your request, I need to fetch content from the redirected URL. Pleas
|
|
|
5128
5134
|
|
|
5129
5135
|
// src/ui/components/permissions/web-fetch-permission-request/WebFetchPermissionRequest.tsx
|
|
5130
5136
|
import { Box as Box82, Text as Text86, useInput as useInput32 } from "ink";
|
|
5131
|
-
import
|
|
5137
|
+
import React112, { useMemo as useMemo27 } from "react";
|
|
5132
5138
|
import chalk16 from "chalk";
|
|
5133
5139
|
|
|
5134
5140
|
// src/ui/components/custom-select/select.tsx
|
|
@@ -6565,7 +6571,7 @@ var FileEditTool = {
|
|
|
6565
6571
|
const originalFileContent = currentFileContent;
|
|
6566
6572
|
let totalPatch = [];
|
|
6567
6573
|
const { SmartEdit } = await import("./smart-edit-AWHJDSU6.js");
|
|
6568
|
-
const { findLspAnchor } = await import("./lspAnchor-
|
|
6574
|
+
const { findLspAnchor } = await import("./lspAnchor-FKXOKCQZ.js");
|
|
6569
6575
|
for (const op of editOperations) {
|
|
6570
6576
|
const normalizedSearch = normalizeLineEndings(op.search);
|
|
6571
6577
|
const normalizedReplace = normalizeLineEndings(op.replace);
|
|
@@ -11200,7 +11206,7 @@ async function createAndStoreApiKey(accessToken) {
|
|
|
11200
11206
|
}
|
|
11201
11207
|
saveGlobalConfig(config2);
|
|
11202
11208
|
try {
|
|
11203
|
-
const { resetAnthropicClient } = await import("./llm-
|
|
11209
|
+
const { resetAnthropicClient } = await import("./llm-3KCTIVOM.js");
|
|
11204
11210
|
resetAnthropicClient();
|
|
11205
11211
|
} catch {
|
|
11206
11212
|
}
|
|
@@ -15482,7 +15488,7 @@ async function refreshPluginRuntimeFromInstalls() {
|
|
|
15482
15488
|
const existingRoots = getSessionPlugins().map((p) => p.rootDir);
|
|
15483
15489
|
const dirs = Array.from(/* @__PURE__ */ new Set([...existingRoots, ...installedRoots]));
|
|
15484
15490
|
if (dirs.length === 0) return [];
|
|
15485
|
-
const { configureSessionPlugins } = await import("./pluginRuntime-
|
|
15491
|
+
const { configureSessionPlugins } = await import("./pluginRuntime-REF3E5F5.js");
|
|
15486
15492
|
const { errors } = await configureSessionPlugins({ pluginDirs: dirs });
|
|
15487
15493
|
return errors;
|
|
15488
15494
|
}
|
|
@@ -16151,7 +16157,7 @@ async function call(onDone, context) {
|
|
|
16151
16157
|
ModelConfig,
|
|
16152
16158
|
{
|
|
16153
16159
|
onClose: () => {
|
|
16154
|
-
import("./model-
|
|
16160
|
+
import("./model-R5X6XP7I.js").then(({ reloadModelManager: reloadModelManager2 }) => {
|
|
16155
16161
|
reloadModelManager2();
|
|
16156
16162
|
triggerModelConfigChange();
|
|
16157
16163
|
onDone();
|
|
@@ -16973,48 +16979,195 @@ var tag = {
|
|
|
16973
16979
|
var tag_default = tag;
|
|
16974
16980
|
|
|
16975
16981
|
// src/commands/todos.tsx
|
|
16976
|
-
import {
|
|
16982
|
+
import { useInput as useInput16 } from "ink";
|
|
16977
16983
|
import * as React48 from "react";
|
|
16978
16984
|
|
|
16979
|
-
// src/ui/components/
|
|
16980
|
-
import React47 from "react";
|
|
16985
|
+
// src/ui/components/TaskList.tsx
|
|
16981
16986
|
import { Box as Box36, Text as Text40 } from "ink";
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
const
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16987
|
+
import React47 from "react";
|
|
16988
|
+
|
|
16989
|
+
// src/utils/session/taskGraph.ts
|
|
16990
|
+
function buildTaskGraph(tasks) {
|
|
16991
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
16992
|
+
const edges = [];
|
|
16993
|
+
const edgeKeys = /* @__PURE__ */ new Set();
|
|
16994
|
+
for (const task of tasks) {
|
|
16995
|
+
nodes.set(task.id, task);
|
|
16996
|
+
}
|
|
16997
|
+
for (const task of tasks) {
|
|
16998
|
+
const blocks = task.blocks ?? [];
|
|
16999
|
+
for (const blockedId of blocks) {
|
|
17000
|
+
const key = `blocks:${task.id}->${blockedId}`;
|
|
17001
|
+
if (!edgeKeys.has(key)) {
|
|
17002
|
+
edgeKeys.add(key);
|
|
17003
|
+
edges.push({ from: task.id, to: blockedId, type: "blocks" });
|
|
17004
|
+
}
|
|
17005
|
+
}
|
|
17006
|
+
const blockedBy = task.blockedBy ?? [];
|
|
17007
|
+
for (const blockerId of blockedBy) {
|
|
17008
|
+
const key = `blocks:${blockerId}->${task.id}`;
|
|
17009
|
+
if (!edgeKeys.has(key)) {
|
|
17010
|
+
edgeKeys.add(key);
|
|
17011
|
+
edges.push({ from: blockerId, to: task.id, type: "blocks" });
|
|
17012
|
+
}
|
|
17013
|
+
}
|
|
17014
|
+
if (task.parent) {
|
|
17015
|
+
const key = `parent:${task.parent}->${task.id}`;
|
|
17016
|
+
if (!edgeKeys.has(key)) {
|
|
17017
|
+
edgeKeys.add(key);
|
|
17018
|
+
edges.push({ from: task.parent, to: task.id, type: "parent" });
|
|
17019
|
+
}
|
|
17020
|
+
}
|
|
17021
|
+
const related = task.related ?? [];
|
|
17022
|
+
for (const relatedId of related) {
|
|
17023
|
+
const key = `related:${task.id}->${relatedId}`;
|
|
17024
|
+
if (!edgeKeys.has(key)) {
|
|
17025
|
+
edgeKeys.add(key);
|
|
17026
|
+
edges.push({ from: task.id, to: relatedId, type: "related" });
|
|
17027
|
+
}
|
|
17028
|
+
}
|
|
17029
|
+
}
|
|
17030
|
+
return { nodes, edges };
|
|
17031
|
+
}
|
|
17032
|
+
function findTaskCycles(graph) {
|
|
17033
|
+
const cycles = [];
|
|
17034
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
17035
|
+
const visited = /* @__PURE__ */ new Set();
|
|
17036
|
+
const stack = [];
|
|
17037
|
+
const adjacency = /* @__PURE__ */ new Map();
|
|
17038
|
+
for (const edge of graph.edges) {
|
|
17039
|
+
if (edge.type === "related") continue;
|
|
17040
|
+
const list = adjacency.get(edge.from) ?? [];
|
|
17041
|
+
list.push(edge.to);
|
|
17042
|
+
adjacency.set(edge.from, list);
|
|
17043
|
+
}
|
|
17044
|
+
const visit = (nodeId) => {
|
|
17045
|
+
if (visiting.has(nodeId)) {
|
|
17046
|
+
const idx = stack.indexOf(nodeId);
|
|
17047
|
+
if (idx >= 0) {
|
|
17048
|
+
cycles.push([...stack.slice(idx), nodeId]);
|
|
17049
|
+
}
|
|
17050
|
+
return;
|
|
17051
|
+
}
|
|
17052
|
+
if (visited.has(nodeId)) return;
|
|
17053
|
+
visiting.add(nodeId);
|
|
17054
|
+
stack.push(nodeId);
|
|
17055
|
+
const nextNodes = adjacency.get(nodeId) ?? [];
|
|
17056
|
+
for (const next of nextNodes) {
|
|
17057
|
+
visit(next);
|
|
17058
|
+
}
|
|
17059
|
+
stack.pop();
|
|
17060
|
+
visiting.delete(nodeId);
|
|
17061
|
+
visited.add(nodeId);
|
|
16998
17062
|
};
|
|
16999
|
-
const
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
return
|
|
17063
|
+
for (const nodeId of graph.nodes.keys()) {
|
|
17064
|
+
visit(nodeId);
|
|
17065
|
+
}
|
|
17066
|
+
return cycles;
|
|
17067
|
+
}
|
|
17068
|
+
function isTaskBlocked(task, tasksById) {
|
|
17069
|
+
const blockers = task.blockedBy ?? [];
|
|
17070
|
+
if (blockers.length === 0) return false;
|
|
17071
|
+
for (const blockerId of blockers) {
|
|
17072
|
+
const blocker = tasksById.get(blockerId);
|
|
17073
|
+
if (!blocker) return true;
|
|
17074
|
+
if (blocker.status !== "done" && blocker.status !== "archived") return true;
|
|
17075
|
+
}
|
|
17076
|
+
return false;
|
|
17077
|
+
}
|
|
17078
|
+
function isReadyStatus(status) {
|
|
17079
|
+
return status === "open";
|
|
17080
|
+
}
|
|
17081
|
+
function calculateReadyBlocked(tasks) {
|
|
17082
|
+
const tasksById = new Map(tasks.map((task) => [task.id, task]));
|
|
17083
|
+
const ready = [];
|
|
17084
|
+
const blocked = [];
|
|
17085
|
+
for (const task of tasks) {
|
|
17086
|
+
if (task.status === "done" || task.status === "archived") continue;
|
|
17087
|
+
const blockedByDeps = isTaskBlocked(task, tasksById);
|
|
17088
|
+
if (blockedByDeps) {
|
|
17089
|
+
blocked.push(task);
|
|
17090
|
+
continue;
|
|
17091
|
+
}
|
|
17092
|
+
if (task.status === "blocked") {
|
|
17093
|
+
blocked.push(task);
|
|
17094
|
+
continue;
|
|
17095
|
+
}
|
|
17096
|
+
if (isReadyStatus(task.status)) {
|
|
17097
|
+
ready.push(task);
|
|
17098
|
+
}
|
|
17099
|
+
}
|
|
17100
|
+
return { ready, blocked };
|
|
17101
|
+
}
|
|
17102
|
+
|
|
17103
|
+
// src/ui/components/TaskList.tsx
|
|
17104
|
+
function getStatusIcon(status) {
|
|
17105
|
+
if (status === "done") return "\u2705";
|
|
17106
|
+
if (status === "archived") return "\u{1F4E6}";
|
|
17107
|
+
if (status === "in_progress") return "\u{1F504}";
|
|
17108
|
+
if (status === "blocked") return "\u26D4";
|
|
17109
|
+
return "\u23F8\uFE0F";
|
|
17110
|
+
}
|
|
17111
|
+
function getStatusColor(status) {
|
|
17112
|
+
if (status === "done" || status === "archived") return void 0;
|
|
17113
|
+
if (status === "in_progress") return "#FFA500";
|
|
17114
|
+
if (status === "blocked") return "#FF5555";
|
|
17115
|
+
return "#FFD700";
|
|
17116
|
+
}
|
|
17117
|
+
function formatTaskDetails(task) {
|
|
17118
|
+
const description3 = task.description?.trim();
|
|
17119
|
+
const blockedBy = (task.blockedBy ?? []).filter(Boolean);
|
|
17120
|
+
if (!description3 && blockedBy.length === 0) return null;
|
|
17121
|
+
if (blockedBy.length === 0) return description3 ?? null;
|
|
17122
|
+
const blockedText = `blocked by: ${blockedBy.join(", ")}`;
|
|
17123
|
+
if (description3) return `${description3} | ${blockedText}`;
|
|
17124
|
+
return blockedText;
|
|
17125
|
+
}
|
|
17126
|
+
function renderTask(task) {
|
|
17127
|
+
const color = getStatusColor(task.status);
|
|
17128
|
+
const isFinished = task.status === "done" || task.status === "archived";
|
|
17129
|
+
const details = formatTaskDetails(task);
|
|
17130
|
+
return /* @__PURE__ */ React47.createElement(Box36, { key: task.id, flexDirection: "row", gap: 1 }, /* @__PURE__ */ React47.createElement(Text40, null, "\u23BF"), /* @__PURE__ */ React47.createElement(Text40, { color, dimColor: isFinished }, getStatusIcon(task.status)), /* @__PURE__ */ React47.createElement(
|
|
17003
17131
|
Text40,
|
|
17004
17132
|
{
|
|
17005
17133
|
color,
|
|
17006
|
-
dimColor:
|
|
17007
|
-
strikethrough:
|
|
17008
|
-
bold:
|
|
17134
|
+
dimColor: isFinished,
|
|
17135
|
+
strikethrough: isFinished,
|
|
17136
|
+
bold: task.status === "in_progress"
|
|
17009
17137
|
},
|
|
17010
|
-
|
|
17011
|
-
),
|
|
17012
|
-
|
|
17138
|
+
task.subject
|
|
17139
|
+
), details ? /* @__PURE__ */ React47.createElement(
|
|
17140
|
+
Text40,
|
|
17141
|
+
{
|
|
17142
|
+
color,
|
|
17143
|
+
dimColor: isFinished,
|
|
17144
|
+
strikethrough: isFinished,
|
|
17145
|
+
bold: task.status === "in_progress"
|
|
17146
|
+
},
|
|
17147
|
+
" - ",
|
|
17148
|
+
details
|
|
17149
|
+
) : null);
|
|
17150
|
+
}
|
|
17151
|
+
function TaskList(props) {
|
|
17152
|
+
const tasks = props.tasks ?? listTasks({ listId: props.listId });
|
|
17153
|
+
const visibleTasks = tasks.filter((task) => task.status !== "archived");
|
|
17154
|
+
const computed = calculateReadyBlocked(visibleTasks);
|
|
17155
|
+
const ready = (props.ready ?? computed.ready).filter(
|
|
17156
|
+
(task) => task.status !== "archived"
|
|
17157
|
+
);
|
|
17158
|
+
const blocked = (props.blocked ?? computed.blocked).filter(
|
|
17159
|
+
(task) => task.status !== "archived"
|
|
17160
|
+
);
|
|
17161
|
+
const total = visibleTasks.length;
|
|
17162
|
+
if (total === 0) {
|
|
17163
|
+
return /* @__PURE__ */ React47.createElement(Text40, null, "No tasks currently tracked");
|
|
17164
|
+
}
|
|
17165
|
+
return /* @__PURE__ */ React47.createElement(Box36, { flexDirection: "column" }, /* @__PURE__ */ React47.createElement(Text40, null, /* @__PURE__ */ React47.createElement(Text40, { bold: true }, ready.length, " ready"), /* @__PURE__ */ React47.createElement(Text40, null, " / "), /* @__PURE__ */ React47.createElement(Text40, { bold: true }, blocked.length, " blocked")), /* @__PURE__ */ React47.createElement(Box36, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React47.createElement(Text40, { bold: true }, "Ready"), /* @__PURE__ */ React47.createElement(Box36, { marginLeft: 2, flexDirection: "column" }, ready.length === 0 ? /* @__PURE__ */ React47.createElement(Text40, { dimColor: true }, "none") : ready.map((task) => renderTask(task))), /* @__PURE__ */ React47.createElement(Box36, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React47.createElement(Text40, { bold: true }, "Blocked"), /* @__PURE__ */ React47.createElement(Box36, { marginLeft: 2, flexDirection: "column" }, blocked.length === 0 ? /* @__PURE__ */ React47.createElement(Text40, { dimColor: true }, "none") : blocked.map((task) => renderTask(task))))));
|
|
17166
|
+
}
|
|
17013
17167
|
|
|
17014
17168
|
// src/commands/todos.tsx
|
|
17015
17169
|
function TodosView({
|
|
17016
|
-
|
|
17017
|
-
todos: injectedTodos,
|
|
17170
|
+
tasks: injectedTasks,
|
|
17018
17171
|
onClose
|
|
17019
17172
|
}) {
|
|
17020
17173
|
useInput16((input, key) => {
|
|
@@ -17022,23 +17175,8 @@ function TodosView({
|
|
|
17022
17175
|
onClose();
|
|
17023
17176
|
}
|
|
17024
17177
|
});
|
|
17025
|
-
const
|
|
17026
|
-
|
|
17027
|
-
return /* @__PURE__ */ React48.createElement(Text41, null, "No todos currently tracked");
|
|
17028
|
-
}
|
|
17029
|
-
const completedIndices = todos2.map((t, i) => ({ status: t.status, index: i })).filter((t) => t.status === "completed").map((t) => t.index);
|
|
17030
|
-
const indicesToHide = /* @__PURE__ */ new Set();
|
|
17031
|
-
if (completedIndices.length > 3) {
|
|
17032
|
-
const toHide = completedIndices.slice(0, completedIndices.length - 1);
|
|
17033
|
-
toHide.forEach((i) => indicesToHide.add(i));
|
|
17034
|
-
}
|
|
17035
|
-
const collapsedCount = indicesToHide.size;
|
|
17036
|
-
const count = todos2.length;
|
|
17037
|
-
const label = count === 1 ? "todo" : "todos";
|
|
17038
|
-
return /* @__PURE__ */ React48.createElement(Box37, { flexDirection: "column" }, /* @__PURE__ */ React48.createElement(Text41, null, /* @__PURE__ */ React48.createElement(Text41, { bold: true }, count, " ", label), /* @__PURE__ */ React48.createElement(Text41, null, ":")), /* @__PURE__ */ React48.createElement(Box37, { marginTop: 1, flexDirection: "column" }, collapsedCount > 0 && /* @__PURE__ */ React48.createElement(Box37, { marginLeft: 2, marginBottom: 0 }, /* @__PURE__ */ React48.createElement(Text41, { dimColor: true }, "... ", collapsedCount, " completed tasks collapsed ...")), todos2.map((item, index) => {
|
|
17039
|
-
if (indicesToHide.has(index)) return null;
|
|
17040
|
-
return /* @__PURE__ */ React48.createElement(TodoItem, { key: index, todo: item });
|
|
17041
|
-
})));
|
|
17178
|
+
const tasks = injectedTasks ?? listTasks();
|
|
17179
|
+
return /* @__PURE__ */ React48.createElement(TaskList, { tasks });
|
|
17042
17180
|
}
|
|
17043
17181
|
var todos = {
|
|
17044
17182
|
type: "local-jsx",
|
|
@@ -17047,7 +17185,9 @@ var todos = {
|
|
|
17047
17185
|
isEnabled: true,
|
|
17048
17186
|
isHidden: false,
|
|
17049
17187
|
async call(onDone, context) {
|
|
17050
|
-
|
|
17188
|
+
migrateTodosToTasks();
|
|
17189
|
+
const tasks = listTasks();
|
|
17190
|
+
return /* @__PURE__ */ React48.createElement(TodosView, { tasks, onClose: onDone });
|
|
17051
17191
|
},
|
|
17052
17192
|
userFacingName() {
|
|
17053
17193
|
return "todos";
|
|
@@ -17070,7 +17210,7 @@ __export(websearch_exports, {
|
|
|
17070
17210
|
import React50 from "react";
|
|
17071
17211
|
|
|
17072
17212
|
// src/ui/components/WebSearchConfig.tsx
|
|
17073
|
-
import { Box as
|
|
17213
|
+
import { Box as Box37, Text as Text41, useInput as useInput17 } from "ink";
|
|
17074
17214
|
import React49, { useMemo as useMemo9, useState as useState16 } from "react";
|
|
17075
17215
|
import figures6 from "figures";
|
|
17076
17216
|
var providerOptions = [
|
|
@@ -17312,8 +17452,8 @@ function WebSearchConfig({ onClose }) {
|
|
|
17312
17452
|
}
|
|
17313
17453
|
});
|
|
17314
17454
|
const cwd = getCwd();
|
|
17315
|
-
return /* @__PURE__ */ React49.createElement(
|
|
17316
|
-
|
|
17455
|
+
return /* @__PURE__ */ React49.createElement(Box37, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React49.createElement(
|
|
17456
|
+
Box37,
|
|
17317
17457
|
{
|
|
17318
17458
|
flexDirection: "column",
|
|
17319
17459
|
borderStyle: "round",
|
|
@@ -17322,30 +17462,30 @@ function WebSearchConfig({ onClose }) {
|
|
|
17322
17462
|
paddingY: 1,
|
|
17323
17463
|
gap: 1
|
|
17324
17464
|
},
|
|
17325
|
-
/* @__PURE__ */ React49.createElement(
|
|
17326
|
-
/* @__PURE__ */ React49.createElement(
|
|
17465
|
+
/* @__PURE__ */ React49.createElement(Text41, { bold: true }, "Web Search Configuration", " ", exitState.pending ? `(press ${exitState.keyName} again to exit)` : ""),
|
|
17466
|
+
/* @__PURE__ */ React49.createElement(Box37, { flexDirection: "column" }, menuItems.map((item, index) => {
|
|
17327
17467
|
const isSelected = index === selectedIndex;
|
|
17328
|
-
return /* @__PURE__ */ React49.createElement(
|
|
17329
|
-
|
|
17468
|
+
return /* @__PURE__ */ React49.createElement(Box37, { key: item.id, flexDirection: "column" }, /* @__PURE__ */ React49.createElement(Box37, { flexDirection: "row", gap: 1 }, /* @__PURE__ */ React49.createElement(Text41, { color: isSelected ? theme.success : theme.text }, isSelected ? figures6.pointer : " ", " ", item.label), /* @__PURE__ */ React49.createElement(
|
|
17469
|
+
Text41,
|
|
17330
17470
|
{
|
|
17331
17471
|
color: item.value === "Not set" ? theme.warning : theme.success
|
|
17332
17472
|
},
|
|
17333
17473
|
item.value
|
|
17334
|
-
), isSelected && /* @__PURE__ */ React49.createElement(
|
|
17474
|
+
), isSelected && /* @__PURE__ */ React49.createElement(Text41, { color: theme.suggestion }, item.id === "tavily-key" ? " [Enter to edit]" : " [Enter/Space to change]")), isSelected && /* @__PURE__ */ React49.createElement(Box37, { paddingLeft: 2, marginBottom: 1 }, /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, item.description)));
|
|
17335
17475
|
})),
|
|
17336
|
-
isEditingKey && /* @__PURE__ */ React49.createElement(
|
|
17337
|
-
/* @__PURE__ */ React49.createElement(
|
|
17338
|
-
/* @__PURE__ */ React49.createElement(
|
|
17339
|
-
/* @__PURE__ */ React49.createElement(
|
|
17476
|
+
isEditingKey && /* @__PURE__ */ React49.createElement(Box37, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React49.createElement(Text41, { bold: true, color: theme.success }, "Enter Tavily API Key (", scope === "project" ? "Project" : "Global", ")"), /* @__PURE__ */ React49.createElement(Text41, { color: theme.secondaryText }, keyInput.replace(/./g, "\u2022")), /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Press Enter to save, Esc to cancel, empty input clears the key")),
|
|
17477
|
+
/* @__PURE__ */ React49.createElement(Box37, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Provider source: ", formatSourceLabel(sources.provider.source)), /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Tavily key source: ", formatSourceLabel(sources.tavilyKey.source))),
|
|
17478
|
+
/* @__PURE__ */ React49.createElement(Box37, { marginTop: 1 }, /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Project scope saves to the exact path: ", cwd)),
|
|
17479
|
+
/* @__PURE__ */ React49.createElement(Box37, null, /* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Running from a subdirectory uses a different project scope entry")),
|
|
17340
17480
|
/* @__PURE__ */ React49.createElement(
|
|
17341
|
-
|
|
17481
|
+
Box37,
|
|
17342
17482
|
{
|
|
17343
17483
|
marginTop: 1,
|
|
17344
17484
|
paddingTop: 1,
|
|
17345
17485
|
borderTopColor: theme.secondaryBorder,
|
|
17346
17486
|
borderTopStyle: "single"
|
|
17347
17487
|
},
|
|
17348
|
-
/* @__PURE__ */ React49.createElement(
|
|
17488
|
+
/* @__PURE__ */ React49.createElement(Text41, { dimColor: true }, "Use \u2191/\u2193 to navigate, Enter/Space to change, Esc to exit")
|
|
17349
17489
|
)
|
|
17350
17490
|
));
|
|
17351
17491
|
}
|
|
@@ -17375,24 +17515,24 @@ import React104 from "react";
|
|
|
17375
17515
|
import { render } from "ink";
|
|
17376
17516
|
|
|
17377
17517
|
// src/ui/screens/REPL.tsx
|
|
17378
|
-
import { Box as
|
|
17518
|
+
import { Box as Box76, Newline as Newline4, Static as Static2 } from "ink";
|
|
17379
17519
|
|
|
17380
17520
|
// src/ui/components/CostThresholdDialog.tsx
|
|
17381
|
-
import { Box as
|
|
17521
|
+
import { Box as Box38, Text as Text43, useInput as useInput18 } from "ink";
|
|
17382
17522
|
import React52 from "react";
|
|
17383
17523
|
|
|
17384
17524
|
// src/ui/components/Link.tsx
|
|
17385
17525
|
import InkLink from "ink-link";
|
|
17386
|
-
import { Text as
|
|
17526
|
+
import { Text as Text42 } from "ink";
|
|
17387
17527
|
import React51 from "react";
|
|
17388
17528
|
var LINK_SUPPORTING_TERMINALS = ["iTerm.app", "WezTerm", "Hyper", "VSCode"];
|
|
17389
17529
|
function Link({ url: url2, children }) {
|
|
17390
17530
|
const supportsLinks = LINK_SUPPORTING_TERMINALS.includes(env.terminal ?? "");
|
|
17391
17531
|
const displayContent = children || url2;
|
|
17392
17532
|
if (supportsLinks || displayContent !== url2) {
|
|
17393
|
-
return /* @__PURE__ */ React51.createElement(InkLink, { url: url2 }, /* @__PURE__ */ React51.createElement(
|
|
17533
|
+
return /* @__PURE__ */ React51.createElement(InkLink, { url: url2 }, /* @__PURE__ */ React51.createElement(Text42, null, displayContent));
|
|
17394
17534
|
} else {
|
|
17395
|
-
return /* @__PURE__ */ React51.createElement(
|
|
17535
|
+
return /* @__PURE__ */ React51.createElement(Text42, { underline: true }, displayContent);
|
|
17396
17536
|
}
|
|
17397
17537
|
}
|
|
17398
17538
|
|
|
@@ -17404,15 +17544,15 @@ function CostThresholdDialog({ onDone }) {
|
|
|
17404
17544
|
}
|
|
17405
17545
|
});
|
|
17406
17546
|
return /* @__PURE__ */ React52.createElement(
|
|
17407
|
-
|
|
17547
|
+
Box38,
|
|
17408
17548
|
{
|
|
17409
17549
|
flexDirection: "column",
|
|
17410
17550
|
borderStyle: "round",
|
|
17411
17551
|
padding: 1,
|
|
17412
17552
|
borderColor: getTheme().secondaryBorder
|
|
17413
17553
|
},
|
|
17414
|
-
/* @__PURE__ */ React52.createElement(
|
|
17415
|
-
/* @__PURE__ */ React52.createElement(
|
|
17554
|
+
/* @__PURE__ */ React52.createElement(Box38, { marginBottom: 1, flexDirection: "column" }, /* @__PURE__ */ React52.createElement(Text43, { bold: true }, "You've spent $5 on AI model API calls this session."), /* @__PURE__ */ React52.createElement(Text43, null, "Learn more about monitoring your AI usage costs:"), /* @__PURE__ */ React52.createElement(Link, { url: "https://github.com/pyb-xc/pyb-ts/blob/main/README.md" })),
|
|
17555
|
+
/* @__PURE__ */ React52.createElement(Box38, null, /* @__PURE__ */ React52.createElement(
|
|
17416
17556
|
Select,
|
|
17417
17557
|
{
|
|
17418
17558
|
options: [
|
|
@@ -17432,21 +17572,21 @@ import * as React102 from "react";
|
|
|
17432
17572
|
import { useEffect as useEffect25, useMemo as useMemo25, useRef as useRef13, useState as useState27, useCallback as useCallback16 } from "react";
|
|
17433
17573
|
|
|
17434
17574
|
// src/ui/components/Message.tsx
|
|
17435
|
-
import { Box as
|
|
17575
|
+
import { Box as Box52 } from "ink";
|
|
17436
17576
|
import * as React73 from "react";
|
|
17437
17577
|
|
|
17438
17578
|
// src/ui/components/messages/user-tool-result-message/UserToolResultMessage.tsx
|
|
17439
17579
|
import * as React58 from "react";
|
|
17440
17580
|
|
|
17441
17581
|
// src/ui/components/messages/user-tool-result-message/UserToolCanceledMessage.tsx
|
|
17442
|
-
import { Text as
|
|
17582
|
+
import { Text as Text44 } from "ink";
|
|
17443
17583
|
import * as React53 from "react";
|
|
17444
17584
|
function UserToolCanceledMessage() {
|
|
17445
|
-
return /* @__PURE__ */ React53.createElement(
|
|
17585
|
+
return /* @__PURE__ */ React53.createElement(Text44, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React53.createElement(Text44, { color: getTheme().error }, "Interrupted by user"));
|
|
17446
17586
|
}
|
|
17447
17587
|
|
|
17448
17588
|
// src/ui/components/messages/user-tool-result-message/UserToolErrorMessage.tsx
|
|
17449
|
-
import { Box as
|
|
17589
|
+
import { Box as Box39, Text as Text45 } from "ink";
|
|
17450
17590
|
import * as React54 from "react";
|
|
17451
17591
|
var MAX_RENDERED_LINES = 10;
|
|
17452
17592
|
function UserToolErrorMessage({
|
|
@@ -17454,7 +17594,7 @@ function UserToolErrorMessage({
|
|
|
17454
17594
|
verbose
|
|
17455
17595
|
}) {
|
|
17456
17596
|
const error = typeof param.content === "string" ? param.content.trim() : "Error";
|
|
17457
|
-
return /* @__PURE__ */ React54.createElement(
|
|
17597
|
+
return /* @__PURE__ */ React54.createElement(Box39, { flexDirection: "row", width: "100%" }, /* @__PURE__ */ React54.createElement(Text45, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React54.createElement(Box39, { flexDirection: "column" }, /* @__PURE__ */ React54.createElement(Text45, { color: getTheme().error }, verbose ? error : error.split("\n").slice(0, MAX_RENDERED_LINES).join("\n") || ""), !verbose && error.split("\n").length > MAX_RENDERED_LINES && /* @__PURE__ */ React54.createElement(Text45, { color: getTheme().secondaryText }, "... (+", error.split("\n").length - MAX_RENDERED_LINES, " lines)")));
|
|
17458
17598
|
}
|
|
17459
17599
|
|
|
17460
17600
|
// src/ui/components/messages/user-tool-result-message/UserToolRejectMessage.tsx
|
|
@@ -17922,7 +18062,7 @@ function UserToolRejectMessage({
|
|
|
17922
18062
|
}
|
|
17923
18063
|
|
|
17924
18064
|
// src/ui/components/messages/user-tool-result-message/UserToolSuccessMessage.tsx
|
|
17925
|
-
import { Box as
|
|
18065
|
+
import { Box as Box40 } from "ink";
|
|
17926
18066
|
import * as React57 from "react";
|
|
17927
18067
|
function UserToolSuccessMessage({
|
|
17928
18068
|
param,
|
|
@@ -17933,7 +18073,7 @@ function UserToolSuccessMessage({
|
|
|
17933
18073
|
width
|
|
17934
18074
|
}) {
|
|
17935
18075
|
const { tool } = useGetToolFromMessages(param.tool_use_id, tools, messages);
|
|
17936
|
-
return /* @__PURE__ */ React57.createElement(
|
|
18076
|
+
return /* @__PURE__ */ React57.createElement(Box40, { flexDirection: "column", width }, tool.renderToolResultMessage?.(message.toolUseResult.data, {
|
|
17937
18077
|
verbose
|
|
17938
18078
|
}));
|
|
17939
18079
|
}
|
|
@@ -17979,11 +18119,11 @@ function UserToolResultMessage({
|
|
|
17979
18119
|
}
|
|
17980
18120
|
|
|
17981
18121
|
// src/ui/components/messages/AssistantToolUseMessage.tsx
|
|
17982
|
-
import { Box as
|
|
18122
|
+
import { Box as Box42, Text as Text48 } from "ink";
|
|
17983
18123
|
import React61 from "react";
|
|
17984
18124
|
|
|
17985
18125
|
// src/ui/components/ToolUseLoader.tsx
|
|
17986
|
-
import { Box as
|
|
18126
|
+
import { Box as Box41, Text as Text46 } from "ink";
|
|
17987
18127
|
import React59 from "react";
|
|
17988
18128
|
|
|
17989
18129
|
// src/ui/hooks/useInterval.ts
|
|
@@ -18019,12 +18159,12 @@ function ToolUseLoader({
|
|
|
18019
18159
|
setIsVisible((_) => !_);
|
|
18020
18160
|
}, 600);
|
|
18021
18161
|
const color = isUnresolved ? getTheme().secondaryText : isError ? getTheme().error : getTheme().success;
|
|
18022
|
-
return /* @__PURE__ */ React59.createElement(
|
|
18162
|
+
return /* @__PURE__ */ React59.createElement(Box41, { minWidth: 2 }, /* @__PURE__ */ React59.createElement(Text46, { color }, isVisible ? BLACK_CIRCLE : " "));
|
|
18023
18163
|
}
|
|
18024
18164
|
|
|
18025
18165
|
// src/ui/components/messages/TaskToolMessage.tsx
|
|
18026
18166
|
import React60, { useEffect as useEffect14, useState as useState18, useMemo as useMemo11 } from "react";
|
|
18027
|
-
import { Text as
|
|
18167
|
+
import { Text as Text47 } from "ink";
|
|
18028
18168
|
var agentConfigCache = /* @__PURE__ */ new Map();
|
|
18029
18169
|
function TaskToolMessage({ agentType, children, bold = true }) {
|
|
18030
18170
|
const theme = getTheme();
|
|
@@ -18054,7 +18194,7 @@ function TaskToolMessage({ agentType, children, bold = true }) {
|
|
|
18054
18194
|
const color = useMemo11(() => {
|
|
18055
18195
|
return agentConfig?.color || theme.text;
|
|
18056
18196
|
}, [agentConfig?.color, theme.text]);
|
|
18057
|
-
return /* @__PURE__ */ React60.createElement(
|
|
18197
|
+
return /* @__PURE__ */ React60.createElement(Text47, { color, bold }, children);
|
|
18058
18198
|
}
|
|
18059
18199
|
|
|
18060
18200
|
// src/utils/tooling/toolNameAliases.ts
|
|
@@ -18103,20 +18243,20 @@ function AssistantToolUseMessage({
|
|
|
18103
18243
|
return null;
|
|
18104
18244
|
}
|
|
18105
18245
|
return /* @__PURE__ */ React61.createElement(
|
|
18106
|
-
|
|
18246
|
+
Box42,
|
|
18107
18247
|
{
|
|
18108
18248
|
flexDirection: "row",
|
|
18109
18249
|
justifyContent: "space-between",
|
|
18110
18250
|
marginTop: addMargin ? 1 : 0,
|
|
18111
18251
|
width: "100%"
|
|
18112
18252
|
},
|
|
18113
|
-
/* @__PURE__ */ React61.createElement(
|
|
18114
|
-
|
|
18253
|
+
/* @__PURE__ */ React61.createElement(Box42, null, /* @__PURE__ */ React61.createElement(
|
|
18254
|
+
Box42,
|
|
18115
18255
|
{
|
|
18116
18256
|
flexWrap: "nowrap",
|
|
18117
18257
|
minWidth: userFacingToolName.length + (shouldShowDot ? 2 : 0)
|
|
18118
18258
|
},
|
|
18119
|
-
shouldShowDot && (isQueued ? /* @__PURE__ */ React61.createElement(
|
|
18259
|
+
shouldShowDot && (isQueued ? /* @__PURE__ */ React61.createElement(Box42, { minWidth: 2 }, /* @__PURE__ */ React61.createElement(Text48, { color }, BLACK_CIRCLE)) : /* @__PURE__ */ React61.createElement(
|
|
18120
18260
|
ToolUseLoader,
|
|
18121
18261
|
{
|
|
18122
18262
|
shouldAnimate,
|
|
@@ -18133,18 +18273,18 @@ function AssistantToolUseMessage({
|
|
|
18133
18273
|
bold: Boolean(!isQueued),
|
|
18134
18274
|
children: String(userFacingToolName || "")
|
|
18135
18275
|
}
|
|
18136
|
-
) : hasToolName && /* @__PURE__ */ React61.createElement(
|
|
18137
|
-
), /* @__PURE__ */ React61.createElement(
|
|
18276
|
+
) : hasToolName && /* @__PURE__ */ React61.createElement(Text48, { color, bold: !isQueued }, userFacingToolName)
|
|
18277
|
+
), /* @__PURE__ */ React61.createElement(Box42, { flexWrap: "nowrap" }, hasToolMessage && (() => {
|
|
18138
18278
|
if (React61.isValidElement(toolMessage)) {
|
|
18139
18279
|
if (!hasToolName) return toolMessage;
|
|
18140
|
-
return /* @__PURE__ */ React61.createElement(
|
|
18280
|
+
return /* @__PURE__ */ React61.createElement(Box42, { flexDirection: "row" }, /* @__PURE__ */ React61.createElement(Text48, { color }, "("), toolMessage, /* @__PURE__ */ React61.createElement(Text48, { color }, ")"));
|
|
18141
18281
|
}
|
|
18142
18282
|
if (typeof toolMessage !== "string") return null;
|
|
18143
18283
|
if (!hasToolName) {
|
|
18144
|
-
return /* @__PURE__ */ React61.createElement(
|
|
18284
|
+
return /* @__PURE__ */ React61.createElement(Text48, { color }, toolMessage);
|
|
18145
18285
|
}
|
|
18146
|
-
return /* @__PURE__ */ React61.createElement(
|
|
18147
|
-
})(), /* @__PURE__ */ React61.createElement(
|
|
18286
|
+
return /* @__PURE__ */ React61.createElement(Text48, { color }, "(", toolMessage, ")");
|
|
18287
|
+
})(), /* @__PURE__ */ React61.createElement(Text48, { color }, "\u2026"))),
|
|
18148
18288
|
/* @__PURE__ */ React61.createElement(Cost, { costUSD, durationMs, debug: debug2 })
|
|
18149
18289
|
);
|
|
18150
18290
|
}
|
|
@@ -18173,7 +18313,7 @@ function AssistantBashOutputMessage({
|
|
|
18173
18313
|
|
|
18174
18314
|
// src/ui/components/messages/AssistantLocalCommandOutputMessage.tsx
|
|
18175
18315
|
import * as React63 from "react";
|
|
18176
|
-
import { Box as
|
|
18316
|
+
import { Box as Box43, Text as Text49 } from "ink";
|
|
18177
18317
|
function AssistantLocalCommandOutputMessage({
|
|
18178
18318
|
content
|
|
18179
18319
|
}) {
|
|
@@ -18189,22 +18329,22 @@ function AssistantLocalCommandOutputMessage({
|
|
|
18189
18329
|
].filter(Boolean);
|
|
18190
18330
|
if (insides.length === 0) {
|
|
18191
18331
|
insides = [
|
|
18192
|
-
/* @__PURE__ */ React63.createElement(React63.Fragment, { key: "0" }, /* @__PURE__ */ React63.createElement(
|
|
18332
|
+
/* @__PURE__ */ React63.createElement(React63.Fragment, { key: "0" }, /* @__PURE__ */ React63.createElement(Text49, null, "(No output)"))
|
|
18193
18333
|
];
|
|
18194
18334
|
}
|
|
18195
18335
|
return [
|
|
18196
|
-
/* @__PURE__ */ React63.createElement(
|
|
18336
|
+
/* @__PURE__ */ React63.createElement(Box43, { key: "0", gap: 1 }, /* @__PURE__ */ React63.createElement(Box43, null, /* @__PURE__ */ React63.createElement(Text49, { color: theme.secondaryText }, " ", "\u23BF ")), insides.map((_, index) => /* @__PURE__ */ React63.createElement(Box43, { key: index, flexDirection: "column" }, _)))
|
|
18197
18337
|
];
|
|
18198
18338
|
}
|
|
18199
18339
|
function format(content, color) {
|
|
18200
18340
|
if (!content) {
|
|
18201
18341
|
return null;
|
|
18202
18342
|
}
|
|
18203
|
-
return /* @__PURE__ */ React63.createElement(
|
|
18343
|
+
return /* @__PURE__ */ React63.createElement(Text49, { color }, content);
|
|
18204
18344
|
}
|
|
18205
18345
|
|
|
18206
18346
|
// src/ui/components/messages/AssistantTextMessage.tsx
|
|
18207
|
-
import { Box as
|
|
18347
|
+
import { Box as Box44, Text as Text50 } from "ink";
|
|
18208
18348
|
|
|
18209
18349
|
// src/utils/text/markdown.ts
|
|
18210
18350
|
import { marked } from "marked";
|
|
@@ -18404,7 +18544,7 @@ function AssistantTextMessage({
|
|
|
18404
18544
|
if (text.startsWith("<tool-progress>")) {
|
|
18405
18545
|
const raw = extractTag(text, "tool-progress") ?? "";
|
|
18406
18546
|
if (raw.trim().length === 0) return null;
|
|
18407
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18547
|
+
return /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().secondaryText }, raw);
|
|
18408
18548
|
}
|
|
18409
18549
|
if (text.startsWith("<bash-notification>")) {
|
|
18410
18550
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18412,7 +18552,7 @@ function AssistantTextMessage({
|
|
|
18412
18552
|
if (!summary) return null;
|
|
18413
18553
|
const theme = getTheme();
|
|
18414
18554
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18415
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18555
|
+
return /* @__PURE__ */ React64.createElement(Box44, null, /* @__PURE__ */ React64.createElement(Text50, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React64.createElement(Text50, null, summary));
|
|
18416
18556
|
}
|
|
18417
18557
|
if (text.startsWith("<agent-notification>")) {
|
|
18418
18558
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18420,7 +18560,7 @@ function AssistantTextMessage({
|
|
|
18420
18560
|
if (!summary) return null;
|
|
18421
18561
|
const theme = getTheme();
|
|
18422
18562
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18423
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18563
|
+
return /* @__PURE__ */ React64.createElement(Box44, null, /* @__PURE__ */ React64.createElement(Text50, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React64.createElement(Text50, null, summary));
|
|
18424
18564
|
}
|
|
18425
18565
|
if (text.startsWith("<task-notification>")) {
|
|
18426
18566
|
const status = (extractTag(text, "status") ?? "").trim();
|
|
@@ -18428,7 +18568,7 @@ function AssistantTextMessage({
|
|
|
18428
18568
|
if (!summary) return null;
|
|
18429
18569
|
const theme = getTheme();
|
|
18430
18570
|
const color = status === "completed" ? theme.success : status === "failed" ? theme.error : status === "killed" ? theme.warning : theme.secondaryText;
|
|
18431
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18571
|
+
return /* @__PURE__ */ React64.createElement(Box44, null, /* @__PURE__ */ React64.createElement(Text50, { color }, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React64.createElement(Text50, null, summary));
|
|
18432
18572
|
}
|
|
18433
18573
|
if (text.startsWith("<bash-stdout") || text.startsWith("<bash-stderr")) {
|
|
18434
18574
|
return /* @__PURE__ */ React64.createElement(AssistantBashOutputMessage, { content: text, verbose });
|
|
@@ -18437,7 +18577,7 @@ function AssistantTextMessage({
|
|
|
18437
18577
|
return /* @__PURE__ */ React64.createElement(AssistantLocalCommandOutputMessage, { content: text });
|
|
18438
18578
|
}
|
|
18439
18579
|
if (text.startsWith(API_ERROR_MESSAGE_PREFIX)) {
|
|
18440
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18580
|
+
return /* @__PURE__ */ React64.createElement(Text50, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().error }, text === API_ERROR_MESSAGE_PREFIX ? `${API_ERROR_MESSAGE_PREFIX}: Please wait a moment and try again.` : text));
|
|
18441
18581
|
}
|
|
18442
18582
|
switch (text) {
|
|
18443
18583
|
case NO_RESPONSE_REQUESTED:
|
|
@@ -18445,16 +18585,16 @@ function AssistantTextMessage({
|
|
|
18445
18585
|
return null;
|
|
18446
18586
|
case INTERRUPT_MESSAGE:
|
|
18447
18587
|
case CANCEL_MESSAGE:
|
|
18448
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18588
|
+
return /* @__PURE__ */ React64.createElement(Text50, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().error }, "Interrupted by user"));
|
|
18449
18589
|
case PROMPT_TOO_LONG_ERROR_MESSAGE:
|
|
18450
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18590
|
+
return /* @__PURE__ */ React64.createElement(Text50, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().error }, "Context low \xB7 Run /compact to compact & continue"));
|
|
18451
18591
|
case CREDIT_BALANCE_TOO_LOW_ERROR_MESSAGE:
|
|
18452
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18592
|
+
return /* @__PURE__ */ React64.createElement(Text50, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().error }, "Credit balance too low \xB7 Add funds in your provider billing settings"));
|
|
18453
18593
|
case INVALID_API_KEY_ERROR_MESSAGE:
|
|
18454
|
-
return /* @__PURE__ */ React64.createElement(
|
|
18594
|
+
return /* @__PURE__ */ React64.createElement(Text50, null, "\xA0\xA0\u23BF \xA0", /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().error }, INVALID_API_KEY_ERROR_MESSAGE));
|
|
18455
18595
|
default:
|
|
18456
18596
|
return /* @__PURE__ */ React64.createElement(
|
|
18457
|
-
|
|
18597
|
+
Box44,
|
|
18458
18598
|
{
|
|
18459
18599
|
alignItems: "flex-start",
|
|
18460
18600
|
flexDirection: "row",
|
|
@@ -18462,14 +18602,14 @@ function AssistantTextMessage({
|
|
|
18462
18602
|
marginTop: addMargin ? 1 : 0,
|
|
18463
18603
|
width: "100%"
|
|
18464
18604
|
},
|
|
18465
|
-
/* @__PURE__ */ React64.createElement(
|
|
18605
|
+
/* @__PURE__ */ React64.createElement(Box44, { flexDirection: "row" }, shouldShowDot && /* @__PURE__ */ React64.createElement(Box44, { minWidth: 2 }, /* @__PURE__ */ React64.createElement(Text50, { color: getTheme().text }, BLACK_CIRCLE)), /* @__PURE__ */ React64.createElement(Box44, { flexDirection: "column", width: columns - 6 }, /* @__PURE__ */ React64.createElement(Text50, null, applyMarkdown(text)))),
|
|
18466
18606
|
/* @__PURE__ */ React64.createElement(Cost, { costUSD, durationMs, debug: debug2 })
|
|
18467
18607
|
);
|
|
18468
18608
|
}
|
|
18469
18609
|
}
|
|
18470
18610
|
|
|
18471
18611
|
// src/ui/components/messages/UserBashInputMessage.tsx
|
|
18472
|
-
import { Box as
|
|
18612
|
+
import { Box as Box45, Text as Text51 } from "ink";
|
|
18473
18613
|
import * as React65 from "react";
|
|
18474
18614
|
function UserBashInputMessage({
|
|
18475
18615
|
param: { text },
|
|
@@ -18479,11 +18619,11 @@ function UserBashInputMessage({
|
|
|
18479
18619
|
if (!input) {
|
|
18480
18620
|
return null;
|
|
18481
18621
|
}
|
|
18482
|
-
return /* @__PURE__ */ React65.createElement(
|
|
18622
|
+
return /* @__PURE__ */ React65.createElement(Box45, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React65.createElement(Box45, null, /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().bashBorder }, "!"), /* @__PURE__ */ React65.createElement(Text51, { color: getTheme().secondaryText }, " ", input)));
|
|
18483
18623
|
}
|
|
18484
18624
|
|
|
18485
18625
|
// src/ui/components/messages/UserPybInputMessage.tsx
|
|
18486
|
-
import { Box as
|
|
18626
|
+
import { Box as Box46, Text as Text52 } from "ink";
|
|
18487
18627
|
import * as React66 from "react";
|
|
18488
18628
|
function UserPybInputMessage({
|
|
18489
18629
|
param: { text },
|
|
@@ -18493,11 +18633,11 @@ function UserPybInputMessage({
|
|
|
18493
18633
|
if (!input) {
|
|
18494
18634
|
return null;
|
|
18495
18635
|
}
|
|
18496
|
-
return /* @__PURE__ */ React66.createElement(
|
|
18636
|
+
return /* @__PURE__ */ React66.createElement(Box46, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React66.createElement(Box46, null, /* @__PURE__ */ React66.createElement(Text52, { color: getTheme().noting }, "#"), /* @__PURE__ */ React66.createElement(Text52, { color: getTheme().secondaryText }, " ", input)));
|
|
18497
18637
|
}
|
|
18498
18638
|
|
|
18499
18639
|
// src/ui/components/messages/UserCommandMessage.tsx
|
|
18500
|
-
import { Box as
|
|
18640
|
+
import { Box as Box47, Text as Text53 } from "ink";
|
|
18501
18641
|
import * as React67 from "react";
|
|
18502
18642
|
function UserCommandMessage({
|
|
18503
18643
|
addMargin,
|
|
@@ -18509,12 +18649,12 @@ function UserCommandMessage({
|
|
|
18509
18649
|
return null;
|
|
18510
18650
|
}
|
|
18511
18651
|
const theme = getTheme();
|
|
18512
|
-
return /* @__PURE__ */ React67.createElement(
|
|
18652
|
+
return /* @__PURE__ */ React67.createElement(Box47, { flexDirection: "column", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React67.createElement(Text53, { color: theme.secondaryText }, "> /", commandName, " ", args));
|
|
18513
18653
|
}
|
|
18514
18654
|
|
|
18515
18655
|
// src/ui/components/messages/UserPromptMessage.tsx
|
|
18516
18656
|
import React68 from "react";
|
|
18517
|
-
import { Box as
|
|
18657
|
+
import { Box as Box48, Text as Text54 } from "ink";
|
|
18518
18658
|
function UserPromptMessage({
|
|
18519
18659
|
addMargin,
|
|
18520
18660
|
param: { text }
|
|
@@ -18524,7 +18664,7 @@ function UserPromptMessage({
|
|
|
18524
18664
|
logError("No content found in user prompt message");
|
|
18525
18665
|
return null;
|
|
18526
18666
|
}
|
|
18527
|
-
return /* @__PURE__ */ React68.createElement(
|
|
18667
|
+
return /* @__PURE__ */ React68.createElement(Box48, { flexDirection: "row", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React68.createElement(Box48, { minWidth: 2, width: 2 }, /* @__PURE__ */ React68.createElement(Text54, { color: getTheme().secondaryText }, ">")), /* @__PURE__ */ React68.createElement(Box48, { flexDirection: "column", width: columns - 4 }, /* @__PURE__ */ React68.createElement(Text54, { color: getTheme().secondaryText, wrap: "wrap" }, text)));
|
|
18528
18668
|
}
|
|
18529
18669
|
|
|
18530
18670
|
// src/ui/components/messages/UserTextMessage.tsx
|
|
@@ -18547,7 +18687,7 @@ function UserTextMessage({ addMargin, param }) {
|
|
|
18547
18687
|
|
|
18548
18688
|
// src/ui/components/messages/UserImageMessage.tsx
|
|
18549
18689
|
import React70 from "react";
|
|
18550
|
-
import { Box as
|
|
18690
|
+
import { Box as Box49, Text as Text55 } from "ink";
|
|
18551
18691
|
function formatBytes2(bytes) {
|
|
18552
18692
|
if (!Number.isFinite(bytes) || bytes <= 0) return "";
|
|
18553
18693
|
const units = ["B", "KB", "MB", "GB"];
|
|
@@ -18566,12 +18706,12 @@ function UserImageMessage({ addMargin, param }) {
|
|
|
18566
18706
|
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;
|
|
18567
18707
|
const sizeLabel = formatBytes2(approxBytes);
|
|
18568
18708
|
const details = [mediaType, sizeLabel].filter(Boolean).join(" \xB7 ");
|
|
18569
|
-
return /* @__PURE__ */ React70.createElement(
|
|
18709
|
+
return /* @__PURE__ */ React70.createElement(Box49, { flexDirection: "row", marginTop: addMargin ? 1 : 0, width: "100%" }, /* @__PURE__ */ React70.createElement(Box49, { minWidth: 2, width: 2 }, /* @__PURE__ */ React70.createElement(Text55, { color: theme.secondaryText }, ">")), /* @__PURE__ */ React70.createElement(Text55, { color: theme.secondaryText }, "[Image]", details ? ` ${details}` : ""));
|
|
18570
18710
|
}
|
|
18571
18711
|
|
|
18572
18712
|
// src/ui/components/messages/AssistantThinkingMessage.tsx
|
|
18573
18713
|
import React71 from "react";
|
|
18574
|
-
import { Box as
|
|
18714
|
+
import { Box as Box50, Text as Text56 } from "ink";
|
|
18575
18715
|
function AssistantThinkingMessage({
|
|
18576
18716
|
param: { thinking },
|
|
18577
18717
|
addMargin = false
|
|
@@ -18580,25 +18720,25 @@ function AssistantThinkingMessage({
|
|
|
18580
18720
|
return null;
|
|
18581
18721
|
}
|
|
18582
18722
|
return /* @__PURE__ */ React71.createElement(
|
|
18583
|
-
|
|
18723
|
+
Box50,
|
|
18584
18724
|
{
|
|
18585
18725
|
flexDirection: "column",
|
|
18586
18726
|
gap: 1,
|
|
18587
18727
|
marginTop: addMargin ? 1 : 0,
|
|
18588
18728
|
width: "100%"
|
|
18589
18729
|
},
|
|
18590
|
-
/* @__PURE__ */ React71.createElement(
|
|
18591
|
-
/* @__PURE__ */ React71.createElement(
|
|
18730
|
+
/* @__PURE__ */ React71.createElement(Text56, { color: getTheme().secondaryText, italic: true }, "\u273B Thinking\u2026"),
|
|
18731
|
+
/* @__PURE__ */ React71.createElement(Box50, { paddingLeft: 2 }, /* @__PURE__ */ React71.createElement(Text56, { color: getTheme().secondaryText, italic: true }, applyMarkdown(thinking)))
|
|
18592
18732
|
);
|
|
18593
18733
|
}
|
|
18594
18734
|
|
|
18595
18735
|
// src/ui/components/messages/AssistantRedactedThinkingMessage.tsx
|
|
18596
18736
|
import React72 from "react";
|
|
18597
|
-
import { Box as
|
|
18737
|
+
import { Box as Box51, Text as Text57 } from "ink";
|
|
18598
18738
|
function AssistantRedactedThinkingMessage({
|
|
18599
18739
|
addMargin = false
|
|
18600
18740
|
}) {
|
|
18601
|
-
return /* @__PURE__ */ React72.createElement(
|
|
18741
|
+
return /* @__PURE__ */ React72.createElement(Box51, { marginTop: addMargin ? 1 : 0 }, /* @__PURE__ */ React72.createElement(Text57, { color: getTheme().secondaryText, italic: true }, "\u273B Thinking\u2026"));
|
|
18602
18742
|
}
|
|
18603
18743
|
|
|
18604
18744
|
// src/ui/components/Message.tsx
|
|
@@ -18617,7 +18757,7 @@ function Message({
|
|
|
18617
18757
|
width
|
|
18618
18758
|
}) {
|
|
18619
18759
|
if (message.type === "assistant") {
|
|
18620
|
-
return /* @__PURE__ */ React73.createElement(
|
|
18760
|
+
return /* @__PURE__ */ React73.createElement(Box52, { flexDirection: "column", width: "100%" }, message.message.content.map((_, index) => /* @__PURE__ */ React73.createElement(
|
|
18621
18761
|
AssistantMessage,
|
|
18622
18762
|
{
|
|
18623
18763
|
key: index,
|
|
@@ -18638,7 +18778,7 @@ function Message({
|
|
|
18638
18778
|
)));
|
|
18639
18779
|
}
|
|
18640
18780
|
const content = typeof message.message.content === "string" ? [{ type: "text", text: message.message.content }] : message.message.content;
|
|
18641
|
-
return /* @__PURE__ */ React73.createElement(
|
|
18781
|
+
return /* @__PURE__ */ React73.createElement(Box52, { flexDirection: "column", width: "100%" }, content.map((_, index) => /* @__PURE__ */ React73.createElement(
|
|
18642
18782
|
UserMessage,
|
|
18643
18783
|
{
|
|
18644
18784
|
key: index,
|
|
@@ -18740,14 +18880,14 @@ function AssistantMessage({
|
|
|
18740
18880
|
}
|
|
18741
18881
|
|
|
18742
18882
|
// src/ui/components/MessageResponse.tsx
|
|
18743
|
-
import { Box as
|
|
18883
|
+
import { Box as Box53, Text as Text58 } from "ink";
|
|
18744
18884
|
import * as React74 from "react";
|
|
18745
18885
|
function MessageResponse({ children }) {
|
|
18746
|
-
return /* @__PURE__ */ React74.createElement(
|
|
18886
|
+
return /* @__PURE__ */ React74.createElement(Box53, { flexDirection: "row" }, /* @__PURE__ */ React74.createElement(Text58, null, " ", "\u23BF \xA0"), /* @__PURE__ */ React74.createElement(Box53, { flexDirection: "column", flexGrow: 1 }, children));
|
|
18747
18887
|
}
|
|
18748
18888
|
|
|
18749
18889
|
// src/ui/components/MessageSelector.tsx
|
|
18750
|
-
import { Box as
|
|
18890
|
+
import { Box as Box54, Text as Text59, useInput as useInput19 } from "ink";
|
|
18751
18891
|
import * as React75 from "react";
|
|
18752
18892
|
import { useMemo as useMemo12, useState as useState19, useEffect as useEffect15 } from "react";
|
|
18753
18893
|
import figures7 from "figures";
|
|
@@ -18825,7 +18965,7 @@ function MessageSelector({
|
|
|
18825
18965
|
[messages]
|
|
18826
18966
|
);
|
|
18827
18967
|
return /* @__PURE__ */ React75.createElement(React75.Fragment, null, /* @__PURE__ */ React75.createElement(
|
|
18828
|
-
|
|
18968
|
+
Box54,
|
|
18829
18969
|
{
|
|
18830
18970
|
flexDirection: "column",
|
|
18831
18971
|
borderStyle: "round",
|
|
@@ -18834,12 +18974,12 @@ function MessageSelector({
|
|
|
18834
18974
|
paddingX: 1,
|
|
18835
18975
|
marginTop: 1
|
|
18836
18976
|
},
|
|
18837
|
-
/* @__PURE__ */ React75.createElement(
|
|
18977
|
+
/* @__PURE__ */ React75.createElement(Box54, { flexDirection: "column", minHeight: 2, marginBottom: 1 }, /* @__PURE__ */ React75.createElement(Text59, { bold: true }, "Jump to a previous message"), /* @__PURE__ */ React75.createElement(Text59, { dimColor: true }, "This will fork the conversation")),
|
|
18838
18978
|
allItems.slice(firstVisibleIndex, firstVisibleIndex + MAX_VISIBLE_MESSAGES).map((msg, index) => {
|
|
18839
18979
|
const actualIndex = firstVisibleIndex + index;
|
|
18840
18980
|
const isSelected = actualIndex === selectedIndex;
|
|
18841
18981
|
const isCurrent = msg.uuid === currentUUID;
|
|
18842
|
-
return /* @__PURE__ */ React75.createElement(
|
|
18982
|
+
return /* @__PURE__ */ React75.createElement(Box54, { key: msg.uuid, flexDirection: "row", height: 2, minHeight: 2 }, /* @__PURE__ */ React75.createElement(Box54, { width: 7 }, isSelected ? /* @__PURE__ */ React75.createElement(Text59, { color: "blue", bold: true }, figures7.pointer, " ", firstVisibleIndex + index + 1, " ") : /* @__PURE__ */ React75.createElement(Text59, null, " ", firstVisibleIndex + index + 1, " ")), /* @__PURE__ */ React75.createElement(Box54, { height: 1, overflow: "hidden", width: 100 }, isCurrent ? /* @__PURE__ */ React75.createElement(Box54, { width: "100%" }, /* @__PURE__ */ React75.createElement(Text59, { dimColor: true, italic: true }, "(current)")) : Array.isArray(msg.message.content) && msg.message.content[0]?.type === "text" && isEmptyMessageText(msg.message.content[0].text) ? /* @__PURE__ */ React75.createElement(Text59, { dimColor: true, italic: true }, "(empty message)") : /* @__PURE__ */ React75.createElement(
|
|
18843
18983
|
Message,
|
|
18844
18984
|
{
|
|
18845
18985
|
message: msg,
|
|
@@ -18856,7 +18996,7 @@ function MessageSelector({
|
|
|
18856
18996
|
}
|
|
18857
18997
|
)));
|
|
18858
18998
|
})
|
|
18859
|
-
), /* @__PURE__ */ React75.createElement(
|
|
18999
|
+
), /* @__PURE__ */ React75.createElement(Box54, { marginLeft: 3 }, /* @__PURE__ */ React75.createElement(Text59, { dimColor: true }, exitState.pending ? /* @__PURE__ */ React75.createElement(React75.Fragment, null, "Press ", exitState.keyName, " again to exit") : /* @__PURE__ */ React75.createElement(React75.Fragment, null, "\u2191/\u2193 to select \xB7 Enter to confirm \xB7 Tab/Esc to cancel"))));
|
|
18860
19000
|
}
|
|
18861
19001
|
|
|
18862
19002
|
// src/ui/components/permissions/PermissionRequest.tsx
|
|
@@ -18865,7 +19005,7 @@ import * as React93 from "react";
|
|
|
18865
19005
|
|
|
18866
19006
|
// src/ui/components/permissions/file-edit-permission-request/FileEditPermissionRequest.tsx
|
|
18867
19007
|
import chalk7 from "chalk";
|
|
18868
|
-
import { Box as
|
|
19008
|
+
import { Box as Box57, Text as Text62, useInput as useInput20 } from "ink";
|
|
18869
19009
|
import { basename, dirname as dirname5, extname as extname6 } from "path";
|
|
18870
19010
|
import React78, { useCallback as useCallback8, useMemo as useMemo14 } from "react";
|
|
18871
19011
|
|
|
@@ -18896,7 +19036,7 @@ function usePermissionRequestLogging(toolUseConfirm, unaryEvent) {
|
|
|
18896
19036
|
|
|
18897
19037
|
// src/ui/components/permissions/PermissionRequestTitle.tsx
|
|
18898
19038
|
import * as React76 from "react";
|
|
18899
|
-
import { Box as
|
|
19039
|
+
import { Box as Box55, Text as Text60 } from "ink";
|
|
18900
19040
|
function categoryForRiskScore(riskScore) {
|
|
18901
19041
|
return riskScore >= 70 ? "high" : riskScore >= 30 ? "moderate" : "low";
|
|
18902
19042
|
}
|
|
@@ -18931,20 +19071,20 @@ function PermissionRiskScore({
|
|
|
18931
19071
|
riskScore
|
|
18932
19072
|
}) {
|
|
18933
19073
|
const category = categoryForRiskScore(riskScore);
|
|
18934
|
-
return /* @__PURE__ */ React76.createElement(
|
|
19074
|
+
return /* @__PURE__ */ React76.createElement(Text60, { color: textColorForRiskScore(riskScore) }, "Risk: ", category);
|
|
18935
19075
|
}
|
|
18936
19076
|
function PermissionRequestTitle({
|
|
18937
19077
|
title,
|
|
18938
19078
|
riskScore
|
|
18939
19079
|
}) {
|
|
18940
|
-
return /* @__PURE__ */ React76.createElement(
|
|
19080
|
+
return /* @__PURE__ */ React76.createElement(Box55, { flexDirection: "column" }, /* @__PURE__ */ React76.createElement(Text60, { bold: true, color: getTheme().permission }, title), riskScore !== null && /* @__PURE__ */ React76.createElement(PermissionRiskScore, { riskScore }));
|
|
18941
19081
|
}
|
|
18942
19082
|
|
|
18943
19083
|
// src/ui/components/permissions/file-edit-permission-request/FileEditToolDiff.tsx
|
|
18944
19084
|
import * as React77 from "react";
|
|
18945
19085
|
import { existsSync as existsSync9, readFileSync as readFileSync6 } from "fs";
|
|
18946
19086
|
import { useMemo as useMemo13 } from "react";
|
|
18947
|
-
import { Box as
|
|
19087
|
+
import { Box as Box56, Text as Text61 } from "ink";
|
|
18948
19088
|
import { relative as relative10 } from "path";
|
|
18949
19089
|
function FileEditToolDiff({
|
|
18950
19090
|
file_path,
|
|
@@ -18967,15 +19107,15 @@ function FileEditToolDiff({
|
|
|
18967
19107
|
}),
|
|
18968
19108
|
[file_path, file, old_string, new_string]
|
|
18969
19109
|
);
|
|
18970
|
-
return /* @__PURE__ */ React77.createElement(
|
|
18971
|
-
|
|
19110
|
+
return /* @__PURE__ */ React77.createElement(Box56, { flexDirection: "column" }, /* @__PURE__ */ React77.createElement(
|
|
19111
|
+
Box56,
|
|
18972
19112
|
{
|
|
18973
19113
|
borderColor: getTheme().secondaryBorder,
|
|
18974
19114
|
borderStyle: useBorder ? "round" : void 0,
|
|
18975
19115
|
flexDirection: "column",
|
|
18976
19116
|
paddingX: 1
|
|
18977
19117
|
},
|
|
18978
|
-
/* @__PURE__ */ React77.createElement(
|
|
19118
|
+
/* @__PURE__ */ React77.createElement(Box56, { paddingBottom: 1 }, /* @__PURE__ */ React77.createElement(Text61, { bold: true }, verbose ? file_path : relative10(getCwd(), file_path))),
|
|
18979
19119
|
intersperse(
|
|
18980
19120
|
patch.map((_) => /* @__PURE__ */ React77.createElement(
|
|
18981
19121
|
StructuredDiff,
|
|
@@ -18986,7 +19126,7 @@ function FileEditToolDiff({
|
|
|
18986
19126
|
width
|
|
18987
19127
|
}
|
|
18988
19128
|
)),
|
|
18989
|
-
(i) => /* @__PURE__ */ React77.createElement(React77.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React77.createElement(
|
|
19129
|
+
(i) => /* @__PURE__ */ React77.createElement(React77.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React77.createElement(Text61, { color: getTheme().secondaryText }, "..."))
|
|
18990
19130
|
)
|
|
18991
19131
|
));
|
|
18992
19132
|
}
|
|
@@ -19169,7 +19309,7 @@ function FileEditPermissionRequest({
|
|
|
19169
19309
|
return true;
|
|
19170
19310
|
});
|
|
19171
19311
|
return /* @__PURE__ */ React78.createElement(
|
|
19172
|
-
|
|
19312
|
+
Box57,
|
|
19173
19313
|
{
|
|
19174
19314
|
flexDirection: "column",
|
|
19175
19315
|
borderStyle: "round",
|
|
@@ -19196,7 +19336,7 @@ function FileEditPermissionRequest({
|
|
|
19196
19336
|
width: columns - 12
|
|
19197
19337
|
}
|
|
19198
19338
|
),
|
|
19199
|
-
/* @__PURE__ */ React78.createElement(
|
|
19339
|
+
/* @__PURE__ */ React78.createElement(Box57, { flexDirection: "column" }, /* @__PURE__ */ React78.createElement(Text62, null, "Do you want to make this edit to", " ", /* @__PURE__ */ React78.createElement(Text62, { bold: true }, basename(file_path)), "?"), /* @__PURE__ */ React78.createElement(
|
|
19200
19340
|
Select,
|
|
19201
19341
|
{
|
|
19202
19342
|
options: getOptions({
|
|
@@ -19220,7 +19360,7 @@ async function extractLanguageName(file_path) {
|
|
|
19220
19360
|
}
|
|
19221
19361
|
|
|
19222
19362
|
// src/ui/components/permissions/bash-permission-request/BashPermissionRequest.tsx
|
|
19223
|
-
import { Box as
|
|
19363
|
+
import { Box as Box58, Text as Text63 } from "ink";
|
|
19224
19364
|
import React79, { useMemo as useMemo15 } from "react";
|
|
19225
19365
|
|
|
19226
19366
|
// src/ui/components/permissions/hooks.ts
|
|
@@ -19327,7 +19467,7 @@ function BashPermissionRequest({
|
|
|
19327
19467
|
);
|
|
19328
19468
|
usePermissionRequestLogging2(toolUseConfirm, unaryEvent);
|
|
19329
19469
|
return /* @__PURE__ */ React79.createElement(
|
|
19330
|
-
|
|
19470
|
+
Box58,
|
|
19331
19471
|
{
|
|
19332
19472
|
flexDirection: "column",
|
|
19333
19473
|
borderStyle: "round",
|
|
@@ -19344,12 +19484,12 @@ function BashPermissionRequest({
|
|
|
19344
19484
|
riskScore: toolUseConfirm.riskScore
|
|
19345
19485
|
}
|
|
19346
19486
|
),
|
|
19347
|
-
/* @__PURE__ */ React79.createElement(
|
|
19487
|
+
/* @__PURE__ */ React79.createElement(Box58, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React79.createElement(Text63, null, BashTool.renderToolUseMessage({
|
|
19348
19488
|
command: command4,
|
|
19349
19489
|
run_in_background,
|
|
19350
19490
|
description: description3
|
|
19351
|
-
})), /* @__PURE__ */ React79.createElement(
|
|
19352
|
-
/* @__PURE__ */ React79.createElement(
|
|
19491
|
+
})), /* @__PURE__ */ React79.createElement(Text63, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
19492
|
+
/* @__PURE__ */ React79.createElement(Box58, { flexDirection: "column" }, /* @__PURE__ */ React79.createElement(Text63, null, "Do you want to proceed?"), /* @__PURE__ */ React79.createElement(
|
|
19353
19493
|
Select,
|
|
19354
19494
|
{
|
|
19355
19495
|
options: toolUseOptions({ toolUseConfirm, command: command4 }),
|
|
@@ -19417,7 +19557,7 @@ function BashPermissionRequest({
|
|
|
19417
19557
|
}
|
|
19418
19558
|
|
|
19419
19559
|
// src/ui/components/permissions/FallbackPermissionRequest.tsx
|
|
19420
|
-
import { Box as
|
|
19560
|
+
import { Box as Box59, Text as Text64 } from "ink";
|
|
19421
19561
|
import React80, { useMemo as useMemo16 } from "react";
|
|
19422
19562
|
import chalk9 from "chalk";
|
|
19423
19563
|
function __getFallbackPermissionInputForTests(tool, input) {
|
|
@@ -19440,7 +19580,7 @@ function FallbackPermissionRequest({
|
|
|
19440
19580
|
);
|
|
19441
19581
|
usePermissionRequestLogging(toolUseConfirm, unaryEvent);
|
|
19442
19582
|
return /* @__PURE__ */ React80.createElement(
|
|
19443
|
-
|
|
19583
|
+
Box59,
|
|
19444
19584
|
{
|
|
19445
19585
|
flexDirection: "column",
|
|
19446
19586
|
borderStyle: "round",
|
|
@@ -19457,11 +19597,11 @@ function FallbackPermissionRequest({
|
|
|
19457
19597
|
riskScore: toolUseConfirm.riskScore
|
|
19458
19598
|
}
|
|
19459
19599
|
),
|
|
19460
|
-
/* @__PURE__ */ React80.createElement(
|
|
19600
|
+
/* @__PURE__ */ React80.createElement(Box59, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React80.createElement(Text64, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
19461
19601
|
toolUseConfirm.input,
|
|
19462
19602
|
{ verbose }
|
|
19463
|
-
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */ React80.createElement(
|
|
19464
|
-
/* @__PURE__ */ React80.createElement(
|
|
19603
|
+
), ")", originalUserFacingName.endsWith(" (MCP)") ? /* @__PURE__ */ React80.createElement(Text64, { color: theme.secondaryText }, " (MCP)") : ""), /* @__PURE__ */ React80.createElement(Text64, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
19604
|
+
/* @__PURE__ */ React80.createElement(Box59, { flexDirection: "column" }, /* @__PURE__ */ React80.createElement(Text64, null, "Do you want to proceed?"), /* @__PURE__ */ React80.createElement(
|
|
19465
19605
|
Select,
|
|
19466
19606
|
{
|
|
19467
19607
|
options: [
|
|
@@ -19577,7 +19717,7 @@ function useNotifyAfterTimeout(message, timeout = DEFAULT_INTERACTION_THRESHOLD_
|
|
|
19577
19717
|
}
|
|
19578
19718
|
|
|
19579
19719
|
// src/ui/components/permissions/file-write-permission-request/FileWritePermissionRequest.tsx
|
|
19580
|
-
import { Box as
|
|
19720
|
+
import { Box as Box61, Text as Text66, useInput as useInput21 } from "ink";
|
|
19581
19721
|
import React82, { useCallback as useCallback9, useMemo as useMemo18 } from "react";
|
|
19582
19722
|
import { basename as basename2, dirname as dirname6, extname as extname8 } from "path";
|
|
19583
19723
|
import { existsSync as existsSync11 } from "fs";
|
|
@@ -19587,7 +19727,7 @@ import chalk10 from "chalk";
|
|
|
19587
19727
|
import * as React81 from "react";
|
|
19588
19728
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
19589
19729
|
import { useMemo as useMemo17 } from "react";
|
|
19590
|
-
import { Box as
|
|
19730
|
+
import { Box as Box60, Text as Text65 } from "ink";
|
|
19591
19731
|
import { extname as extname7, relative as relative11 } from "path";
|
|
19592
19732
|
function FileWriteToolDiff({
|
|
19593
19733
|
file_path,
|
|
@@ -19615,14 +19755,14 @@ function FileWriteToolDiff({
|
|
|
19615
19755
|
});
|
|
19616
19756
|
}, [fileExists, file_path, oldContent, content]);
|
|
19617
19757
|
return /* @__PURE__ */ React81.createElement(
|
|
19618
|
-
|
|
19758
|
+
Box60,
|
|
19619
19759
|
{
|
|
19620
19760
|
borderColor: getTheme().secondaryBorder,
|
|
19621
19761
|
borderStyle: "round",
|
|
19622
19762
|
flexDirection: "column",
|
|
19623
19763
|
paddingX: 1
|
|
19624
19764
|
},
|
|
19625
|
-
/* @__PURE__ */ React81.createElement(
|
|
19765
|
+
/* @__PURE__ */ React81.createElement(Box60, { paddingBottom: 1 }, /* @__PURE__ */ React81.createElement(Text65, { bold: true }, verbose ? file_path : relative11(getCwd(), file_path))),
|
|
19626
19766
|
hunks ? intersperse(
|
|
19627
19767
|
hunks.map((_) => /* @__PURE__ */ React81.createElement(
|
|
19628
19768
|
StructuredDiff,
|
|
@@ -19633,7 +19773,7 @@ function FileWriteToolDiff({
|
|
|
19633
19773
|
width
|
|
19634
19774
|
}
|
|
19635
19775
|
)),
|
|
19636
|
-
(i) => /* @__PURE__ */ React81.createElement(React81.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React81.createElement(
|
|
19776
|
+
(i) => /* @__PURE__ */ React81.createElement(React81.Fragment, { key: `ellipsis-${i}` }, /* @__PURE__ */ React81.createElement(Text65, { color: getTheme().secondaryText }, "..."))
|
|
19637
19777
|
) : /* @__PURE__ */ React81.createElement(
|
|
19638
19778
|
HighlightedCode,
|
|
19639
19779
|
{
|
|
@@ -19770,7 +19910,7 @@ function FileWritePermissionRequest({
|
|
|
19770
19910
|
return true;
|
|
19771
19911
|
});
|
|
19772
19912
|
return /* @__PURE__ */ React82.createElement(
|
|
19773
|
-
|
|
19913
|
+
Box61,
|
|
19774
19914
|
{
|
|
19775
19915
|
flexDirection: "column",
|
|
19776
19916
|
borderStyle: "round",
|
|
@@ -19787,7 +19927,7 @@ function FileWritePermissionRequest({
|
|
|
19787
19927
|
riskScore: toolUseConfirm.riskScore
|
|
19788
19928
|
}
|
|
19789
19929
|
),
|
|
19790
|
-
/* @__PURE__ */ React82.createElement(
|
|
19930
|
+
/* @__PURE__ */ React82.createElement(Box61, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(
|
|
19791
19931
|
FileWriteToolDiff,
|
|
19792
19932
|
{
|
|
19793
19933
|
file_path,
|
|
@@ -19796,7 +19936,7 @@ function FileWritePermissionRequest({
|
|
|
19796
19936
|
width: columns - 12
|
|
19797
19937
|
}
|
|
19798
19938
|
)),
|
|
19799
|
-
/* @__PURE__ */ React82.createElement(
|
|
19939
|
+
/* @__PURE__ */ React82.createElement(Box61, { flexDirection: "column" }, /* @__PURE__ */ React82.createElement(Text66, null, "Do you want to ", fileExists ? "make this edit to" : "create", " ", /* @__PURE__ */ React82.createElement(Text66, { bold: true }, basename2(file_path)), "?"), /* @__PURE__ */ React82.createElement(
|
|
19800
19940
|
Select,
|
|
19801
19941
|
{
|
|
19802
19942
|
options: [
|
|
@@ -19830,7 +19970,7 @@ async function extractLanguageName2(file_path) {
|
|
|
19830
19970
|
}
|
|
19831
19971
|
|
|
19832
19972
|
// src/ui/components/permissions/filesystem-permission-request/FilesystemPermissionRequest.tsx
|
|
19833
|
-
import { Box as
|
|
19973
|
+
import { Box as Box62, Text as Text67, useInput as useInput22 } from "ink";
|
|
19834
19974
|
import React83, { useCallback as useCallback10, useMemo as useMemo19 } from "react";
|
|
19835
19975
|
import chalk11 from "chalk";
|
|
19836
19976
|
import { basename as basename3, dirname as dirname7 } from "path";
|
|
@@ -20040,7 +20180,7 @@ function FilesystemPermissionRequestImpl({
|
|
|
20040
20180
|
return true;
|
|
20041
20181
|
});
|
|
20042
20182
|
return /* @__PURE__ */ React83.createElement(
|
|
20043
|
-
|
|
20183
|
+
Box62,
|
|
20044
20184
|
{
|
|
20045
20185
|
flexDirection: "column",
|
|
20046
20186
|
borderStyle: "round",
|
|
@@ -20057,11 +20197,11 @@ function FilesystemPermissionRequestImpl({
|
|
|
20057
20197
|
riskScore: toolUseConfirm.riskScore
|
|
20058
20198
|
}
|
|
20059
20199
|
),
|
|
20060
|
-
/* @__PURE__ */ React83.createElement(
|
|
20200
|
+
/* @__PURE__ */ React83.createElement(Box62, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React83.createElement(Text67, null, userFacingName3, "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20061
20201
|
toolUseConfirm.input,
|
|
20062
20202
|
{ verbose }
|
|
20063
20203
|
), ")")),
|
|
20064
|
-
/* @__PURE__ */ React83.createElement(
|
|
20204
|
+
/* @__PURE__ */ React83.createElement(Box62, { flexDirection: "column" }, /* @__PURE__ */ React83.createElement(Text67, null, "Do you want to proceed?"), /* @__PURE__ */ React83.createElement(
|
|
20065
20205
|
Select,
|
|
20066
20206
|
{
|
|
20067
20207
|
options: [
|
|
@@ -20321,7 +20461,7 @@ function findCommand(commandName, commands) {
|
|
|
20321
20461
|
}
|
|
20322
20462
|
|
|
20323
20463
|
// src/ui/components/permissions/slash-command-permission-request/SlashCommandPermissionRequest.tsx
|
|
20324
|
-
import { Box as
|
|
20464
|
+
import { Box as Box63, Text as Text68 } from "ink";
|
|
20325
20465
|
import React85, { useMemo as useMemo20 } from "react";
|
|
20326
20466
|
import chalk12 from "chalk";
|
|
20327
20467
|
function parsePrefix(command4) {
|
|
@@ -20348,7 +20488,7 @@ function SlashCommandPermissionRequest({
|
|
|
20348
20488
|
const prefix = parsePrefix(command4);
|
|
20349
20489
|
const showPrefixOption = !!prefix && hasArgs(command4);
|
|
20350
20490
|
return /* @__PURE__ */ React85.createElement(
|
|
20351
|
-
|
|
20491
|
+
Box63,
|
|
20352
20492
|
{
|
|
20353
20493
|
flexDirection: "column",
|
|
20354
20494
|
borderStyle: "round",
|
|
@@ -20359,13 +20499,13 @@ function SlashCommandPermissionRequest({
|
|
|
20359
20499
|
paddingBottom: 1
|
|
20360
20500
|
},
|
|
20361
20501
|
/* @__PURE__ */ React85.createElement(PermissionRequestTitle, { title: "Slash command", riskScore: null }),
|
|
20362
|
-
/* @__PURE__ */ React85.createElement(
|
|
20502
|
+
/* @__PURE__ */ React85.createElement(Box63, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React85.createElement(Text68, null, toolUseConfirm.tool.userFacingName?.() || "SlashCommand", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20363
20503
|
toolUseConfirm.input,
|
|
20364
20504
|
{
|
|
20365
20505
|
verbose
|
|
20366
20506
|
}
|
|
20367
|
-
), ")"), /* @__PURE__ */ React85.createElement(
|
|
20368
|
-
/* @__PURE__ */ React85.createElement(
|
|
20507
|
+
), ")"), /* @__PURE__ */ React85.createElement(Text68, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20508
|
+
/* @__PURE__ */ React85.createElement(Box63, { flexDirection: "column" }, /* @__PURE__ */ React85.createElement(Text68, null, "Do you want to proceed?"), /* @__PURE__ */ React85.createElement(
|
|
20369
20509
|
Select,
|
|
20370
20510
|
{
|
|
20371
20511
|
options: [
|
|
@@ -20466,7 +20606,7 @@ function SlashCommandPermissionRequest({
|
|
|
20466
20606
|
}
|
|
20467
20607
|
|
|
20468
20608
|
// src/ui/components/permissions/skill-permission-request/SkillPermissionRequest.tsx
|
|
20469
|
-
import { Box as
|
|
20609
|
+
import { Box as Box64, Text as Text69 } from "ink";
|
|
20470
20610
|
import React86, { useMemo as useMemo21 } from "react";
|
|
20471
20611
|
import chalk13 from "chalk";
|
|
20472
20612
|
function SkillPermissionRequest({
|
|
@@ -20483,7 +20623,7 @@ function SkillPermissionRequest({
|
|
|
20483
20623
|
const raw = typeof toolUseConfirm.input.skill === "string" ? toolUseConfirm.input.skill : "";
|
|
20484
20624
|
const skill = raw.trim().replace(/^\//, "");
|
|
20485
20625
|
return /* @__PURE__ */ React86.createElement(
|
|
20486
|
-
|
|
20626
|
+
Box64,
|
|
20487
20627
|
{
|
|
20488
20628
|
flexDirection: "column",
|
|
20489
20629
|
borderStyle: "round",
|
|
@@ -20494,13 +20634,13 @@ function SkillPermissionRequest({
|
|
|
20494
20634
|
paddingBottom: 1
|
|
20495
20635
|
},
|
|
20496
20636
|
/* @__PURE__ */ React86.createElement(PermissionRequestTitle, { title: "Skill", riskScore: null }),
|
|
20497
|
-
/* @__PURE__ */ React86.createElement(
|
|
20637
|
+
/* @__PURE__ */ React86.createElement(Box64, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React86.createElement(Text69, null, toolUseConfirm.tool.userFacingName?.() || "Skill", "(", toolUseConfirm.tool.renderToolUseMessage(
|
|
20498
20638
|
toolUseConfirm.input,
|
|
20499
20639
|
{
|
|
20500
20640
|
verbose
|
|
20501
20641
|
}
|
|
20502
|
-
), ")"), /* @__PURE__ */ React86.createElement(
|
|
20503
|
-
/* @__PURE__ */ React86.createElement(
|
|
20642
|
+
), ")"), /* @__PURE__ */ React86.createElement(Text69, { color: theme.secondaryText }, toolUseConfirm.description)),
|
|
20643
|
+
/* @__PURE__ */ React86.createElement(Box64, { flexDirection: "column" }, /* @__PURE__ */ React86.createElement(Text69, null, "Do you want to proceed?"), /* @__PURE__ */ React86.createElement(
|
|
20504
20644
|
Select,
|
|
20505
20645
|
{
|
|
20506
20646
|
options: [
|
|
@@ -20570,7 +20710,7 @@ function SkillPermissionRequest({
|
|
|
20570
20710
|
}
|
|
20571
20711
|
|
|
20572
20712
|
// src/tools/agent/PlanModeTool/EnterPlanModeTool.tsx
|
|
20573
|
-
import { Box as
|
|
20713
|
+
import { Box as Box65, Text as Text70 } from "ink";
|
|
20574
20714
|
import React87 from "react";
|
|
20575
20715
|
import { z as z10 } from "zod";
|
|
20576
20716
|
|
|
@@ -20723,11 +20863,11 @@ var EnterPlanModeTool = {
|
|
|
20723
20863
|
},
|
|
20724
20864
|
renderToolUseRejectedMessage() {
|
|
20725
20865
|
const theme = getTheme();
|
|
20726
|
-
return /* @__PURE__ */ React87.createElement(
|
|
20866
|
+
return /* @__PURE__ */ React87.createElement(Box65, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React87.createElement(Text70, { color: theme.text }, BLACK_CIRCLE), /* @__PURE__ */ React87.createElement(Text70, null, " User declined to enter plan mode"));
|
|
20727
20867
|
},
|
|
20728
20868
|
renderToolResultMessage(_output) {
|
|
20729
20869
|
const theme = getTheme();
|
|
20730
|
-
return /* @__PURE__ */ React87.createElement(
|
|
20870
|
+
return /* @__PURE__ */ React87.createElement(Box65, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React87.createElement(Box65, { flexDirection: "row" }, /* @__PURE__ */ React87.createElement(Text70, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React87.createElement(Text70, null, " Entered plan mode")), /* @__PURE__ */ React87.createElement(Box65, { paddingLeft: 2 }, /* @__PURE__ */ React87.createElement(Text70, { dimColor: true }, "Pyb Agent is now exploring and designing an implementation approach.")));
|
|
20731
20871
|
},
|
|
20732
20872
|
renderResultForAssistant(output) {
|
|
20733
20873
|
return `${output.message}
|
|
@@ -20760,7 +20900,7 @@ Remember: DO NOT write or edit any files yet. This is a read-only exploration an
|
|
|
20760
20900
|
};
|
|
20761
20901
|
|
|
20762
20902
|
// src/tools/agent/PlanModeTool/ExitPlanModeTool.tsx
|
|
20763
|
-
import { Box as
|
|
20903
|
+
import { Box as Box66, Text as Text71 } from "ink";
|
|
20764
20904
|
import React88 from "react";
|
|
20765
20905
|
import { z as z11 } from "zod";
|
|
20766
20906
|
function getExitPlanModePlanText(conversationKey) {
|
|
@@ -20806,8 +20946,8 @@ var ExitPlanModeTool = {
|
|
|
20806
20946
|
const conversationKey = typeof options.conversationKey === "string" && options.conversationKey.trim() ? options.conversationKey.trim() : void 0;
|
|
20807
20947
|
const { content } = readPlanFile(void 0, conversationKey);
|
|
20808
20948
|
const plan = getExitPlanModePlanText(conversationKey);
|
|
20809
|
-
return /* @__PURE__ */ React88.createElement(
|
|
20810
|
-
|
|
20949
|
+
return /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text71, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React88.createElement(Text71, { color: theme.error }, "User rejected Pyb Agent's plan:"), /* @__PURE__ */ React88.createElement(
|
|
20950
|
+
Box66,
|
|
20811
20951
|
{
|
|
20812
20952
|
borderStyle: "round",
|
|
20813
20953
|
borderColor: theme.planMode,
|
|
@@ -20815,14 +20955,14 @@ var ExitPlanModeTool = {
|
|
|
20815
20955
|
paddingX: 1,
|
|
20816
20956
|
overflow: "hidden"
|
|
20817
20957
|
},
|
|
20818
|
-
/* @__PURE__ */ React88.createElement(
|
|
20958
|
+
/* @__PURE__ */ React88.createElement(Text71, { dimColor: true }, plan)
|
|
20819
20959
|
))));
|
|
20820
20960
|
},
|
|
20821
20961
|
renderToolResultMessage(output) {
|
|
20822
20962
|
const theme = getTheme();
|
|
20823
20963
|
const planPath = typeof output.filePath === "string" ? output.filePath : null;
|
|
20824
20964
|
const plan = output.plan || "No plan found";
|
|
20825
|
-
return /* @__PURE__ */ React88.createElement(
|
|
20965
|
+
return /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "column", marginTop: 1, width: "100%" }, /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text71, { color: theme.planMode }, BLACK_CIRCLE), /* @__PURE__ */ React88.createElement(Text71, null, " User approved Pyb Agent's plan")), /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "row" }, /* @__PURE__ */ React88.createElement(Text71, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React88.createElement(Box66, { flexDirection: "column" }, planPath ? /* @__PURE__ */ React88.createElement(Text71, { dimColor: true }, "Plan saved to: ", planPath, " \xB7 /plan to edit") : null, /* @__PURE__ */ React88.createElement(Text71, { dimColor: true }, plan))));
|
|
20826
20966
|
},
|
|
20827
20967
|
renderResultForAssistant(output) {
|
|
20828
20968
|
if (output.isAgent) {
|
|
@@ -20906,7 +21046,7 @@ ${output.plan}`;
|
|
|
20906
21046
|
};
|
|
20907
21047
|
|
|
20908
21048
|
// src/ui/components/permissions/plan-mode-permission-request/EnterPlanModePermissionRequest.tsx
|
|
20909
|
-
import { Box as
|
|
21049
|
+
import { Box as Box67, Text as Text72, useInput as useInput23 } from "ink";
|
|
20910
21050
|
import React89 from "react";
|
|
20911
21051
|
function EnterPlanModePermissionRequest({
|
|
20912
21052
|
toolUseConfirm,
|
|
@@ -20921,7 +21061,7 @@ function EnterPlanModePermissionRequest({
|
|
|
20921
21061
|
}
|
|
20922
21062
|
});
|
|
20923
21063
|
return /* @__PURE__ */ React89.createElement(
|
|
20924
|
-
|
|
21064
|
+
Box67,
|
|
20925
21065
|
{
|
|
20926
21066
|
flexDirection: "column",
|
|
20927
21067
|
borderStyle: "round",
|
|
@@ -20932,10 +21072,10 @@ function EnterPlanModePermissionRequest({
|
|
|
20932
21072
|
paddingBottom: 1
|
|
20933
21073
|
},
|
|
20934
21074
|
/* @__PURE__ */ React89.createElement(PermissionRequestTitle, { title: "Enter plan mode?", riskScore: null }),
|
|
20935
|
-
/* @__PURE__ */ React89.createElement(
|
|
20936
|
-
/* @__PURE__ */ React89.createElement(
|
|
20937
|
-
/* @__PURE__ */ React89.createElement(
|
|
20938
|
-
/* @__PURE__ */ React89.createElement(
|
|
21075
|
+
/* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React89.createElement(Text72, null, "The assistant wants to enter plan mode to explore and design an implementation approach.")),
|
|
21076
|
+
/* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, "In plan mode, the assistant will:"), /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, " \xB7 Explore the codebase thoroughly"), /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, " \xB7 Identify existing patterns"), /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, " \xB7 Design an implementation strategy"), /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, " \xB7 Present a plan for your approval")),
|
|
21077
|
+
/* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column", paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React89.createElement(Text72, { dimColor: true }, "No code changes will be made until you approve the plan.")),
|
|
21078
|
+
/* @__PURE__ */ React89.createElement(Box67, { flexDirection: "column" }, /* @__PURE__ */ React89.createElement(Text72, null, "Would you like to proceed?"), /* @__PURE__ */ React89.createElement(
|
|
20939
21079
|
Select,
|
|
20940
21080
|
{
|
|
20941
21081
|
options: [
|
|
@@ -20958,7 +21098,7 @@ function EnterPlanModePermissionRequest({
|
|
|
20958
21098
|
}
|
|
20959
21099
|
|
|
20960
21100
|
// src/ui/components/permissions/plan-mode-permission-request/ExitPlanModePermissionRequest.tsx
|
|
20961
|
-
import { Box as
|
|
21101
|
+
import { Box as Box68, Text as Text73, useInput as useInput24 } from "ink";
|
|
20962
21102
|
import React90, { useEffect as useEffect19, useMemo as useMemo22, useState as useState20 } from "react";
|
|
20963
21103
|
|
|
20964
21104
|
// src/utils/system/externalEditor.ts
|
|
@@ -21267,7 +21407,7 @@ function ExitPlanModePermissionRequest({
|
|
|
21267
21407
|
);
|
|
21268
21408
|
if (showRejectInput) {
|
|
21269
21409
|
return /* @__PURE__ */ React90.createElement(
|
|
21270
|
-
|
|
21410
|
+
Box68,
|
|
21271
21411
|
{
|
|
21272
21412
|
flexDirection: "column",
|
|
21273
21413
|
borderStyle: "round",
|
|
@@ -21278,7 +21418,7 @@ function ExitPlanModePermissionRequest({
|
|
|
21278
21418
|
paddingBottom: 1
|
|
21279
21419
|
},
|
|
21280
21420
|
/* @__PURE__ */ React90.createElement(PermissionRequestTitle, { title: "No, keep planning", riskScore: null }),
|
|
21281
|
-
/* @__PURE__ */ React90.createElement(
|
|
21421
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, "Type here to tell Pyb Agent what to change (Enter submits, Esc cancels)"), rejectError ? /* @__PURE__ */ React90.createElement(Text73, { color: theme.error }, rejectError) : null, /* @__PURE__ */ React90.createElement(
|
|
21282
21422
|
TextInput,
|
|
21283
21423
|
{
|
|
21284
21424
|
value: rejectFeedback,
|
|
@@ -21308,7 +21448,7 @@ function ExitPlanModePermissionRequest({
|
|
|
21308
21448
|
);
|
|
21309
21449
|
}
|
|
21310
21450
|
return /* @__PURE__ */ React90.createElement(
|
|
21311
|
-
|
|
21451
|
+
Box68,
|
|
21312
21452
|
{
|
|
21313
21453
|
flexDirection: "column",
|
|
21314
21454
|
borderStyle: "round",
|
|
@@ -21319,8 +21459,8 @@ function ExitPlanModePermissionRequest({
|
|
|
21319
21459
|
paddingBottom: 1
|
|
21320
21460
|
},
|
|
21321
21461
|
/* @__PURE__ */ React90.createElement(PermissionRequestTitle, { title: "Ready to code?", riskScore: null }),
|
|
21322
|
-
/* @__PURE__ */ React90.createElement(
|
|
21323
|
-
|
|
21462
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React90.createElement(Text73, null, "Here is Pyb Agent's plan:"), /* @__PURE__ */ React90.createElement(
|
|
21463
|
+
Box68,
|
|
21324
21464
|
{
|
|
21325
21465
|
borderStyle: "dashed",
|
|
21326
21466
|
borderColor: theme.secondaryBorder,
|
|
@@ -21332,10 +21472,10 @@ function ExitPlanModePermissionRequest({
|
|
|
21332
21472
|
marginBottom: 1,
|
|
21333
21473
|
flexDirection: "column"
|
|
21334
21474
|
},
|
|
21335
|
-
/* @__PURE__ */ React90.createElement(
|
|
21475
|
+
/* @__PURE__ */ React90.createElement(Text73, null, planText)
|
|
21336
21476
|
)),
|
|
21337
|
-
/* @__PURE__ */ React90.createElement(
|
|
21338
|
-
/* @__PURE__ */ React90.createElement(
|
|
21477
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", paddingX: 2 }, /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, "Tip: Press ctrl+g to edit", " ", planSource === "file" ? `plan file: ${planFilePath}` : "plan text", planSaved ? " \xB7 Plan saved!" : "")),
|
|
21478
|
+
/* @__PURE__ */ React90.createElement(Box68, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React90.createElement(Text73, { dimColor: true }, "Would you like to proceed?"), /* @__PURE__ */ React90.createElement(
|
|
21339
21479
|
Select,
|
|
21340
21480
|
{
|
|
21341
21481
|
options,
|
|
@@ -21361,7 +21501,7 @@ function ExitPlanModePermissionRequest({
|
|
|
21361
21501
|
}
|
|
21362
21502
|
|
|
21363
21503
|
// src/tools/interaction/AskUserQuestionTool/AskUserQuestionTool.tsx
|
|
21364
|
-
import { Box as
|
|
21504
|
+
import { Box as Box69, Text as Text74 } from "ink";
|
|
21365
21505
|
import React91 from "react";
|
|
21366
21506
|
import { z as z12 } from "zod";
|
|
21367
21507
|
|
|
@@ -21439,11 +21579,11 @@ var AskUserQuestionTool = {
|
|
|
21439
21579
|
},
|
|
21440
21580
|
renderToolUseRejectedMessage() {
|
|
21441
21581
|
const theme = getTheme();
|
|
21442
|
-
return /* @__PURE__ */ React91.createElement(
|
|
21582
|
+
return /* @__PURE__ */ React91.createElement(Box69, { flexDirection: "row", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Text74, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React91.createElement(Text74, null, "User declined to answer questions"));
|
|
21443
21583
|
},
|
|
21444
21584
|
renderToolResultMessage(output, _options) {
|
|
21445
21585
|
const theme = getTheme();
|
|
21446
|
-
return /* @__PURE__ */ React91.createElement(
|
|
21586
|
+
return /* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React91.createElement(Box69, { flexDirection: "row" }, /* @__PURE__ */ React91.createElement(Text74, { color: theme.text }, BLACK_CIRCLE, "\xA0"), /* @__PURE__ */ React91.createElement(Text74, null, "User answered Pyb Agent's questions:")), /* @__PURE__ */ React91.createElement(Box69, { flexDirection: "column", paddingLeft: 2 }, Object.entries(output.answers).map(([question, answer]) => /* @__PURE__ */ React91.createElement(Box69, { key: question }, /* @__PURE__ */ React91.createElement(Text74, { dimColor: true }, "\xB7 ", question, " \u2192 ", answer)))));
|
|
21447
21587
|
},
|
|
21448
21588
|
renderResultForAssistant(output) {
|
|
21449
21589
|
const formatted = Object.entries(output.answers).map(([question, answer]) => `"${question}"="${answer}"`).join(", ");
|
|
@@ -21461,7 +21601,7 @@ var AskUserQuestionTool = {
|
|
|
21461
21601
|
|
|
21462
21602
|
// src/ui/components/permissions/ask-user-question-permission-request/AskUserQuestionPermissionRequest.tsx
|
|
21463
21603
|
import React92, { useCallback as useCallback11, useMemo as useMemo23, useState as useState21 } from "react";
|
|
21464
|
-
import { Box as
|
|
21604
|
+
import { Box as Box70, Text as Text75, useInput as useInput25 } from "ink";
|
|
21465
21605
|
import figures8 from "figures";
|
|
21466
21606
|
import stringWidth from "string-width";
|
|
21467
21607
|
function isTextInputChar(input, key) {
|
|
@@ -21815,18 +21955,18 @@ function AskUserQuestionPermissionRequest({
|
|
|
21815
21955
|
const rightArrowInactive = currentQuestionIndex === maxTabIndex;
|
|
21816
21956
|
const allQuestionsAnswered = questions.every((q) => q?.question && Boolean(answers[q.question])) ?? false;
|
|
21817
21957
|
if (questions.length === 0) {
|
|
21818
|
-
return /* @__PURE__ */ React92.createElement(
|
|
21958
|
+
return /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.error }, "Invalid AskUserQuestion input."), /* @__PURE__ */ React92.createElement(Text75, { dimColor: true }, "Press Esc to cancel."));
|
|
21819
21959
|
}
|
|
21820
|
-
return /* @__PURE__ */ React92.createElement(
|
|
21821
|
-
|
|
21960
|
+
return /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React92.createElement(
|
|
21961
|
+
Box70,
|
|
21822
21962
|
{
|
|
21823
21963
|
borderTop: true,
|
|
21824
21964
|
borderColor: theme.secondaryText,
|
|
21825
21965
|
flexDirection: "column",
|
|
21826
21966
|
paddingTop: 0
|
|
21827
21967
|
},
|
|
21828
|
-
/* @__PURE__ */ React92.createElement(
|
|
21829
|
-
|
|
21968
|
+
/* @__PURE__ */ React92.createElement(Box70, { flexDirection: "row", marginBottom: 1 }, showArrows && /* @__PURE__ */ React92.createElement(
|
|
21969
|
+
Text75,
|
|
21830
21970
|
{
|
|
21831
21971
|
color: currentQuestionIndex === 0 ? theme.secondaryText : void 0
|
|
21832
21972
|
},
|
|
@@ -21838,7 +21978,7 @@ function AskUserQuestionPermissionRequest({
|
|
|
21838
21978
|
const headerText = tabHeaders[index] ?? question.header ?? `Q${index + 1}`;
|
|
21839
21979
|
const tabText = ` ${checkbox} ${headerText} `;
|
|
21840
21980
|
return /* @__PURE__ */ React92.createElement(React92.Fragment, { key: question.question || `question-${index}` }, /* @__PURE__ */ React92.createElement(
|
|
21841
|
-
|
|
21981
|
+
Text75,
|
|
21842
21982
|
{
|
|
21843
21983
|
backgroundColor: isSelected ? theme.permission : void 0,
|
|
21844
21984
|
color: isSelected ? inverseText : void 0
|
|
@@ -21846,7 +21986,7 @@ function AskUserQuestionPermissionRequest({
|
|
|
21846
21986
|
tabText
|
|
21847
21987
|
));
|
|
21848
21988
|
}), !hideSubmitTab && /* @__PURE__ */ React92.createElement(
|
|
21849
|
-
|
|
21989
|
+
Text75,
|
|
21850
21990
|
{
|
|
21851
21991
|
backgroundColor: isSubmitTab ? theme.permission : void 0,
|
|
21852
21992
|
color: isSubmitTab ? inverseText : void 0
|
|
@@ -21855,8 +21995,8 @@ function AskUserQuestionPermissionRequest({
|
|
|
21855
21995
|
figures8.tick,
|
|
21856
21996
|
" Submit",
|
|
21857
21997
|
" "
|
|
21858
|
-
), showArrows && /* @__PURE__ */ React92.createElement(
|
|
21859
|
-
!isSubmitTab && currentQuestion && /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(
|
|
21998
|
+
), showArrows && /* @__PURE__ */ React92.createElement(Text75, { color: rightArrowInactive ? theme.secondaryText : void 0 }, " ", "\u2192")),
|
|
21999
|
+
!isSubmitTab && currentQuestion && /* @__PURE__ */ React92.createElement(React92.Fragment, null, /* @__PURE__ */ React92.createElement(Text75, { bold: true }, currentQuestion.question), /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", marginTop: 1 }, (() => {
|
|
21860
22000
|
const rawSelected = activeQuestionState?.selectedValue;
|
|
21861
22001
|
const selectedValues = Array.isArray(rawSelected) ? rawSelected : [];
|
|
21862
22002
|
const otherSelected = currentQuestion.multiSelect ? selectedValues.includes("__other__") : rawSelected === "__other__";
|
|
@@ -21869,9 +22009,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
21869
22009
|
const pointer = isFocused ? figures8.pointer : " ";
|
|
21870
22010
|
const color = isFocused ? theme.pyb : theme.text;
|
|
21871
22011
|
const indicator = currentQuestion.multiSelect ? isSelected ? figures8.checkboxOn : figures8.checkboxOff : isSelected ? figures8.tick : " ";
|
|
21872
|
-
return /* @__PURE__ */ React92.createElement(
|
|
21873
|
-
}), /* @__PURE__ */ React92.createElement(
|
|
21874
|
-
|
|
22012
|
+
return /* @__PURE__ */ React92.createElement(Box70, { key: option.label, flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text75, { color }, pointer, " ", indicator, " ", option.label), /* @__PURE__ */ React92.createElement(Text75, { color: theme.secondaryText }, " ", option.description));
|
|
22013
|
+
}), /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text75, { color: isOtherFocused ? theme.pyb : theme.text }, isOtherFocused ? figures8.pointer : " ", " ", currentQuestion.multiSelect ? otherSelected ? figures8.checkboxOn : figures8.checkboxOff : otherSelected ? figures8.tick : " ", " ", "Other"), (isOtherFocused || otherSelected || otherText.trim().length > 0) && /* @__PURE__ */ React92.createElement(Text75, { color: theme.secondaryText }, otherLine, isOtherFocused && /* @__PURE__ */ React92.createElement(Text75, { color: "gray" }, "\u258C"))), currentQuestion.multiSelect && /* @__PURE__ */ React92.createElement(Box70, { marginTop: 0 }, /* @__PURE__ */ React92.createElement(
|
|
22014
|
+
Text75,
|
|
21875
22015
|
{
|
|
21876
22016
|
color: isMultiSelectSubmitFocused ? theme.pyb : theme.text,
|
|
21877
22017
|
bold: isMultiSelectSubmitFocused
|
|
@@ -21879,9 +22019,9 @@ function AskUserQuestionPermissionRequest({
|
|
|
21879
22019
|
isMultiSelectSubmitFocused ? figures8.pointer : " ",
|
|
21880
22020
|
" ",
|
|
21881
22021
|
currentQuestionIndex === questions.length - 1 ? "Submit" : "Next"
|
|
21882
|
-
)), /* @__PURE__ */ React92.createElement(
|
|
22022
|
+
)), /* @__PURE__ */ React92.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.secondaryText, dimColor: true }, "Enter to select \xB7 Tab/Arrow keys to navigate \xB7 Esc to cancel")));
|
|
21883
22023
|
})())),
|
|
21884
|
-
isSubmitTab && /* @__PURE__ */ React92.createElement(
|
|
22024
|
+
isSubmitTab && /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column" }, /* @__PURE__ */ React92.createElement(Text75, { bold: true }, "Review your answers"), !allQuestionsAnswered && /* @__PURE__ */ React92.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.warning }, figures8.warning, " You have not answered all questions")), /* @__PURE__ */ React92.createElement(Box70, { flexDirection: "column", marginTop: 1 }, questions.filter((q) => q?.question && answers[q.question]).map((q) => /* @__PURE__ */ React92.createElement(Box70, { key: q.question, flexDirection: "column", marginLeft: 1 }, /* @__PURE__ */ React92.createElement(Text75, null, figures8.bullet, " ", q.question), /* @__PURE__ */ React92.createElement(Box70, { marginLeft: 2 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.success }, figures8.arrowRight, " ", answers[q.question]))))), /* @__PURE__ */ React92.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(Text75, { color: theme.secondaryText }, "Ready to submit your answers?")), /* @__PURE__ */ React92.createElement(Box70, { marginTop: 1 }, /* @__PURE__ */ React92.createElement(
|
|
21885
22025
|
Select,
|
|
21886
22026
|
{
|
|
21887
22027
|
options: [
|
|
@@ -21962,7 +22102,7 @@ function PermissionRequest({
|
|
|
21962
22102
|
}
|
|
21963
22103
|
|
|
21964
22104
|
// src/ui/components/PromptInput.tsx
|
|
21965
|
-
import { Box as
|
|
22105
|
+
import { Box as Box73, Text as Text78, useInput as useInput28 } from "ink";
|
|
21966
22106
|
import * as React97 from "react";
|
|
21967
22107
|
|
|
21968
22108
|
// src/ui/hooks/useArrowKeyHistory.ts
|
|
@@ -23482,19 +23622,19 @@ function useUnifiedCompletion({
|
|
|
23482
23622
|
if (systemCommands.length > 0 || isLoadingCommands) return;
|
|
23483
23623
|
setIsLoadingCommands(true);
|
|
23484
23624
|
try {
|
|
23485
|
-
const { readdirSync: readdirSync3, statSync:
|
|
23625
|
+
const { readdirSync: readdirSync3, statSync: statSync14 } = await import("fs");
|
|
23486
23626
|
const pathDirs = (process.env.PATH || "").split(":").filter(Boolean);
|
|
23487
23627
|
const commandSet = /* @__PURE__ */ new Set();
|
|
23488
23628
|
const essentialCommands = getEssentialCommands();
|
|
23489
23629
|
essentialCommands.forEach((cmd) => commandSet.add(cmd));
|
|
23490
23630
|
for (const dir of pathDirs) {
|
|
23491
23631
|
try {
|
|
23492
|
-
if (readdirSync3 &&
|
|
23632
|
+
if (readdirSync3 && statSync14) {
|
|
23493
23633
|
const entries = readdirSync3(dir);
|
|
23494
23634
|
for (const entry of entries) {
|
|
23495
23635
|
try {
|
|
23496
23636
|
const fullPath = `${dir}/${entry}`;
|
|
23497
|
-
const stats =
|
|
23637
|
+
const stats = statSync14(fullPath);
|
|
23498
23638
|
if (stats.isFile() && (stats.mode & 73) !== 0) {
|
|
23499
23639
|
commandSet.add(entry);
|
|
23500
23640
|
}
|
|
@@ -24021,7 +24161,7 @@ var SentryErrorBoundary = class extends React94.Component {
|
|
|
24021
24161
|
};
|
|
24022
24162
|
|
|
24023
24163
|
// src/ui/components/TokenWarning.tsx
|
|
24024
|
-
import { Box as
|
|
24164
|
+
import { Box as Box71, Text as Text76 } from "ink";
|
|
24025
24165
|
import * as React95 from "react";
|
|
24026
24166
|
var MAX_TOKENS = 19e4;
|
|
24027
24167
|
var WARNING_THRESHOLD = MAX_TOKENS * 0.6;
|
|
@@ -24032,7 +24172,7 @@ function TokenWarning({ tokenUsage }) {
|
|
|
24032
24172
|
return null;
|
|
24033
24173
|
}
|
|
24034
24174
|
const isError = tokenUsage >= ERROR_THRESHOLD;
|
|
24035
|
-
return /* @__PURE__ */ React95.createElement(
|
|
24175
|
+
return /* @__PURE__ */ React95.createElement(Box71, { flexDirection: "row" }, /* @__PURE__ */ React95.createElement(Text76, { color: isError ? theme.error : theme.warning }, "Context low (", Math.max(0, 100 - Math.round(tokenUsage / MAX_TOKENS * 100)), "% remaining) \xB7 Run /compact to compact & continue"));
|
|
24036
24176
|
}
|
|
24037
24177
|
|
|
24038
24178
|
// src/utils/commands/hashCommand.ts
|
|
@@ -24079,7 +24219,7 @@ _Added on ${now.toLocaleString()} ${timezone}_`;
|
|
|
24079
24219
|
|
|
24080
24220
|
// src/ui/components/ModeIndicator.tsx
|
|
24081
24221
|
import React96 from "react";
|
|
24082
|
-
import { Box as
|
|
24222
|
+
import { Box as Box72, Text as Text77 } from "ink";
|
|
24083
24223
|
function __getModeIndicatorDisplayForTests(args) {
|
|
24084
24224
|
if (args.mode === "default") {
|
|
24085
24225
|
return {
|
|
@@ -24150,7 +24290,7 @@ function CompactModeIndicator() {
|
|
|
24150
24290
|
shortcutDisplayText: shortcut.displayText,
|
|
24151
24291
|
theme
|
|
24152
24292
|
});
|
|
24153
|
-
return /* @__PURE__ */ React96.createElement(
|
|
24293
|
+
return /* @__PURE__ */ React96.createElement(Text77, { color: indicator.color }, indicator.mainText, /* @__PURE__ */ React96.createElement(Text77, { dimColor: true }, indicator.shortcutHintText));
|
|
24154
24294
|
}
|
|
24155
24295
|
|
|
24156
24296
|
// src/utils/terminal/promptInputSpecialKey.ts
|
|
@@ -24277,7 +24417,7 @@ function useStatusLine() {
|
|
|
24277
24417
|
// src/ui/components/PromptInput.tsx
|
|
24278
24418
|
async function interpretHashCommand(input) {
|
|
24279
24419
|
try {
|
|
24280
|
-
const { queryQuick: queryQuick2 } = await import("./llm-
|
|
24420
|
+
const { queryQuick: queryQuick2 } = await import("./llm-3KCTIVOM.js");
|
|
24281
24421
|
const systemPrompt = [
|
|
24282
24422
|
"You're helping the user structure notes that will be added to their PYB.md file.",
|
|
24283
24423
|
"Format the user's input into a well-structured note that will be useful for later reference.",
|
|
@@ -24386,12 +24526,12 @@ function PromptInput({
|
|
|
24386
24526
|
const isAgent = suggestion.type === "agent";
|
|
24387
24527
|
const displayColor = isSelected ? theme.suggestion : isAgent && suggestion.metadata?.color ? suggestion.metadata.color : void 0;
|
|
24388
24528
|
return /* @__PURE__ */ React97.createElement(
|
|
24389
|
-
|
|
24529
|
+
Box73,
|
|
24390
24530
|
{
|
|
24391
24531
|
key: `${suggestion.type}-${suggestion.value}-${index}`,
|
|
24392
24532
|
flexDirection: "row"
|
|
24393
24533
|
},
|
|
24394
|
-
/* @__PURE__ */ React97.createElement(
|
|
24534
|
+
/* @__PURE__ */ React97.createElement(Text78, { color: displayColor, dimColor: !isSelected && !displayColor }, isSelected ? "\u25C6 " : " ", suggestion.displayValue)
|
|
24395
24535
|
);
|
|
24396
24536
|
});
|
|
24397
24537
|
}, [suggestions, selectedIndex, theme.suggestion]);
|
|
@@ -24590,7 +24730,7 @@ function PromptInput({
|
|
|
24590
24730
|
if (messages2.length) {
|
|
24591
24731
|
if (mode === "bash") {
|
|
24592
24732
|
onQuery(messages2, newAbortController).then(async () => {
|
|
24593
|
-
const { getCwd: getCwd2 } = await import("./state-
|
|
24733
|
+
const { getCwd: getCwd2 } = await import("./state-4AIVX6VM.js");
|
|
24594
24734
|
setCurrentPwd(getCwd2());
|
|
24595
24735
|
});
|
|
24596
24736
|
} else {
|
|
@@ -24746,17 +24886,17 @@ function PromptInput({
|
|
|
24746
24886
|
currentTokens: tokenUsage
|
|
24747
24887
|
};
|
|
24748
24888
|
}, [tokenUsage, modelSwitchMessage.show, submitCount, currentModelId]);
|
|
24749
|
-
return /* @__PURE__ */ React97.createElement(
|
|
24750
|
-
|
|
24889
|
+
return /* @__PURE__ */ React97.createElement(Box73, { flexDirection: "column" }, (mode === "bash" || modelInfo) && /* @__PURE__ */ React97.createElement(
|
|
24890
|
+
Box73,
|
|
24751
24891
|
{
|
|
24752
24892
|
justifyContent: "space-between",
|
|
24753
24893
|
marginBottom: 1,
|
|
24754
24894
|
flexDirection: "row"
|
|
24755
24895
|
},
|
|
24756
|
-
mode === "bash" ? /* @__PURE__ */ React97.createElement(
|
|
24757
|
-
modelInfo && /* @__PURE__ */ React97.createElement(
|
|
24896
|
+
mode === "bash" ? /* @__PURE__ */ React97.createElement(Text78, { color: theme.bashBorder }, "Shell PWD: ", currentPwd) : /* @__PURE__ */ React97.createElement(Text78, null, " "),
|
|
24897
|
+
modelInfo && /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, "[", modelInfo.provider, "] ", modelInfo.name, ":", " ", Math.round(modelInfo.currentTokens / 1e3), "k /", " ", Math.round(modelInfo.contextLength / 1e3), "k")
|
|
24758
24898
|
), /* @__PURE__ */ React97.createElement(
|
|
24759
|
-
|
|
24899
|
+
Box73,
|
|
24760
24900
|
{
|
|
24761
24901
|
alignItems: "flex-start",
|
|
24762
24902
|
justifyContent: "flex-start",
|
|
@@ -24771,7 +24911,7 @@ function PromptInput({
|
|
|
24771
24911
|
width: "100%"
|
|
24772
24912
|
},
|
|
24773
24913
|
/* @__PURE__ */ React97.createElement(
|
|
24774
|
-
|
|
24914
|
+
Box73,
|
|
24775
24915
|
{
|
|
24776
24916
|
alignItems: "flex-start",
|
|
24777
24917
|
alignSelf: "flex-start",
|
|
@@ -24779,9 +24919,9 @@ function PromptInput({
|
|
|
24779
24919
|
justifyContent: "flex-start",
|
|
24780
24920
|
width: 3
|
|
24781
24921
|
},
|
|
24782
|
-
mode === "bash" ? /* @__PURE__ */ React97.createElement(
|
|
24922
|
+
mode === "bash" ? /* @__PURE__ */ React97.createElement(Text78, { color: theme.bashBorder }, "\xA0!\xA0") : mode === "pyb" ? /* @__PURE__ */ React97.createElement(Text78, { color: theme.noting }, "\xA0#\xA0") : /* @__PURE__ */ React97.createElement(Text78, { color: isLoading ? theme.secondaryText : void 0 }, "P>\xA0")
|
|
24783
24923
|
),
|
|
24784
|
-
/* @__PURE__ */ React97.createElement(
|
|
24924
|
+
/* @__PURE__ */ React97.createElement(Box73, { paddingRight: 1 }, /* @__PURE__ */ React97.createElement(
|
|
24785
24925
|
TextInput,
|
|
24786
24926
|
{
|
|
24787
24927
|
multiline: true,
|
|
@@ -24806,36 +24946,36 @@ function PromptInput({
|
|
|
24806
24946
|
onSpecialKey: handleSpecialKey
|
|
24807
24947
|
}
|
|
24808
24948
|
))
|
|
24809
|
-
), !completionActive && suggestions.length === 0 && /* @__PURE__ */ React97.createElement(
|
|
24810
|
-
|
|
24949
|
+
), !completionActive && suggestions.length === 0 && /* @__PURE__ */ React97.createElement(Box73, { flexDirection: "column", paddingX: 2, paddingY: 0 }, /* @__PURE__ */ React97.createElement(Box73, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React97.createElement(Box73, { justifyContent: "flex-start", gap: 1 }, exitMessage.show ? /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, "Press ", exitMessage.key, " again to exit") : message.show ? /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, message.text) : rewindMessagePending ? /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, "Press Escape again to undo") : modelSwitchMessage.show ? /* @__PURE__ */ React97.createElement(Text78, { color: theme.success }, modelSwitchMessage.text) : mode === "prompt" && currentMode !== "default" ? /* @__PURE__ */ React97.createElement(CompactModeIndicator, null) : /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(
|
|
24950
|
+
Text78,
|
|
24811
24951
|
{
|
|
24812
24952
|
color: mode === "bash" ? theme.bashBorder : void 0,
|
|
24813
24953
|
dimColor: mode !== "bash"
|
|
24814
24954
|
},
|
|
24815
24955
|
"! run some shell command"
|
|
24816
|
-
), /* @__PURE__ */ React97.createElement(
|
|
24817
|
-
|
|
24956
|
+
), /* @__PURE__ */ React97.createElement(Text78, { dimColor: true }, " \xB7 / for commands"), /* @__PURE__ */ React97.createElement(
|
|
24957
|
+
Text78,
|
|
24818
24958
|
{
|
|
24819
24959
|
color: mode === "pyb" ? theme.noting : void 0,
|
|
24820
24960
|
dimColor: mode !== "pyb"
|
|
24821
24961
|
},
|
|
24822
24962
|
" ",
|
|
24823
24963
|
"\xB7 # tell agent something to remember forever"
|
|
24824
|
-
))), /* @__PURE__ */ React97.createElement(
|
|
24964
|
+
))), /* @__PURE__ */ React97.createElement(Box73, { justifyContent: "flex-end" }, /* @__PURE__ */ React97.createElement(Text78, { dimColor: true, wrap: "truncate-end" }, statusLine ? `${statusLine} \xB7 ESC to interrupt \xB7 2\xD7ESC for undo` : "ESC to interrupt \xB7 2\xD7ESC for undo"))), !exitMessage.show && !message.show && !modelSwitchMessage.show && !rewindMessagePending && /* @__PURE__ */ React97.createElement(Box73, { flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React97.createElement(Box73, { justifyContent: "flex-start", gap: 1 }, /* @__PURE__ */ React97.createElement(Text78, { dimColor: true, wrap: "truncate-end" }, "option+enter: newline \xB7", " ", showQuickModelSwitchShortcut ? "option+m: switch model \xB7 " : "", "option+g: external editor \xB7 ", modeCycleShortcut.displayText, ": switch mode")), /* @__PURE__ */ React97.createElement(
|
|
24825
24965
|
SentryErrorBoundary,
|
|
24826
24966
|
{
|
|
24827
|
-
children: /* @__PURE__ */ React97.createElement(
|
|
24967
|
+
children: /* @__PURE__ */ React97.createElement(Box73, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage }))
|
|
24828
24968
|
}
|
|
24829
24969
|
))), suggestions.length > 0 && /* @__PURE__ */ React97.createElement(
|
|
24830
|
-
|
|
24970
|
+
Box73,
|
|
24831
24971
|
{
|
|
24832
24972
|
flexDirection: "row",
|
|
24833
24973
|
justifyContent: "space-between",
|
|
24834
24974
|
paddingX: 2,
|
|
24835
24975
|
paddingY: 0
|
|
24836
24976
|
},
|
|
24837
|
-
/* @__PURE__ */ React97.createElement(
|
|
24838
|
-
|
|
24977
|
+
/* @__PURE__ */ React97.createElement(Box73, { flexDirection: "column" }, renderedSuggestions, /* @__PURE__ */ React97.createElement(
|
|
24978
|
+
Box73,
|
|
24839
24979
|
{
|
|
24840
24980
|
marginTop: 1,
|
|
24841
24981
|
paddingX: 3,
|
|
@@ -24843,7 +24983,7 @@ function PromptInput({
|
|
|
24843
24983
|
borderColor: "gray"
|
|
24844
24984
|
},
|
|
24845
24985
|
/* @__PURE__ */ React97.createElement(
|
|
24846
|
-
|
|
24986
|
+
Text78,
|
|
24847
24987
|
{
|
|
24848
24988
|
dimColor: !emptyDirMessage,
|
|
24849
24989
|
color: emptyDirMessage ? "yellow" : void 0
|
|
@@ -24866,7 +25006,7 @@ function PromptInput({
|
|
|
24866
25006
|
/* @__PURE__ */ React97.createElement(
|
|
24867
25007
|
SentryErrorBoundary,
|
|
24868
25008
|
{
|
|
24869
|
-
children: /* @__PURE__ */ React97.createElement(
|
|
25009
|
+
children: /* @__PURE__ */ React97.createElement(Box73, { justifyContent: "flex-end", gap: 1 }, /* @__PURE__ */ React97.createElement(TokenWarning, { tokenUsage: countTokens(messages) }))
|
|
24870
25010
|
}
|
|
24871
25011
|
)
|
|
24872
25012
|
));
|
|
@@ -25284,6 +25424,195 @@ As you answer the user's questions, you can use the following context:
|
|
|
25284
25424
|
return { systemPrompt: enhancedPrompt, reminders };
|
|
25285
25425
|
}
|
|
25286
25426
|
|
|
25427
|
+
// src/services/system/taskWatcher.ts
|
|
25428
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync5, statSync as statSync12, watch } from "fs";
|
|
25429
|
+
var getPollIntervalMs = () => Number(process.env.PYB_TASK_WATCHER_POLL_INTERVAL_MS ?? 1e3);
|
|
25430
|
+
var taskWatchers = /* @__PURE__ */ new Map();
|
|
25431
|
+
function ensureDirs(paths) {
|
|
25432
|
+
mkdirSync5(paths.tasksDir, { recursive: true });
|
|
25433
|
+
}
|
|
25434
|
+
function getLatestMtime(dir) {
|
|
25435
|
+
try {
|
|
25436
|
+
if (!existsSync13(dir)) return 0;
|
|
25437
|
+
const entries = statSync12(dir);
|
|
25438
|
+
if (!entries.isDirectory()) return 0;
|
|
25439
|
+
return entries.mtimeMs;
|
|
25440
|
+
} catch {
|
|
25441
|
+
return 0;
|
|
25442
|
+
}
|
|
25443
|
+
}
|
|
25444
|
+
function getFingerprint(paths) {
|
|
25445
|
+
const indexMtime = existsSync13(paths.indexPath) ? statSync12(paths.indexPath).mtimeMs : 0;
|
|
25446
|
+
const listMtime = getLatestMtime(paths.listDir);
|
|
25447
|
+
const tasksMtime = getLatestMtime(paths.tasksDir);
|
|
25448
|
+
return `${indexMtime}-${listMtime}-${tasksMtime}`;
|
|
25449
|
+
}
|
|
25450
|
+
function getEventOffset(paths) {
|
|
25451
|
+
if (!existsSync13(paths.eventsPath)) return 0;
|
|
25452
|
+
return statSync12(paths.eventsPath).size;
|
|
25453
|
+
}
|
|
25454
|
+
function buildReadySet(listId) {
|
|
25455
|
+
const tasks = listTasks({ listId });
|
|
25456
|
+
const readyBlocked = calculateReadyBlocked(tasks);
|
|
25457
|
+
return new Set(readyBlocked.ready.map((task) => task.id));
|
|
25458
|
+
}
|
|
25459
|
+
function readySetChanged(next, prev) {
|
|
25460
|
+
if (next.size !== prev.size) return true;
|
|
25461
|
+
for (const id of next) {
|
|
25462
|
+
if (!prev.has(id)) return true;
|
|
25463
|
+
}
|
|
25464
|
+
return false;
|
|
25465
|
+
}
|
|
25466
|
+
function emitListChanged(listId) {
|
|
25467
|
+
const tasks = listTasks({ listId });
|
|
25468
|
+
const readyBlocked = calculateReadyBlocked(tasks);
|
|
25469
|
+
emitReminderEvent("task:list_changed", {
|
|
25470
|
+
listId,
|
|
25471
|
+
timestamp: Date.now(),
|
|
25472
|
+
summary: {
|
|
25473
|
+
total: tasks.length,
|
|
25474
|
+
ready: readyBlocked.ready.length,
|
|
25475
|
+
blocked: readyBlocked.blocked.length,
|
|
25476
|
+
done: tasks.filter((task) => task.status === "done").length,
|
|
25477
|
+
inProgress: tasks.filter((task) => task.status === "in_progress").length,
|
|
25478
|
+
open: tasks.filter((task) => task.status === "open").length,
|
|
25479
|
+
archived: tasks.filter((task) => task.status === "archived").length
|
|
25480
|
+
}
|
|
25481
|
+
});
|
|
25482
|
+
return readyBlocked.ready;
|
|
25483
|
+
}
|
|
25484
|
+
function refreshSignals(entry) {
|
|
25485
|
+
const readyTasks = emitListChanged(entry.listId);
|
|
25486
|
+
const nextReadyIds = new Set(readyTasks.map((task) => task.id));
|
|
25487
|
+
if (readySetChanged(nextReadyIds, entry.lastReadyIds)) {
|
|
25488
|
+
emitReminderEvent("task:ready_changed", {
|
|
25489
|
+
listId: entry.listId,
|
|
25490
|
+
timestamp: Date.now(),
|
|
25491
|
+
readyIds: Array.from(nextReadyIds)
|
|
25492
|
+
});
|
|
25493
|
+
entry.lastReadyIds = nextReadyIds;
|
|
25494
|
+
}
|
|
25495
|
+
}
|
|
25496
|
+
function handleChange(entry) {
|
|
25497
|
+
try {
|
|
25498
|
+
const paths = getTaskListPaths(entry.listId);
|
|
25499
|
+
const fingerprint = getFingerprint(paths);
|
|
25500
|
+
if (fingerprint === entry.lastFingerprint) return;
|
|
25501
|
+
entry.lastFingerprint = fingerprint;
|
|
25502
|
+
refreshSignals(entry);
|
|
25503
|
+
} catch (error) {
|
|
25504
|
+
logError(error);
|
|
25505
|
+
debug.warn("TASK_WATCHER_HANDLE_CHANGE_FAILED", {
|
|
25506
|
+
listId: entry.listId,
|
|
25507
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25508
|
+
});
|
|
25509
|
+
}
|
|
25510
|
+
}
|
|
25511
|
+
function startPolling(entry, intervalMs) {
|
|
25512
|
+
entry.pollingTimer = setInterval(() => handleChange(entry), intervalMs);
|
|
25513
|
+
}
|
|
25514
|
+
function stopFallbackWatcher(entry) {
|
|
25515
|
+
if (entry.watcher) {
|
|
25516
|
+
entry.watcher.close();
|
|
25517
|
+
entry.watcher = void 0;
|
|
25518
|
+
}
|
|
25519
|
+
if (entry.pollingTimer) {
|
|
25520
|
+
clearInterval(entry.pollingTimer);
|
|
25521
|
+
entry.pollingTimer = void 0;
|
|
25522
|
+
}
|
|
25523
|
+
}
|
|
25524
|
+
function startFallbackWatcher(entry) {
|
|
25525
|
+
if (entry.watcher || entry.pollingTimer) return;
|
|
25526
|
+
const forcePolling = process.env.PYB_TASK_WATCHER_POLLING === "1";
|
|
25527
|
+
if (forcePolling) {
|
|
25528
|
+
startPolling(entry, getPollIntervalMs());
|
|
25529
|
+
return;
|
|
25530
|
+
}
|
|
25531
|
+
try {
|
|
25532
|
+
entry.watcher = watch(
|
|
25533
|
+
entry.listDir,
|
|
25534
|
+
{ recursive: true },
|
|
25535
|
+
() => handleChange(entry)
|
|
25536
|
+
);
|
|
25537
|
+
} catch (error) {
|
|
25538
|
+
debug.warn("TASK_WATCHER_WATCH_FAILED", {
|
|
25539
|
+
listId: entry.listId,
|
|
25540
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25541
|
+
});
|
|
25542
|
+
startPolling(entry, getPollIntervalMs());
|
|
25543
|
+
}
|
|
25544
|
+
}
|
|
25545
|
+
function handleEventStream(entry) {
|
|
25546
|
+
try {
|
|
25547
|
+
const { events, nextOffset } = readTaskEventLog(
|
|
25548
|
+
entry.listId,
|
|
25549
|
+
entry.lastEventOffset
|
|
25550
|
+
);
|
|
25551
|
+
if (nextOffset !== entry.lastEventOffset) {
|
|
25552
|
+
entry.lastEventOffset = nextOffset;
|
|
25553
|
+
}
|
|
25554
|
+
if (events.length === 0) return;
|
|
25555
|
+
refreshSignals(entry);
|
|
25556
|
+
} catch (error) {
|
|
25557
|
+
logError(error);
|
|
25558
|
+
debug.warn("TASK_WATCHER_EVENT_STREAM_FAILED", {
|
|
25559
|
+
listId: entry.listId,
|
|
25560
|
+
error: error instanceof Error ? error.message : String(error)
|
|
25561
|
+
});
|
|
25562
|
+
if (entry.eventPollingTimer) {
|
|
25563
|
+
clearInterval(entry.eventPollingTimer);
|
|
25564
|
+
entry.eventPollingTimer = void 0;
|
|
25565
|
+
}
|
|
25566
|
+
startFallbackWatcher(entry);
|
|
25567
|
+
startEventSwitchPolling(entry);
|
|
25568
|
+
}
|
|
25569
|
+
}
|
|
25570
|
+
function startEventStreamPolling(entry, intervalMs) {
|
|
25571
|
+
entry.eventPollingTimer = setInterval(
|
|
25572
|
+
() => handleEventStream(entry),
|
|
25573
|
+
intervalMs
|
|
25574
|
+
);
|
|
25575
|
+
}
|
|
25576
|
+
function switchToEventStream(entry) {
|
|
25577
|
+
if (entry.eventPollingTimer) return;
|
|
25578
|
+
stopFallbackWatcher(entry);
|
|
25579
|
+
entry.lastEventOffset = 0;
|
|
25580
|
+
startEventStreamPolling(entry, getPollIntervalMs());
|
|
25581
|
+
if (entry.eventSwitchTimer) {
|
|
25582
|
+
clearInterval(entry.eventSwitchTimer);
|
|
25583
|
+
entry.eventSwitchTimer = void 0;
|
|
25584
|
+
}
|
|
25585
|
+
}
|
|
25586
|
+
function startEventSwitchPolling(entry) {
|
|
25587
|
+
if (entry.eventSwitchTimer) return;
|
|
25588
|
+
entry.eventSwitchTimer = setInterval(() => {
|
|
25589
|
+
if (!existsSync13(entry.eventsPath)) return;
|
|
25590
|
+
switchToEventStream(entry);
|
|
25591
|
+
}, getPollIntervalMs());
|
|
25592
|
+
}
|
|
25593
|
+
function startWatchingTaskList(listId) {
|
|
25594
|
+
const paths = getTaskListPaths(listId);
|
|
25595
|
+
if (taskWatchers.has(paths.listId)) return;
|
|
25596
|
+
ensureDirs(paths);
|
|
25597
|
+
const entry = {
|
|
25598
|
+
listId: paths.listId,
|
|
25599
|
+
listDir: paths.listDir,
|
|
25600
|
+
tasksDir: paths.tasksDir,
|
|
25601
|
+
indexPath: paths.indexPath,
|
|
25602
|
+
eventsPath: paths.eventsPath,
|
|
25603
|
+
lastFingerprint: getFingerprint(paths),
|
|
25604
|
+
lastReadyIds: buildReadySet(paths.listId),
|
|
25605
|
+
lastEventOffset: getEventOffset(paths)
|
|
25606
|
+
};
|
|
25607
|
+
taskWatchers.set(paths.listId, entry);
|
|
25608
|
+
if (existsSync13(paths.eventsPath)) {
|
|
25609
|
+
startEventStreamPolling(entry, getPollIntervalMs());
|
|
25610
|
+
return;
|
|
25611
|
+
}
|
|
25612
|
+
startFallbackWatcher(entry);
|
|
25613
|
+
startEventSwitchPolling(entry);
|
|
25614
|
+
}
|
|
25615
|
+
|
|
25287
25616
|
// src/utils/session/fileRecoveryCore.ts
|
|
25288
25617
|
var MAX_FILES_TO_RECOVER = 5;
|
|
25289
25618
|
var MAX_TOKENS_PER_FILE = 1e4;
|
|
@@ -25931,6 +26260,9 @@ async function* queryCore(messages, systemPrompt, context, canUseTool, toolUseCo
|
|
|
25931
26260
|
messages: messages.length,
|
|
25932
26261
|
timestamp: Date.now()
|
|
25933
26262
|
});
|
|
26263
|
+
if (!toolUseContext.agentId || toolUseContext.agentId === "main") {
|
|
26264
|
+
startWatchingTaskList();
|
|
26265
|
+
}
|
|
25934
26266
|
if (reminders && messages.length > 0) {
|
|
25935
26267
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
25936
26268
|
const msg = messages[i];
|
|
@@ -26459,13 +26791,13 @@ import { default as React101, useCallback as useCallback15 } from "react";
|
|
|
26459
26791
|
|
|
26460
26792
|
// src/ui/components/binary-feedback/BinaryFeedbackView.tsx
|
|
26461
26793
|
import chalk14 from "chalk";
|
|
26462
|
-
import { Box as
|
|
26794
|
+
import { Box as Box75, Text as Text79, useInput as useInput30 } from "ink";
|
|
26463
26795
|
import Link2 from "ink-link";
|
|
26464
26796
|
import React100, { useState as useState26 } from "react";
|
|
26465
26797
|
|
|
26466
26798
|
// src/ui/components/binary-feedback/BinaryFeedbackOption.tsx
|
|
26467
26799
|
import * as React99 from "react";
|
|
26468
|
-
import { Box as
|
|
26800
|
+
import { Box as Box74 } from "ink";
|
|
26469
26801
|
function BinaryFeedbackOption({
|
|
26470
26802
|
debug: debug2,
|
|
26471
26803
|
erroredToolUseIDs,
|
|
@@ -26477,7 +26809,7 @@ function BinaryFeedbackOption({
|
|
|
26477
26809
|
verbose
|
|
26478
26810
|
}) {
|
|
26479
26811
|
const { columns } = useTerminalSize();
|
|
26480
|
-
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */ React99.createElement(
|
|
26812
|
+
return normalizeMessages([message]).filter((_) => _.type !== "progress").map((_, index) => /* @__PURE__ */ React99.createElement(Box74, { flexDirection: "column", key: index }, /* @__PURE__ */ React99.createElement(
|
|
26481
26813
|
Message,
|
|
26482
26814
|
{
|
|
26483
26815
|
addMargin: false,
|
|
@@ -26607,7 +26939,7 @@ function BinaryFeedbackView({
|
|
|
26607
26939
|
}
|
|
26608
26940
|
});
|
|
26609
26941
|
return /* @__PURE__ */ React100.createElement(React100.Fragment, null, /* @__PURE__ */ React100.createElement(
|
|
26610
|
-
|
|
26942
|
+
Box75,
|
|
26611
26943
|
{
|
|
26612
26944
|
flexDirection: "column",
|
|
26613
26945
|
height: "100%",
|
|
@@ -26615,9 +26947,9 @@ function BinaryFeedbackView({
|
|
|
26615
26947
|
borderStyle: "round",
|
|
26616
26948
|
borderColor: theme.permission
|
|
26617
26949
|
},
|
|
26618
|
-
/* @__PURE__ */ React100.createElement(
|
|
26619
|
-
/* @__PURE__ */ React100.createElement(
|
|
26620
|
-
|
|
26950
|
+
/* @__PURE__ */ React100.createElement(Box75, { width: "100%", justifyContent: "space-between", paddingX: 1 }, /* @__PURE__ */ React100.createElement(Text79, { bold: true, color: theme.permission }, "[ANT-ONLY] Help train ", PRODUCT_NAME), /* @__PURE__ */ React100.createElement(Text79, null, /* @__PURE__ */ React100.createElement(Link2, { url: HELP_URL }, "[?]"))),
|
|
26951
|
+
/* @__PURE__ */ React100.createElement(Box75, { flexDirection: "row", width: "100%", flexGrow: 1, paddingTop: 1 }, /* @__PURE__ */ React100.createElement(
|
|
26952
|
+
Box75,
|
|
26621
26953
|
{
|
|
26622
26954
|
flexDirection: "column",
|
|
26623
26955
|
flexGrow: 1,
|
|
@@ -26642,7 +26974,7 @@ function BinaryFeedbackView({
|
|
|
26642
26974
|
}
|
|
26643
26975
|
)
|
|
26644
26976
|
), /* @__PURE__ */ React100.createElement(
|
|
26645
|
-
|
|
26977
|
+
Box75,
|
|
26646
26978
|
{
|
|
26647
26979
|
flexDirection: "column",
|
|
26648
26980
|
flexGrow: 1,
|
|
@@ -26667,7 +26999,7 @@ function BinaryFeedbackView({
|
|
|
26667
26999
|
}
|
|
26668
27000
|
)
|
|
26669
27001
|
)),
|
|
26670
|
-
/* @__PURE__ */ React100.createElement(
|
|
27002
|
+
/* @__PURE__ */ React100.createElement(Box75, { flexDirection: "column", paddingTop: 1, paddingX: 1 }, /* @__PURE__ */ React100.createElement(Text79, null, "How do you want to proceed?"), /* @__PURE__ */ React100.createElement(
|
|
26671
27003
|
Select,
|
|
26672
27004
|
{
|
|
26673
27005
|
options: getOptions2(),
|
|
@@ -26676,7 +27008,7 @@ function BinaryFeedbackView({
|
|
|
26676
27008
|
onChange: onChoose
|
|
26677
27009
|
}
|
|
26678
27010
|
))
|
|
26679
|
-
), exitState.pending ? /* @__PURE__ */ React100.createElement(
|
|
27011
|
+
), exitState.pending ? /* @__PURE__ */ React100.createElement(Box75, { marginLeft: 3 }, /* @__PURE__ */ React100.createElement(Text79, { dimColor: true }, "Press ", exitState.keyName, " again to exit")) : /* @__PURE__ */ React100.createElement(Text79, null, " "));
|
|
26680
27012
|
}
|
|
26681
27013
|
|
|
26682
27014
|
// src/ui/components/binary-feedback/BinaryFeedback.tsx
|
|
@@ -27153,7 +27485,7 @@ function REPL({
|
|
|
27153
27485
|
if (debug2) {
|
|
27154
27486
|
return {
|
|
27155
27487
|
jsx: /* @__PURE__ */ React102.createElement(
|
|
27156
|
-
|
|
27488
|
+
Box76,
|
|
27157
27489
|
{
|
|
27158
27490
|
borderStyle: "single",
|
|
27159
27491
|
borderColor: isInStaticPrefix ? "green" : "red",
|
|
@@ -27165,7 +27497,7 @@ function REPL({
|
|
|
27165
27497
|
};
|
|
27166
27498
|
}
|
|
27167
27499
|
return {
|
|
27168
|
-
jsx: /* @__PURE__ */ React102.createElement(
|
|
27500
|
+
jsx: /* @__PURE__ */ React102.createElement(Box76, { key: _.uuid, width: "100%" }, message)
|
|
27169
27501
|
};
|
|
27170
27502
|
});
|
|
27171
27503
|
}, [
|
|
@@ -27188,7 +27520,7 @@ function REPL({
|
|
|
27188
27520
|
const staticItems = useMemo25(
|
|
27189
27521
|
() => [
|
|
27190
27522
|
{
|
|
27191
|
-
jsx: /* @__PURE__ */ React102.createElement(
|
|
27523
|
+
jsx: /* @__PURE__ */ React102.createElement(Box76, { flexDirection: "column", key: `logo${forkNumber}` }, /* @__PURE__ */ React102.createElement(
|
|
27192
27524
|
Logo,
|
|
27193
27525
|
{
|
|
27194
27526
|
mcpClients,
|
|
@@ -27223,7 +27555,7 @@ function REPL({
|
|
|
27223
27555
|
isBypassPermissionsModeAvailable: !safeMode
|
|
27224
27556
|
},
|
|
27225
27557
|
/* @__PURE__ */ React102.createElement(React102.Fragment, null, /* @__PURE__ */ React102.createElement(React102.Fragment, { key: `static-messages-${forkNumber}` }, /* @__PURE__ */ React102.createElement(Static2, { items: staticItems, children: (item) => item.jsx })), transientItems.map((_) => _.jsx), /* @__PURE__ */ React102.createElement(
|
|
27226
|
-
|
|
27558
|
+
Box76,
|
|
27227
27559
|
{
|
|
27228
27560
|
borderColor: "red",
|
|
27229
27561
|
borderStyle: debug2 ? "single" : void 0,
|
|
@@ -27334,7 +27666,7 @@ function REPL({
|
|
|
27334
27666
|
|
|
27335
27667
|
// src/ui/components/SessionSelector.tsx
|
|
27336
27668
|
import React103 from "react";
|
|
27337
|
-
import { Box as
|
|
27669
|
+
import { Box as Box77, Text as Text81 } from "ink";
|
|
27338
27670
|
function SessionSelector({
|
|
27339
27671
|
sessions,
|
|
27340
27672
|
onSelect
|
|
@@ -27362,14 +27694,14 @@ function SessionSelector({
|
|
|
27362
27694
|
const truncated = labelTxt.length > columns - 2 ? `${labelTxt.slice(0, columns - 5)}...` : labelTxt;
|
|
27363
27695
|
return { label: truncated, value: String(i) };
|
|
27364
27696
|
});
|
|
27365
|
-
return /* @__PURE__ */ React103.createElement(
|
|
27697
|
+
return /* @__PURE__ */ React103.createElement(Box77, { flexDirection: "column", height: "100%", width: "100%" }, /* @__PURE__ */ React103.createElement(Box77, { paddingLeft: 9 }, /* @__PURE__ */ React103.createElement(Text81, { bold: true, color: getTheme().text }, "Modified"), /* @__PURE__ */ React103.createElement(Text81, null, " "), /* @__PURE__ */ React103.createElement(Text81, { bold: true, color: getTheme().text }, "Created"), /* @__PURE__ */ React103.createElement(Text81, null, " "), /* @__PURE__ */ React103.createElement(Text81, { bold: true, color: getTheme().text }, "Tag"), /* @__PURE__ */ React103.createElement(Text81, null, " "), /* @__PURE__ */ React103.createElement(Text81, { bold: true, color: getTheme().text }, "Session")), /* @__PURE__ */ React103.createElement(
|
|
27366
27698
|
Select,
|
|
27367
27699
|
{
|
|
27368
27700
|
options,
|
|
27369
27701
|
onChange: (value) => onSelect(parseInt(value, 10)),
|
|
27370
27702
|
visibleOptionCount: visibleCount
|
|
27371
27703
|
}
|
|
27372
|
-
), hiddenCount > 0 && /* @__PURE__ */ React103.createElement(
|
|
27704
|
+
), hiddenCount > 0 && /* @__PURE__ */ React103.createElement(Box77, { paddingLeft: 2 }, /* @__PURE__ */ React103.createElement(Text81, { color: getTheme().secondaryText }, "and ", hiddenCount, " more\u2026")));
|
|
27373
27705
|
}
|
|
27374
27706
|
|
|
27375
27707
|
// src/ui/screens/ResumeConversation.tsx
|
|
@@ -27477,7 +27809,7 @@ import React107 from "react";
|
|
|
27477
27809
|
|
|
27478
27810
|
// src/commands/agents/ui.tsx
|
|
27479
27811
|
import React106, { useCallback as useCallback17, useEffect as useEffect26, useMemo as useMemo26, useRef as useRef14, useState as useState28 } from "react";
|
|
27480
|
-
import { Box as
|
|
27812
|
+
import { Box as Box78, Text as Text82, useInput as useInput31 } from "ink";
|
|
27481
27813
|
import figures9 from "figures";
|
|
27482
27814
|
import chalk15 from "chalk";
|
|
27483
27815
|
import { join as join12 } from "path";
|
|
@@ -27519,8 +27851,8 @@ async function getAvailableTools() {
|
|
|
27519
27851
|
|
|
27520
27852
|
// src/commands/agents/storage.ts
|
|
27521
27853
|
import {
|
|
27522
|
-
existsSync as
|
|
27523
|
-
mkdirSync as
|
|
27854
|
+
existsSync as existsSync14,
|
|
27855
|
+
mkdirSync as mkdirSync6,
|
|
27524
27856
|
renameSync as renameSync2,
|
|
27525
27857
|
unlinkSync as unlinkSync2,
|
|
27526
27858
|
writeFileSync as writeFileSync6
|
|
@@ -27531,7 +27863,7 @@ import { homedir as homedir7 } from "os";
|
|
|
27531
27863
|
// src/commands/agents/generation.ts
|
|
27532
27864
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
27533
27865
|
async function generateAgentWithClaude(prompt) {
|
|
27534
|
-
const { queryModel } = await import("./llm-
|
|
27866
|
+
const { queryModel } = await import("./llm-3KCTIVOM.js");
|
|
27535
27867
|
const systemPrompt = `You are an expert at creating AI agent configurations. Based on the user's description, generate a specialized agent configuration.
|
|
27536
27868
|
|
|
27537
27869
|
Return your response as a JSON object with exactly these fields:
|
|
@@ -27733,8 +28065,8 @@ function getLegacyAgentFilePath(location, agentType) {
|
|
|
27733
28065
|
}
|
|
27734
28066
|
function ensureDirectoryExists(location) {
|
|
27735
28067
|
const dir = getAgentDirectory(location);
|
|
27736
|
-
if (!
|
|
27737
|
-
|
|
28068
|
+
if (!existsSync14(dir)) {
|
|
28069
|
+
mkdirSync6(dir, { recursive: true });
|
|
27738
28070
|
}
|
|
27739
28071
|
return dir;
|
|
27740
28072
|
}
|
|
@@ -27742,7 +28074,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
|
|
|
27742
28074
|
ensureDirectoryExists(location);
|
|
27743
28075
|
const filePath = getPrimaryAgentFilePath(location, agentType);
|
|
27744
28076
|
const legacyPath = getLegacyAgentFilePath(location, agentType);
|
|
27745
|
-
if (throwIfExists && (
|
|
28077
|
+
if (throwIfExists && (existsSync14(filePath) || existsSync14(legacyPath))) {
|
|
27746
28078
|
throw new Error(`Agent file already exists: ${filePath}`);
|
|
27747
28079
|
}
|
|
27748
28080
|
const tempFile = `${filePath}.tmp.${Date.now()}.${Math.random().toString(36).substr(2, 9)}`;
|
|
@@ -27757,7 +28089,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
|
|
|
27757
28089
|
);
|
|
27758
28090
|
try {
|
|
27759
28091
|
writeFileSync6(tempFile, content, { encoding: "utf-8", flag: "wx" });
|
|
27760
|
-
if (throwIfExists && (
|
|
28092
|
+
if (throwIfExists && (existsSync14(filePath) || existsSync14(legacyPath))) {
|
|
27761
28093
|
try {
|
|
27762
28094
|
unlinkSync2(tempFile);
|
|
27763
28095
|
} catch {
|
|
@@ -27767,7 +28099,7 @@ async function saveAgent(location, agentType, description3, tools, systemPrompt,
|
|
|
27767
28099
|
renameSync2(tempFile, filePath);
|
|
27768
28100
|
} catch (error) {
|
|
27769
28101
|
try {
|
|
27770
|
-
if (
|
|
28102
|
+
if (existsSync14(tempFile)) {
|
|
27771
28103
|
unlinkSync2(tempFile);
|
|
27772
28104
|
}
|
|
27773
28105
|
} catch (cleanupError) {
|
|
@@ -27795,7 +28127,7 @@ async function updateAgent(agent, description3, tools, systemPrompt, color, mode
|
|
|
27795
28127
|
const location = agent.location;
|
|
27796
28128
|
const primaryPath = getPrimaryAgentFilePath(location, agent.agentType);
|
|
27797
28129
|
const legacyPath = getLegacyAgentFilePath(location, agent.agentType);
|
|
27798
|
-
const filePath =
|
|
28130
|
+
const filePath = existsSync14(primaryPath) ? primaryPath : existsSync14(legacyPath) ? legacyPath : primaryPath;
|
|
27799
28131
|
ensureDirectoryExists(location);
|
|
27800
28132
|
writeFileSync6(filePath, content, { encoding: "utf-8", flag: "w" });
|
|
27801
28133
|
}
|
|
@@ -27806,10 +28138,10 @@ async function deleteAgent(agent) {
|
|
|
27806
28138
|
const location = agent.location;
|
|
27807
28139
|
const primaryPath = getPrimaryAgentFilePath(location, agent.agentType);
|
|
27808
28140
|
const legacyPath = getLegacyAgentFilePath(location, agent.agentType);
|
|
27809
|
-
if (
|
|
28141
|
+
if (existsSync14(primaryPath)) {
|
|
27810
28142
|
unlinkSync2(primaryPath);
|
|
27811
28143
|
}
|
|
27812
|
-
if (
|
|
28144
|
+
if (existsSync14(legacyPath)) {
|
|
27813
28145
|
unlinkSync2(legacyPath);
|
|
27814
28146
|
}
|
|
27815
28147
|
}
|
|
@@ -27914,20 +28246,20 @@ function panelBorderColor(kind) {
|
|
|
27914
28246
|
function Panel(props) {
|
|
27915
28247
|
const theme = getTheme();
|
|
27916
28248
|
return /* @__PURE__ */ React106.createElement(
|
|
27917
|
-
|
|
28249
|
+
Box78,
|
|
27918
28250
|
{
|
|
27919
28251
|
borderStyle: "round",
|
|
27920
28252
|
borderColor: props.borderColor ?? theme.suggestion,
|
|
27921
28253
|
flexDirection: "column"
|
|
27922
28254
|
},
|
|
27923
|
-
/* @__PURE__ */ React106.createElement(
|
|
27924
|
-
/* @__PURE__ */ React106.createElement(
|
|
28255
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", paddingX: 1 }, /* @__PURE__ */ React106.createElement(Text82, { bold: true, color: props.titleColor ?? theme.text }, props.title), props.subtitle ? /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, props.subtitle) : null),
|
|
28256
|
+
/* @__PURE__ */ React106.createElement(Box78, { paddingX: 1, flexDirection: "column" }, props.children)
|
|
27925
28257
|
);
|
|
27926
28258
|
}
|
|
27927
28259
|
function Instructions({
|
|
27928
28260
|
instructions = "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back"
|
|
27929
28261
|
}) {
|
|
27930
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28262
|
+
return /* @__PURE__ */ React106.createElement(Box78, { marginLeft: 3 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, instructions));
|
|
27931
28263
|
}
|
|
27932
28264
|
function computeOverrides(args) {
|
|
27933
28265
|
const activeByType = /* @__PURE__ */ new Map();
|
|
@@ -28006,29 +28338,29 @@ function AgentsListView(props) {
|
|
|
28006
28338
|
setSelectedAgent(nextAgent);
|
|
28007
28339
|
}
|
|
28008
28340
|
});
|
|
28009
|
-
const renderCreateNew = () => /* @__PURE__ */ React106.createElement(
|
|
28341
|
+
const renderCreateNew = () => /* @__PURE__ */ React106.createElement(Box78, null, /* @__PURE__ */ React106.createElement(Text82, { color: onCreateOption ? theme.suggestion : void 0 }, onCreateOption ? `${figures9.pointer} ` : " "), /* @__PURE__ */ React106.createElement(Text82, { color: onCreateOption ? theme.suggestion : void 0 }, "Create new agent"));
|
|
28010
28342
|
const renderAgentRow = (agent) => {
|
|
28011
28343
|
const isBuiltIn = agent.source === "built-in";
|
|
28012
28344
|
const isSelected = !isBuiltIn && !onCreateOption && selectedAgent?.agentType === agent.agentType && selectedAgent?.source === agent.source;
|
|
28013
28345
|
const dimmed = Boolean(isBuiltIn || agent.overriddenBy);
|
|
28014
28346
|
const rowColor = isSelected ? theme.suggestion : void 0;
|
|
28015
28347
|
const pointer = isBuiltIn ? "" : isSelected ? `${figures9.pointer} ` : " ";
|
|
28016
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28348
|
+
return /* @__PURE__ */ React106.createElement(Box78, { key: `${agent.agentType}-${agent.source}`, flexDirection: "row" }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: dimmed && !isSelected, color: rowColor }, pointer), /* @__PURE__ */ React106.createElement(Text82, { dimColor: dimmed && !isSelected, color: rowColor }, agent.agentType), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true, color: rowColor }, " \xB7 ", formatModelShort(agent.model)), agent.overriddenBy ? /* @__PURE__ */ React106.createElement(Text82, { dimColor: !isSelected, color: isSelected ? theme.warning : void 0 }, " ", figures9.warning, " overridden by ", agent.overriddenBy) : null);
|
|
28017
28349
|
};
|
|
28018
28350
|
const group = (label, agents) => {
|
|
28019
28351
|
if (agents.length === 0) return null;
|
|
28020
28352
|
const baseDir = agents[0]?.baseDir;
|
|
28021
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28353
|
+
return /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginBottom: 1 }, /* @__PURE__ */ React106.createElement(Box78, { paddingLeft: 2 }, /* @__PURE__ */ React106.createElement(Text82, { bold: true, dimColor: true }, label), baseDir ? /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, " ", "(", baseDir, ")") : null), agents.map(renderAgentRow));
|
|
28022
28354
|
};
|
|
28023
28355
|
const builtInSection = (label = "Built-in (always available):") => {
|
|
28024
28356
|
const builtIn = props.agents.filter((a) => a.source === "built-in");
|
|
28025
28357
|
if (builtIn.length === 0) return null;
|
|
28026
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28358
|
+
return /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginBottom: 1, paddingLeft: 2 }, /* @__PURE__ */ React106.createElement(Text82, { bold: true, dimColor: true }, label), builtIn.map(renderAgentRow));
|
|
28027
28359
|
};
|
|
28028
28360
|
const notOverriddenCount = props.agents.filter((a) => !a.overriddenBy).length;
|
|
28029
28361
|
const title = titleForSource(props.source);
|
|
28030
28362
|
if (props.agents.length === 0 || props.source !== "built-in" && !props.agents.some((a) => a.source !== "built-in")) {
|
|
28031
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title, subtitle: "No agents found" }, props.onCreateNew ? /* @__PURE__ */ React106.createElement(
|
|
28363
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title, subtitle: "No agents found" }, props.onCreateNew ? /* @__PURE__ */ React106.createElement(Box78, { marginY: 1 }, renderCreateNew()) : null, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "No agents found. Create specialized subagents that Claude can delegate to."), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Each subagent has its own context window, custom system prompt, and specific tools."), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer."), props.source !== "built-in" && props.agents.some((a) => a.source === "built-in") ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "\u2500".repeat(40))), builtInSection()) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
28032
28364
|
}
|
|
28033
28365
|
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
28034
28366
|
Panel,
|
|
@@ -28036,8 +28368,8 @@ function AgentsListView(props) {
|
|
|
28036
28368
|
title,
|
|
28037
28369
|
subtitle: `${notOverriddenCount} agents`
|
|
28038
28370
|
},
|
|
28039
|
-
props.changes.length > 0 ? /* @__PURE__ */ React106.createElement(
|
|
28040
|
-
/* @__PURE__ */ React106.createElement(
|
|
28371
|
+
props.changes.length > 0 ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, props.changes[props.changes.length - 1])) : null,
|
|
28372
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1 }, props.onCreateNew ? /* @__PURE__ */ React106.createElement(Box78, { marginBottom: 1 }, renderCreateNew()) : null, props.source === "all" ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, group(
|
|
28041
28373
|
"User agents",
|
|
28042
28374
|
props.agents.filter((a) => a.source === "userSettings")
|
|
28043
28375
|
), group(
|
|
@@ -28052,7 +28384,7 @@ function AgentsListView(props) {
|
|
|
28052
28384
|
), group(
|
|
28053
28385
|
"CLI arg agents",
|
|
28054
28386
|
props.agents.filter((a) => a.source === "flagSettings")
|
|
28055
|
-
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
28387
|
+
), builtInSection("Built-in agents (always available)")) : props.source === "built-in" ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true, italic: true }, "Built-in agents are provided by default and cannot be modified."), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, props.agents.map(renderAgentRow))) : /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column" }, props.agents.filter((a) => a.source !== "built-in").map(renderAgentRow)))
|
|
28056
28388
|
), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
28057
28389
|
}
|
|
28058
28390
|
function wizardLocationToStorageLocation(location) {
|
|
@@ -28153,7 +28485,7 @@ function StepChooseLocation({ ctx }) {
|
|
|
28153
28485
|
useInput31((_input, key) => {
|
|
28154
28486
|
if (key.escape) ctx.cancel();
|
|
28155
28487
|
});
|
|
28156
|
-
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose location", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to cancel" }, /* @__PURE__ */ React106.createElement(
|
|
28488
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose location", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to cancel" }, /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
28157
28489
|
Select,
|
|
28158
28490
|
{
|
|
28159
28491
|
options: [
|
|
@@ -28172,7 +28504,7 @@ function StepChooseMethod({ ctx }) {
|
|
|
28172
28504
|
useInput31((_input, key) => {
|
|
28173
28505
|
if (key.escape) ctx.goBack();
|
|
28174
28506
|
});
|
|
28175
|
-
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React106.createElement(
|
|
28507
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Creation method" }, /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
28176
28508
|
Select,
|
|
28177
28509
|
{
|
|
28178
28510
|
options: [
|
|
@@ -28256,7 +28588,7 @@ function StepGenerationPrompt(props) {
|
|
|
28256
28588
|
abortRef.current = null;
|
|
28257
28589
|
}
|
|
28258
28590
|
};
|
|
28259
|
-
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Describe the agent you want" }, /* @__PURE__ */ React106.createElement(
|
|
28591
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Describe the agent you want" }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, "What should this agent do?"), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Describe a role like \u201Ccode reviewer\u201D, \u201Csecurity auditor\u201D, or \u201Ctech lead\u201D."), /* @__PURE__ */ React106.createElement(
|
|
28260
28592
|
TextInput,
|
|
28261
28593
|
{
|
|
28262
28594
|
value,
|
|
@@ -28267,7 +28599,7 @@ function StepGenerationPrompt(props) {
|
|
|
28267
28599
|
cursorOffset,
|
|
28268
28600
|
onChangeCursorOffset: setCursorOffset
|
|
28269
28601
|
}
|
|
28270
|
-
), error ? /* @__PURE__ */ React106.createElement(
|
|
28602
|
+
), error ? /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error) : null, isGenerating ? /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Generating\u2026") : null));
|
|
28271
28603
|
}
|
|
28272
28604
|
function themeColor(kind) {
|
|
28273
28605
|
const theme = getTheme();
|
|
@@ -28309,7 +28641,7 @@ function StepAgentType(props) {
|
|
|
28309
28641
|
subtitle: "Agent type (identifier)",
|
|
28310
28642
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28311
28643
|
},
|
|
28312
|
-
/* @__PURE__ */ React106.createElement(
|
|
28644
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, "Enter a unique identifier for your agent:"), /* @__PURE__ */ React106.createElement(
|
|
28313
28645
|
TextInput,
|
|
28314
28646
|
{
|
|
28315
28647
|
value,
|
|
@@ -28319,7 +28651,7 @@ function StepAgentType(props) {
|
|
|
28319
28651
|
cursorOffset,
|
|
28320
28652
|
onChangeCursorOffset: setCursorOffset
|
|
28321
28653
|
}
|
|
28322
|
-
), /* @__PURE__ */ React106.createElement(
|
|
28654
|
+
), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "e.g., code-reviewer, tech-lead, etc"), error ? /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
28323
28655
|
);
|
|
28324
28656
|
}
|
|
28325
28657
|
function StepSystemPrompt({ ctx }) {
|
|
@@ -28346,7 +28678,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
28346
28678
|
subtitle: "System prompt",
|
|
28347
28679
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28348
28680
|
},
|
|
28349
|
-
/* @__PURE__ */ React106.createElement(
|
|
28681
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, "Enter the system prompt for your agent:"), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Be comprehensive for best results"), /* @__PURE__ */ React106.createElement(
|
|
28350
28682
|
TextInput,
|
|
28351
28683
|
{
|
|
28352
28684
|
value,
|
|
@@ -28357,7 +28689,7 @@ function StepSystemPrompt({ ctx }) {
|
|
|
28357
28689
|
cursorOffset,
|
|
28358
28690
|
onChangeCursorOffset: setCursorOffset
|
|
28359
28691
|
}
|
|
28360
|
-
), error ? /* @__PURE__ */ React106.createElement(
|
|
28692
|
+
), error ? /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
28361
28693
|
);
|
|
28362
28694
|
}
|
|
28363
28695
|
function StepDescription({ ctx }) {
|
|
@@ -28384,7 +28716,7 @@ function StepDescription({ ctx }) {
|
|
|
28384
28716
|
subtitle: "Description (tell Claude when to use this agent)",
|
|
28385
28717
|
footerText: "Press Enter to continue \xB7 Esc to go back"
|
|
28386
28718
|
},
|
|
28387
|
-
/* @__PURE__ */ React106.createElement(
|
|
28719
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, "When should Claude use this agent?"), /* @__PURE__ */ React106.createElement(
|
|
28388
28720
|
TextInput,
|
|
28389
28721
|
{
|
|
28390
28722
|
value,
|
|
@@ -28395,7 +28727,7 @@ function StepDescription({ ctx }) {
|
|
|
28395
28727
|
cursorOffset,
|
|
28396
28728
|
onChangeCursorOffset: setCursorOffset
|
|
28397
28729
|
}
|
|
28398
|
-
), error ? /* @__PURE__ */ React106.createElement(
|
|
28730
|
+
), error ? /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error) : null)
|
|
28399
28731
|
);
|
|
28400
28732
|
}
|
|
28401
28733
|
function ToolPicker(props) {
|
|
@@ -28554,12 +28886,12 @@ function ToolPicker(props) {
|
|
|
28554
28886
|
return;
|
|
28555
28887
|
}
|
|
28556
28888
|
});
|
|
28557
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28889
|
+
return /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: cursorIndex === 0 ? themeColor("suggestion") : void 0, bold: cursorIndex === 0 }, cursorIndex === 0 ? `${figures9.pointer} ` : " ", "[ Continue ]"), /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "\u2500".repeat(40)), items.slice(1).map((item, idx) => {
|
|
28558
28890
|
const index = idx + 1;
|
|
28559
28891
|
const focused = index === cursorIndex;
|
|
28560
28892
|
const prefix = item.isHeader ? "" : focused ? `${figures9.pointer} ` : " ";
|
|
28561
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React106.createElement(
|
|
28562
|
-
|
|
28893
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.id }, item.isToggle ? /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "\u2500".repeat(40)) : null, /* @__PURE__ */ React106.createElement(
|
|
28894
|
+
Text82,
|
|
28563
28895
|
{
|
|
28564
28896
|
dimColor: item.isHeader,
|
|
28565
28897
|
color: !item.isHeader && focused ? themeColor("suggestion") : void 0,
|
|
@@ -28567,7 +28899,7 @@ function ToolPicker(props) {
|
|
|
28567
28899
|
},
|
|
28568
28900
|
item.isToggle ? `${prefix}[ ${item.label} ]` : `${prefix}${item.label}`
|
|
28569
28901
|
));
|
|
28570
|
-
}), /* @__PURE__ */ React106.createElement(
|
|
28902
|
+
}), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, isAllSelected ? "All tools selected" : `${selectedSet.size} of ${allToolNames.length} tools selected`)));
|
|
28571
28903
|
}
|
|
28572
28904
|
function StepSelectTools(props) {
|
|
28573
28905
|
const { ctx } = props;
|
|
@@ -28591,7 +28923,7 @@ function StepSelectModel({ ctx }) {
|
|
|
28591
28923
|
});
|
|
28592
28924
|
const options = modelOptions();
|
|
28593
28925
|
const defaultValue = ctx.wizardData.selectedModel ?? DEFAULT_AGENT_MODEL;
|
|
28594
|
-
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Select model", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(
|
|
28926
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Select model", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React106.createElement(
|
|
28595
28927
|
Select,
|
|
28596
28928
|
{
|
|
28597
28929
|
options,
|
|
@@ -28612,12 +28944,12 @@ function ColorPicker(props) {
|
|
|
28612
28944
|
else if (key.downArrow) setIndex((i) => i < COLOR_OPTIONS.length - 1 ? i + 1 : 0);
|
|
28613
28945
|
else if (key.return) props.onConfirm(COLOR_OPTIONS[index] ?? "automatic");
|
|
28614
28946
|
});
|
|
28615
|
-
return /* @__PURE__ */ React106.createElement(
|
|
28947
|
+
return /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", gap: 1 }, COLOR_OPTIONS.map((color, i) => {
|
|
28616
28948
|
const focused = i === index;
|
|
28617
28949
|
const prefix = focused ? figures9.pointer : " ";
|
|
28618
28950
|
const label = color === "automatic" ? "Automatic color" : color.charAt(0).toUpperCase() + color.slice(1);
|
|
28619
28951
|
return /* @__PURE__ */ React106.createElement(React106.Fragment, { key: color }, /* @__PURE__ */ React106.createElement(
|
|
28620
|
-
|
|
28952
|
+
Text82,
|
|
28621
28953
|
{
|
|
28622
28954
|
color: focused ? themeColor("suggestion") : void 0,
|
|
28623
28955
|
bold: focused
|
|
@@ -28650,7 +28982,7 @@ function StepChooseColor({ ctx }) {
|
|
|
28650
28982
|
});
|
|
28651
28983
|
ctx.goNext();
|
|
28652
28984
|
};
|
|
28653
|
-
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose background color", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(
|
|
28985
|
+
return /* @__PURE__ */ React106.createElement(WizardPanel, { subtitle: "Choose background color", footerText: "Press \u2191\u2193 to navigate \xB7 Enter to select \xB7 Esc to go back" }, /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(ColorPicker, { agentName: agentType, currentColor: "automatic", onConfirm })));
|
|
28654
28986
|
}
|
|
28655
28987
|
function validateFinalAgent(args) {
|
|
28656
28988
|
const errors = [];
|
|
@@ -28721,7 +29053,7 @@ function StepConfirm(props) {
|
|
|
28721
29053
|
subtitle: "Confirm and save",
|
|
28722
29054
|
footerText: "Press s/Enter to save \xB7 e to edit in your editor \xB7 Esc to cancel"
|
|
28723
29055
|
},
|
|
28724
|
-
/* @__PURE__ */ React106.createElement(
|
|
29056
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1, gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Name"), ": ", finalAgent.agentType), /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Location"), ": ", locationPath), /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Tools"), ": ", toolSummary(finalAgent.tools)), /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Model"), ": ", formatModelLong(finalAgent.model)), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React106.createElement(Box78, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, truncate(finalAgent.whenToUse)))), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React106.createElement(Box78, { marginLeft: 2, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, truncate(finalAgent.systemPrompt)))), validation.warnings.length > 0 ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("warning") }, "Warnings:"), validation.warnings.map((w, i) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: i }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, " ", "\u2022 ", w)))) : null, validation.errors.length > 0 ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, "Errors:"), validation.errors.map((e, i) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: i }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, " ", "\u2022 ", e)))) : null, error ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error)) : null)
|
|
28725
29057
|
);
|
|
28726
29058
|
}
|
|
28727
29059
|
function CreateAgentWizard(props) {
|
|
@@ -28792,7 +29124,7 @@ function AgentMenu(props) {
|
|
|
28792
29124
|
],
|
|
28793
29125
|
{ label: "Back", value: "back" }
|
|
28794
29126
|
];
|
|
28795
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(
|
|
29127
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
28796
29128
|
Select,
|
|
28797
29129
|
{
|
|
28798
29130
|
options,
|
|
@@ -28834,9 +29166,9 @@ function ViewAgent(props) {
|
|
|
28834
29166
|
const toolsSummary = () => {
|
|
28835
29167
|
if (parsedTools.hasWildcard) return "All tools";
|
|
28836
29168
|
if (!props.agent.tools || props.agent.tools === "*" || props.agent.tools.length === 0) return "None";
|
|
28837
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, parsedTools.valid.length > 0 ? parsedTools.valid.join(", ") : null, parsedTools.invalid.length > 0 ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(
|
|
29169
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, parsedTools.valid.length > 0 ? parsedTools.valid.join(", ") : null, parsedTools.invalid.length > 0 ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("warning") }, " ", figures9.warning, " Unrecognized: ", parsedTools.invalid.join(", "))) : null);
|
|
28838
29170
|
};
|
|
28839
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(
|
|
29171
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: props.agent.agentType }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, sourceLine), /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Description"), " (tells Claude when to use this agent):"), /* @__PURE__ */ React106.createElement(Box78, { marginLeft: 2 }, /* @__PURE__ */ React106.createElement(Text82, null, props.agent.whenToUse))), /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Tools"), ": ", toolsSummary()), /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Model"), ": ", formatModelLong(props.agent.model)), props.agent.color ? /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "Color"), ": ", props.agent.color) : null, props.agent.systemPrompt ? /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Text82, null, /* @__PURE__ */ React106.createElement(Text82, { bold: true }, "System prompt"), ":"), /* @__PURE__ */ React106.createElement(Box78, { marginLeft: 2, marginRight: 2 }, /* @__PURE__ */ React106.createElement(Text82, null, props.agent.systemPrompt))) : null)), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter or Esc to go back" }));
|
|
28840
29172
|
}
|
|
28841
29173
|
function EditAgent(props) {
|
|
28842
29174
|
const [mode, setMode] = useState28("menu");
|
|
@@ -28913,10 +29245,10 @@ function EditAgent(props) {
|
|
|
28913
29245
|
},
|
|
28914
29246
|
onCancel: () => setMode("menu")
|
|
28915
29247
|
}
|
|
28916
|
-
), error ? /* @__PURE__ */ React106.createElement(
|
|
29248
|
+
), error ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, { instructions: "Press Enter to toggle selection \xB7 \u2191\u2193 Navigate \xB7 Esc to go back" }));
|
|
28917
29249
|
}
|
|
28918
29250
|
if (mode === "edit-model") {
|
|
28919
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(
|
|
29251
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", gap: 1, marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Model determines the agent's reasoning capabilities and speed."), /* @__PURE__ */ React106.createElement(
|
|
28920
29252
|
Select,
|
|
28921
29253
|
{
|
|
28922
29254
|
options: modelOptions(),
|
|
@@ -28926,10 +29258,10 @@ function EditAgent(props) {
|
|
|
28926
29258
|
setMode("menu");
|
|
28927
29259
|
}
|
|
28928
29260
|
}
|
|
28929
|
-
)), error ? /* @__PURE__ */ React106.createElement(
|
|
29261
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
28930
29262
|
}
|
|
28931
29263
|
if (mode === "edit-color") {
|
|
28932
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(
|
|
29264
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
28933
29265
|
ColorPicker,
|
|
28934
29266
|
{
|
|
28935
29267
|
agentName: props.agent.agentType,
|
|
@@ -28939,16 +29271,16 @@ function EditAgent(props) {
|
|
|
28939
29271
|
setMode("menu");
|
|
28940
29272
|
}
|
|
28941
29273
|
}
|
|
28942
|
-
)), error ? /* @__PURE__ */ React106.createElement(
|
|
29274
|
+
)), error ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error)) : null), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
28943
29275
|
}
|
|
28944
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(
|
|
28945
|
-
|
|
29276
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: `Edit agent: ${props.agent.agentType}` }, /* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column" }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Source: ", titleForSource(props.agent.source)), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1, flexDirection: "column" }, menuItems.map((item, idx) => /* @__PURE__ */ React106.createElement(React106.Fragment, { key: item.label }, /* @__PURE__ */ React106.createElement(
|
|
29277
|
+
Text82,
|
|
28946
29278
|
{
|
|
28947
29279
|
color: idx === selectedIndex ? themeColor("suggestion") : void 0
|
|
28948
29280
|
},
|
|
28949
29281
|
idx === selectedIndex ? `${figures9.pointer} ` : " ",
|
|
28950
29282
|
item.label
|
|
28951
|
-
)))), error ? /* @__PURE__ */ React106.createElement(
|
|
29283
|
+
)))), error ? /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { color: themeColor("error") }, error)) : null)), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
28952
29284
|
}
|
|
28953
29285
|
function DeleteConfirm(props) {
|
|
28954
29286
|
useInput31((_input, key) => {
|
|
@@ -28961,7 +29293,7 @@ function DeleteConfirm(props) {
|
|
|
28961
29293
|
borderColor: panelBorderColor("error"),
|
|
28962
29294
|
titleColor: themeColor("error")
|
|
28963
29295
|
},
|
|
28964
|
-
/* @__PURE__ */ React106.createElement(
|
|
29296
|
+
/* @__PURE__ */ React106.createElement(Box78, { flexDirection: "column", gap: 1 }, /* @__PURE__ */ React106.createElement(Text82, null, "Are you sure you want to delete the agent ", /* @__PURE__ */ React106.createElement(Text82, { bold: true }, props.agent.agentType), "?"), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Source: ", props.agent.source)), /* @__PURE__ */ React106.createElement(Box78, { marginTop: 1 }, /* @__PURE__ */ React106.createElement(
|
|
28965
29297
|
Select,
|
|
28966
29298
|
{
|
|
28967
29299
|
options: [
|
|
@@ -29045,7 +29377,7 @@ ${changes.join("\n")}`);
|
|
|
29045
29377
|
onExit("Agents dialog dismissed");
|
|
29046
29378
|
}, [changes, onExit]);
|
|
29047
29379
|
if (loading) {
|
|
29048
|
-
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Agents", subtitle: "Loading\u2026" }, /* @__PURE__ */ React106.createElement(
|
|
29380
|
+
return /* @__PURE__ */ React106.createElement(React106.Fragment, null, /* @__PURE__ */ React106.createElement(Panel, { title: "Agents", subtitle: "Loading\u2026" }, /* @__PURE__ */ React106.createElement(Text82, { dimColor: true }, "Loading agents\u2026")), /* @__PURE__ */ React106.createElement(Instructions, null));
|
|
29049
29381
|
}
|
|
29050
29382
|
if (mode.mode === "list-agents") {
|
|
29051
29383
|
return /* @__PURE__ */ React106.createElement(
|
|
@@ -29459,7 +29791,7 @@ function parseMcpToolName2(name3) {
|
|
|
29459
29791
|
}
|
|
29460
29792
|
|
|
29461
29793
|
// src/tools/system/KillShellTool/KillShellTool.tsx
|
|
29462
|
-
import { Box as
|
|
29794
|
+
import { Box as Box79, Text as Text83 } from "ink";
|
|
29463
29795
|
import React109 from "react";
|
|
29464
29796
|
import { z as z14 } from "zod";
|
|
29465
29797
|
|
|
@@ -29509,7 +29841,7 @@ var KillShellTool = {
|
|
|
29509
29841
|
return /* @__PURE__ */ React109.createElement(FallbackToolUseRejectedMessage, null);
|
|
29510
29842
|
},
|
|
29511
29843
|
renderToolResultMessage(output) {
|
|
29512
|
-
return /* @__PURE__ */ React109.createElement(
|
|
29844
|
+
return /* @__PURE__ */ React109.createElement(Box79, { flexDirection: "row" }, /* @__PURE__ */ React109.createElement(Text83, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React109.createElement(Text83, null, "Shell ", output.shell_id, " killed"));
|
|
29513
29845
|
},
|
|
29514
29846
|
renderResultForAssistant(output) {
|
|
29515
29847
|
return JSON.stringify(output);
|
|
@@ -29551,7 +29883,7 @@ var KillShellTool = {
|
|
|
29551
29883
|
|
|
29552
29884
|
// src/tools/interaction/TodoWriteTool/TodoWriteTool.tsx
|
|
29553
29885
|
import { Box as Box81, Text as Text85 } from "ink";
|
|
29554
|
-
import * as
|
|
29886
|
+
import * as React111 from "react";
|
|
29555
29887
|
import { randomUUID as randomUUID6 } from "crypto";
|
|
29556
29888
|
import { z as z15 } from "zod";
|
|
29557
29889
|
|
|
@@ -29771,6 +30103,41 @@ The assistant did not use the todo list because this is a single command executi
|
|
|
29771
30103
|
When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
|
|
29772
30104
|
`;
|
|
29773
30105
|
|
|
30106
|
+
// src/ui/components/TodoItem.tsx
|
|
30107
|
+
import React110 from "react";
|
|
30108
|
+
import { Box as Box80, Text as Text84 } from "ink";
|
|
30109
|
+
var TodoItem = ({ todo, children }) => {
|
|
30110
|
+
const statusIconMap = {
|
|
30111
|
+
completed: "\u2705",
|
|
30112
|
+
in_progress: "\u{1F504}",
|
|
30113
|
+
pending: "\u23F8\uFE0F"
|
|
30114
|
+
};
|
|
30115
|
+
const statusColorMap = {
|
|
30116
|
+
completed: void 0,
|
|
30117
|
+
// Use default color (will be dimmed)
|
|
30118
|
+
in_progress: "#FFA500",
|
|
30119
|
+
pending: "#FFD700"
|
|
30120
|
+
};
|
|
30121
|
+
const priorityIconMap = {
|
|
30122
|
+
high: "\u{1F534}",
|
|
30123
|
+
medium: "\u{1F7E1}",
|
|
30124
|
+
low: "\u{1F7E2}"
|
|
30125
|
+
};
|
|
30126
|
+
const icon = statusIconMap[todo.status];
|
|
30127
|
+
const color = statusColorMap[todo.status];
|
|
30128
|
+
const priorityIcon = todo.priority ? priorityIconMap[todo.priority] : "";
|
|
30129
|
+
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(
|
|
30130
|
+
Text84,
|
|
30131
|
+
{
|
|
30132
|
+
color,
|
|
30133
|
+
dimColor: todo.status === "completed",
|
|
30134
|
+
strikethrough: todo.status === "completed",
|
|
30135
|
+
bold: todo.status === "in_progress"
|
|
30136
|
+
},
|
|
30137
|
+
todo.content
|
|
30138
|
+
), children), todo.status === "in_progress" && todo.activeForm && /* @__PURE__ */ React110.createElement(Box80, { marginLeft: 4 }, /* @__PURE__ */ React110.createElement(Text84, { color: "gray" }, "\u21B3 Action: ", todo.activeForm)));
|
|
30139
|
+
};
|
|
30140
|
+
|
|
29774
30141
|
// src/tools/interaction/TodoWriteTool/TodoWriteTool.tsx
|
|
29775
30142
|
var TodoItemSchema = z15.object({
|
|
29776
30143
|
content: z15.string().min(1, "Content cannot be empty").describe("The task description or content"),
|
|
@@ -29839,7 +30206,7 @@ var TodoWriteTool = {
|
|
|
29839
30206
|
return "";
|
|
29840
30207
|
},
|
|
29841
30208
|
async isEnabled() {
|
|
29842
|
-
return
|
|
30209
|
+
return isTodoCompatEnabled();
|
|
29843
30210
|
},
|
|
29844
30211
|
isReadOnly() {
|
|
29845
30212
|
return false;
|
|
@@ -29857,19 +30224,19 @@ var TodoWriteTool = {
|
|
|
29857
30224
|
return null;
|
|
29858
30225
|
},
|
|
29859
30226
|
renderToolUseRejectedMessage() {
|
|
29860
|
-
return /* @__PURE__ */
|
|
30227
|
+
return /* @__PURE__ */ React111.createElement(FallbackToolUseRejectedMessage, null);
|
|
29861
30228
|
},
|
|
29862
30229
|
renderToolResultMessage(output, _options) {
|
|
29863
30230
|
if (typeof output === "string") {
|
|
29864
|
-
return /* @__PURE__ */
|
|
30231
|
+
return /* @__PURE__ */ React111.createElement(Box81, { flexDirection: "row" }, /* @__PURE__ */ React111.createElement(Text85, null, output));
|
|
29865
30232
|
}
|
|
29866
30233
|
const todos2 = getTodos(output.agentId);
|
|
29867
30234
|
if (todos2.length === 0) {
|
|
29868
|
-
return /* @__PURE__ */
|
|
30235
|
+
return /* @__PURE__ */ React111.createElement(Box81, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React111.createElement(Text85, null, "No todos currently tracked"));
|
|
29869
30236
|
}
|
|
29870
30237
|
const count = todos2.length;
|
|
29871
30238
|
const label = count === 1 ? "todo" : "todos";
|
|
29872
|
-
return /* @__PURE__ */
|
|
30239
|
+
return /* @__PURE__ */ React111.createElement(Box81, { flexDirection: "column" }, /* @__PURE__ */ React111.createElement(Text85, null, /* @__PURE__ */ React111.createElement(Text85, { bold: true }, count, " ", label), /* @__PURE__ */ React111.createElement(Text85, null, ":")), /* @__PURE__ */ React111.createElement(Box81, { marginTop: 1, flexDirection: "column" }, todos2.map((item) => /* @__PURE__ */ React111.createElement(TodoItem, { key: item.id, todo: item }))));
|
|
29873
30240
|
},
|
|
29874
30241
|
async validateInput({ todos: todos2 }) {
|
|
29875
30242
|
const validation = validateTodos(todos2);
|
|
@@ -29912,6 +30279,9 @@ var TodoWriteTool = {
|
|
|
29912
30279
|
});
|
|
29913
30280
|
try {
|
|
29914
30281
|
setTodos(todoItems, agentId);
|
|
30282
|
+
if (isTodoCompatEnabled()) {
|
|
30283
|
+
syncTodosToTasks(todoItems);
|
|
30284
|
+
}
|
|
29915
30285
|
} catch (error) {
|
|
29916
30286
|
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
29917
30287
|
emitReminderEvent("todo:error", {
|
|
@@ -30632,7 +31002,7 @@ function WebFetchPermissionRequest({
|
|
|
30632
31002
|
reject();
|
|
30633
31003
|
}
|
|
30634
31004
|
});
|
|
30635
|
-
return /* @__PURE__ */
|
|
31005
|
+
return /* @__PURE__ */ React112.createElement(
|
|
30636
31006
|
Box82,
|
|
30637
31007
|
{
|
|
30638
31008
|
flexDirection: "column",
|
|
@@ -30643,14 +31013,14 @@ function WebFetchPermissionRequest({
|
|
|
30643
31013
|
paddingRight: 1,
|
|
30644
31014
|
paddingBottom: 1
|
|
30645
31015
|
},
|
|
30646
|
-
/* @__PURE__ */
|
|
31016
|
+
/* @__PURE__ */ React112.createElement(
|
|
30647
31017
|
PermissionRequestTitle,
|
|
30648
31018
|
{
|
|
30649
31019
|
title: "Network request outside of sandbox",
|
|
30650
31020
|
riskScore: null
|
|
30651
31021
|
}
|
|
30652
31022
|
),
|
|
30653
|
-
/* @__PURE__ */
|
|
31023
|
+
/* @__PURE__ */ React112.createElement(Box82, { flexDirection: "column", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React112.createElement(Box82, null, /* @__PURE__ */ React112.createElement(Text86, { dimColor: true }, "Host:"), /* @__PURE__ */ React112.createElement(Text86, null, " ", hostLabel)), /* @__PURE__ */ React112.createElement(Box82, { marginTop: 1 }, /* @__PURE__ */ React112.createElement(Text86, null, "Do you want to allow this connection?")), /* @__PURE__ */ React112.createElement(Box82, { marginTop: 1 }, /* @__PURE__ */ React112.createElement(
|
|
30654
31024
|
Select,
|
|
30655
31025
|
{
|
|
30656
31026
|
options: [
|
|
@@ -31022,10 +31392,10 @@ var BashTool = {
|
|
|
31022
31392
|
return withDescription(base.trim());
|
|
31023
31393
|
},
|
|
31024
31394
|
renderToolUseRejectedMessage() {
|
|
31025
|
-
return /* @__PURE__ */
|
|
31395
|
+
return /* @__PURE__ */ React113.createElement(FallbackToolUseRejectedMessage, null);
|
|
31026
31396
|
},
|
|
31027
31397
|
renderToolResultMessage(content) {
|
|
31028
|
-
return /* @__PURE__ */
|
|
31398
|
+
return /* @__PURE__ */ React113.createElement(BashToolResultMessage_default, { content, verbose: false });
|
|
31029
31399
|
},
|
|
31030
31400
|
renderResultForAssistant({
|
|
31031
31401
|
interrupted,
|
|
@@ -31266,7 +31636,7 @@ Did you mean "git ${cmdParts.slice(1).join(" ")}"?`;
|
|
|
31266
31636
|
}
|
|
31267
31637
|
};
|
|
31268
31638
|
setToolJSX({
|
|
31269
|
-
jsx: /* @__PURE__ */
|
|
31639
|
+
jsx: /* @__PURE__ */ React113.createElement(
|
|
31270
31640
|
WebFetchPermissionRequest,
|
|
31271
31641
|
{
|
|
31272
31642
|
toolUseConfirm,
|
|
@@ -31436,7 +31806,7 @@ ${footerParts.join(" ")}`;
|
|
|
31436
31806
|
for (const filePath of filePaths) {
|
|
31437
31807
|
const fullFilePath = isAbsolute8(filePath) ? filePath : resolve10(getCwd(), filePath);
|
|
31438
31808
|
try {
|
|
31439
|
-
readFileTimestamps[fullFilePath] =
|
|
31809
|
+
readFileTimestamps[fullFilePath] = statSync13(fullFilePath).mtimeMs;
|
|
31440
31810
|
} catch (e) {
|
|
31441
31811
|
logError(e);
|
|
31442
31812
|
}
|
|
@@ -31462,7 +31832,7 @@ ${footerParts.join(" ")}`;
|
|
|
31462
31832
|
if (!overlayShown && setToolJSX && Date.now() - startedAt >= PROGRESS_INITIAL_DELAY_MS) {
|
|
31463
31833
|
overlayShown = true;
|
|
31464
31834
|
setToolJSX({
|
|
31465
|
-
jsx: /* @__PURE__ */
|
|
31835
|
+
jsx: /* @__PURE__ */ React113.createElement(
|
|
31466
31836
|
BashToolRunInBackgroundOverlay,
|
|
31467
31837
|
{
|
|
31468
31838
|
onBackground: requestBackground
|
|
@@ -31526,12 +31896,14 @@ There are additional slash commands and flags available to the user. If the user
|
|
|
31526
31896
|
To give feedback, users should ${MACRO.ISSUES_EXPLAINER}.
|
|
31527
31897
|
|
|
31528
31898
|
# Task Management
|
|
31529
|
-
You have access to the
|
|
31530
|
-
These tools are powerful for planning tasks and for breaking down larger complex tasks into smaller steps.
|
|
31899
|
+
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.
|
|
31900
|
+
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.
|
|
31901
|
+
|
|
31902
|
+
**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.
|
|
31531
31903
|
|
|
31532
|
-
|
|
31904
|
+
Task records use subject as the single primary name, with activeForm auto-generated from subject to describe the in-progress action. Keep description and blockedBy independent in JSON; any joining is only for terminal rendering. blocks/blockedBy should always be present as arrays (empty when not used). Ordering is by task id; do not use priority fields.
|
|
31533
31905
|
|
|
31534
|
-
It is critical that you mark
|
|
31906
|
+
It is critical that you mark tasks as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
|
|
31535
31907
|
|
|
31536
31908
|
# Cognitive Safety & Sensing
|
|
31537
31909
|
1. **Modification Check**: Before editing, you MUST verify if the change is already present (e.g. use \`grep\` or \`read\`).
|
|
@@ -31637,7 +32009,7 @@ When making changes to files, first understand the file's code conventions. Mimi
|
|
|
31637
32009
|
|
|
31638
32010
|
${includeCodingInstructions ? `# Doing tasks
|
|
31639
32011
|
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
|
|
31640
|
-
- Use
|
|
32012
|
+
- Use TaskCreate to plan multi-step work and TaskUpdate to track progress; use TaskList/TaskGet to review
|
|
31641
32013
|
- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
|
|
31642
32014
|
- Implement the solution using all tools available to you
|
|
31643
32015
|
- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.
|
|
@@ -31742,7 +32114,6 @@ export {
|
|
|
31742
32114
|
SkillTool,
|
|
31743
32115
|
ExitPlanModeTool,
|
|
31744
32116
|
KillShellTool,
|
|
31745
|
-
TodoWriteTool,
|
|
31746
32117
|
hasPermissionsToUseTool,
|
|
31747
32118
|
BashTool,
|
|
31748
32119
|
getCLISyspromptPrefix,
|
|
@@ -31759,6 +32130,9 @@ export {
|
|
|
31759
32130
|
Doctor,
|
|
31760
32131
|
Onboarding,
|
|
31761
32132
|
review_default,
|
|
32133
|
+
buildTaskGraph,
|
|
32134
|
+
findTaskCycles,
|
|
32135
|
+
calculateReadyBlocked,
|
|
31762
32136
|
applyMarkdown,
|
|
31763
32137
|
EnterPlanModeTool,
|
|
31764
32138
|
AskUserQuestionTool,
|