claude-code-best 2.8.1 → 2.8.3
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/README.md +1 -1
- package/dist/chunks/{AddWorkspaceDirectory-CNyPaerF.js → AddWorkspaceDirectory-CM5PYqoF.js} +1 -1
- package/dist/chunks/{App-hiKxO6UA.js → App-BLLQEMkd.js} +1 -1
- package/dist/chunks/ApproveApiKey-AMXQPmfE.js +1 -0
- package/dist/chunks/{ApproveApiKey-Cd43j9Wa.js → ApproveApiKey-DrflOSA-.js} +1 -1
- package/dist/chunks/{AssistantSessionChooser-C8OxwSGM.js → AssistantSessionChooser-SlRne98s.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Cciww_FF.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-Ddjzluka.js → BypassPermissionsModeDialog-HaciDdx0.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-BhvrEJlm.js → ClaudeInChromeOnboarding-EA3k_q2M.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C-T8G8O7.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-DoNd72PS.js → ClaudeMdExternalIncludesDialog-xBclyqKk.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BTN62PKj.js +1 -0
- package/dist/chunks/{DesktopHandoff-DVUOZjb0.js → DesktopHandoff-BhY_F3Ob.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-DJbRHAIy.js → DevChannelsDialog-DU5komVT.js} +1 -1
- package/dist/chunks/DiffDialog-D_-znREV.js +3 -0
- package/dist/chunks/Doctor-BhrEYzPO.js +3 -0
- package/dist/chunks/Doctor-CjnUU1CY.js +1 -0
- package/dist/chunks/{ExitFlow-BPbtGcEg.js → ExitFlow-cRfxceuS.js} +2 -2
- package/dist/chunks/{Feedback-BSagYjmf.js → Feedback-BMv8Kt05.js} +2 -2
- package/dist/chunks/Grove-CRAZGlvf.js +1 -0
- package/dist/chunks/{Grove-BrP9JNpK.js → Grove-CjfR7Acp.js} +1 -1
- package/dist/chunks/{HybridTransport-DLaxmXCR.js → HybridTransport-D32dn9xc.js} +1 -1
- package/dist/chunks/{ITermBackend-tXN55G2D.js → ITermBackend-BxjzkptA.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-BzFQdfwu.js → InvalidConfigDialog-CnCOCqMT.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-KFg61s41.js → InvalidSettingsDialog-CLOgpfR2.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BhbT4Sah.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DsHSSgsx.js → McpParsingWarnings-B5X5HVnQ.js} +1 -1
- package/dist/chunks/MessageSelector-DLofsxam.js +3 -0
- package/dist/chunks/Messages-D1-i4MMT.js +11 -0
- package/dist/chunks/{Onboarding-DBJX6Cnf.js → Onboarding-Co5P3gZs.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-B4beCEX2.js → OverageCreditUpsell-DjgcfVt2.js} +1 -1
- package/dist/chunks/PluginSettings-NB-Wod-9.js +17 -0
- package/dist/chunks/{PromptInputHelpMenu-Bjjr3tYl.js → PromptInputHelpMenu-BDI5IF1s.js} +1 -1
- package/dist/chunks/QueryEngine-B217mLel.js +1 -0
- package/dist/chunks/REPL-BfprHNDt.js +1 -0
- package/dist/chunks/{REPL-CXcCBQuz.js → REPL-DCm_BFr_.js} +36 -36
- package/dist/chunks/{RemoteCallout-CuxqarhC.js → RemoteCallout-dGnKRIDB.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-BhPF41Wn.js → RemoteSessionManager-BidAIOqZ.js} +2 -2
- package/dist/chunks/ResumeConversation-SDRT6hO3.js +1 -0
- package/dist/chunks/{SSETransport-8yaTbdSK.js → SSETransport-BM2xz03M.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-DCSReOsq.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-ydwbrVTx.js → SentryErrorBoundary-D5niZGEU.js} +1 -1
- package/dist/chunks/SentryErrorBoundary-DzwCuftg.js +1 -0
- package/dist/chunks/Settings-D3ds_WCz.js +2 -0
- package/dist/chunks/{TeleportProgress-CNcl_DxR.js → TeleportProgress-Dg6HcEO9.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DJc8_mjE.js → TeleportRepoMismatchDialog-BUKNU2jx.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-Cw438s-J.js → TeleportResumeWrapper-5FTzA9R_.js} +1 -1
- package/dist/chunks/{ThemePicker-8X6yAwuQ.js → ThemePicker-Bdm12PmJ.js} +1 -1
- package/dist/chunks/{TmuxBackend-CqAnVFoI.js → TmuxBackend-CYx3Hdf1.js} +2 -2
- package/dist/chunks/{TrustDialog-Ch1FJzxi.js → TrustDialog-DGKf4iwh.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-sgfvJPWZ.js → ValidationErrorsList-BP7vG1uX.js} +1 -1
- package/dist/chunks/{WelcomeV2-Bu8l3w90.js → WelcomeV2-k_969SnB.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-Bvq7nHOp.js → WindowsTerminalBackend-K_zVZBSP.js} +2 -2
- package/dist/chunks/{add-dir-DqrRNnxe.js → add-dir-DnfUkb1n.js} +1 -1
- package/dist/chunks/{agentDisplay-DcxzWi1v.js → agentDisplay-DT04Kqdm.js} +1 -1
- package/dist/chunks/{agents-Do1ynqiW.js → agents-ELZyUElQ.js} +7 -7
- package/dist/chunks/{agents-QqLm1wcM.js → agents-hh7Zcqm6.js} +1 -1
- package/dist/chunks/{ant-D5gD6O-r.js → ant-CuQC6xHS.js} +1 -1
- package/dist/chunks/api-BY3NFL4L.js +1 -0
- package/dist/chunks/{api-hcsOinLV.js → api-C-KY7A3r.js} +1 -1
- package/dist/chunks/asciicast-BeEmDIKr.js +1 -0
- package/dist/chunks/{asciicast-C_1Pi99k.js → asciicast-C0fPsv7_.js} +1 -1
- package/dist/chunks/assistant-C669PK45.js +1 -0
- package/dist/chunks/{assistant-CemNvrYr.js → assistant-DbtrknMt.js} +1 -1
- package/dist/chunks/{assistant-DkECAILU.js → assistant-Z-xFHPiY.js} +1 -1
- package/dist/chunks/{auth-Dm8aWPRh.js → auth-Bo_eeRO9.js} +1 -1
- package/dist/chunks/auth-C-rD91K7.js +1 -0
- package/dist/chunks/{autoMode-dygqoN_C.js → autoMode-BhsFtU8_.js} +6 -6
- package/dist/chunks/{autonomy-BdxnxJnk.js → autonomy-B-d3Xamr.js} +1 -1
- package/dist/chunks/{autonomy-DPeEmb00.js → autonomy-C5wE-5B8.js} +12 -12
- package/dist/chunks/{autonomyPanel-Bocl2taZ.js → autonomyPanel-CMy4Zs1a.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-YAOGWoo4.js +17 -0
- package/dist/chunks/backgroundHousekeeping-xFmPDL7y.js +1 -0
- package/dist/chunks/{branch-DwdVgun5.js → branch-DoV3sEJf.js} +2 -2
- package/dist/chunks/{bridge-DkkMogD_.js → bridge-8RYx23zW.js} +2 -2
- package/dist/chunks/{bridgeConfig-l6Ldi_hk.js → bridgeConfig-C8tQXEsd.js} +1 -1
- package/dist/chunks/bridgeConfig-D5awYlvd.js +1 -0
- package/dist/chunks/bridgeEnabled-0tZw2TlM.js +1 -0
- package/dist/chunks/{bridgeEnabled-DYclTb9d.js → bridgeEnabled-B3KTIVe4.js} +1 -1
- package/dist/chunks/bridgeMain-DKkE8RYG.js +1 -0
- package/dist/chunks/bridgeMain-Ssp8HRcV.js +68 -0
- package/dist/chunks/{bridgeMessaging-CYe1Cixl.js → bridgeMessaging-DGTm_wDk.js} +1 -1
- package/dist/chunks/{btw-CyOlY5R-.js → btw-Du0mHeiD.js} +1 -1
- package/dist/chunks/{buddy-q-utA1_5.js → buddy-D04AYSW6.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CTrRxzdz.js → bypassPermissionsKillswitch-CRYkShwu.js} +1 -1
- package/dist/chunks/caches-Byd8SjTZ.js +1 -0
- package/dist/chunks/{caches-Bz4yVQyE.js → caches-DYf69-N9.js} +2 -2
- package/dist/chunks/{ccrClient-DXiEw9xU.js → ccrClient-CDrBxSox.js} +1 -1
- package/dist/chunks/changeDetector-CGzGs92S.js +1 -0
- package/dist/chunks/{channelNotification-CLPdvxGZ.js → channelNotification-CtA9HHFW.js} +1 -1
- package/dist/chunks/channelNotification-DOvTvOGt.js +1 -0
- package/dist/chunks/{chrome-DxbhLWDW.js → chrome-BHbT4cc4.js} +1 -1
- package/dist/chunks/clear-BGLxPs_B.js +1 -0
- package/dist/chunks/client-CtOmoNuQ.js +1 -0
- package/dist/chunks/color-MOZYZ1cM.js +1 -0
- package/dist/chunks/commands-B3XpQmEm.js +1 -0
- package/dist/chunks/{commitAttribution-CJXF8wMs.js → commitAttribution-BTtCTr8c.js} +1 -1
- package/dist/chunks/commitAttribution-CXNK79GW.js +1 -0
- package/dist/chunks/compact-CMqxm2yG.js +3 -0
- package/dist/chunks/{companion-rXSt0nmz.js → companion-ChxkOPHB.js} +1 -1
- package/dist/chunks/{config-BE3jrcr-.js → config-cRyRIPI7.js} +1 -1
- package/dist/chunks/{config-CzC08IjE.js → config-wvQYYbwU.js} +1 -1
- package/dist/chunks/{context-BHE99SMA.js → context-7ds9guuJ.js} +1 -1
- package/dist/chunks/{context-noninteractive-BZQIUH_y.js → context-noninteractive-CISZymIU.js} +2 -2
- package/dist/chunks/context-noninteractive-CwJBBF8h.js +1 -0
- package/dist/chunks/conversation-Bgsdn99n.js +1 -0
- package/dist/chunks/conversation-D30CU_jS.js +1 -0
- package/dist/chunks/{copy-TgphIVzy.js → copy-Dvz2Mge4.js} +2 -2
- package/dist/chunks/{createSSHSession-CSKEZ4ic.js → createSSHSession-Befx8LiM.js} +1 -1
- package/dist/chunks/createSession-Cp0KTjPL.js +1 -0
- package/dist/chunks/{createSession-Ce218tQj.js → createSession-CsZGoika.js} +1 -1
- package/dist/chunks/{cronJitterConfig-CnKed5Gi.js → cronJitterConfig-Dfl7iZqE.js} +3 -3
- package/dist/chunks/{crossProjectResume-BFlsTYOq.js → crossProjectResume-DK8nt_cn.js} +3 -3
- package/dist/chunks/{datadog-D5jSRybW.js → datadog-2vPhbh6g.js} +1 -1
- package/dist/chunks/datadog-DLTYg-S2.js +1 -0
- package/dist/chunks/{desktop-cjA0tGOa.js → desktop-DY9Nw2Fi.js} +1 -1
- package/dist/chunks/{diff-DMd61IjE.js → diff-Ci6rs6S6.js} +1 -1
- package/dist/chunks/{directoryCompletion-DqtWZsoW.js → directoryCompletion-DLxCFk_m.js} +1 -1
- package/dist/chunks/{doctor-ueUYyjyL.js → doctor-DBYGgS-y.js} +1 -1
- package/dist/chunks/{effort-B9IvAstG.js → effort-Bi_t4J_o.js} +2 -2
- package/dist/chunks/{entry-Bq_KRMWs.js → entry-p_5l64_p.js} +5 -5
- package/dist/chunks/{envLessBridgeConfig-CpjlwmvF.js → envLessBridgeConfig-C_sqoGX6.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-Cfbqwjew.js +1 -0
- package/dist/chunks/exit-Bc8L5oQT.js +1 -0
- package/dist/chunks/{export-CP638-TO.js → export-kvnEu9Iw.js} +1 -1
- package/dist/chunks/{exportRenderer-B5emJDvn.js → exportRenderer-DmpMgUiv.js} +1 -1
- package/dist/chunks/extra-usage-BnO6knuC.js +1 -0
- package/dist/chunks/{extra-usage-DIm8nrKj.js → extra-usage-CmP6V7HX.js} +1 -1
- package/dist/chunks/{extra-usage-core-DERKSEe1.js → extra-usage-core-BqJClmf4.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-Dq5dog_-.js → extra-usage-noninteractive-BWyPFx53.js} +1 -1
- package/dist/chunks/extraUsage-DgMspmL4.js +1 -0
- package/dist/chunks/extractMemories-uQJS_i6E.js +1 -0
- package/dist/chunks/fast-Bunl4ivM.js +1 -0
- package/dist/chunks/{fast-BP2t1xDM.js → fast-Dd2jZVF-.js} +1 -1
- package/dist/chunks/{feedback-C-mR6zJr.js → feedback-8UeDx3Yc.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-sMmHdYjg.js → firstPartyEventLogger-cKEuzfyR.js} +1 -1
- package/dist/chunks/{flushGate-C18XwNsa.js → flushGate-B3upNVdV.js} +1 -1
- package/dist/chunks/{gates-Be5r2kKS.js → gates-lWoKqpJ1.js} +1 -1
- package/dist/chunks/gates-uo2owWkc.js +1 -0
- package/dist/chunks/{gemini-BberPcp1.js → gemini-DDSP4ArG.js} +1 -1
- package/dist/chunks/{generateRecap-B76UcVUS.js → generateRecap-DCBzHqag.js} +1 -1
- package/dist/chunks/{generateSessionName-BwtXd8TC.js → generateSessionName-Db5pZ3cL.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-5IlVgR2l.js → githubRepoPathMapping-v_U9b0Fe.js} +1 -1
- package/dist/chunks/{goal-DQ0jNcLO.js → goal-EZCOCHZa.js} +3 -3
- package/dist/chunks/{grok-Dh_thT2_.js → grok-H8K_fDKF.js} +1 -1
- package/dist/chunks/{growthbook-4ADV3CAt.js → growthbook-mMD0jkbu.js} +1 -1
- package/dist/chunks/{heapdump-Dwqmh4SX.js → heapdump-CbVvtQuH.js} +1 -1
- package/dist/chunks/{help-Bznaywoi.js → help-Bq4jxCSJ.js} +1 -1
- package/dist/chunks/hooks-CVlFJfV0.js +1 -0
- package/dist/chunks/{hooks-F-82cg6M.js → hooks-DbKUS0fN.js} +2 -2
- package/dist/chunks/{hostAdapter-DpfLr3hX.js → hostAdapter-BhVpIn1Y.js} +1 -1
- package/dist/chunks/{ide-BfAKWufQ.js → ide-DZJheXyl.js} +2 -2
- package/dist/chunks/{inboundAttachments-CFV_eqMu.js → inboundAttachments-B9NxWIDx.js} +1 -1
- package/dist/chunks/inboundAttachments-_vhgWPEL.js +1 -0
- package/dist/chunks/initReplBridge-BCIaWf78.js +1 -0
- package/dist/chunks/{insights-BNsCwNYa.js → insights-D1BFvhw_.js} +68 -68
- package/dist/chunks/{install-Bszzs98N.js → install-D_xm-9s1.js} +1 -1
- package/dist/chunks/{install-github-app-DVxGR2rp.js → install-github-app-CUEACXdr.js} +2 -2
- package/dist/chunks/{install-slack-app-CjlRL19o.js → install-slack-app-DGV6l9wy.js} +1 -1
- package/dist/chunks/{instrumentation-BOYPOtyu.js → instrumentation-CEfWNakt.js} +3 -3
- package/dist/chunks/{job-BvD5_lGz.js → job-BeeAFieV.js} +1 -1
- package/dist/chunks/{keybindings-RPmPPGhp.js → keybindings-CeYhuE5G.js} +2 -2
- package/dist/chunks/{lang-9VNaOJMz.js → lang-BmwAsgo1.js} +1 -1
- package/dist/chunks/{language-Ct5Nkqm6.js → language-BcWiv2lr.js} +1 -1
- package/dist/chunks/language-BnQye2Mx.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-CnoxFIXV.js → launchAgentsPlatform-DqQzwcqV.js} +1 -1
- package/dist/chunks/{launchAutofixPr-ChaDUtvx.js → launchAutofixPr-XltBpICW.js} +3 -3
- package/dist/chunks/{launchLocalMemory-MwZfEJxz.js → launchLocalMemory-CHSU4_or.js} +2 -2
- package/dist/chunks/{launchLocalVault-B6Ib5WXx.js → launchLocalVault-CnvCdQ1M.js} +3 -3
- package/dist/chunks/{launchMemoryStores-D6xyGwQ1.js → launchMemoryStores-DD2duIDU.js} +1 -1
- package/dist/chunks/{launchOnboarding-BtdAOO3p.js → launchOnboarding-JTKef_jU.js} +1 -1
- package/dist/chunks/{launchSchedule-XVljzNKg.js → launchSchedule-BVtfNQtS.js} +1 -1
- package/dist/chunks/{launchSkillStore-QT8Qcc5N.js → launchSkillStore-TisTmZ3O.js} +1 -1
- package/dist/chunks/{launchTeleport-DwxPesKQ.js → launchTeleport-BO_V6ggj.js} +3 -3
- package/dist/chunks/{launchVault-Dbti6pph.js → launchVault-Civro2KB.js} +1 -1
- package/dist/chunks/{loadAgentsDir-BYWykYwn.js → loadAgentsDir-BfEZacjM.js} +740 -690
- package/dist/chunks/loadAgentsDir-rYxb2igq.js +1 -0
- package/dist/chunks/loadPluginHooks-Cniyh-tZ.js +1 -0
- package/dist/chunks/localSearch-C0J7ETJQ.js +1 -0
- package/dist/chunks/{localSearch-eWjZxMc8.js → localSearch-COJcqOWl.js} +1 -1
- package/dist/chunks/login-B4wjtpEU.js +1 -0
- package/dist/chunks/{login-D1aQCqp0.js → login-SuUxFLIY.js} +1 -1
- package/dist/chunks/{logoV2Utils-CPNvLtol.js → logoV2Utils-DvjpZkyF.js} +1 -1
- package/dist/chunks/logout-o16yNWNB.js +1 -0
- package/dist/chunks/{magicDocs-DAvjAbAJ.js → magicDocs-BZBrH9zB.js} +2 -2
- package/dist/chunks/{main-BKlQiSuc.js → main-p9Tke3lb.js} +90 -63
- package/dist/chunks/mappers-BcXg_fI3.js +1 -0
- package/dist/chunks/mcp-BFxLEf3X.js +1 -0
- package/dist/chunks/{mcp-ya96irNP.js → mcp-CIJL0PTq.js} +2 -2
- package/dist/chunks/mcp-DfuQ1MJu.js +6 -0
- package/dist/chunks/{mcpServer-B1q9blAc.js → mcpServer-D2kI_m2H.js} +1 -1
- package/dist/chunks/{mcpServer-BJB5g6j2.js → mcpServer-DPk-oJOU.js} +1 -1
- package/dist/chunks/{memory-CxiukAGg.js → memory-CJOtY_Uv.js} +1 -1
- package/dist/chunks/{mode-DqAJ2y6R.js → mode-DkpKiyTE.js} +1 -1
- package/dist/chunks/{model-C8TW-qjl.js → model-DZyzd39E.js} +1 -1
- package/dist/chunks/model-De0AGQ3F.js +1 -0
- package/dist/chunks/{onChangeAppState-BG1pF7ht.js → onChangeAppState-CvtxqUDG.js} +1 -1
- package/dist/chunks/{openai-CHoRhRtf.js → openai-B888nVou.js} +3 -3
- package/dist/chunks/{overageCreditGrant-DYMg1lV4.js → overageCreditGrant-BOSyVk3U.js} +1 -1
- package/dist/chunks/{panelCall-SYrmrKt9.js → panelCall-BVdu8oii.js} +1 -1
- package/dist/chunks/{passes-CSV-SZJc.js → passes-DeSsjipz.js} +1 -1
- package/dist/chunks/{path-BE28AJwZ.js → path-Cit7LKW-.js} +1 -1
- package/dist/chunks/{paths-BZjPDxMm.js → paths-nIHVpTn2.js} +3 -3
- package/dist/chunks/permissions-DGdr-wOj.js +3 -0
- package/dist/chunks/{pipeTransport-uK7GxbSG.js → pipeTransport-ClZYq1sd.js} +1 -1
- package/dist/chunks/{plan-DEbo-Adi.js → plan-D9bnkDwv.js} +1 -1
- package/dist/chunks/{plugin-Cops24hg.js → plugin-BE0r1g1g.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Bg7JMOHN.js → pluginAutoupdate-xyXksEJv.js} +1 -1
- package/dist/chunks/pluginBlocklist-Dd7XBe8U.js +1 -0
- package/dist/chunks/{pluginCliCommands-DyYEg7Cv.js → pluginCliCommands-8MJCk1nq.js} +1 -1
- package/dist/chunks/{pluginFlagging-DwChUZMJ.js → pluginFlagging-7zuXXBD5.js} +1 -1
- package/dist/chunks/pluginOperations-DFzbASMD.js +2 -0
- package/dist/chunks/{pluginStartupCheck-DCxJJkYs.js → pluginStartupCheck-BC5npqdw.js} +1 -1
- package/dist/chunks/pluginStartupCheck-C6IH0haF.js +1 -0
- package/dist/chunks/plugins-Bhc2pbAj.js +4 -0
- package/dist/chunks/policyLimits-CfrU0rIR.js +1 -0
- package/dist/chunks/{pollConfig-DBNHhvHf.js → pollConfig-B3hNYQ_n.js} +1 -1
- package/dist/chunks/{poor-aPQce502.js → poor-BjTGCuqc.js} +1 -1
- package/dist/chunks/{poorMode-CFRuV-nB.js → poorMode-CGVMMLlz.js} +1 -1
- package/dist/chunks/poorMode-DWLhTldO.js +1 -0
- package/dist/chunks/{print-Cf2tY__0.js → print-BJkyuCzw.js} +11 -11
- package/dist/chunks/{privacy-settings-CYkM3Aem.js → privacy-settings-BDVjqVcX.js} +1 -1
- package/dist/chunks/processBashCommand-DnzyTwtS.js +1 -0
- package/dist/chunks/processSlashCommand-BGBRvSCA.js +6 -0
- package/dist/chunks/prompt-BXrvaHyx.js +1 -0
- package/dist/chunks/prompt-DgIuTC6Q.js +227 -0
- package/dist/chunks/prompt-Fax-fxAf.js +1 -0
- package/dist/chunks/{promptEditor-U03qQWbq.js → promptEditor-BkHY_Vzb.js} +2 -2
- package/dist/chunks/{protocolHandler-3yBj9w5N.js → protocolHandler-CrXWRkxh.js} +1 -1
- package/dist/chunks/rate-limit-options-skMSi19l.js +1 -0
- package/dist/chunks/{rcDebugLog-ClX1msJX.js → rcDebugLog-Bv_x5w_B.js} +1 -1
- package/dist/chunks/{referral-qe-yqXJE.js → referral-DfKWr4Jf.js} +1 -1
- package/dist/chunks/refresh-zosTlttX.js +1 -0
- package/dist/chunks/{registerProtocol-CClQph00.js → registerProtocol-De6y1iOi.js} +1 -1
- package/dist/chunks/registry-C8JbYbJI.js +1 -0
- package/dist/chunks/{release-notes-CyZHxWTF.js → release-notes-Su1UPyE4.js} +1 -1
- package/dist/chunks/{releaseNotes-BtxL5R5Q.js → releaseNotes-C7-JnhrH.js} +2 -2
- package/dist/chunks/{reload-plugins-B0eR8JHH.js → reload-plugins-C8lWCq8M.js} +1 -1
- package/dist/chunks/{remote-env-B_sIjY87.js → remote-env-tQuvJmrt.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-C3WRaLpU.js → remoteBridgeCore-CwOTDmNP.js} +1 -1
- package/dist/chunks/{remoteControlServer-BOj9qmgH.js → remoteControlServer-DIKi-0lr.js} +2 -2
- package/dist/chunks/rename-Trg9EHjT.js +1 -0
- package/dist/chunks/{resume-CpivBr9S.js → resume-Nt_EbjKh.js} +2 -2
- package/dist/chunks/{runtimeObserver-sOnfVR7t.js → runtimeObserver-CyWhTJpz.js} +4 -4
- package/dist/chunks/{runtimeObserver-C2_7Vsnd.js → runtimeObserver-T9QERJ_O.js} +1 -1
- package/dist/chunks/sandbox-adapter-BDGhDrPl.js +1 -0
- package/dist/chunks/{sandbox-toggle-Bv68-Ca7.js → sandbox-toggle-C6v31S7-.js} +1 -1
- package/dist/chunks/searchExtraTools-C8ehknh0.js +1 -0
- package/dist/chunks/{sentry-BBCn6RGP.js → sentry-CK_GHX79.js} +1 -1
- package/dist/chunks/{session-DfvxYP8o.js → session-Ys3KvmQ0.js} +1 -1
- package/dist/chunks/{sessionDiscovery-CyuRBTAm.js → sessionDiscovery-Cg3X2fKe.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-vthxapHk.js +1 -0
- package/dist/chunks/sessionMemory-ek1SfYG_.js +1 -0
- package/dist/chunks/sessionMemory-l-S0jpuk.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BGJeJyKn.js +1 -0
- package/dist/chunks/sessionObserver-COTvvM3Z.js +1 -0
- package/dist/chunks/{sessionObserver-CTkIYplM.js → sessionObserver-DvAdG6vQ.js} +2 -2
- package/dist/chunks/sessionStorage-GKe4ALVr.js +1 -0
- package/dist/chunks/{sessionTitle-ePQRpeV2.js → sessionTitle-DJMmUKBJ.js} +2 -2
- package/dist/chunks/{sessionTracing-81-RIJBo.js → sessionTracing-DuQ3kbq6.js} +1 -1
- package/dist/chunks/{settingsSync-DEFWnE1o.js → settingsSync-1mhDakFG.js} +1 -1
- package/dist/chunks/{setup-CTfYsKsz.js → setup-CAy0HkI3.js} +1 -1
- package/dist/chunks/setup-CGxUKG8x.js +3 -0
- package/dist/chunks/{setup-2611vmGJ.js → setup-D5ioKRsS.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CGD7Nx03.js → shadowedRuleDetection-Cq0y9pLR.js} +1 -1
- package/dist/chunks/{sideQuestion-BcP9Mm-5.js → sideQuestion-ZII6LMSM.js} +3 -3
- package/dist/chunks/{sink-D_t1TIt9.js → sink-Cd5g6Qqh.js} +1 -1
- package/dist/chunks/sink-Df9tds-b.js +1 -0
- package/dist/chunks/sinks-C4DwU8Xs.js +1 -0
- package/dist/chunks/{sinks-DXsozhmS.js → sinks-DZlIEjLZ.js} +2 -2
- package/dist/chunks/{skill-learning-CZm2iMik.js → skill-learning-DO21PjpF.js} +1 -1
- package/dist/chunks/skillChangeDetector-B6tL2yC9.js +1 -0
- package/dist/chunks/{skillGapStore-DzHv8v-D.js → skillGapStore-B_xv3GUy.js} +1 -1
- package/dist/chunks/{skillGapStore-cWo6Ra90.js → skillGapStore-CTD8MYTx.js} +2 -2
- package/dist/chunks/{skillGenerator-D_W1IeP3.js → skillGenerator-CO9r-gft.js} +2 -2
- package/dist/chunks/skillLearning-BJS4lsNk.js +1 -0
- package/dist/chunks/skillLearning-C2NmdcYQ.js +1 -0
- package/dist/chunks/{skillPanel-ChmOZu4F.js → skillPanel-DSumFGKN.js} +3 -3
- package/dist/chunks/{skillSearchPanel-CVx2b4Pr.js → skillSearchPanel-SqkfYBjV.js} +4 -4
- package/dist/chunks/{skills-CWX1SydA.js → skills-Bj3g5apl.js} +1 -1
- package/dist/chunks/{sprites-BuvEFwW6.js → sprites-CxMz3tIE.js} +1 -1
- package/dist/chunks/{stats-wjMQA-CA.js → stats-D1wYx84O.js} +1 -1
- package/dist/chunks/{status-CyU7IQhO.js → status-BWCqbeJ3.js} +1 -1
- package/dist/chunks/statusNoticeHelpers-DY0Cblkd.js +1 -0
- package/dist/chunks/{tag-opEEZI5B.js → tag-Hc7nOYm5.js} +2 -2
- package/dist/chunks/{tasks-CCtnU5u1.js → tasks-BSqecqVm.js} +1 -1
- package/dist/chunks/{teamHelpers-BJJs8taN.js → teamHelpers-BOmVFTLS.js} +1 -1
- package/dist/chunks/teamHelpers-BueGmQcw.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-CLiiOCkO.js → teammateModeSnapshot-DhXjREuo.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-_MCm6NGJ.js +1 -0
- package/dist/chunks/teleport-W2iPwivh.js +1 -0
- package/dist/chunks/{templateJobs-C6D7GC-Q.js → templateJobs-1oMC9yLQ.js} +1 -1
- package/dist/chunks/{terminalSetup-2ioFcRAA.js → terminalSetup-Bkml3uSP.js} +1 -1
- package/dist/chunks/{terminalSetup-B3bN4Cj8.js → terminalSetup-DJX1hqKs.js} +1 -1
- package/dist/chunks/{theme-Dgq_Og2P.js → theme-ia4cIc4d.js} +1 -1
- package/dist/chunks/thinkback-1NYskewu.js +1 -0
- package/dist/chunks/{thinkback-C43WBHis.js → thinkback-DWLUXUQC.js} +1 -1
- package/dist/chunks/thinkback-play-DZmXMRtq.js +1 -0
- package/dist/chunks/{toolEventObserver-B7EA-nNa.js → toolEventObserver-Ci0BECRu.js} +1 -1
- package/dist/chunks/{toolEventObserver-BG_3sGCL.js → toolEventObserver-nPwMQ5Vf.js} +1 -1
- package/dist/chunks/toolPool-ByCdlOak.js +1 -0
- package/dist/chunks/toolPool-IkNWjuk2.js +1 -0
- package/dist/chunks/{trustedDevice-S34i6Jc9.js → trustedDevice-BynTLVs4.js} +1 -1
- package/dist/chunks/{trustedDevice-DeNxe6bl.js → trustedDevice-CtL2IGDX.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-C45bmZqN.js → ultrareviewCommand-DN-QhQ-f.js} +2 -2
- package/dist/chunks/undercover-CqJzV_Ar.js +1 -0
- package/dist/chunks/{undercover-DoUSM8d6.js → undercover-DLr5xI3K.js} +1 -1
- package/dist/chunks/{updateCCB-BuAm25MX.js → updateCCB-C6Ov8SNx.js} +4 -4
- package/dist/chunks/{upgrade-BDKg286g.js → upgrade-CVM1ffhq.js} +1 -1
- package/dist/chunks/upgrade-d40dVpDc.js +1 -0
- package/dist/chunks/{upload-CMptZXZs.js → upload-DSNwGLNd.js} +1 -1
- package/dist/chunks/{usage-Bw_LK9YI.js → usage-BRv8mBDf.js} +1 -1
- package/dist/chunks/{usage-DEWsKPXj.js → usage-GMw8NiO_.js} +1 -1
- package/dist/chunks/{useMainLoopModel-D0PmGDuy.js → useMainLoopModel-CEM_50a0.js} +1 -1
- package/dist/chunks/{useManagePlugins-B-ejJsXy.js → useManagePlugins-hCqb5F5n.js} +1 -1
- package/dist/chunks/{useMergedTools-B6x9qtfj.js → useMergedTools-DxvRmxVF.js} +1 -1
- package/dist/chunks/{useSearchInput-BpMLsxaS.js → useSearchInput-BCErnYur.js} +1 -1
- package/dist/chunks/useSettingsErrors-BwNeCSA6.js +1 -0
- package/dist/chunks/{useVoice-C3ryR2HE.js → useVoice-Cu39ifSa.js} +1 -1
- package/dist/chunks/{util-DWl5gjmI.js → util-DYuasrIE.js} +1 -1
- package/dist/chunks/utils-DSGFJaZ_.js +1 -0
- package/dist/chunks/{validatePlugin-8EMSASvV.js → validatePlugin-b1ec7M7n.js} +1 -1
- package/dist/chunks/{vim-CaZ20SrQ.js → vim-CrAzv4cM.js} +1 -1
- package/dist/chunks/{voice-BrnKguEV.js → voice-DKG3SYqi.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-3eg8vSqy.js → voiceModeEnabled-By2qa3A2.js} +1 -1
- package/dist/chunks/voiceModeEnabled-DwYcj-FH.js +1 -0
- package/dist/chunks/voiceStreamSTT-DD8ulbg1.js +1 -0
- package/dist/chunks/{voiceStreamSTT-D7jWIYwz.js → voiceStreamSTT-DEV82xnN.js} +1 -1
- package/dist/chunks/{web-tools-BT3TbzG5.js → web-tools-8QRyE7va.js} +1 -1
- package/dist/chunks/windowsPaths-CRq9Bt5c.js +1 -0
- package/dist/chunks/windowsPaths-jbJ-skB_.js +1 -0
- package/dist/chunks/{workerRegistry-C_i5wwjL.js → workerRegistry-S7pO5khK.js} +1 -1
- package/dist/chunks/worktree-CfXrXsQ2.js +1 -0
- package/dist/chunks/{xml-DOXio8vw.js → xml-CPJXOUFt.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-DUoUTxFp.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-VKhuyQLe.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-COO2W0ij.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CPWq7O57.js +0 -1
- package/dist/chunks/DiffDialog-D0RK4t-9.js +0 -3
- package/dist/chunks/Doctor-0Nv3L1Oy.js +0 -3
- package/dist/chunks/Doctor-Ba9zhV0V.js +0 -1
- package/dist/chunks/Grove-DyvIToPa.js +0 -1
- package/dist/chunks/MCPConnectionManager-N-oJu3qn.js +0 -1
- package/dist/chunks/MessageSelector-D10JMnsc.js +0 -3
- package/dist/chunks/Messages-CQdQJ2AA.js +0 -11
- package/dist/chunks/PluginSettings-BBrFCSpQ.js +0 -17
- package/dist/chunks/QueryEngine-BSk8-8vB.js +0 -1
- package/dist/chunks/REPL-D-akKdFc.js +0 -1
- package/dist/chunks/ResumeConversation-hmIOkZ2U.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-wDSdfnRo.js +0 -1
- package/dist/chunks/SentryErrorBoundary-Duyg6HeT.js +0 -1
- package/dist/chunks/Settings-BSbzT25q.js +0 -2
- package/dist/chunks/api-VMfJpk1G.js +0 -1
- package/dist/chunks/asciicast-DA6TudSH.js +0 -1
- package/dist/chunks/assistant-D7D1sqTB.js +0 -1
- package/dist/chunks/auth-CGdLe3rq.js +0 -1
- package/dist/chunks/backgroundHousekeeping-4H6yTjsj.js +0 -1
- package/dist/chunks/backgroundHousekeeping-zf-tDimg.js +0 -17
- package/dist/chunks/bridgeConfig-CTJBoASk.js +0 -1
- package/dist/chunks/bridgeEnabled-SMuWz3Is.js +0 -1
- package/dist/chunks/bridgeMain-Ct5oDosG.js +0 -68
- package/dist/chunks/bridgeMain-UqwOi37W.js +0 -1
- package/dist/chunks/caches-DKMoKTAZ.js +0 -1
- package/dist/chunks/changeDetector--KPj2maX.js +0 -1
- package/dist/chunks/channelNotification-fJgjqRMx.js +0 -1
- package/dist/chunks/clear-CYVCwiwu.js +0 -1
- package/dist/chunks/client-DvWRsIpi.js +0 -1
- package/dist/chunks/color-DiLtK8_L.js +0 -1
- package/dist/chunks/commands-BT2_ICaW.js +0 -1
- package/dist/chunks/commitAttribution-Bpbro1a4.js +0 -1
- package/dist/chunks/compact-C6xm1N5a.js +0 -3
- package/dist/chunks/context-noninteractive-BQDOgVUW.js +0 -1
- package/dist/chunks/conversation-Bt6QdGd-.js +0 -1
- package/dist/chunks/conversation-CBPRFDod.js +0 -1
- package/dist/chunks/createSession-BaHXBnfG.js +0 -1
- package/dist/chunks/datadog-DgYqUGa-.js +0 -1
- package/dist/chunks/envLessBridgeConfig-D_GCqhTu.js +0 -1
- package/dist/chunks/exit-DtjFIrvJ.js +0 -1
- package/dist/chunks/extra-usage-C4dUWLhg.js +0 -1
- package/dist/chunks/extraUsage-BMvDY0Sk.js +0 -1
- package/dist/chunks/extractMemories-DS7XXeEo.js +0 -1
- package/dist/chunks/fast-D1xIHYaN.js +0 -1
- package/dist/chunks/gates-CUAwAhPL.js +0 -1
- package/dist/chunks/hooks-DynUngv2.js +0 -1
- package/dist/chunks/inboundAttachments-Cug-8Xdy.js +0 -1
- package/dist/chunks/initReplBridge-DV9KhSic.js +0 -1
- package/dist/chunks/language-CjFs6_la.js +0 -1
- package/dist/chunks/loadAgentsDir-tPgCg0WD.js +0 -1
- package/dist/chunks/loadPluginHooks-2U3UO__Q.js +0 -1
- package/dist/chunks/localSearch-CxwxzM8W.js +0 -1
- package/dist/chunks/login-CVVFklZw.js +0 -1
- package/dist/chunks/logout-BYsszpXx.js +0 -1
- package/dist/chunks/mappers-BBkM1aA5.js +0 -1
- package/dist/chunks/mcp-C3jlClk0.js +0 -6
- package/dist/chunks/mcp-Cmw8ecKk.js +0 -1
- package/dist/chunks/model-VB4ItNVB.js +0 -1
- package/dist/chunks/permissions-DBddT2NP.js +0 -3
- package/dist/chunks/pluginBlocklist-DEM_RWc2.js +0 -1
- package/dist/chunks/pluginOperations-COyT4tHs.js +0 -2
- package/dist/chunks/pluginStartupCheck-DjfIaOch.js +0 -1
- package/dist/chunks/plugins-BanQjHmw.js +0 -4
- package/dist/chunks/policyLimits-D-Y_soHx.js +0 -1
- package/dist/chunks/poorMode-DQagHYWe.js +0 -1
- package/dist/chunks/processBashCommand-BLSC8o8M.js +0 -1
- package/dist/chunks/processSlashCommand-Ch9B-6nh.js +0 -6
- package/dist/chunks/prompt-BGNhFY1n.js +0 -227
- package/dist/chunks/prompt-CrNwH5kr.js +0 -1
- package/dist/chunks/prompt-dH0MMivt.js +0 -1
- package/dist/chunks/rate-limit-options-D-xl_9PO.js +0 -1
- package/dist/chunks/refresh-CO_P3WKA.js +0 -1
- package/dist/chunks/registry-C0zdU2Hb.js +0 -1
- package/dist/chunks/rename-BFAC3WLD.js +0 -1
- package/dist/chunks/sandbox-adapter-jX_WzvnK.js +0 -1
- package/dist/chunks/searchExtraTools-xPuOKDpi.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-DiKsr7H7.js +0 -1
- package/dist/chunks/sessionMemory-C34-eFnJ.js +0 -1
- package/dist/chunks/sessionMemory-kYQnpcyG.js +0 -1
- package/dist/chunks/sessionMemoryUtils-CcJcgftx.js +0 -1
- package/dist/chunks/sessionObserver-B73s6yu8.js +0 -1
- package/dist/chunks/sessionStorage-BHi7PKs-.js +0 -1
- package/dist/chunks/setup-BJSk1czd.js +0 -3
- package/dist/chunks/sink-i8NmYch9.js +0 -1
- package/dist/chunks/sinks-3w0mLszx.js +0 -1
- package/dist/chunks/skillChangeDetector-1aFn40GC.js +0 -1
- package/dist/chunks/skillLearning-Bddmbx8E.js +0 -1
- package/dist/chunks/skillLearning-C-uI_jZB.js +0 -1
- package/dist/chunks/statusNoticeHelpers-JNibsI_v.js +0 -1
- package/dist/chunks/teamHelpers-D41zdxpl.js +0 -1
- package/dist/chunks/teammateModeSnapshot-q-bARbLL.js +0 -1
- package/dist/chunks/teleport-ClxQigSQ.js +0 -1
- package/dist/chunks/thinkback-BE8NNmAo.js +0 -1
- package/dist/chunks/thinkback-play-D2_n_aoQ.js +0 -1
- package/dist/chunks/toolPool-BLshLuvo.js +0 -1
- package/dist/chunks/toolPool-HYKCHxDA.js +0 -1
- package/dist/chunks/undercover-B4sdXe12.js +0 -1
- package/dist/chunks/upgrade-BiWGhm2d.js +0 -1
- package/dist/chunks/useSettingsErrors-DUe4k_RK.js +0 -1
- package/dist/chunks/utils-DP3EtI6F.js +0 -1
- package/dist/chunks/voiceModeEnabled-B1ARFTcz.js +0 -1
- package/dist/chunks/voiceStreamSTT-CONK4g-B.js +0 -1
- package/dist/chunks/windowsPaths-BeDSnJ23.js +0 -2
- package/dist/chunks/windowsPaths-ttHiMKpR.js +0 -1
- package/dist/chunks/worktree-CFNQKVGn.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-nIHVpTn2.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,Ka as n,dc as r,lo as i,oo as a,yc as o}from"./paths-
|
|
2
|
-
Install SoX manually for audio recording.`}`};if(!await y()){let e;return e=process.platform===`win32`?`Settings → Privacy → Microphone`:process.platform===`linux`?`your system's audio settings`:`System Settings → Privacy & Security → Microphone`,{type:`text`,value:`Microphone access is denied. To enable it, go to ${e}, then run /voice again.`}}if(i(`userSettings`,{voiceEnabled:!0,...
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,Ka as n,dc as r,lo as i,oo as a,yc as o}from"./paths-nIHVpTn2.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{HA as l,KA as u,MT as d,NT as f}from"./loadAgentsDir-BfEZacjM.js";import{n as p,r as m}from"./voiceModeEnabled-By2qa3A2.js";import{n as h,t as g}from"./useVoice-Cu39ifSa.js";var _,v;e((()=>{g(),f(),s(),o(),l(),a(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let a=n(),o=a.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return i(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(u.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${d(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return i(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(u.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${d(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return i(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(u.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let l=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-DD8ulbg1.js`),{checkRecordingAvailability:p}=await import(`./voice-BXg-kzte.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(l!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-BXg-kzte.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
|
|
2
|
+
Install SoX manually for audio recording.`}`};if(!await y()){let e;return e=process.platform===`win32`?`Settings → Privacy → Microphone`:process.platform===`linux`?`your system's audio settings`:`System Settings → Privacy & Security → Microphone`,{type:`text`,value:`Microphone access is denied. To enable it, go to ${e}, then run /voice again.`}}if(i(`userSettings`,{voiceEnabled:!0,...l===`doubao`?{voiceProvider:`doubao`}:{}}).error)return{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`};u.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!0});let x=d(`voice:pushToTalk`,`Chat`,`Space`),S=``,C=l===`doubao`?`Doubao ASR`:`Anthropic`;if(l!==`doubao`){let e=h(a.language),n=r(),i=n.voiceLangHintLastLanguage!==e.code,o=i?0:n.voiceLangHintShownCount??0,s=!e.fellBackFrom&&o<_;e.fellBackFrom?S=` Note: "${e.fellBackFrom}" is not a supported dictation language; using English. Change it via /config.`:s&&(S=` Dictation language: ${e.code} (/config to change).`),(i||s)&&t(t=>({...t,voiceLangHintShownCount:o+ +!!s,voiceLangHintLastLanguage:e.code}))}return{type:`text`,value:`Voice mode enabled (${C}). Hold ${x} to record.${S}`}}}))();export{v as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-nIHVpTn2.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n}from"./voiceModeEnabled-By2qa3A2.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./voiceStreamSTT-DEV82xnN.js";t();export{e as isVoiceStreamAvailable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-nIHVpTn2.js";import{D as d,E as f,O as p,l as m,p as h}from"./debug-otxXY3j-.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-DSV4Ht5l.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CF7ZDxaW.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return h(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&h(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),h(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let f=`${c}${k}?${l.toString()}`;h(`[voice_stream] Connecting to ${f}`);let m={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(f,typeof Bun<`u`?{headers:m,proxy:C(f),tls:_||void 0}:{headers:m,agent:b(f),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){h(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}h(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){h(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}h(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(h(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{h(`[voice_stream] WebSocket connected`),w=!0,h(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(h(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();h(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=d(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(h(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(h(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{h(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;h(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??p(r);h(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(h(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){h(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){h(`[voice_stream] unexpected-response fired with 101; ignoring`);return}h(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),h(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),f(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,n as a,r as o,t as s,x as c,xt as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{lo as d,no as f,oo as p}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,n as a,r as o,t as s,x as c,xt as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{lo as d,no as f,oo as p}from"./paths-nIHVpTn2.js";import{t as m}from"./useTerminalSize-Du-EamDN.js";import{n as h,t as g}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as _,r as v}from"./modalContext-CuTwi_eD.js";function y({tab:e,adapters:t,current:n,fieldLabel:r,onConfigure:a,onSwitchTab:o,onSelectAdapter:s,onClose:u,contentHeight:d}){let[f,p]=(0,T.useState)(Math.max(0,t.findIndex(e=>e.key===n)));return l((n,r)=>{if(r.upArrow)p(e=>Math.max(0,e-1));else if(r.downArrow)p(e=>Math.min(e+1,t.length-1));else if(r.tab&&e===`search`)o(`fetch`),p(0);else if(r.tab&&e===`fetch`)o(`search`),p(0);else if(r.escape)u();else if(r.return){let e=t[f];e&&a(e)}else if(n===` `){let e=t[f];e&&s(e.key)}}),(0,E.jsxs)(c,{flexDirection:`column`,padding:1,children:[(0,E.jsx)(i,{bold:!0,children:r}),(0,E.jsx)(c,{flexDirection:`column`,marginTop:1,children:t.map((e,t)=>{let r=e.key===n,a=t===f,o=a||r;return(0,E.jsxs)(c,{flexDirection:`row`,children:[(0,E.jsxs)(i,{color:r?`success`:void 0,children:[a?`›`:` `,(0,E.jsxs)(i,{color:r?`success`:void 0,children:[` `,r?`●`:`○`,` `]})]}),(0,E.jsx)(i,{bold:r,backgroundColor:o?`suggestion`:void 0,color:o?`inverseText`:void 0,children:e.label}),(0,E.jsx)(i,{children:` `}),(0,E.jsx)(i,{dimColor:!r,children:e.description})]},e.key)})}),(0,E.jsxs)(c,{marginTop:1,flexDirection:`row`,gap:2,children:[(0,E.jsxs)(i,{dimColor:!0,children:[`↑↓`,` navigate · Space select · Enter config · Esc close`]}),(0,E.jsx)(i,{dimColor:!0,children:`Tab switch tab`})]})]})}function b(e){let t=[];switch(e.key){case`tavily`:t.push({key:`tavilyEndpointUrl`,label:`Endpoint URL`,placeholder:`https://tavily.claude-code-best.win`,maskInput:!1,getValue:e=>e.tavilyEndpointUrl??`https://tavily.claude-code-best.win`,setValue:(e,t)=>({...e,tavilyEndpointUrl:t||void 0})});break;case`brave`:t.push({key:`braveApiKey`,label:`API Key`,placeholder:`BSA...`,maskInput:!0,getValue:e=>e.braveApiKey??``,setValue:(e,t)=>({...e,braveApiKey:t||void 0})});break;case`exa`:t.push({key:`exaApiKey`,label:`API Key`,placeholder:`exa-...`,maskInput:!0,getValue:e=>e.exaApiKey??``,setValue:(e,t)=>({...e,exaApiKey:t||void 0})}),t.push({key:`exaEndpointUrl`,label:`Endpoint URL`,placeholder:`https://mcp.exa.ai/mcp`,maskInput:!1,getValue:e=>e.exaEndpointUrl??`https://mcp.exa.ai/mcp`,setValue:(e,t)=>({...e,exaEndpointUrl:t||void 0})});break;case`http`:t.push({key:`webFetchHttpTimeoutMs`,label:`Timeout (ms)`,placeholder:`60000`,maskInput:!1,getValue:e=>String(e.webFetchHttpTimeoutMs??6e4),setValue:(e,t)=>({...e,webFetchHttpTimeoutMs:t&&Number(t)||void 0})});break;default:break}return t}function x({adapter:e,onBack:t,onSave:n,onSelect:r}){let i=b(e),a=f();return i.length===0?(0,E.jsx)(S,{adapter:e,onBack:t,onSelect:r}):(0,E.jsx)(C,{fields:i,adapter:e,onBack:t,onSave:n,settings:a})}function S({adapter:e,onBack:t,onSelect:n}){let[r,a]=(0,T.useState)(0);return l((i,o)=>{o.upArrow||o.downArrow?a(e=>+(e===0)):o.escape?t():o.return&&(r===0?n(`Selected ${e.label}.`):t())}),(0,E.jsxs)(c,{flexDirection:`column`,padding:1,children:[(0,E.jsx)(i,{bold:!0,children:e.label}),(0,E.jsxs)(c,{flexDirection:`column`,marginTop:1,children:[(0,E.jsx)(i,{children:e.description}),(0,E.jsx)(c,{marginTop:1,children:(0,E.jsx)(i,{dimColor:!0,children:`No additional configuration needed.`})})]}),(0,E.jsxs)(c,{flexDirection:`column`,marginTop:1,children:[(0,E.jsxs)(c,{children:[(0,E.jsxs)(i,{children:[r===0?`›`:` `,` `]}),(0,E.jsx)(i,{backgroundColor:r===0?`suggestion`:void 0,color:r===0?`inverseText`:void 0,bold:!0,children:`[ Select & Close ]`})]}),(0,E.jsxs)(c,{children:[(0,E.jsxs)(i,{children:[r===1?`›`:` `,` `]}),(0,E.jsx)(i,{backgroundColor:r===1?`suggestion`:void 0,color:r===1?`inverseText`:void 0,children:`[ Back ]`})]})]}),(0,E.jsx)(c,{marginTop:1,children:(0,E.jsxs)(i,{dimColor:!0,children:[`↑↓`,` navigate · Enter confirm · Esc back`]})})]})}function C({fields:e,adapter:t,onBack:n,onSave:r,settings:a}){let[o,s]=(0,T.useState)(0),[u,f]=(0,T.useState)(!1),[p,m]=(0,T.useState)(``),[h,g]=(0,T.useState)(0),_=(0,T.useCallback)(()=>{f(!1),m(``),g(0)},[]);e.length-1;let v=e.length,y=e.length+1,b=(0,T.useCallback)(()=>{let n={...a};for(let t of e){let e=t.getValue(a);n=t.setValue(n,e)}d(`userSettings`,n),r(`Configuration saved for ${t.label}.`)},[e,a,t.label,r]),x=(0,T.useCallback)(()=>{let t=e[o];if(!t)return;let n=t.getValue(a);m(n),g(n.length),f(!0)},[o,e,a]),S=(0,T.useCallback)(()=>{let t=e[o];if(!t)return;let n=t.setValue({...a},p);Object.assign(a,n),f(!1)},[o,e,a,p]);return l((e,t)=>{u?t.escape?_():t.return?S():t.backspace||t.delete?m(e=>{let t=h;return t>0?(g(t-1),e.slice(0,t-1)+e.slice(t)):e}):t.leftArrow?g(e=>Math.max(0,e-1)):t.rightArrow?g(e=>Math.min(p.length,e+1)):e&&e.length===1&&!t.ctrl&&!t.meta&&m(t=>{let n=h;return g(n+1),t.slice(0,n)+e+t.slice(n)}):t.upArrow?s(e=>Math.max(0,e-1)):t.downArrow?s(e=>Math.min(y,e+1)):t.escape?n():t.return&&(o===v?b():o===y?n():x())}),(0,E.jsxs)(c,{flexDirection:`column`,padding:1,children:[(0,E.jsxs)(i,{bold:!0,children:[t.label,` Configuration`]}),(0,E.jsxs)(c,{flexDirection:`column`,marginTop:1,children:[e.map((e,t)=>{let n=t===o&&!u,r=e.getValue(a),s=u&&t===o?e.maskInput?`•`.repeat(p.length):p:e.maskInput&&r?`•`.repeat(Math.min(r.length,16)):r;return(0,E.jsxs)(c,{flexDirection:`row`,children:[(0,E.jsxs)(i,{children:[n?`›`:` `,` `]}),(0,E.jsxs)(i,{dimColor:!0,children:[e.label,`: `]}),(0,E.jsx)(i,{backgroundColor:n?`suggestion`:void 0,color:u&&t===o?`success`:n?`inverseText`:void 0,children:s||(0,E.jsx)(i,{dimColor:!0,children:`(empty)`})}),u&&t===o&&(0,E.jsxs)(i,{dimColor:!0,children:[` |`,` pos `,h,`/`,p.length]})]},e.key)}),(0,E.jsxs)(c,{marginTop:1,children:[(0,E.jsxs)(i,{children:[o===v?`›`:` `,` `]}),(0,E.jsx)(i,{backgroundColor:o===v?`suggestion`:void 0,color:o===v?`inverseText`:void 0,bold:!0,children:`[ Save ]`})]}),(0,E.jsxs)(c,{children:[(0,E.jsxs)(i,{children:[o===y?`›`:` `,` `]}),(0,E.jsx)(i,{backgroundColor:o===y?`suggestion`:void 0,color:o===y?`inverseText`:void 0,children:`[ Back ]`})]})]}),(0,E.jsx)(c,{marginTop:1,children:(0,E.jsx)(i,{dimColor:!0,children:u?`←→ move cursor · Type to edit · Enter confirm · Esc cancel edit`:`↑↓ navigate · Enter edit field · Esc go back`})})]})}function w({onClose:e,_context:t}){let[r,i]=(0,T.useState)(`search`),[s,c]=(0,T.useState)({kind:`main`}),l=f(),u=l.webSearchAdapter??`tavily`,p=l.webFetchAdapter??`tavily`,m=v(),{rows:g}=n(),_=m?g+1:Math.max(14,Math.min(Math.floor(g*.7),24));h();let b=(0,T.useCallback)(t=>{let n=r;d(`userSettings`,{[n===`search`?`webSearchAdapter`:`webFetchAdapter`]:t});let i=(n===`search`?D:O).find(e=>e.key===t)?.label??t;e(`${n===`search`?`Web search`:`Web fetch`} backend set to ${i}.`)},[r,e]),S=(0,T.useCallback)(e=>{c({kind:`config`,adapter:e})},[]),C=(0,T.useCallback)(()=>{c({kind:`main`})},[]),w=(0,T.useCallback)(t=>{e(t)},[e]),k=(0,T.useCallback)(t=>{let n=s.adapter;d(`userSettings`,{[(s.kind===`config`?D.some(e=>e.key===n.key)?`search`:`fetch`:r)===`search`?`webSearchAdapter`:`webFetchAdapter`]:n.key}),e(t)},[e,s,r]);return s.kind===`config`?(0,E.jsx)(x,{adapter:s.adapter,onBack:C,onSave:w,onSelect:k}):(0,E.jsxs)(o,{title:`Web Tools`,contentHeight:_,children:[(0,E.jsx)(a,{title:`Search`,children:(0,E.jsx)(y,{tab:r,adapters:D,current:u,fieldLabel:`Choose a web search backend:`,onConfigure:S,onSwitchTab:i,onSelectAdapter:b,onClose:()=>e(`Web tools panel dismissed`),contentHeight:_})},`search`),(0,E.jsx)(a,{title:`Fetch`,children:(0,E.jsx)(y,{tab:r,adapters:O,current:p,fieldLabel:`Choose a web fetch backend:`,onConfigure:S,onSwitchTab:i,onSelectAdapter:b,onClose:()=>e(`Web tools panel dismissed`),contentHeight:_})},`fetch`)]})}var T,E,D,O,k;e((()=>{r(),T=t(r(),1),s(),g(),m(),_(),p(),E=u(),D=[{key:`tavily`,label:`Tavily`,description:`Tavily Search API (default)`,hasConfig:!0},{key:`api`,label:`Anthropic API`,description:`Anthropic server-side web search`,hasConfig:!1},{key:`bing`,label:`Bing`,description:`Scrape Bing HTML results`,hasConfig:!1},{key:`brave`,label:`Brave`,description:`Brave Search API (needs API key)`,hasConfig:!0},{key:`exa`,label:`Exa`,description:`Exa AI search (MCP endpoint)`,hasConfig:!0}],O=[{key:`tavily`,label:`Tavily Extract`,description:`Use Tavily /extract (default)`,hasConfig:!0},{key:`http`,label:`HTTP Direct`,description:`Fetch URL directly via HTTP`,hasConfig:!0}],k=async(e,t)=>(0,E.jsx)(w,{onClose:e,_context:t})}))();export{k as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./windowsPaths-jbJ-skB_.js";e();export{t as setShellIfWindows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{l as r,p as i}from"./debug-otxXY3j-.js";import{n as a,t as o}from"./cwd--iizewsn.js";import{n as s,t as c}from"./execSyncWrapper-Bn7EJqtD.js";import{i as l,o as u}from"./platform-mh9ypxS8.js";import{n as d,t as f}from"./memoize-DJ1XCN-z.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(l()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,i(`Using bash path: "${e}"`)}}function g(e,t){let n=[`C:\\Program Files\\Git\\bin\\bash.exe`,`C:\\Program Files\\Git\\usr\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\usr\\bin\\bash.exe`];t&&n.push(`${t}\\scoop\\apps\\git\\current\\usr\\bin\\bash.exe`);for(let t of n)if(e(t))return t;return null}function _(e,t){if(e===`git`){for(let e of[`C:\\Program Files\\Git\\cmd\\git.exe`,`C:\\Program Files (x86)\\Git\\cmd\\git.exe`])if(t.checkExists(e))return e}try{let n=t.execCommand(`where.exe ${e}`).split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=m.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=m.resolve(e).toLowerCase(),n=m.dirname(t).toLowerCase(),a=m.relative(r,n);if(a===``||!a.startsWith(`..`)&&!m.isAbsolute(a)){i(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function v(e=b){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=_(`bash`,e);if(n&&e.checkExists(n))return n;let r=_(`git`,e);if(r){let t=[m.join(r,`..`,`..`,`bin`,`bash.exe`),m.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),m.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return g(e.checkExists,e.userProfile)}function y(){let e=x();if(e!==null)return e;let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(t?`Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe`),process.exit(1)}var b,x,S,C,w=e((()=>{n(),a(),r(),s(),f(),u(),b={checkExists:p,execCommand:e=>c(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:o,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=d(e=>{if(e.startsWith(`\\\\`))return e.replace(/\\/g,`/`);let t=e.match(/^([A-Za-z]):[/\\]/);return t?`/`+t[1].toLowerCase()+e.slice(2).replace(/\\/g,`/`):e.replace(/\\/g,`/`)},e=>e,500),C=d(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t){let n=t[1].toUpperCase(),r=e.slice((`/cygdrive/`+t[1]).length);return n+`:`+(r||`\\`).replace(/\//g,`\\`)}let n=e.match(/^\/([A-Za-z])(\/|$)/);if(n){let t=n[1].toUpperCase(),r=e.slice(2);return t+`:`+(r||`\\`).replace(/\//g,`\\`)}return e.replace(/\//g,`\\`)},e=>e,500)}));export{C as a,w as i,x as n,h as o,v as r,S as s,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jt as e,on as t}from"./paths-
|
|
1
|
+
import{Jt as e,on as t}from"./paths-nIHVpTn2.js";import{U as n,z as r}from"./debug-otxXY3j-.js";import{o as i,t as a}from"./bridgeMain-Ssp8HRcV.js";import{resolve as o}from"path";t(),n();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),n=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:n,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>e()?.accessToken,onAuth401:async t=>!!e()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(e){e instanceof a?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${r(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ct as e,Ot as t}from"./loadAgentsDir-BfEZacjM.js";t();export{e as execIntoTmuxWorktree};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{es as t,no as n,oo as r,us as i}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{es as t,no as n,oo as r,us as i}from"./paths-nIHVpTn2.js";function a(e){d.set(e.name,e)}function o(e){return e.endsWith(`@${f}`)}function s(e){return d.get(e)}function c(){let e=n(),t=[],r=[];for(let[n,i]of d){if(i.isAvailable&&!i.isAvailable())continue;let a=`${n}@${f}`,o=e?.enabledPlugins?.[a],s=o===void 0?i.defaultEnabled??!0:o===!0,c={name:n,manifest:{name:n,description:i.description,version:i.version},path:f,source:a,repository:a,enabled:s,isBuiltin:!0,hooksConfig:i.hooks,mcpServers:i.mcpServers};s?t.push(c):r.push(c)}return{enabled:t,disabled:r}}function l(){let{enabled:e}=c(),t=[];for(let n of e){let e=d.get(n.name);if(e?.skills)for(let n of e.skills)t.push(u(n))}return t}function u(e){return{type:`prompt`,name:e.name,description:e.description,hasUserSpecifiedDescription:!0,allowedTools:e.allowedTools??[],argumentHint:e.argumentHint,whenToUse:e.whenToUse,model:e.model,disableModelInvocation:e.disableModelInvocation??!1,userInvocable:e.userInvocable??!0,contentLength:0,source:`bundled`,loadedFrom:`bundled`,hooks:e.hooks,context:e.context,agent:e.agent,isEnabled:e.isEnabled??(()=>!0),isHidden:!(e.userInvocable??!0),progressMessage:`running`,getPromptForCommand:e.getPromptForCommand}}var d,f,p=e((()=>{r(),d=new Map,f=`builtin`}));function m(e){if(e.includes(`@`)){let t=e.split(`@`);return{name:t[0]||``,marketplace:t[1]}}return{name:e}}function h(e){return e!==void 0&&t.has(e.toLowerCase())}function g(e){if(e===`managed`)throw Error(`Cannot install plugins to managed scope`);return y[e]}function _(e){return v[e]}var v,y,b=e((()=>{i(),v={policySettings:`managed`,userSettings:`user`,projectSettings:`project`,localSettings:`local`,flagSettings:`flag`},y={user:`userSettings`,project:`projectSettings`,local:`localSettings`}}));function x(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function S(e){return x(e).replace(/"/g,`"`).replace(/'/g,`'`)}var C=e((()=>{}));export{h as a,_ as c,l as d,c as f,a as h,b as i,f as l,o as m,S as n,m as o,p,C as r,g as s,x as t,s as u};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.8.
|
|
2
|
+
import{s as e,u as t}from"./chunks/envUtils-BWeoiL4Y.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),e(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),t(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,`isTTY`,{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`2.8.3 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-DtTgsdnI.js`);if(t(`cli_entry`),process.argv[2]===`--claude-in-chrome-mcp`){t(`cli_claude_in_chrome_mcp_path`);let{runClaudeInChromeMcpServer:e}=await import(`./chunks/mcpServer-DPk-oJOU.js`);await e();return}else if(process.argv[2]===`--chrome-native-host`){t(`cli_chrome_native_host_path`);let{runChromeNativeHost:e}=await import(`./chunks/chromeNativeHost-BldB1Zzi.js`);await e();return}else if(process.argv[2]===`--computer-use-mcp`){t(`cli_computer_use_mcp_path`);let{runComputerUseMcpServer:e}=await import(`./chunks/mcpServer-D2kI_m2H.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-p_5l64_p.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-BGzuPZ5q.js`),{enableConfigs:r}=await import(`./chunks/config-wvQYYbwU.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-Df9tds-b.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-DLTYg-S2.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-cKEuzfyR.js`),{logForDebugging:s}=await import(`./chunks/debug-DIYxb3SF.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-DOvTvOGt.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s,registerPermissionHandler(e,t){e.setNotificationHandler(c(),async e=>t(e.params))}},`2.8.3`);return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-S7pO5khK.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-wvQYYbwU.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-0tZw2TlM.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-BCy5hsQR.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-DKkE8RYG.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-Bo_eeRO9.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-D5awYlvd.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-CfrU0rIR.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-wvQYYbwU.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-CRq9Bt5c.js`);r();let{initSinks:i}=await import(`./chunks/sinks-C4DwU8Xs.js`);i();let{daemonMain:a}=await import(`./chunks/main-SFdnVz-G.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-B-d3Xamr.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-wvQYYbwU.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-CRq9Bt5c.js`);r(),await(await import(`./chunks/bg-CngkAkgc.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-wvQYYbwU.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-CRq9Bt5c.js`);i();let{initSinks:a}=await import(`./chunks/sinks-C4DwU8Xs.js`);a();let{daemonMain:o}=await import(`./chunks/main-SFdnVz-G.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-1oMC9yLQ.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-1oMC9yLQ.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-wvQYYbwU.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-RtizNgNg.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-CfXrXsQ2.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CWupreF6.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-DEZaWwKF.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-p9Tke3lb.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-best",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.3",
|
|
4
4
|
"description": "Reverse-engineered Anthropic Claude Code CLI — interactive AI coding assistant in the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "claude-code-best <claude-code-best@proton.me>",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ApproveApiKey-Cd43j9Wa.js";export{e as ApproveApiKey};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{B as o,F as s,Q as c,Rn as l,T as u,b as d,f,g as p,h as m,nt as h,t as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ko as y,Ps as b}from"./paths-BZjPDxMm.js";import{S as x,U as S,_ as C,z as w}from"./debug-otxXY3j-.js";import{n as T,r as ee}from"./analytics-DqMQntaB.js";import{S as te,b as E,x as D}from"./teammate-CbskW5G9.js";import{S as O,T as k,b as A,d as ne,p as re,u as ie}from"./startupProfiler-CBcN1Chw.js";import{l as j,o as M}from"./stringUtils-KZoO4GUd.js";import{A_ as N,Au as P,BE as ae,DT as oe,Du as se,Fj as ce,Hu as le,Ij as ue,In as de,Jy as F,Lv as fe,Mn as pe,Mu as me,Nv as he,OT as ge,Oo as _e,Ou as ve,Pn as ye,Qh as be,Qy as xe,Tv as Se,Uo as Ce,Vu as we,Xg as Te,Xu as Ee,Zg as De,Zo as Oe,Zu as ke,aS as Ae,bp as je,cb as Me,da as Ne,eg as Pe,eo as Fe,fC as Ie,j_ as Le,jn as Re,lC as ze,la as Be,lb as Ve,nC as He,oS as Ue,qy as I,rC as We,rb as Ge,sS as Ke,sb as qe,uC as Je,uS as Ye,ub as Xe,vp as Ze,wu as Qe,wv as $e,xp as et,xv as tt,yp as nt,zE as rt}from"./loadAgentsDir-BYWykYwn.js";import{Qn as it,Xn as at,Zn as ot,fn as st,sn as ct}from"./prompt-BGNhFY1n.js";import{n as lt,t as ut}from"./browser-Bt-ckCaU.js";import{t as L}from"./useKeybinding-DPOUuymz.js";import{t as dt}from"./useTerminalSize-Du-EamDN.js";import{a as ft,c as pt}from"./constants-BljlAJOX.js";import{t as mt}from"./Dialog-91X6ZGg9.js";import{i as ht,n as gt}from"./mappers-BBkM1aA5.js";function _t(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`local_agent`}function vt(e){return{...e,retain:!1,messages:void 0,diskLoaded:!1,evictAfter:pe(e.status)?Date.now()+St:void 0}}function yt(e,t){ee(`tengu_transcript_view_enter`,{}),t(t=>{let n=t.tasks[e],r=t.viewingAgentTaskId,i=r===void 0?void 0:t.tasks[r],a=r!==void 0&&r!==e&&_t(i)&&i.retain,o=_t(n)&&(!n.retain||n.evictAfter!==void 0),s=t.viewingAgentTaskId!==e||t.viewSelectionMode!==`viewing-agent`;if(!o&&!s&&!a)return t;let c=t.tasks;return(a||o)&&(c={...t.tasks},a&&(c[r]=vt(i)),o&&(c[e]={...n,retain:!0,evictAfter:void 0})),{...t,viewingAgentTaskId:e,viewSelectionMode:`viewing-agent`,tasks:c}})}function bt(e){ee(`tengu_transcript_view_exit`,{}),e(e=>{let t=e.viewingAgentTaskId,n={...e,viewingAgentTaskId:void 0,viewSelectionMode:`none`};if(t===void 0)return e.viewSelectionMode===`none`?e:n;let r=e.tasks[t];return!_t(r)||!r.retain?n:{...n,tasks:{...e.tasks,[t]:vt(r)}}})}function xt(e,t){t(t=>{let n=t.tasks[e];if(!_t(n))return t;if(n.status===`running`)return n.abortController?.abort(),t;if(n.evictAfter===0)return t;let r=t.viewingAgentTaskId===e;return{...t,tasks:{...t.tasks,[e]:{...vt(n),evictAfter:0}},...r&&{viewingAgentTaskId:void 0,viewSelectionMode:`none`}}})}var St,Ct=t((()=>{T(),Re(),St=3e4}));function wt(e,t,n){let r=at(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,Tt.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var Tt,Et=t((()=>{l(),g(),it(),Tt=v()}));function Dt(e){return e===`completed`||e===`failed`||e===`killed`}function Ot(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 kt(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 At(e){return e.shutdownRequested?`stopping`:e.awaitingPlanApproval?`awaiting approval`:e.isIdle?`idle`:(e.progress?.recentActivities&&le(e.progress.recentActivities))??e.progress?.lastActivity?.activityDescription??`working`}function jt(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!Me(t)||process.env.USER_TYPE===`ant`&&me(t))&&(n=!0,t.type!==`in_process_teammate`))return!1;return n}var Mt=t((()=>{i(),P(),qe(),we()}));function Nt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=u(),a=(0,Pt.useMemo)(()=>Ee(ot()),[]),o=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},c=_e(e.prompt,`plan`),l=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)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,R.jsx)(f,{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:kt(e.status),children:[Ot(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,R.jsxs)(d,{dimColor:!0,children:[o,g!==void 0&&g>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,re(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)(m,{children:[r&&(0,R.jsx)(p,{shortcut:`←`,action:`go back`}),(0,R.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,R.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,R.jsxs)(_,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,R.jsxs)(_,{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?`› `:` `,wt(t,a,i)]},n))]}),c?(0,R.jsx)(_,{marginTop:1,children:(0,R.jsx)(Te,{addMargin:!1,planContent:c})}):(0,R.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,R.jsx)(d,{wrap:`wrap`,children:l})]}),e.status===`failed`&&e.error&&(0,R.jsxs)(_,{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 Pt,R,Ft=t((()=>{Pt=n(l(),1),I(),g(),L(),it(),ke(),A(),Ce(),De(),Et(),Mt(),R=v()}));function It(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 Lt({text:e,phase:t=0}){return(0,z.jsx)(z.Fragment,{children:[...e].map((e,n)=>(0,z.jsx)(d,{color:ce(n+t),children:e},n))})}function Rt(e,t,n){let r=(0,Vt.useRef)(e),i=(0,Vt.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 zt({session:e}){let t=We().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=o(r&&!t?Ht:null),a=n?.bugsFound??0,s=n?.bugsVerified??0,c=n?.bugsRefuted??0,l=t||!r,u=Rt(a,i,l),f=Rt(s,i,l),p=Rt(c,i,l),m=Math.floor(i/(Ht*3))%7;if(e.status===`completed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(Lt,{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)(Lt,{text:`ultrareview`,phase:0}),(0,z.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?It(n.stage,u,f,p):`setting up`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,z.jsx)(Lt,{text:`ultrareview`,phase:r?m:0}),(0,z.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function Bt({session:e}){if(e.isRemoteReview)return(0,z.jsx)(zt,{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=E(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,z.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var Vt,z,Ht,Ut=t((()=>{Vt=n(l(),1),b(),He(),g(),D(),ue(),z=v(),Ht=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 Wt({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,Gt=t((()=>{g(),V=v()}));function Kt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,H.jsxs)(d,{children:[O(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,H.jsx)(Wt,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,H.jsx)(d,{children:(0,H.jsx)(Bt,{session:e})}):(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),O(e.title,n,!0),(0,H.jsx)(d,{dimColor:!0,children:` · `}),(0,H.jsx)(Bt,{session:e})]});case`local_agent`:return(0,H.jsxs)(d,{children:[O(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`in_process_teammate`:{let t=At(e);return(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{color:Xe(e.identity.color),children:[`@`,e.identity.agentName]}),(0,H.jsxs)(d,{dimColor:!0,children:[`: `,O(t,n,!0)]})]})}case`local_workflow`:{let t=e;return(0,H.jsxs)(d,{children:[O(t.workflowName??e.summary??e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`running`?`${t.agentCount} ${j(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:[O(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} ${j(t,`file`)}`:`${e.sessionsReviewing} ${j(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,qt=t((()=>{l(),g(),Ve(),A(),M(),b(),Ut(),Gt(),Mt(),H=v()}));function Jt({task:e,onDone:t,onBack:n,onKill:r}){let i=F(e.startTime,e.status===`running`,1e3,0);h({"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())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-Yt),c=o.length-s.length;return(0,U.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,U.jsx)(f,{title:`Memory consolidation`,subtitle:(0,U.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,j(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,j(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)(m,{children:[n&&(0,U.jsx)(p,{shortcut:`←`,action:`go back`}),(0,U.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,U.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(_,{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})]}),s.length===0?(0,U.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,U.jsxs)(U.Fragment,{children:[c>0&&(0,U.jsxs)(d,{dimColor:!0,children:[`(`,c,` earlier `,j(c,`turn`),`)`]}),s.map((e,t)=>(0,U.jsxs)(_,{flexDirection:`column`,children:[(0,U.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,U.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,j(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var U,Yt,Xt=t((()=>{l(),I(),g(),L(),M(),U=v(),Yt=6}));function Zt({teammate:e,onDone:t,onKill:n,onBack:r,onForeground:i}){let[a]=u(),o=(0,Qt.useMemo)(()=>Ee(ot()),[]),s=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let c=a=>{a.key===` `?(a.preventDefault(),t()):a.key===`left`&&r?(a.preventDefault(),r()):a.key===`x`&&e.status===`running`&&n?(a.preventDefault(),n()):a.key===`f`&&e.status===`running`&&i&&(a.preventDefault(),i())},l=At(e),g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount,y=k(e.prompt,300);return(0,W.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:c,children:(0,W.jsxs)(f,{title:(0,W.jsxs)(d,{children:[(0,W.jsxs)(d,{color:Xe(e.identity.color),children:[`@`,e.identity.agentName]}),l&&(0,W.jsxs)(d,{dimColor:!0,children:[` (`,l,`)`]})]}),subtitle:(0,W.jsxs)(d,{children:[e.status!==`running`&&(0,W.jsxs)(d,{color:e.status===`completed`?`success`:e.status===`killed`?`warning`:`error`,children:[e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,W.jsxs)(d,{dimColor:!0,children:[s,g!==void 0&&g>0&&(0,W.jsxs)(W.Fragment,{children:[` · `,re(g),` tokens`]}),v!==void 0&&v>0&&(0,W.jsxs)(W.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,W.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,W.jsxs)(m,{children:[r&&(0,W.jsx)(p,{shortcut:`←`,action:`go back`}),(0,W.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,W.jsx)(p,{shortcut:`x`,action:`stop`}),e.status===`running`&&i&&(0,W.jsx)(p,{shortcut:`f`,action:`foreground`})]}),children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,W.jsxs)(_,{flexDirection:`column`,children:[(0,W.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,W.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,wt(t,o,a)]},n))]}),(0,W.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,W.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,W.jsx)(d,{wrap:`wrap`,children:y})]}),e.status===`failed`&&e.error&&(0,W.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,W.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,W.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})}var Qt,W,$t=t((()=>{Qt=n(l(),1),I(),g(),L(),it(),ke(),A(),Ve(),Et(),Mt(),W=v()}));function en(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: ${k(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${k(n.replace(/\s+/g,` `).trim(),60)}`;return e}function tn({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?sn[o]:`running`:e.status,l=F(e.startTime,i,1e3,0,e.endTime),{agentsWorking:u,toolCalls:p,lastToolCall:m}=(0,G.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?en(r.name,r.input):null}},[e.log]),h=$e(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,G.useState)(!1);return v?(0,K.jsx)(f,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,K.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,K.jsx)(d,{dimColor:!0,children:`This will terminate the Claude Code on the web session.`}),(0,K.jsx)(Ae,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,K.jsx)(f,{title:(0,K.jsxs)(d,{children:[(0,K.jsxs)(d,{color:`background`,children:[o===`plan_ready`?`◆`:`◇`,` `]}),(0,K.jsx)(d,{bold:!0,children:`ultraplan`}),(0,K.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,s]})]}),onCancel:g,color:`background`,children:(0,K.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,K.jsxs)(d,{children:[o===`plan_ready`&&(0,K.jsxs)(d,{color:`success`,children:[a.tick,` `]}),u,` `,j(u,`agent`),` `,o?cn[o]:`working`,` · `,p,` tool`,` `,j(p,`call`)]}),m&&(0,K.jsx)(d,{dimColor:!0,children:m}),(0,K.jsx)(c,{url:h,children:(0,K.jsx)(d,{dimColor:!0,children:h})}),(0,K.jsx)(Ae,{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`:lt(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function nn({stage:e,completed:t,hasProgress:n}){let r=e?ln.indexOf(e):-1,i=!t&&!n;return(0,K.jsxs)(d,{children:[i?(0,K.jsx)(d,{color:`background`,children:`Setup`}):(0,K.jsx)(d,{dimColor:!0,children:`Setup`}),(0,K.jsx)(d,{dimColor:!0,children:` → `}),ln.map((e,n)=>{let a=!t&&!i&&n===r;return(0,K.jsxs)(G.Fragment,{children:[n>0&&(0,K.jsx)(d,{dimColor:!0,children:` → `}),a?(0,K.jsx)(d,{color:`background`,children:un[e]}):(0,K.jsx)(d,{dimColor:!0,children:un[e]})]},e)}),t&&(0,K.jsx)(d,{color:`success`,children:` ✓`})]})}function rn(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} ${j(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return It(t.stage,t.bugsFound,n,r)}function an({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[o,s]=(0,G.useState)(!1),l=F(e.startTime,a,1e3,0,e.endTime),u=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??u,g=$e(e.sessionId),v=i?`ready`:a?`running`:e.status;if(o)return(0,K.jsx)(f,{title:`Stop ultrareview?`,onCancel:()=>s(!1),color:`background`,children:(0,K.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,K.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,K.jsx)(Ae,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):s(!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,K.jsx)(f,{title:(0,K.jsxs)(d,{children:[(0,K.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,K.jsx)(d,{bold:!0,children:`ultrareview`}),(0,K.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,K.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,K.jsxs)(m,{children:[(0,K.jsx)(p,{shortcut:`Enter`,action:`select`}),(0,K.jsx)(p,{shortcut:`Esc`,action:`go back`})]}),children:(0,K.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,K.jsx)(nn,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,K.jsxs)(_,{flexDirection:`column`,children:[(0,K.jsx)(d,{children:rn(e)}),(0,K.jsx)(c,{url:g,children:(0,K.jsx)(d,{dimColor:!0,children:g})})]}),(0,K.jsx)(Ae,{options:y,onChange:e=>{switch(e){case`open`:lt(g),t();break;case`stop`:s(!0);break;case`back`:h();break;case`dismiss`:u();break}}})]})})}function on({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,o]=(0,G.useState)(!1),[s,l]=(0,G.useState)(null),u=(0,G.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:Oe(ht(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,K.jsx)(tn,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,K.jsx)(an,{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(){o(!0),l(null);try{await fe(e.sessionId)}catch(e){l(w(e))}finally{o(!1)}}let y=k(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,K.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,K.jsxs)(f,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,K.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,K.jsxs)(m,{children:[r&&(0,K.jsx)(p,{shortcut:`←`,action:`go back`}),(0,K.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,K.jsx)(p,{shortcut:`t`,action:`teleport`})]}),children:[(0,K.jsxs)(_,{flexDirection:`column`,children:[(0,K.jsxs)(d,{children:[(0,K.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,K.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,K.jsx)(d,{color:`success`,children:b}):(0,K.jsx)(d,{color:`error`,children:b})]}),(0,K.jsxs)(d,{children:[(0,K.jsx)(d,{bold:!0,children:`Runtime`}),`: `,ie((e.endTime??Date.now())-e.startTime)]}),(0,K.jsxs)(d,{wrap:`truncate-end`,children:[(0,K.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,K.jsxs)(d,{children:[(0,K.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,K.jsx)(Bt,{session:e})]}),(0,K.jsxs)(d,{children:[(0,K.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,K.jsx)(c,{url:$e(e.sessionId),children:(0,K.jsx)(d,{dimColor:!0,children:$e(e.sessionId)})})]})]}),e.log.length>0&&(0,K.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(d,{children:[(0,K.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,K.jsx)(_,{flexDirection:`column`,height:10,overflowY:`hidden`,children:u.map((e,n)=>(0,K.jsx)(be,{message:e,lookups:Fe,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,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,u.length,` of `,e.log.length,` messages`]})})]}),s&&(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(d,{color:`error`,children:[`Teleport failed: `,s]})}),a&&(0,K.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var G,K,sn,cn,ln,un,dn=t((()=>{i(),G=n(l(),1),b(),I(),g(),Se(),y(),ct(),st(),ut(),S(),A(),gt(),Ce(),M(),he(),Ue(),Pe(),Ut(),K=v(),sn={needs_input:`input required`,plan_ready:`ready`},cn={needs_input:`waiting`,plan_ready:`done`},ln=[`finding`,`verifying`,`synthesizing`],un={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function fn(e){let t=ye(e.id);try{let e=await x(t,hn);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function pn({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=s(),[a,o]=(0,q.useState)(()=>fn(e)),c=(0,q.useDeferredValue)(a);(0,q.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(fn(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let l=()=>t(`Shell details dismissed`,{display:`system`});h({"confirm:yes":l},{context:`Confirmation`});let u=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=k(e.command,280);return(0,J.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:u,children:(0,J.jsxs)(f,{title:g?`Monitor details`:`Shell details`,onCancel:l,color:`background`,inputGuide:t=>t.pending?(0,J.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,J.jsxs)(m,{children:[r&&(0,J.jsx)(p,{shortcut:`←`,action:`go back`}),(0,J.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:[(0,J.jsxs)(_,{flexDirection:`column`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,J.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,J.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Runtime:`}),` `,ie((e.endTime??Date.now())-e.startTime)]}),(0,J.jsxs)(d,{wrap:`wrap`,children:[(0,J.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,J.jsxs)(_,{flexDirection:`column`,children:[(0,J.jsx)(d,{bold:!0,children:`Output:`}),(0,J.jsx)(q.Suspense,{fallback:(0,J.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,J.jsx)(mn,{outputPromise:c,columns:i})})]})]})})}function mn({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,q.use)(e);if(!n)return(0,J.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,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(_,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,J.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,J.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${ne(r)}`:``]})]})}var q,J,hn,gn=t((()=>{q=n(l(),1),dt(),g(),L(),A(),C(),de(),J=v(),hn=8192})),_n=t((()=>{g()})),vn=t((()=>{g()})),yn=r({MonitorMcpDetailDialog:()=>bn});function bn({task:e,onBack:t,onKill:n}){let r=F(e.startTime,e.status===`running`,1e3,0);return h({},{context:`MonitorMcpDetail`}),(0,Y.jsx)(_,{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,Y.jsx)(f,{title:`MCP Monitor`,subtitle:(0,Y.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,Y.jsxs)(m,{children:[t&&(0,Y.jsx)(p,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(p,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,Y.jsx)(d,{color:`ansi:green`,children:e.status}):(0,Y.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var Y,xn=t((()=>{l(),I(),g(),L(),_n(),mt(),vn(),Y=v()}));function Sn(e,t){return Object.values(e??{}).filter(Me).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Cn({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=Je(e=>e.tasks),i=Je(e=>e.foregroundedTaskId),a=Je(e=>e.expandedView)===`teammates`,o=Ie(),s=ge(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),c=r,l=(0,Z.useRef)(!1),[u,g]=(0,Z.useState)(()=>{if(n)return l.current=!0,{mode:`detail`,itemId:n};let e=Sn(c,i);return e.length===1?(l.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[v,y]=(0,Z.useState)(0);Ye(`background-tasks-dialog`);let{bashTasks:b,remoteSessions:x,agentTasks:S,teammateTasks:C,workflowTasks:w,mcpMonitors:T,dreamTasks:ee,allSelectableItems:D}=(0,Z.useMemo)(()=>{let e=Object.values(c??{}).filter(Me).map(wn).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),o=e.filter(e=>e.type===`local_workflow`),s=e.filter(e=>e.type===`monitor_mcp`),l=e.filter(e=>e.type===`dream`),u=a?[]:e.filter(e=>e.type===`in_process_teammate`),d=u.length>0?[{id:`__leader__`,type:`leader`,label:`@${ft}`,status:`running`}]:[];return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:o,mcpMonitors:s,dreamTasks:l,teammateTasks:[...d,...u],allSelectableItems:[...d,...u,...t,...s,...n,...r,...o,...l]}},[c,i,a]),O=D[v]??null;h({"confirm:previous":()=>y(e=>Math.max(0,e-1)),"confirm:next":()=>y(e=>Math.min(D.length-1,e+1)),"confirm:yes":()=>{let t=D[v];t&&(t.type===`leader`?(bt(o),e(`Viewing leader`,{display:`system`})):g({mode:`detail`,itemId:t.id}))}},{context:`Confirmation`,isActive:u.mode===`list`});let k=t=>{if(u.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=D[v];n&&(t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?A(n.id):n.type===`local_agent`&&n.status===`running`?ne(n.id):n.type===`in_process_teammate`&&n.status===`running`?re(n.id):n.type===`local_workflow`&&n.status===`running`&&En?En(n.id,o):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,o):n.type===`dream`&&n.status===`running`?ie(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?Ne(n.id,n.task.sessionId,o):j(n.id))),t.key===`f`&&(n.type===`in_process_teammate`&&n.status===`running`?(t.preventDefault(),yt(n.id,o),e(`Viewing teammate`,{display:`system`})):n.type===`leader`&&(t.preventDefault(),bt(o),e(`Viewing leader`,{display:`system`}))))};async function A(e){await Qe.kill(e,o)}async function ne(e){await ve.kill(e,o)}async function re(e){await xe.kill(e,o)}async function ie(e){await je.kill(e,o)}async function j(e){await tt.kill(e,o)}let M=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(u.mode!==`list`){let e=(c??{})[u.itemId];(!e||e.type!==`local_workflow`&&!Me(e))&&(l.current?M(`Background tasks dialog dismissed`,{display:`system`}):g({mode:`list`}))}let e=D.length;v>=e&&e>0&&y(e-1)},[u,c,v,D,M]);let N=()=>{l.current&&D.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(l.current=!1,g({mode:`list`}))};if(u.mode!==`list`&&c){let n=c[u.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Q.jsx)(pn,{shell:n,onDone:e,onKillShell:()=>void A(n.id),onBack:N},`shell-${n.id}`);case`local_agent`:return(0,Q.jsx)(Nt,{agent:n,onDone:e,onKillAgent:()=>void ne(n.id),onBack:N},`agent-${n.id}`);case`remote_agent`:return(0,Q.jsx)(on,{session:n,onDone:e,toolUseContext:t,onBack:N,onKill:n.status===`running`?n.isUltraplan?()=>void Ne(n.id,n.sessionId,o):()=>void j(n.id):void 0},`session-${n.id}`);case`in_process_teammate`:return(0,Q.jsx)(Zt,{teammate:n,onDone:e,onKill:n.status===`running`?()=>void re(n.id):void 0,onBack:N,onForeground:n.status===`running`?()=>{yt(n.id,o),e(`Viewing teammate`,{display:`system`})}:void 0},`teammate-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&En?()=>En(n.id,o):void 0;return(0,Q.jsx)(_,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),N()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Q.jsx)(f,{title:n.workflowName,subtitle:(0,Q.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:N,inputGuide:()=>(0,Q.jsxs)(m,{children:[(0,Q.jsx)(p,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(p,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,Q.jsxs)(_,{flexDirection:`column`,children:[(0,Q.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,Q.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,Q.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Dn?(0,Q.jsx)(Dn,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,o):void 0,onBack:N},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Q.jsx)(Jt,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:N,onKill:n.status===`running`?()=>void ie(n.id):void 0},`dream-${n.id}`)}}let P=E(b,e=>e.status===`running`),ae=E(x,e=>e.status===`running`||e.status===`pending`)+E(S,e=>e.status===`running`),oe=E(C,e=>e.status===`running`),se=te([...oe>0?[(0,Q.jsxs)(d,{children:[oe,` `,oe===1?`agent`:`agents`]},`teammates`)]:[],...P>0?[(0,Q.jsxs)(d,{children:[P,` `,P===1?`active shell`:`active shells`]},`shells`)]:[],...ae>0?[(0,Q.jsxs)(d,{children:[ae,` `,ae===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(d,{children:` · `},`separator-${e}`)),ce=[(0,Q.jsx)(p,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(p,{shortcut:`Enter`,action:`view`},`enter`),...O?.type===`in_process_teammate`&&O.status===`running`?[(0,Q.jsx)(p,{shortcut:`f`,action:`foreground`},`foreground`)]:[],...(O?.type===`local_bash`||O?.type===`local_agent`||O?.type===`in_process_teammate`||O?.type===`local_workflow`||O?.type===`monitor_mcp`||O?.type===`dream`||O?.type===`remote_agent`)&&O.status===`running`?[(0,Q.jsx)(p,{shortcut:`x`,action:`stop`},`kill`)]:[],...S.some(e=>e.status===`running`)?[(0,Q.jsx)(p,{shortcut:s,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(p,{shortcut:`←/Esc`,action:`close`},`esc`)],le=()=>e(`Background tasks dialog dismissed`,{display:`system`});function ue(e){return e.pending?(0,Q.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(m,{children:ce})}return(0,Q.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:k,children:(0,Q.jsx)(f,{title:`Background tasks`,subtitle:(0,Q.jsx)(Q.Fragment,{children:se}),onCancel:le,color:`background`,inputGuide:ue,children:D.length===0?(0,Q.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(_,{flexDirection:`column`,children:[C.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,children:[(b.length>0||x.length>0||S.length>0)&&(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Agents`]}),` (`,E(C,e=>e.type!==`leader`),`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:(0,Q.jsx)(Tn,{teammateTasks:C,currentSelectionId:O?.id})})]}),b.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0),children:[(C.length>0||x.length>0||S.length>0)&&(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,b.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:b.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})]}),T.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,T.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:T.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})]}),x.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,x.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:x.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})]}),S.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,S.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:S.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})]}),w.length>0&&(0,Q.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0),children:[(0,Q.jsxs)(d,{dimColor:!0,children:[(0,Q.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,w.length,`)`]}),(0,Q.jsx)(_,{flexDirection:`column`,children:w.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})]}),ee.length>0&&(0,Q.jsx)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0||w.length>0),children:(0,Q.jsx)(_,{flexDirection:`column`,children:ee.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===O?.id},e.id))})})]})})})}function wn(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`in_process_teammate`:return{id:e.id,type:`in_process_teammate`,label:`@${e.identity.agentName}`,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 X({item:e,isSelected:t}){let{columns:n}=s(),r=Math.max(30,n-26),i=ae();return(0,Q.jsxs)(_,{flexDirection:`row`,children:[(0,Q.jsx)(d,{dimColor:i&&t,children:t?a.pointer+` `:` `}),(0,Q.jsx)(d,{color:t&&!i?`suggestion`:void 0,children:e.type===`leader`?(0,Q.jsxs)(d,{children:[`@`,ft]}):(0,Q.jsx)(Kt,{task:e.task,maxActivityWidth:r})})]})}function Tn({teammateTasks:e,currentSelectionId:t}){let n=e.filter(e=>e.type===`leader`),r=e.filter(e=>e.type===`in_process_teammate`),i=new Map;for(let e of r){let t=e.task.identity.teamName,n=i.get(t);n?n.push(e):i.set(t,[e])}return(0,Q.jsx)(Q.Fragment,{children:[...i.entries()].map(([e,r])=>(0,Q.jsxs)(_,{flexDirection:`column`,children:[(0,Q.jsxs)(d,{dimColor:!0,children:[` `,`Team: `,e,` (`,r.length+n.length,`)`]}),n.map(n=>(0,Q.jsx)(X,{item:n,isSelected:n.id===t},`${n.id}-${e}`)),r.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===t},e.id))]},e))})}var Z,Q,En,$,Dn,On=t((()=>{i(),Z=n(l(),1),rt(),dt(),ze(),Ct(),et(),Ge(),P(),se(),Se(),qe(),D(),pt(),Be(),Ke(),g(),L(),oe(),Ft(),qt(),Xt(),$t(),dn(),gn(),Q=v(),En=(nt(),e(Ze))?.killWorkflowTask??null,$=(Le(),e(N))?.killMonitorMcp??null,Dn=(xn(),e(yn)).MonitorMcpDetailDialog}));export{jt as a,Ct as c,Dt as i,xt as l,On as n,yt as o,Mt as r,bt as s,Cn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./ClaudeMdExternalIncludesDialog-DoNd72PS.js";e();export{t as ClaudeMdExternalIncludesDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hy as e,Vy as t}from"./loadAgentsDir-BYWykYwn.js";e();export{t as ConsoleOAuthFlow};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Rn as a,b as o,f as s,h as c,m as l,nt as u,t as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Uc as m,Xc as h}from"./paths-BZjPDxMm.js";import{n as g,t as _}from"./cwd--iizewsn.js";import{b as v,w as y}from"./startupProfiler-CBcN1Chw.js";import{l as b,o as x}from"./stringUtils-KZoO4GUd.js";import{DT as S,OT as C,bm as w,dm as T,fm as E,sS as D,uS as O,vm as k,ym as A}from"./loadAgentsDir-BYWykYwn.js";import{t as j}from"./useKeybinding-DPOUuymz.js";import{t as M}from"./useTerminalSize-Du-EamDN.js";import{resolve as ee}from"path";function N(){let[e,t]=(0,P.useState)(null),[n,r]=(0,P.useState)(new Map),[i,a]=(0,P.useState)(!0);return(0,P.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([k(),A()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,P.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>F;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 P,F,I=e((()=>{P=t(a(),1),w(),F=400}));function L(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 te(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function ne(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 re(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 R(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 z(e){let t=(0,B.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,B.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&&(R(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:re(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(L(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&&te(e)){let t=e.content.split(`
|
|
2
|
-
`),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}=ne(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&&(R(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var B,V=e((()=>{B=t(a(),1)}));function H({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:s}){let{columns:c}=i(),{firstLine:u,fileContent:d}=(0,U.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=h(ee(_(),e));return{firstLine:t?.split(`
|
|
3
|
-
`)[0]??null,fileContent:t??void 0}},[e]);return s?(0,W.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,W.jsxs)(f,{children:[(0,W.jsx)(o,{bold:!0,children:e}),(0,W.jsx)(o,{dimColor:!0,children:` (untracked)`})]}),(0,W.jsx)(l,{padding:4}),(0,W.jsxs)(f,{flexDirection:`column`,children:[(0,W.jsx)(o,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,W.jsxs)(o,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,W.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,W.jsx)(f,{children:(0,W.jsx)(o,{bold:!0,children:e})}),(0,W.jsx)(l,{padding:4}),(0,W.jsx)(f,{flexDirection:`column`,children:(0,W.jsx)(o,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,W.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,W.jsx)(f,{children:(0,W.jsx)(o,{bold:!0,children:e})}),(0,W.jsx)(l,{padding:4}),(0,W.jsx)(f,{flexDirection:`column`,children:(0,W.jsx)(o,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,W.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,W.jsxs)(f,{children:[(0,W.jsx)(o,{bold:!0,children:e}),a&&(0,W.jsx)(o,{dimColor:!0,children:` (truncated)`})]}),(0,W.jsx)(l,{padding:4}),(0,W.jsx)(f,{flexDirection:`column`,children:t.length===0?(0,W.jsx)(o,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,W.jsx)(T,{patch:t,filePath:e,firstLine:u,fileContent:d,dim:!1,width:c-2-2},n))}),a&&(0,W.jsx)(o,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var U,W,G=e((()=>{U=t(a(),1),M(),d(),g(),m(),E(),W=p()}));function K({files:e,selectedIndex:t}){let{columns:n}=i(),{startIndex:r,endIndex:a}=(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)(o,{dimColor:!0,children:`No changed files`});let s=e.slice(r,a),c=r>0,l=a<e.length,u=e.length>Z,d=Math.max(20,n-16-3-4);return(0,X.jsxs)(f,{flexDirection:`column`,children:[u&&(0,X.jsx)(o,{dimColor:!0,children:c?` ↑ ${r} more ${b(r,`file`)}`:` `}),s.map((e,n)=>(0,X.jsx)(q,{file:e,isSelected:r+n===t,maxPathWidth:d},e.path)),u&&(0,X.jsx)(o,{dimColor:!0,children:l?` ↓ ${e.length-a} more ${b(e.length-a,`file`)}`:` `})]})}function q({file:e,isSelected:t,maxPathWidth:n}){let i=y(e.path,n),a=`${t?r.pointer+` `:` `}${i}`;return(0,X.jsxs)(f,{flexDirection:`row`,children:[(0,X.jsx)(o,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(f,{flexGrow:1}),(0,X.jsx)(J,{file:e,isSelected:t})]})}function J({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(o,{children:[e.linesAdded>0&&(0,X.jsxs)(o,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(o,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(o,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,ie=e((()=>{n(),Y=t(a(),1),M(),d(),v(),x(),X=p(),Z=5}));function ae(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 oe({messages:e,onDone:t}){let n=N(),r=z(e),[i,a]=(0,Q.useState)(`list`),[l,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)(()=>_?ae(_):n,[_,n]),y=v.files[l],x=(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 S=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{S.current!==p&&(d(0),S.current=p)},[p]),O(`diff-dialog`),u({"diff:previousSource":()=>{i===`detail`?a(`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`&&a(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&a(`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 w=v.stats?(0,$.jsxs)(o,{dimColor:!0,children:[v.stats.filesCount,` `,b(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(o,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(o,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,T=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,E=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,D=h.length>1?(0,$.jsxs)(f,{children:[p>0&&(0,$.jsx)(o,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(o,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<h.length-1&&(0,$.jsx)(o,{dimColor:!0,children:` ▶`})]}):null,k=C(`diff:dismiss`,`DiffDialog`,`esc`),A=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`,j=(0,$.jsxs)(o,{children:[T,E&&(0,$.jsxs)(o,{dimColor:!0,children:[` `,E]})]});function M(){i===`detail`?a(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(s,{title:j,onCancel:M,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[h.length>1&&(0,$.jsx)(o,{children:`←/→ source`}),(0,$.jsx)(o,{children:`↑/↓ select`}),(0,$.jsx)(o,{children:`Enter view`}),(0,$.jsxs)(o,{children:[k,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(o,{children:`← back`}),(0,$.jsxs)(o,{children:[k,` close`]})]}),children:[D,w,v.files.length===0?(0,$.jsx)(f,{marginTop:1,children:(0,$.jsx)(o,{dimColor:!0,children:A})}):i===`list`?(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(K,{files:v.files,selectedIndex:l})}):(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(H,{filePath:y?.path||``,hunks:x,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(a(),1),D(),I(),V(),d(),j(),S(),x(),G(),ie(),$=p()}))();export{oe as DiffDialog};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Rn as o,b as s,nt as c,p as l,t as u,x as d}from"./src-Di342QoJ.js";import{t as f}from"./jsx-runtime-D-D469L8.js";import{cn as p,ot as ee}from"./state-sIHsFpDu.js";import{Ao as m,Do as h,Dr as g,Jc as _,Ka as v,Pr as y,Uc as b,cr as te,dr as x,oo as S}from"./paths-BZjPDxMm.js";import{l as C,o as w}from"./stringUtils-KZoO4GUd.js";import{FA as T,FT as E,IT as D,JT as ne,KT as O,Kk as k,MA as A,NT as re,PT as ie,Qk as ae,XT as oe,Xc as j,Xk as se,YT as ce,Yc as M,Yk as N,_h as P,_x as F,bh as I,bx as L,cj as R,dl as z,dp as B,lC as V,lp as H,qT as U,sj as W,uC as G,ul as le,up as ue,vh as de,vx as fe,xh as pe,yh as me,yx as he}from"./loadAgentsDir-BYWykYwn.js";import{t as ge}from"./useKeybinding-DPOUuymz.js";import{n as _e,t as ve}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{a as ye,i as be}from"./xdg-BFD9ydDV.js";import{n as xe,t as Se}from"./McpParsingWarnings-DsHSSgsx.js";import{n as Ce,t as we}from"./PressEnterToContinue-BYdiZwYD.js";import{n as Te,t as Ee}from"./ValidationErrorsList-sgfvJPWZ.js";import{n as De,t as Oe}from"./useSettingsErrors-DUe4k_RK.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-CGD7Nx03.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-JNibsI_v.js";import{join as q}from"path";function Ne(){if(!D())return null;let e=re();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)(d,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(s,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`Location: `}),(0,J.jsx)(s,{dimColor:!0,children:ie()})]}),(0,J.jsxs)(d,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(d,{flexDirection:`column`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`└ `}),(0,J.jsx)(s,{color:`error`,children:`[Error]`}),(0,J.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(d,{marginLeft:3,children:(0,J.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(d,{flexDirection:`column`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`└ `}),(0,J.jsx)(s,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(d,{marginLeft:3,children:(0,J.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{o(),u(),E(),J=f()}));function Fe(){if(!A.isSupportedPlatform()||!A.isSandboxEnabledInSettings())return null;let e=A.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsx)(s,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(s,{children:[`└ Status: `,(0,Y.jsx)(s,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(s,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(s,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(s,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{o(),u(),T(),Y=f()}));async function Le(){let e=N(await se());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 > ${k.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${k.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:k}}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:j(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 le(e,t,n,g());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+j(((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:A.isSandboxingEnabled()&&A.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${m(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${C(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((()=>{M(),z(),ae(),y(),h(),ke(),T(),Me(),w(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(s,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(s,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(s,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=G(e=>e.agentDefinitions),r=G(e=>e.mcp.tools),i=G(e=>e.toolPermissionContext),o=G(e=>e.plugins.errors);_e();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S=De(),C=(0,Q.useMemo)(()=>O().then(e=>(e.installationType===`native`?ne:ce)().catch(()=>({latest:null,stable:null}))),[]),w=v()?.autoUpdatesChannel??`latest`,T=S.filter(e=>e.mcpErrorMetadata===void 0),E=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:P,upperLimit:de},{name:`TASK_MAX_OUTPUT_LENGTH`,default:H,upperLimit:ue},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...te(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=pe(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{O().then(p),(async()=>{let e=q(n(),`agents`),r=q(ee(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([_(e),_(r)]);if(h({activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s}),y(await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i)),L()){let e=q(be(),`claude`,`locks`),t=F(e);x({enabled:!0,locks:fe(e),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 c({"confirm:yes":D,"confirm:no":D},{context:`Confirmation`}),f?(0,$.jsxs)(l,{children:[(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(s,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(s,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(s,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(s,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(s,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(s,{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)(s,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),(0,$.jsxs)(s,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
|
|
2
|
-
`)[0]]}),(0,$.jsx)(s,{dimColor:!0,children:f.recommendation.split(`
|
|
3
|
-
`)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),(0,$.jsx)(s,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(s,{}),f.warnings.map((e,t)=>(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsxs)(s,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(s,{children:[`Fix: `,e.fix]})]},t))]}),T.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(s,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(Ee,{errors:T})]})]}),(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Updates`}),(0,$.jsxs)(s,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(s,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(s,{children:[`└ Auto-update channel: `,w]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:C})})]}),(0,$.jsx)(Fe,{}),(0,$.jsx)(Se,{}),(0,$.jsx)(Ne,{}),E.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Environment Variables`}),E.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(s,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),b?.enabled&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Version Locks`}),b.staleLocksCleaned>0&&(0,$.jsxs)(s,{dimColor:!0,children:[`└ Cleaned `,b.staleLocksCleaned,` stale lock(s)`]}),b.locks.length===0?(0,$.jsx)(s,{dimColor:!0,children:`└ No active version locks`}):b.locks.map((e,t)=>(0,$.jsxs)(s,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(s,{children:`(running)`}):(0,$.jsx)(s,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(s,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),o.length>0&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(s,{color:`error`,children:[`└ `,o.length,` plugin error(s) detected:`]}),o.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,W(e)]},t))]}),g?.unreachableRulesWarning&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.unreachableRulesWarning.message]})]}),g.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g&&(g.claudeMdWarning||g.agentWarning||g.mcpWarning)&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Context Usage Warnings`}),g.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.claudeMdWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Files:`]}),g.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.agentWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Top contributors:`]}),g.agentWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.mcpWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ MCP servers:`]}),g.mcpWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(d,{children:(0,$.jsx)(we,{})})]}):(0,$.jsx)(l,{children:(0,$.jsx)(s,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(o(),1),Pe(),xe(),x(),r(),p(),u(),Ce(),Ie(),Te(),Oe(),ve(),ge(),V(),R(),oe(),Ve(),U(),I(),b(),he(),S(),me(),B(),ye(),$=f()}));export{We as n,Ue as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./Doctor-0Nv3L1Oy.js";e();export{t as Doctor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./Grove-BrP9JNpK.js";e();export{t as GroveDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{B as r,F as i,L as a,z as o}from"./server-DzOdtq8A.js";import{Rn as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Ct as l,cn as u,y as d}from"./state-sIHsFpDu.js";import{Qo as f,S as p,Xo as ee,_ as m,bl as h,hl as g,ml as _,xl as te}from"./paths-BZjPDxMm.js";import{E as v,O as y,U as b,l as x,p as ne,z as S}from"./debug-otxXY3j-.js";import{n as re,r as C}from"./analytics-DqMQntaB.js";import{c as w,l as T,o as ie}from"./log-DSV4Ht5l.js";import{Fw as ae,Hw as E,IC as oe,Jw as se,Jx as D,KO as ce,Kw as O,LC as le,Lw as k,Nw as ue,Ow as de,Pw as fe,Qx as A,Vw as pe,Xw as me,Xx as j,Zx as M,dC as he,eS as N,fC as ge,hw as _e,lC as P,oC as F,qw as I,rS as L,sC as ve,tS as ye,uC as R,xw as be,zO as xe}from"./loadAgentsDir-BYWykYwn.js";import{o as Se,s as Ce}from"./localSearch-eWjZxMc8.js";import{c as we,i as Te,l as Ee,o as De,r as Oe,s as ke,t as z}from"./channelNotification-CLPdvxGZ.js";import{basename as Ae}from"path";function je(){return m(`tengu_harbor_permissions`,!0)}function B(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);t>>>=0;let n=``;for(let e=0;e<5;e++)n+=V[t%25],t=Math.floor(t/25);return n}function Me(e){let t=B(e);for(let n=0;n<10;n++){if(!H.some(e=>t.includes(e)))return t;t=B(`${e}:${n}`)}return t}function Ne(e){try{let t=y(e);return t.length>200?t.slice(0,200)+`…`:t}catch{return`(unserializable)`}}function Pe(e,t){return e.filter(e=>e.type===`connected`&&t(e.name)&&!!e.capabilities?.experimental?.[`claude/channel`]&&!!e.capabilities?.experimental?.[`claude/channel/permission`])}function Fe(){let e=new Map;return{onResponse(t,n){let r=t.toLowerCase();return e.set(r,n),()=>{e.delete(r)}},resolve(t,n,r){let i=t.toLowerCase(),a=e.get(i);return a?(e.delete(i),a({behavior:n,fromServer:r}),!0):!1}}}var V,H,U=t((()=>{v(),p(),V=`abcdefghijkmnopqrstuvwxyz`,H=[`fuck`,`shit`,`cunt`,`cock`,`dick`,`twat`,`piss`,`crap`,`bitch`,`whore`,`ass`,`tit`,`cum`,`fag`,`dyke`,`nig`,`kike`,`rape`,`nazi`,`damn`,`poo`,`pee`,`wank`,`anus`]}));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 Ie(e,t=!1){let n=he(),r=R(e=>e.authVersion),s=R(e=>e.mcp.pluginReconnectKey),c=ge(),u=(0,K.useRef)(new Map),f=(0,K.useRef)(new Set),p=(0,K.useRef)(null);p.current===null&&(p.current=Fe()),(0,K.useEffect)(()=>{{let e=p.current;return!e||!je()?void 0:(c(t=>t.channelPermissionCallbacks===e?t:{...t,channelPermissionCallbacks:e}),()=>{c(e=>e.channelPermissionCallbacks===void 0?e:{...e,channelPermissionCallbacks:void 0})})}},[c]);let{addNotification:m}=ve(),h=(0,K.useRef)([]),_=(0,K.useRef)(null),v=(0,K.useCallback)(()=>{_.current=null;let e=h.current;e.length!==0&&(h.current=[],c(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=ee(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:[...g(n.tools,e=>e.name?.startsWith(l)),...o],f=s===void 0?n.commands:[...g(n.commands,e=>_e(e,a.name)),...s],p=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:te(n.resources,a.name)};n={...n,clients:u,tools:d,commands:f,resources:p}}return{...t,mcp:n}}))},[c]),y=(0,K.useCallback)(e=>{h.current.push(e),_.current===null&&(_.current=setTimeout(v,16))},[v]),b=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(y({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:{le(e.client,e.name,c),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(D(e.name,e.config).catch(()=>{ne(`Failed to invalidate the server cache: ${e.name}`)}),E(e.name)){w(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=Le(t);w(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=u.current.get(e.name);r&&(clearTimeout(r),u.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(E(e.name)){w(e.name,`Server disabled during reconnection, stopping retry`),u.current.delete(e.name);return}y({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await L(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){w(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),u.current.delete(e.name),b(i);return}if(w(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){w(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),b(i);return}}catch(i){let a=Date.now()-r;if(T(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){w(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),y({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);w(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);u.current.set(e.name,n)})}})()}else y({...e,type:`failed`})};let t=ke(e.name,e.capabilities,e.config.pluginSource),n=De(e.name,d()),r=n?.kind===`plugin`?`${n.name}@${n.marketplace}`:void 0;switch((t.action===`register`||t.kind!==`capability`)&&C(`tengu_mcp_channel_gate`,{registered:t.action===`register`,skip_kind:t.action===`skip`?t.kind:void 0,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),t.action){case`register`:w(e.name,`Channel notifications registered`),e.client.setNotificationHandler(Oe(),async t=>{let{content:i,meta:a}=t.params;w(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),C(`tengu_mcp_channel_message`,{content_length:i.length,meta_key_count:Object.keys(a??{}).length,entry_kind:n?.kind,is_dev:n?.dev??!1,plugin:r}),xe({mode:`prompt`,value:Ee(e.name,i,a),priority:`next`,isMeta:!0,origin:{kind:`channel`,server:e.name},skipSlashCommands:!0})}),e.capabilities?.experimental?.[`claude/channel/permission`]&&e.client.setNotificationHandler(Te(),async t=>{let{request_id:n,behavior:r}=t.params,i=p.current?.resolve(n,r,e.name)??!1;w(e.name,`notifications/claude/channel/permission: ${n} → ${r} (${i?`matched pending`:`no pending entry — stale or unknown ID`})`)});break;case`skip`:if(e.client.removeNotificationHandler(`notifications/claude/channel`),e.client.removeNotificationHandler(z),w(e.name,`Channel notifications skipped: ${t.reason}`),t.kind!==`capability`&&t.kind!==`session`&&!f.current.has(t.kind)&&(t.kind===`marketplace`||t.kind===`allowlist`||n!==void 0)){f.current.add(t.kind);let e=t.kind===`disabled`?`Channels are not currently available`:t.kind===`auth`?`Channels require claude.ai authentication · run /login`:t.kind===`policy`?`Channels are not enabled for your org · have an administrator set channelsEnabled: true in managed settings`:t.reason;m({key:`channels-blocked-${t.kind}`,priority:`high`,text:e,color:`warning`,timeoutMs:12e3})}break}e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(o,async()=>{w(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=A.cache.get(e.name);A.cache.delete(e.name);let n=await A(e),r=n.length;t?t.then(e=>{C(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{C(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):C(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),y({...e,tools:n})}catch(t){T(e.name,`Failed to refresh tools after list_changed notification: ${S(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(i,async()=>{w(e.name,`Received prompts/list_changed notification, refreshing prompts`),C(`tengu_mcp_list_changed`,{type:`prompts`});try{j.cache.delete(e.name);let[t,n]=await Promise.all([j(e),Promise.resolve([])]);y({...e,commands:[...t,...n]}),q?.()}catch(t){T(e.name,`Failed to refresh prompts after list_changed notification: ${S(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(a,async()=>{w(e.name,`Received resources/list_changed notification, refreshing resources`),C(`tengu_mcp_list_changed`,{type:`resources`});try{M.cache.delete(e.name);{let t=await M(e);y({...e,resources:t})}}catch(t){T(e.name,`Failed to refresh resources after list_changed notification: ${S(t)}`)}});break}case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[y]),x=l();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await k(e),i={...n,...e};G(c,r),c(e=>{let{stale:t,...n}=be(e.mcp,i);for(let e of t){let t=u.current.get(e.name);t&&(clearTimeout(t),u.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,D(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(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=>{T(`useManageMCPConnections`,`Failed to initialize servers as pending: ${S(e)}`)})},[t,e,c,x,s]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||fe()?r=Promise.resolve({}):(I(),r=se());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await k(e,r);if(n)return;G(c,a);let o={...i,...e};N(b,Object.fromEntries(Object.entries(o).filter(([e])=>!E(e)))).catch(e=>{T(`useManageMcpConnections`,`Failed to get MCP resources: ${S(e)}`)});let s={};if(!t){if(s=ae(await r).allowed,n)return;if(Object.keys(s).length>0){let{servers:e}=ue(s,o);s=e}Object.keys(s).length>0&&(c(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(s).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:E(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}}),N(b,Object.fromEntries(Object.entries(s).filter(([e])=>!E(e)))).catch(e=>{T(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${S(e)}`)}))}let l={...o,...s},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},d=[];for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++,process.env.USER_TYPE===`ant`&&!E(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&d.push(Ae(t.command));C(`tengu_mcp_servers`,{...u,...process.env.USER_TYPE===`ant`&&d.length>0?{stdio_commands:d.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,b,c,r,x,s]),(0,K.useEffect)(()=>{let e=u.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),_.current!==null&&(clearTimeout(_.current),_.current=null,v())}},[v]),{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=u.current.get(e);r&&(clearTimeout(r),u.current.delete(e));let i=await L(e,t.config);return b(i),i},[n,b]),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=u.current.get(e);n&&(clearTimeout(n),u.current.delete(e)),O(e,!1),t.type===`connected`&&await D(e,t.config),y({name:e,type:`disabled`,config:t.config})}else O(e,!0),y({name:e,type:`pending`,config:t.config}),b(await L(e,t.config))},[n,y,b])}}function Le(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,Re=t((()=>{K=n(s(),1),u(),ye(),r(),h(),_(),re(),pe(),x(),F(),P(),b(),ie(),ce(),we(),U(),me(),oe(),f(),de(),q=(Se(),e(Ce)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ze(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function Be(){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}=Ie(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,He=t((()=>{Z=n(s(),1),Re(),Q=c(),$=(0,Z.createContext)(null)}));export{Pe as a,Ne as c,Be as i,He as n,U as o,ze as r,Me as s,Ve as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./figures-gfT9mM8P.js";import{F as a,Rn as o,b as s,m as c,nt as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{Ct as m,cn as h,mr as g,vt as _}from"./state-sIHsFpDu.js";import{Ht as v,Ko as y,Uo as b,no as x,on as S,oo as C,pi as w,vi as T}from"./paths-BZjPDxMm.js";import{n as E,r as D}from"./analytics-DqMQntaB.js";import{n as O,t as k}from"./cwd--iizewsn.js";import{O as A,et as j,h as ee,m as te,o as ne,s as M}from"./log-DSV4Ht5l.js";import{b as N,x as re}from"./teammate-CbskW5G9.js";import{S as ie,b as ae,h as oe}from"./startupProfiler-CBcN1Chw.js";import{Cn as se,Co as P,Eo as F,Ey as ce,Fc as le,Gc as I,Go as L,Ky as ue,Mc as R,Mo as de,NC as fe,Nc as pe,Oo as z,Ty as me,Uo as B,Wc as V,Wy as he,Yi as ge,Yo as _e,_D as ve,aS as ye,cu as be,dk as xe,fk as Se,fs as Ce,gD as we,ha as Te,jC as Ee,jy as De,lC as Oe,lk as H,ln as ke,na as Ae,oS as je,qi as Me,qo as Ne,uC as Pe,uu as U,vo as Fe,wy as Ie,yn as Le}from"./loadAgentsDir-BYWykYwn.js";import{E as Re,T as ze,c as Be,d as Ve,w as He}from"./sessionTracing-81-RIJBo.js";import{t as Ue}from"./useKeybinding-DPOUuymz.js";import{t as We}from"./useTerminalSize-Du-EamDN.js";import{n as Ge,t as Ke}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.js";import{n as qe,t as Je}from"./slashCommandParsing-BfanVchF.js";import*as W from"path";import{randomUUID as G}from"crypto";o();var K=p();r(),u(),h(),E(),O(),j(),te(),ne(),re(),ae(),y(),C(),S(),xe(),He(),we(),Ee(),Be(),be(),V(),le(),Ce(),B(),Ae(),se(),Je();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`?!0:/\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||``;Ve(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&ze(`user_prompt`,{prompt_length:String(l.length),prompt:Re(l),"prompt.id":s}),D(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[F({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:[F({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}E(),B();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),U(`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(U(`query_process_user_input_base_end`),!x.shouldQuery)return x;U(`query_hooks_start`);let S=de(e)||``;for await(let t of ke(S,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[P(`${Le(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(F({content:e})),x.shouldQuery=!1,x}if(t.additionalContexts&&t.additionalContexts.length>0&&x.messages.push(R({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 U(`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){U(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await Se(n);if(e.dimensions){let t=H(e.dimensions);t&&b.push(t)}t.push(e.block)}else t.push(n);x=t,U(`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 S=i?Object.values(i).filter(I):[],C=S.map(e=>e.id),w=i?await fe(i):new Map;U(`query_pasted_image_processing_start`);let T=await Promise.all(S.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return D(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await Se(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??w.get(e.id)}})),E=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of T){if(e.dimensions){let t=H(e.dimensions,n);t&&b.push(t)}else if(t){let e=H(t,n);e&&b.push(e)}else n&&b.push(`[Image source: ${n}]`);E.push(e.block)}U(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=qe(v),t=e?Me(e.commandName,r.options.commands):void 0;if(t){let n=ge(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${Te(t)} isn't available over Remote Control.`;return{messages:[F({content:v,uuid:s}),Fe(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&v!==null&&!O&&!v.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Qe(g??v)){D(`tengu_ultraplan_keyword`,{});let e=$e(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-Ch9B-6nh.js`);return Y(await t(`/ultraplan ${e}`,y,E,[],r,n,s,c,u,_),b)}let k=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));U(`query_attachment_loading_start`);let A=k?await ve(pe(v,r,a??null,[],o,l)):[];if(U(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-BLSC8o8M.js`);return Y(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-Ch9B-6nh.js`);return Y(await e(v,y,E,A,r,n,s,c,u,_),b)}if(v!==null&&t===`prompt`){let e=v.trim(),t=A.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;D(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(x,E,C,A,s,d,m),b)}function Y(e,t){return t.length>0&&e.messages.push(F({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}h(),T();function ot(e){return e===`Agent`?b:e}function st(e){let t=x()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:k(),session_id:m(),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:v().source,betas:_(),claude_code_version:`2.8.1`,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=w(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:a,onClose:o,preselectedMessage:u}){let p=Pe(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=me(),_=(0,Q.useMemo)(G,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...F({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),x=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),S=v.length>1,[C,w]=(0,Q.useState)(u),[T,E]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!u||!g)return;let e=!1;return ce(p,u.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[u,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,te]=(0,Q.useState)(`both`),[ne,N]=(0,Q.useState)(``),[re,ie]=(0,Q.useState)(``);function ae(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:N}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{D(`tengu_message_selector_opened`,{})},[]);async function se(e){t(),k(!0);try{await n(e),k(!1),o()}catch(e){M(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function P(t){let n=e.indexOf(t);if(D(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!g){await se(t);return}let r=await ce(p,t.uuid);w(t),E(r)}async function le(e){if(D(`tengu_message_selector_restore_option_selected`,{option:e}),!C){h(`Message not found.`);return}if(e===`nevermind`){u?o():w(void 0);return}if(X(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`;await a(C,(t===`up_to`?re:ne).trim()||void 0,t),k(!1),j(null),w(void 0),o()}catch(e){M(e),k(!1),j(null),w(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,s=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,M(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){s=e,M(s)}k(!1),w(void 0),s&&i?h(`Failed to restore the conversation and code:\n${s}\n${i}`):s?h(`Failed to restore the conversation:\n${s}`):i?h(`Failed to restore the code:\n${i}`):o()}let I=Ge(),L=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),ue=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),R=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),de=(0,Q.useCallback)(()=>b(0),[]),fe=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),pe=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,L,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":ue,"messageSelector:down":R,"messageSelector:top":de,"messageSelector:bottom":fe,"messageSelector:select":pe},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[z,B]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=Ie(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;B(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let V=g&&T?.filesChanged&&T.filesChanged.length>0,ge=!m&&!C&&!u&&S;return(0,K.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(c,{color:`suggestion`}),(0,K.jsxs)(f,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(s,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(s,{color:`error`,children:[`Error: `,m]})}),!S&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(s,{children:`Nothing to rewind to yet.`})}),!m&&C&&S&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(s,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(f,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:C,color:`text`,isCurrent:!1}),(0,K.jsxs)(s,{dimColor:!0,children:[`(`,oe(new Date(C.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:ee,canRestoreCode:!!V,diffStatsForRestore:T}),O&&X(A)?(0,K.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(he,{}),(0,K.jsx)(s,{children:`Summarizing…`})]}):(0,K.jsx)(ye,{isDisabled:O,options:ae(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>te(e),onChange:e=>le(e),onCancel:()=>u?o():w(void 0)}),V&&(0,K.jsx)(f,{marginBottom:1,children:(0,K.jsxs)(s,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ge&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(s,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(s,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(f,{width:`100%`,flexDirection:`column`,children:v.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===y,a=e.uuid===_,o=n in z,c=z[n],l=c?.filesChanged&&c.filesChanged.length;return(0,K.jsxs)(f,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(f,{width:2,minWidth:2,children:r?(0,K.jsxs)(s,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(s,{children:` `})}),(0,K.jsxs)(f,{flexDirection:`column`,children:[(0,K.jsx)(f,{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)(f,{height:1,flexDirection:`row`,children:c?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(s,{dimColor:!r,color:`inactive`,children:l?(0,K.jsxs)(K.Fragment,{children:[l===1&&c.filesChanged[0]?`${W.basename(c.filesChanged[0])} `:`${l} files changed `,(0,K.jsx)(mt,{diffStats:c})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(s,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,K.jsx)(s,{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&&S&&`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)(f,{flexDirection:`column`,children:[(0,K.jsx)(s,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(s,{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)(s,{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)(s,{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)(s,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(s,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:o}=a();if(r)return(0,K.jsx)(f,{width:`100%`,children:(0,K.jsx)(s,{italic:!0,color:t,dimColor:n,children:`(current)`})});let c=e.message.content,l=typeof c==`string`?null:c[c.length-1],u=ee(typeof c==`string`?c.trim():l&<(l)?l.text.trim():`(no prompt)`);if(L(u))return(0,K.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(s,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=z(u,`bash-input`);if(e)return(0,K.jsxs)(f,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(s,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(s,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=z(u,A),r=z(u,`command-args`),i=z(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(s,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(s,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(f,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(s,{color:t,dimColor:n,children:i?ie(u,o-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||!_e(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=N(e.lines,e=>e.startsWith(`+`)),n=N(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`||Ne(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||r.indexOf(`<teammate-message`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!Ne(t)&&!_e(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(o()),E(),Oe(),De(),Ke(),Ue(),B(),je(),ue(),We(),$=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};
|