@readmagic/workmate 0.0.8 → 0.0.9
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-qFZy3FOD.js +1 -0
- package/dist/chunks/App-DW4elk6E.js +1 -0
- package/dist/chunks/ApproveApiKey-D05WywHU.js +1 -0
- package/dist/chunks/ApproveApiKey-DHAbdwkC.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BuRFF1fQ.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CDrArsSX.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +1 -0
- package/dist/chunks/DiffDialog-BIcwpgSr.js +6 -0
- package/dist/chunks/Doctor-D160J8Ad.js +3 -0
- package/dist/chunks/Doctor-VhJi2cmL.js +1 -0
- package/dist/chunks/ExitFlow-CoWHhKHJ.js +2 -0
- package/dist/chunks/Grove-BmirUB6V.js +11 -0
- package/dist/chunks/{HybridTransport-BJPOG2wl.js → HybridTransport-BVmSUHf0.js} +1 -1
- package/dist/chunks/InvalidConfigDialog-WRywkKeS.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-C4n3A72C.js +1 -0
- package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +1 -0
- package/dist/chunks/MCPToolListView-BPmE0C2o.js +1 -0
- package/dist/chunks/McpParsingWarnings-CH4yyMAL.js +1 -0
- package/dist/chunks/MessageSelector-kOn2GaU-.js +3 -0
- package/dist/chunks/Messages-4EnHFeh1.js +11 -0
- package/dist/chunks/Onboarding-BboWs1pp.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-BpC9COmh.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +1 -0
- package/dist/chunks/QueryEngine-J6ElcO16.js +1 -0
- package/dist/chunks/REPL-DBjbAJsm.js +133 -0
- package/dist/chunks/REPL-oBemMXvp.js +1 -0
- package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +2 -0
- package/dist/chunks/ResumeConversation-wBG8OD9P.js +1 -0
- package/dist/chunks/{SSETransport-CrwbKuVt.js → SSETransport-1KBBUikF.js} +1 -1
- package/dist/chunks/{SearchBox-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +1 -0
- package/dist/chunks/Settings-DptKuJE7.js +2 -0
- package/dist/chunks/TeleportProgress-BmgPAZAi.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-sgxNOeM_.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-GptvrUdv.js +1 -0
- package/dist/chunks/ThemePicker-gAMqqD1P.js +1 -0
- package/dist/chunks/{TrustDialog-BukWGvHZ.js → TrustDialog-CWt-4Evl.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-DokTJQwi.js → ValidationErrorsList-De3kzHtz.js} +1 -1
- package/dist/chunks/{WelcomeV2-Ci9VwPYh.js → WelcomeV2-BWF-cJOu.js} +1 -1
- package/dist/chunks/add-dir-DBVT1cEK.js +1 -0
- package/dist/chunks/{agentDisplay-DBQYOaOh.js → agentDisplay-5gnCQwUY.js} +1 -1
- package/dist/chunks/{agents-HlKk68Qc.js → agents-Bz1MLp4A.js} +1 -1
- package/dist/chunks/agents-CnwTOlqO.js +103 -0
- package/dist/chunks/allErrors-DYw_q14e.js +1 -0
- package/dist/chunks/analytics-DJobLaWP.js +1 -0
- package/dist/chunks/api-DXDXTFGa.js +1 -0
- package/dist/chunks/{api-CF5IVtj0.js → api-DzccRM_z.js} +1 -1
- package/dist/chunks/auth-Cjnyy10u.js +15 -0
- package/dist/chunks/auth-CnLb6RWc.js +1 -0
- package/dist/chunks/auth-D-SGHS0K.js +1 -0
- package/dist/chunks/{autoMode-Cr0AhS1G.js → autoMode-CQ5nqP9c.js} +4 -4
- package/dist/chunks/{autonomy-ARUQt-Lu.js → autonomy-CPUCe-YU.js} +1 -1
- package/dist/chunks/autonomy-dSJl0hN1.js +15 -0
- package/dist/chunks/{autonomyPanel-BQK9MoeB.js → autonomyPanel-Ccr9ilei.js} +1 -1
- package/dist/chunks/backgroundHousekeeping--cs5crp7.js +17 -0
- package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +1 -0
- package/dist/chunks/{banner-Ca7rki2V.js → banner-BJZNMppT.js} +1 -1
- package/dist/chunks/bg-DWloqGwk.js +1 -0
- package/dist/chunks/{bg-DxRHF1yn.js → bg-w3Vlsm3Y.js} +2 -2
- package/dist/chunks/branch-CG0AKS1J.js +3 -0
- package/dist/chunks/{break-cache-BKvoMOZx.js → break-cache-DXV0brco.js} +2 -2
- package/dist/chunks/bridgeConfig-Dmc1ZDev.js +1 -0
- package/dist/chunks/{bridgeConfig-jDEva6Eh.js → bridgeConfig-vORehbGG.js} +1 -1
- package/dist/chunks/{bridgeMessaging-YqYdl6ej.js → bridgeMessaging-DlczTV9X.js} +1 -1
- package/dist/chunks/{bridgePointer-DIM0sj0x.js → bridgePointer-D4W9GpWw.js} +1 -1
- package/dist/chunks/btw-DDUC_t0w.js +1 -0
- package/dist/chunks/caches-1IFb6_M_.js +1 -0
- package/dist/chunks/caches-CB8MHqy2.js +1 -0
- package/dist/chunks/{capacityWake-CKOiRELo.js → capacityWake-L7b1mMft.js} +1 -1
- package/dist/chunks/{ccrClient-BC2q3k44.js → ccrClient-CG6HTv_n.js} +1 -1
- package/dist/chunks/{claudeDesktop-DQXL5bGm.js → claudeDesktop-CAmnheYx.js} +1 -1
- package/dist/chunks/{clear-1etSJhdg.js → clear-DdWexxbM.js} +1 -1
- package/dist/chunks/{cliLaunch-CQjLYRzM.js → cliLaunch-BWWOgBFh.js} +1 -1
- package/dist/chunks/{client-DQwf_b9o.js → client-CoXtVRzi.js} +1 -1
- package/dist/chunks/client-Crrwkw7g.js +1 -0
- package/dist/chunks/client-D8hKghba.js +1 -0
- package/dist/chunks/color-Cuq0c6xy.js +1 -0
- package/dist/chunks/commands-D3sESsTp.js +1 -0
- package/dist/chunks/compact-DIpwuBDq.js +2 -0
- package/dist/chunks/config-CVvUNkj2.js +1 -0
- package/dist/chunks/config-D4G8_MqJ.js +3 -0
- package/dist/chunks/config-q9D4hFiK.js +1 -0
- package/dist/chunks/context-BWcfhhDj.js +1 -0
- package/dist/chunks/context-noninteractive-Bwt9A3XD.js +1 -0
- package/dist/chunks/{context-noninteractive-Ct_ttQfP.js → context-noninteractive-c7jGVWHQ.js} +2 -2
- package/dist/chunks/conversation-Bjo_8kia.js +1 -0
- package/dist/chunks/conversation-DrHZIQX2.js +1 -0
- package/dist/chunks/{createSSHSession-BmHXA2me.js → createSSHSession-DP7B8yvb.js} +1 -1
- package/dist/chunks/{createSession-C4rukWkv.js → createSession-CPo6GBSb.js} +1 -1
- package/dist/chunks/createSession-DnykRoia.js +1 -0
- package/dist/chunks/crossProjectResume-D2A-qjgP.js +40 -0
- package/dist/chunks/cwd--q1ONL7P.js +1 -0
- package/dist/chunks/{cwd-C5ce-7WB.js → cwd-L4wygFqJ.js} +1 -1
- package/dist/chunks/{daemon-ZtpTZWgQ.js → daemon-D2vFIVOz.js} +1 -1
- package/dist/chunks/datadog-DrmHyl3_.js +1 -0
- package/dist/chunks/{debug-RZ4NuXyS.js → debug-BdqxZ7rV.js} +4 -4
- package/dist/chunks/{debugUtils-D30M1cbN.js → debugUtils-CezNYZ-4.js} +1 -1
- package/dist/chunks/{detached-jrVP11oU.js → detached-CkPpYMJj.js} +1 -1
- package/dist/chunks/detectRepository-DA1Q_Skc.js +1 -0
- package/dist/chunks/{detectRepository-CFiHe6Rv.js → detectRepository-DvxoaPlk.js} +1 -1
- package/dist/chunks/{diff-BKiK3xHv.js → diff-DHzz9WAp.js} +1 -1
- package/dist/chunks/directoryCompletion-D5AvL7TF.js +1 -0
- package/dist/chunks/doctor-PWqB46xd.js +1 -0
- package/dist/chunks/entry-4JtoJONR.js +14 -0
- package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
- package/dist/chunks/{esm-BLPbfHQd.js → esm-DcIr7tVd.js} +1 -1
- package/dist/chunks/{execFileNoThrow-CCX-JY8h.js → execFileNoThrow-5SylUnAI.js} +1 -1
- package/dist/chunks/{execSyncWrapper-dhRSYGFW.js → execSyncWrapper-DKuxVTaf.js} +1 -1
- package/dist/chunks/exit-OW9g7b9A.js +1 -0
- package/dist/chunks/extraUsage-Dt5mw35U.js +1 -0
- package/dist/chunks/extractMemories-1VlmCGwa.js +1 -0
- package/dist/chunks/fast-ClYQcEv5.js +1 -0
- package/dist/chunks/fast-CrvLdpy3.js +1 -0
- package/dist/chunks/fileSuggestions-fNxREjpe.js +3 -0
- package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +1 -0
- package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +5 -0
- package/dist/chunks/{flushGate-Cnsu4HET.js → flushGate-ch-Tvwjj.js} +1 -1
- package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
- package/dist/chunks/{gemini-Cudre91e.js → gemini-fZ0VPU2A.js} +1 -1
- package/dist/chunks/generateRecap-BIBVlB__.js +1 -0
- package/dist/chunks/generateSessionName-nZj_VvKZ.js +1 -0
- package/dist/chunks/{genericProcessUtils-DVfMHhfy.js → genericProcessUtils-BmDSLcMf.js} +1 -1
- package/dist/chunks/{git-BerW9bId.js → git-B9uvt96d.js} +1 -1
- package/dist/chunks/git-BfS5Hk4S.js +1 -0
- package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +1 -0
- package/dist/chunks/goal-IasZVqKh.js +3 -0
- package/dist/chunks/grok-Dk3LyzMa.js +1 -0
- package/dist/chunks/grove-BE4fQ6tG.js +7 -0
- package/dist/chunks/help-D2-v9Ug9.js +1 -0
- package/dist/chunks/{hooks-BZJTWD07.js → hooks-BrKy5XWQ.js} +2 -2
- package/dist/chunks/hooks-DGd02IKF.js +1 -0
- package/dist/chunks/initReplBridge-RhCAlmHE.js +1 -0
- package/dist/chunks/{install-BI---dv0.js → install-CVGZ55wV.js} +1 -1
- package/dist/chunks/{instrumentation-CcWzhGfE.js → instrumentation-BmWotlxR.js} +4 -4
- package/dist/chunks/{job-B0ftcqPF.js → job-DEXxW_Zo.js} +1 -1
- package/dist/chunks/{jwtUtils-C0cE-1Ey.js → jwtUtils-C9sdGhvT.js} +1 -1
- package/dist/chunks/keybindings-BRdSOSUD.js +2 -0
- package/dist/chunks/language-C0cIpKE2.js +1 -0
- package/dist/chunks/{language-s-dLbdVz.js → language-CxThoWRC.js} +1 -1
- package/dist/chunks/launchLocalMemory-CLSSVFoj.js +3 -0
- package/dist/chunks/launchOnboarding-BkJfKviO.js +8 -0
- package/dist/chunks/loadAgentsDir-8UprzS4w.js +1 -0
- package/dist/chunks/{loadAgentsDir-ByO8eJqU.js → loadAgentsDir-CKSb56Gp.js} +673 -759
- package/dist/chunks/loadPluginHooks-LbaURHVH.js +1 -0
- package/dist/chunks/{localSearch-CHHCH16D.js → localSearch-CPOnyi8I.js} +1 -1
- package/dist/chunks/localSearch-DNjbr4S9.js +1 -0
- package/dist/chunks/{log-CZ0zYP_c.js → log-CTFl4qpD.js} +1 -1
- package/dist/chunks/logoV2Utils-we1sfJvf.js +1 -0
- package/dist/chunks/{magicDocs-C5i5ruuU.js → magicDocs-DmKlTQvK.js} +3 -3
- package/dist/chunks/main-BIiwW4mM.js +605 -0
- package/dist/chunks/{main-BLD4QAQg.js → main-ClXu1ilx.js} +2 -2
- package/dist/chunks/{managedEnv-C-9XSN14.js → managedEnv-Cl7YbYzf.js} +1 -1
- package/dist/chunks/managedEnv-CpiiQx_v.js +1 -0
- package/dist/chunks/{mappers-CHRFic5q.js → mappers-xQC-Z4-h.js} +1 -1
- package/dist/chunks/mcp-B_m1XBDt.js +6 -0
- package/dist/chunks/mcp-BiyfH9Sd.js +1 -0
- package/dist/chunks/mcp-BjlaPUWX.js +2 -0
- package/dist/chunks/{memoize-B8hfb1JN.js → memoize-FJv2HV1u.js} +1 -1
- package/dist/chunks/memory-LN8f_p2b.js +1 -0
- package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
- package/dist/chunks/mode-lYTs0XHs.js +2 -0
- package/dist/chunks/model-C2e73CJD.js +1 -0
- package/dist/chunks/model-CvmS-Esk.js +1 -0
- package/dist/chunks/model-DJ8mFfuR.js +1 -0
- package/dist/chunks/modelOptions-efCGKnXT.js +1 -0
- package/dist/chunks/nativeInstaller-DQIFwdat.js +1 -0
- package/dist/chunks/oauth-BN2I0_jl.js +1 -0
- package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
- package/dist/chunks/omit-CLPZGevl.js +1 -0
- package/dist/chunks/onChangeAppState-DhBO34OK.js +1 -0
- package/dist/chunks/{openai-DPH6rXOZ.js → openai-DJLYqiRl.js} +2 -2
- package/dist/chunks/{panel-mD094ALT.js → panel-q0_iT9cg.js} +1 -1
- package/dist/chunks/panelCall-sum-3zvi.js +1 -0
- package/dist/chunks/parser-BcdhBGx0.js +1 -0
- package/dist/chunks/{parser-dbHRgXb8.js → parser-BdCj2GrE.js} +1 -1
- package/dist/chunks/partition-CpfoVrg1.js +1 -0
- package/dist/chunks/permissions-DTb9wkAP.js +3 -0
- package/dist/chunks/pidLock-BR5M6RQw.js +3 -0
- package/dist/chunks/{pipeTransport-DVOKR4c_.js → pipeTransport-B3TIkTAp.js} +1 -1
- package/dist/chunks/plan-BeoIjNPv.js +1 -0
- package/dist/chunks/{platform-DCXXznJg.js → platform-D6IMiyqT.js} +1 -1
- package/dist/chunks/plugin-D_dHjTud.js +17 -0
- package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +1 -0
- package/dist/chunks/pluginBlocklist-D93Hd1GF.js +1 -0
- package/dist/chunks/pluginCliCommands-vv0wNt4O.js +1 -0
- package/dist/chunks/{pluginFlagging-pBxSselw.js → pluginFlagging-CxuRF2Vc.js} +1 -1
- package/dist/chunks/pluginOperations-BTq4AjYB.js +2 -0
- package/dist/chunks/{pluginStartupCheck-Di4LjHXf.js → pluginStartupCheck-B6leNWq9.js} +1 -1
- package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +1 -0
- package/dist/chunks/plugins-pmipe7kE.js +4 -0
- package/dist/chunks/{poorMode-CYXmr_mU.js → poorMode-BxsyllUK.js} +1 -1
- package/dist/chunks/poorMode-iV1NwC5L.js +1 -0
- package/dist/chunks/print-CAUvczBM.js +23 -0
- package/dist/chunks/processBashCommand-CdeQg_c6.js +1 -0
- package/dist/chunks/processSlashCommand-CbkshIC6.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-CybUvG8G.js +139 -0
- package/dist/chunks/prompt-RBn4JdEg.js +1 -0
- package/dist/chunks/prompt-Rb8zXlDo.js +1 -0
- package/dist/chunks/promptEditor-0Ug93P2I.js +4 -0
- package/dist/chunks/{protocolHandler-RNKkhq91.js → protocolHandler-ClfbHTjI.js} +1 -1
- package/dist/chunks/{proxy-BmtEnJ02.js → proxy-Blq4W6Ox.js} +1 -1
- package/dist/chunks/reconciler-Drq3HSkj.js +4 -0
- package/dist/chunks/refresh-D8TLHO_T.js +1 -0
- package/dist/chunks/{registerProtocol-DoKqmqu2.js → registerProtocol-3_ozAuDK.js} +1 -1
- package/dist/chunks/reload-plugins-Dn1ibOiI.js +1 -0
- package/dist/chunks/{remoteBridgeCore-Cddqv2WW.js → remoteBridgeCore-Dpg6Se9C.js} +1 -1
- package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +1 -0
- package/dist/chunks/rename-CKsSc7Z3.js +1 -0
- package/dist/chunks/{renderOptions-ChLwxtVu.js → renderOptions-CLcco6fc.js} +1 -1
- package/dist/chunks/replBridgeHandle-DNC797_T.js +1 -0
- package/dist/chunks/resume-B1a5gLVR.js +2 -0
- package/dist/chunks/ripgrep-BisRODQ2.js +1 -0
- package/dist/chunks/{ripgrep-gaT9Njwi.js → ripgrep-DkL2S7-I.js} +1 -1
- package/dist/chunks/{runtimeObserver-CsIwinzh.js → runtimeObserver-B0xfyLiA.js} +1 -1
- package/dist/chunks/{runtimeObserver-Dbxxw4ls.js → runtimeObserver-DonWCJOx.js} +4 -4
- package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +1 -0
- package/dist/chunks/sandbox-toggle-CSdnHWp-.js +1 -0
- package/dist/chunks/searchExtraTools-DbgfnQkH.js +1 -0
- package/dist/chunks/session-BbQlh2S5.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +1 -0
- package/dist/chunks/sessionMemory-7UOFdp29.js +1 -0
- package/dist/chunks/sessionMemory-fAzgAS7Q.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +1 -0
- package/dist/chunks/sessionObserver-Cl26OdaW.js +1 -0
- package/dist/chunks/{sessionObserver-DoYc0ZOP.js → sessionObserver-XV6N0XER.js} +2 -2
- package/dist/chunks/{sessionState-CjNY991n.js → sessionState-BvECKycx.js} +1 -1
- package/dist/chunks/sessionStorage-DSj9yZkl.js +1 -0
- package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
- package/dist/chunks/sessionTitle-E1FvsKM9.js +14 -0
- package/dist/chunks/sessionTracing-ClGQ08jM.js +11 -0
- package/dist/chunks/settings-B-R9ZJNY.js +1 -0
- package/dist/chunks/settings-Xbq6AaD-.js +20 -0
- package/dist/chunks/settingsSync-NCN0a4sc.js +1 -0
- package/dist/chunks/setup-uZ0dSekt.js +3 -0
- package/dist/chunks/shadowedRuleDetection-B9iSx6mB.js +1 -0
- package/dist/chunks/{shellQuote-BUVKMu_P.js → shellQuote-Bth6IZgX.js} +1 -1
- package/dist/chunks/{sideQuestion-C780iYwd.js → sideQuestion-D2dPToW8.js} +3 -3
- package/dist/chunks/sinks-C7q46rvE.js +2 -0
- package/dist/chunks/sinks-D3bXeHlQ.js +1 -0
- package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +1 -0
- package/dist/chunks/{skillGapStore-Dc1arohs.js → skillGapStore-DylpOKJ6.js} +2 -2
- package/dist/chunks/{skillLifecycle-DP6mY1Kp.js → skillLifecycle-GK-8eyyn.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CpLTImaL.js → skillSearchPanel-mpaC62y4.js} +4 -4
- package/dist/chunks/skills-t6krW8GZ.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-BaiXZ9tr.js +1 -0
- package/dist/chunks/{startupProfiler-DCn_NxMH.js → startupProfiler-jeId9f2i.js} +2 -2
- package/dist/chunks/state-B4HwLt8i.js +1 -0
- package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
- package/dist/chunks/state-Bs5xweDL.js +1 -0
- package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
- package/dist/chunks/{stats-Duk7_xjQ.js → stats-BJBhl-Lc.js} +1 -1
- package/dist/chunks/{status-peiVB_2j.js → status-BtsnKNVY.js} +1 -1
- package/dist/chunks/status-nZQEar7T.js +2 -0
- package/dist/chunks/{statusNoticeHelpers-B5U5c9PE.js → statusNoticeHelpers-DMqRGFOh.js} +1 -1
- package/dist/chunks/{stringUtils-B6FudhoZ.js → stringUtils-CbS6OkmE.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-BAMqSX7Z.js → switcher-77h2J5HC.js} +1 -1
- package/dist/chunks/switcher-B2CYzCC_.js +1 -0
- package/dist/chunks/{syncCache-Zl9kZRRl.js → syncCache-By_-buUC.js} +1 -1
- package/dist/chunks/tasks-BNrdmF9p.js +1 -0
- package/dist/chunks/teleport-mdnhIZBj.js +1 -0
- package/dist/chunks/{templateJobs-DR5fKFiO.js → templateJobs-Dkv4I9c1.js} +1 -1
- package/dist/chunks/{terminalSetup-DgRBt-JJ.js → terminalSetup-DQopnSPR.js} +1 -1
- package/dist/chunks/terminalSetup-DTGm1Eo2.js +33 -0
- package/dist/chunks/{theme-Bz6esfST.js → theme-BjpBVRf5.js} +1 -1
- package/dist/chunks/{tmux-DSU9tYIo.js → tmux-CMRiI6CD.js} +1 -1
- package/dist/chunks/{toolEventObserver-BSekCkM2.js → toolEventObserver-D-sNBvOe.js} +1 -1
- package/dist/chunks/toolPool-Di30gn_Y.js +1 -0
- package/dist/chunks/trustedDevice-CupLMpO8.js +1 -0
- package/dist/chunks/{trustedDevice-B0x9X0fb.js → trustedDevice-j1u2TG5U.js} +1 -1
- package/dist/chunks/{types-D7_37tP2.js → types-DWRxAH0E.js} +1 -1
- package/dist/chunks/{udsClient-CHoMMH28.js → udsClient-Cm3HqYUu.js} +1 -1
- package/dist/chunks/{updateCCB-D_kGQKPT.js → updateCCB-BlUAU2Vp.js} +8 -8
- package/dist/chunks/{upstreamproxy-Hmq-n8fw.js → upstreamproxy-DDVMwoRi.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-D2FvHieH.js +1 -0
- package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +1 -0
- package/dist/chunks/useManagePlugins-BbWJNLe8.js +1 -0
- package/dist/chunks/useMergedTools-B-Z9XQ6U.js +1 -0
- package/dist/chunks/useSearchInput-C6d6nt9S.js +1 -0
- package/dist/chunks/useSettingsErrors-DKh4rkGi.js +1 -0
- package/dist/chunks/{userAgent-BxTG7IMk.js → userAgent-Ng_TTjWr.js} +1 -1
- package/dist/chunks/util-D-X8i5Z2.js +1 -0
- package/dist/chunks/validatePlugin-DSw08u76.js +1 -0
- package/dist/chunks/vim-3mUqsEJm.js +1 -0
- package/dist/chunks/{which-CHLNJmtJ.js → which-DznMOwny.js} +1 -1
- package/dist/chunks/windowsPaths-1mgenSWa.js +1 -0
- package/dist/chunks/{windowsPaths-o62uq6LF.js → windowsPaths-BVztIhXM.js} +1 -1
- package/dist/chunks/{workSecret-DG9shvG0.js → workSecret-DtiFreRl.js} +1 -1
- package/dist/chunks/workerRegistry-DdOYjLm3.js +6 -0
- package/dist/chunks/worktree-BX1ULzrw.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/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/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/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/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/entry-BzL1MFQG.js +0 -14
- package/dist/chunks/envUtils-DSxRz_kt.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/fileSuggestions-Dyu2kQtE.js +0 -3
- package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +0 -5
- package/dist/chunks/firstPartyEventLogger-LsNY6yOt.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/keybindings-DZU3vwo3.js +0 -2
- package/dist/chunks/language-DHhXLb_Y.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/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/plan-Brg9XnRr.js +0 -1
- package/dist/chunks/plugin-CRwa39Y1.js +0 -17
- package/dist/chunks/pluginAutoupdate-D0LIP7cy.js +0 -1
- package/dist/chunks/pluginBlocklist-PwHHD3nj.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/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/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/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/validatePlugin-AHl-g4ct.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-BdqxZ7rV.js";import{o as _,s as v}from"./log-CTFl4qpD.js";import{n as y,t as b}from"./memoize-FJv2HV1u.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-BdqxZ7rV.js";import{o as u}from"./log-CTFl4qpD.js";import{a as d,i as f}from"./genericProcessUtils-BmDSLcMf.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};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`);let a=await x();if(!a){process.stderr.write(
|
|
1
|
+
import{ff as e,uf as t}from"./loadAgentsDir-CKSb56Gp.js";import{di as n,ui as r}from"./src-P_wYS_NJ2.js";import{a as i,l as a}from"./debug-BdqxZ7rV.js";import{n as o,o as s}from"./process-gEbdy6uY.js";import{n as c,r as l}from"./execFileNoThrow-5SylUnAI.js";import{l as u,u as d}from"./ripgrep-DkL2S7-I.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.9`}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
3
|
`),process.stderr.write(`Unable to fetch latest version from npm registry.
|
|
4
|
-
`),await
|
|
5
|
-
`),await
|
|
6
|
-
`)}catch(e){process.stderr.write(
|
|
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
7
|
`),process.stderr.write(`${e}\n`),process.stderr.write(`
|
|
8
8
|
`),process.stderr.write(`Try manually updating with:
|
|
9
|
-
`),i===`bun`?process.stderr.write(
|
|
10
|
-
`):process.stderr.write(
|
|
11
|
-
`),await
|
|
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-BdqxZ7rV.js";import{c as l,h as u,l as d,m as f,s as p}from"./proxy-Blq4W6Ox.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{Ew as n,kd as r}from"./loadAgentsDir-CKSb56Gp.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(),r()}));function f(e,t,n){return l(i,t,e,n)}var p=e((()=>{n(),d()}));export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ov as t,sv as n}from"./loadAgentsDir-CKSb56Gp.js";import{C as r,_ as i,s as a}from"./model-C2e73CJD.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{Eo as t,Fp as n,Fs as r,Ip as i,Is as a,KC as o,Ls as s,Np as c,Ps as l,To as u,cf as d,jp as f,lf as p,lv as m,mg as h,ov as g,pg as _,qC as v,sv as y}from"./loadAgentsDir-CKSb56Gp.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-BdqxZ7rV.js";import{In as T,Ln as E}from"./settings-Xbq6AaD-.js";import{O as D,k as O}from"./git-B9uvt96d.js";import{o as k,s as A}from"./log-CTFl4qpD.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-CxuRF2Vc.js";import{t as F}from"./pluginBlocklist-D93Hd1GF.js";var I=e(b(),1);d(),j(),f(),g(),E(),S(),D(),w(),k(),a(),r(),_(),n(),o(),P(),u();function L({enabled:e=!0}={}){let n=m(),r=y(e=>e.plugins.needsRefresh),{addNotification:a}=p(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:r,errors:o}=await t();await F();let u=N();Object.keys(u).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let d=[],f=[];try{d=await l()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{f=await s()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await h()}catch(e){let t=e instanceof Error?e.message:String(e);o.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let p=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await v(e,o);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await i(e,o);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);c(),n(t=>{let n=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(o.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),a=[...n.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...o];return{...t,plugins:{...t.plugins,enabled:e,disabled:r,commands:d,errors:a}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${r.length}, Commands: ${d.length}, Agents: ${f.length}, Errors: ${o.length}`);let g=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:r.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:o.length,skill_count:d.length,agent_count:f.length,hook_count:g,mcp_count:p,lsp_count:m}}catch(e){let t=x(e);return A(t),C(`Error loading plugins: ${e}`),n(e=>{let n=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:t.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...n,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}}},[n,a]);(0,I.useEffect)(()=>{e&&o().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)})},[o,e]),(0,I.useEffect)(()=>{!e||!r||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,a])}export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{cl as n,fl as r}from"./loadAgentsDir-CKSb56Gp.js";import{fi as i}from"./src-P_wYS_NJ2.js";import{n as a,t as o}from"./toolPool-Di30gn_Y.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{Ad as n,Bd as r,Id as i,Ld as a,Md as o,Rd as s,Vd as c,jd as l,pw as u,zd as d}from"./loadAgentsDir-CKSb56Gp.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:o,onExitUp:u,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=n.fromText(T,w,D);if(!(f.ctrl&&g.includes(f.key.toLowerCase()))){if(_(f)||s(),v(f)||d(),f.key===`return`||f.key===`down`){f.preventDefault(),t();return}if(f.key===`up`){f.preventDefault(),u&&u();return}if(f.key===`escape`){f.preventDefault(),o?o():T.length>0?(E(``),O(0)):t();return}if(f.key===`backspace`){if(f.preventDefault(),f.meta){let{cursor:e,killed:t}=p.deleteWordBefore();i(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(o??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){(o??t)();return}let e=p.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(o??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=p.deleteToLineEnd();i(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=p.deleteToLineStart();i(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=p.deleteWordBefore();i(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=l();if(e.length>0){let t=p.offset,n=p.insert(e);a(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(o){o();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=c();if(e){let{text:t,start:n,length:i}=e,a=T.slice(0,n),o=T.slice(n+i),s=a+t+o,c=n+t.length;r(t.length),E(s),O(c)}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(),o(),u(),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{cf as n,gv as r,hv as i,lf as a}from"./loadAgentsDir-CKSb56Gp.js";import{fi as o}from"./src-P_wYS_NJ2.js";import{B as s,Kt as c}from"./state-Bs5xweDL.js";import{n as l,t as u}from"./allErrors-DYw_q14e.js";function d(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return r((0,f.useCallback)(()=>{let{errors:e}=u();i(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(),i(),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.9`}var n=e((()=>{}));export{n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fu as t,Pu as n,av as r,ov as i}from"./loadAgentsDir-CKSb56Gp.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-C2e73CJD.js";import{t as m}from"./WelcomeV2-BWF-cJOu.js";import{t as h}from"./useManagePlugins-BbWJNLe8.js";import{n as g,t as _}from"./MCPConnectionManager-DPFe4hPh.js";import{n as v}from"./onChangeAppState-DhBO34OK.js";import{cwd as y}from"process";var b=e(s(),1);c(),t(),u(),g(),i(),f();var x=l();async function S(e){d(`tengu_setup_token_command`,{});let t=!p(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-D1MYL1dJ.js`);await new Promise(s=>{e.render((0,x.jsx)(r,{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)(i,{onDone:()=>{s()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-VhJi2cmL.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)(r,{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-uZ0dSekt.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-CVGZ55wV.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{IE as r,LE as i,RE as a,_D as o,gD as s,mD as c,nE as l,pD as ee,rE as u}from"./loadAgentsDir-CKSb56Gp.js";import{p as d}from"./external-CEp-aPkt.js";import{r as f}from"./lazySchema-B4D4qJVE.js";import{C as p,F as m,I as h,S as g,V as _,a as te,d as v,l as y,p as b,w as x,z as S}from"./debug-BdqxZ7rV.js";import{_t as C,gt as w,ht as T,pt as ne,vt as re}from"./settings-Xbq6AaD-.js";import{o as ie,s as E}from"./log-CTFl4qpD.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(l(),H)}async function I(){let e=F();try{let t=p(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return y(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`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>W?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${m(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=l();await v().mkdir(r),await P(n,x(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),y(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){y(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return a(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw a(`install_counts`,U,`failure`,performance.now()-e,r(t)),t}}async function z(){let e=await I();if(e){y(`Using cached install counts`),a(`install_counts`,U,`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 R();await L({version:V,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 E(e),y(`Failed to fetch install counts: ${m(e)}`),null}}function B(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 V,H,U,W,G=e((()=>{n(),te(),S(),b(),ie(),g(),i(),u(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=v(),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=se(t.startsWith(`~`)?t.replace(/^~/,ae()):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(),b()}));function le(e){let t=D.basename(e),n=D.basename(D.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=D.resolve(e),i;try{i=await k(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=D.resolve(e),i;try{i=await k(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:d(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=D.dirname(r),a=D.basename(i)===`.claude-plugin`?D.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await k(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 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 s=a[1]||``,c;try{c=o(s)}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 k(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=ne().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 A(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=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.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`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.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 k(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(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.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 k(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((()=>{f(),S(),c(),g(),s(),re(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z 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-D4G8_MqJ.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-5SylUnAI.js";import{n as r,t as i}from"./execSyncWrapper-DKuxVTaf.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,o as t}from"./windowsPaths-BVztIhXM.js";e();export{t as setShellIfWindows};
|
|
@@ -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-L4wygFqJ.js";import{a,l as o}from"./debug-BdqxZ7rV.js";import{n as s,t as c}from"./memoize-FJv2HV1u.js";import{n as l,t as u}from"./execSyncWrapper-DKuxVTaf.js";import{i as d,o as f}from"./platform-D6IMiyqT.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};
|
|
@@ -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-BdqxZ7rV.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,_t as a,dD as o,fD as s,ld as c}from"./loadAgentsDir-CKSb56Gp.js";import{t as l}from"./src-P_wYS_NJ2.js";import{C as u,F as d,S as f,a as p,l as m,w as h,z as g}from"./debug-BdqxZ7rV.js";import{Ut as _}from"./settings-Xbq6AaD-.js";import{O as v,k as y}from"./git-B9uvt96d.js";import{o as b,s as x}from"./log-CTFl4qpD.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{C as w,l as T,v as E}from"./startupProfiler-jeId9f2i.js";import{Bt as D,Ot as O,_n as k,vn as A}from"./model-C2e73CJD.js";import{i as ee,t as j}from"./sessionIdCompat-DMayYBrf.js";import{n as te}from"./firstPartyEventLogger-DhEPWcit.js";import{t as M}from"./datadog-DrmHyl3_.js";import{n as N,o as P,r as F}from"./debugUtils-CezNYZ-4.js";import{t as I}from"./pollConfig-BgpfHQPJ.js";import{n as L,t as ne}from"./rcDebugLog-CARUIORE.js";import{a as R,i as z,n as B,o as re,r as V,s as H,t as ie}from"./capacityWake-L7b1mMft.js";import{a as ae,i as oe,n as se,r as U,t as ce}from"./workSecret-DtiFreRl.js";import{i as W}from"./trustedDevice-j1u2TG5U.js";import{t as le}from"./jwtUtils-C9sdGhvT.js";import{i as G,n as K,r as q}from"./cliLaunch-BWWOgBFh.js";import{t as J}from"./lib-BlVGipXx.js";import{hostname as Y,tmpdir as ue}from"os";import{dirname as X,join as de,resolve as Z}from"path";import{createWriteStream as fe}from"fs";import{randomUUID as Q}from"crypto";import{spawn as pe}from"child_process";import{createInterface as me}from"readline";t(),g(),f(),v(),b(),S(),E(),k(),s(),M(),te(),i(),ne(),G(),J(),_(),l(),p(),c(),j(),P();var he=10,$=10;function ge(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var _e={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 ve(e,t){let n=_e[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 ye(e,t,n){let r;try{r=u(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=ve(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${xe(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 be(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 xe(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 Se(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(X(e.debugFile),`bridge-transcript-${r}.jsonl`),a=fe(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 l=pe(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${l.pid}`);let d=[],f=null,p=[],m=!1,g=!1;l.stderr&&me({input:l.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(t+`
|
|
2
|
+
`),p.length>=$&&p.shift(),p.push(t)}),l.stdout&&me({input:l.stdout}).on(`line`,n=>{a&&a.write(n+`
|
|
3
|
+
`),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${N(n)}`),e.verbose&&process.stderr.write(n+`
|
|
4
|
+
`);let r=ye(n,t.sessionId,e.onDebug);for(let n of r)d.length>=he&&d.shift(),d.push(n),f=n,e.onActivity?.(t.sessionId,n);{let r;try{r=u(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=be(n);e&&(g=!0,t.onFirstUserMessage(e))}}}});let _=new Promise(n=>{l.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${l.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${l.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${l.pid}`),n(`failed`))}),l.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(){l.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGTERM`))},forceKill(){!m&&l.pid&&(m=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${l.pid}`),process.platform===`win32`?l.kill():l.kill(`SIGKILL`))},writeStdin(n){l.stdin&&!l.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${N(n)}`),l.stdin.write(n))},updateAccessToken(n){v.accessToken=n,v.writeStdin(h({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}}}p(),c(),P();var Ce={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},we=1e3;function Te(e){return e.connCapMs*2}function Ee(){let e=[...K()],t=q();return t&&e.push(t),e}function De(e,t,n){try{return e.spawn(t,n)}catch(e){let t=d(e);return x(Error(`Session spawn failed: ${t}`)),t}}async function Oe(t,i,s,c,l,u,f,p=Ce,h,g){let _=new AbortController;f.aborted?_.abort():f.addEventListener(`abort`,()=>_.abort(),{once:!0});let v=_.signal,b=new Map,S=new Map,w=new Map,E=new Map,D=new Map,O=new Map,k=new Set,j=new Map,te=new Set,M=new Set,N=ie(v);async function P(){L(`heartbeat: checking ${b.size} active session(s)`);let e=!1,t=!1,n=[];for(let[r]of b){let a=w.get(r),o=D.get(r);if(!(!a||!o))try{await c.heartbeatWork(i,a,o),e=!0}catch(e){m(`[bridge:heartbeat] Failed for sessionId=${r} workId=${a}: ${d(e)}`),e instanceof B&&(C(`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){u.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await c.reconnectSession(i,e),m(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){u.logError(`Failed to refresh session ${e} token: ${d(t)}`),m(`[bridge:heartbeat] reconnectSession(${e}) failed: ${d(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let ne=new Set,V=g?le({getAccessToken:g,onRefresh:(e,t)=>{let n=b.get(e);n&&(ne.has(e)?(u.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),c.reconnectSession(i,e).catch(t=>{u.logError(`Failed to refresh session ${e} token: ${d(t)}`),m(`[bridge:token] reconnectSession(${e}) failed: ${d(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,H=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;m(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${i}`),y(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),u.printBanner(t,i),u.updateSessionCount(0,t.maxSessions,t.spawnMode),h&&u.setAttached(h);function fe(){u.updateSessionCount(b.size,t.maxSessions,t.spawnMode);for(let[e,t]of b){let n=t.currentActivity;n&&u.updateSessionActivity(E.get(e)??e,n)}if(b.size===0){u.updateIdleStatus();return}let[e,n]=[...b.entries()].pop(),r=S.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&u.refreshDisplay();return}let a=T(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);u.updateSessionStatus(e,a,i,o)}function Q(){pe(),fe(),Z=setInterval(fe,we)}function pe(){Z&&(clearInterval(Z),Z=null)}function me(e,n,a){return o=>{let s=w.get(e);L(`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)`}`),b.delete(e),S.delete(e),w.delete(e),D.delete(e);let l=E.get(e)??e;E.delete(e),u.removeSession(l),M.delete(l),ne.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,A=Date.now()-n;m(`[bridge:session] sessionId=${e} workId=${s??`unknown`} exited status=${g} duration=${T(A)}`),C(`tengu_bridge_session_done`,{status:g,duration_ms:A}),y(`info`,`bridge_session_done`,{status:g,duration_ms:A}),u.clearStatus(),pe();let ee=a.lastStderr.length>0?a.lastStderr.join(`
|
|
6
|
+
`):void 0,P;switch(g){case`completed`:u.logSessionComplete(e,A);break;case`failed`:!h&&!v.aborted&&(P=ee??`Process exited with error`,u.logSessionFailed(e,P),x(Error(`Bridge session failed: ${P}`)));break;case`interrupted`:u.logVerbose(`Session ${e} interrupted`);break}g!==`interrupted`&&s&&(G(Pe(c,i,s,u,p.stopWorkBaseDelayMs)),k.add(s));let F=j.get(e);if(F&&(j.delete(e),G(r(F.worktreePath,F.worktreeBranch,F.gitRoot,F.hookBased).catch(e=>u.logVerbose(`Failed to remove worktree ${F.worktreePath}: ${d(e)}`)))),g!==`interrupted`&&!v.aborted)if(t.spawnMode!==`single-session`)G(c.archiveSession(l).catch(t=>u.logVerbose(`Failed to archive session ${e}: ${d(t)}`))),m(`[bridge:session] Session ${g}, returning to idle (multi-session mode)`);else{m(`[bridge:session] Session ${g}, aborting poll loop to tear down environment`),_.abort();return}v.aborted||Q()}}for(h||Q();!v.aborted;){let f=I();try{L(`poll: envId=${i} activeSessions=${b.size}`);let g=await c.pollForWork(i,s,v,f.reclaim_older_than_ms);if(J!==null||Y!==null){let e=Date.now()-(J??Y??Date.now());u.logReconnected(e),m(`[bridge:poll] Reconnected after ${T(e)}`),C(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(K=0,q=0,J=null,Y=null,X=null,!g){if(b.size>=t.maxSessions){let e=f.multisession_poll_interval_ms_at_capacity;if(f.non_exclusive_heartbeat_interval_ms>0){C(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:b.size,heartbeat_interval_ms:f.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!v.aborted&&b.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=I();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=N.signal();if(r=await P(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await A(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:v.aborted?`shutdown`:b.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:b.size}),a===`poll_due`&&m(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=N.signal();await A(e>0?e:f.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=N.signal();await A(e,t.signal),t.cleanup()}}else await A(b.size>0?f.multisession_poll_interval_ms_partial_capacity:f.multisession_poll_interval_ms_not_at_capacity,v);continue}let _=b.size>=t.maxSessions;if(k.has(g.id)){if(m(`[bridge:work] Skipping already-completed workId=${g.id}`),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await A(1e3,v);continue}let F;try{F=U(g.secret)}catch(e){let t=d(e);if(u.logError(`Failed to decode work secret for workId=${g.id}: ${t}`),C(`tengu_bridge_work_secret_failed`,{}),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs)),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let R=async()=>{m(`[bridge:work] Acknowledging workId=${g.id}`);try{await c.acknowledgeWork(i,g.id,F.session_ingress_token)}catch(e){m(`[bridge:work] Acknowledge failed workId=${g.id}: ${d(e)}`)}},z=g.data.type;switch(g.data.type){case`healthcheck`:await R(),m(`[bridge:work] Healthcheck received`),u.logVerbose(`Healthcheck received`);break;case`session`:{let s=g.data.id;L(`work received: type=session sessionId=${s} workId=${g.id}`);try{re(s,`session_id`)}catch{await R(),u.logError(`Invalid session_id received: ${s}`);break}let f=b.get(s);if(f){f.updateAccessToken(F.session_ingress_token),D.set(s,F.session_ingress_token),w.set(s,g.id),V?.schedule(s,F.session_ingress_token),m(`[bridge:work] Updated access token for existing sessionId=${s} workId=${g.id}`),await R();break}if(b.size>=t.maxSessions){m(`[bridge:work] At capacity (${b.size}/${t.maxSessions}), cannot spawn new session for workId=${g.id}`);break}await R();let _=Date.now(),T,N=!1,P;if(F.use_code_sessions===!0||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){T=ce(t.apiBaseUrl,s);for(let e=1;e<=2;e++)try{P=await oe(T,F.session_ingress_token),N=!0,m(`[bridge:session] CCR v2: registered worker sessionId=${s} epoch=${P} attempt=${e}`);break}catch(t){let n=d(t);if(e<2){if(m(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await A(2e3,v),v.aborted)break;continue}u.logError(`CCR v2 worker registration failed for session ${s}: ${n}`),x(Error(`registerWorker failed: ${n}`)),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs))}if(!N)break}else T=se(t.sessionIngressUrl,s);let I=t.spawnMode,z=t.dir,B=0;if(I===`worktree`&&(h===void 0||!ae(s,h))){let e=Date.now();try{let t=await a(`bridge-${ge(s)}`);B=Date.now()-e,j.set(s,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),z=t.worktreePath,m(`[bridge:session] Created worktree for sessionId=${s} at ${t.worktreePath}`)}catch(e){let t=d(e);u.logError(`Failed to create worktree for session ${s}: ${t}`),x(Error(`Worktree creation failed: ${t}`)),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs));break}}m(`[bridge:session] Spawning sessionId=${s} sdkUrl=${T}`);let H=ee(s);L(`spawning session: sessionId=${s} sdkUrl=${T} useCcrV2=${N} workerEpoch=${P} dir=${z} accessToken=${F.session_ingress_token?F.session_ingress_token.slice(0,8)+`...`:`NONE`}`);let ie=De(l,{sessionId:s,sdkUrl:T,accessToken:F.session_ingress_token,useCcrV2:N,workerEpoch:P,onFirstUserMessage:e=>{if(M.has(H))return;M.add(H);let n=Le(e);u.setSessionTitle(H,n),m(`[bridge:title] derived title for ${H}: ${n}`),import(`./createSession-DnykRoia.js`).then(({updateBridgeSessionTitle:e})=>e(H,n,{baseUrl:t.apiBaseUrl})).catch(e=>m(`[bridge:title] failed to update title for ${H}: ${e}`,{level:`error`}))}},z);if(typeof ie==`string`){u.logError(`Failed to spawn session ${s}: ${ie}`);let e=j.get(s);e&&(j.delete(s),G(r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>u.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${d(t)}`)))),k.add(g.id),G(Pe(c,i,g.id,u,p.stopWorkBaseDelayMs));break}let U=ie,W=Date.now()-_;C(`tengu_bridge_session_started`,{active_sessions:b.size,spawn_mode:I,in_worktree:j.has(s),spawn_duration_ms:W,worktree_create_ms:B,inProtectedNamespace:n()}),y(`info`,`bridge_session_started`,{spawn_mode:I,in_worktree:j.has(s),spawn_duration_ms:W,worktree_create_ms:B}),b.set(s,U),w.set(s,g.id),D.set(s,F.session_ingress_token),E.set(s,H);let le=Date.now();S.set(s,le),u.logSessionStart(s,`Session ${s}`);let K=ge(s),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&&u.logVerbose(`Debug log: ${q}`),u.addSession(H,o(H,t.sessionIngressUrl)),Q(),u.setAttached(H),Re(H,t.apiBaseUrl).then(e=>{e&&b.has(s)&&(M.add(H),u.setSessionTitle(H,e),m(`[bridge:title] server title for ${H}: ${e}`))}).catch(e=>m(`[bridge:title] failed to fetch title for ${H}: ${e}`,{level:`error`}));let J=t.sessionTimeoutMs??864e5;if(J>0){let e=setTimeout(Fe,J,s,J,u,te,U);O.set(s,e)}N&&ne.add(s),V?.schedule(s,F.session_ingress_token),U.done.then(me(s,le,U));break}default:await R(),m(`[bridge:work] Unknown work type: ${z}, skipping`);break}if(_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await P(),await A(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await A(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(v.aborted)break;if(e instanceof B){z(e.errorType)?u.logStatus(e.message):R(e)?m(`[bridge:work] Suppressed 403 error: ${e.message}`):(u.logError(e.message),x(e)),C(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),y(z(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=F(e);if(L(`poll error: ${t} isConn=${Ae(e)} isServer=${je(e)} activeSessions=${b.size}`),Ae(e)||je(e)){let e=Date.now();X!==null&&e-X>Te(p)&&(m(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),y(`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>=p.connGiveUpMs){u.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),y(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n});break}Y=null,q=0,K=K?Math.min(K*2,p.connCapMs):p.connInitialMs;let r=Me(K);u.logVerbose(`Connection error, retrying in ${Ne(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),u.updateReconnectingStatus(Ne(r),T(n)),I().non_exclusive_heartbeat_interval_ms>0&&await P(),await A(r,v)}else{let e=Date.now();X!==null&&e-X>Te(p)&&(m(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),y(`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>=p.generalGiveUpMs){u.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),C(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),y(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n});break}J=null,K=0,q=q?Math.min(q*2,p.generalCapMs):p.generalInitialMs;let r=Me(q);u.logVerbose(`Poll failed, retrying in ${Ne(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),u.updateReconnectingStatus(Ne(r),T(n)),I().non_exclusive_heartbeat_interval_ms>0&&await P(),await A(r,v)}}}pe(),u.clearStatus();let he=Date.now()-H;C(`tengu_bridge_shutdown`,{active_sessions:b.size,loop_duration_ms:he}),y(`info`,`bridge_shutdown`,{active_sessions:b.size,loop_duration_ms:he});let $=new Set(b.keys());h&&$.add(h);let _e=new Map(E);if(b.size>0){m(`[bridge:shutdown] Shutting down ${b.size} active session(s)`),u.logStatus(`Shutting down ${b.size} active session(s)\u2026`);let e=new Map(w);for(let[e,t]of b.entries())m(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...b.values()].map(e=>e.done)),A(p.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of b.entries())m(`[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(),m(`[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=>u.logVerbose(`Failed to stop work ${t} for session ${e}: ${d(n)}`))))}W.size>0&&await Promise.allSettled([...W]),$.size>0&&(m(`[bridge:shutdown] Archiving ${$.size} session(s)`),await Promise.allSettled([...$].map(e=>c.archiveSession(_e.get(e)??ee(e)).catch(t=>u.logVerbose(`Failed to archive session ${e}: ${d(t)}`)))));try{await c.deregisterEnvironment(i),m(`[bridge:shutdown] Environment deregistered, bridge offline`),u.logVerbose(`Environment deregistered.`)}catch(e){u.logVerbose(`Failed to deregister environment: ${d(e)}`)}let{clearBridgePointer:ve}=await import(`./bridgePointer-D4W9GpWw.js`);await ve(t.dir),u.logVerbose(`Environment offline.`)}var ke=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function Ae(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&ke.has(e.code))}function je(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function Me(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function Ne(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function Pe(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),m(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof B){R(e)?m(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),y(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=d(e);if(a<3){let e=Me(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${Ne(e)}: ${t}`),await A(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),y(`error`,`bridge_stop_work_failed`,{attempts:3})}}function Fe(e,t,n,r,i){m(`[bridge:session] sessionId=${e} timed out after ${T(t)}`),C(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${T(t)}`),r.add(e),i.kill()}var Ie=80;function Le(e){return w(e.replace(/\s+/g,` `).trim(),Ie)}async function Re(e,t){let{getBridgeSession:n}=await import(`./createSession-DnykRoia.js`);return(await n(e,{baseUrl:t}))?.title||void 0}var ze=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function Be(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-B4HwLt8i.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-CVvUNkj2.js`);o();let{initSinks:c}=await import(`./sinks-D3bXeHlQ.js`);if(c(),!s())throw new ze(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(H);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-Dmc1ZDev.js`),u=l();if(u.startsWith(`http://`)&&!u.includes(`localhost`)&&!u.includes(`127.0.0.1`))throw new ze(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let f=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||u,{getBranch:p,getRemoteUrl:m,findGitRoot:h}=await import(`./git-BfS5Hk4S.js`),{hasWorktreeCreateHook:g}=await import(`./hooks-DGd02IKF.js`);if(e.spawnMode===`worktree`&&!(g()||h(n)!==null))throw new ze(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let _=await p(),v=await m(),y=Y(),b=Q(),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:Q(),apiBaseUrl:u,sessionIngressUrl:f,sessionTimeoutMs:e.sessionTimeoutMs},S=V({baseUrl:u,getAccessToken:e.getAccessToken,runnerVersion:`0.0.9`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:W}),C,w;try{let e=await S.registerBridgeEnvironment(x);C=e.environment_id,w=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${d(e)}`)}let T=Se({execPath:process.execPath,scriptArgs:Ee(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),E=Ve(r);E.printBanner(x,C);let D;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-DnykRoia.js`);try{let i=await n({environmentId:C,title:e.name,events:[],gitRepoUrl:v,branch:_,signal:t,baseUrl:u,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(D=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${d(e)}`)}}await Oe(x,C,w,S,T,E,t,void 0,D,async()=>e.getAccessToken())}function Ve(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}}D(),g();var He=78,Ue=1;async function We(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=He;return}switch(e){case`remoteControl`:await Ge();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=He}}async function Ge(){let e=process.env.DAEMON_WORKER_DIR||Z(`.`),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 u={dir:e,name:t,spawnMode:n,capacity:r,permissionMode:i,sandbox:a,sessionTimeoutMs:o,createSessionOnStart:s,getAccessToken:()=>O()?.accessToken,onAuth401:async e=>!!O()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await Be(u,c.signal)}catch(e){e instanceof ze?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=He):(console.error(`[remoteControl] transient error: ${d(e)}`),process.exitCode=Ue)}finally{process.off(`SIGTERM`,l),process.off(`SIGINT`,l)}}export{We as runDaemonWorker};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tt as e,bt as t}from"./loadAgentsDir-CKSb56Gp.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.9 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-BaiXZ9tr.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-4JtoJONR.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-DdOYjLm3.js`);await n(t);return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-CVvUNkj2.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-1mgenSWa.js`);r();let{initSinks:i}=await import(`./chunks/sinks-D3bXeHlQ.js`);i();let{daemonMain:a}=await import(`./chunks/main-ClXu1ilx.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-CPUCe-YU.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-CVvUNkj2.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-1mgenSWa.js`);r(),await(await import(`./chunks/bg-DWloqGwk.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-CVvUNkj2.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-1mgenSWa.js`);i();let{initSinks:a}=await import(`./chunks/sinks-D3bXeHlQ.js`);a();let{daemonMain:o}=await import(`./chunks/main-ClXu1ilx.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-Dkv4I9c1.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-Dkv4I9c1.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-CVvUNkj2.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-BX1ULzrw.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-xcoTbKQn.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-BIiwW4mM.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};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,Lt as r,P as i,T as a,fi as o,t as s,y as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Rp as u,zp as d}from"./loadAgentsDir-ByO8eJqU.js";import{n as f,r as p}from"./analytics-CkYUHW_U.js";import{i as m,o as h,r as g,s as _,t as v}from"./grove-Cv19v6Sv.js";var y=e(o(),1);f(),s(),u();var b=l(),x=` _____________
|
|
2
|
-
| \\ \\
|
|
3
|
-
| NEW TERMS \\__\\
|
|
4
|
-
| |
|
|
5
|
-
| ---------- |
|
|
6
|
-
| ---------- |
|
|
7
|
-
| ---------- |
|
|
8
|
-
| ---------- |
|
|
9
|
-
| ---------- |
|
|
10
|
-
| |
|
|
11
|
-
|______________|`;function S(){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(i,{children:[`An update to our Consumer Terms and Privacy Policy will take effect on `,(0,b.jsx)(i,{bold:!0,children:`October 8, 2025`}),`. You can accept the updated terms today.`]}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{children:`What's changing?`}),(0,b.jsx)(n,{paddingLeft:1,children:(0,b.jsxs)(i,{children:[(0,b.jsx)(i,{children:`· `}),(0,b.jsx)(i,{bold:!0,children:`You can help improve Claude `}),(0,b.jsxs)(i,{children:[`— Allow the use of your chats and coding sessions to train and improve Claude AI models. Change anytime in your Privacy Settings (`,(0,b.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`}),`).`]})]})}),(0,b.jsx)(n,{paddingLeft:1,children:(0,b.jsxs)(i,{children:[(0,b.jsx)(i,{children:`· `}),(0,b.jsx)(i,{bold:!0,children:`Updates to data retention `}),(0,b.jsx)(i,{children:`— To help us improve our AI models and safety protections, we're extending data retention to 5 years.`})]})})]}),(0,b.jsxs)(i,{children:[`Learn more (`,(0,b.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function C(){return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(i,{children:`We've updated our Consumer Terms and Privacy Policy.`}),(0,b.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,b.jsx)(i,{children:`What's changing?`}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`Help improve Claude`}),(0,b.jsx)(i,{children:`Allow the use of your chats and coding sessions to train and improve Claude AI models. You can change this anytime in Privacy Settings`}),(0,b.jsx)(r,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`How this affects data retention`}),(0,b.jsx)(i,{children:`Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime.`})]})]}),(0,b.jsxs)(i,{children:[`Learn more (`,(0,b.jsx)(r,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,b.jsx)(r,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function w({showIfAlreadyViewed:e,location:r,onDone:o}){let[s,l]=(0,y.useState)(null),[u,f]=(0,y.useState)(null);if((0,y.useEffect)(()=>{async function t(){let[t,n]=await Promise.all([m(),g()]),i=n.success?n.data:null;f(i);let a=v(t,n,e);if(l(a),!a){o(`skip_rendering`);return}h(),p(`tengu_grove_policy_viewed`,{location:r,dismissable:i?.notice_is_grace_period})}t()},[e,r,o]),s===null||!s)return null;async function w(e){switch(e){case`accept_opt_in`:await _(!0),p(`tengu_grove_policy_submitted`,{state:!0,dismissable:u?.notice_is_grace_period});break;case`accept_opt_out`:await _(!1),p(`tengu_grove_policy_submitted`,{state:!1,dismissable:u?.notice_is_grace_period});break;case`defer`:p(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:p(`tengu_grove_policy_escaped`,{});break}o(e)}let T=u?.domain_excluded?[{label:`Accept terms · Help improve Claude: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Claude: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Claude: OFF`,value:`accept_opt_out`}];function E(){if(u?.notice_is_grace_period){w(`defer`);return}w(`escape`)}return(0,b.jsxs)(c,{title:`Updates to Consumer Terms and Policies`,color:`professionalBlue`,onCancel:E,inputGuide:e=>e.pending?(0,b.jsxs)(i,{children:[`Press `,e.keyName,` again to exit`]}):(0,b.jsxs)(a,{children:[(0,b.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,b.jsx)(t,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,b.jsxs)(n,{flexDirection:`row`,children:[(0,b.jsx)(n,{flexDirection:`column`,gap:1,flexGrow:1,children:u?.notice_is_grace_period?(0,b.jsx)(S,{}):(0,b.jsx)(C,{})}),(0,b.jsx)(n,{flexShrink:0,children:(0,b.jsx)(i,{color:`professionalBlue`,children:x})})]}),(0,b.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,b.jsxs)(n,{flexDirection:`column`,children:[(0,b.jsx)(i,{bold:!0,children:`Please select how you'd like to continue`}),(0,b.jsx)(i,{children:`Your choice takes effect immediately upon confirmation.`})]}),(0,b.jsx)(d,{options:[...T,...u?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>w(e),onCancel:E})]})]})}export{w as GroveDialog};
|