@readmagic/workmate 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AddWorkspaceDirectory-Vmmm7p1c.js +1 -0
- package/dist/chunks/App-C2yQjBgY.js +1 -0
- package/dist/chunks/ApproveApiKey-CKbv5C1x.js +1 -0
- package/dist/chunks/ApproveApiKey-MscC-ssL.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-CLSACUmo.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BqNxQOXJ.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +1 -0
- package/dist/chunks/DiffDialog-9AYwtupw.js +6 -0
- package/dist/chunks/Doctor-DmgAwce2.js +1 -0
- package/dist/chunks/Doctor-jEs9chPk.js +3 -0
- package/dist/chunks/ExitFlow-DVKxFdpX.js +2 -0
- package/dist/chunks/Grove-B9-hhkZA.js +11 -0
- package/dist/chunks/{HybridTransport-BJPOG2wl.js → HybridTransport-MxJ_W_np.js} +3 -3
- package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-YyQcHocx.js +1 -0
- package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +1 -0
- package/dist/chunks/MCPToolListView-CvqB4nCw.js +1 -0
- package/dist/chunks/McpParsingWarnings-BCpfHaBK.js +1 -0
- package/dist/chunks/MessageSelector-BLzw172f.js +3 -0
- package/dist/chunks/Messages-4K5sLmNh.js +11 -0
- package/dist/chunks/Onboarding-ClwHS5rh.js +1 -0
- package/dist/chunks/{PermissionDialog-0ya1CU5k.js → PermissionDialog-Cb3z8OUP.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-Dl9Hg9Mf.js → PressEnterToContinue-Dq0Imo9c.js} +1 -1
- package/dist/chunks/PromptInputFooterSuggestions-BSA9NrZc.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-Bb4KdIX_.js +1 -0
- package/dist/chunks/QueryEngine-DPHLSsax.js +1 -0
- package/dist/chunks/REPL-Bf46iQCN.js +1 -0
- package/dist/chunks/REPL-DIaAo9M9.js +133 -0
- package/dist/chunks/RemoteSessionManager-CS6mywIn.js +2 -0
- package/dist/chunks/ResumeConversation-Br2KsBoe.js +1 -0
- package/dist/chunks/{SSETransport-CrwbKuVt.js → SSETransport-CoxQ8YpH.js} +1 -1
- package/dist/chunks/{SearchBox-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +1 -0
- package/dist/chunks/Settings-BMXysXIx.js +2 -0
- package/dist/chunks/TeleportProgress-Doucj-50.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-B5I73j7Y.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-D6kpr2c6.js +1 -0
- package/dist/chunks/ThemePicker-DrC8tlp0.js +1 -0
- package/dist/chunks/{TrustDialog-BukWGvHZ.js → TrustDialog-Fk4m_Sy4.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-DokTJQwi.js → ValidationErrorsList-D_OUa4RT.js} +1 -1
- package/dist/chunks/WelcomeV2-DvfQHnZY.js +1 -0
- package/dist/chunks/add-dir-CZ6Clvq8.js +1 -0
- package/dist/chunks/{agentDisplay-DBQYOaOh.js → agentDisplay-B755vMZE.js} +1 -1
- package/dist/chunks/{agents-HlKk68Qc.js → agents-CIvP8l0s.js} +1 -1
- package/dist/chunks/agents-DHnNg4h6.js +103 -0
- package/dist/chunks/allErrors-CU89tF-z.js +1 -0
- package/dist/chunks/analytics-DJobLaWP.js +1 -0
- package/dist/chunks/api-BSeE6MwB.js +1 -0
- package/dist/chunks/{api-CF5IVtj0.js → api-nSHc_GIQ.js} +1 -1
- package/dist/chunks/auth-5QB6tsfB.js +15 -0
- package/dist/chunks/auth-BIGJth5U.js +1 -0
- package/dist/chunks/auth-CDQMhIZP.js +1 -0
- package/dist/chunks/{autoMode-Cr0AhS1G.js → autoMode-BnUiK9Cu.js} +4 -4
- package/dist/chunks/{autonomy-ARUQt-Lu.js → autonomy-C1aSgWPQ.js} +1 -1
- package/dist/chunks/autonomy-Src6sKCp.js +15 -0
- package/dist/chunks/{autonomyPanel-BQK9MoeB.js → autonomyPanel-DnHpuiy4.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +17 -0
- package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +1 -0
- package/dist/chunks/{banner-Ca7rki2V.js → banner-D0P7wXdw.js} +1 -1
- package/dist/chunks/bg-50rllUNh.js +1 -0
- package/dist/chunks/{bg-DxRHF1yn.js → bg-DAPORXF3.js} +2 -2
- package/dist/chunks/branch-DFWa4Oxo.js +3 -0
- package/dist/chunks/{break-cache-BKvoMOZx.js → break-cache-Chj9i9MP.js} +2 -2
- package/dist/chunks/{bridgeConfig-jDEva6Eh.js → bridgeConfig-Bb6URf4Q.js} +1 -1
- package/dist/chunks/bridgeConfig-BeqChxJC.js +1 -0
- package/dist/chunks/bridgeMessaging-C3huGcR3.js +1 -0
- package/dist/chunks/{bridgePointer-DIM0sj0x.js → bridgePointer-DLYyvRKb.js} +1 -1
- package/dist/chunks/bridgeStatusUtil-DFMftajD.js +1 -0
- package/dist/chunks/btw-DSK9R2C8.js +1 -0
- package/dist/chunks/caches-BTQAW9zc.js +1 -0
- package/dist/chunks/caches-BVtSCnV1.js +1 -0
- package/dist/chunks/{capacityWake-CKOiRELo.js → capacityWake-amzeeBz0.js} +1 -1
- package/dist/chunks/{ccrClient-BC2q3k44.js → ccrClient-Bu7Tf1Z5.js} +1 -1
- package/dist/chunks/{claudeDesktop-DQXL5bGm.js → claudeDesktop-CsJfF1b-.js} +1 -1
- package/dist/chunks/{clear-1etSJhdg.js → clear-ClFDpWVJ.js} +1 -1
- package/dist/chunks/{cliLaunch-CQjLYRzM.js → cliLaunch-BWcoyZDP.js} +1 -1
- package/dist/chunks/client-BWQ4-rN7.js +1 -0
- package/dist/chunks/{client-DQwf_b9o.js → client-DFlE4fYh.js} +1 -1
- package/dist/chunks/client-c-3-PW1F.js +1 -0
- package/dist/chunks/commands-Bi7k3Wg-.js +1 -0
- package/dist/chunks/compact-J-h0Yf4b.js +2 -0
- package/dist/chunks/config-CVHMRMwd.js +1 -0
- package/dist/chunks/config-Do1870_d.js +3 -0
- package/dist/chunks/config-yyFe87vW.js +1 -0
- package/dist/chunks/context-Tb1Ca2Q-.js +1 -0
- package/dist/chunks/{context-noninteractive-Ct_ttQfP.js → context-noninteractive-D5iQhasu.js} +2 -2
- package/dist/chunks/context-noninteractive-soPYKAc9.js +1 -0
- package/dist/chunks/conversation-CSEtUxOY.js +1 -0
- package/dist/chunks/conversation-Dk1WDQuN.js +1 -0
- package/dist/chunks/{createSSHSession-BmHXA2me.js → createSSHSession-CJtzNQdZ.js} +1 -1
- package/dist/chunks/{createSession-C4rukWkv.js → createSession-DkT1GL8y.js} +1 -1
- package/dist/chunks/createSession-eE8mswkv.js +1 -0
- package/dist/chunks/crossProjectResume-04n3Ppy9.js +40 -0
- package/dist/chunks/cwd-Cfdf7z7s.js +1 -0
- package/dist/chunks/cwd-ClLru_7T.js +1 -0
- package/dist/chunks/datadog-DjeJThpV.js +1 -0
- package/dist/chunks/{debug-RZ4NuXyS.js → debug-RAynG_nM.js} +4 -4
- package/dist/chunks/{debugUtils-D30M1cbN.js → debugUtils-DX0KAXNK.js} +1 -1
- package/dist/chunks/{detached-jrVP11oU.js → detached-X_yjYR7x.js} +1 -1
- package/dist/chunks/{detectRepository-CFiHe6Rv.js → detectRepository-DgpNd87p.js} +1 -1
- package/dist/chunks/detectRepository-ctF9KDbb.js +1 -0
- package/dist/chunks/{diff-BKiK3xHv.js → diff-jEJJe58I.js} +1 -1
- package/dist/chunks/directoryCompletion-BbXR2bfy.js +1 -0
- package/dist/chunks/doctor-B-Wag4C1.js +1 -0
- package/dist/chunks/earlyInput-BEjRkAtH.js +1 -0
- package/dist/chunks/{earlyInput-BTC_Wucv.js → earlyInput-IghoCjG5.js} +1 -1
- package/dist/chunks/entry-oIqjxIjQ.js +14 -0
- package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
- package/dist/chunks/esm-Cf4nSRjF.js +1 -0
- package/dist/chunks/{execFileNoThrow-CCX-JY8h.js → execFileNoThrow-Dwu6psHW.js} +1 -1
- package/dist/chunks/{execSyncWrapper-dhRSYGFW.js → execSyncWrapper-BTZJjCuv.js} +1 -1
- package/dist/chunks/exit-BtW7LfRX.js +1 -0
- package/dist/chunks/extraUsage-Mi66JwFZ.js +1 -0
- package/dist/chunks/extractMemories-CUrdiNcr.js +1 -0
- package/dist/chunks/fast-BU4iUZ8E.js +1 -0
- package/dist/chunks/fast-C60p6AqJ.js +1 -0
- package/dist/chunks/featureCheck-D6FjD-nt.js +1 -0
- package/dist/chunks/featureCheck-JOur3pHb.js +1 -0
- package/dist/chunks/fileSuggestions-BMfQIDdW.js +3 -0
- package/dist/chunks/firstPartyEventLogger-B3cXgR67.js +5 -0
- package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +1 -0
- package/dist/chunks/flushGate-DgSDVGKZ.js +1 -0
- package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
- package/dist/chunks/gemini-BwvSxGgn.js +1 -0
- package/dist/chunks/generateSessionName-DlrdedOk.js +1 -0
- package/dist/chunks/{genericProcessUtils-DVfMHhfy.js → genericProcessUtils-CmsUPyRz.js} +1 -1
- package/dist/chunks/{git-BerW9bId.js → git-2c7WlGDL.js} +1 -1
- package/dist/chunks/git-XtKbtJMc.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +1 -0
- package/dist/chunks/goal-ZmSRBx4q.js +3 -0
- package/dist/chunks/grok-BXMvezWb.js +1 -0
- package/dist/chunks/grove-CeOjTaY6.js +7 -0
- package/dist/chunks/help-5DNZO6_H.js +1 -0
- package/dist/chunks/{hooks-BZJTWD07.js → hooks-C637tFtd.js} +2 -2
- package/dist/chunks/hooks-DWg07LmS.js +1 -0
- package/dist/chunks/initReplBridge-D1h10vQ9.js +1 -0
- package/dist/chunks/{install-BI---dv0.js → install-C-6ItpH0.js} +1 -1
- package/dist/chunks/{instrumentation-CcWzhGfE.js → instrumentation-DaiPDUst.js} +4 -4
- package/dist/chunks/intl-D2kgJmX7.js +1 -0
- package/dist/chunks/{job-B0ftcqPF.js → job-BeYzQUiR.js} +1 -1
- package/dist/chunks/{jwtUtils-C0cE-1Ey.js → jwtUtils-CUPXdX3W.js} +1 -1
- package/dist/chunks/keybindings-DgIPdBy9.js +2 -0
- package/dist/chunks/launchLocalMemory-CE4J98xO.js +3 -0
- package/dist/chunks/launchOnboarding-BfTdC6vp.js +8 -0
- package/dist/chunks/{loadAgentsDir-ByO8eJqU.js → loadAgentsDir-C7lOqvfh.js} +2233 -2454
- package/dist/chunks/loadAgentsDir-zikjxLvn.js +1 -0
- package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +1 -0
- package/dist/chunks/{localSearch-CHHCH16D.js → localSearch-BKrznW5x.js} +1 -1
- package/dist/chunks/localSearch-ZFyFy5FN.js +1 -0
- package/dist/chunks/log-CezCRpAN.js +1 -0
- package/dist/chunks/logoV2Utils-BkQfyQ1-.js +1 -0
- package/dist/chunks/{magicDocs-C5i5ruuU.js → magicDocs-BpVcON9o.js} +3 -3
- package/dist/chunks/main-9r5gLzUW.js +605 -0
- package/dist/chunks/{main-BLD4QAQg.js → main-CvOv59-7.js} +4 -4
- package/dist/chunks/managedEnv-B61yLpwp.js +1 -0
- package/dist/chunks/{managedEnv-C-9XSN14.js → managedEnv-DhWRJ5DK.js} +1 -1
- package/dist/chunks/{mappers-CHRFic5q.js → mappers-bOab8ipV.js} +1 -1
- package/dist/chunks/mcp-BckPBjaM.js +6 -0
- package/dist/chunks/mcp-CS1DA3JL.js +1 -0
- package/dist/chunks/mcp-VcGPYCkW.js +2 -0
- package/dist/chunks/{memoize-B8hfb1JN.js → memoize-DsqYrbeR.js} +1 -1
- package/dist/chunks/memory-C5ohwh-T.js +1 -0
- package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
- package/dist/chunks/mode-DlKnUM8l.js +2 -0
- package/dist/chunks/model-BGu1AGq0.js +1 -0
- package/dist/chunks/model-BsZ4sP_H.js +1 -0
- package/dist/chunks/model-D19IIcll.js +1 -0
- package/dist/chunks/modelOptions-CxP067Qv.js +1 -0
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +1 -0
- package/dist/chunks/oauth-BN2I0_jl.js +1 -0
- package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
- package/dist/chunks/omit-DDUIPHnl.js +1 -0
- package/dist/chunks/onChangeAppState-RBl6H7ho.js +1 -0
- package/dist/chunks/{openai-DPH6rXOZ.js → openai-B9C2XN5Q.js} +3 -3
- package/dist/chunks/{panel-mD094ALT.js → panel-KW-wmEvU.js} +1 -1
- package/dist/chunks/{parser-dbHRgXb8.js → parser-BwPXQomy.js} +1 -1
- package/dist/chunks/parser-xSBaQRLH.js +1 -0
- package/dist/chunks/partition-D-UhsUCx.js +1 -0
- package/dist/chunks/permissions-BoLXYN1j.js +3 -0
- package/dist/chunks/pidLock-nJHbufJN.js +3 -0
- package/dist/chunks/plan-CyU2zrCK.js +1 -0
- package/dist/chunks/{platform-DCXXznJg.js → platform-BMPbglug.js} +1 -1
- package/dist/chunks/plugin-C6-GQke5.js +17 -0
- package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +1 -0
- package/dist/chunks/{pluginBlocklist-PwHHD3nj.js → pluginBlocklist-n6Imlh3y.js} +1 -1
- package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +1 -0
- package/dist/chunks/{pluginFlagging-pBxSselw.js → pluginFlagging-DZaYzecY.js} +1 -1
- package/dist/chunks/pluginOperations-D90IRawu.js +2 -0
- package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +1 -0
- package/dist/chunks/{pluginStartupCheck-Di4LjHXf.js → pluginStartupCheck-CB2q2dLv.js} +1 -1
- package/dist/chunks/plugins-B9eSjLSA.js +4 -0
- package/dist/chunks/poorMode-BAnubpn1.js +1 -0
- package/dist/chunks/{poorMode-CYXmr_mU.js → poorMode-DEwQOAJt.js} +1 -1
- package/dist/chunks/print-eCRv_Li-.js +26 -0
- package/dist/chunks/processBashCommand-B5F2Cl7K.js +1 -0
- package/dist/chunks/processSlashCommand-BC_D3cH5.js +5 -0
- package/dist/chunks/{projectContext-D9MDwJUF.js → projectContext-CIxul6vA.js} +1 -1
- package/dist/chunks/{projectContext-BaDZBAoK.js → projectContext-RUMJB798.js} +1 -1
- package/dist/chunks/prompt-C1JPqinc.js +1 -0
- package/dist/chunks/prompt-DZhBz_Vu.js +1 -0
- package/dist/chunks/prompt-M2lu8_Oa.js +139 -0
- package/dist/chunks/promptEditor-DhcZY-iu.js +4 -0
- package/dist/chunks/{protocolHandler-RNKkhq91.js → protocolHandler-CkFaJKKo.js} +1 -1
- package/dist/chunks/{proxy-BmtEnJ02.js → proxy-CuMaO_YV.js} +1 -1
- package/dist/chunks/reconciler-B4GDm_iC.js +1 -0
- package/dist/chunks/refresh-DBVizOzg.js +1 -0
- package/dist/chunks/{registerProtocol-DoKqmqu2.js → registerProtocol-CsNYRZKr.js} +1 -1
- package/dist/chunks/reload-plugins-B7JAE3b4.js +1 -0
- package/dist/chunks/{remoteBridgeCore-Cddqv2WW.js → remoteBridgeCore-CFLJhsB6.js} +1 -1
- package/dist/chunks/remoteManagedSettings-xh_MViZH.js +1 -0
- package/dist/chunks/rename-BCp2Vtqu.js +1 -0
- package/dist/chunks/{renderOptions-ChLwxtVu.js → renderOptions-Q5oCLFIC.js} +1 -1
- package/dist/chunks/resume-DVCSzKvv.js +2 -0
- package/dist/chunks/{ripgrep-gaT9Njwi.js → ripgrep-DvOOsDMv.js} +1 -1
- package/dist/chunks/ripgrep-e-iewvTf.js +1 -0
- package/dist/chunks/{runtimeObserver-Dbxxw4ls.js → runtimeObserver-CS_3BDNo.js} +4 -4
- package/dist/chunks/{runtimeObserver-CsIwinzh.js → runtimeObserver-DYUva6g-.js} +1 -1
- package/dist/chunks/sandbox-adapter-BFZFHplu.js +1 -0
- package/dist/chunks/sandbox-toggle--zNSKce_.js +1 -0
- package/dist/chunks/searchExtraTools-ui5y2VSE.js +1 -0
- package/dist/chunks/session-CO3gEqQP.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +1 -0
- package/dist/chunks/sessionObserver-Ba7um95p.js +1 -0
- package/dist/chunks/{sessionObserver-DoYc0ZOP.js → sessionObserver-YkRHC-Aa.js} +2 -2
- package/dist/chunks/sessionState-Bifmu95-.js +11 -0
- package/dist/chunks/sessionStorage-CedwLLQs.js +1 -0
- package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
- package/dist/chunks/sessionTitle-COBSgSXS.js +14 -0
- package/dist/chunks/sessionTracing-BrNx1k2V.js +11 -0
- package/dist/chunks/settings-DkDH7WQT.js +1 -0
- package/dist/chunks/settings-DnptdP79.js +20 -0
- package/dist/chunks/settingsSync-PmU7SmkU.js +1 -0
- package/dist/chunks/setup-BEsBuzsk.js +3 -0
- package/dist/chunks/shadowedRuleDetection-DEaw-X5j.js +1 -0
- package/dist/chunks/{shellQuote-BUVKMu_P.js → shellQuote-BYeOv3Ip.js} +1 -1
- package/dist/chunks/{sideQuestion-C780iYwd.js → sideQuestion-D0OKljee.js} +3 -3
- package/dist/chunks/sinks-BJHgxz6Y.js +1 -0
- package/dist/chunks/sinks-D5-yhcgU.js +2 -0
- package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +1 -0
- package/dist/chunks/{skillGapStore-Dc1arohs.js → skillGapStore-N_kmvXML.js} +2 -2
- package/dist/chunks/{skillLifecycle-DP6mY1Kp.js → skillLifecycle-C4F5RXuh.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CpLTImaL.js → skillSearchPanel-CftorvAM.js} +4 -4
- package/dist/chunks/skills-C4CTRN9o.js +1 -0
- package/dist/chunks/{src-CDCSSo0U2.js → src-P_wYS_NJ2.js} +1 -1
- package/dist/chunks/{src-CST_jFnT.js → src-r6ZFgWPx2.js} +1 -1
- package/dist/chunks/startupProfiler-D4FBdEQr.js +1 -0
- package/dist/chunks/{startupProfiler-DCn_NxMH.js → startupProfiler-L_UWZ03w.js} +3 -3
- package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
- package/dist/chunks/state-BemZdQIl.js +1 -0
- package/dist/chunks/state-D_lk6z-C.js +1 -0
- package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
- package/dist/chunks/{stats-Duk7_xjQ.js → stats-IzV0_vEc.js} +1 -1
- package/dist/chunks/{status-peiVB_2j.js → status-CeVP_uDT.js} +1 -1
- package/dist/chunks/status-Dzuw3hBv.js +2 -0
- package/dist/chunks/statusNoticeHelpers-Bb9gxdSt.js +1 -0
- package/dist/chunks/{stringUtils-B6FudhoZ.js → stringUtils-C84IJ91d.js} +1 -1
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +1 -0
- package/dist/chunks/{subprocessEnv-vrwzMgKn.js → subprocessEnv-Ci8VV_bi.js} +1 -1
- package/dist/chunks/switcher-4KzBvuKH.js +1 -0
- package/dist/chunks/{switcher-BAMqSX7Z.js → switcher-CCs9xl1z.js} +1 -1
- package/dist/chunks/{syncCache-Zl9kZRRl.js → syncCache-CBRiRU5x.js} +1 -1
- package/dist/chunks/tasks-DZDhgx0w.js +1 -0
- package/dist/chunks/teleport-Bw0jSxe9.js +1 -0
- package/dist/chunks/{templateJobs-DR5fKFiO.js → templateJobs-CrNPEKkh.js} +1 -1
- package/dist/chunks/{terminalSetup-DgRBt-JJ.js → terminalSetup-CBqcwQll.js} +1 -1
- package/dist/chunks/terminalSetup-D-N8YPiQ.js +33 -0
- package/dist/chunks/{theme-Bz6esfST.js → theme-Dazsirbw.js} +1 -1
- package/dist/chunks/{tmux-DSU9tYIo.js → tmux-DewYVEBm.js} +1 -1
- package/dist/chunks/{toolEventObserver-BSekCkM2.js → toolEventObserver-lnHJ9fLQ.js} +1 -1
- package/dist/chunks/toolPool-CkXFlqsn.js +1 -0
- package/dist/chunks/{trustedDevice-B0x9X0fb.js → trustedDevice-CFf5yaG-.js} +1 -1
- package/dist/chunks/trustedDevice-CuwSv8dG.js +1 -0
- package/dist/chunks/{types-D7_37tP2.js → types-3j8PS-Du.js} +1 -1
- package/dist/chunks/{udsClient-CHoMMH28.js → udsClient-e9dIkwVA.js} +1 -1
- package/dist/chunks/updateCCB-BPe9_FW6.js +11 -0
- package/dist/chunks/{upstreamproxy-Hmq-n8fw.js → upstreamproxy-DF00RzGG.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js +1 -0
- package/dist/chunks/useMainLoopModel-2-eujv0n.js +1 -0
- package/dist/chunks/useManagePlugins-CYBIkaB1.js +1 -0
- package/dist/chunks/useMergedTools-Dk5cPqLc.js +1 -0
- package/dist/chunks/useSearchInput-C7Y1I9P9.js +1 -0
- package/dist/chunks/useSettingsErrors-DAEO7AyB.js +1 -0
- package/dist/chunks/{userAgent-BxTG7IMk.js → userAgent-CIq27vUR.js} +1 -1
- package/dist/chunks/util-VO98TdOz.js +1 -0
- package/dist/chunks/{validatePlugin-AHl-g4ct.js → validatePlugin-Kk6pxnO2.js} +1 -1
- package/dist/chunks/vim-EYQn94Kx.js +1 -0
- package/dist/chunks/{which-CHLNJmtJ.js → which-DzFN5TNM.js} +1 -1
- package/dist/chunks/{windowsPaths-o62uq6LF.js → windowsPaths-BU3yQWTB.js} +1 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +1 -0
- package/dist/chunks/{workSecret-DG9shvG0.js → workSecret-DUqdPy44.js} +1 -1
- package/dist/chunks/workerRegistry-C07BcZIw.js +6 -0
- package/dist/chunks/worktree-dFUkhVE_.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-CwLtQld4.js +0 -1
- package/dist/chunks/App-Ba52HvYC.js +0 -1
- package/dist/chunks/ApproveApiKey-CEIfuUh0.js +0 -1
- package/dist/chunks/ApproveApiKey-D2MLQu2P.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-IGDrkbWl.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-GYhq--JR.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C-CTa-95.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-Catv6BCJ.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-BeQXqUtX.js +0 -1
- package/dist/chunks/DiffDialog-AC5DSJrq.js +0 -6
- package/dist/chunks/Doctor-B9Rxsoy0.js +0 -1
- package/dist/chunks/Doctor-lhUBhEy5.js +0 -3
- package/dist/chunks/ExitFlow-Cu8SoQHs.js +0 -2
- package/dist/chunks/Grove-Bc4CofEj.js +0 -11
- package/dist/chunks/InvalidConfigDialog-BI13il58.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-CtOheV1K.js +0 -1
- package/dist/chunks/MCPConnectionManager-ao-P3xSA.js +0 -1
- package/dist/chunks/MCPToolListView-dkofcJs4.js +0 -1
- package/dist/chunks/McpParsingWarnings-BS4JoR5l.js +0 -1
- package/dist/chunks/MessageSelector-B88b2ypw.js +0 -3
- package/dist/chunks/Messages-BPeI7lLV.js +0 -11
- package/dist/chunks/Onboarding-c2fQ8Io_.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-D1cH9sDX.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DDD5WuK0.js +0 -1
- package/dist/chunks/QueryEngine-Cv_meCam.js +0 -1
- package/dist/chunks/REPL-BXhAQOXb.js +0 -139
- package/dist/chunks/REPL-YqjLnr3A.js +0 -1
- package/dist/chunks/RemoteSessionManager-CT7T8BaR.js +0 -2
- package/dist/chunks/ResumeConversation-CIZCjms9.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-Dx6093yw.js +0 -1
- package/dist/chunks/Settings-CyUm0AtU.js +0 -2
- package/dist/chunks/TeleportProgress-C3qyp5zy.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-BV--nyYn.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-Blo2cZg-.js +0 -1
- package/dist/chunks/ThemePicker-EQ6hPUeI.js +0 -1
- package/dist/chunks/WelcomeV2-Ci9VwPYh.js +0 -1
- package/dist/chunks/add-dir-DPQV0qml.js +0 -1
- package/dist/chunks/agents-DmybpgDN.js +0 -103
- package/dist/chunks/allErrors-BPn_2TrB.js +0 -1
- package/dist/chunks/analytics-CkYUHW_U.js +0 -1
- package/dist/chunks/ant-DjdvlLOo.js +0 -1
- package/dist/chunks/api-AMgj1zf_.js +0 -1
- package/dist/chunks/asciicast-BJNYO5sh.js +0 -4
- package/dist/chunks/asciicast-CH6hdK0a.js +0 -1
- package/dist/chunks/attributionTrailer-oKKrF3z8.js +0 -1
- package/dist/chunks/auth-CNjDn1VY.js +0 -15
- package/dist/chunks/auth-CZzP483s.js +0 -1
- package/dist/chunks/auth-DDSBm_Yj.js +0 -1
- package/dist/chunks/autonomy-D4xZLOdJ.js +0 -15
- package/dist/chunks/backgroundHousekeeping--eBgphcg.js +0 -17
- package/dist/chunks/backgroundHousekeeping-VV1V_Y2Z.js +0 -1
- package/dist/chunks/bg-BK_9J6F6.js +0 -1
- package/dist/chunks/branch-BYq0zpzT.js +0 -3
- package/dist/chunks/bridgeConfig-C82un7rJ.js +0 -1
- package/dist/chunks/bridgeMessaging-YqYdl6ej.js +0 -1
- package/dist/chunks/btw-CUV3nRrE.js +0 -1
- package/dist/chunks/caches-BZ59_En6.js +0 -1
- package/dist/chunks/caches-Cg-HtWKG.js +0 -1
- package/dist/chunks/client-DQXvVKND.js +0 -1
- package/dist/chunks/client-DkgC-mFB.js +0 -1
- package/dist/chunks/color-CBsNbt1s.js +0 -1
- package/dist/chunks/commands-qM5z_Uld.js +0 -1
- package/dist/chunks/compact-BclJiRJe.js +0 -2
- package/dist/chunks/completionCache-BMHAktkM.js +0 -1
- package/dist/chunks/config-CE058cvr.js +0 -3
- package/dist/chunks/config-D81avYye.js +0 -1
- package/dist/chunks/config-DpOOllGk.js +0 -1
- package/dist/chunks/context-noninteractive-DJb8H_hN.js +0 -1
- package/dist/chunks/context-sR9fJmXE.js +0 -1
- package/dist/chunks/conversation-D48Kt3ar.js +0 -1
- package/dist/chunks/conversation-fOFTa7k5.js +0 -1
- package/dist/chunks/createSession-CSwlW2T2.js +0 -1
- package/dist/chunks/crossProjectResume-lDFB2ZcY.js +0 -40
- package/dist/chunks/cwd-5Xr-Qka6.js +0 -1
- package/dist/chunks/cwd-C5ce-7WB.js +0 -1
- package/dist/chunks/daemon-ZtpTZWgQ.js +0 -2
- package/dist/chunks/datadog-BJn5ECIu.js +0 -1
- package/dist/chunks/detectRepository-DqQvyj_a.js +0 -1
- package/dist/chunks/directoryCompletion-BagQcynj.js +0 -1
- package/dist/chunks/doctor-BEHYm34V.js +0 -1
- package/dist/chunks/earlyInput-xcoTbKQn.js +0 -1
- package/dist/chunks/entry-BzL1MFQG.js +0 -14
- package/dist/chunks/envUtils-DSxRz_kt.js +0 -1
- package/dist/chunks/esm-BLPbfHQd.js +0 -1
- package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +0 -1
- package/dist/chunks/exit-DE2YiAhQ.js +0 -1
- package/dist/chunks/extraUsage-Dw7AXiH7.js +0 -1
- package/dist/chunks/extractMemories-DxTUMiv3.js +0 -1
- package/dist/chunks/fast-CHmMkIpE.js +0 -1
- package/dist/chunks/fast-uQASHWqR.js +0 -1
- package/dist/chunks/featureCheck-CrJeuheQ.js +0 -1
- package/dist/chunks/featureCheck-HslM03dr.js +0 -1
- package/dist/chunks/fileSuggestions-Dyu2kQtE.js +0 -3
- package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +0 -5
- package/dist/chunks/firstPartyEventLogger-LsNY6yOt.js +0 -1
- package/dist/chunks/flushGate-Cnsu4HET.js +0 -1
- package/dist/chunks/gemini-Cudre91e.js +0 -1
- package/dist/chunks/generateRecap-CiFxXlmH.js +0 -1
- package/dist/chunks/generateSessionName-DitoBxJT.js +0 -1
- package/dist/chunks/git-D6dOU2mT.js +0 -1
- package/dist/chunks/githubRepoPathMapping-DGr0kJ8D.js +0 -1
- package/dist/chunks/goal-DuUayfDg.js +0 -3
- package/dist/chunks/grok-tRbmZzEh.js +0 -1
- package/dist/chunks/grove-Cv19v6Sv.js +0 -7
- package/dist/chunks/help-DkqxbFDM.js +0 -1
- package/dist/chunks/hooks-CsP42iOp.js +0 -1
- package/dist/chunks/initReplBridge-DdsSWVqN.js +0 -1
- package/dist/chunks/intl-cKc-V6Mq.js +0 -1
- package/dist/chunks/keybindings-DZU3vwo3.js +0 -2
- package/dist/chunks/language-DHhXLb_Y.js +0 -1
- package/dist/chunks/language-s-dLbdVz.js +0 -1
- package/dist/chunks/launchLocalMemory-twLxpPvg.js +0 -3
- package/dist/chunks/launchOnboarding-BWz2XSb9.js +0 -8
- package/dist/chunks/lib-rQZENxQg.js +0 -8
- package/dist/chunks/loadAgentsDir-CMNFLt7R.js +0 -1
- package/dist/chunks/loadPluginHooks-BPnxcgrL.js +0 -1
- package/dist/chunks/localSearch-DzQODFap.js +0 -1
- package/dist/chunks/log-CZ0zYP_c.js +0 -1
- package/dist/chunks/logoV2Utils-CGUJ-5gY.js +0 -1
- package/dist/chunks/main-D4Uk-WUs.js +0 -862
- package/dist/chunks/managedEnv-DLVRBaA9.js +0 -1
- package/dist/chunks/mcp-BMVdGknC.js +0 -1
- package/dist/chunks/mcp-COS5RJFS.js +0 -6
- package/dist/chunks/mcp-tGsOW1GN.js +0 -2
- package/dist/chunks/memory-DR6poqeH.js +0 -1
- package/dist/chunks/mode-QV-NW1Wd.js +0 -2
- package/dist/chunks/model-BF_4ebyl.js +0 -1
- package/dist/chunks/model-BNU_ulDJ.js +0 -1
- package/dist/chunks/model-CwO-g1RW.js +0 -1
- package/dist/chunks/nativeInstaller-B-lNJjM-.js +0 -1
- package/dist/chunks/oauth-BqJqV-2M.js +0 -1
- package/dist/chunks/oauth-C8X_p8Gc.js +0 -1
- package/dist/chunks/omit-DZCEXri5.js +0 -1
- package/dist/chunks/onChangeAppState-BmfM5g-D.js +0 -1
- package/dist/chunks/p-map-B1EeBuI8.js +0 -1
- package/dist/chunks/p-map-HKDr3iDo.js +0 -1
- package/dist/chunks/panelCall-SbffM7G4.js +0 -1
- package/dist/chunks/parser-DrBC8nWp.js +0 -1
- package/dist/chunks/partition-DKuAFJkc.js +0 -1
- package/dist/chunks/path-Cv9QMBAX.js +0 -1
- package/dist/chunks/permissions-ey-bfanE.js +0 -3
- package/dist/chunks/pidLock-DJnS_38v.js +0 -3
- package/dist/chunks/pipeTransport-DVOKR4c_.js +0 -1
- package/dist/chunks/plan-Brg9XnRr.js +0 -1
- package/dist/chunks/plugin-CRwa39Y1.js +0 -17
- package/dist/chunks/pluginAutoupdate-D0LIP7cy.js +0 -1
- package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +0 -1
- package/dist/chunks/pluginOperations-C7p_Qr2r.js +0 -2
- package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +0 -1
- package/dist/chunks/plugins-DUKNjLq6.js +0 -4
- package/dist/chunks/poorMode-CejPNCp-.js +0 -1
- package/dist/chunks/print-gyTOCJzk.js +0 -23
- package/dist/chunks/processBashCommand-Cze9vCm6.js +0 -1
- package/dist/chunks/processSlashCommand-BRajh1v7.js +0 -5
- package/dist/chunks/prompt-B7joRiqj.js +0 -139
- package/dist/chunks/prompt-DqSMh2x9.js +0 -1
- package/dist/chunks/prompt-Eysh8Et_.js +0 -1
- package/dist/chunks/promptEditor-R_acDAgI.js +0 -4
- package/dist/chunks/reconciler-BfkO6X2X.js +0 -4
- package/dist/chunks/refresh-C1X3sptR.js +0 -1
- package/dist/chunks/reload-plugins-C0osFcNh.js +0 -1
- package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +0 -1
- package/dist/chunks/rename-B3tf-YiD.js +0 -1
- package/dist/chunks/replBridgeHandle-CNwNIijW.js +0 -1
- package/dist/chunks/resume-Be1G_GBL.js +0 -2
- package/dist/chunks/ripgrep-C2PhTJDh.js +0 -1
- package/dist/chunks/rollback-BPWRKlIZ.js +0 -11
- package/dist/chunks/sandbox-adapter-C6GBuJPB.js +0 -1
- package/dist/chunks/sandbox-toggle-jEySONTW.js +0 -1
- package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +0 -1
- package/dist/chunks/searchExtraTools-C_UTryh_.js +0 -1
- package/dist/chunks/session-DDI1Eb2x.js +0 -2
- package/dist/chunks/sessionDataUploader-CaCjwsA2.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +0 -1
- package/dist/chunks/sessionMemory-CQBxPkTQ.js +0 -1
- package/dist/chunks/sessionMemory-s0ALUHvc.js +0 -1
- package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +0 -1
- package/dist/chunks/sessionObserver-C2sYqWL3.js +0 -1
- package/dist/chunks/sessionState-CjNY991n.js +0 -11
- package/dist/chunks/sessionStorage-DqsY-7pi.js +0 -1
- package/dist/chunks/sessionTitle-B0OYf5nM.js +0 -14
- package/dist/chunks/sessionTracing-CwsXt_uA.js +0 -11
- package/dist/chunks/settings-BWtOA9A7.js +0 -1
- package/dist/chunks/settings-hQDLwPVj.js +0 -20
- package/dist/chunks/settingsSync-DdFagwHV.js +0 -1
- package/dist/chunks/setup-DzC22EkN.js +0 -3
- package/dist/chunks/shadowedRuleDetection-C86PTj1m.js +0 -1
- package/dist/chunks/sinks-5G_xhc1Q.js +0 -1
- package/dist/chunks/sinks-Cftq7Es0.js +0 -2
- package/dist/chunks/skillChangeDetector-plLveEbf.js +0 -1
- package/dist/chunks/skills-zGYaYfFV.js +0 -1
- package/dist/chunks/startupProfiler-JbpAkfNE.js +0 -1
- package/dist/chunks/state-C2OSZkV1.js +0 -1
- package/dist/chunks/state-DU9lRJ9x.js +0 -1
- package/dist/chunks/status-CFw-FpZM.js +0 -2
- package/dist/chunks/statusNoticeHelpers-B5U5c9PE.js +0 -1
- package/dist/chunks/subprocessEnv-BSQSomcK.js +0 -1
- package/dist/chunks/switcher-hgBgVzLb.js +0 -1
- package/dist/chunks/tasks-BxpyRhmD.js +0 -1
- package/dist/chunks/teleport-CwxeD5vL.js +0 -1
- package/dist/chunks/terminalSetup-DlaFWI81.js +0 -33
- package/dist/chunks/toolPool-B7SIoDw5.js +0 -1
- package/dist/chunks/trustedDevice-CjHQtVkO.js +0 -1
- package/dist/chunks/up-B8wBSpLg.js +0 -12
- package/dist/chunks/updateCCB-D_kGQKPT.js +0 -11
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +0 -1
- package/dist/chunks/useMainLoopModel-BICP6_Fi.js +0 -1
- package/dist/chunks/useManagePlugins-DtbY_vPL.js +0 -1
- package/dist/chunks/useMergedTools-Ckx2IEhF.js +0 -1
- package/dist/chunks/useSearchInput-BAgljZUl.js +0 -1
- package/dist/chunks/useSettingsErrors-CAJR_wpd.js +0 -1
- package/dist/chunks/util-DDtmyq_r.js +0 -1
- package/dist/chunks/vim-kg-mRVbu.js +0 -1
- package/dist/chunks/windowsPaths-Pmx8LDR6.js +0 -1
- package/dist/chunks/workerRegistry-C7H_lsQX.js +0 -6
- package/dist/chunks/worktree-O2p-mJdF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,O as r,b as i,j as a,l as o,m as s,p as c,w as l}from"./external-CEp-aPkt.js";import{n as u,r as d,t as f}from"./lazySchema-B4D4qJVE.js";import{S as p,b as m,w as h,y as g}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{A as t,C as n,O as r,b as i,j as a,l as o,m as s,p as c,w as l}from"./external-CEp-aPkt.js";import{n as u,r as d,t as f}from"./lazySchema-B4D4qJVE.js";import{S as p,b as m,w as h,y as g}from"./debug-RAynG_nM.js";import{o as _,s as v}from"./log-CezCRpAN.js";import{n as y,t as b}from"./memoize-DsqYrbeR.js";import{open as x,readFile as S,stat as C}from"fs/promises";function w(e){return e.startsWith(T)?e.slice(1):e}var T,E=e((()=>{T=``}));function D(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&A(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&A(e.charCodeAt(r)))for(r++;r<e.length&&A(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&A(e.charCodeAt(r))){for(r++;r<e.length&&A(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
2
2
|
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(k(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(O(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(O(t));return o=15}if(k(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
3
3
|
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!k(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,k(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!A(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(O(e)||k(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function O(e){return e===32||e===9}function k(e){return e===10||e===13}function A(e){return e>=48&&e<=57}var ee,j=e((()=>{(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(ee||(ee={}))})),M,N,P,F,te=e((()=>{M=Array(20).fill(0).map((e,t)=>` `.repeat(t)),N=200,P={" ":{"\n":Array(N).fill(0).map((e,t)=>`
|
|
4
4
|
`+` `.repeat(t)),"\r":Array(N).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(N).fill(0).map((e,t)=>`\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{C as r,F as i,H as a,S as o,a as s,l as c,z as l}from"./debug-RAynG_nM.js";import{o as u}from"./log-CezCRpAN.js";import{a as d,i as f}from"./genericProcessUtils-CmsUPyRz.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{l(),o()})),_=e((()=>{s(),l(),n(),g(),u(),o()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return a(e)||c(`[udsClient] readdir failed: ${i(e)}`),[]}let n=[];for(let i of t){if(!/^\d+\.json$/.test(i))continue;let t=parseInt(i.slice(0,-5),10);if(d(t))try{let a=r(await m(p(e,i),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),s(),l(),f(),o(),_(),g()}))();export{y as listAllLiveSessions};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{rf as e,tf as t}from"./loadAgentsDir-C7lOqvfh.js";import{di as n,ui as r}from"./src-P_wYS_NJ2.js";import{a as i,l as a}from"./debug-RAynG_nM.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-Dwu6psHW.js";import{l as u,u as d}from"./ripgrep-DvOOsDMv.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";n(),i(),d(),l(),e(),o();var _=`@readmagic/workmate`;function v(){try{let e=f(u,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`0.0.10`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await c(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(a(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let e=v();s(`Current version: ${e}\n`);let n=y(`bun`),i=b()&&n?`bun`:`npm`;s(`Package manager: ${i}\n`),s(`Checking for updates...
|
|
2
|
+
`);let a=await x();if(!a){process.stderr.write(r.red(`Failed to check for updates`)+`
|
|
3
|
+
`),process.stderr.write(`Unable to fetch latest version from npm registry.
|
|
4
|
+
`),await t(1);return}if(a===e||S(e,a)){s(r.green(`ccb is up to date (${e})`)+`
|
|
5
|
+
`),await t(0);return}s(`New version available: ${a} (current: ${e})\n`),s(`Installing update via ${i}...\n`);try{p(i===`bun`?`bun install -g ${_}@latest`:`npm install -g ${_}@latest`,{stdio:`inherit`,cwd:g(),timeout:12e4}),s(r.green(`Successfully updated from ${e} to ${a}`)+`
|
|
6
|
+
`)}catch(e){process.stderr.write(r.red(`Update failed`)+`
|
|
7
|
+
`),process.stderr.write(`${e}\n`),process.stderr.write(`
|
|
8
|
+
`),process.stderr.write(`Try manually updating with:
|
|
9
|
+
`),i===`bun`?process.stderr.write(r.bold(` bun install -g ${_}@latest`)+`
|
|
10
|
+
`):process.stderr.write(r.bold(` npm install -g ${_}@latest`)+`
|
|
11
|
+
`),await t(1)}await t(0)}export{C as updateCCB};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-BDhHQY0-.js";import{V as r,a as i,l as a,nt as o,rt as s,z as c}from"./debug-RAynG_nM.js";import{c as l,h as u,l as d,m as f,s as p}from"./proxy-CuMaO_YV.js";import{homedir as m}from"os";import{join as h}from"path";import{mkdir as g,readFile as _,unlink as v,writeFile as y}from"fs/promises";import{createServer as b}from"node:net";n(),o(),c(),i(),u(),d();var x,S=512*1024,C=3e4;function w(e){let t=e.length,n=[],r=t;for(;r>127;)n.push(r&127|128),r>>>=7;n.push(r);let i=new Uint8Array(1+n.length+t);return i[0]=10,i.set(n,1),i.set(e,1+n.length),i}function T(e){if(e.length===0)return new Uint8Array;if(e[0]!==10)return null;let t=0,n=0,r=1;for(;r<e.length;){let i=e[r];if(t|=(i&127)<<n,r++,!(i&128))break;if(n+=7,n>28)return null}return r+t>e.length?null:e.subarray(r,r+t)}function E(){return{connectBuf:Buffer.alloc(0),pending:[],wsOpen:!1,established:!1,closed:!1}}async function D(e){let t=`Basic `+Buffer.from(`${e.sessionId}:${e.token}`).toString(`base64`),n=`Bearer ${e.token}`,r=typeof Bun<`u`?O(e.wsUrl,t,n):await k(e.wsUrl,t,n);return a(`[upstreamproxy] relay listening on 127.0.0.1:${r.port}`),r}function O(e,t,n){let r=Bun.listen({hostname:`127.0.0.1`,port:0,socket:{open(e){e.data={...E(),writeBuf:[]}},data(r,i){let a=r.data;A({write:e=>{let t=typeof e==`string`?Buffer.from(e,`utf8`):e;if(a.writeBuf.length>0){a.writeBuf.push(t);return}let n=r.write(t);n<t.length&&a.writeBuf.push(t.subarray(n))},end:()=>r.end()},a,i,e,t,n)},drain(e){let t=e.data;for(;t.writeBuf.length>0;){let n=t.writeBuf[0],r=e.write(n);if(r<n.length){t.writeBuf[0]=n.subarray(r);return}t.writeBuf.shift()}},close(e){P(e.data)},error(e,t){a(`[upstreamproxy] client socket error: ${t.message}`),P(e.data)}}});return{port:r.port,stop:()=>r.stop(!0)}}async function k(e,t,n){x=(await import(`./wrapper-K8ZapJVu.js`)).default;let r=new WeakMap,i=b(i=>{let o=E();r.set(i,o);let s={write:e=>{i.write(typeof e==`string`?e:Buffer.from(e))},end:()=>i.end()};i.on(`data`,r=>A(s,o,r,e,t,n)),i.on(`close`,()=>P(r.get(i))),i.on(`error`,e=>{a(`[upstreamproxy] client socket error: ${e.message}`),P(r.get(i))})});return new Promise((e,t)=>{i.once(`error`,t),i.listen(0,`127.0.0.1`,()=>{let n=i.address();if(n===null||typeof n==`string`){t(Error(`upstreamproxy: server has no TCP address`));return}e({port:n.port,stop:()=>i.close()})})})}function A(e,t,n,r,i,a){if(!t.ws){t.connectBuf=Buffer.concat([t.connectBuf,n]);let o=t.connectBuf.indexOf(`\r
|
|
2
2
|
\r
|
|
3
3
|
`);if(o===-1){t.connectBuf.length>8192&&(e.write(`HTTP/1.1 400 Bad Request\r
|
|
4
4
|
\r
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{bd as n,qC as r}from"./loadAgentsDir-C7lOqvfh.js";import{Gt as i,et as a,fi as o,t as s,vt as c}from"./src-P_wYS_NJ2.js";function l(e,t,n,r=!0){let{exit:i}=c(),[o,s]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??i,[n,i]),d=a(e=>s({pending:e,keyName:`Ctrl-C`}),l),f=a(e=>s({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),o}var u,d=e((()=>{u=t(o(),1),s(),n()}));function f(e,t,n){return l(i,t,e,n)}var p=e((()=>{r(),d()}));export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Cg as t,wg as n}from"./loadAgentsDir-C7lOqvfh.js";import{C as r,_ as i,s as a}from"./model-BsZ4sP_H.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as t,Bh as n,Cg as r,Cs as i,Ds as a,ES as o,Eg as s,Gh as c,Hh as l,J_ as u,Os as d,Ss as f,TS as p,Wh as m,ef as h,mo as g,po as _,q_ as v,wg as y}from"./loadAgentsDir-C7lOqvfh.js";import{fi as b}from"./src-P_wYS_NJ2.js";import{W as x,a as S,l as C,z as w}from"./debug-RAynG_nM.js";import{In as T,Ln as E}from"./settings-DnptdP79.js";import{O as D,k as O}from"./git-2c7WlGDL.js";import{o as k,s as A}from"./log-CezCRpAN.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-DZaYzecY.js";import{t as F}from"./pluginBlocklist-n6Imlh3y.js";var I=e(b(),1);t(),j(),n(),r(),E(),S(),D(),w(),k(),a(),i(),v(),m(),p(),P(),_();function L({enabled:e=!0}={}){let t=s(),n=y(e=>e.plugins.needsRefresh),{addNotification:r}=h(),i=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:i}=await g();await F();let a=N();Object.keys(a).length>0&&r({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let s=[],p=[];try{s=await f()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{p=await d()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await u()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let m=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await o(e,i);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),h=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await c(e,i);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);l(),t(t=>{let r=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(i.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...i];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:s,errors:o}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${s.length}, Agents: ${p.length}, Errors: ${i.length}`);let _=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:i.length,skill_count:s.length,agent_count:p.length,hook_count:_,mcp_count:m,lsp_count:h}}catch(e){let n=x(e);return A(n),C(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,r]);(0,I.useEffect)(()=>{e&&i().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),O(`info`,`tengu_plugins_loaded`,r)})},[i,e]),(0,I.useEffect)(()=>{!e||!n||r({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,n,r])}export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$c as n,rl as r}from"./loadAgentsDir-C7lOqvfh.js";import{fi as i}from"./src-P_wYS_NJ2.js";import{n as a,t as o}from"./toolPool-CkXFlqsn.js";function s(e,t,r){return(0,c.useMemo)(()=>a(e,n(r,t),r.mode),[e,t,r,!1,!1])}var c,l=e((()=>{c=t(i(),1),r(),o()}));export{s as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$C as n,Ad as r,Cd as i,Dd as a,Md as o,Od as s,Sd as c,jd as l,kd as u,xd as d}from"./loadAgentsDir-C7lOqvfh.js";import{Vn as f,fi as p,hn as m,ot as h,t as g}from"./src-P_wYS_NJ2.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:n,onExitUp:i,columns:p,passthroughCtrlKeys:g=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=h(),w=p??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=f=>{if(!e)return;let p=d.fromText(T,w,D);if(!(f.ctrl&&g.includes(f.key.toLowerCase()))){if(_(f)||u(),v(f)||r(),f.key===`return`||f.key===`down`){f.preventDefault(),t();return}if(f.key===`up`){f.preventDefault(),i&&i();return}if(f.key===`escape`){f.preventDefault(),n?n():T.length>0?(E(``),O(0)):t();return}if(f.key===`backspace`){if(f.preventDefault(),f.meta){let{cursor:e,killed:t}=p.deleteWordBefore();a(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(n??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}if(f.key===`delete`){f.preventDefault();let e=p.del();E(e.text),O(e.offset);return}if(f.key===`left`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.prevWord();O(e.offset);return}if(f.key===`right`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.nextWord();O(e.offset);return}if(f.key===`left`){f.preventDefault();let e=p.left();O(e.offset);return}if(f.key===`right`){f.preventDefault();let e=p.right();O(e.offset);return}if(f.key===`home`){f.preventDefault(),O(0);return}if(f.key===`end`){f.preventDefault(),O(T.length);return}if(f.ctrl){switch(f.preventDefault(),f.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(p.left().offset);return;case`f`:O(p.right().offset);return;case`d`:{if(T.length===0){(n??t)();return}let e=p.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(n??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=p.deleteToLineEnd();a(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=p.deleteToLineStart();a(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=p.deleteWordBefore();a(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=c();if(e.length>0){let t=p.offset,n=p.insert(e);s(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(n){n();return}}return}if(f.meta){switch(f.preventDefault(),f.key.toLowerCase()){case`b`:O(p.prevWord().offset);return;case`f`:O(p.nextWord().offset);return;case`d`:{let e=p.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=o();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;l(t.length),E(o),O(s)}return}}return}if(f.key!==`tab`&&f.key.length>=1&&!x.has(f.key)){f.preventDefault();let e=p.insert(f.key);E(e.text),O(e.offset)}}};return m((e,t,n)=>{A(new f(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(p(),1),g(),i(),n(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$d as n,Ag as r,ef as i,kg as a}from"./loadAgentsDir-C7lOqvfh.js";import{fi as o}from"./src-P_wYS_NJ2.js";import{B as s,Wt as c}from"./state-BemZdQIl.js";import{n as l,t as u}from"./allErrors-CU89tF-z.js";function d(){let{addNotification:e,removeNotification:t}=i(),[n,a]=(0,f.useState)(()=>{let{errors:e}=u();return e});return r((0,f.useCallback)(()=>{let{errors:e}=u();a(e)},[])),(0,f.useEffect)(()=>{if(!s())if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[n,e,t]),n}var f,p,m=e((()=>{f=t(o(),1),n(),c(),l(),a(),p=`settings-errors`}));export{d as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return`claude-code/0.0.
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return`claude-code/0.0.10`}var n=e((()=>{}));export{n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Cg as t,Mu as n,Nu as r,Sg as i}from"./loadAgentsDir-C7lOqvfh.js";import{I as a,P as o,fi as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{Bt as f,Ht as p}from"./model-BsZ4sP_H.js";import{t as m}from"./WelcomeV2-DvfQHnZY.js";import{t as h}from"./useManagePlugins-CYBIkaB1.js";import{n as g,t as _}from"./MCPConnectionManager-CUTuaa8T.js";import{n as v}from"./onChangeAppState-RBl6H7ho.js";import{cwd as y}from"process";var b=e(s(),1);c(),r(),u(),g(),t(),f();var x=l();async function S(e){d(`tengu_setup_token_command`,{});let t=!p(),{ConsoleOAuthFlow:r}=await import(`./ConsoleOAuthFlow-4mOvEer_.js`);await new Promise(s=>{e.render((0,x.jsx)(i,{onChangeAppState:v,children:(0,x.jsx)(n,{children:(0,x.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),t&&(0,x.jsxs)(a,{flexDirection:`column`,children:[(0,x.jsx)(o,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(o,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(r,{onDone:()=>{s()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-DmgAwce2.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(i,{children:(0,x.jsx)(n,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-BEsBuzsk.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-C-6ItpH0.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{p as r}from"./external-CEp-aPkt.js";import{r as i}from"./lazySchema-B4D4qJVE.js";import{$E as a,ID as o,LD as s,ND as ee,PD as c,bE as l,eD as u,tD as d,yE as f}from"./loadAgentsDir-ByO8eJqU.js";import{C as p,F as m,I as h,S as g,V as _,a as v,d as y,l as b,p as x,w as te,z as S}from"./debug-RZ4NuXyS.js";import{_t as C,gt as w,ht as T,pt as E,vt as D}from"./settings-hQDLwPVj.js";import{o as ne,s as O}from"./log-CZ0zYP_c.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(f(),U)}async function L(){let e=I();try{let t=p(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return b(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return b(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return b(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(b(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(b(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(b(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&b(`Failed to load install counts cache: ${m(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=f();await y().mkdir(r),await F(n,te(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),b(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){b(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return d(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw d(`install_counts`,W,`failure`,performance.now()-e,a(t)),t}}async function B(){let e=await L();if(e){b(`Using cached install counts`),d(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),b(`Failed to fetch install counts: ${m(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),v(),S(),x(),ne(),g(),u(),l(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=y(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{S(),x()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=T().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=k.resolve(e),a;try{a=await A(i,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=p(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let s=C().extend({plugins:r(w().strict())}).strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=k.dirname(i),a=k.basename(r)===`.claude-plugin`?k.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(ee);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,c;try{c=s(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let l=c;if(l.description!==void 0){let e=l.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});l.name!==void 0&&l.name!==null&&typeof l.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof l.name}.`});let u=l[`allowed-tools`];u!=null&&(typeof u!=`string`&&!Array.isArray(u)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof u}.`}):Array.isArray(u)&&u.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=l.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=E().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=p(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),S(),c(),g(),o(),D(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{GE as r,JE as i,KE as a,Xw as o,YE as s,Zw as c,iT as l,nT as u,rT as d}from"./loadAgentsDir-C7lOqvfh.js";import{p as f}from"./external-CEp-aPkt.js";import{r as ee}from"./lazySchema-B4D4qJVE.js";import{C as p,F as m,I as h,S as g,V as _,a as v,d as y,l as b,p as x,w as te,z as S}from"./debug-RAynG_nM.js";import{_t as C,gt as w,ht as T,pt as E,vt as D}from"./settings-DnptdP79.js";import{o as ne,s as O}from"./log-CezCRpAN.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(o(),U)}async function L(){let e=I();try{let t=p(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return b(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return b(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return b(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(b(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(b(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(b(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&b(`Failed to load install counts cache: ${m(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=o();await y().mkdir(r),await F(n,te(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),b(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){b(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return l(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw l(`install_counts`,W,`failure`,performance.now()-e,u(t)),t}}async function B(){let e=await L();if(e){b(`Using cached install counts`),l(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),b(`Failed to fetch install counts: ${m(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),v(),S(),x(),ne(),g(),d(),c(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=y(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{S(),x()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=T().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(a&&typeof a==`object`){let e=a;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let o=C().extend({plugins:f(w().strict())}).strict().safeParse(a);if(o.success||t.push(...q(o.error)),o.success){let e=o.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=k.dirname(r),a=k.basename(i)===`.claude-plugin`?k.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let i=[],a=[],o=t.match(r);if(!o)return a.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:i,warnings:a,filePath:e,fileType:n};let c=o[1]||``,l;try{l=s(c)}catch(t){return i.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:i,warnings:a,filePath:e,fileType:n}}if(typeof l!=`object`||!l||Array.isArray(l))return i.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(l)?`an array`:l===null?`null`:typeof l}.`}),{success:!1,errors:i,warnings:a,filePath:e,fileType:n};let u=l;if(u.description!==void 0){let e=u.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&i.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else a.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});u.name!==void 0&&u.name!==null&&typeof u.name!=`string`&&i.push({path:`name`,message:`name must be a string, got ${typeof u.name}.`});let d=u[`allowed-tools`];d!=null&&(typeof d!=`string`&&!Array.isArray(d)?i.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof d}.`}):Array.isArray(d)&&d.some(e=>typeof e!=`string`)&&i.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let f=u.shell;if(f!=null)if(typeof f!=`string`)i.push({path:`shell`,message:`shell must be a string, got ${typeof f}.`});else{let e=f.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&i.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${f}'.`})}return{success:i.length===0,errors:i,warnings:a,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=E().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=p(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{ee(),S(),a(),g(),i(),D(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,h as n,y as r}from"./config-Do1870_d.js";import{n as i,r as a}from"./analytics-DJobLaWP.js";var o;e((()=>{i(),n(),o=async()=>{let e=t().editorMode||`normal`;e===`emacs`&&(e=`normal`);let n=e===`normal`?`vim`:`normal`;return r(e=>({...e,editorMode:n})),a(`tengu_editor_mode_changed`,{mode:n,source:`command`}),{type:`text`,value:`Editor mode set to ${n}. ${n===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,o as n}from"./execFileNoThrow-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,o as n}from"./execFileNoThrow-Dwu6psHW.js";import{n as r,t as i}from"./execSyncWrapper-BTZJjCuv.js";async function a(e){if(process.platform===`win32`){let t=await n(`where.exe ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim().split(/\r?\n/)[0]||null}let t=await n(`which ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim()}function o(e){if(process.platform===`win32`)try{return i(`where.exe ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return i(`which ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()||null}catch{return null}}var s,c,l,u=e((()=>{t(),r(),s=typeof Bun<`u`&&typeof Bun.which==`function`?Bun.which:null,c=s?async e=>s(e):a,l=s??o}));export{c as n,l as r,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./cwd-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./cwd-Cfdf7z7s.js";import{a,l as o}from"./debug-RAynG_nM.js";import{n as s,t as c}from"./memoize-DsqYrbeR.js";import{n as l,t as u}from"./execSyncWrapper-BTZJjCuv.js";import{i as d,o as f}from"./platform-BMPbglug.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(d()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,o(`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(),i=m.relative(r,n);if(i===``||!i.startsWith(`..`)&&!m.isAbsolute(i)){o(`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?`Work Mate was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Work Mate 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(),r(),a(),l(),c(),f(),b={checkExists:p,execCommand:e=>u(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:i,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=s(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=s(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./windowsPaths-BU3yQWTB.js";e();export{t as setShellIfWindows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./axios-DaWTGg7G.js";import{C as n,S as r,w as i}from"./debug-
|
|
1
|
+
import{n as e,t}from"./axios-DaWTGg7G.js";import{C as n,S as r,w as i}from"./debug-RAynG_nM.js";t(),r();function a(e){let t=n(Buffer.from(e,`base64url`).toString(`utf-8`));if(!t||typeof t!=`object`||!(`version`in t)||t.version!==1)throw Error(`Unsupported work secret version: ${t&&typeof t==`object`&&`version`in t?t.version:`unknown`}`);let r=t;if(typeof r.session_ingress_token!=`string`||r.session_ingress_token.length===0)throw Error(`Invalid work secret: missing or empty session_ingress_token`);if(typeof r.api_base_url!=`string`)throw Error(`Invalid work secret: missing api_base_url`);return t}function o(e,t){let n=e.includes(`localhost`)||e.includes(`127.0.0.1`),r=e.startsWith(`https`)?`wss`:`ws`,i=n?`v2`:`v1`;return`${r}://${e.replace(/^https?:\/\//,``).replace(/\/+$/,``)}/${i}/session_ingress/ws/${t}`}function s(e,t){if(e===t)return!0;let n=e.slice(e.lastIndexOf(`_`)+1),r=t.slice(t.lastIndexOf(`_`)+1);return n.length>=4&&n===r}function c(e,t){return`${e.replace(/\/+$/,``)}/v1/code/sessions/${t}`}async function l(t,n){let r=await e.post(`${t}/worker/register`,{},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`},timeout:1e4}),a=r.data?.worker_epoch,o=typeof a==`string`?Number(a):a;if(typeof o!=`number`||!Number.isFinite(o)||!Number.isSafeInteger(o))throw Error(`registerWorker: invalid worker_epoch in response: ${i(r.data)}`);return o}export{s as a,l as i,o as n,a as r,c as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{l as e,o as t,u as n}from"./envUtils-BDhHQY0-.js";import{At as r,Tt as i,US as a,WS as o,_t as s}from"./loadAgentsDir-C7lOqvfh.js";import{t as c}from"./src-P_wYS_NJ2.js";import{C as l,F as u,S as d,a as f,l as p,w as m,z as h}from"./debug-RAynG_nM.js";import{Ut as g}from"./settings-DnptdP79.js";import{O as _,k as v}from"./git-2c7WlGDL.js";import{o as y,s as b}from"./log-CezCRpAN.js";import{n as x,r as S}from"./analytics-DJobLaWP.js";import{C,l as w,v as T}from"./startupProfiler-L_UWZ03w.js";import{Bt as E,Ot as D,_n as O,vn as k}from"./model-BsZ4sP_H.js";import{i as ee,t as A}from"./sessionIdCompat-DMayYBrf.js";import{n as j}from"./firstPartyEventLogger-B3cXgR67.js";import{t as te}from"./datadog-DjeJThpV.js";import{n as M,o as N,r as P}from"./debugUtils-DX0KAXNK.js";import{t as F}from"./pollConfig-BgpfHQPJ.js";import{n as I,t as L}from"./rcDebugLog-CARUIORE.js";import{a as R,i as z,n as B,o as ne,r as re,s as V,t as H}from"./capacityWake-amzeeBz0.js";import{a as ie,i as ae,n as oe,r as se,t as ce}from"./workSecret-DUqdPy44.js";import{i as U}from"./trustedDevice-CFf5yaG-.js";import{t as le}from"./jwtUtils-CUPXdX3W.js";import{i as W,n as G,r as K}from"./cliLaunch-BWcoyZDP.js";import"./bridgeStatusUtil-DFMftajD.js";import{t as q}from"./lib-BlVGipXx.js";import{hostname as J,tmpdir as ue}from"os";import{dirname as Y,join as de,resolve as X}from"path";import{createWriteStream as Z}from"fs";import{randomUUID as fe}from"crypto";import{spawn as pe}from"child_process";import{createInterface as Q}from"readline";t(),h(),d(),_(),y(),x(),T(),O(),o(),te(),j(),i(),L(),W(),q(),g(),c(),f(),A(),N();var me=10,he=10;function ge(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var $={Read:`Reading`,Write:`Writing`,Edit:`Editing`,MultiEdit:`Editing`,Bash:`Running`,Glob:`Searching`,Grep:`Searching`,WebFetch:`Fetching`,WebSearch:`Searching`,Task:`Running task`,FileReadTool:`Reading`,FileWriteTool:`Writing`,FileEditTool:`Editing`,GlobTool:`Searching`,GrepTool:`Searching`,BashTool:`Running`,NotebookEditTool:`Editing notebook`,LSP:`LSP`};function _e(e,t){let n=$[e]??e,r=t.file_path??t.filePath??t.pattern??t.command?.slice(0,60)??t.url??t.query??``;return r?`${n} ${r}`:n}function ve(e,t,n){let r;try{r=l(e)}catch{return[]}if(!r||typeof r!=`object`)return[];let i=r,a=[],o=Date.now();switch(i.type){case`assistant`:{let e=i.message;if(!e)break;let r=e.content;if(!Array.isArray(r))break;for(let e of r){if(!e||typeof e!=`object`)continue;let r=e;if(r.type===`tool_use`){let e=r.name??`Tool`,i=r.input??{},s=_e(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${be(i)}`)}else if(r.type===`text`){let e=r.text??``;e.length>0&&(a.push({type:`text`,summary:e.slice(0,80),timestamp:o}),n(`[bridge:activity] sessionId=${t} text "${e.slice(0,100)}"`))}}break}case`result`:{let e=i.subtype;if(e===`success`)a.push({type:`result`,summary:`Session completed`,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=success`);else if(e){let r=i.errors?.[0]??`Error: ${e}`;a.push({type:`error`,summary:r,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=${e} error="${r}"`)}else n(`[bridge:activity] sessionId=${t} result subtype=undefined`);break}default:break}return a}function ye(e){if(e.parent_tool_use_id!=null||e.isSynthetic||e.isReplay)return;let t=e.message?.content,n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let e of t)if(e&&typeof e==`object`&&e.type===`text`){n=e.text;break}}return n=n?.trim(),n||void 0}function be(e){let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`&&t.push(`${n}="${r.slice(0,100)}"`),t.length>=3)break;return t.join(` `)}function xe(e){return{spawn(t,n){let r=ge(t.sessionId),i;if(e.debugFile){let t=e.debugFile.lastIndexOf(`.`);i=t>0?`${e.debugFile.slice(0,t)}-${r}${e.debugFile.slice(t)}`:`${e.debugFile}-${r}`}else e.verbose&&(i=de(ue(),`claude`,`bridge-session-${r}.log`));let a=null,o;e.debugFile&&(o=de(Y(e.debugFile),`bridge-transcript-${r}.jsonl`),a=Z(o,{flags:`a`}),a.on(`error`,t=>{e.onDebug(`[bridge:session] Transcript write error: ${t.message}`),a=null}),e.onDebug(`[bridge:session] Transcript log: ${o}`));let s=[...e.scriptArgs,`--print`,`--sdk-url`,t.sdkUrl,`--session-id`,t.sessionId,`--input-format`,`stream-json`,`--output-format`,`stream-json`,`--replay-user-messages`,...e.verbose?[`--verbose`]:[],...i?[`--debug-file`,i]:[],...e.permissionMode?[`--permission-mode`,e.permissionMode]:[]],c={...e.env,CLAUDE_CODE_OAUTH_TOKEN:void 0,CLAUDE_CODE_ENVIRONMENT_KIND:`bridge`,...e.sandbox&&{CLAUDE_CODE_FORCE_SANDBOX:`1`},CLAUDE_CODE_SESSION_ACCESS_TOKEN:t.accessToken,CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2:`1`,...t.useCcrV2&&{CLAUDE_CODE_USE_CCR_V2:`1`,CLAUDE_CODE_WORKER_EPOCH:String(t.workerEpoch)}};e.onDebug(`[bridge:session] Spawning sessionId=${t.sessionId} sdkUrl=${t.sdkUrl} accessToken=${t.accessToken?`present`:`MISSING`}`),e.onDebug(`[bridge:session] Child args: ${s.join(` `)}`),i&&e.onDebug(`[bridge:session] Debug log: ${i}`);let u=pe(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${u.pid}`);let d=[],f=null,p=[],h=!1,g=!1;u.stderr&&Q({input:u.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(t+`
|
|
2
|
+
`),p.length>=he&&p.shift(),p.push(t)}),u.stdout&&Q({input:u.stdout}).on(`line`,n=>{a&&a.write(n+`
|
|
3
|
+
`),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${M(n)}`),e.verbose&&process.stderr.write(n+`
|
|
4
|
+
`);let r=ve(n,t.sessionId,e.onDebug);for(let n of r)d.length>=me&&d.shift(),d.push(n),f=n,e.onActivity?.(t.sessionId,n);{let r;try{r=l(n)}catch{}if(r&&typeof r==`object`){let n=r;if(n.type===`control_request`)n.request?.subtype===`can_use_tool`&&e.onPermissionRequest&&e.onPermissionRequest(t.sessionId,r,t.accessToken);else if(n.type===`user`&&!g&&t.onFirstUserMessage){let e=ye(n);e&&(g=!0,t.onFirstUserMessage(e))}}}});let _=new Promise(n=>{u.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${u.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${u.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${u.pid}`),n(`failed`))}),u.on(`error`,r=>{e.onDebug(`[bridge:session] sessionId=${t.sessionId} spawn error: ${r.message}`),n(`failed`)})}),v={sessionId:t.sessionId,done:_,activities:d,accessToken:t.accessToken,lastStderr:p,get currentActivity(){return f},kill(){u.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${u.pid}`),process.platform===`win32`?u.kill():u.kill(`SIGTERM`))},forceKill(){!h&&u.pid&&(h=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${u.pid}`),process.platform===`win32`?u.kill():u.kill(`SIGKILL`))},writeStdin(n){u.stdin&&!u.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${M(n)}`),u.stdin.write(n))},updateAccessToken(n){v.accessToken=n,v.writeStdin(m({type:`update_environment_variables`,variables:{CLAUDE_CODE_SESSION_ACCESS_TOKEN:n}})+`
|
|
5
|
+
`),e.onDebug(`[bridge:session] Sent token refresh via stdin for sessionId=${t.sessionId}`)}};return v}}}f(),N();var Se={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},Ce=1e3;function we(e){return e.connCapMs*2}function Te(){let e=[...G()],t=K();return t&&e.push(t),e}function Ee(e,t,n){try{return e.spawn(t,n)}catch(e){let t=u(e);return b(Error(`Session spawn failed: ${t}`)),t}}async function De(t,i,o,c,l,d,f,m=Se,h,g){let _=new AbortController;f.aborted?_.abort():f.addEventListener(`abort`,()=>_.abort(),{once:!0});let y=_.signal,x=new Map,C=new Map,T=new Map,E=new Map,D=new Map,O=new Map,A=new Set,j=new Map,te=new Set,M=new Set,N=H(y);async function L(){I(`heartbeat: checking ${x.size} active session(s)`);let e=!1,t=!1,n=[];for(let[r]of x){let a=T.get(r),o=D.get(r);if(!(!a||!o))try{await c.heartbeatWork(i,a,o),e=!0}catch(e){p(`[bridge:heartbeat] Failed for sessionId=${r} workId=${a}: ${u(e)}`),e instanceof B&&(S(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),e.status===401||e.status===403?n.push(r):t=!0)}}for(let e of n){d.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await c.reconnectSession(i,e),p(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){d.logError(`Failed to refresh session ${e} token: ${u(t)}`),p(`[bridge:heartbeat] reconnectSession(${e}) failed: ${u(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let re=new Set,V=g?le({getAccessToken:g,onRefresh:(e,t)=>{let n=x.get(e);n&&(re.has(e)?(d.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),c.reconnectSession(i,e).catch(t=>{d.logError(`Failed to refresh session ${e} token: ${u(t)}`),p(`[bridge:token] reconnectSession(${e}) failed: ${u(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,U=Date.now(),W=new Set;function G(e){W.add(e),e.finally(()=>W.delete(e))}let K=0,q=0,J=null,Y=null,X=null,Z=null;p(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${i}`),v(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),d.printBanner(t,i),d.updateSessionCount(0,t.maxSessions,t.spawnMode),h&&d.setAttached(h);function fe(){d.updateSessionCount(x.size,t.maxSessions,t.spawnMode);for(let[e,t]of x){let n=t.currentActivity;n&&d.updateSessionActivity(E.get(e)??e,n)}if(x.size===0){d.updateIdleStatus();return}let[e,n]=[...x.entries()].pop(),r=C.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&d.refreshDisplay();return}let a=w(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);d.updateSessionStatus(e,a,i,o)}function pe(){Q(),fe(),Z=setInterval(fe,Ce)}function Q(){Z&&(clearInterval(Z),Z=null)}function me(e,n,a){return o=>{let s=T.get(e);I(`session done: sessionId=${e} workId=${s??`none`} status=${o} wasTimedOut=${te.has(e)} duration=${Math.round((Date.now()-n)/1e3)}s stderr=${a.lastStderr.length>0?a.lastStderr.join(`\\n`).slice(0,500):`(none)`}`),x.delete(e),C.delete(e),T.delete(e),D.delete(e);let l=E.get(e)??e;E.delete(e),d.removeSession(l),M.delete(l),re.delete(e);let f=O.get(e);f&&(clearTimeout(f),O.delete(e)),V?.cancel(e),N.wake();let h=te.delete(e),g=h&&o===`interrupted`?`failed`:o,k=Date.now()-n;p(`[bridge:session] sessionId=${e} workId=${s??`unknown`} exited status=${g} duration=${w(k)}`),S(`tengu_bridge_session_done`,{status:g,duration_ms:k}),v(`info`,`bridge_session_done`,{status:g,duration_ms:k}),d.clearStatus(),Q();let ee=a.lastStderr.length>0?a.lastStderr.join(`
|
|
6
|
+
`):void 0,P;switch(g){case`completed`:d.logSessionComplete(e,k);break;case`failed`:!h&&!y.aborted&&(P=ee??`Process exited with error`,d.logSessionFailed(e,P),b(Error(`Bridge session failed: ${P}`)));break;case`interrupted`:d.logVerbose(`Session ${e} interrupted`);break}g!==`interrupted`&&s&&(G(Ne(c,i,s,d,m.stopWorkBaseDelayMs)),A.add(s));let F=j.get(e);if(F&&(j.delete(e),G(r(F.worktreePath,F.worktreeBranch,F.gitRoot,F.hookBased).catch(e=>d.logVerbose(`Failed to remove worktree ${F.worktreePath}: ${u(e)}`)))),g!==`interrupted`&&!y.aborted)if(t.spawnMode!==`single-session`)G(c.archiveSession(l).catch(t=>d.logVerbose(`Failed to archive session ${e}: ${u(t)}`))),p(`[bridge:session] Session ${g}, returning to idle (multi-session mode)`);else{p(`[bridge:session] Session ${g}, aborting poll loop to tear down environment`),_.abort();return}y.aborted||pe()}}for(h||pe();!y.aborted;){let f=F();try{I(`poll: envId=${i} activeSessions=${x.size}`);let g=await c.pollForWork(i,o,y,f.reclaim_older_than_ms);if(J!==null||Y!==null){let e=Date.now()-(J??Y??Date.now());d.logReconnected(e),p(`[bridge:poll] Reconnected after ${w(e)}`),S(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(K=0,q=0,J=null,Y=null,X=null,!g){if(x.size>=t.maxSessions){let e=f.multisession_poll_interval_ms_at_capacity;if(f.non_exclusive_heartbeat_interval_ms>0){S(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:x.size,heartbeat_interval_ms:f.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!y.aborted&&x.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=F();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=N.signal();if(r=await L(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await k(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:y.aborted?`shutdown`:x.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(S(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:x.size}),a===`poll_due`&&p(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=N.signal();await k(e>0?e:f.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=N.signal();await k(e,t.signal),t.cleanup()}}else await k(x.size>0?f.multisession_poll_interval_ms_partial_capacity:f.multisession_poll_interval_ms_not_at_capacity,y);continue}let _=x.size>=t.maxSessions;if(A.has(g.id)){if(p(`[bridge:work] Skipping already-completed workId=${g.id}`),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await k(1e3,y);continue}let P;try{P=se(g.secret)}catch(e){let t=u(e);if(d.logError(`Failed to decode work secret for workId=${g.id}: ${t}`),S(`tengu_bridge_work_secret_failed`,{}),A.add(g.id),G(Ne(c,i,g.id,d,m.stopWorkBaseDelayMs)),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let R=async()=>{p(`[bridge:work] Acknowledging workId=${g.id}`);try{await c.acknowledgeWork(i,g.id,P.session_ingress_token)}catch(e){p(`[bridge:work] Acknowledge failed workId=${g.id}: ${u(e)}`)}},z=g.data.type;switch(g.data.type){case`healthcheck`:await R(),p(`[bridge:work] Healthcheck received`),d.logVerbose(`Healthcheck received`);break;case`session`:{let o=g.data.id;I(`work received: type=session sessionId=${o} workId=${g.id}`);try{ne(o,`session_id`)}catch{await R(),d.logError(`Invalid session_id received: ${o}`);break}let f=x.get(o);if(f){f.updateAccessToken(P.session_ingress_token),D.set(o,P.session_ingress_token),T.set(o,g.id),V?.schedule(o,P.session_ingress_token),p(`[bridge:work] Updated access token for existing sessionId=${o} workId=${g.id}`),await R();break}if(x.size>=t.maxSessions){p(`[bridge:work] At capacity (${x.size}/${t.maxSessions}), cannot spawn new session for workId=${g.id}`);break}await R();let _=Date.now(),w,N=!1,F;if(P.use_code_sessions===!0||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){w=ce(t.apiBaseUrl,o);for(let e=1;e<=2;e++)try{F=await ae(w,P.session_ingress_token),N=!0,p(`[bridge:session] CCR v2: registered worker sessionId=${o} epoch=${F} attempt=${e}`);break}catch(t){let n=u(t);if(e<2){if(p(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await k(2e3,y),y.aborted)break;continue}d.logError(`CCR v2 worker registration failed for session ${o}: ${n}`),b(Error(`registerWorker failed: ${n}`)),A.add(g.id),G(Ne(c,i,g.id,d,m.stopWorkBaseDelayMs))}if(!N)break}else w=oe(t.sessionIngressUrl,o);let L=t.spawnMode,z=t.dir,B=0;if(L===`worktree`&&(h===void 0||!ie(o,h))){let e=Date.now();try{let t=await s(`bridge-${ge(o)}`);B=Date.now()-e,j.set(o,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),z=t.worktreePath,p(`[bridge:session] Created worktree for sessionId=${o} at ${t.worktreePath}`)}catch(e){let t=u(e);d.logError(`Failed to create worktree for session ${o}: ${t}`),b(Error(`Worktree creation failed: ${t}`)),A.add(g.id),G(Ne(c,i,g.id,d,m.stopWorkBaseDelayMs));break}}p(`[bridge:session] Spawning sessionId=${o} sdkUrl=${w}`);let H=ee(o);I(`spawning session: sessionId=${o} sdkUrl=${w} useCcrV2=${N} workerEpoch=${F} dir=${z} accessToken=${P.session_ingress_token?P.session_ingress_token.slice(0,8)+`...`:`NONE`}`);let se=Ee(l,{sessionId:o,sdkUrl:w,accessToken:P.session_ingress_token,useCcrV2:N,workerEpoch:F,onFirstUserMessage:e=>{if(M.has(H))return;M.add(H);let n=Ie(e);d.setSessionTitle(H,n),p(`[bridge:title] derived title for ${H}: ${n}`),import(`./createSession-eE8mswkv.js`).then(({updateBridgeSessionTitle:e})=>e(H,n,{baseUrl:t.apiBaseUrl})).catch(e=>p(`[bridge:title] failed to update title for ${H}: ${e}`,{level:`error`}))}},z);if(typeof se==`string`){d.logError(`Failed to spawn session ${o}: ${se}`);let e=j.get(o);e&&(j.delete(o),G(r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>d.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${u(t)}`)))),A.add(g.id),G(Ne(c,i,g.id,d,m.stopWorkBaseDelayMs));break}let U=se,le=Date.now()-_;S(`tengu_bridge_session_started`,{active_sessions:x.size,spawn_mode:L,in_worktree:j.has(o),spawn_duration_ms:le,worktree_create_ms:B,inProtectedNamespace:n()}),v(`info`,`bridge_session_started`,{spawn_mode:L,in_worktree:j.has(o),spawn_duration_ms:le,worktree_create_ms:B}),x.set(o,U),T.set(o,g.id),D.set(o,P.session_ingress_token),E.set(o,H);let W=Date.now();C.set(o,W),d.logSessionStart(o,`Session ${o}`);let K=ge(o),q;if(t.debugFile){let e=t.debugFile.lastIndexOf(`.`);q=e>0?`${t.debugFile.slice(0,e)}-${K}${t.debugFile.slice(e)}`:`${t.debugFile}-${K}`}else t.verbose&&(q=de(ue(),`claude`,`bridge-session-${K}.log`));q&&d.logVerbose(`Debug log: ${q}`),d.addSession(H,a(H,t.sessionIngressUrl)),pe(),d.setAttached(H),Le(H,t.apiBaseUrl).then(e=>{e&&x.has(o)&&(M.add(H),d.setSessionTitle(H,e),p(`[bridge:title] server title for ${H}: ${e}`))}).catch(e=>p(`[bridge:title] failed to fetch title for ${H}: ${e}`,{level:`error`}));let J=t.sessionTimeoutMs??864e5;if(J>0){let e=setTimeout(Pe,J,o,J,d,te,U);O.set(o,e)}N&&re.add(o),V?.schedule(o,P.session_ingress_token),U.done.then(me(o,W,U));break}default:await R(),p(`[bridge:work] Unknown work type: ${z}, skipping`);break}if(_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(y.aborted)break;if(e instanceof B){z(e.errorType)?d.logStatus(e.message):R(e)?p(`[bridge:work] Suppressed 403 error: ${e.message}`):(d.logError(e.message),b(e)),S(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),v(z(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=P(e);if(I(`poll error: ${t} isConn=${ke(e)} isServer=${Ae(e)} activeSessions=${x.size}`),ke(e)||Ae(e)){let e=Date.now();X!==null&&e-X>we(m)&&(p(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),v(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,J||(J=e);let n=e-J;if(n>=m.connGiveUpMs){d.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),S(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),v(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n});break}Y=null,q=0,K=K?Math.min(K*2,m.connCapMs):m.connInitialMs;let r=je(K);d.logVerbose(`Connection error, retrying in ${Me(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),d.updateReconnectingStatus(Me(r),w(n)),F().non_exclusive_heartbeat_interval_ms>0&&await L(),await k(r,y)}else{let e=Date.now();X!==null&&e-X>we(m)&&(p(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),v(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,Y||(Y=e);let n=e-Y;if(n>=m.generalGiveUpMs){d.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),S(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),v(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n});break}J=null,K=0,q=q?Math.min(q*2,m.generalCapMs):m.generalInitialMs;let r=je(q);d.logVerbose(`Poll failed, retrying in ${Me(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),d.updateReconnectingStatus(Me(r),w(n)),F().non_exclusive_heartbeat_interval_ms>0&&await L(),await k(r,y)}}}Q(),d.clearStatus();let he=Date.now()-U;S(`tengu_bridge_shutdown`,{active_sessions:x.size,loop_duration_ms:he}),v(`info`,`bridge_shutdown`,{active_sessions:x.size,loop_duration_ms:he});let $=new Set(x.keys());h&&$.add(h);let _e=new Map(E);if(x.size>0){p(`[bridge:shutdown] Shutting down ${x.size} active session(s)`),d.logStatus(`Shutting down ${x.size} active session(s)\u2026`);let e=new Map(T);for(let[e,t]of x.entries())p(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...x.values()].map(e=>e.done)),k(m.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of x.entries())p(`[bridge:shutdown] Force-killing stuck sessionId=${e}`),t.forceKill();for(let e of O.values())clearTimeout(e);if(O.clear(),V?.cancelAll(),j.size>0){let e=[...j.values()];j.clear(),p(`[bridge:shutdown] Cleaning up ${e.length} worktree(s)`),await Promise.allSettled(e.map(e=>r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased)))}await Promise.allSettled([...e.entries()].map(([e,t])=>c.stopWork(i,t,!0).catch(n=>d.logVerbose(`Failed to stop work ${t} for session ${e}: ${u(n)}`))))}W.size>0&&await Promise.allSettled([...W]),$.size>0&&(p(`[bridge:shutdown] Archiving ${$.size} session(s)`),await Promise.allSettled([...$].map(e=>c.archiveSession(_e.get(e)??ee(e)).catch(t=>d.logVerbose(`Failed to archive session ${e}: ${u(t)}`)))));try{await c.deregisterEnvironment(i),p(`[bridge:shutdown] Environment deregistered, bridge offline`),d.logVerbose(`Environment deregistered.`)}catch(e){d.logVerbose(`Failed to deregister environment: ${u(e)}`)}let{clearBridgePointer:ve}=await import(`./bridgePointer-DLYyvRKb.js`);await ve(t.dir),d.logVerbose(`Environment offline.`)}var Oe=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function ke(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&Oe.has(e.code))}function Ae(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function je(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function Me(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function Ne(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),p(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof B){R(e)?p(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),v(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=u(e);if(a<3){let e=je(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${Me(e)}: ${t}`),await k(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),v(`error`,`bridge_stop_work_failed`,{attempts:3})}}function Pe(e,t,n,r,i){p(`[bridge:session] sessionId=${e} timed out after ${w(t)}`),S(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${w(t)}`),r.add(e),i.kill()}var Fe=80;function Ie(e){return C(e.replace(/\s+/g,` `).trim(),Fe)}async function Le(e,t){let{getBridgeSession:n}=await import(`./createSession-eE8mswkv.js`);return(await n(e,{baseUrl:t}))?.title||void 0}var Re=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function ze(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-D_lk6z-C.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-CVHMRMwd.js`);o();let{initSinks:c}=await import(`./sinks-BJHgxz6Y.js`);if(c(),!s())throw new Re(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(V);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-BeqChxJC.js`),d=l();if(d.startsWith(`http://`)&&!d.includes(`localhost`)&&!d.includes(`127.0.0.1`))throw new Re(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let f=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||d,{getBranch:p,getRemoteUrl:m,findGitRoot:h}=await import(`./git-XtKbtJMc.js`),{hasWorktreeCreateHook:g}=await import(`./hooks-DWg07LmS.js`);if(e.spawnMode===`worktree`&&!(g()||h(n)!==null))throw new Re(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let _=await p(),v=await m(),y=J(),b=fe(),x={dir:n,machineName:y,branch:_,gitRepoUrl:v,maxSessions:e.capacity,spawnMode:e.spawnMode,verbose:!1,sandbox:e.sandbox,bridgeId:b,workerType:`claude_code`,environmentId:fe(),apiBaseUrl:d,sessionIngressUrl:f,sessionTimeoutMs:e.sessionTimeoutMs},S=re({baseUrl:d,getAccessToken:e.getAccessToken,runnerVersion:`0.0.10`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:U}),C,w;try{let e=await S.registerBridgeEnvironment(x);C=e.environment_id,w=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${u(e)}`)}let T=xe({execPath:process.execPath,scriptArgs:Te(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),E=Be(r);E.printBanner(x,C);let D;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-eE8mswkv.js`);try{let i=await n({environmentId:C,title:e.name,events:[],gitRepoUrl:v,branch:_,signal:t,baseUrl:d,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(D=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${u(e)}`)}}await De(x,C,w,S,T,E,t,void 0,D,async()=>e.getAccessToken())}function Be(e){let t=()=>{};return{printBanner:(t,n)=>e(`registered environmentId=${n} dir=${t.dir} spawnMode=${t.spawnMode} capacity=${t.maxSessions}`),logSessionStart:(t,n)=>e(`session start ${t}`),logSessionComplete:(t,n)=>e(`session complete ${t} (${n}ms)`),logSessionFailed:(t,n)=>e(`session failed ${t}: ${n}`),logStatus:e,logVerbose:e,logError:t=>e(`error: ${t}`),logReconnected:t=>e(`reconnected after ${t}ms`),addSession:(t,n)=>e(`session attached ${t}`),removeSession:t=>e(`session detached ${t}`),updateIdleStatus:t,updateReconnectingStatus:t,updateSessionStatus:t,updateSessionActivity:t,updateSessionCount:t,updateFailedStatus:t,setSpawnModeDisplay:t,setRepoInfo:t,setDebugLogPath:t,setAttached:t,setSessionTitle:t,clearStatus:t,toggleQr:t,refreshDisplay:t}}E(),h();var Ve=78,He=1;async function Ue(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=Ve;return}switch(e){case`remoteControl`:await We();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=Ve}}async function We(){let e=process.env.DAEMON_WORKER_DIR||X(`.`),t=process.env.DAEMON_WORKER_NAME||void 0,n=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,r=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),i=process.env.DAEMON_WORKER_PERMISSION||void 0,a=process.env.DAEMON_WORKER_SANDBOX===`1`,o=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,s=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,c=new AbortController,l=()=>c.abort();process.on(`SIGTERM`,l),process.on(`SIGINT`,l);let d={dir:e,name:t,spawnMode:n,capacity:r,permissionMode:i,sandbox:a,sessionTimeoutMs:o,createSessionOnStart:s,getAccessToken:()=>D()?.accessToken,onAuth401:async e=>!!D()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await ze(d,c.signal)}catch(e){e instanceof Re?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=Ve):(console.error(`[remoteControl] transient error: ${u(e)}`),process.exitCode=He)}finally{process.off(`SIGTERM`,l),process.off(`SIGINT`,l)}}export{Ue as runDaemonWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tt as e,bt as t}from"./loadAgentsDir-C7lOqvfh.js";e();export{t as execIntoTmuxWorktree};
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{l as e,o as t}from"./chunks/envUtils-
|
|
2
|
+
import{l as e,o as t}from"./chunks/envUtils-BDhHQY0-.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(),t(),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:``}),e(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(`0.0.10 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-D4FBdEQr.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-oIqjxIjQ.js`);await e();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-C07BcZIw.js`);await n(t);return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-CVHMRMwd.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-DgZ3YY4a.js`);r();let{initSinks:i}=await import(`./chunks/sinks-BJHgxz6Y.js`);i();let{daemonMain:a}=await import(`./chunks/main-CvOv59-7.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-C1aSgWPQ.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-CVHMRMwd.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-DgZ3YY4a.js`);r(),await(await import(`./chunks/bg-50rllUNh.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-CVHMRMwd.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-DgZ3YY4a.js`);i();let{initSinks:a}=await import(`./chunks/sinks-BJHgxz6Y.js`);a();let{daemonMain:o}=await import(`./chunks/main-CvOv59-7.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-CrNPEKkh.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-CrNPEKkh.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-CVHMRMwd.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-dFUkhVE_.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.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-BEjRkAtH.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-9r5gLzUW.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,t as u,vn as d,y as f,yn as p}from"./src-CDCSSo0U2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{Bp as h,Jp as g,L as _,Pw as v,R as y,im as b,qp as x,rm as S,z as C,zp as w}from"./loadAgentsDir-ByO8eJqU.js";import{r as T,t as E}from"./directoryCompletion-BagQcynj.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-D1cH9sDX.js";function k(){return(0,P.jsx)(o,{dimColor:!0,children:`Claude Code will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(a,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(o,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:s,selectedSuggestion:c}){return(0,P.jsxs)(a,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:`Enter the path to the directory:`}),(0,P.jsx)(a,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(S,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),s.length>0&&(0,P.jsx)(a,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:s,selectedSuggestion:c})}),i&&(0,P.jsx)(o,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[l,u]=(0,N.useState)(``),[d,m]=(0,N.useState)(null),[h,g]=(0,N.useState)([]),[v,y]=(0,N.useState)(0),b=(0,N.useMemo)(()=>F,[]),S=p((0,N.useCallback)(async e=>{if(!e){g([]),y(0);return}let t=await E(e);g(t),y(0)},[]),100);(0,N.useEffect)(()=>{S(l)},[l,S]);let T=(0,N.useCallback)(e=>{let t=e.id+`/`;u(t),m(null)},[]),D=(0,N.useCallback)(async t=>{let r=await C(t,n);r.resultType===`success`?e(r.absolutePath,!1):m(_(r))},[n,e]);c(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(h.length>0){if(e.key===`tab`){e.preventDefault();let t=h[v];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=h[v];t&&D(t.id+`/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),y(e=>e<=0?h.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),y(e=>e>=h.length-1?0:e+1);return}}},[h,v,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(a,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(f,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(s,{children:[(0,P.jsx)(i,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(i,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(x,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(w,{options:b,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(a,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:l,onChange:u,onSubmit:D,error:d,suggestions:h,selectedSuggestion:v})]})})})}var N,P,F,I=e((()=>{n(),l(),N=t(l(),1),d(),y(),b(),u(),v(),T(),g(),h(),D(),P=m(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{R as e,fi as t,t as n}from"./src-CDCSSo0U2.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{_v as i,gv as a}from"./loadAgentsDir-ByO8eJqU.js";import{b as o,c as s,g as c}from"./config-CE058cvr.js";import{n as l}from"./onChangeAppState-BmfM5g-D.js";import{t as u}from"./fpsMetrics-Cf_hdtiJ.js";import{t as d}from"./stats-Duk7_xjQ.js";t(),i(),n(),c();var f=r();function p({getFpsMetrics:t,stats:n,initialState:r,children:i}){return(0,f.jsx)(u,{getFpsMetrics:t,children:(0,f.jsx)(d,{store:n,children:(0,f.jsx)(a,{initialState:r,onChangeAppState:l,children:(0,f.jsx)(e,{initialState:s().theme,onThemeSave:e=>o(t=>({...t,theme:e})),children:i})})})})}export{p as App};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Rp as a,zp as o}from"./loadAgentsDir-ByO8eJqU.js";import{b as s,g as c}from"./config-CE058cvr.js";t(),n(),c(),a();var l=i();function u({customApiKeyTruncated:t,onDone:n}){function i(e){switch(e){case`yes`:s(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,approved:[...e.customApiKeyResponses?.approved??[],t]}})),n(!0);break;case`no`:s(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,rejected:[...e.customApiKeyResponses?.rejected??[],t]}})),n(!1);break}}return(0,l.jsxs)(r,{title:`Detected a custom API key in your environment`,color:`warning`,onCancel:()=>i(`no`),children:[(0,l.jsxs)(e,{children:[(0,l.jsx)(e,{bold:!0,children:`ANTHROPIC_API_KEY`}),(0,l.jsxs)(e,{children:[`: sk-ant-...`,t]})]}),(0,l.jsx)(e,{children:`Do you want to use this API key?`}),(0,l.jsx)(o,{defaultValue:`no`,defaultFocusValue:`no`,options:[{label:`Yes`,value:`yes`},{label:(0,l.jsxs)(e,{children:[`No (`,(0,l.jsx)(e,{bold:!0,children:`recommended`}),`)`]}),value:`no`}],onChange:e=>i(e),onCancel:()=>i(`no`)})]})}export{u as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./ApproveApiKey-CEIfuUh0.js";export{e as ApproveApiKey};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gt as s,H as c,I as l,Lt as u,P as d,T as f,fi as p,mt as m,ot as h,t as g,y as _}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{$s as y,Ad as b,An as x,Bp as S,Bu as C,Ff as ee,Fw as te,Gf as w,Hu as T,If as E,Iw as ne,Kp as re,Ld as ie,Lf as D,Mn as ae,Pw as O,Qs as oe,Rd as se,Up as k,Vf as ce,_u as A,_v as le,bv as ue,co as de,eo as fe,fw as pe,gu as me,hl as he,hp as j,hv as ge,hy as _e,jd as ve,ma as ye,ml as be,mp as xe,mv as Se,nf as Ce,pw as we,tc as Te,tf as Ee,vu as De,vv as Oe,vy as ke,xw as Ae,yu as je,za as Me,zp as Ne}from"./loadAgentsDir-ByO8eJqU.js";import{F as Pe,p as Fe,v as Ie,z as Le}from"./debug-RZ4NuXyS.js";import{In as M,Ln as Re,Rn as ze,Ut as Be}from"./settings-hQDLwPVj.js";import{d as Ve,p as He,u as Ue,w as We,x as N,y as P}from"./startupProfiler-DCn_NxMH.js";import{l as F,o as Ge}from"./stringUtils-B6FudhoZ.js";import{bn as Ke,wt as qe,xn as Je,yn as Ye}from"./prompt-B7joRiqj.js";import{i as Xe,n as Ze}from"./mappers-CHRFic5q.js";function I(e,t,n=1e3,r=0,i){let a=()=>Ue(Math.max(0,(i??Date.now())-e-r));return(0,Qe.useSyncExternalStore)((0,Qe.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var Qe,L=t((()=>{Qe=n(p(),1),P()}));function $e(e,t,n){let r=Ye(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,et.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var et,tt=t((()=>{p(),g(),Je(),et=v()}));function nt(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 rt(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 it(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!j(t)||process.env.USER_TYPE===`ant`&&Te(t)))return n=!0,!1;return n}var at=t((()=>{i(),y(),xe()}));function ot({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=c(),a=(0,st.useMemo)(()=>be(Ke()),[]),u=I(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);s({"confirm:yes":t},{context:`Confirmation`});let p=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},m=Me(e.prompt,`plan`),h=e.prompt.length>300?e.prompt.substring(0,297)+`…`:e.prompt,g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,R.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:p,children:(0,R.jsx)(_,{title:(0,R.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,R.jsxs)(d,{children:[e.status!==`running`&&(0,R.jsxs)(d,{color:rt(e.status),children:[nt(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,R.jsxs)(d,{dimColor:!0,children:[u,g!==void 0&&g>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,He(g),` tokens`]}),v!==void 0&&v>0&&(0,R.jsxs)(R.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,R.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,R.jsxs)(f,{children:[r&&(0,R.jsx)(o,{shortcut:`←`,action:`go back`}),(0,R.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,R.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,R.jsxs)(l,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,R.jsxs)(l,{flexDirection:`column`,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,R.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,$e(t,a,i)]},n))]}),m?(0,R.jsx)(l,{marginTop:1,children:(0,R.jsx)(ie,{addMargin:!1,planContent:m})}):(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,R.jsx)(d,{wrap:`wrap`,children:h})]}),e.status===`failed`&&e.error&&(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,R.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var st,R,ct=t((()=>{st=n(p(),1),L(),g(),O(),Je(),he(),P(),fe(),se(),tt(),at(),R=v()}));function lt(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 ut({text:e,phase:t=0}){return(0,z.jsx)(z.Fragment,{children:[...e].map((e,n)=>(0,z.jsx)(d,{color:b(n+t),children:e},n))})}function dt(e,t,n){let r=(0,mt.useRef)(e),i=(0,mt.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 ft({session:e}){let t=ge().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=m(r&&!t?ht:null),a=n?.bugsFound??0,o=n?.bugsVerified??0,s=n?.bugsRefuted??0,c=t||!r,l=dt(a,i,c),u=dt(o,i,c),f=dt(s,i,c),p=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)(ut,{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)(ut,{text:`ultrareview`,phase:0}),(0,z.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?lt(n.stage,l,u,f):`setting up`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,z.jsx)(ut,{text:`ultrareview`,phase:r?p:0}),(0,z.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function pt({session:e}){if(e.isRemoteReview)return(0,z.jsx)(ft,{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=M(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,z.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var mt,z,ht,gt=t((()=>{mt=n(p(),1),Be(),Se(),g(),Re(),ve(),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 _t({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,vt=t((()=>{g(),V=v()}));function yt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,H.jsxs)(d,{children:[N(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,H.jsx)(_t,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,H.jsx)(d,{children:(0,H.jsx)(pt,{session:e})}):(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),N(e.title,n,!0),(0,H.jsx)(d,{dimColor:!0,children:` · `}),(0,H.jsx)(pt,{session:e})]});case`local_agent`:return(0,H.jsxs)(d,{children:[N(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,H.jsxs)(d,{children:[N(t.workflowName??e.summary??e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`running`?`${t.agentCount} ${F(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:[N(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} ${F(t,`file`)}`:`${e.sessionsReviewing} ${F(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,bt=t((()=>{p(),g(),P(),Ge(),Be(),gt(),vt(),H=v()}));function xt({task:e,onDone:t,onBack:n,onKill:r}){let i=I(e.startTime,e.status===`running`,1e3,0);s({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},c=e.turns.filter(e=>e.text!==``),u=c.slice(-6),p=c.length-u.length;return(0,U.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,U.jsx)(_,{title:`Memory consolidation`,subtitle:(0,U.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,F(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,F(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(f,{children:[n&&(0,U.jsx)(o,{shortcut:`←`,action:`go back`}),(0,U.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,U.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,U.jsxs)(d,{children:[(0,U.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,U.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,U.jsx)(d,{color:`success`,children:e.status}):(0,U.jsx)(d,{color:`error`,children:e.status})]}),u.length===0?(0,U.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,U.jsxs)(U.Fragment,{children:[p>0&&(0,U.jsxs)(d,{dimColor:!0,children:[`(`,p,` earlier `,F(p,`turn`),`)`]}),u.map((e,t)=>(0,U.jsxs)(l,{flexDirection:`column`,children:[(0,U.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,U.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,F(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var U,St=t((()=>{p(),L(),g(),O(),Ge(),U=v()}));function Ct({stage:e,completed:t,hasProgress:n}){let r=e?Dt.indexOf(e):-1,i=!t&&!n;return(0,G.jsxs)(d,{children:[i?(0,G.jsx)(d,{color:`background`,children:`Setup`}):(0,G.jsx)(d,{dimColor:!0,children:`Setup`}),(0,G.jsx)(d,{dimColor:!0,children:` → `}),Dt.map((e,n)=>{let a=!t&&!i&&n===r;return(0,G.jsxs)(W.Fragment,{children:[n>0&&(0,G.jsx)(d,{dimColor:!0,children:` → `}),a?(0,G.jsx)(d,{color:`background`,children:Ot[e]}):(0,G.jsx)(d,{dimColor:!0,children:Ot[e]})]},e)}),t&&(0,G.jsx)(d,{color:`success`,children:` ✓`})]})}function wt(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} ${F(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return lt(t.stage,t.bugsFound,n,r)}function Tt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[s,c]=(0,W.useState)(!1),p=I(e.startTime,a,1e3,0,e.endTime),m=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??m,g=E(e.sessionId),v=i?`ready`:a?`running`:e.status;if(s)return(0,G.jsx)(_,{title:`Stop ultrareview?`,onCancel:()=>c(!1),color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded.`}),(0,G.jsx)(Ne,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):c(!1)}})]})});let y=i?[{label:`Open in Claude Code on the web`,value:`open`},{label:`Dismiss`,value:`dismiss`}]:[{label:`Open in Claude Code on the web`,value:`open`},...r&&a?[{label:`Stop ultrareview`,value:`stop`}]:[],{label:`Back`,value:`back`}];return(0,G.jsx)(_,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultrareview`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,p,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[(0,G.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,G.jsx)(o,{shortcut:`Esc`,action:`go back`})]}),children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(Ct,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsx)(d,{children:wt(e)}),(0,G.jsx)(u,{url:g,children:(0,G.jsx)(d,{dimColor:!0,children:g})})]}),(0,G.jsx)(Ne,{options:y,onChange:e=>{switch(e){case`open`:we(g),t();break;case`stop`:c(!0);break;case`back`:h();break;case`dismiss`:m();break}}})]})})}function Et({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,s]=(0,W.useState)(!1),[c,p]=(0,W.useState)(null),m=(0,W.useMemo)(()=>e.isRemoteReview?[]:de(Xe(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isRemoteReview)return(0,G.jsx)(Tt,{session:e,onDone:n,onBack:r,onKill:i});let h=()=>n(`Remote session details dismissed`,{display:`system`}),g=e=>{e.key===` `?(e.preventDefault(),n(`Remote session details dismissed`,{display:`system`})):e.key===`left`&&r?(e.preventDefault(),r()):e.key===`t`&&!a?(e.preventDefault(),v()):e.key===`return`&&(e.preventDefault(),h())};async function v(){s(!0),p(null);try{await w(e.sessionId)}catch(e){p(Pe(e))}finally{s(!1)}}let y=We(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,G.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,G.jsxs)(_,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[r&&(0,G.jsx)(o,{shortcut:`←`,action:`go back`}),(0,G.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,G.jsx)(o,{shortcut:`t`,action:`teleport`})]}),children:[(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,G.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,G.jsx)(d,{color:`success`,children:b}):(0,G.jsx)(d,{color:`error`,children:b})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Runtime`}),`: `,Ue((e.endTime??Date.now())-e.startTime)]}),(0,G.jsxs)(d,{wrap:`truncate-end`,children:[(0,G.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,G.jsx)(pt,{session:e})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,G.jsx)(u,{url:E(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:E(e.sessionId)})})]})]}),e.log.length>0&&(0,G.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,G.jsx)(l,{flexDirection:`column`,height:10,overflowY:`hidden`,children:m.map((e,n)=>(0,G.jsx)(C,{message:e,lookups:ye,addMargin:n>0,tools:t.options.tools,commands:t.options.commands,verbose:t.options.verbose,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,style:`condensed`,isTranscriptMode:!1,isStatic:!0},n))}),(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,m.length,` of `,e.log.length,` messages`]})})]}),c&&(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{color:`error`,children:[`Teleport failed: `,c]})}),a&&(0,G.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var W,G,Dt,Ot,kt=t((()=>{W=n(p(),1),Be(),L(),g(),D(),qe(),pe(),Le(),P(),Ze(),fe(),Ge(),ce(),S(),T(),gt(),G=v(),Dt=[`finding`,`verifying`,`synthesizing`],Ot={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function At(e){let t=x(e.id);try{let e=await Ie(t,Nt);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function jt({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=h(),[a,c]=(0,K.useState)(()=>At(e)),u=(0,K.useDeferredValue)(a);(0,K.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(At(t)),1e3,c,e);return()=>clearInterval(t)},[e.id,e.status]);let p=()=>t(`Shell details dismissed`,{display:`system`});s({"confirm:yes":p},{context:`Confirmation`});let m=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},g=e.kind===`monitor`,v=We(e.command,280);return(0,q.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:m,children:(0,q.jsxs)(_,{title:g?`Monitor details`:`Shell details`,onCancel:p,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(f,{children:[r&&(0,q.jsx)(o,{shortcut:`←`,action:`go back`}),(0,q.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,q.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:[(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,q.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,q.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Runtime:`}),` `,Ue((e.endTime??Date.now())-e.startTime)]}),(0,q.jsxs)(d,{wrap:`wrap`,children:[(0,q.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsx)(d,{bold:!0,children:`Output:`}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,q.jsx)(Mt,{outputPromise:u,columns:i})})]})]})})}function Mt({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,K.use)(e);if(!n)return(0,q.jsx)(d,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
|
|
2
|
-
`,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(l,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,q.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,q.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${Ve(r)}`:``]})]})}var K,q,Nt,Pt=t((()=>{K=n(p(),1),Ae(),g(),O(),P(),Fe(),ae(),q=v(),Nt=8192})),Ft=t((()=>{g()})),It=t((()=>{g()})),Lt=t((()=>{g()})),Rt=r({MonitorMcpDetailDialog:()=>zt});function zt({task:e,onBack:t,onKill:n}){let r=I(e.startTime,e.status===`running`,1e3,0);return s({},{context:`MonitorMcpDetail`}),(0,J.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:r=>{r.key===`left`&&t?(r.preventDefault(),t()):r.key===`x`&&e.status===`running`&&n&&(r.preventDefault(),n())},children:(0,J.jsx)(_,{title:`MCP Monitor`,subtitle:(0,J.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,J.jsxs)(f,{children:[t&&(0,J.jsx)(o,{shortcut:`←`,action:`go back`}),(0,J.jsx)(o,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,J.jsx)(d,{color:`ansi:green`,children:e.status}):(0,J.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var J,Bt=t((()=>{p(),L(),g(),O(),Ft(),It(),Lt(),J=v()}));function Vt(e,t){return Object.values(e??{}).filter(j).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Ht({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=Oe(e=>e.tasks),i=Oe(e=>e.foregroundedTaskId),a=ue(),c=ne(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),u=r,p=(0,X.useRef)(!1),[m,h]=(0,X.useState)(()=>{if(n)return p.current=!0,{mode:`detail`,itemId:n};let e=Vt(u,i);return e.length===1?(p.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[g,v]=(0,X.useState)(0);re(`background-tasks-dialog`);let{bashTasks:y,remoteSessions:b,agentTasks:x,workflowTasks:S,mcpMonitors:C,dreamTasks:te,allSelectableItems:w}=(0,X.useMemo)(()=>{let e=Object.values(u??{}).filter(j).map(Ut).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`remote_agent`),r=e.filter(e=>e.type===`local_agent`&&e.id!==i),a=e.filter(e=>e.type===`local_workflow`),o=e.filter(e=>e.type===`monitor_mcp`),s=e.filter(e=>e.type===`dream`);return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:a,mcpMonitors:o,dreamTasks:s,allSelectableItems:[...t,...o,...n,...r,...a,...s]}},[u,i]),T=w[g]??null;s({"confirm:previous":()=>v(e=>Math.max(0,e-1)),"confirm:next":()=>v(e=>Math.min(w.length-1,e+1)),"confirm:yes":()=>{let e=w[g];e&&h({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:m.mode===`list`});let E=t=>{if(m.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=w[g];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?ie(n.id):n.type===`local_agent`&&n.status===`running`?D(n.id):n.type===`local_workflow`&&n.status===`running`&&Q?Q(n.id,a):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,a):n.type===`dream`&&n.status===`running`?ae(n.id):n.type===`remote_agent`&&n.status===`running`&&O(n.id))};async function ie(e){await _e.kill(e,a)}async function D(e){await oe.kill(e,a)}async function ae(e){await De.kill(e,a)}async function O(e){await ee.kill(e,a)}let se=(0,X.useEffectEvent)(e);(0,X.useEffect)(()=>{if(m.mode!==`list`){let e=(u??{})[m.itemId];(!e||e.type!==`local_workflow`&&!j(e))&&(p.current?se(`Background tasks dialog dismissed`,{display:`system`}):h({mode:`list`}))}let e=w.length;g>=e&&e>0&&v(e-1)},[m,u,g,w,se]);let k=()=>{p.current&&w.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(p.current=!1,h({mode:`list`}))};if(m.mode!==`list`&&u){let n=u[m.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Z.jsx)(jt,{shell:n,onDone:e,onKillShell:()=>void ie(n.id),onBack:k},`shell-${n.id}`);case`local_agent`:return(0,Z.jsx)(ot,{agent:n,onDone:e,onKillAgent:()=>void D(n.id),onBack:k},`agent-${n.id}`);case`remote_agent`:return(0,Z.jsx)(Et,{session:n,onDone:e,toolUseContext:t,onBack:k,onKill:n.status===`running`?()=>void O(n.id):void 0},`session-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&Q?()=>Q(n.id,a):void 0;return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),k()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Z.jsx)(_,{title:n.workflowName,subtitle:(0,Z.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:k,inputGuide:()=>(0,Z.jsxs)(f,{children:[(0,Z.jsx)(o,{shortcut:`←`,action:`go back`}),(0,Z.jsx)(o,{shortcut:`Esc`,action:`close`}),e&&(0,Z.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Wt?(0,Z.jsx)(Wt,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,a):void 0,onBack:k},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Z.jsx)(xt,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:k,onKill:n.status===`running`?()=>void ae(n.id):void 0},`dream-${n.id}`)}}let ce=M(y,e=>e.status===`running`),A=M(b,e=>e.status===`running`||e.status===`pending`)+M(x,e=>e.status===`running`),le=ze([...ce>0?[(0,Z.jsxs)(d,{children:[ce,` `,ce===1?`active shell`:`active shells`]},`shells`)]:[],...A>0?[(0,Z.jsxs)(d,{children:[A,` `,A===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Z.jsx)(d,{children:` · `},`separator-${e}`)),de=[(0,Z.jsx)(o,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Z.jsx)(o,{shortcut:`Enter`,action:`view`},`enter`),...(T?.type===`local_bash`||T?.type===`local_agent`||T?.type===`local_workflow`||T?.type===`monitor_mcp`||T?.type===`dream`||T?.type===`remote_agent`)&&T.status===`running`?[(0,Z.jsx)(o,{shortcut:`x`,action:`stop`},`kill`)]:[],...x.some(e=>e.status===`running`)?[(0,Z.jsx)(o,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Z.jsx)(o,{shortcut:`←/Esc`,action:`close`},`esc`)],fe=()=>e(`Background tasks dialog dismissed`,{display:`system`});function pe(e){return e.pending?(0,Z.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(f,{children:de})}return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:E,children:(0,Z.jsx)(_,{title:`Background tasks`,subtitle:(0,Z.jsx)(Z.Fragment,{children:le}),onCancel:fe,color:`background`,inputGuide:pe,children:w.length===0?(0,Z.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Z.jsxs)(l,{flexDirection:`column`,children:[y.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,children:[(b.length>0||x.length>0)&&(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,y.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:y.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),C.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,C.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:C.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),b.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,b.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:b.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),x.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,x.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:x.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),S.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,S.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:S.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),te.length>0&&(0,Z.jsx)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0||S.length>0),children:(0,Z.jsx)(l,{flexDirection:`column`,children:te.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})})]})})})}function Ut(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.kind===`monitor`?e.description:e.command,status:e.status,task:e};case`remote_agent`:return{id:e.id,type:`remote_agent`,label:e.title,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`monitor_mcp`:return{id:e.id,type:`monitor_mcp`,label:e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function Y({item:e,isSelected:t}){let{columns:n}=h(),r=Math.max(30,n-26);return(0,Z.jsxs)(l,{flexDirection:`row`,children:[(0,Z.jsx)(d,{children:t?a.pointer+` `:` `}),(0,Z.jsx)(d,{color:t?`suggestion`:void 0,children:(0,Z.jsx)(yt,{task:e.task,maxActivityWidth:r})})]})}var X,Z,Q,$,Wt,Gt=t((()=>{i(),X=n(p(),1),Ae(),le(),je(),y(),ke(),D(),xe(),Re(),k(),g(),O(),te(),ct(),bt(),St(),kt(),Pt(),Z=v(),Q=(A(),e(me))?.killWorkflowTask??null,$=(Ce(),e(Ee))?.killMonitorMcp??null,Wt=(Bt(),e(Rt)).MonitorMcpDetailDialog}));export{L as a,it as i,Gt as n,I as o,at as r,Ht as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,fi as i,kt as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Jm as l,Rp as u,qm as d,zp as f}from"./loadAgentsDir-ByO8eJqU.js";import{g as p,x as m}from"./settings-hQDLwPVj.js";import{n as h,r as g}from"./analytics-CkYUHW_U.js";var _=e(i(),1);h(),o(),l(),p(),u();var v=c();function y({onAccept:e}){let[i,o]=_.useState(null);_.useEffect(()=>{if(i!==null){let e=i,t=setTimeout(()=>d(e));return()=>clearTimeout(t)}},[i]),_.useEffect(()=>{g(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:g(`tengu_bypass_permissions_mode_dialog_accept`,{}),m(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let l=(0,_.useCallback)(()=>{o(0)},[]);return i===null?(0,v.jsxs)(s,{title:`WARNING: Claude Code running in Bypass Permissions mode`,color:`error`,onCancel:l,children:[(0,v.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(r,{children:[`In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(a,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(r,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(n,{url:`https://code.claude.com/docs/en/security`})]}),(0,v.jsx)(f,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Rp as l,zp as u}from"./loadAgentsDir-ByO8eJqU.js";import{g as d,y as f}from"./config-CE058cvr.js";import{n as p,r as m}from"./analytics-CkYUHW_U.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:a}){g.useEffect(()=>{m(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(m(`tengu_claude_md_external_includes_dialog_declined`,{}),f(e=>({...e,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!0}))):(m(`tengu_claude_md_external_includes_dialog_accepted`,{}),f(e=>({...e,hasClaudeMdExternalIncludesApproved:!0,hasClaudeMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(s,{title:`Allow external CLAUDE.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's CLAUDE.md imports files outside the current working directory. Never allow this for third-party repositories.`}),a&&a.length>0&&(0,_.jsxs)(n,{flexDirection:`column`,children:[(0,_.jsx)(i,{dimColor:!0,children:`External imports:`}),a.map((e,t)=>(0,_.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Important: Only use Claude Code with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(r,{url:`https://code.claude.com/docs/en/security`}),` `]}),(0,_.jsx)(u,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var g,_,v=e((()=>{g=t(a(),1),p(),o(),d(),l(),_=c()}));export{v as n,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./ClaudeMdExternalIncludesDialog-C-CTa-95.js";e();export{t as ClaudeMdExternalIncludesDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{nm as e,tm as t}from"./loadAgentsDir-ByO8eJqU.js";e();export{t as ConsoleOAuthFlow};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{C as i,Gt as a,I as o,P as s,T as c,fi as l,ot as u,t as d,y as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Fw as m,Iw as ee,Kp as te,Pw as h,Up as g,ev as _,tv as v,xw as y}from"./loadAgentsDir-ByO8eJqU.js";import{n as b,t as x}from"./cwd-C5ce-7WB.js";import{An as S,Cn as C}from"./settings-hQDLwPVj.js";import{l as w,m as T,p as E,s as D}from"./git-BerW9bId.js";import{r as O,t as k}from"./execFileNoThrow-CCX-JY8h.js";import{C as ne,y as re}from"./startupProfiler-DCn_NxMH.js";import{l as A,o as j}from"./stringUtils-B6FudhoZ.js";import{i as ie}from"./detectRepository-CFiHe6Rv.js";import{join as ae,resolve as M}from"path";import{access as N}from"fs/promises";async function oe(){if(!await w()||await P())return null;let{stdout:e,code:t}=await k(E(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:F,preserveOutputOnError:!1});if(t===0){let t=de(e);if(t&&t.filesCount>z)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await k(E(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=ce(n),o=I-a.size;if(o>0){let e=await ue(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function se(){if(!await w()||await P())return new Map;let{stdout:e,code:t}=await k(E(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?le(e):new Map}function ce(e){let t=e.trim().split(`
|
|
2
|
-
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function le(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
|
|
3
|
-
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(``+t),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function P(){let e=await D(x());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>N(ae(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function ue(e){let{stdout:t,code:n}=await k(E(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:F,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
|
|
4
|
-
`).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function de(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var F,I,L,R,z,B=e((()=>{b(),ie(),O(),C(),T(),F=5e3,I=50,L=1e6,R=400,z=500}));function V(){let[e,t]=(0,H.useState)(null),[n,r]=(0,H.useState)(new Map),[i,a]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([oe(),se()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(l(),1),B(),U=400}));function W(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 pe(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:n.slice(0,29)+`…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(!(!r||r.type!==`user`)){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(W(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&&pe(e)){let t=e.content.split(`
|
|
5
|
-
`),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+`+e)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=me(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var K,_e=e((()=>{K=t(l(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:c}){let{columns:l}=u(),{firstLine:d,fileContent:f}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=S(M(x(),e));return{firstLine:t?.split(`
|
|
6
|
-
`)[0]??null,fileContent:t??void 0}},[e]);return c?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),(0,J.jsx)(s,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(s,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(o,{children:(0,J.jsx)(s,{bold:!0,children:e})}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(o,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(s,{bold:!0,children:e}),a&&(0,J.jsx)(s,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(i,{padding:4}),(0,J.jsx)(o,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(s,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(_,{patch:t,filePath:e,firstLine:d,fileContent:f,dim:!1,width:l-2-2},n))}),a&&(0,J.jsx)(s,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(l(),1),y(),d(),b(),C(),v(),J=p()}));function be({files:e,selectedIndex:t}){let{columns:n}=u(),{startIndex:r,endIndex:i}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(s,{dimColor:!0,children:`No changed files`});let a=e.slice(r,i),c=r>0,l=i<e.length,d=e.length>Z,f=Math.max(20,n-16-3-4);return(0,X.jsxs)(o,{flexDirection:`column`,children:[d&&(0,X.jsx)(s,{dimColor:!0,children:c?` ↑ ${r} more ${A(r,`file`)}`:` `}),a.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:f},e.path)),d&&(0,X.jsx)(s,{dimColor:!0,children:l?` ↓ ${e.length-i} more ${A(e.length-i,`file`)}`:` `})]})}function xe({file:e,isSelected:t,maxPathWidth:n}){let i=ne(e.path,n),a=`${t?r.pointer+` `:` `}${i}`;return(0,X.jsxs)(o,{flexDirection:`row`,children:[(0,X.jsx)(s,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(o,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(s,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(s,{children:[e.linesAdded>0&&(0,X.jsxs)(s,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(s,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(s,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(l(),1),y(),d(),re(),j(),X=p(),Z=5}));function we(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function Te({messages:e,onDone:t}){let n=V(),r=ge(e),[i,l]=(0,Q.useState)(`list`),[u,d]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[p],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[u],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{p>=h.length&&m(Math.max(0,h.length-1))},[h.length,p]);let x=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{x.current!==p&&(d(0),x.current=p)},[p]),te(`diff-dialog`),a({"diff:previousSource":()=>{i===`detail`?l(`list`):i===`list`&&h.length>1&&m(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&h.length>1&&m(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{i===`detail`&&l(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&l(`detail`)},"diff:previousFile":()=>{i===`list`&&d(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&d(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(s,{dimColor:!0,children:[v.stats.filesCount,` `,A(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(s,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(s,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,T=h.length>1?(0,$.jsxs)(o,{children:[p>0&&(0,$.jsx)(s,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(s,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<h.length-1&&(0,$.jsx)(s,{dimColor:!0,children:` ▶`})]}):null,E=ee(`diff:dismiss`,`DiffDialog`,`esc`),D=v.loading?`Loading diff…`:_?`No file changes in this turn`:v.stats&&v.stats.filesCount>0&&v.files.length===0?`Too many files to display details`:`Working tree is clean`,O=(0,$.jsxs)(s,{children:[C,w&&(0,$.jsxs)(s,{dimColor:!0,children:[` `,w]})]});function k(){i===`detail`?l(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(f,{title:O,onCancel:k,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(s,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[h.length>1&&(0,$.jsx)(s,{children:`←/→ source`}),(0,$.jsx)(s,{children:`↑/↓ select`}),(0,$.jsx)(s,{children:`Enter view`}),(0,$.jsxs)(s,{children:[E,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(s,{children:`← back`}),(0,$.jsxs)(s,{children:[E,` close`]})]}),children:[T,S,v.files.length===0?(0,$.jsx)(o,{marginTop:1,children:(0,$.jsx)(s,{dimColor:!0,children:D})}):i===`list`?(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:u})}):(0,$.jsx)(o,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(ve,{filePath:y?.path||``,hunks:b,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(l(),1),g(),fe(),_e(),d(),h(),m(),j(),ye(),Ce(),$=p()}))();export{Te as DiffDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./Doctor-lhUBhEy5.js";e();export{t as Doctor};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Gt as o,I as s,P as c,fi as l,t as u,x as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as p,tt as ee}from"./state-C2OSZkV1.js";import{Bw as m,Gg as h,Gv as te,Hv as g,Hw as _,Hx as v,Kg as y,Pw as b,Rx as x,SE as S,TE as C,Uv as w,Uw as T,Vv as E,Vw as D,Vx as ne,Wv as re,Wx as ie,_D as ae,_v as oe,du as se,fa as ce,lu as le,pa as O,uu as k,vD as A,vv as j}from"./loadAgentsDir-ByO8eJqU.js";import{Cn as M,H as N,On as P,g as F,n as I,z as L}from"./settings-hQDLwPVj.js";import{l as R,o as z}from"./stringUtils-B6FudhoZ.js";import{Kn as B,Un as V,_ as H,u as U}from"./model-CwO-g1RW.js";import{n as W,t as ue}from"./ValidationErrorsList-DokTJQwi.js";import{d as de,f as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,u as G}from"./pidLock-DJnS_38v.js";import{a as ye,i as be}from"./xdg-DcF9ejUM.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import{n as Ce,t as we}from"./McpParsingWarnings-BS4JoR5l.js";import{n as Te,t as Ee}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{n as De,t as Oe}from"./useSettingsErrors-CAJR_wpd.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-C86PTj1m.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-B5U5c9PE.js";import{join as q}from"path";function Ne(){if(!T())return null;let e=m();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(c,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`Location: `}),(0,J.jsx)(c,{dimColor:!0,children:D()})]}),(0,J.jsxs)(s,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`error`,children:`[Error]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{l(),u(),_(),J=f()}));function Fe(){if(!S.isSupportedPlatform()||!S.isSandboxEnabledInSettings())return null;let e=S.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(s,{flexDirection:`column`,children:[(0,Y.jsx)(c,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(c,{children:[`└ Status: `,(0,Y.jsx)(c,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(c,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(c,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(c,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{l(),u(),C(),Y=f()}));async function Le(){let e=ne(await v());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 > ${x.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${x.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:x}}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:O(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 h(e,t,n,U());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+O(((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:S.isSandboxingEnabled()&&S.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${N(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${R(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((()=>{ce(),y(),ie(),H(),L(),ke(),C(),Me(),z(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(c,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(c,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(c,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=j(e=>e.agentDefinitions),r=j(e=>e.mcp.tools),i=j(e=>e.toolPermissionContext),l=j(e=>e.plugins.errors);xe();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(null),x=De(),S=(0,Q.useMemo)(()=>G().then(e=>(e.installationType===`native`?fe:he)().catch(()=>({latest:null,stable:null}))),[]),C=I()?.autoUpdatesChannel??`latest`,w=x.filter(e=>e.mcpErrorMetadata===void 0),T=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:E,upperLimit:g},{name:`TASK_MAX_OUTPUT_LENGTH`,default:le,upperLimit:k},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...V(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=te(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{G().then(p),(async()=>{let e=q(n(),`agents`),r=q(ee(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([P(e),P(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s};h(d);let f=await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(v(f),_e()){let e=q(be(),`claude`,`locks`),t=ge(e),n=ve(e);b({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else b({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let D=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return o({"confirm:yes":D,"confirm:no":D},{context:`Confirmation`}),f?(0,$.jsxs)(d,{children:[(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(c,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(c,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(c,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(c,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(c,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(c,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.ripgrepStatus.note&&(0,$.jsxs)(c,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsxs)(c,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
|
|
2
|
-
`)[0]]}),(0,$.jsx)(c,{dimColor:!0,children:f.recommendation.split(`
|
|
3
|
-
`)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsx)(c,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),f.warnings.map((e,t)=>(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsxs)(c,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(c,{children:[`Fix: `,e.fix]})]},t))]}),w.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(c,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(ue,{errors:w})]})]}),(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Updates`}),(0,$.jsxs)(c,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(c,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(c,{children:[`└ Auto-update channel: `,C]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:S})})]}),(0,$.jsx)(Fe,{}),(0,$.jsx)(we,{}),(0,$.jsx)(Ne,{}),T.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Environment Variables`}),T.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(c,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),y?.enabled&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Version Locks`}),y.staleLocksCleaned>0&&(0,$.jsxs)(c,{dimColor:!0,children:[`└ Cleaned `,y.staleLocksCleaned,` stale lock(s)`]}),y.locks.length===0?(0,$.jsx)(c,{dimColor:!0,children:`└ No active version locks`}):y.locks.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(c,{children:`(running)`}):(0,$.jsx)(c,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),l.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ `,l.length,` plugin error(s) detected:`]}),l.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ae(e)]},t))]}),_?.unreachableRulesWarning&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.unreachableRulesWarning.message]})]}),_.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_&&(_.claudeMdWarning||_.agentWarning||_.mcpWarning)&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Context Usage Warnings`}),_.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.claudeMdWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Files:`]}),_.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.agentWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Top contributors:`]}),_.agentWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.mcpWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ MCP servers:`]}),_.mcpWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(s,{children:(0,$.jsx)(Ee,{})})]}):(0,$.jsx)(d,{children:(0,$.jsx)(c,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(l(),1),Pe(),Ce(),B(),r(),p(),u(),Te(),Ie(),W(),Oe(),Se(),b(),oe(),A(),pe(),Ve(),de(),re(),M(),me(),F(),w(),se(),ye(),$=f()}));export{We as n,Ue as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Bp as l,Ct as u,Ei as d,Et as f,HT as p,Jm as m,Km as h,Mv as g,Ot as _,RE as v,UT as y,dp as b,gt as x,jr as S,jv as C,kt as w,pp as T,zE as E,zp as D}from"./loadAgentsDir-ByO8eJqU.js";import{a as O,l as k}from"./debug-RZ4NuXyS.js";import{r as A,t as j}from"./execFileNoThrow-CCX-JY8h.js";import{n as M,r as N}from"./analytics-CkYUHW_U.js";function P(){(S(),e(d)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,a]=(0,I.useState)(`loading`),[o,c]=(0,I.useState)([]),[l,d]=(0,I.useState)(0),[f,m]=(0,I.useState)(),h=u();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await j(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
|
-
`).filter(e=>e.trim()!==``),c(e)),h){let{stdout:t}=await j(`git`,[`rev-list`,`--count`,`${h.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(d(n),e.length===0&&n===0){a(`removing`),x().then(()=>{process.chdir(h.originalCwd),g(h.originalCwd),P(),p.cache.clear?.(),m(`Worktree removed (no changes)`)}).catch(e=>{k(`Failed to clean up worktree: ${e}`,{level:`error`}),m(`Worktree cleanup failed, exiting anyway`)}).then(()=>{a(`done`)});return}else a(`asking`)}}e()},[h]),(0,I.useEffect)(()=>{n===`done`&&e(f)},[n,e,f]),!h)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function v(e){if(!h)return;let t=!!h.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),await _(),process.chdir(h.originalCwd),g(h.originalCwd),P(),p.cache.clear?.(),m(t?`Worktree kept. Your work is saved at ${h.worktreePath} on branch ${h.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${h.tmuxSessionName}`:`Worktree kept. Your work is saved at ${h.worktreePath} on branch ${h.worktreeBranch}`),a(`done`);else if(e===`keep-kill-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),h.tmuxSessionName&&await w(h.tmuxSessionName),await _(),process.chdir(h.originalCwd),g(h.originalCwd),P(),p.cache.clear?.(),m(`Worktree kept at ${h.worktreePath} on branch ${h.worktreeBranch}. Tmux session terminated.`),a(`done`);else if(e===`remove`||e===`remove-with-tmux`){a(`removing`),N(`tengu_worktree_removed`,{commits:l,changed_files:o.length}),h.tmuxSessionName&&await w(h.tmuxSessionName);try{await x(),process.chdir(h.originalCwd),g(h.originalCwd),P(),p.cache.clear?.()}catch(e){k(`Failed to clean up worktree: ${e}`,{level:`error`}),m(`Worktree cleanup failed, exiting anyway`),a(`done`);return}let e=t?` Tmux session terminated.`:``;l>0&&o.length>0?m(`Worktree removed. ${l} ${l===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):l>0?m(`Worktree removed. ${l} ${l===1?`commit`:`commits`} on ${h.worktreeBranch} ${l===1?`was`:`were`} discarded.${e}`):o.length>0?m(`Worktree removed. Uncommitted changes were discarded.${e}`):m(`Worktree removed.${e}`),a(`done`)}}if(n===`keeping`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(b,{}),(0,L.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(b,{}),(0,L.jsx)(i,{children:`Removing worktree…`})]});let y=h.worktreeBranch,S=o.length>0,C=l>0,T=``;T=S&&C?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${l} ${l===1?`commit`:`commits`} on ${y}. All will be lost if you remove.`:S?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:C?`You have ${l} ${l===1?`commit`:`commits`} on ${y}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}v(`keep`)}let O=S||C?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!h.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${h.worktreePath}. Reattach with: tmux attach -t ${h.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${h.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${h.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(s,{title:`Exiting worktree session`,subtitle:T,onCancel:E,children:(0,L.jsx)(D,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:v})})}var I,L,R=t((()=>{I=n(a(),1),M(),O(),o(),A(),y(),C(),f(),l(),T(),L=c()}));function z(){return E(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await h(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{v(),a(),m(),R(),V=c(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
|