@readmagic/workmate 0.0.5 → 0.0.7
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/chunks/{AddWorkspaceDirectory-DJRkEz7o.js → AddWorkspaceDirectory-CFrrXnt9.js} +1 -1
- package/dist/chunks/{App-iJu5qyiF.js → App-Buad9Llp.js} +1 -1
- package/dist/chunks/{ApproveApiKey-CRejTHUw.js → ApproveApiKey-B2HJUD7h.js} +1 -1
- package/dist/chunks/ApproveApiKey-BQbHdvc3.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-CBLQ1v-J.js → AssistantSessionChooser-4lm4eXQ8.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-D1FCKVOi.js → BypassPermissionsModeDialog-DllL8dxU.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CI0yF6sZ.js → ClaudeMdExternalIncludesDialog-BZSyRqeq.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +1 -0
- package/dist/chunks/{DesktopHandoff-D1rrMxeP.js → DesktopHandoff-DaP4Riar.js} +1 -1
- package/dist/chunks/{DiffDialog-BKcfKx7O.js → DiffDialog-B7hx8i_Y.js} +2 -2
- package/dist/chunks/Doctor-89OgoAUA.js +1 -0
- package/dist/chunks/Doctor-CuKJ-nGt.js +3 -0
- package/dist/chunks/ExitFlow-DnPydE17.js +2 -0
- package/dist/chunks/{Feedback-bEUtrHia.js → Feedback-SmGiR3mf.js} +2 -2
- package/dist/chunks/Grove-CjN9DO47.js +11 -0
- package/dist/chunks/Grove-Cq88VBmM.js +1 -0
- package/dist/chunks/{HybridTransport-9fTBC2Pv.js → HybridTransport-rK83Qijz.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-9M-1nfZ6.js → InvalidConfigDialog-DdO0AxyF.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-B2F6pryH.js → InvalidSettingsDialog-s1G0DwXF.js} +1 -1
- package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BPBb7Npe.js → McpParsingWarnings-Du5IxZos.js} +1 -1
- package/dist/chunks/MessageSelector-iIroHvXo.js +3 -0
- package/dist/chunks/Messages-D4Hm4gaY.js +11 -0
- package/dist/chunks/{Onboarding-cHcnsBGp.js → Onboarding-BiZByBK-.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-CWCD_RpM.js → OverageCreditUpsell-BM7szLgm.js} +1 -1
- package/dist/chunks/PluginSettings-uY5KTCtK.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-D5sAO6y-.js → PromptInputFooterSuggestions-BmsFdOu9.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-n6hAdsto.js → PromptInputHelpMenu-DX-0wEDo.js} +1 -1
- package/dist/chunks/QueryEngine-CGYaShXD.js +1 -0
- package/dist/chunks/REPL-CRJB2t2z.js +142 -0
- package/dist/chunks/REPL-u4Yq29Du.js +1 -0
- package/dist/chunks/{RemoteCallout-CiA4rCEs.js → RemoteCallout-B-tyvQOe.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-zdHfmvfj.js → RemoteSessionManager-DCd0O5_l.js} +2 -2
- package/dist/chunks/ResumeConversation-DAAXlOCd.js +1 -0
- package/dist/chunks/{SSETransport-BPbhCa2f.js → SSETransport-5VK5okFv.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +1 -0
- package/dist/chunks/Settings-CUjWlncb.js +2 -0
- package/dist/chunks/{TeleportProgress-DrulEQ7z.js → TeleportProgress-DxN0bQL2.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-D3FOLr0P.js → TeleportRepoMismatchDialog-A5Ss0kuk.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-DI5iRFND.js → TeleportResumeWrapper-Bz14mUqR.js} +1 -1
- package/dist/chunks/{ThemePicker-CQ7dfFtv.js → ThemePicker-CVSRqTzW.js} +1 -1
- package/dist/chunks/TrustDialog-CY8an_Tg.js +1 -0
- package/dist/chunks/{ValidationErrorsList-CPYeuppg.js → ValidationErrorsList-BYsDtAvX.js} +1 -1
- package/dist/chunks/{WelcomeV2-C-UXdIng.js → WelcomeV2-C1BfrqC5.js} +1 -1
- package/dist/chunks/{add-dir-xTz4COgn.js → add-dir-DfLYgwox.js} +1 -1
- package/dist/chunks/{agentDisplay-BuSReYxu.js → agentDisplay-CMmHIl86.js} +1 -1
- package/dist/chunks/{agents-CiLlKN2I.js → agents-DE_4mAHG.js} +1 -1
- package/dist/chunks/agents-DJtPfvnL.js +103 -0
- package/dist/chunks/allErrors-CQE2k0zO.js +1 -0
- package/dist/chunks/{ant-CBIfqmAb.js → ant-ClQkuQjZ.js} +1 -1
- package/dist/chunks/{api-B-5jqiMg.js → api-2cdIPaeq.js} +1 -1
- package/dist/chunks/api-CG-lhKe-.js +1 -0
- package/dist/chunks/{assistant-XOnU01yl.js → assistant-Bje16tQx.js} +1 -1
- package/dist/chunks/auth-DMfEiQrC.js +1 -0
- package/dist/chunks/auth-D_cGl8WD.js +1 -0
- package/dist/chunks/{auth-DT2yxy94.js → auth-DqcKPbw8.js} +1 -1
- package/dist/chunks/{autoMode-CEMflt3g.js → autoMode-ZW70mpr0.js} +5 -5
- package/dist/chunks/{autonomy-_N8aDaA8.js → autonomy-CwbWsCnv.js} +1 -1
- package/dist/chunks/autonomy-Oui8yK8G.js +15 -0
- package/dist/chunks/{autonomyPanel-I4yCy3Fr.js → autonomyPanel-Mq50H7iM.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +1 -0
- package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +17 -0
- package/dist/chunks/{branch-BIX-pyHp.js → branch-DU5O9KZ0.js} +1 -1
- package/dist/chunks/{break-cache-BQfgkNAo.js → break-cache-C_p7Kmx2.js} +3 -3
- package/dist/chunks/{bridge-CYskzVt8.js → bridge-DNNxtPlz.js} +2 -2
- package/dist/chunks/{bridgeConfig-5p_w4s5r.js → bridgeConfig-CE6dMsiJ.js} +1 -1
- package/dist/chunks/bridgeConfig-DP9dD1Cv.js +1 -0
- package/dist/chunks/{bridgeEnabled-DhFrLTbG.js → bridgeEnabled-Cc0mGlTb.js} +1 -1
- package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +1 -0
- package/dist/chunks/bridgeMain-CwxMa_pd.js +1 -0
- package/dist/chunks/bridgeMain-D11t1BYQ.js +68 -0
- package/dist/chunks/{bridgeMessaging-B5Lbzr8e.js → bridgeMessaging-DdvApEqW.js} +1 -1
- package/dist/chunks/{bridgePointer-MqLe5Asm.js → bridgePointer-DqHMHa2B.js} +1 -1
- package/dist/chunks/{btw-CWWFO7u8.js → btw-CejSEdNl.js} +1 -1
- package/dist/chunks/{caches-DPqPIogk.js → caches-5HVQSevy.js} +2 -2
- package/dist/chunks/caches-B-nJoHLM.js +1 -0
- package/dist/chunks/{ccrClient-CTLnU9Y1.js → ccrClient-BFyfO67b.js} +1 -1
- package/dist/chunks/{claudeDesktop-Cx31Ugjp.js → claudeDesktop-Fe-QL-sN.js} +1 -1
- package/dist/chunks/{clear-DCAgZwc4.js → clear-D8m2utXW.js} +1 -1
- package/dist/chunks/client-C6MbjvOB.js +17 -0
- package/dist/chunks/client-DKXCfdde.js +1 -0
- package/dist/chunks/client-xxikkAoZ.js +1 -0
- package/dist/chunks/{color-CmJGInHL.js → color-DWhgZH7A.js} +1 -1
- package/dist/chunks/commands-CxJpmEKF.js +1 -0
- package/dist/chunks/commitAttribution-DM6SBMwl.js +1 -0
- package/dist/chunks/{commitAttribution-CGZr7XNO.js → commitAttribution-DPnHHKSA.js} +1 -1
- package/dist/chunks/compact-CblM7306.js +2 -0
- package/dist/chunks/config-BLVBFi5v.js +1 -0
- package/dist/chunks/config-CMnqm6Se.js +1 -0
- package/dist/chunks/{config-3m_9zSrj.js → config-DRDuVyzE.js} +2 -2
- package/dist/chunks/{context-C9V4GF0n.js → context-CdSMMM-0.js} +1 -1
- package/dist/chunks/context-noninteractive-CPkf2vB9.js +1 -0
- package/dist/chunks/{context-noninteractive-BmC4o5xo.js → context-noninteractive-DNury4JI.js} +5 -5
- package/dist/chunks/conversation-DCMw_rsE.js +1 -0
- package/dist/chunks/conversation-pUtvc-cE.js +1 -0
- package/dist/chunks/{createSSHSession-BL6j0AU5.js → createSSHSession-BOdTAX3N.js} +1 -1
- package/dist/chunks/{createSession-D_sgO1Xy.js → createSession-8Ei-Lj7V.js} +1 -1
- package/dist/chunks/createSession-CjqxVh_Q.js +1 -0
- package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +40 -0
- package/dist/chunks/{datadog-UkGdjL8-.js → datadog-DqHxqiwY.js} +1 -1
- package/dist/chunks/{desktop-HbYKh-VK.js → desktop-Z5FAfunZ.js} +1 -1
- package/dist/chunks/{diff-nTV17iWX.js → diff-CJEKvOA5.js} +1 -1
- package/dist/chunks/doctor-BA2ZLDTl.js +1 -0
- package/dist/chunks/{entry-CCFI6-gM.js → entry-DE0uMIf0.js} +4 -4
- package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +1 -0
- package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +1 -0
- package/dist/chunks/{esm-CGoYrggU.js → esm-5w3xFBnt.js} +1 -1
- package/dist/chunks/exit-Dt9kHtJO.js +1 -0
- package/dist/chunks/{extra-usage-g2Pw4zt_.js → extra-usage-C7E2Z1p1.js} +1 -1
- package/dist/chunks/extra-usage-D0Kkjp-2.js +1 -0
- package/dist/chunks/{extra-usage-core-DLYHAInT.js → extra-usage-core-DjdaD1qO.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-D8iszH3c.js → extra-usage-noninteractive-BnD1RhKK.js} +1 -1
- package/dist/chunks/{extraUsage-C2Ylufhj.js → extraUsage-CpgRTcMk.js} +1 -1
- package/dist/chunks/extractMemories-DhUprYa7.js +1 -0
- package/dist/chunks/{fast-Dx2fTmWr.js → fast-C4ZevUNL.js} +1 -1
- package/dist/chunks/fast-CChxlAAF.js +1 -0
- package/dist/chunks/{feedback-DCQ4pJ3v.js → feedback-BIhBhV6n.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-BNGPPBNP.js → firstPartyEventLogger-BXY1IJ2D.js} +2 -2
- package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +1 -0
- package/dist/chunks/{flushGate-XaheIZZT.js → flushGate-CgHq81Gw.js} +1 -1
- package/dist/chunks/{gemini-BCCLHK3K.js → gemini-C1J-x1g7.js} +1 -1
- package/dist/chunks/generateRecap-C0jjCg0Z.js +1 -0
- package/dist/chunks/generateSessionName-w0BMtwS7.js +1 -0
- package/dist/chunks/{githubRepoPathMapping-B4AM8luI.js → githubRepoPathMapping-8D0kpsif.js} +1 -1
- package/dist/chunks/{goal-Bp6fyGqo.js → goal-B4GsR54_.js} +3 -3
- package/dist/chunks/grok-ffNyU3Lt.js +1 -0
- package/dist/chunks/{grove-DrBVaZSN.js → grove-BQisE2JM.js} +1 -1
- package/dist/chunks/{heapdump-JseysNDr.js → heapdump-DiCjAPR3.js} +1 -1
- package/dist/chunks/{help-DR9hKneR.js → help-2hn8VK2-.js} +1 -1
- package/dist/chunks/hooks-CBmrBO-J.js +1 -0
- package/dist/chunks/{hooks-C5n23H1E.js → hooks-CkA9bhHl.js} +2 -2
- package/dist/chunks/hostGuard-BHI6Q8Mt.js +1 -0
- package/dist/chunks/inboundAttachments-C5K3XPTC.js +1 -0
- package/dist/chunks/{inboundAttachments-Cp8XvLMZ.js → inboundAttachments-IH-g95jo.js} +1 -1
- package/dist/chunks/initReplBridge-C-P4dgAG.js +1 -0
- package/dist/chunks/{install-C7qTB0V5.js → install-Dzlm4u58.js} +1 -1
- package/dist/chunks/{instrumentation-CLZttr_u.js → instrumentation-Yt31gxWN.js} +3 -3
- package/dist/chunks/{job-BhiazwPH.js → job-BXujwZNa.js} +1 -1
- package/dist/chunks/{keybindings-CkL8BzUt.js → keybindings-D8FXoO89.js} +2 -2
- package/dist/chunks/language-Baosud0X.js +1 -0
- package/dist/chunks/{language-DIw2871r.js → language-Ca4B018X.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-j-mWpwW1.js → launchAgentsPlatform-D6DmNuDt.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DmoXp0Xo.js → launchLocalMemory-C0FzUq7x.js} +2 -2
- package/dist/chunks/{launchLocalVault-1uKe0HjA.js → launchLocalVault-DkYAre4O.js} +3 -3
- package/dist/chunks/{launchMemoryStores-SxDKjHJ3.js → launchMemoryStores-D2rKWAPs.js} +1 -1
- package/dist/chunks/{launchOnboarding-CTtpnXcs.js → launchOnboarding-gOVAFEFp.js} +1 -1
- package/dist/chunks/{launchSchedule-BDVnGhaL.js → launchSchedule-IZdFstT_.js} +1 -1
- package/dist/chunks/{launchSkillStore-SmMLxp4K.js → launchSkillStore-B7LamM1d.js} +1 -1
- package/dist/chunks/{launchTeleport-B472ZSGz.js → launchTeleport-C2BQMfYP.js} +3 -3
- package/dist/chunks/{launchVault-CsyBgxle.js → launchVault-C60WUcCI.js} +1 -1
- package/dist/chunks/{lazySchema-DcIJE_0i.js → lazySchema-DULtBUCI.js} +1 -1
- package/dist/chunks/loadAgentsDir-B9c3Emvg.js +1 -0
- package/dist/chunks/{loadAgentsDir-Clu7Uk6a.js → loadAgentsDir-x3rlgED4.js} +693 -695
- package/dist/chunks/loadPluginHooks-BhNdAjeY.js +1 -0
- package/dist/chunks/localSearch-BLCGsdyM.js +1 -0
- package/dist/chunks/{localSearch-iA6JTk19.js → localSearch-DtplGF-l.js} +1 -1
- package/dist/chunks/{logoV2Utils-YHBJLIrC.js → logoV2Utils-gGK9gErT.js} +1 -1
- package/dist/chunks/{magicDocs-Bf1fqnHN.js → magicDocs-qdDB_mKb.js} +2 -2
- package/dist/chunks/{main-gtV_TqXP.js → main-OWFSddRx.js} +84 -84
- package/dist/chunks/managedEnv-Aq5BXfY7.js +1 -0
- package/dist/chunks/managedEnv-BHoeDjpS.js +1 -0
- package/dist/chunks/managedEnvConstants-BPwL2aWI.js +1 -0
- package/dist/chunks/{mappers-C8lYERPX.js → mappers-04gNXJ3w.js} +1 -1
- package/dist/chunks/mcp-BSNdwbxR.js +1 -0
- package/dist/chunks/mcp-CMnDNI-4.js +6 -0
- package/dist/chunks/mcp-D1yA9E56.js +2 -0
- package/dist/chunks/memory-D1zbyjxN.js +1 -0
- package/dist/chunks/{mode-DO6g7nkX.js → mode-DY087x_x.js} +2 -2
- package/dist/chunks/model-CZViyZnE.js +1 -0
- package/dist/chunks/{model-DLXL0CNu.js → model-D0EfJBuw.js} +1 -1
- package/dist/chunks/model-DLLkVV6S.js +1 -0
- package/dist/chunks/{nativeInstaller-OPuO2sm_.js → nativeInstaller-yj81F75v.js} +1 -1
- package/dist/chunks/onChangeAppState-DhGKPG9g.js +1 -0
- package/dist/chunks/{openai-HOebt-8k.js → openai-EYRnUsco.js} +3 -3
- package/dist/chunks/{overageCreditGrant-Bi1CTBAx.js → overageCreditGrant-Du3dOYVu.js} +1 -1
- package/dist/chunks/{panel-CrTPqXCv.js → panel-BSZGX6jN.js} +1 -1
- package/dist/chunks/{panelCall-D0eURklm.js → panelCall-dMvRPAGE.js} +1 -1
- package/dist/chunks/{partition-C8RSL3SQ.js → partition-C4FWzYVm.js} +1 -1
- package/dist/chunks/{passes-BJci5SM_.js → passes-Daz-ARWD.js} +1 -1
- package/dist/chunks/permissions-DF8tAmDF.js +3 -0
- package/dist/chunks/{pidLock-Bd2e6xuT.js → pidLock-CbC_il6r.js} +2 -2
- package/dist/chunks/{plan-D4gMsK7i.js → plan-rsb_83Fo.js} +1 -1
- package/dist/chunks/{plugin-CwCo5Kik.js → plugin-Cm31-nej.js} +1 -1
- package/dist/chunks/pluginAutoupdate-0k03PVff.js +1 -0
- package/dist/chunks/pluginBlocklist-wPFCUPdm.js +1 -0
- package/dist/chunks/pluginCliCommands-DhL9LbH0.js +1 -0
- package/dist/chunks/{pluginFlagging-DNPBbJZo.js → pluginFlagging-CAdaFV_D.js} +1 -1
- package/dist/chunks/pluginOperations-Cs_Z4C6O.js +2 -0
- package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +1 -0
- package/dist/chunks/pluginStartupCheck-KeU0efTj.js +1 -0
- package/dist/chunks/{plugins-CzJIuPfb.js → plugins-CQNKZmjP.js} +4 -4
- package/dist/chunks/policyLimits-D2s8M8P2.js +1 -0
- package/dist/chunks/{pollConfig-DH2oCtFS.js → pollConfig-2nFzv6Hy.js} +1 -1
- package/dist/chunks/{poor-Dha9p9RF.js → poor-DXumVTR4.js} +1 -1
- package/dist/chunks/{poorMode-1NLYiS3Y.js → poorMode-CBOtooa0.js} +1 -1
- package/dist/chunks/poorMode-yNZL5uYf.js +1 -0
- package/dist/chunks/print-uxCF5ka5.js +23 -0
- package/dist/chunks/{privacy-settings-6ZWxR4Qt.js → privacy-settings-BncbJCV0.js} +1 -1
- package/dist/chunks/processBashCommand-CGdwvPmD.js +1 -0
- package/dist/chunks/processSlashCommand-DQarepEb.js +5 -0
- package/dist/chunks/prompt-BgOdcHkd.js +1 -0
- package/dist/chunks/{prompt-Bg_1U0gO.js → prompt-CE3sFmZV.js} +5 -5
- package/dist/chunks/prompt-CLJKFebn.js +1 -0
- package/dist/chunks/{promptEditor-BhYDmwdS.js → promptEditor-CyTzyjwG.js} +2 -2
- package/dist/chunks/{protocolHandler-Dnb7lITm.js → protocolHandler-JR8pASdH.js} +1 -1
- package/dist/chunks/rate-limit-options-C-EqWjeI.js +1 -0
- package/dist/chunks/{rcDebugLog-VKwMl0yg.js → rcDebugLog-DBB9r8aw.js} +1 -1
- package/dist/chunks/reconciler-CYD_XpG4.js +4 -0
- package/dist/chunks/{referral-BlrMpBAV.js → referral-CKmHHxj_.js} +1 -1
- package/dist/chunks/refresh-ZqZdmLK5.js +1 -0
- package/dist/chunks/{registerProtocol-CuKZAiCc.js → registerProtocol-wZv2uiW_.js} +1 -1
- package/dist/chunks/{release-notes-BgP8u7NE.js → release-notes-B5K7wVqZ.js} +1 -1
- package/dist/chunks/{releaseNotes-CunqVlbU.js → releaseNotes-B8gbyFFJ.js} +2 -2
- package/dist/chunks/{reload-plugins-CD9TzvFm.js → reload-plugins-B9ApSp2m.js} +1 -1
- package/dist/chunks/{remote-env-QaP_W_sv.js → remote-env-CAt1dHIS.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-9-HVMo63.js → remoteBridgeCore-Bk3UdSLJ.js} +1 -1
- package/dist/chunks/remoteManagedSettings-bswzAB6W.js +1 -0
- package/dist/chunks/rename-CE_U6KE6.js +1 -0
- package/dist/chunks/{resume-D-SpOy_1.js → resume-BicEjsPd.js} +2 -2
- package/dist/chunks/{runtimeObserver-Dm3LIUMp.js → runtimeObserver-BrGF5QWX.js} +4 -4
- package/dist/chunks/{runtimeObserver-DOEcrylu.js → runtimeObserver-CiwnPFjK.js} +1 -1
- package/dist/chunks/sandbox-adapter-BtMiHImm.js +1 -0
- package/dist/chunks/{sandbox-toggle-B61AeBor.js → sandbox-toggle-D8eebdyI.js} +1 -1
- package/dist/chunks/searchExtraTools-hLLPuh7c.js +1 -0
- package/dist/chunks/{session-RwJCIIcs.js → session-BZIlR9Gc.js} +2 -2
- package/dist/chunks/{sessionDiscovery-dkFeWcA3.js → sessionDiscovery-DfDqTrF1.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +1 -0
- package/dist/chunks/sessionMemory-D37S0-jX.js +1 -0
- package/dist/chunks/sessionMemory-DmlAG3jq.js +1 -0
- package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +1 -0
- package/dist/chunks/sessionObserver-BUw2rzKl.js +1 -0
- package/dist/chunks/{sessionObserver-CSOYgsvH.js → sessionObserver-KgquhGWw.js} +1 -1
- package/dist/chunks/sessionStorage-CucBSK5Q.js +1 -0
- package/dist/chunks/{sessionTitle-CLOlPZ_M.js → sessionTitle-DAnM73S0.js} +2 -2
- package/dist/chunks/{sessionTracing-D8wr9j4X.js → sessionTracing-_Hh5VXxt.js} +1 -1
- package/dist/chunks/settings-BeLFUeie.js +19 -0
- package/dist/chunks/settings-Cl16Haug.js +1 -0
- package/dist/chunks/settingsSync-BNvFYH3c.js +1 -0
- package/dist/chunks/setup-D8kXv3ts.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-CXsmUY2o.js → shadowedRuleDetection-C6R5zOUe.js} +1 -1
- package/dist/chunks/{sideQuestion-CHpOVzY5.js → sideQuestion-hUhxls9r.js} +3 -3
- package/dist/chunks/{sinks-1hFrW9HK.js → sinks-BuE17DeZ.js} +2 -2
- package/dist/chunks/sinks-FevoYQqP.js +1 -0
- package/dist/chunks/{skill-learning-Ck17rwH8.js → skill-learning-CMdxGtxr.js} +1 -1
- package/dist/chunks/skillChangeDetector-C65ZLSYV.js +1 -0
- package/dist/chunks/{skillGapStore-DyqNKuNy.js → skillGapStore-D18LRJAM.js} +2 -2
- package/dist/chunks/{skillGapStore-BJ1h2LVr.js → skillGapStore-Ep62R-2_.js} +1 -1
- package/dist/chunks/{skillGenerator-BT8NGzXT.js → skillGenerator-Bc7WwNT8.js} +2 -2
- package/dist/chunks/{skillLearning-Cn9Uw0Kd.js → skillLearning-Cs9fJgkV.js} +1 -1
- package/dist/chunks/skillLearning-duPZl69A.js +1 -0
- package/dist/chunks/{skillPanel-N0GoWjIi.js → skillPanel-Cyzby746.js} +3 -3
- package/dist/chunks/{skillSearchPanel-CTwtgTzy.js → skillSearchPanel-Cll9ccA5.js} +4 -4
- package/dist/chunks/{skills-Bv3lH-aA.js → skills-BPPeYBy7.js} +1 -1
- package/dist/chunks/{stats-C1Ff6w4i.js → stats-CqfF4Axp.js} +1 -1
- package/dist/chunks/{status-FD7HVYS7.js → status-CC9Q-2Yn.js} +1 -1
- package/dist/chunks/{status-DyXiBa0m.js → status-D4IQpsNK.js} +2 -2
- package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +1 -0
- package/dist/chunks/syncCache-CANQZ9mQ.js +1 -0
- package/dist/chunks/{tag-RzOSA5T0.js → tag-DDbNqBMu.js} +2 -2
- package/dist/chunks/{tasks-eJrOcdhB.js → tasks-CZvWJYGr.js} +1 -1
- package/dist/chunks/teleport-Dk5j03Ix.js +1 -0
- package/dist/chunks/{templateJobs-BnOBSFtq.js → templateJobs-D1BdhZsv.js} +1 -1
- package/dist/chunks/{terminalSetup-D_P5iZmq.js → terminalSetup-3JNy6i_J.js} +5 -5
- package/dist/chunks/{terminalSetup-BfvmoJaK.js → terminalSetup-Cn6jeYw1.js} +1 -1
- package/dist/chunks/{theme-S0kVMVt4.js → theme-Cg4GNOoQ.js} +1 -1
- package/dist/chunks/thinkback-p-vKIRW_.js +1 -0
- package/dist/chunks/thinkback-play-DnPTDE8B.js +1 -0
- package/dist/chunks/{thinkback-HyW_R_88.js → thinkback-rFA1do6F.js} +1 -1
- package/dist/chunks/{toolEventObserver--Z6jENks.js → toolEventObserver-CzsCuUMc.js} +1 -1
- package/dist/chunks/{toolEventObserver-BAFzvePj.js → toolEventObserver-SFwURL5F.js} +1 -1
- package/dist/chunks/toolPool-BR27AMJO.js +1 -0
- package/dist/chunks/trustedDevice-BYt39fui.js +1 -0
- package/dist/chunks/{trustedDevice-Dn4rXbxT.js → trustedDevice-CKedohmT.js} +1 -1
- package/dist/chunks/{types-C-MRCL8J.js → types-Dut4311z.js} +2 -2
- package/dist/chunks/{ultrareviewCommand-mYDTBCFD.js → ultrareviewCommand-C_4OSBTW.js} +2 -2
- package/dist/chunks/{undercover-CdapzvNH.js → undercover-D30rKimg.js} +2 -2
- package/dist/chunks/undercover-DRSwLozU.js +1 -0
- package/dist/chunks/{updateCCB-DPShheOr.js → updateCCB-C2G-U-qA.js} +1 -1
- package/dist/chunks/upgrade-Bi-bIz7R.js +1 -0
- package/dist/chunks/{upgrade-BOeakAP6.js → upgrade-Chs-OQFd.js} +1 -1
- package/dist/chunks/{upload-BXQsDtLW.js → upload-D8FWMSQx.js} +1 -1
- package/dist/chunks/{usage-iNQzY960.js → usage-BxVeUt60.js} +1 -1
- package/dist/chunks/usage-DUO7Yy1f.js +1 -0
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CntByfTQ.js → useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js} +1 -1
- package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +1 -0
- package/dist/chunks/useManagePlugins-B11_87VN.js +1 -0
- package/dist/chunks/useMergedTools-CR56my9t.js +1 -0
- package/dist/chunks/{useSearchInput-H-8hJeFD.js → useSearchInput-C5OzQnX6.js} +1 -1
- package/dist/chunks/{useSettingsErrors-BF5i5Xju.js → useSettingsErrors-B9vOZL41.js} +1 -1
- package/dist/chunks/{util-CoicMvOv.js → util-8EHwfg4A.js} +1 -1
- package/dist/chunks/validatePlugin-6q1qmnAC.js +1 -0
- package/dist/chunks/{vim-DdvQlLDm.js → vim-CNDzwoTd.js} +1 -1
- package/dist/chunks/{workerRegistry-CzqQwCHC.js → workerRegistry-CvyHvwx-.js} +1 -1
- package/dist/chunks/worktree-ogmNCIpz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-CKfn7U1R.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CyoLEYWH.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +0 -1
- package/dist/chunks/Doctor-CcJUwSQn.js +0 -1
- package/dist/chunks/Doctor-Yco1McrL.js +0 -3
- package/dist/chunks/ExitFlow-D3csukbB.js +0 -2
- package/dist/chunks/Grove-DPkIjqg8.js +0 -1
- package/dist/chunks/Grove-Dsd7F39b.js +0 -11
- package/dist/chunks/MCPConnectionManager-MWpKjeZT.js +0 -1
- package/dist/chunks/MessageSelector-DsQmqFt2.js +0 -3
- package/dist/chunks/Messages-B3sGRx5A.js +0 -11
- package/dist/chunks/PluginSettings-B0jbwB2M.js +0 -17
- package/dist/chunks/QueryEngine-cwdsr4dr.js +0 -1
- package/dist/chunks/REPL-CJzScgbZ.js +0 -142
- package/dist/chunks/REPL-DlBJIPCw.js +0 -1
- package/dist/chunks/ResumeConversation-Rxwd6HAJ.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +0 -1
- package/dist/chunks/Settings-CxI_KHUj.js +0 -2
- package/dist/chunks/TrustDialog-CnVKrdxQ.js +0 -1
- package/dist/chunks/agents-Du9KYHqN.js +0 -103
- package/dist/chunks/allErrors-P3utlEeA.js +0 -1
- package/dist/chunks/api-BiwZmmsh.js +0 -1
- package/dist/chunks/auth-BQa4kzQo.js +0 -1
- package/dist/chunks/auth-UAJhZNmZ.js +0 -1
- package/dist/chunks/autonomy-Cg5zweUa.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DhF2lrQ9.js +0 -17
- package/dist/chunks/bridgeConfig-DWEqKbXk.js +0 -1
- package/dist/chunks/bridgeEnabled-CjVCMwnq.js +0 -1
- package/dist/chunks/bridgeMain-6lollTtZ.js +0 -1
- package/dist/chunks/bridgeMain-BX2AkLPs.js +0 -68
- package/dist/chunks/caches-C46fa77L.js +0 -1
- package/dist/chunks/client-Bup0Sgcn.js +0 -1
- package/dist/chunks/commands-BdB1eFvP.js +0 -1
- package/dist/chunks/commitAttribution-D6J3NuhB.js +0 -1
- package/dist/chunks/compact-C6-lMHgn.js +0 -2
- package/dist/chunks/config-Bxt1UH1T.js +0 -1
- package/dist/chunks/config-CjjXZfNi.js +0 -1
- package/dist/chunks/context-noninteractive-DvGo1l7b.js +0 -1
- package/dist/chunks/conversation-CH9ouFai.js +0 -1
- package/dist/chunks/conversation-CYqqk0o7.js +0 -1
- package/dist/chunks/createSession-DUfOAeyE.js +0 -1
- package/dist/chunks/crossProjectResume-D5hTOfnE.js +0 -40
- package/dist/chunks/doctor-7fgVhEKL.js +0 -1
- package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DXd10GXD.js +0 -1
- package/dist/chunks/exit-ropaQiOr.js +0 -1
- package/dist/chunks/extra-usage-CLhv1Z4g.js +0 -1
- package/dist/chunks/extractMemories-B2IAvbXM.js +0 -1
- package/dist/chunks/fast-_G6zcFye.js +0 -1
- package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +0 -1
- package/dist/chunks/generateRecap-BhvbixY2.js +0 -1
- package/dist/chunks/generateSessionName-CN1oh7Fa.js +0 -1
- package/dist/chunks/grok-ax26ju8y.js +0 -1
- package/dist/chunks/hooks-BUJLxdFJ.js +0 -1
- package/dist/chunks/hostGuard-C5xydXZI.js +0 -1
- package/dist/chunks/inboundAttachments-C0nMTtCi.js +0 -1
- package/dist/chunks/initReplBridge-DJs28ZkI.js +0 -1
- package/dist/chunks/language-DfOAuDFc.js +0 -1
- package/dist/chunks/loadAgentsDir-DTbJJff-.js +0 -1
- package/dist/chunks/loadPluginHooks-Cvd5VdjQ.js +0 -1
- package/dist/chunks/localSearch-DKv8PRLD.js +0 -1
- package/dist/chunks/mcp-CNuhEGP6.js +0 -6
- package/dist/chunks/mcp-Ci0OPVrR.js +0 -1
- package/dist/chunks/mcp-CwIYauZl.js +0 -2
- package/dist/chunks/memory-DCGqfQ1U.js +0 -1
- package/dist/chunks/model-BQF64tZx.js +0 -1
- package/dist/chunks/model-DvrvG6BB.js +0 -1
- package/dist/chunks/onChangeAppState-CHhRDkM7.js +0 -1
- package/dist/chunks/permissions-JU9CGHgI.js +0 -3
- package/dist/chunks/pluginAutoupdate-CO-n9bqe.js +0 -1
- package/dist/chunks/pluginBlocklist-5qbaTRbV.js +0 -1
- package/dist/chunks/pluginCliCommands-I-lsw_us.js +0 -1
- package/dist/chunks/pluginOperations-Cz6eQ0Vu.js +0 -2
- package/dist/chunks/pluginStartupCheck-CoW7073W.js +0 -1
- package/dist/chunks/pluginStartupCheck-DJ9fslCK.js +0 -1
- package/dist/chunks/policyLimits-BkjgMQD0.js +0 -1
- package/dist/chunks/poorMode-qlxqU8Hm.js +0 -1
- package/dist/chunks/print-BL4EUT5Z.js +0 -23
- package/dist/chunks/processBashCommand-BZs9wggV.js +0 -1
- package/dist/chunks/processSlashCommand-D8lKLNzM.js +0 -5
- package/dist/chunks/prompt-CN7gBNKS.js +0 -1
- package/dist/chunks/prompt-D-zHhqp8.js +0 -1
- package/dist/chunks/rate-limit-options-DVzT3eWH.js +0 -1
- package/dist/chunks/reconciler-BdRXZTJf.js +0 -4
- package/dist/chunks/refresh-jwqnoK2h.js +0 -1
- package/dist/chunks/remoteManagedSettings-jZ6u8ZBT.js +0 -1
- package/dist/chunks/rename-29qxHf8W.js +0 -1
- package/dist/chunks/sandbox-adapter-LzTcKwBp.js +0 -1
- package/dist/chunks/searchExtraTools-CbJJQqzH.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +0 -1
- package/dist/chunks/sessionMemory-C4JAUZ6V.js +0 -1
- package/dist/chunks/sessionMemory-btARBn8H.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +0 -1
- package/dist/chunks/sessionObserver-DMvWci8-.js +0 -1
- package/dist/chunks/sessionStorage-Diyuvt20.js +0 -1
- package/dist/chunks/settings-Dlp5JTa_.js +0 -19
- package/dist/chunks/settingsSync-QWA0VZSu.js +0 -1
- package/dist/chunks/setup-UI9uv2-K.js +0 -3
- package/dist/chunks/sinks-CXq8-7Qn.js +0 -1
- package/dist/chunks/skillChangeDetector-s0F9Yf9a.js +0 -1
- package/dist/chunks/skillLearning-1ZfYIzfL.js +0 -1
- package/dist/chunks/statusNoticeHelpers-kTp9Rdk6.js +0 -1
- package/dist/chunks/teleport-ABA-hdmP.js +0 -1
- package/dist/chunks/thinkback-C6gV2LpU.js +0 -1
- package/dist/chunks/thinkback-play-H6md4czq.js +0 -1
- package/dist/chunks/toolPool-CR61XXm3.js +0 -1
- package/dist/chunks/trustedDevice-DUrFWupL.js +0 -1
- package/dist/chunks/undercover-k3JoOKAb.js +0 -1
- package/dist/chunks/upgrade-D7iGU0PQ.js +0 -1
- package/dist/chunks/usage-DbRdMJog.js +0 -1
- package/dist/chunks/useMainLoopModel-DHkRIgNs.js +0 -1
- package/dist/chunks/useManagePlugins-B8HD0RUh.js +0 -1
- package/dist/chunks/useMergedTools-DfchLQZC.js +0 -1
- package/dist/chunks/validatePlugin-z2fcngf8.js +0 -1
- package/dist/chunks/worktree-DMhP5T0p.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,t as u,vn as d,y as f,yn as p}from"./src-CDCSSo0U2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,t as u,vn as d,y as f,yn as p}from"./src-CDCSSo0U2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{Ex as h,L as g,R as _,Tx as v,ax as y,fx as b,ix as x,px as S,z as C}from"./loadAgentsDir-x3rlgED4.js";import{u as w}from"./referral-CKmHHxj_.js";import{r as T,t as E}from"./directoryCompletion-CW2ckkQg.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-BmsFdOu9.js";function k(){return(0,P.jsx)(o,{dimColor:!0,children:`Claude Code will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(a,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(o,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:s,selectedSuggestion:c}){return(0,P.jsxs)(a,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:`Enter the path to the directory:`}),(0,P.jsx)(a,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(v,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),s.length>0&&(0,P.jsx)(a,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:s,selectedSuggestion:c})}),i&&(0,P.jsx)(o,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[l,u]=(0,N.useState)(``),[d,m]=(0,N.useState)(null),[h,_]=(0,N.useState)([]),[v,y]=(0,N.useState)(0),S=(0,N.useMemo)(()=>F,[]),w=p((0,N.useCallback)(async e=>{if(!e){_([]),y(0);return}let t=await E(e);_(t),y(0)},[]),100);(0,N.useEffect)(()=>{w(l)},[l,w]);let T=(0,N.useCallback)(e=>{let t=e.id+`/`;u(t),m(null)},[]),D=(0,N.useCallback)(async t=>{let r=await C(t,n);r.resultType===`success`?e(r.absolutePath,!1):m(g(r))},[n,e]);c(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(h.length>0){if(e.key===`tab`){e.preventDefault();let t=h[v];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=h[v];t&&D(t.id+`/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),y(e=>e<=0?h.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),y(e=>e>=h.length-1?0:e+1);return}}},[h,v,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(a,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(f,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(s,{children:[(0,P.jsx)(i,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(i,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(x,{options:S,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(a,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:l,onChange:u,onSubmit:D,error:d,suggestions:h,selectedSuggestion:v})]})})})}var N,P,F,I=e((()=>{n(),l(),N=t(l(),1),d(),_(),h(),u(),w(),T(),S(),y(),D(),P=m(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{R as e,fi as t,t as n}from"./src-CDCSSo0U2.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import"./rolldown-runtime-DaDcL9Zw.js";import{R as e,fi as t,t as n}from"./src-CDCSSo0U2.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{NS as i,PS as a}from"./loadAgentsDir-x3rlgED4.js";import{b as o,c as s,g as c}from"./config-DRDuVyzE.js";import{n as l}from"./onChangeAppState-DhGKPG9g.js";import{t as u}from"./fpsMetrics-Cf_hdtiJ.js";import{t as d}from"./stats-CqfF4Axp.js";t(),a(),n(),c();var f=r();function p({getFpsMetrics:t,stats:n,initialState:r,children:a}){return(0,f.jsx)(u,{getFpsMetrics:t,children:(0,f.jsx)(d,{store:n,children:(0,f.jsx)(i,{initialState:r,onChangeAppState:l,children:(0,f.jsx)(e,{initialState:s().theme,onThemeSave:e=>o(t=>({...t,theme:e})),children:a})})})})}export{p as App};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{ix as a,rx as o}from"./loadAgentsDir-x3rlgED4.js";import{b as s,g as c}from"./config-DRDuVyzE.js";t(),n(),c(),o();var l=i();function u({customApiKeyTruncated:t,onDone:n}){function i(e){switch(e){case`yes`:s(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,approved:[...e.customApiKeyResponses?.approved??[],t]}})),n(!0);break;case`no`:s(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,rejected:[...e.customApiKeyResponses?.rejected??[],t]}})),n(!1);break}}return(0,l.jsxs)(r,{title:`Detected a custom API key in your environment`,color:`warning`,onCancel:()=>i(`no`),children:[(0,l.jsxs)(e,{children:[(0,l.jsx)(e,{bold:!0,children:`ANTHROPIC_API_KEY`}),(0,l.jsxs)(e,{children:[`: sk-ant-...`,t]})]}),(0,l.jsx)(e,{children:`Do you want to use this API key?`}),(0,l.jsx)(a,{defaultValue:`no`,defaultFocusValue:`no`,options:[{label:`Yes`,value:`yes`},{label:(0,l.jsxs)(e,{children:[`No (`,(0,l.jsx)(e,{bold:!0,children:`recommended`}),`)`]}),value:`no`}],onChange:e=>i(e),onCancel:()=>i(`no`)})]})}export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ApproveApiKey-B2HJUD7h.js";export{e as ApproveApiKey};
|
package/dist/chunks/{AssistantSessionChooser-CBLQ1v-J.js → AssistantSessionChooser-4lm4eXQ8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,I as n,P as r,_ as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as t,I as n,P as r,_ as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{cx as l,dx as u}from"./loadAgentsDir-x3rlgED4.js";import{u as d}from"./referral-CKmHHxj_.js";import{t as f}from"./Dialog-vfLXEPed.js";import{t as p}from"./ListItem-vfLXEPed.js";var m=e(a(),1);o(),f(),p(),l(),d();var h=c();function g({sessions:e,onSelect:a,onCancel:o}){u(`assistant-session-chooser`);let[c,l]=(0,m.useState)(0);return t({"select:next":()=>l(t=>(t+1)%e.length),"select:previous":()=>l(t=>(t-1+e.length)%e.length),"select:accept":()=>a(e[c].id)},{context:`Select`}),(0,h.jsx)(s,{title:`Select Assistant Session`,onCancel:o,hideInputGuide:!0,children:(0,h.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,h.jsx)(r,{children:`Multiple sessions found. Select one to attach:`}),(0,h.jsx)(n,{flexDirection:`column`,children:e.map((e,t)=>(0,h.jsx)(i,{isFocused:c===t,children:(0,h.jsxs)(n,{children:[(0,h.jsx)(r,{children:e.title||e.id.slice(0,20)}),(0,h.jsxs)(r,{dimColor:!0,children:[` [`,e.status,`]`]})]})},e.id))}),(0,h.jsx)(r,{dimColor:!0,children:`↑↓ navigate · Enter select · Esc cancel`})]})})}export{g as AssistantSessionChooser};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gt as s,H as c,I as l,Lt as u,P as d,T as f,fi as p,mt as m,ot as h,t as g,y as _}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{$C as y,An as b,Bm as x,Bo as S,Cu as C,Db as ee,FS as te,Ga as w,Hu as T,LS as ne,Mn as re,Mo as ie,Ob as E,PS as ae,QC as oe,Sm as se,Su as ce,Sy as le,Tu as D,Uu as O,XS as k,_o as ue,af as de,ax as fe,bh as pe,cx as me,dS as he,dx as ge,fS as _e,fy as A,gu as ve,hx as ye,ia as be,if as xe,ix as j,ly as Se,mx as Ce,na as we,of as Te,py as Ee,rf as De,vy as Oe,wm as ke,yh as Ae,yu as je,zm as Me}from"./loadAgentsDir-x3rlgED4.js";import{F as Ne,p as Pe,v as Fe,z as Ie}from"./debug-BrXObCdR.js";import{Jt as Le,bn as Re,it as ze,vn as Be,yn as Ve}from"./settings-BeLFUeie.js";import{S as M,T as He,b as N,d as Ue,p as We,u as Ge}from"./startupProfiler-xa3NmN7Z.js";import{l as P,o as Ke}from"./stringUtils-DGLPkqJ4.js";import{Cn as qe,Rt as Je,Tn as Ye,Ut as Xe,wn as Ze}from"./prompt-CE3sFmZV.js";import{u as F}from"./referral-CKmHHxj_.js";import{n as Qe,t as $e}from"./browser-BmZuQom6.js";import{t as et}from"./Dialog-vfLXEPed.js";import{i as tt,n as nt}from"./mappers-04gNXJ3w.js";function I(e,t,n=1e3,r=0,i){let a=()=>Ge(Math.max(0,(i??Date.now())-e-r));return(0,rt.useSyncExternalStore)((0,rt.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var rt,L=t((()=>{rt=n(p(),1),N()}));function it(e,t,n){let r=qe(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,at.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var at,ot=t((()=>{p(),g(),Ye(),at=v()}));function st(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:o}=t??{};return i?a.cross:r?a.questionMarkPrefix:o?a.warning:e===`running`?n?a.ellipsis:a.play:e===`completed`?a.tick:e===`failed`||e===`killed`?a.cross:a.bullet}function ct(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function lt(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!E(t)||process.env.USER_TYPE===`ant`&&D(t)))return n=!0,!1;return n}var ut=t((()=>{i(),C(),ee()}));function dt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=c(),a=(0,ft.useMemo)(()=>T(Ze()),[]),u=I(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);s({"confirm:yes":t},{context:`Confirmation`});let p=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},m=ue(e.prompt,`plan`),h=e.prompt.length>300?e.prompt.substring(0,297)+`…`:e.prompt,g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,R.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:p,children:(0,R.jsx)(_,{title:(0,R.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,R.jsxs)(d,{children:[e.status!==`running`&&(0,R.jsxs)(d,{color:ct(e.status),children:[st(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,R.jsxs)(d,{dimColor:!0,children:[u,g!==void 0&&g>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,We(g),` tokens`]}),v!==void 0&&v>0&&(0,R.jsxs)(R.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,R.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,R.jsxs)(f,{children:[r&&(0,R.jsx)(o,{shortcut:`←`,action:`go back`}),(0,R.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,R.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,R.jsxs)(l,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,R.jsxs)(l,{flexDirection:`column`,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,R.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,it(t,a,i)]},n))]}),m?(0,R.jsx)(l,{marginTop:1,children:(0,R.jsx)(Me,{addMargin:!1,planContent:m})}):(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,R.jsx)(d,{wrap:`wrap`,children:h})]}),e.status===`failed`&&e.error&&(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,R.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var ft,R,pt=t((()=>{ft=n(p(),1),L(),g(),F(),Ye(),O(),N(),ie(),x(),ot(),ut(),R=v()}));function mt(e,t,n,r){if(!e)return`${t} found · ${n} verified`;if(e===`synthesizing`){let e=[`${n} verified`];return r>0&&e.push(`${r} refuted`),e.push(`deduping`),e.join(` · `)}if(e===`verifying`){let e=[`${t} found`,`${n} verified`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return t>0?`${t} found`:`finding`}function ht({text:e,phase:t=0}){return(0,z.jsx)(z.Fragment,{children:[...e].map((e,n)=>(0,z.jsx)(d,{color:oe(n+t),children:e},n))})}function gt(e,t,n){let r=(0,yt.useRef)(e),i=(0,yt.useRef)(t);return n||e<r.current?r.current=e:e>r.current&&t!==i.current&&(r.current+=1,i.current=t),r.current}function _t({session:e}){let t=_e().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=m(r&&!t?bt:null),a=n?.bugsFound??0,o=n?.bugsVerified??0,s=n?.bugsRefuted??0,c=t||!r,l=gt(a,i,c),u=gt(o,i,c),f=gt(s,i,c),p=Math.floor(i/(bt*3))%7;if(e.status===`completed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsx)(d,{dimColor:!0,children:` ready · shift+↓ to view`})]});if(e.status===`failed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?mt(n.stage,l,u,f):`setting up`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:r?p:0}),(0,z.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function vt({session:e}){if(e.isRemoteReview)return(0,z.jsx)(_t,{session:e});if(e.status===`completed`)return(0,z.jsx)(d,{bold:!0,color:`success`,dimColor:!0,children:`done`});if(e.status===`failed`)return(0,z.jsx)(d,{bold:!0,color:`error`,dimColor:!0,children:`error`});if(!e.todoList.length)return(0,z.jsxs)(d,{dimColor:!0,children:[e.status,`…`]});let t=Be(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,z.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var yt,z,bt,xt=t((()=>{yt=n(p(),1),Le(),he(),g(),Ve(),y(),z=v(),bt=80}));function B({status:e,label:t,suffix:n}){return(0,V.jsxs)(d,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function St({shell:e}){switch(e.status){case`completed`:return(0,V.jsx)(B,{status:`completed`,label:`done`});case`failed`:return(0,V.jsx)(B,{status:`failed`,label:`error`});case`killed`:return(0,V.jsx)(B,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,V.jsx)(B,{status:`running`})}}var V,Ct=t((()=>{g(),V=v()}));function wt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,H.jsxs)(d,{children:[M(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,H.jsx)(St,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,H.jsx)(d,{children:(0,H.jsx)(vt,{session:e})}):(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),M(e.title,n,!0),(0,H.jsx)(d,{dimColor:!0,children:` · `}),(0,H.jsx)(vt,{session:e})]});case`local_agent`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,H.jsxs)(d,{children:[M(t.workflowName??e.summary??e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`running`?`${t.agentCount} ${P(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`monitor_mcp`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${P(t,`file`)}`:`${e.sessionsReviewing} ${P(e.sessionsReviewing,`session`)}`;return(0,H.jsxs)(d,{children:[e.description,` `,(0,H.jsxs)(d,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var H,Tt=t((()=>{p(),g(),N(),Ke(),Le(),xt(),Ct(),H=v()}));function Et({task:e,onDone:t,onBack:n,onKill:r}){let i=I(e.startTime,e.status===`running`,1e3,0);s({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},c=e.turns.filter(e=>e.text!==``),u=c.slice(-6),p=c.length-u.length;return(0,U.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,U.jsx)(_,{title:`Memory consolidation`,subtitle:(0,U.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,P(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,P(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(f,{children:[n&&(0,U.jsx)(o,{shortcut:`←`,action:`go back`}),(0,U.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,U.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,U.jsxs)(d,{children:[(0,U.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,U.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,U.jsx)(d,{color:`success`,children:e.status}):(0,U.jsx)(d,{color:`error`,children:e.status})]}),u.length===0?(0,U.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,U.jsxs)(U.Fragment,{children:[p>0&&(0,U.jsxs)(d,{dimColor:!0,children:[`(`,p,` earlier `,P(p,`turn`),`)`]}),u.map((e,t)=>(0,U.jsxs)(l,{flexDirection:`column`,children:[(0,U.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,U.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,P(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var U,Dt=t((()=>{p(),L(),g(),F(),Ke(),U=v()}));function Ot(e,t){if(e===`ExitPlanMode`)return`Review the plan in Claude Code on the web`;if(!t||typeof t!=`object`)return e;if(e===`AskUserQuestion`&&`questions`in t){let e=t.questions;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`){let t=`question`in e[0]&&typeof e[0].question==`string`&&e[0].question?e[0].question:`header`in e[0]&&typeof e[0].header==`string`?e[0].header:null;if(t)return`Answer in browser: ${He(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${He(n.replace(/\s+/g,` `).trim(),60)}`;return e}function kt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?Pt[o]:`running`:e.status,c=I(e.startTime,i,1e3,0,e.endTime),{agentsWorking:f,toolCalls:p,lastToolCall:m}=(0,W.useMemo)(()=>{let t=0,n=0,r=null;for(let i of e.log){if(i.type!==`assistant`)continue;let e=i.message?.content??[];for(let i of e)i.type===`tool_use`&&(n++,r=i,(i.name===`Agent`||i.name===`Task`)&&t++)}return{agentsWorking:1+t,toolCalls:n,lastToolCall:r?Ot(r.name,r.input):null}},[e.log]),h=A(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,W.useState)(!1);return v?(0,G.jsx)(_,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This will terminate the Claude Code on the web session.`}),(0,G.jsx)(j,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,G.jsx)(_,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[o===`plan_ready`?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultraplan`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,c,` · `,s]})]}),onCancel:g,color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsxs)(d,{children:[o===`plan_ready`&&(0,G.jsxs)(d,{color:`success`,children:[a.tick,` `]}),f,` `,P(f,`agent`),` `,o?Ft[o]:`working`,` · `,p,` tool`,` `,P(p,`call`)]}),m&&(0,G.jsx)(d,{dimColor:!0,children:m}),(0,G.jsx)(u,{url:h,children:(0,G.jsx)(d,{dimColor:!0,children:h})}),(0,G.jsx)(j,{options:[{label:`Review in Claude Code on the web`,value:`open`},...r&&i?[{label:`Stop ultraplan`,value:`stop`}]:[],{label:`Back`,value:`back`}],onChange:e=>{switch(e){case`open`:Qe(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function At({stage:e,completed:t,hasProgress:n}){let r=e?It.indexOf(e):-1,i=!t&&!n;return(0,G.jsxs)(d,{children:[i?(0,G.jsx)(d,{color:`background`,children:`Setup`}):(0,G.jsx)(d,{dimColor:!0,children:`Setup`}),(0,G.jsx)(d,{dimColor:!0,children:` → `}),It.map((e,n)=>{let a=!t&&!i&&n===r;return(0,G.jsxs)(W.Fragment,{children:[n>0&&(0,G.jsx)(d,{dimColor:!0,children:` → `}),a?(0,G.jsx)(d,{color:`background`,children:Lt[e]}):(0,G.jsx)(d,{dimColor:!0,children:Lt[e]})]},e)}),t&&(0,G.jsx)(d,{color:`success`,children:` ✓`})]})}function jt(e){let t=e.reviewProgress;if(!t)return e.status===`completed`?`done`:`setting up`;let n=t.bugsVerified,r=t.bugsRefuted??0;if(e.status===`completed`){let e=[`${n} ${P(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return mt(t.stage,t.bugsFound,n,r)}function Mt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[s,c]=(0,W.useState)(!1),p=I(e.startTime,a,1e3,0,e.endTime),m=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??m,g=A(e.sessionId),v=i?`ready`:a?`running`:e.status;if(s)return(0,G.jsx)(_,{title:`Stop ultrareview?`,onCancel:()=>c(!1),color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded.`}),(0,G.jsx)(j,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):c(!1)}})]})});let y=i?[{label:`Open in Claude Code on the web`,value:`open`},{label:`Dismiss`,value:`dismiss`}]:[{label:`Open in Claude Code on the web`,value:`open`},...r&&a?[{label:`Stop ultrareview`,value:`stop`}]:[],{label:`Back`,value:`back`}];return(0,G.jsx)(_,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultrareview`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,p,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[(0,G.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,G.jsx)(o,{shortcut:`Esc`,action:`go back`})]}),children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(At,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsx)(d,{children:jt(e)}),(0,G.jsx)(u,{url:g,children:(0,G.jsx)(d,{dimColor:!0,children:g})})]}),(0,G.jsx)(j,{options:y,onChange:e=>{switch(e){case`open`:Qe(g),t();break;case`stop`:c(!0);break;case`back`:h();break;case`dismiss`:m();break}}})]})})}function Nt({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,s]=(0,W.useState)(!1),[c,p]=(0,W.useState)(null),m=(0,W.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:S(tt(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,G.jsx)(kt,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,G.jsx)(Mt,{session:e,onDone:n,onBack:r,onKill:i});let h=()=>n(`Remote session details dismissed`,{display:`system`}),g=e=>{e.key===` `?(e.preventDefault(),n(`Remote session details dismissed`,{display:`system`})):e.key===`left`&&r?(e.preventDefault(),r()):e.key===`t`&&!a?(e.preventDefault(),v()):e.key===`return`&&(e.preventDefault(),h())};async function v(){s(!0),p(null);try{await le(e.sessionId)}catch(e){p(Ne(e))}finally{s(!1)}}let y=He(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,G.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,G.jsxs)(_,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[r&&(0,G.jsx)(o,{shortcut:`←`,action:`go back`}),(0,G.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,G.jsx)(o,{shortcut:`t`,action:`teleport`})]}),children:[(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,G.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,G.jsx)(d,{color:`success`,children:b}):(0,G.jsx)(d,{color:`error`,children:b})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Runtime`}),`: `,Ge((e.endTime??Date.now())-e.startTime)]}),(0,G.jsxs)(d,{wrap:`truncate-end`,children:[(0,G.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,G.jsx)(vt,{session:e})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,G.jsx)(u,{url:A(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:A(e.sessionId)})})]})]}),e.log.length>0&&(0,G.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,G.jsx)(l,{flexDirection:`column`,height:10,overflowY:`hidden`,children:m.map((e,n)=>(0,G.jsx)(se,{message:e,lookups:w,addMargin:n>0,tools:t.options.tools,commands:t.options.commands,verbose:t.options.verbose,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,style:`condensed`,isTranscriptMode:!1,isStatic:!0},n))}),(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,m.length,` of `,e.log.length,` messages`]})})]}),c&&(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{color:`error`,children:[`Teleport failed: `,c]})}),a&&(0,G.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var W,G,Pt,Ft,It,Lt,Rt=t((()=>{i(),W=n(p(),1),Le(),L(),g(),Ee(),ze(),Je(),Xe(),$e(),Ie(),N(),nt(),ie(),Ke(),Oe(),fe(),ke(),xt(),G=v(),Pt={needs_input:`input required`,plan_ready:`ready`},Ft={needs_input:`waiting`,plan_ready:`done`},It=[`finding`,`verifying`,`synthesizing`],Lt={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function zt(e){let t=b(e.id);try{let e=await Fe(t,Ht);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Bt({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=h(),[a,c]=(0,K.useState)(()=>zt(e)),u=(0,K.useDeferredValue)(a);(0,K.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(zt(t)),1e3,c,e);return()=>clearInterval(t)},[e.id,e.status]);let p=()=>t(`Shell details dismissed`,{display:`system`});s({"confirm:yes":p},{context:`Confirmation`});let m=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},g=e.kind===`monitor`,v=He(e.command,280);return(0,q.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:m,children:(0,q.jsxs)(_,{title:g?`Monitor details`:`Shell details`,onCancel:p,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(f,{children:[r&&(0,q.jsx)(o,{shortcut:`←`,action:`go back`}),(0,q.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,q.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:[(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,q.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,q.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Runtime:`}),` `,Ge((e.endTime??Date.now())-e.startTime)]}),(0,q.jsxs)(d,{wrap:`wrap`,children:[(0,q.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsx)(d,{bold:!0,children:`Output:`}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,q.jsx)(Vt,{outputPromise:u,columns:i})})]})]})})}function Vt({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,K.use)(e);if(!n)return(0,q.jsx)(d,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
|
|
2
|
+
`,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(l,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,q.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,q.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${Ue(r)}`:``]})]})}var K,q,Ht,Ut=t((()=>{K=n(p(),1),k(),g(),F(),N(),Pe(),re(),q=v(),Ht=8192})),Wt=t((()=>{g()})),Gt=t((()=>{g()})),Kt=r({MonitorMcpDetailDialog:()=>qt});function qt({task:e,onBack:t,onKill:n}){let r=I(e.startTime,e.status===`running`,1e3,0);return s({},{context:`MonitorMcpDetail`}),(0,J.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:r=>{r.key===`left`&&t?(r.preventDefault(),t()):r.key===`x`&&e.status===`running`&&n&&(r.preventDefault(),n())},children:(0,J.jsx)(_,{title:`MCP Monitor`,subtitle:(0,J.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,J.jsxs)(f,{children:[t&&(0,J.jsx)(o,{shortcut:`←`,action:`go back`}),(0,J.jsx)(o,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,J.jsx)(d,{color:`ansi:green`,children:e.status}):(0,J.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var J,Jt=t((()=>{p(),L(),g(),F(),Wt(),et(),Gt(),J=v()}));function Yt(e,t){return Object.values(e??{}).filter(E).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Xt({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=te(e=>e.tasks),i=te(e=>e.foregroundedTaskId),a=ne(),c=ye(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),u=r,p=(0,X.useRef)(!1),[m,h]=(0,X.useState)(()=>{if(n)return p.current=!0,{mode:`detail`,itemId:n};let e=Yt(u,i);return e.length===1?(p.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[g,v]=(0,X.useState)(0);ge(`background-tasks-dialog`);let{bashTasks:y,remoteSessions:b,agentTasks:x,workflowTasks:S,mcpMonitors:C,dreamTasks:ee,allSelectableItems:w}=(0,X.useMemo)(()=>{let e=Object.values(u??{}).filter(E).map(Zt).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`remote_agent`),r=e.filter(e=>e.type===`local_agent`&&e.id!==i),a=e.filter(e=>e.type===`local_workflow`),o=e.filter(e=>e.type===`monitor_mcp`),s=e.filter(e=>e.type===`dream`);return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:a,mcpMonitors:o,dreamTasks:s,allSelectableItems:[...t,...o,...n,...r,...a,...s]}},[u,i]),T=w[g]??null;s({"confirm:previous":()=>v(e=>Math.max(0,e-1)),"confirm:next":()=>v(e=>Math.min(w.length-1,e+1)),"confirm:yes":()=>{let e=w[g];e&&h({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:m.mode===`list`});let re=t=>{if(m.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=w[g];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?ie(n.id):n.type===`local_agent`&&n.status===`running`?ae(n.id):n.type===`local_workflow`&&n.status===`running`&&Q?Q(n.id,a):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,a):n.type===`dream`&&n.status===`running`?oe(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?be(n.id,n.task.sessionId,a):se(n.id)))};async function ie(e){await ve.kill(e,a)}async function ae(e){await ce.kill(e,a)}async function oe(e){await de.kill(e,a)}async function se(e){await Se.kill(e,a)}let le=(0,X.useEffectEvent)(e);(0,X.useEffect)(()=>{if(m.mode!==`list`){let e=(u??{})[m.itemId];(!e||e.type!==`local_workflow`&&!E(e))&&(p.current?le(`Background tasks dialog dismissed`,{display:`system`}):h({mode:`list`}))}let e=w.length;g>=e&&e>0&&v(e-1)},[m,u,g,w,le]);let D=()=>{p.current&&w.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(p.current=!1,h({mode:`list`}))};if(m.mode!==`list`&&u){let n=u[m.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Z.jsx)(Bt,{shell:n,onDone:e,onKillShell:()=>void ie(n.id),onBack:D},`shell-${n.id}`);case`local_agent`:return(0,Z.jsx)(dt,{agent:n,onDone:e,onKillAgent:()=>void ae(n.id),onBack:D},`agent-${n.id}`);case`remote_agent`:return(0,Z.jsx)(Nt,{session:n,onDone:e,toolUseContext:t,onBack:D,onKill:n.status===`running`?n.isUltraplan?()=>void be(n.id,n.sessionId,a):()=>void se(n.id):void 0},`session-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&Q?()=>Q(n.id,a):void 0;return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),D()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Z.jsx)(_,{title:n.workflowName,subtitle:(0,Z.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:D,inputGuide:()=>(0,Z.jsxs)(f,{children:[(0,Z.jsx)(o,{shortcut:`←`,action:`go back`}),(0,Z.jsx)(o,{shortcut:`Esc`,action:`close`}),e&&(0,Z.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Qt?(0,Z.jsx)(Qt,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,a):void 0,onBack:D},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Z.jsx)(Et,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:D,onKill:n.status===`running`?()=>void oe(n.id):void 0},`dream-${n.id}`)}}let O=Be(y,e=>e.status===`running`),k=Be(b,e=>e.status===`running`||e.status===`pending`)+Be(x,e=>e.status===`running`),ue=Re([...O>0?[(0,Z.jsxs)(d,{children:[O,` `,O===1?`active shell`:`active shells`]},`shells`)]:[],...k>0?[(0,Z.jsxs)(d,{children:[k,` `,k===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Z.jsx)(d,{children:` · `},`separator-${e}`)),fe=[(0,Z.jsx)(o,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Z.jsx)(o,{shortcut:`Enter`,action:`view`},`enter`),...(T?.type===`local_bash`||T?.type===`local_agent`||T?.type===`local_workflow`||T?.type===`monitor_mcp`||T?.type===`dream`||T?.type===`remote_agent`)&&T.status===`running`?[(0,Z.jsx)(o,{shortcut:`x`,action:`stop`},`kill`)]:[],...x.some(e=>e.status===`running`)?[(0,Z.jsx)(o,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Z.jsx)(o,{shortcut:`←/Esc`,action:`close`},`esc`)],pe=()=>e(`Background tasks dialog dismissed`,{display:`system`});function me(e){return e.pending?(0,Z.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(f,{children:fe})}return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:re,children:(0,Z.jsx)(_,{title:`Background tasks`,subtitle:(0,Z.jsx)(Z.Fragment,{children:ue}),onCancel:pe,color:`background`,inputGuide:me,children:w.length===0?(0,Z.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Z.jsxs)(l,{flexDirection:`column`,children:[y.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,children:[(b.length>0||x.length>0)&&(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,y.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:y.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),C.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,C.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:C.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),b.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,b.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:b.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),x.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,x.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:x.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),S.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,S.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:S.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),ee.length>0&&(0,Z.jsx)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0||S.length>0),children:(0,Z.jsx)(l,{flexDirection:`column`,children:ee.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})})]})})})}function Zt(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.kind===`monitor`?e.description:e.command,status:e.status,task:e};case`remote_agent`:return{id:e.id,type:`remote_agent`,label:e.title,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`monitor_mcp`:return{id:e.id,type:`monitor_mcp`,label:e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function Y({item:e,isSelected:t}){let{columns:n}=h(),r=Math.max(30,n-26);return(0,Z.jsxs)(l,{flexDirection:`row`,children:[(0,Z.jsx)(d,{children:t?a.pointer+` `:` `}),(0,Z.jsx)(d,{color:t?`suggestion`:void 0,children:(0,Z.jsx)(wt,{task:e.task,maxActivityWidth:r})})]})}var X,Z,Q,$,Qt,$t=t((()=>{i(),X=n(p(),1),k(),ae(),Te(),C(),je(),Ee(),ee(),Ve(),we(),me(),g(),F(),Ce(),pt(),Tt(),Dt(),Rt(),Ut(),Z=v(),Q=(xe(),e(De))?.killWorkflowTask??null,$=(pe(),e(Ae))?.killMonitorMcp??null,Qt=(Jt(),e(Kt)).MonitorMcpDetailDialog}));export{L as a,lt as i,$t as n,I as o,ut as r,Xt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,fi as i,kt as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,fi as i,kt as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$S as l,QS as u,ix as d,rx as f}from"./loadAgentsDir-x3rlgED4.js";import{g as p,x as m}from"./settings-BeLFUeie.js";import{n as h,r as g}from"./analytics-BotDBGh0.js";var _=e(i(),1);h(),o(),l(),p(),f();var v=c();function y({onAccept:e}){let[i,o]=_.useState(null);_.useEffect(()=>{if(i!==null){let e=i,t=setTimeout(()=>u(e));return()=>clearTimeout(t)}},[i]),_.useEffect(()=>{g(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:g(`tengu_bypass_permissions_mode_dialog_accept`,{}),m(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let l=(0,_.useCallback)(()=>{o(0)},[]);return i===null?(0,v.jsxs)(s,{title:`WARNING: Claude Code running in Bypass Permissions mode`,color:`error`,onCancel:l,children:[(0,v.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(r,{children:[`In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(a,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(r,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(n,{url:`https://code.claude.com/docs/en/security`})]}),(0,v.jsx)(d,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./ClaudeMdExternalIncludesDialog-BZSyRqeq.js";e();export{t as ClaudeMdExternalIncludesDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{ix as l,rx as u}from"./loadAgentsDir-x3rlgED4.js";import{g as d,y as f}from"./config-DRDuVyzE.js";import{n as p,r as m}from"./analytics-BotDBGh0.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:a}){g.useEffect(()=>{m(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(m(`tengu_claude_md_external_includes_dialog_declined`,{}),f(e=>({...e,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!0}))):(m(`tengu_claude_md_external_includes_dialog_accepted`,{}),f(e=>({...e,hasClaudeMdExternalIncludesApproved:!0,hasClaudeMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(s,{title:`Allow external CLAUDE.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's CLAUDE.md imports files outside the current working directory. Never allow this for third-party repositories.`}),a&&a.length>0&&(0,_.jsxs)(n,{flexDirection:`column`,children:[(0,_.jsx)(i,{dimColor:!0,children:`External imports:`}),a.map((e,t)=>(0,_.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Important: Only use Claude Code with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(r,{url:`https://code.claude.com/docs/en/security`}),` `]}),(0,_.jsx)(l,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var g,_,v=e((()=>{g=t(a(),1),p(),o(),d(),u(),_=c()}));export{v as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cx as e,wx as t}from"./loadAgentsDir-x3rlgED4.js";t();export{e as ConsoleOAuthFlow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{t as n}from"./semver-DQo45qGo.js";import{I as r,P as i,fi as a,hn as o,p as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{t as n}from"./semver-DQo45qGo.js";import{I as r,P as i,fi as a,hn as o,p as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{$S as f,ZS as p,jr as m,lr as h}from"./loadAgentsDir-x3rlgED4.js";import{n as g,t as _}from"./cwd-CYmmnQVS.js";import{F as v,a as y,l as b,z as x}from"./debug-BrXObCdR.js";import{r as S,t as C}from"./execFileNoThrow-D244NytW.js";import{_ as w,f as T}from"./file-DcZWPH2V.js";import{n as E,r as D}from"./semver-BMRJYn3q.js";import{n as O,t as k}from"./browser-BmZuQom6.js";import{join as A}from"path";import{readdir as j}from"fs/promises";function M(){let e=[process.argv[1]||``,process.execPath||``],t=[`/build-ant/`,`/build-ant-native/`,`/build-external/`,`/build-external-native/`];return e.some(e=>t.some(t=>e.includes(t)))}function N(e){let t=M()?`claude-dev`:`claude`,n=new URL(`${t}://resume`);return n.searchParams.set(`session`,e),n.searchParams.set(`cwd`,_()),n.toString()}async function P(){if(M())return!0;let e=process.platform;if(e===`darwin`)return w(`/Applications/Claude.app`);if(e===`linux`){let{code:e,stdout:t}=await C(`xdg-mime`,[`query`,`default`,`x-scheme-handler/claude`]);return e===0&&t.trim().length>0}else if(e===`win32`){let{code:e}=await C(`reg`,[`query`,`HKEY_CLASSES_ROOT\\claude`,`/ve`]);return e===0}return!1}async function F(){let e=process.platform;if(e===`darwin`){let{code:e,stdout:t}=await C(`defaults`,[`read`,`/Applications/Claude.app/Contents/Info.plist`,`CFBundleShortVersionString`]);if(e!==0)return null;let n=t.trim();return n.length>0?n:null}else if(e===`win32`){let e=process.env.LOCALAPPDATA;if(!e)return null;let t=A(e,`AnthropicClaude`);try{let e=(await j(t)).filter(e=>e.startsWith(`app-`)).map(e=>e.slice(4)).filter(e=>(0,z.coerce)(e)!==null).sort((e,t)=>{let n=(0,z.coerce)(e),r=(0,z.coerce)(t);return n.compare(r)});return e.length>0?e[e.length-1]:null}catch{return null}}return null}async function I(){if(!await P())return{status:`not-installed`};let e;try{e=await F()}catch{return{status:`ready`,version:`unknown`}}if(!e)return{status:`ready`,version:`unknown`};let t=(0,z.coerce)(e);return!t||!E(t.version,B)?{status:`version-too-old`,version:e}:{status:`ready`,version:e}}async function L(e){let t=process.platform;if(b(`Opening deep link: ${e}`),t===`darwin`){if(M()){let{code:t}=await C(`osascript`,[`-e`,`tell application "Electron" to open location "${e}"`]);return t===0}let{code:t}=await C(`open`,[e]);return t===0}else if(t===`linux`){let{code:t}=await C(`xdg-open`,[e]);return t===0}else if(t===`win32`){let{code:t}=await C(`cmd`,[`/c`,`start`,``,e]);return t===0}return!1}async function R(){let e=d();if(!await P())return{success:!1,error:`Claude Desktop is not installed. Install it from https://claude.ai/download`};let t=N(e);return await L(t)?{success:!0,deepLinkUrl:t}:{success:!1,error:`Failed to open Claude Desktop. Please try opening it manually.`,deepLinkUrl:t}}var z,B,V=e((()=>{z=n(),u(),g(),y(),S(),T(),D(),B=`1.1.2396`}));function H(){switch(process.platform){case`win32`:return`https://claude.ai/api/desktop/win32/x64/exe/latest/redirect`;default:return`https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect`}}function U({onDone:e}){let[t,n]=(0,W.useState)(`checking`),[a,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(``);return o(n=>{if(t===`error`){e(a??`Unknown error`,{display:`system`});return}t===`prompt-download`&&(n===`y`||n===`Y`?(O(H()).catch(()=>{}),e(`Starting download. Re-run /desktop once you\u2019ve installed the app.\nLearn more at ${K}`,{display:`system`})):(n===`n`||n===`N`)&&e(`The desktop app is required for /desktop. Learn more at ${K}`,{display:`system`}))}),(0,W.useEffect)(()=>{async function t(){n(`checking`);let t=await I();if(t.status===`not-installed`){u(`Claude Desktop is not installed.`),n(`prompt-download`);return}if(t.status===`version-too-old`){u(`Claude Desktop needs to be updated (found v${t.version}, need v1.1.2396+).`),n(`prompt-download`);return}n(`flushing`),await h(),n(`opening`);let r=await R();if(!r.success){c(r.error??`Failed to open Claude Desktop`),n(`error`);return}n(`success`),setTimeout(async e=>{e(`Session transferred to Claude Desktop`,{display:`system`}),await p(0,`other`)},500,e)}t().catch(e=>{c(v(e)),n(`error`)})},[e]),t===`error`?(0,G.jsxs)(r,{flexDirection:`column`,paddingX:2,children:[(0,G.jsxs)(i,{color:`error`,children:[`Error: `,a]}),(0,G.jsx)(i,{dimColor:!0,children:`Press any key to continue…`})]}):t===`prompt-download`?(0,G.jsxs)(r,{flexDirection:`column`,paddingX:2,children:[(0,G.jsx)(i,{children:l}),(0,G.jsx)(i,{children:`Download now? (y/n)`})]}):(0,G.jsx)(s,{message:{checking:`Checking for Claude Desktop…`,flushing:`Saving session…`,opening:`Opening Claude Desktop…`,success:`Opening in Claude Desktop…`}[t]})}var W,G,K,q=e((()=>{W=t(a(),1),c(),V(),k(),x(),f(),m(),G=l(),K=`https://clau.de/desktop`}));export{q as n,U as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{C as i,Gt as a,I as o,P as s,T as c,fi as l,ot as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{C as i,Gt as a,I as o,P as s,T as c,fi as l,ot as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Rf as m,XS as h,cx as g,dx as ee,hx as te,mx as _,zf as v}from"./loadAgentsDir-x3rlgED4.js";import{n as y,t as b}from"./cwd-CYmmnQVS.js";import{_ as x,d as S,g as C,s as w}from"./git-Do0wJvux.js";import{r as T,t as E}from"./execFileNoThrow-D244NytW.js";import{f as D,y as O}from"./file-DcZWPH2V.js";import{b as k,w as ne}from"./startupProfiler-xa3NmN7Z.js";import{l as A,o as j}from"./stringUtils-DGLPkqJ4.js";import{i as re}from"./detectRepository-BPr0VWNO.js";import{u as ie}from"./referral-CKmHHxj_.js";import{join as ae,resolve as oe}from"path";import{access as M}from"fs/promises";async function se(){if(!await S()||await P())return null;let{stdout:e,code:t}=await E(C(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:F,preserveOutputOnError:!1});if(t===0){let t=de(e);if(t&&t.filesCount>z)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await E(C(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=le(n),o=I-a.size;if(o>0){let e=await ue(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function ce(){if(!await S()||await P())return new Map;let{stdout:e,code:t}=await E(C(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?N(e):new Map}function le(e){let t=e.trim().split(`
|
|
2
2
|
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function N(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
|
|
3
3
|
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(``+t),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function P(){let e=await w(b());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>M(ae(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function ue(e){let{stdout:t,code:n}=await E(C(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:F,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
|
|
4
4
|
`).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function de(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var F,I,L,R,z,B=e((()=>{y(),re(),T(),D(),x(),F=5e3,I=50,L=1e6,R=400,z=500}));function V(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(new Map),[i,a]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([se(),ce()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(l(),1),B(),U=400}));function pe(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function W(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:n.slice(0,29)+`…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(!(!r||r.type!==`user`)){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(pe(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&W(e)){let t=e.content.split(`
|
|
5
5
|
`),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+`+e)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=me(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var K,_e=e((()=>{K=t(l(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:c}){let{columns:l}=u(),{firstLine:d,fileContent:f}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=O(oe(b(),e));return{firstLine:t?.split(`
|
|
6
|
-
`)[0]??null,fileContent:t??void 0}},[e]);return c?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),(0,J.jsx)(s,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(s,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),a&&(0,J.jsx)(s,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(s,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(
|
|
6
|
+
`)[0]??null,fileContent:t??void 0}},[e]);return c?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),(0,J.jsx)(s,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(s,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),a&&(0,J.jsx)(s,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(s,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(m,{patch:t,filePath:e,firstLine:d,fileContent:f,dim:!1,width:l-2-2},n))}),a&&(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(l(),1),h(),d(),y(),D(),v(),J=p()}));function be({files:e,selectedIndex:t}){let{columns:n}=u(),{startIndex:r,endIndex:i}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(s,{dimColor:!0,children:`No changed files`});let a=e.slice(r,i),c=r>0,l=i<e.length,d=e.length>Z,f=Math.max(20,n-16-3-4);return(0,X.jsxs)(o,{flexDirection:`column`,children:[d&&(0,X.jsx)(s,{dimColor:!0,children:c?` ↑ ${r} more ${A(r,`file`)}`:` `}),a.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:f},e.path)),d&&(0,X.jsx)(s,{dimColor:!0,children:l?` ↓ ${e.length-i} more ${A(e.length-i,`file`)}`:` `})]})}function xe({file:e,isSelected:t,maxPathWidth:n}){let i=ne(e.path,n),a=`${t?r.pointer+` `:` `}${i}`;return(0,X.jsxs)(o,{flexDirection:`row`,children:[(0,X.jsx)(s,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(o,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(s,{children:[e.linesAdded>0&&(0,X.jsxs)(s,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(s,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(s,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(l(),1),h(),d(),k(),j(),X=p(),Z=5}));function we(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function Te({messages:e,onDone:t}){let n=V(),r=ge(e),[i,l]=(0,Q.useState)(`list`),[u,d]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[p],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[u],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{p>=h.length&&m(Math.max(0,h.length-1))},[h.length,p]);let x=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{x.current!==p&&(d(0),x.current=p)},[p]),ee(`diff-dialog`),a({"diff:previousSource":()=>{i===`detail`?l(`list`):i===`list`&&h.length>1&&m(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&h.length>1&&m(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{i===`detail`&&l(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&l(`detail`)},"diff:previousFile":()=>{i===`list`&&d(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&d(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(s,{dimColor:!0,children:[v.stats.filesCount,` `,A(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(s,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(s,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,T=h.length>1?(0,$.jsxs)(o,{children:[p>0&&(0,$.jsx)(s,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(s,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<h.length-1&&(0,$.jsx)(s,{dimColor:!0,children:` ▶`})]}):null,E=te(`diff:dismiss`,`DiffDialog`,`esc`),D=v.loading?`Loading diff…`:_?`No file changes in this turn`:v.stats&&v.stats.filesCount>0&&v.files.length===0?`Too many files to display details`:`Working tree is clean`,O=(0,$.jsxs)(s,{children:[C,w&&(0,$.jsxs)(s,{dimColor:!0,children:[` `,w]})]});function k(){i===`detail`?l(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(f,{title:O,onCancel:k,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[h.length>1&&(0,$.jsx)(s,{children:`←/→ source`}),(0,$.jsx)(s,{children:`↑/↓ select`}),(0,$.jsx)(s,{children:`Enter view`}),(0,$.jsxs)(s,{children:[E,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(s,{children:`← back`}),(0,$.jsxs)(s,{children:[E,` close`]})]}),children:[T,S,v.files.length===0?(0,$.jsx)(o,{marginTop:1,children:(0,$.jsx)(s,{dimColor:!0,children:D})}):i===`list`?(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:u})}):(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(ve,{filePath:y?.path||``,hunks:b,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(l(),1),g(),fe(),_e(),d(),ie(),_(),j(),ye(),Ce(),$=p()}))();export{Te as DiffDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./Doctor-CuKJ-nGt.js";e();export{t as Doctor};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Gt as o,I as s,P as c,fi as l,t as u,x as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{en as p,nt as m}from"./state-ix0xIunV.js";import{AE as h,EE as g,FS as _,Gp as ee,Hp as te,Ic as v,Jd as ne,Lc as y,ME as b,PS as x,Qc as S,SS as C,Up as w,Vp as re,Wp as T,Xd as E,Yd as ie,Zc as D,aO as ae,bS as oe,kE as se,oO as ce,pD as O,uD as k,xS as le,yS as A}from"./loadAgentsDir-x3rlgED4.js";import{H as j,g as M,n as N,z as P}from"./settings-BeLFUeie.js";import{_ as F,f as I}from"./file-DcZWPH2V.js";import{l as L,o as R}from"./stringUtils-DGLPkqJ4.js";import{Kn as z,Un as B,_ as V,u as H}from"./model-CZViyZnE.js";import{n as U,t as W}from"./ValidationErrorsList-BYsDtAvX.js";import{u as ue}from"./referral-CKmHHxj_.js";import{d as de,f as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,u as G}from"./pidLock-CbC_il6r.js";import{a as ye,i as be}from"./xdg-DcF9ejUM.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import{n as Ce,t as we}from"./McpParsingWarnings-Du5IxZos.js";import{n as Te,t as Ee}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{n as De,t as Oe}from"./useSettingsErrors-B9vOZL41.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-C6R5zOUe.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-CEGvdm5d.js";import{join as q}from"path";function Ne(){if(!C())return null;let e=A();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(c,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`Location: `}),(0,J.jsx)(c,{dimColor:!0,children:oe()})]}),(0,J.jsxs)(s,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`error`,children:`[Error]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{l(),u(),le(),J=f()}));function Fe(){if(!k.isSupportedPlatform()||!k.isSandboxEnabledInSettings())return null;let e=k.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(s,{flexDirection:`column`,children:[(0,Y.jsx)(c,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(c,{children:[`└ Status: `,(0,Y.jsx)(c,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(c,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(c,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(c,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{l(),u(),O(),Y=f()}));async function Le(){let e=se(await h());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`claudemd_files`,severity:`warning`,message:e.length===1?`Large CLAUDE.md file detected (${e[0].content.length.toLocaleString()} chars > ${g.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${g.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:g}}async function X(e){if(!e)return null;let t=je(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:y(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function Re(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await D(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+y(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function ze(e){let t=Ae(await e(),{sandboxAutoAllowEnabled:k.isSandboxingEnabled()&&k.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${j(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Be(e,t,n){let[r,i,a,o]=await Promise.all([Le(),X(t),Re(e,n,t),ze(n)]);return{claudeMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ve=e((()=>{v(),S(),b(),V(),P(),ke(),O(),Me(),R(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(c,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(c,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(c,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=_(e=>e.agentDefinitions),r=_(e=>e.mcp.tools),i=_(e=>e.toolPermissionContext),l=_(e=>e.plugins.errors);xe();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S=De(),C=(0,Q.useMemo)(()=>G().then(e=>(e.installationType===`native`?fe:he)().catch(()=>({latest:null,stable:null}))),[]),w=N()?.autoUpdatesChannel??`latest`,T=S.filter(e=>e.mcpErrorMetadata===void 0),E=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:re,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:ne,upperLimit:ie},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...B(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=ee(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{G().then(p),(async()=>{let e=q(n(),`agents`),r=q(m(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([F(e),F(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s};g(d);let f=await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(y(f),_e()){let e=q(be(),`claude`,`locks`),t=ge(e),n=ve(e);x({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else x({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let D=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return o({"confirm:yes":D,"confirm:no":D},{context:`Confirmation`}),f?(0,$.jsxs)(d,{children:[(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(c,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(c,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(c,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(c,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(c,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(c,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.ripgrepStatus.note&&(0,$.jsxs)(c,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsxs)(c,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
|
|
2
|
+
`)[0]]}),(0,$.jsx)(c,{dimColor:!0,children:f.recommendation.split(`
|
|
3
|
+
`)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsx)(c,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),f.warnings.map((e,t)=>(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsxs)(c,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(c,{children:[`Fix: `,e.fix]})]},t))]}),T.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(c,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:T})]})]}),(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Updates`}),(0,$.jsxs)(c,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(c,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(c,{children:[`└ Auto-update channel: `,w]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:C})})]}),(0,$.jsx)(Fe,{}),(0,$.jsx)(we,{}),(0,$.jsx)(Ne,{}),E.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Environment Variables`}),E.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(c,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),b?.enabled&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Version Locks`}),b.staleLocksCleaned>0&&(0,$.jsxs)(c,{dimColor:!0,children:[`└ Cleaned `,b.staleLocksCleaned,` stale lock(s)`]}),b.locks.length===0?(0,$.jsx)(c,{dimColor:!0,children:`└ No active version locks`}):b.locks.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(c,{children:`(running)`}):(0,$.jsx)(c,{color:`warning`,children:`(stale)`})]},t))]}),h?.failedFiles&&h.failedFiles.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ Failed to parse `,h.failedFiles.length,` agent file(s):`]}),h.failedFiles.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),l.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ `,l.length,` plugin error(s) detected:`]}),l.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ae(e)]},t))]}),v?.unreachableRulesWarning&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.unreachableRulesWarning.message]})]}),v.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v&&(v.claudeMdWarning||v.agentWarning||v.mcpWarning)&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Context Usage Warnings`}),v.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.claudeMdWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Files:`]}),v.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.agentWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Top contributors:`]}),v.agentWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),v.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,v.mcpWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ MCP servers:`]}),v.mcpWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(s,{children:(0,$.jsx)(Ee,{})})]}):(0,$.jsx)(d,{children:(0,$.jsx)(c,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(l(),1),Pe(),Ce(),z(),r(),p(),u(),Te(),Ie(),U(),Oe(),Se(),ue(),x(),ce(),pe(),Ve(),de(),T(),I(),me(),M(),w(),E(),ye(),$=f()}));export{We as n,Ue as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$S as l,Ct as u,DD as d,ED as f,Eb as p,Ei as m,Et as h,Lp as g,Ot as _,Rp as v,ZS as y,ax as b,gt as x,ix as S,jr as C,kt as w,nb as T,rb as E,wb as D}from"./loadAgentsDir-x3rlgED4.js";import{a as O,l as k}from"./debug-BrXObCdR.js";import{r as A,t as j}from"./execFileNoThrow-D244NytW.js";import{n as M,r as N}from"./analytics-BotDBGh0.js";function P(){(C(),e(m)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,a]=(0,I.useState)(`loading`),[o,c]=(0,I.useState)([]),[l,d]=(0,I.useState)(0),[f,p]=(0,I.useState)(),m=u();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await j(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
|
+
`).filter(e=>e.trim()!==``),c(e)),m){let{stdout:t}=await j(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(d(n),e.length===0&&n===0){a(`removing`),x().then(()=>{process.chdir(m.originalCwd),v(m.originalCwd),P(),T.cache.clear?.(),p(`Worktree removed (no changes)`)}).catch(e=>{k(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`)}).then(()=>{a(`done`)});return}else a(`asking`)}}e()},[m]),(0,I.useEffect)(()=>{n===`done`&&e(f)},[n,e,f]),!m)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function h(e){if(!m)return;let t=!!m.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),await _(),process.chdir(m.originalCwd),v(m.originalCwd),P(),T.cache.clear?.(),p(t?`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${m.tmuxSessionName}`:`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}`),a(`done`);else if(e===`keep-kill-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),m.tmuxSessionName&&await w(m.tmuxSessionName),await _(),process.chdir(m.originalCwd),v(m.originalCwd),P(),T.cache.clear?.(),p(`Worktree kept at ${m.worktreePath} on branch ${m.worktreeBranch}. Tmux session terminated.`),a(`done`);else if(e===`remove`||e===`remove-with-tmux`){a(`removing`),N(`tengu_worktree_removed`,{commits:l,changed_files:o.length}),m.tmuxSessionName&&await w(m.tmuxSessionName);try{await x(),process.chdir(m.originalCwd),v(m.originalCwd),P(),T.cache.clear?.()}catch(e){k(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`),a(`done`);return}let e=t?` Tmux session terminated.`:``;l>0&&o.length>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):l>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} on ${m.worktreeBranch} ${l===1?`was`:`were`} discarded.${e}`):o.length>0?p(`Worktree removed. Uncommitted changes were discarded.${e}`):p(`Worktree removed.${e}`),a(`done`)}}if(n===`keeping`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(D,{}),(0,L.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(D,{}),(0,L.jsx)(i,{children:`Removing worktree…`})]});let g=m.worktreeBranch,y=o.length>0,b=l>0,C=``;C=y&&b?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${l} ${l===1?`commit`:`commits`} on ${g}. All will be lost if you remove.`:y?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:b?`You have ${l} ${l===1?`commit`:`commits`} on ${g}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}h(`keep`)}let O=y||b?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!m.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${m.worktreePath}. Reattach with: tmux attach -t ${m.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${m.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${m.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(s,{title:`Exiting worktree session`,subtitle:C,onCancel:E,children:(0,L.jsx)(S,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:h})})}var I,L,R=t((()=>{I=n(a(),1),M(),O(),o(),A(),E(),g(),h(),b(),p(),L=c()}));function z(){return d(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await y(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{f(),a(),l(),R(),V=c(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,hn as u,ot as d,t as f,y as ee}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{U as te,en as m}from"./state-ix0xIunV.js";import{Er as h,
|
|
2
|
-
`)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function J(e){if(e instanceof Error){let t=Error(G(e.message));e.stack&&(t.stack=G(e.stack)),I(t)}else{let t=G(String(e));I(Error(t))}}async function Y(e,t){if(N())return{success:!1};try{await V();let r=z();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":U(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:j(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(J(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return J(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return J(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return J(e),{success:!1}}}var X,Z,Q,$,xe=e((()=>{r(),l(),X=t(l(),1),m(),de(),L(),
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,hn as u,ot as d,t as f,y as ee}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{U as te,en as m}from"./state-ix0xIunV.js";import{Er as h,Ex as g,HT as _,Mo as v,NT as y,PT as b,So as ne,Tx as re,Ur as ie,Vo as x,XS as S,et as C,fx as w,jr as T,px as E,tt as D}from"./loadAgentsDir-x3rlgED4.js";import{S as O,a as k,l as A,w as j}from"./debug-BrXObCdR.js";import{$t as ae,Xt as M}from"./settings-BeLFUeie.js";import{_ as oe,c as se,d as ce}from"./git-Do0wJvux.js";import{d as le,f as N,i as P,o as F,s as I}from"./log-BMCygSzM.js";import{n as L,r as R}from"./analytics-BotDBGh0.js";import{$n as z,Bt as B,mt as V,rr as H,tr as U}from"./model-CZViyZnE.js";import{st as W}from"./rcDebugLog-DBB9r8aw.js";import{a as ue,n as de}from"./firstPartyEventLogger-BXY1IJ2D.js";import{u as fe}from"./referral-CKmHHxj_.js";import{n as pe,t as me}from"./browser-BmZuQom6.js";import{readFile as he,stat as ge}from"fs/promises";function G(e){let t=e;return t=t.replace(/"(sk-ant[^\s"']{24,})"/g,`"[REDACTED_API_KEY]"`),t=t.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g,`[REDACTED_API_KEY]`),t=t.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g,`AWS key: "[REDACTED_AWS_KEY]"`),t=t.replace(/(AKIA[A-Z0-9]{16})/g,`[REDACTED_AWS_KEY]`),t=t.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g,`[REDACTED_GCP_KEY]`),t=t.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g,`[REDACTED_GCP_SERVICE_ACCOUNT]`),t=t.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi,`$1[REDACTED_API_KEY]`),t=t.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi,`$1[REDACTED_TOKEN]`),t=t.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_AWS_VALUE]`),t=t.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_GCP_VALUE]`),t=t.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED]`),t}function K(){return P().map(e=>{let t={...e};return t&&typeof t.error==`string`&&(t.error=G(t.error)),t})}async function _e(){try{let e=h(),{size:t}=await ge(e);return t>52428800?(A(`Skipping raw transcript read: file too large (${t} bytes)`,{level:`warn`}),null):await he(e,`utf-8`)}catch{return null}}function ve({abortSignal:e,messages:t,initialDescription:n,onDone:r,backgroundTasks:l={}}){let[f,p]=(0,X.useState)(`userInput`),[m,h]=(0,X.useState)(0),[g,_]=(0,X.useState)(n??``),[v,y]=(0,X.useState)(null),[b,S]=(0,X.useState)(null),[C,T]=(0,X.useState)({isGit:!1,gitState:null}),[E,D]=(0,X.useState)(null),O=d().columns-4;(0,X.useEffect)(()=>{async function e(){let e=await ce(),t=null;e&&(t=await se()),T({isGit:e,gitState:t})}e()},[]);let k=(0,X.useCallback)(async()=>{p(`submitting`),S(null),y(null);let n=K(),r=ne(t)?.requestId??null,[i,a]=await Promise.all([ie(),_e()]),o={...i},s={latestAssistantMessageId:r,message_count:t.length,datetime:new Date().toISOString(),description:g,platform:M.platform,gitRepo:C.isGit,terminal:M.terminal,version:`0.0.7`,transcript:x(t),errors:n,lastApiRequest:te(),...Object.keys(o).length>0&&{subagentTranscripts:o},...a&&{rawTranscriptJsonl:a}},[c,l]=await Promise.all([Y(s,e),be(g,e)]);D(l),c.success?(c.feedbackId&&(y(c.feedbackId),R(`tengu_bug_report_submitted`,{feedback_id:c.feedbackId,last_assistant_message_id:r}),ue(`tengu_bug_report_description`,{feedback_id:c.feedbackId,description:G(g)})),p(`done`)):(c.isZdrOrg?S(`Feedback collection is not available for organizations with custom data retention policies.`):S(`Could not submit feedback. Please try again later.`),p(`userInput`))},[g,C.isGit,t]),A=(0,X.useCallback)(()=>{if(f===`done`){r(b?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}r(`Feedback / bug report cancelled`,{display:`system`})},[f,b,r]);return c(`confirm:no`,A,{context:`Settings`,isActive:f===`userInput`}),u((e,t)=>{if(f===`done`){t.return&&E&&pe(ye(v??``,E,g,K())),r(b?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}if(b&&f!==`userInput`){r(`Error submitting feedback / bug report`,{display:`system`});return}f===`consent`&&(t.return||e===` `)&&k()}),(0,Z.jsxs)(ee,{title:`Submit Feedback / Bug Report`,onCancel:A,isCancelActive:f!==`userInput`,inputGuide:e=>e.pending?(0,Z.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):f===`userInput`?(0,Z.jsxs)(s,{children:[(0,Z.jsx)(i,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):f===`consent`?(0,Z.jsxs)(s,{children:[(0,Z.jsx)(i,{shortcut:`Enter`,action:`submit`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):null,children:[f===`userInput`&&(0,Z.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{children:`Describe the issue below:`}),(0,Z.jsx)(re,{value:g,onChange:e=>{_(e),b&&S(null)},columns:O,onSubmit:()=>p(`consent`),onExitMessage:()=>r(`Feedback cancelled`,{display:`system`}),cursorOffset:m,onChangeCursorOffset:h,showCursor:!0}),b&&(0,Z.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{color:`error`,children:b}),(0,Z.jsx)(o,{dimColor:!0,children:`Edit and press Enter to retry, or Esc to cancel`})]})]}),f===`consent`&&(0,Z.jsxs)(a,{flexDirection:`column`,children:[(0,Z.jsx)(o,{children:`This report will include:`}),(0,Z.jsxs)(a,{marginLeft:2,flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[`- Your feedback / bug description: `,(0,Z.jsx)(o,{dimColor:!0,children:g})]}),(0,Z.jsxs)(o,{children:[`- Environment info:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[M.platform,`, `,M.terminal,`, v`,`0.0.7`]})]}),C.gitState&&(0,Z.jsxs)(o,{children:[`- Git repo metadata:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[C.gitState.branchName,C.gitState.commitHash?`, ${C.gitState.commitHash.slice(0,7)}`:``,C.gitState.remoteUrl?` @ ${C.gitState.remoteUrl}`:``,!C.gitState.isHeadOnRemote&&`, not synced`,!C.gitState.isClean&&`, has local changes`]})]}),(0,Z.jsx)(o,{children:`- Current session transcript`})]}),(0,Z.jsx)(a,{marginTop:1,children:(0,Z.jsx)(o,{wrap:`wrap`,dimColor:!0,children:`We will use your feedback to debug related issues or to improve Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).`})}),(0,Z.jsx)(a,{marginTop:1,children:(0,Z.jsxs)(o,{children:[`Press `,(0,Z.jsx)(o,{bold:!0,children:`Enter`}),` to confirm and submit.`]})})]}),f===`submitting`&&(0,Z.jsx)(a,{flexDirection:`row`,gap:1,children:(0,Z.jsx)(o,{children:`Submitting report…`})}),f===`done`&&(0,Z.jsxs)(a,{flexDirection:`column`,children:[b?(0,Z.jsx)(o,{color:`error`,children:b}):(0,Z.jsx)(o,{color:`success`,children:`Thank you for your report!`}),v&&(0,Z.jsxs)(o,{dimColor:!0,children:[`Feedback ID: `,v]}),(0,Z.jsxs)(a,{marginTop:1,children:[(0,Z.jsx)(o,{children:`Press `}),(0,Z.jsx)(o,{bold:!0,children:`Enter `}),(0,Z.jsx)(o,{children:`to open your browser and draft a GitHub issue, or any other key to close.`})]})]})]})}function ye(e,t,n,r){let i=G(t),a=`**Bug Description**\n${G(n)}\n\n**Environment Info**\n- Platform: ${M.platform}\n- Terminal: ${M.terminal}\n- Version: 0.0.7\n- Feedback ID: ${e}\n\n**Errors**\n\`\`\`json\n`,o=j(r),s=`${$}/new?title=${encodeURIComponent(i)}&labels=user-reported,bug&body=`,c=encodeURIComponent(a),l=encodeURIComponent(o),u=Q-s.length-c.length-15-46;if(u<=0){let e=Q-s.length-9-46-50,t=a+o+"\n```\n",n=encodeURIComponent(t);if(n.length>e){n=n.slice(0,e);let t=n.lastIndexOf(`%`);t>=n.length-2&&(n=n.slice(0,t))}return s+n+`%E2%80%A6%0A**Note%3A**%20Content%20was%20truncated.%0A`}if(l.length<=u)return s+c+l+`%0A%60%60%60%0A`;let d=l.slice(0,u-9-50),f=d.lastIndexOf(`%`);return f>=d.length-2&&(d=d.slice(0,f)),s+c+d+`%E2%80%A6%0A%60%60%60%0A%0A**Note%3A**%20Content%20was%20truncated.%0A`}async function be(e,t){try{let n=(await D({systemPrompt:W([`Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.`,`Claude Code is an agentic coding CLI.`,`The title should:`,`- Include the type of issue [Bug] or [Feature Request] as the first thing in the title`,`- Be concise, specific and descriptive of the actual problem`,`- Use technical terminology appropriate for a software issue`,`- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)`,`- Be direct and clear for developers to understand the problem`,`- If you cannot determine a clear issue, use "Bug Report: [brief description]"`,`- Any LLM API errors are from the Claude API, not from any other model provider`,`Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination`,`Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"`]),userPrompt:e,signal:t,options:{hasAppendSystemPrompt:!1,toolChoice:void 0,isNonInteractiveSession:!1,agents:[],querySource:`feedback`,mcpTools:[]}}))?.message?.content?.[0],r=n?.type===`text`?n.text:`Bug Report`;return b(r)?q(e):r}catch(t){return I(t),q(e)}}function q(e){let t=e.split(`
|
|
2
|
+
`)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function J(e){if(e instanceof Error){let t=Error(G(e.message));e.stack&&(t.stack=G(e.stack)),I(t)}else{let t=G(String(e));I(Error(t))}}async function Y(e,t){if(N())return{success:!1};try{await V();let r=z();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":U(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:j(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(J(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return J(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return J(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return J(e),{success:!1}}}var X,Z,Q,$,xe=e((()=>{r(),l(),X=t(l(),1),m(),de(),L(),v(),S(),f(),fe(),C(),y(),B(),me(),k(),ae(),oe(),H(),F(),le(),T(),O(),_(),E(),g(),Z=p(),Q=7250,$=process.env.USER_TYPE===`ant`?`https://github.com/anthropics/claude-cli-internal/issues`:`https://github.com/anthropics/claude-code/issues`}));export{xe as n,G as r,ve as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{D as n,I as r,Lt as i,P as a,T as o,fi as s,hn as c,t as l,y as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{ix as f,rx as p}from"./loadAgentsDir-x3rlgED4.js";import{n as m,r as h}from"./analytics-BotDBGh0.js";import{a as g,c as _,i as v,r as y,s as b,t as x}from"./grove-BQisE2JM.js";function S(){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(a,{children:[`An update to our Consumer Terms and Privacy Policy will take effect on `,(0,D.jsx)(a,{bold:!0,children:`October 8, 2025`}),`. You can accept the updated terms today.`]}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(a,{children:`What's changing?`}),(0,D.jsx)(r,{paddingLeft:1,children:(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:`· `}),(0,D.jsx)(a,{bold:!0,children:`You can help improve Claude `}),(0,D.jsxs)(a,{children:[`— Allow the use of your chats and coding sessions to train and improve Claude AI models. Change anytime in your Privacy Settings (`,(0,D.jsx)(i,{url:`https://claude.ai/settings/data-privacy-controls`}),`).`]})]})}),(0,D.jsx)(r,{paddingLeft:1,children:(0,D.jsxs)(a,{children:[(0,D.jsx)(a,{children:`· `}),(0,D.jsx)(a,{bold:!0,children:`Updates to data retention `}),(0,D.jsx)(a,{children:`— To help us improve our AI models and safety protections, we're extending data retention to 5 years.`})]})})]}),(0,D.jsxs)(a,{children:[`Learn more (`,(0,D.jsx)(i,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,D.jsx)(i,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,D.jsx)(i,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function C(){return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{children:`We've updated our Consumer Terms and Privacy Policy.`}),(0,D.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,D.jsx)(a,{children:`What's changing?`}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(a,{bold:!0,children:`Help improve Claude`}),(0,D.jsx)(a,{children:`Allow the use of your chats and coding sessions to train and improve Claude AI models. You can change this anytime in Privacy Settings`}),(0,D.jsx)(i,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(a,{bold:!0,children:`How this affects data retention`}),(0,D.jsx)(a,{children:`Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime.`})]})]}),(0,D.jsxs)(a,{children:[`Learn more (`,(0,D.jsx)(i,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,D.jsx)(i,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,D.jsx)(i,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function w({showIfAlreadyViewed:e,location:t,onDone:i}){let[s,c]=(0,E.useState)(null),[l,d]=(0,E.useState)(null);if((0,E.useEffect)(()=>{async function n(){let[n,r]=await Promise.all([v(),y()]),a=r.success?r.data:null;d(a);let o=x(n,r,e);if(c(o),!o){i(`skip_rendering`);return}b(),h(`tengu_grove_policy_viewed`,{location:t,dismissable:a?.notice_is_grace_period})}n()},[e,t,i]),s===null||!s)return null;async function p(e){switch(e){case`accept_opt_in`:await _(!0),h(`tengu_grove_policy_submitted`,{state:!0,dismissable:l?.notice_is_grace_period});break;case`accept_opt_out`:await _(!1),h(`tengu_grove_policy_submitted`,{state:!1,dismissable:l?.notice_is_grace_period});break;case`defer`:h(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:h(`tengu_grove_policy_escaped`,{});break}i(e)}let m=l?.domain_excluded?[{label:`Accept terms · Help improve Claude: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Claude: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Claude: OFF`,value:`accept_opt_out`}];function g(){if(l?.notice_is_grace_period){p(`defer`);return}p(`escape`)}return(0,D.jsxs)(u,{title:`Updates to Consumer Terms and Policies`,color:`professionalBlue`,onCancel:g,inputGuide:e=>e.pending?(0,D.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):(0,D.jsxs)(o,{children:[(0,D.jsx)(n,{shortcut:`Enter`,action:`confirm`}),(0,D.jsx)(n,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,D.jsxs)(r,{flexDirection:`row`,children:[(0,D.jsx)(r,{flexDirection:`column`,gap:1,flexGrow:1,children:l?.notice_is_grace_period?(0,D.jsx)(S,{}):(0,D.jsx)(C,{})}),(0,D.jsx)(r,{flexShrink:0,children:(0,D.jsx)(a,{color:`professionalBlue`,children:O})})]}),(0,D.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(r,{flexDirection:`column`,children:[(0,D.jsx)(a,{bold:!0,children:`Please select how you'd like to continue`}),(0,D.jsx)(a,{children:`Your choice takes effect immediately upon confirmation.`})]}),(0,D.jsx)(f,{options:[...m,...l?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>p(e),onCancel:g})]})]})}function T({settings:e,domainExcluded:t,onDone:s}){let[l,d]=(0,E.useState)(e.grove_enabled);E.useEffect(()=>{h(`tengu_grove_privacy_settings_viewed`,{})},[]),c(async(e,n)=>{if(!t&&(n.tab||n.return||e===` `)){let e=!l;d(e),await _(e)}});let f=(0,D.jsx)(a,{color:`error`,children:`false`});return t?f=(0,D.jsx)(a,{color:`error`,children:`false (for emails with your domain)`}):l&&(f=(0,D.jsx)(a,{color:`success`,children:`true`})),(0,D.jsxs)(u,{title:`Data Privacy`,color:`professionalBlue`,onCancel:s,inputGuide:e=>e.pending?(0,D.jsxs)(a,{children:[`Press `,e.keyName,` again to exit`]}):t?(0,D.jsx)(n,{shortcut:`Esc`,action:`cancel`}):(0,D.jsxs)(o,{children:[(0,D.jsx)(n,{shortcut:`Enter/Tab/Space`,action:`toggle`}),(0,D.jsx)(n,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,D.jsxs)(a,{children:[`Review and manage your privacy settings at`,` `,(0,D.jsx)(i,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,D.jsxs)(r,{children:[(0,D.jsx)(r,{width:44,children:(0,D.jsx)(a,{bold:!0,children:`Help improve Claude`})}),(0,D.jsx)(r,{children:f})]})]})}var E,D,O,k=e((()=>{E=t(s(),1),m(),l(),g(),p(),D=d(),O=` _____________
|
|
2
|
+
| \\ \\
|
|
3
|
+
| NEW TERMS \\__\\
|
|
4
|
+
| |
|
|
5
|
+
| ---------- |
|
|
6
|
+
| ---------- |
|
|
7
|
+
| ---------- |
|
|
8
|
+
| ---------- |
|
|
9
|
+
| ---------- |
|
|
10
|
+
| |
|
|
11
|
+
|______________|`}));export{T as n,k as r,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./Grove-CjN9DO47.js";e();export{t as GroveDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{n as i,t as a}from"./axios-DaWTGg7G.js";import{
|
|
1
|
+
import{l as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{n as i,t as a}from"./axios-DaWTGg7G.js";import{Kp as o,qp as s}from"./loadAgentsDir-x3rlgED4.js";import{S as c,a as l,l as u,w as d}from"./debug-BrXObCdR.js";import{M as f,j as p}from"./git-Do0wJvux.js";import{n as m,r as h}from"./analytics-BotDBGh0.js";import{c as g,h as _,l as v,m as y,s as b}from"./proxy-CRN7jYIi.js";import{D as x,O as S,a as C,l as w,n as T,r as E,t as D}from"./rcDebugLog-DBB9r8aw.js";import{r as O}from"./ccrClient-BFyfO67b.js";a(),S(),m(),s(),l(),D(),p(),t(),_(),v(),E(),c(),n();var k=`{"type":"keep_alive"}
|
|
2
2
|
`,A=1e3,j=1e3,M=3e4,N=6e5,P=1e4,F=12e4,I=M*2,L=new Set([1002,4001,4003]),R=class{constructor(e,t={},n,i,a){r(this,`ws`,null),r(this,`lastSentId`,null),r(this,`url`,void 0),r(this,`state`,`idle`),r(this,`onData`,void 0),r(this,`onCloseCallback`,void 0),r(this,`onConnectCallback`,void 0),r(this,`headers`,void 0),r(this,`sessionId`,void 0),r(this,`autoReconnect`,void 0),r(this,`isBridge`,void 0),r(this,`reconnectAttempts`,0),r(this,`reconnectStartTime`,null),r(this,`reconnectTimer`,null),r(this,`lastReconnectAttemptTime`,null),r(this,`lastActivityTime`,0),r(this,`pingInterval`,null),r(this,`pongReceived`,!0),r(this,`keepAliveInterval`,null),r(this,`messageBuffer`,void 0),r(this,`isBunWs`,!1),r(this,`connectStartTime`,0),r(this,`refreshHeaders`,void 0),r(this,`onBunOpen`,()=>{this.handleOpenEvent(),this.lastSentId&&this.replayBufferedMessages(``)}),r(this,`onBunMessage`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.lastActivityTime=Date.now(),f(`info`,`cli_websocket_message_received`,{length:t.length}),this.onData&&this.onData(t)}),r(this,`onBunError`,()=>{u(`WebSocketTransport: Error`,{level:`error`}),f(`error`,`cli_websocket_connect_error`)}),r(this,`onBunClose`,e=>{let t=e.code===1e3||e.code===1001;u(`WebSocketTransport: Closed: ${e.code}`,t?void 0:{level:`error`}),f(`error`,`cli_websocket_connect_closed`),this.handleConnectionError(e.code)}),r(this,`onNodeOpen`,()=>{let e=this.ws;if(this.handleOpenEvent(),!e)return;let t=e.upgradeReq;if(t?.headers?.[`x-last-request-id`]){let e=t.headers[`x-last-request-id`];this.replayBufferedMessages(e)}}),r(this,`onNodeMessage`,e=>{let t=e.toString();this.lastActivityTime=Date.now(),f(`info`,`cli_websocket_message_received`,{length:t.length}),this.onData&&this.onData(t)}),r(this,`onNodeError`,e=>{u(`WebSocketTransport: Error: ${e.message}`,{level:`error`}),f(`error`,`cli_websocket_connect_error`)}),r(this,`onNodeClose`,(e,t)=>{let n=e===1e3||e===1001;u(`WebSocketTransport: Closed: ${e}`,n?void 0:{level:`error`}),f(`error`,`cli_websocket_connect_closed`),this.handleConnectionError(e)}),r(this,`onPong`,()=>{this.pongReceived=!0}),this.url=e,this.headers=t,this.sessionId=n,this.refreshHeaders=i,this.autoReconnect=a?.autoReconnect??!0,this.isBridge=a?.isBridge??!1,this.messageBuffer=new o(A)}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){u(`WebSocketTransport: Cannot connect, current state is ${this.state}`,{level:`error`}),f(`error`,`cli_websocket_connect_failed`);return}this.state=`reconnecting`,this.connectStartTime=Date.now(),u(`WebSocketTransport: Opening ${this.url.href}`),f(`info`,`cli_websocket_connect_opening`);let e={...this.headers};if(this.lastSentId&&(e[`X-Last-Request-Id`]=this.lastSentId,u(`WebSocketTransport: Adding X-Last-Request-Id header: ${this.lastSentId}`)),typeof Bun<`u`){let t=new globalThis.WebSocket(this.url.href,{headers:e,proxy:g(this.url.href),tls:y()||void 0});this.ws=t,this.isBunWs=!0,t.addEventListener(`open`,this.onBunOpen),t.addEventListener(`message`,this.onBunMessage),t.addEventListener(`error`,this.onBunError),t.addEventListener(`close`,this.onBunClose),t.addEventListener(`pong`,this.onPong)}else{let{default:t}=await import(`./wrapper-K8ZapJVu.js`),n=new t(this.url.href,{headers:e,agent:b(this.url.href),...y()});this.ws=n,this.isBunWs=!1,n.on(`open`,this.onNodeOpen),n.on(`message`,this.onNodeMessage),n.on(`error`,this.onNodeError),n.on(`close`,this.onNodeClose),n.on(`pong`,this.onPong)}}handleOpenEvent(){let e=Date.now()-this.connectStartTime;u(`WebSocketTransport: Connected`),f(`info`,`cli_websocket_connect_connected`,{duration_ms:e}),this.isBridge&&this.reconnectStartTime!==null&&h(`tengu_ws_transport_reconnected`,{attempts:this.reconnectAttempts,downtimeMs:Date.now()-this.reconnectStartTime}),this.reconnectAttempts=0,this.reconnectStartTime=null,this.lastReconnectAttemptTime=null,this.lastActivityTime=Date.now(),this.state=`connected`,this.onConnectCallback?.(),this.startPingInterval(),this.startKeepaliveInterval(),C(()=>{this.write({type:`keep_alive`})})}sendLine(e){if(!this.ws||this.state!==`connected`)return u(`WebSocketTransport: Not connected`),f(`info`,`cli_websocket_send_not_connected`),!1;try{return this.ws.send(e),this.lastActivityTime=Date.now(),!0}catch(e){return u(`WebSocketTransport: Failed to send: ${e}`,{level:`error`}),f(`error`,`cli_websocket_send_error`),this.handleConnectionError(),!1}}removeWsListeners(e){if(this.isBunWs){let t=e;t.removeEventListener(`open`,this.onBunOpen),t.removeEventListener(`message`,this.onBunMessage),t.removeEventListener(`error`,this.onBunError),t.removeEventListener(`close`,this.onBunClose),t.removeEventListener(`pong`,this.onPong)}else{let t=e;t.off(`open`,this.onNodeOpen),t.off(`message`,this.onNodeMessage),t.off(`error`,this.onNodeError),t.off(`close`,this.onNodeClose),t.off(`pong`,this.onPong)}}doDisconnect(){this.stopPingInterval(),this.stopKeepaliveInterval(),w(),this.ws&&(this.removeWsListeners(this.ws),this.ws.close(),this.ws=null)}handleConnectionError(e){if(T(`WS handleConnectionError: code=${e} state=${this.state} url=${this.url.href.replace(/token=[^&]+/,`token=***`)} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1} reconnectAttempts=${this.reconnectAttempts}`),u(`WebSocketTransport: Disconnected from ${this.url.href}`+(e==null?``:` (code ${e})`)),f(`info`,`cli_websocket_disconnected`),this.isBridge&&h(`tengu_ws_transport_closed`,{closeCode:e,msSinceLastActivity:this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1,wasConnected:this.state===`connected`,reconnectAttempts:this.reconnectAttempts}),this.doDisconnect(),this.state===`closing`||this.state===`closed`)return;let t=!1;if(e===4003&&this.refreshHeaders){let e=this.refreshHeaders();e.Authorization!==this.headers.Authorization&&(Object.assign(this.headers,e),t=!0,u(`WebSocketTransport: 4003 received but headers refreshed, scheduling reconnect`),f(`info`,`cli_websocket_4003_token_refreshed`))}if(e!=null&&L.has(e)&&!t){u(`WebSocketTransport: Permanent close code ${e}, not reconnecting`,{level:`error`}),f(`error`,`cli_websocket_permanent_close`,{closeCode:e}),this.state=`closed`,this.onCloseCallback?.(e);return}if(!this.autoReconnect){this.state=`closed`,this.onCloseCallback?.(e);return}let n=Date.now();this.reconnectStartTime||(this.reconnectStartTime=n),this.lastReconnectAttemptTime!==null&&n-this.lastReconnectAttemptTime>I&&(u(`WebSocketTransport: Detected system sleep (${Math.round((n-this.lastReconnectAttemptTime)/1e3)}s gap), resetting reconnection budget`),f(`info`,`cli_websocket_sleep_detected`,{gapMs:n-this.lastReconnectAttemptTime}),this.reconnectStartTime=n,this.reconnectAttempts=0),this.lastReconnectAttemptTime=n;let r=n-this.reconnectStartTime;if(r<N){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!t&&this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),u(`WebSocketTransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(j*2**(this.reconnectAttempts-1),M),n=Math.max(0,e+e*.25*(2*Math.random()-1));u(`WebSocketTransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(r/1e3)}s elapsed)`),f(`error`,`cli_websocket_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.isBridge&&h(`tengu_ws_transport_reconnecting`,{attempt:this.reconnectAttempts,elapsedMs:r,delayMs:Math.round(n)}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else u(`WebSocketTransport: Reconnection time budget exhausted after ${Math.round(r/1e3)}s for ${this.url.href}`,{level:`error`}),f(`error`,`cli_websocket_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:r}),this.state=`closed`,this.onCloseCallback&&this.onCloseCallback(e)}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopPingInterval(),this.stopKeepaliveInterval(),w(),this.state=`closing`,this.doDisconnect()}replayBufferedMessages(e){let t=this.messageBuffer.toArray();if(t.length===0)return;let n=0;if(e){let r=t.findIndex(t=>`uuid`in t&&t.uuid===e);if(r>=0){n=r+1;let e=t.slice(n);this.messageBuffer.clear(),this.messageBuffer.addAll(e),e.length===0&&(this.lastSentId=null),u(`WebSocketTransport: Evicted ${n} confirmed messages, ${e.length} remaining`),f(`info`,`cli_websocket_evicted_confirmed_messages`,{evicted:n,remaining:e.length})}}let r=t.slice(n);if(r.length===0){u(`WebSocketTransport: No new messages to replay`),f(`info`,`cli_websocket_no_messages_to_replay`);return}u(`WebSocketTransport: Replaying ${r.length} buffered messages`),f(`info`,`cli_websocket_messages_to_replay`,{count:r.length});for(let e of r){let t=d(e)+`
|
|
3
3
|
`;if(!this.sendLine(t)){this.handleConnectionError();break}}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnConnect(e){this.onConnectCallback=e}setOnClose(e){this.onCloseCallback=e}getStateLabel(){return this.state}async write(e){`uuid`in e&&typeof e.uuid==`string`&&(this.messageBuffer.add(e),this.lastSentId=e.uuid);let t=d(e)+`
|
|
4
4
|
`;if(this.state!==`connected`)return;let n=this.sessionId?` session=${this.sessionId}`:``,r=this.getControlMessageDetailLabel(e);u(`WebSocketTransport: Sending message type=${e.type}${n}${r}`),this.sendLine(t)}getControlMessageDetailLabel(e){if(e.type===`control_request`){let{request_id:t,request:n}=e,r=n.subtype===`can_use_tool`?n.tool_name:``;return` subtype=${n.subtype} request_id=${t}${r?` tool=${r}`:``}`}if(e.type===`control_response`){let{subtype:t,request_id:n}=e.response;return` subtype=${t} request_id=${n}`}return``}startPingInterval(){this.stopPingInterval(),this.pongReceived=!0;let e=Date.now();this.pingInterval=setInterval(()=>{if(this.state===`connected`&&this.ws){let t=Date.now(),n=t-e;if(e=t,n>I){u(`WebSocketTransport: ${Math.round(n/1e3)}s tick gap detected — process was suspended, forcing reconnect`),f(`info`,`cli_websocket_sleep_detected_on_ping`,{gapMs:n}),this.handleConnectionError();return}if(!this.pongReceived){u(`WebSocketTransport: No pong received, connection appears dead`,{level:`error`}),f(`error`,`cli_websocket_pong_timeout`),this.handleConnectionError();return}this.pongReceived=!1;try{this.ws.ping?.()}catch(e){u(`WebSocketTransport: Ping failed: ${e}`,{level:`error`}),f(`error`,`cli_websocket_ping_failed`)}}},P)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}startKeepaliveInterval(){this.stopKeepaliveInterval(),!e(process.env.CLAUDE_CODE_REMOTE)&&(this.keepAliveInterval=setInterval(()=>{if(this.state===`connected`&&this.ws)try{this.ws.send(k),this.lastActivityTime=Date.now(),u(`WebSocketTransport: Sent periodic keep_alive data frame`)}catch(e){u(`WebSocketTransport: Periodic keep_alive failed: ${e}`,{level:`error`}),f(`error`,`cli_websocket_keepalive_failed`)}},F))}stopKeepaliveInterval(){this.keepAliveInterval&&(clearInterval(this.keepAliveInterval),this.keepAliveInterval=null)}};l(),D(),p(),n();var z=100,B=15e3,V=3e3,H=class extends R{constructor(e,t={},n,i,a){super(e,t,n,i,a),r(this,`postUrl`,void 0),r(this,`uploader`,void 0),r(this,`streamEventBuffer`,[]),r(this,`streamEventTimer`,null);let{maxConsecutiveFailures:o,onBatchDropped:s}=a??{};this.postUrl=U(e),this.uploader=new O({maxBatchSize:500,maxQueueSize:1e4,baseDelayMs:500,maxDelayMs:8e3,jitterMs:1e3,maxConsecutiveFailures:o,onBatchDropped:(e,t)=>{f(`error`,`cli_hybrid_batch_dropped_max_failures`,{batchSize:e,failures:t}),s?.(e,t)},send:e=>this.postOnce(e)}),u(`HybridTransport: POST URL = ${this.postUrl}`),f(`info`,`cli_hybrid_transport_initialized`)}async write(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>this.flushStreamEvents(),z));return}return await this.uploader.enqueue([...this.takeStreamEvents(),e]),this.uploader.flush()}async writeBatch(e){return await this.uploader.enqueue([...this.takeStreamEvents(),...e]),this.uploader.flush()}get droppedBatchCount(){return this.uploader.droppedBatchCount}flush(){return this.uploader.enqueue(this.takeStreamEvents()),this.uploader.flush()}takeStreamEvents(){this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null);let e=this.streamEventBuffer;return this.streamEventBuffer=[],e}flushStreamEvents(){this.streamEventTimer=null,this.uploader.enqueue(this.takeStreamEvents())}close(){this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[];let e=this.uploader,t;Promise.race([e.flush(),new Promise(e=>{t=setTimeout(e,V)})]).finally(()=>{clearTimeout(t),e.close()}),super.close()}async postOnce(e){let t=x();if(!t){u(`HybridTransport: No session token available for POST`),f(`warn`,`cli_hybrid_post_no_token`);return}let n={Authorization:`Bearer ${t}`,"Content-Type":`application/json`},r;try{r=await i.post(this.postUrl,{events:e},{headers:n,validateStatus:()=>!0,timeout:B})}catch(e){throw u(`HybridTransport: POST error: ${e.message}`),f(`warn`,`cli_hybrid_post_network_error`),e}if(r.status>=200&&r.status<300){u(`HybridTransport: POST success count=${e.length}`);return}if(r.status>=400&&r.status<500&&r.status!==429){T(`Hybrid POST ${r.status}: url=${this.postUrl.replace(/token=[^&]+/,`token=***`)} events=${e.length} body=${JSON.stringify(r.data).slice(0,200)}`),u(`HybridTransport: POST returned ${r.status} (permanent), dropping`),f(`warn`,`cli_hybrid_post_client_error`,{status:r.status});return}throw u(`HybridTransport: POST returned ${r.status} (retryable)`),f(`warn`,`cli_hybrid_post_retryable_error`,{status:r.status}),Error(`POST failed with ${r.status}`)}};function U(e){let t=e.protocol===`wss:`?`https:`:`http:`,n=e.pathname;return n=n.replace(`/ws/`,`/session/`),n.endsWith(`/events`)||(n=n.endsWith(`/`)?n+`events`:n+`/events`),`${t}//${e.host}${n}${e.search}`}export{R as n,H as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{I as e,P as t,fi as n,kn as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import"./rolldown-runtime-DaDcL9Zw.js";import{I as e,P as t,fi as n,kn as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{NS as s,PS as c,bb as l,ix as u,rx as d,yb as f}from"./loadAgentsDir-x3rlgED4.js";import{E as p,S as m,w as h}from"./debug-BrXObCdR.js";import{t as g}from"./renderOptions-BUJB9nAm.js";n(),i(),l(),c(),m(),d();var _=o();function v({filePath:n,errorDescription:r,onExit:i,onReset:o}){return(0,_.jsxs)(a,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,_.jsxs)(e,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(t,{children:[`The configuration file at `,(0,_.jsx)(t,{bold:!0,children:n}),` contains invalid JSON.`]}),(0,_.jsx)(t,{children:r})]}),(0,_.jsxs)(e,{flexDirection:`column`,children:[(0,_.jsx)(t,{bold:!0,children:`Choose an option:`}),(0,_.jsx)(u,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():o()},onCancel:i})]})]})}var y=`dark`;async function b({error:e}){let t={...g(!1),theme:y};await new Promise(async n=>{let{unmount:i}=await r((0,_.jsx)(s,{children:(0,_.jsx)(f,{children:(0,_.jsx)(v,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{i(),n(),process.exit(1)},onReset:()=>{p(e.filePath,h(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),i(),n(),process.exit(0)}})})}),t)})}export{b as showInvalidConfigDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{ix as a,rx as o}from"./loadAgentsDir-x3rlgED4.js";import{n as s,t as c}from"./ValidationErrorsList-BYsDtAvX.js";t(),n(),o(),s();var l=i();function u({settingsErrors:t,onContinue:n,onExit:i}){function o(e){e===`exit`?i():n()}return(0,l.jsxs)(r,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,l.jsx)(c,{errors:t}),(0,l.jsx)(e,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,l.jsx)(a,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:o})]})}export{u as InvalidSettingsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{en as a,ht as o}from"./state-ix0xIunV.js";import{$h as s,E_ as c,FS as l,Gv as u,Hv as d,IS as f,Kv as p,LS as ee,L_ as m,MS as h,M_ as g,N_ as _,OD as v,O_ as y,PS as b,Qh as x,R_ as S,T_ as C,V_ as w,Vv as te,Yh as T,Zh as E,f_ as D,ig as O,jS as k,kD as A,ng as j,o_ as ne,og as M,sg as re,tg as N,w_ as ie,y_ as ae,z_ as oe}from"./loadAgentsDir-x3rlgED4.js";import{F as P,a as se,l as ce,z as le}from"./debug-BrXObCdR.js";import{ct as F,ut as I}from"./settings-BeLFUeie.js";import{c as L,l as R,o as z}from"./log-BMCygSzM.js";import{n as B,r as V}from"./analytics-BotDBGh0.js";import{c as H,s as U}from"./pluginFlagging-CAdaFV_D.js";import{o as ue,s as de}from"./localSearch-DtplGF-l.js";import{basename as fe}from"path";function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function pe(e,t=!1){let n=f(),r=l(e=>e.authVersion),i=l(e=>e.mcp.pluginReconnectKey),a=ee(),p=(0,K.useRef)(new Map),{addNotification:g}=h(),v=(0,K.useRef)([]),b=(0,K.useRef)(null),w=(0,K.useCallback)(()=>{b.current=null;let e=v.current;e.length!==0&&(v.current=[],a(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=F(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...A(n.tools,e=>e.name?.startsWith(l)),...o],f=s===void 0?n.commands:[...A(n.commands,e=>ne(e,a.name)),...s],p=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:H(n.resources,a.name)};n={...n,clients:u,tools:d,commands:f,resources:p}}return{...t,mcp:n}}))},[a]),k=(0,K.useCallback)(e=>{v.current.push(e),b.current===null&&(b.current=setTimeout(w,16))},[w]),j=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(k({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:re(e.client,e.name,a),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(T(e.name,e.config).catch(()=>{ce(`Failed to invalidate the server cache: ${e.name}`)}),_(e.name)){L(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=me(t);L(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=p.current.get(e.name);r&&(clearTimeout(r),p.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(_(e.name)){L(e.name,`Server disabled during reconnection, stopping retry`),p.current.delete(e.name);return}k({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await O(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){L(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),p.current.delete(e.name),j(i);return}if(L(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),p.current.delete(e.name),j(i);return}}catch(i){let a=Date.now()-r;if(R(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),p.current.delete(e.name),k({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);L(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);p.current.set(e.name,n)})}})()}else k({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(u,async()=>{L(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=s.cache.get(e.name);s.cache.delete(e.name);let n=await s(e),r=n.length;t?t.then(e=>{V(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),k({...e,tools:n})}catch(t){R(e.name,`Failed to refresh tools after list_changed notification: ${P(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(te,async()=>{L(e.name,`Received prompts/list_changed notification, refreshing prompts`),V(`tengu_mcp_list_changed`,{type:`prompts`});try{E.cache.delete(e.name);let[t,n]=await Promise.all([E(e),Promise.resolve([])]);k({...e,commands:[...t,...n]}),q?.()}catch(t){R(e.name,`Failed to refresh prompts after list_changed notification: ${P(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(d,async()=>{L(e.name,`Received resources/list_changed notification, refreshing resources`),V(`tengu_mcp_list_changed`,{type:`resources`});try{x.cache.delete(e.name);{let t=await x(e);k({...e,resources:t})}}catch(t){R(e.name,`Failed to refresh resources after list_changed notification: ${P(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[k]),M=o();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await y(e),i={...n,...e};G(a,r),a(e=>{let{stale:t,...n}=D(e.mcp,i);for(let e of t){let t=p.current.get(e.name);t&&(clearTimeout(t),p.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,T(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:_(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{R(`useManageMCPConnections`,`Failed to initialize servers as pending: ${P(e)}`)})},[t,e,a,M,i]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||C()?r=Promise.resolve({}):(S(),r=oe());let{servers:i,errors:o}=t?{servers:{},errors:[]}:await y(e,r);if(n)return;G(a,o);let s={...i,...e},l=Object.fromEntries(Object.entries(s).filter(([e])=>!_(e)));N(j,l).catch(e=>{R(`useManageMcpConnections`,`Failed to get MCP resources: ${P(e)}`)});let u={};if(!t){if(u=c(await r).allowed,n)return;if(Object.keys(u).length>0){let{servers:e}=ie(u,s);u=e}if(Object.keys(u).length>0){a(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(u).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:_(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(u).filter(([e])=>!_(e)));N(j,e).catch(e=>{R(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${P(e)}`)})}}let d={...s,...u},f={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},p=[];for(let[e,t]of Object.entries(d))t.scope===`enterprise`?f.enterprise++:t.scope===`user`?f.global++:t.scope===`project`?f.project++:t.scope===`local`?f.user++:t.scope===`dynamic`?f.plugin++:t.scope===`claudeai`&&f.claudeai++,process.env.USER_TYPE===`ant`&&!_(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&p.push(fe(t.command));V(`tengu_mcp_servers`,{...f,...process.env.USER_TYPE===`ant`&&p.length>0?{stdio_commands:p.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,j,a,r,M,i]),(0,K.useEffect)(()=>{let e=p.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),b.current!==null&&(clearTimeout(b.current),b.current=null,w())}},[w]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=p.current.get(e);r&&(clearTimeout(r),p.current.delete(e));let i=await O(e,t.config);return j(i),i},[n,j]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=p.current.get(e);n&&(clearTimeout(n),p.current.delete(e)),m(e,!1),t.type===`connected`&&await T(e,t.config),k({name:e,type:`disabled`,config:t.config})}else{m(e,!0),k({name:e,type:`pending`,config:t.config});let n=await O(e,t.config);j(n)}},[n,k,j])}}function me(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,he=t((()=>{K=n(r(),1),a(),j(),p(),U(),v(),B(),g(),se(),k(),b(),le(),z(),M(),w(),I(),ae(),q=(ue(),e(de)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ge(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function _e(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=pe(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ye=t((()=>{Z=n(r(),1),he(),Q=i(),$=(0,Z.createContext)(null)}));export{_e as i,ye as n,ge as r,ve as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{A_ as c,M_ as l,s_ as u,v_ as d,y_ as f}from"./loadAgentsDir-x3rlgED4.js";function p({scope:e,parsingErrors:t,warnings:r}){let a=t.length>0,o=r.length>0;return!a&&!o?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(n,{children:[(a||o)&&(0,_.jsxs)(i,{color:a?`error`:`warning`,children:[`[`,a?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(i,{children:d(e)})]}),(0,_.jsxs)(n,{children:[(0,_.jsx)(i,{dimColor:!0,children:`Location: `}),(0,_.jsx)(i,{dimColor:!0,children:u(e)})]}),(0,_.jsxs)(n,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`error`,children:`[Error]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),r.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:c(`user`)},{scope:`project`,config:c(`project`)},{scope:`local`,config:c(`local`)},{scope:`enterprise`,config:c(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),a=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!a?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(i,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(n,{marginTop:1,children:(0,_.jsxs)(i,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(r,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(a(),1),l(),f(),o(),_=s()}));export{v as n,m as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{en as m,ht as h,nr as g,pt as _}from"./state-ix0xIunV.js";import{$o as v,Eb as y,FS as b,GT as x,Gi as S,Io as C,KC as w,KT as T,Mc as E,Mo as D,PS as O,Po as k,Qi as A,Ro as j,Sc as M,Sx as ee,UT as N,Ui as te,XS as ne,_o as P,ax as re,bc as ie,bx as F,ca as ae,co as I,db as oe,eu as se,fo as ce,gb as le,hn as ue,ho as L,ix as de,jc as fe,lb as pe,nu as R,on as z,qC as me,ub as he,wb as ge,xo as B,yc as _e,yn as ve}from"./loadAgentsDir-x3rlgED4.js";import{n as ye,t as be}from"./cwd-CYmmnQVS.js";import{f as xe,g as Se,it as Ce,tt as we,vn as Te,yn as Ee}from"./settings-BeLFUeie.js";import{Y as De,h as Oe,m as ke,o as Ae,s as V,w as je}from"./log-BMCygSzM.js";import{n as H,r as U}from"./analytics-BotDBGh0.js";import{S as Me,b as Ne,h as Pe}from"./startupProfiler-xa3NmN7Z.js";import{Bt as Fe,St as Ie,Y as Le,et as Re}from"./model-CZViyZnE.js";import{E as ze,T as Be,c as Ve,d as He,w as Ue}from"./sessionTracing-_Hh5VXxt.js";import{u as We}from"./referral-CKmHHxj_.js";import{n as Ge,t as Ke}from"./slashCommandParsing-RQb_7Xzt.js";import{n as qe,t as Je}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import*as W from"path";import{randomUUID as G}from"crypto";u();var K=p();r(),f(),m(),ye(),De(),ke(),Ae(),Ee(),H(),Ne(),Ce(),Se(),Fe(),x(),Ue(),w(),F(),Ve(),se(),fe(),M(),v(),D(),A(),ve(),Ke();var Ye={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Xe(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Ye[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else(o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Ye)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function q(e){return Xe(e,`ultraplan`)}function Ze(e){return Xe(e,`ultrareview`)}function Qe(e){return q(e).length>0}function $e(e){let[t]=q(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function et(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function tt(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function nt(e,t,n,r,i,a,o){let s=G();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;He(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Be(`user_prompt`,{prompt_length:String(l.length),prompt:ze(l),"prompt.id":s}),U(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[L({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[L({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}H(),D();async function rt({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null,y=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!y&&c?.(v),R(`query_process_user_input_base_start`);let b=i.getAppState(),x=await at(e,n,r,i,a,o,s,l,u,d,f,b.toolPermissionContext.mode,p,m,h,g,t,_);if(R(`query_process_user_input_base_end`),!x.shouldQuery)return x;R(`query_hooks_start`);let S=B(e)||``;for await(let t of z(S,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[ce(`${ue(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:x.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return x.messages.push(L({content:e})),x.shouldQuery=!1,x}if(t.additionalContexts&&t.additionalContexts.length>0&&x.messages.push(_e({type:`hook_additional_context`,content:t.additionalContexts.map(it),hookName:`UserPromptSubmit`,toolUseID:`hook-${G()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;x.messages.push({...t.message,attachment:{...t.message.attachment,content:it(t.message.attachment.content)}});break;default:x.messages.push(t.message);break}}return R(`query_hooks_end`),x}var J=1e4;function it(e){return e.length>J?`${e.substring(0,J)}… [output truncated - exceeded ${J} characters]`:e}async function at(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],b=[],x=e;if(typeof e==`string`)v=e;else if(e.length>0){R(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await T(n);if(e.dimensions){let t=N(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,R(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let C=i?Object.values(i).filter(E):[],w=C.map(e=>e.id),D=i?await ee(i):new Map;R(`query_pasted_image_processing_start`);let O=await Promise.all(C.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return U(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await T(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??D.get(e.id)}})),k=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of O){if(e.dimensions){let t=N(e.dimensions,n);t&&b.push(t)}else if(t){let e=N(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);k.push(e.block)}R(`query_pasted_image_processing_end`);let A=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Ge(v),t=e?te(e.commandName,r.options.commands):void 0;if(t){let n=S(t,e?.args??``);if(n.ok)A=!1;else{let e=n.reason??`/${ae(t)} isn't available over Remote Control.`;return{messages:[L({content:v,uuid:s}),I(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!A&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Qe(g??v)){U(`tengu_ultraplan_keyword`,{});let e=$e(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-DQarepEb.js`);return Y(await t(`/ultraplan ${e}`,y,k,[],r,n,s,c,u,_),b)}let j=!h&&v!==null&&(t!==`prompt`||A||!v.startsWith(`/`));R(`query_attachment_loading_start`);let M=j?await me(ie(v,r,a??null,[],o,l)):[];if(R(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-CGdwvPmD.js`);return Y(await e(v,y,M,r,n),b)}if(v!==null&&!A&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-DQarepEb.js`);return Y(await e(v,y,k,M,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=M.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;U(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(x,k,w,M,s,d,m),b)}function Y(e,t){return t.length>0&&e.messages.push(L({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Re();function ot(e){return e===`Agent`?we:e}function st(e){let t=xe()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:be(),session_id:h(),tools:e.tools.map(e=>ot(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:Ie().source,betas:_(),claude_code_version:`0.0.7`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:G()};return n.fast_mode_state=Le(e.model,e.fastMode),n}var ct=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function lt(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=b(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=he(),_=(0,Q.useMemo)(G,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...L({content:``}),uuid:_}],[e,_]),[y,x]=(0,Q.useState)(v.length-1),S=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),C=v.length>1,[w,T]=(0,Q.useState)(f),[E,D]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return oe(p,f.uuid).then(t=>{e||D(t)}),()=>{e=!0}},[f,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[M,ee]=(0,Q.useState)(`both`),[N,te]=(0,Q.useState)(``),[ne,P]=(0,Q.useState)(``);function re(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:te}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:P}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{U(`tengu_message_selector_opened`,{})},[]);async function ie(e){t(),k(!0);try{await n(e),k(!1),d()}catch(e){V(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(U(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await ie(t);return}let r=await oe(p,t.uuid);T(t),D(r)}async function ae(e){if(U(`tengu_message_selector_restore_option_selected`,{option:e}),!w){h(`Message not found.`);return}if(e===`nevermind`){f?d():T(void 0);return}if(X(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?ne:N).trim()||void 0;await u(w,n,t),k(!1),j(null),T(void 0),d()}catch(e){V(e),k(!1),j(null),T(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(w)}catch(e){i=e,V(i)}if(e===`conversation`||e===`both`)try{await n(w)}catch(e){a=e,V(a)}k(!1),T(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=qe(),se=(0,Q.useCallback)(()=>{if(w&&!f){T(void 0);return}U(`tengu_message_selector_cancelled`,{}),d()},[d,w,f]),ce=(0,Q.useCallback)(()=>x(e=>Math.max(0,e-1)),[]),le=(0,Q.useCallback)(()=>x(e=>Math.min(v.length-1,e+1)),[v.length]),ue=(0,Q.useCallback)(()=>x(0),[]),fe=(0,Q.useCallback)(()=>x(v.length-1),[v.length]),R=(0,Q.useCallback)(()=>{let e=v[y];e&&F(e)},[v,y,F]);l(`confirm:no`,se,{context:`Confirmation`,isActive:!w}),o({"messageSelector:up":ce,"messageSelector:down":le,"messageSelector:top":ue,"messageSelector:bottom":fe,"messageSelector:select":R},{context:`MessageSelector`,isActive:!O&&!m&&!w&&C});let[z,me]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=pe(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;me(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let B=g&&E?.filesChanged&&E.filesChanged.length>0,_e=!m&&!w&&!f&&C;return(0,K.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(a,{color:`suggestion`}),(0,K.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!C&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&w&&C&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{children:[`Confirm you want to restore `,!E&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:w,color:`text`,isCurrent:!1}),(0,K.jsxs)(c,{dimColor:!0,children:[`(`,Pe(new Date(w.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:M,canRestoreCode:!!B,diffStatsForRestore:E}),O&&X(A)?(0,K.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(ge,{}),(0,K.jsx)(c,{children:`Summarizing…`})]}):(0,K.jsx)(de,{isDisabled:O,options:re(!!B),defaultFocusValue:B?`both`:`conversation`,onFocus:e=>ee(e),onChange:e=>ae(e),onCancel:()=>f?d():T(void 0)}),B&&(0,K.jsx)(s,{marginBottom:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),_e&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(s,{width:`100%`,flexDirection:`column`,children:v.slice(S,S+$).map((e,t)=>{let n=S+t,r=n===y,a=e.uuid===_,o=n in z,l=z[n],u=l?.filesChanged&&l.filesChanged.length;return(0,K.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(s,{width:2,minWidth:2,children:r?(0,K.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(c,{children:` `})}),(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,K.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,K.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,K.jsxs)(K.Fragment,{children:[u===1&&l.filesChanged[0]?`${W.basename(l.filesChanged[0])} `:`${u} files changed `,(0,K.jsx)(mt,{diffStats:l})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!w&&(0,K.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,K.jsxs)(K.Fragment,{children:[!m&&C&&`Enter to continue · `,`Esc to exit`]})})]})]})}function dt(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function ft({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,K.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?W.basename(e.filesChanged[0]||``):t===2?`${W.basename(e.filesChanged[0]||``)} and ${W.basename(e.filesChanged[1]||``)}`:`${W.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,K.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,K.jsx)(s,{width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Oe(typeof o==`string`?o.trim():l&<(l)?l.text.trim():`(no prompt)`);if(k(u))return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=P(u,`bash-input`);if(e)return(0,K.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(c,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=P(u,je),r=P(u,`command-args`),i=P(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{color:t,dimColor:n,children:i?Me(u,a-i,!0):u.slice(0,500).split(`
|
|
2
|
+
`).slice(0,4).join(`
|
|
3
|
+
`)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!j(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=Te(e.lines,e=>e.startsWith(`+`)),n=Te(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||C(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&<(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!C(t)&&!j(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(u(),1),H(),O(),le(),Je(),We(),D(),re(),y(),ne(),$=7}));export{Z as a,rt as c,_t as i,q as l,ct as n,st as o,vt as r,ot as s,ut as t,Ze as u};
|