@readmagic/workmate 0.0.21 → 0.0.22
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-DWgTWJ7R.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-s0Orgord.js +1 -0
- package/dist/chunks/App-BcEI6U5j.js +1 -0
- package/dist/chunks/ApproveApiKey-DegdTXZl.js +1 -0
- package/dist/chunks/ApproveApiKey-_VXIMSwY.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-D2Gesf-u.js +1 -0
- package/dist/chunks/CustomSelect-B46Eh0gU.js +1 -0
- package/dist/chunks/DiffDialog-v2IiYyi3.js +6 -0
- package/dist/chunks/Doctor-BP0Rqraa.js +1 -0
- package/dist/chunks/Doctor-By_y3C2V.js +3 -0
- package/dist/chunks/ExitFlow-BasHk1mk.js +2 -0
- package/dist/chunks/Grove-C3mhgshv.js +11 -0
- package/dist/chunks/InvalidConfigDialog-DYVQK5js.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-Dg6OiStR.js +1 -0
- package/dist/chunks/KeybindingProviderSetup-Bn1jzN5F.js +1 -0
- package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +1 -0
- package/dist/chunks/MCPToolListView-DLSrQHDc.js +1 -0
- package/dist/chunks/{McpParsingWarnings-6ENzOklf.js → McpParsingWarnings-DZejAh8b.js} +1 -1
- package/dist/chunks/MessageSelector-CdDlJE48.js +3 -0
- package/dist/chunks/Messages-DuL_r1Or.js +10 -0
- package/dist/chunks/Onboarding-CE2GNA-h.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-Blzgj5yW.js → PromptInputFooterSuggestions-lkr_A5jQ.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-DaQKKyM5.js +1 -0
- package/dist/chunks/QueryEngine-DNNy1UCD.js +1 -0
- package/dist/chunks/REPL-CEhW-C41.js +1 -0
- package/dist/chunks/REPL-CkSL4C_8.js +124 -0
- package/dist/chunks/ResumeConversation-BMCO_3X7.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +1 -0
- package/dist/chunks/SelectMulti-CNE06VAN.js +1 -0
- package/dist/chunks/Settings-mDykHLok.js +2 -0
- package/dist/chunks/Spinner-DwsJJUtn.js +1 -0
- package/dist/chunks/SpinnerGlyph-A6G-gloN.js +1 -0
- package/dist/chunks/TextInput-7uqPhq9T.js +22 -0
- package/dist/chunks/ThemePicker-DT9zVy-0.js +1 -0
- package/dist/chunks/TrustDialog-G4jM9IfM.js +1 -0
- package/dist/chunks/{ValidationErrorsList-2QWIs_6h.js → ValidationErrorsList-BLtP647v.js} +1 -1
- package/dist/chunks/add-dir-7RfQAC3h.js +1 -0
- package/dist/chunks/{agentDisplay-1Y-N-gqz.js → agentDisplay-vLQHFrmq.js} +1 -1
- package/dist/chunks/agents-BNg_skSm.js +101 -0
- package/dist/chunks/{agents-CvW8XjoJ.js → agents-DLz0kfsr.js} +1 -1
- package/dist/chunks/allErrors-DaztSMrw.js +1 -0
- package/dist/chunks/appleTerminalBackup-BYKdf3of.js +1 -0
- package/dist/chunks/auth-BTB00dq5.js +10 -0
- package/dist/chunks/auth-Bbc0Ny8i.js +1 -0
- package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +1 -0
- package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +17 -0
- package/dist/chunks/banner-mqZEluky.js +2 -0
- package/dist/chunks/branch-exFKkymg.js +2 -0
- package/dist/chunks/{break-cache-BZ_UMtEL.js → break-cache-BL2gnDLX.js} +2 -2
- package/dist/chunks/btw-3l78DYET.js +1 -0
- package/dist/chunks/caches-6Nx6tsk9.js +1 -0
- package/dist/chunks/caches-ouaWB9bY.js +1 -0
- package/dist/chunks/claudeDesktop-D3PEgx3U.js +1 -0
- package/dist/chunks/{clear-D2KRoibg.js → clear-CXfhVRp8.js} +1 -1
- package/dist/chunks/client-C01Bnxxv.js +1 -0
- package/dist/chunks/client-DYRgRQsr.js +1 -0
- package/dist/chunks/{client-C_jBL1yC.js → client-DdenNfkQ.js} +1 -1
- package/dist/chunks/client-DvhWKIOx.js +1 -0
- package/dist/chunks/commands-BoxOw75F.js +1 -0
- package/dist/chunks/compact-BOYr105K.js +2 -0
- package/dist/chunks/config-BddEvZZl.js +3 -0
- package/dist/chunks/config-GEv9hUzz.js +1 -0
- package/dist/chunks/config-kw4xg7Nk.js +1 -0
- package/dist/chunks/{context-Db9tH1VF.js → context-3s9wtn4L.js} +1 -1
- package/dist/chunks/{context-noninteractive-CacA9VlT.js → context-noninteractive-CJhUu_4y.js} +9 -9
- package/dist/chunks/context-noninteractive-DFvoZ2L9.js +1 -0
- package/dist/chunks/conversation-CoGharlH.js +1 -0
- package/dist/chunks/conversation-MxEVm54C.js +1 -0
- package/dist/chunks/conversationRecovery-Da_8uldZ.js +1 -0
- package/dist/chunks/crossProjectResume-CzPCHq_K.js +40 -0
- package/dist/chunks/cwd-BcO6WHKo.js +1 -0
- package/dist/chunks/cwd-CDUelriw.js +1 -0
- package/dist/chunks/{datadog-BuElf2EQ.js → datadog-v_mXWncN.js} +1 -1
- package/dist/chunks/{debug-D58GQBDG.js → debug-8DCufdSp.js} +4 -4
- package/dist/chunks/detectRepository-DfX8xXw2.js +1 -0
- package/dist/chunks/{diff-yA6v_dpP.js → diff-DJSt7QO6.js} +1 -1
- package/dist/chunks/directoryCompletion-CT6YVeg7.js +1 -0
- package/dist/chunks/doctor-DWvioSU9.js +1 -0
- package/dist/chunks/entry-ex0-RyYV.js +13 -0
- package/dist/chunks/esm-BQY8jJNR.js +1 -0
- package/dist/chunks/{execFileNoThrow-B_KRY4cT.js → execFileNoThrow-BsfuytkN.js} +1 -1
- package/dist/chunks/exit-BxC_ZEtO.js +1 -0
- package/dist/chunks/extraUsage-DYm33Occ.js +1 -0
- package/dist/chunks/extractMemories-CzN3Ax2B.js +1 -0
- package/dist/chunks/fast-DqUpl_Lr.js +1 -0
- package/dist/chunks/fast-NUdUyAaM.js +1 -0
- package/dist/chunks/fetchModelList-CqsTAWEN.js +1 -0
- package/dist/chunks/fetchModelList-DBMHE6Ng.js +1 -0
- package/dist/chunks/fileSuggestions-B-SLfb-o.js +3 -0
- package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +3 -0
- package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +1 -0
- package/dist/chunks/gemini-BC9kHhwe.js +2 -0
- package/dist/chunks/generateSessionName-ChvKBVxB.js +1 -0
- package/dist/chunks/{genericProcessUtils-Cnyun_Wr.js → genericProcessUtils-BYi0OefF.js} +1 -1
- package/dist/chunks/goal-ByyimpVU.js +3 -0
- package/dist/chunks/grok-DenjixMl.js +1 -0
- package/dist/chunks/grove-Dq8QbQ9o.js +7 -0
- package/dist/chunks/help-CK90i4hE.js +1 -0
- package/dist/chunks/history-CNQNd6hT.js +1 -0
- package/dist/chunks/{hooks-BDgToO1Z.js → hooks-BRFDg9DV.js} +2 -2
- package/dist/chunks/hooks-BaYwmkxD.js +1 -0
- package/dist/chunks/install-ZMll-dAa.js +1 -0
- package/dist/chunks/instrumentation-BwVyvRfY.js +21 -0
- package/dist/chunks/{job-DYMfSglZ.js → job-G_ukhLc4.js} +1 -1
- package/dist/chunks/keybindings-wNxBzDVQ.js +1 -0
- package/dist/chunks/launchLocalMemory-BcRlXLm6.js +3 -0
- package/dist/chunks/launchOnboarding-CDjQ64RO.js +8 -0
- package/dist/chunks/{loadAgentsDir-C96o6gCj.js → loadAgentsDir-C1LkW7gl.js} +551 -621
- package/dist/chunks/loadAgentsDir-DKXap_Om.js +1 -0
- package/dist/chunks/{loadPluginHooks-0nGlugZ4.js → loadPluginHooks-DtmHtEiS.js} +1 -1
- package/dist/chunks/{loader-C33o_5kS.js → loader-C61fB6vU.js} +1 -1
- package/dist/chunks/localSearch-BB9x5C2N.js +1 -0
- package/dist/chunks/{localSearch-DLz5IGGu.js → localSearch-DFo_WTMm.js} +1 -1
- package/dist/chunks/log-DaILwWJa.js +1 -0
- package/dist/chunks/logoUtils-Dj_2SWmO.js +1 -0
- package/dist/chunks/{magicDocs-DmPNMnNY.js → magicDocs-DYc9TFmI.js} +2 -2
- package/dist/chunks/main-BRg8L_aw.js +346 -0
- package/dist/chunks/managedEnv-DsqAYOJ4.js +1 -0
- package/dist/chunks/managedEnv-lybrMred.js +1 -0
- package/dist/chunks/mcp-Bsw3cMiJ.js +6 -0
- package/dist/chunks/mcp-DDdud6Y7.js +1 -0
- package/dist/chunks/mcp-DbgTDUt7.js +2 -0
- package/dist/chunks/memory-CzwTzihf.js +1 -0
- package/dist/chunks/mode-Pan-Q2c4.js +2 -0
- package/dist/chunks/model-BYfmXKHf.js +1 -0
- package/dist/chunks/model-BwBE0Pt5.js +1 -0
- package/dist/chunks/modelOptions-DvNBapgG.js +1 -0
- package/dist/chunks/nativeInstaller-DnSNJWIi.js +1 -0
- package/dist/chunks/notifications-B0DTaYoy.js +1 -0
- package/dist/chunks/omit-Dl1Us_PY.js +1 -0
- package/dist/chunks/onChangeAppState-4KOJMN82.js +1 -0
- package/dist/chunks/openai-C_6C1_0N.js +10 -0
- package/dist/chunks/overlayContext-CMV7nYR9.js +1 -0
- package/dist/chunks/{panel-Cm23FDVt.js → panel-D9fGQgln.js} +1 -1
- package/dist/chunks/parser-BKAVMTyD.js +1 -0
- package/dist/chunks/{parser-eVu-cTRs.js → parser-D8slvrJP.js} +1 -1
- package/dist/chunks/partition-B504IgAa.js +1 -0
- package/dist/chunks/pasteStore-DNV1M5Xd.js +1 -0
- package/dist/chunks/permissions-CLFMhdRk.js +3 -0
- package/dist/chunks/pidLock-D9do1Afy.js +3 -0
- package/dist/chunks/{plan-s228H7IU.js → plan-CQLnPLuE.js} +1 -1
- package/dist/chunks/{platform-DMQxcm4K.js → platform-Dzff1WWw.js} +1 -1
- package/dist/chunks/plugin-BYdF7uob.js +17 -0
- package/dist/chunks/{pluginAutoupdate-aLXhSUVD.js → pluginAutoupdate-BJaAqwTH.js} +1 -1
- package/dist/chunks/{pluginBlocklist-BprCv0En.js → pluginBlocklist-DKKmOnWM.js} +1 -1
- package/dist/chunks/pluginCliCommands-z8TtJMKH.js +1 -0
- package/dist/chunks/{pluginFlagging-BSLuTk3M.js → pluginFlagging-DQP8tBi2.js} +1 -1
- package/dist/chunks/pluginOperations-BcfJCDco.js +2 -0
- package/dist/chunks/{pluginStartupCheck-xQbHZ5gf.js → pluginStartupCheck-CfRvCrFg.js} +1 -1
- package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +1 -0
- package/dist/chunks/plugins-CTM8jpOw.js +4 -0
- package/dist/chunks/policyLimits-a7ix6GnU.js +1 -0
- package/dist/chunks/poorMode-C11JEH3d.js +1 -0
- package/dist/chunks/{poorMode-Bt_A2arj.js → poorMode-J5SYJvoY.js} +1 -1
- package/dist/chunks/print-u6MzL5Cr.js +13 -0
- package/dist/chunks/processBashCommand-DIwrI2QC.js +1 -0
- package/dist/chunks/processSlashCommand-B-Gujpxm.js +5 -0
- package/dist/chunks/projectOnboardingState-CJycxw5P.js +1 -0
- package/dist/chunks/{prompt-BNNE5tsG.js → prompt-BGqgPgCU.js} +3 -3
- package/dist/chunks/prompt-BPJDGlx5.js +1 -0
- package/dist/chunks/prompt-DEdZzkEz.js +1 -0
- package/dist/chunks/promptEditor-CmQ9p4oe.js +4 -0
- package/dist/chunks/{protocolHandler-DukQ6b4Q.js → protocolHandler-CJo9-PfZ.js} +2 -2
- package/dist/chunks/{proxy-BhIc7-mj.js → proxy-CB17QimU.js} +2 -2
- package/dist/chunks/reconciler-DSKLuOS7.js +1 -0
- package/dist/chunks/refresh-BbZFCNpn.js +1 -0
- package/dist/chunks/registerProtocol-CLIpzVwF.js +1 -0
- package/dist/chunks/reload-plugins-DjugL8jH.js +1 -0
- package/dist/chunks/rename-DOtCOtEr.js +1 -0
- package/dist/chunks/{renderOptions-D-aQZbzS.js → renderOptions-Zqfm2U1y.js} +1 -1
- package/dist/chunks/resume-BB4T4WIV.js +2 -0
- package/dist/chunks/ripgrep-BuzOTf1S.js +5 -0
- package/dist/chunks/ripgrep-CZ2CqaHb.js +1 -0
- package/dist/chunks/{runtimeObserver-DS1PK6We.js → runtimeObserver-CK_iZ6OB.js} +1 -1
- package/dist/chunks/{runtimeObserver-CsZw5XBt.js → runtimeObserver-CpP0L9T9.js} +4 -4
- package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +1 -0
- package/dist/chunks/sandbox-toggle-KOHYvbQT.js +1 -0
- package/dist/chunks/searchExtraTools-CdJghGkj.js +1 -0
- package/dist/chunks/select-C_KXmqbI.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +1 -0
- package/dist/chunks/sessionObserver-DB-sLv-X.js +1 -0
- package/dist/chunks/{sessionObserver-N7fORFdL.js → sessionObserver-WOYv2n7C.js} +2 -2
- package/dist/chunks/sessionStorage-sgOAbDn7.js +1 -0
- package/dist/chunks/{sessionTracing-fIp8g04N.js → sessionTracing-yBre24PH.js} +2 -2
- package/dist/chunks/settings-C-KNkvsM.js +1 -0
- package/dist/chunks/settings-DKN4xSpQ.js +24 -0
- package/dist/chunks/setup-CN_Pk7AR.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEo1hvGi.js → shadowedRuleDetection-Df-kZ_pK.js} +1 -1
- package/dist/chunks/{sideQuestion-C11KgNGL.js → sideQuestion-CMB8hfgX.js} +3 -3
- package/dist/chunks/sinks-BS17vtN0.js +1 -0
- package/dist/chunks/sinks-D1EjkHb4.js +1 -0
- package/dist/chunks/skillChangeDetector-CBKuGuEi.js +1 -0
- package/dist/chunks/{skillGapStore-H4MkUFUY.js → skillGapStore-CfmlO6pb.js} +2 -2
- package/dist/chunks/{skillLifecycle-ADUTDK7D.js → skillLifecycle-BQ2LMfMx.js} +2 -2
- package/dist/chunks/{skillSearchPanel-PpfVDMGR.js → skillSearchPanel-BwYuwLFs.js} +4 -4
- package/dist/chunks/skills-BVHPQma0.js +1 -0
- package/dist/chunks/startupProfiler-B_U4QDtf.js +1 -0
- package/dist/chunks/startupProfiler-DTs9w9EN.js +3 -0
- package/dist/chunks/{state-D5D6QpTX.js → state-BowF111d.js} +1 -1
- package/dist/chunks/state-CGuyDES7.js +1 -0
- package/dist/chunks/status-BurdTfyz.js +2 -0
- package/dist/chunks/status-DMq1An5h.js +1 -0
- package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +1 -0
- package/dist/chunks/stringUtils-BQm3OfeJ.js +4 -0
- package/dist/chunks/{switcher-DWfKi17X.js → switcher-Bq1Ct_Sn.js} +1 -1
- package/dist/chunks/switcher-DGD4ORVf.js +1 -0
- package/dist/chunks/{tasks-BwSsj2vI.js → tasks-0c8Uy04D.js} +1 -1
- package/dist/chunks/tempfile-CHO5wXsV.js +1 -0
- package/dist/chunks/{templateJobs-fiKuu4DK.js → templateJobs-BdFzE9XG.js} +1 -1
- package/dist/chunks/terminalSetup-Cf_r6pwK.js +32 -0
- package/dist/chunks/{terminalSetup-Cte5a4hM.js → terminalSetup-D7J6bxcn.js} +1 -1
- package/dist/chunks/{theme-CAoGjf2D.js → theme-Bby4fssR.js} +1 -1
- package/dist/chunks/tipRegistry-CyRXWWTz.js +2 -0
- package/dist/chunks/{toolEventObserver-Cq_ZV7x9.js → toolEventObserver-CzFZUIsM.js} +1 -1
- package/dist/chunks/toolPool-CnrZcprA.js +1 -0
- package/dist/chunks/types-zk5Ltv5q.js +81 -0
- package/dist/chunks/udsClient-ftP0yIpe.js +1 -0
- package/dist/chunks/use-select-navigation-DMaC_3iw.js +1 -0
- package/dist/chunks/useDoublePress-C9xxQzh1.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CjW3gUOt.js +1 -0
- package/dist/chunks/useMainLoopModel-DWscpA9I.js +1 -0
- package/dist/chunks/useManagePlugins-CYXVcql2.js +1 -0
- package/dist/chunks/useMergedTools-DarmnCEw.js +1 -0
- package/dist/chunks/useSearchInput-C2JuUW3g.js +1 -0
- package/dist/chunks/useSettingsErrors-DutJBiKZ.js +1 -0
- package/dist/chunks/util-Bq5l7FF5.js +1 -0
- package/dist/chunks/validatePlugin-DIdEydz_.js +1 -0
- package/dist/chunks/{vim-xruiCyUd.js → vim-D8prM2IH.js} +1 -1
- package/dist/chunks/worktree-Caqt2WRZ.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-DgAxYgBY.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-DGMRVexR.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Dp6CwZyI.js +0 -1
- package/dist/chunks/App-VWyPd524.js +0 -1
- package/dist/chunks/ApproveApiKey-Bolw0sPs.js +0 -1
- package/dist/chunks/ApproveApiKey-CyNPMd6g.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-DxagIOOw.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-OS2S66zQ.js +0 -1
- package/dist/chunks/DiffDialog-CMtml9iw.js +0 -6
- package/dist/chunks/Doctor-Bk9P37mU.js +0 -1
- package/dist/chunks/Doctor-D9F3tKsr.js +0 -3
- package/dist/chunks/ExitFlow-DhRv5JPj.js +0 -2
- package/dist/chunks/Grove-Bbh8PpH0.js +0 -11
- package/dist/chunks/HybridTransport-P1vEUwhv.js +0 -2
- package/dist/chunks/InvalidConfigDialog-xAYpE-20.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-CXFSISy3.js +0 -1
- package/dist/chunks/MCPConnectionManager-CoId-C__.js +0 -1
- package/dist/chunks/MCPToolListView-BQkQ-hyF.js +0 -1
- package/dist/chunks/MessageSelector-BvRVrfg6.js +0 -3
- package/dist/chunks/Messages-Cykztq1O.js +0 -10
- package/dist/chunks/Onboarding-CfeRwPNQ.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-Ckp0k8E3.js +0 -1
- package/dist/chunks/QueryEngine-DduzztIG.js +0 -1
- package/dist/chunks/REPL-B8e5UU3H.js +0 -128
- package/dist/chunks/REPL-C4mbOhyL.js +0 -1
- package/dist/chunks/RemoteSessionManager-BPESC6Wu.js +0 -2
- package/dist/chunks/ResumeConversation-DG1sLryB.js +0 -1
- package/dist/chunks/SSETransport-CDNP2PlK.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-vK2PP628.js +0 -1
- package/dist/chunks/Settings-B7n_dfP-.js +0 -2
- package/dist/chunks/TeleportProgress-QL3ibQfK.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-f-xl7biD.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-DzVcrFuP.js +0 -1
- package/dist/chunks/ThemePicker-CIFKZza0.js +0 -1
- package/dist/chunks/TrustDialog-C0HEwZPk.js +0 -1
- package/dist/chunks/add-dir-DmEhPnvj.js +0 -1
- package/dist/chunks/agents-D96ng5I9.js +0 -101
- package/dist/chunks/allErrors-CT2dbBF3.js +0 -1
- package/dist/chunks/api-DTyrmy1O.js +0 -1
- package/dist/chunks/api-DumFOErN.js +0 -1
- package/dist/chunks/auth-CZ4EsFWF.js +0 -10
- package/dist/chunks/auth-QvonHoG9.js +0 -1
- package/dist/chunks/auth-jV5THRH8.js +0 -1
- package/dist/chunks/backgroundHousekeeping-C72oPgfD.js +0 -17
- package/dist/chunks/backgroundHousekeeping-D9PScHES.js +0 -1
- package/dist/chunks/banner-ChT5Ri7Q.js +0 -2
- package/dist/chunks/bg-qG2osBbP.js +0 -9
- package/dist/chunks/branch-K8X6jx0i.js +0 -2
- package/dist/chunks/bridgeConfig-C-bI-slm.js +0 -1
- package/dist/chunks/bridgeConfig-_xpxhGB5.js +0 -1
- package/dist/chunks/bridgeMessaging-DSJlYarJ.js +0 -1
- package/dist/chunks/bridgePointer-DfTOjgtX.js +0 -1
- package/dist/chunks/bridgeStatusUtil-DaEq5c69.js +0 -1
- package/dist/chunks/btw-BNs5OX7x.js +0 -1
- package/dist/chunks/bundledMode--fG1S62b.js +0 -1
- package/dist/chunks/caches-CC5NHwAz.js +0 -1
- package/dist/chunks/caches-nHxJWXgO.js +0 -1
- package/dist/chunks/capacityWake-BpP6c7x3.js +0 -3
- package/dist/chunks/ccrClient-JnhF5b3z.js +0 -1
- package/dist/chunks/claudeDesktop-DPc_SaVn.js +0 -1
- package/dist/chunks/cliLaunch-DDtwAolw.js +0 -1
- package/dist/chunks/client-9uHzAmFH.js +0 -1
- package/dist/chunks/client-BVal_QII.js +0 -1
- package/dist/chunks/client-BtTkq0YS.js +0 -1
- package/dist/chunks/client-Dd7CKMRX.js +0 -1
- package/dist/chunks/commands-C_rYjyQZ.js +0 -1
- package/dist/chunks/compact-Cqd6vKpn.js +0 -2
- package/dist/chunks/config-Be0BkAAr.js +0 -1
- package/dist/chunks/config-DUTgj3js.js +0 -3
- package/dist/chunks/config-DoEDgAfv.js +0 -1
- package/dist/chunks/context-noninteractive-D9tJYwi7.js +0 -1
- package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +0 -1
- package/dist/chunks/conversation-DWfE4KGH.js +0 -1
- package/dist/chunks/conversation-Tvo4EDpQ.js +0 -1
- package/dist/chunks/createSSHSession-BQ83MMtr.js +0 -5
- package/dist/chunks/createSession-CqHnHhCR.js +0 -1
- package/dist/chunks/createSession-DqTtBycR.js +0 -1
- package/dist/chunks/crossProjectResume-DIXtiODF.js +0 -40
- package/dist/chunks/cwd-DLK3znO7.js +0 -1
- package/dist/chunks/cwd-Nh5IZNKO.js +0 -1
- package/dist/chunks/debugUtils-DXBRbwCE.js +0 -1
- package/dist/chunks/detached-Biz-xhu0.js +0 -4
- package/dist/chunks/detectRepository-DUJBh5s2.js +0 -1
- package/dist/chunks/detectRepository-pRAVv8SH.js +0 -1
- package/dist/chunks/directoryCompletion-CuA3_YIT.js +0 -1
- package/dist/chunks/doctor-eNAm6OiS.js +0 -1
- package/dist/chunks/entry-DidpiR-D.js +0 -13
- package/dist/chunks/esm-BCUC71kt.js +0 -1
- package/dist/chunks/execSyncWrapper-C3ZFV9od.js +0 -1
- package/dist/chunks/exit-DywUeiYd.js +0 -1
- package/dist/chunks/extraUsage-DiAirtuk.js +0 -1
- package/dist/chunks/extractMemories-_xiTnX95.js +0 -1
- package/dist/chunks/fast-DCXZACT9.js +0 -1
- package/dist/chunks/fast-Qo4WVqiW.js +0 -1
- package/dist/chunks/fetchModelList-fQDsmR3E.js +0 -1
- package/dist/chunks/fetchModelList-woVzIVde.js +0 -1
- package/dist/chunks/fileSuggestions-CRx1D6uk.js +0 -3
- package/dist/chunks/firstPartyEventLogger-B261Wksn.js +0 -3
- package/dist/chunks/firstPartyEventLogger-DtFTeHy-.js +0 -1
- package/dist/chunks/flushGate-BA8dSr0i.js +0 -1
- package/dist/chunks/gemini-BXAyy1JN.js +0 -1
- package/dist/chunks/generateSessionName-Cwmk2N3F.js +0 -1
- package/dist/chunks/git-Wid-XppW.js +0 -5
- package/dist/chunks/git-hO-TMvXc.js +0 -1
- package/dist/chunks/githubRepoPathMapping-OV8U1VFK.js +0 -1
- package/dist/chunks/goal-C9clrwEH.js +0 -3
- package/dist/chunks/grok-CjeCecsZ.js +0 -1
- package/dist/chunks/grove-DqTnK9nn.js +0 -7
- package/dist/chunks/hash-Tu-My5Vp.js +0 -1
- package/dist/chunks/help-Bb6LdzXK.js +0 -1
- package/dist/chunks/hooks-BX2s7aoL.js +0 -1
- package/dist/chunks/initReplBridge-D7cuY_os.js +0 -1
- package/dist/chunks/install-eCA8UACi.js +0 -1
- package/dist/chunks/instrumentation-BaRKojJh.js +0 -21
- package/dist/chunks/jwtUtils-JE2okZ70.js +0 -1
- package/dist/chunks/keybindings-iBqc1KHL.js +0 -1
- package/dist/chunks/launchLocalMemory-IZPGEzMk.js +0 -3
- package/dist/chunks/launchOnboarding-BeNf51Ig.js +0 -8
- package/dist/chunks/lazySchema-DULtBUCI.js +0 -65
- package/dist/chunks/lib-BlVGipXx.js +0 -14
- package/dist/chunks/loadAgentsDir-Bpke9CtB.js +0 -1
- package/dist/chunks/localSearch-dodgnjGn.js +0 -1
- package/dist/chunks/log-CZ7ploQm.js +0 -1
- package/dist/chunks/logoUtils-Cg_6QV1Z.js +0 -1
- package/dist/chunks/main-7ssnA9Yb.js +0 -31
- package/dist/chunks/main-BEv6MqMX.js +0 -356
- package/dist/chunks/managedEnv-CHYvwXBH.js +0 -1
- package/dist/chunks/managedEnv-CbjOQmEe.js +0 -1
- package/dist/chunks/mappers-D8VLUZ2N.js +0 -1
- package/dist/chunks/mcp-BUn3yqsT.js +0 -1
- package/dist/chunks/mcp-BskLq9iP.js +0 -2
- package/dist/chunks/mcp-C-0DMaXx.js +0 -6
- package/dist/chunks/memoize-CumjjK2Q.js +0 -1
- package/dist/chunks/memory-vDkJM58W.js +0 -1
- package/dist/chunks/mode-Dbh21H2Y.js +0 -2
- package/dist/chunks/model-BaMclMXn.js +0 -1
- package/dist/chunks/model-atn3_JBi.js +0 -1
- package/dist/chunks/model-vS1Iewyq.js +0 -1
- package/dist/chunks/modelOptions-Cw1ThINb.js +0 -1
- package/dist/chunks/nativeInstaller-CfZ5uNTh.js +0 -1
- package/dist/chunks/oauth-D38aRTUb.js +0 -1
- package/dist/chunks/oauth-U649LV5H.js +0 -1
- package/dist/chunks/omit-B7eQ9q0x.js +0 -1
- package/dist/chunks/onChangeAppState-kEAt8nxV.js +0 -1
- package/dist/chunks/openai-wh8AX5iz.js +0 -10
- package/dist/chunks/parser-Cq9X7HMP.js +0 -1
- package/dist/chunks/partition-CENvOfiS.js +0 -1
- package/dist/chunks/permissions-ChuIx-d4.js +0 -3
- package/dist/chunks/pidLock-C1hmh3YQ.js +0 -3
- package/dist/chunks/plugin-DVBEWwMP.js +0 -17
- package/dist/chunks/pluginCliCommands-WzzqR1Sr.js +0 -1
- package/dist/chunks/pluginOperations-Ca9Lup5G.js +0 -2
- package/dist/chunks/pluginStartupCheck-DdtxcNwH.js +0 -1
- package/dist/chunks/plugins-DdIaXpNb.js +0 -4
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poorMode-ZIq2oz7q.js +0 -1
- package/dist/chunks/print-vxrRE1O2.js +0 -14
- package/dist/chunks/processBashCommand-ISucgwpi.js +0 -1
- package/dist/chunks/processSlashCommand-BnpXO_fI.js +0 -5
- package/dist/chunks/prompt-2AA5W7EH.js +0 -1
- package/dist/chunks/prompt-AXiS2LoO.js +0 -1
- package/dist/chunks/promptEditor-DT6egmcb.js +0 -4
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +0 -1
- package/dist/chunks/reconciler-D3zyJCnV.js +0 -1
- package/dist/chunks/refresh-BSG0t4cf.js +0 -1
- package/dist/chunks/registerProtocol-BOEYaX-X.js +0 -1
- package/dist/chunks/reload-plugins-BFMRhbv8.js +0 -1
- package/dist/chunks/remoteBridgeCore-D5OwvmAz.js +0 -1
- package/dist/chunks/remoteManagedSettings-DyGVvvcW.js +0 -1
- package/dist/chunks/rename-BrEwj3Xw.js +0 -1
- package/dist/chunks/resume-DR5JbICs.js +0 -2
- package/dist/chunks/ripgrep-Dt4a91S5.js +0 -5
- package/dist/chunks/ripgrep-KTOU5s9J.js +0 -1
- package/dist/chunks/sandbox-adapter-BqDyWcol.js +0 -1
- package/dist/chunks/sandbox-toggle-B9f_0NQI.js +0 -1
- package/dist/chunks/searchExtraTools-2pIT2C8u.js +0 -1
- package/dist/chunks/session-wkRTfdo8.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-DV22q9JO.js +0 -1
- package/dist/chunks/sessionIdCompat-Dgp6PW_1.js +0 -1
- package/dist/chunks/sessionObserver-BLJg0qm_.js +0 -1
- package/dist/chunks/sessionState-8jutEorw.js +0 -11
- package/dist/chunks/sessionStorage-DRV7IhZF.js +0 -1
- package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +0 -3
- package/dist/chunks/settings-BowI3jp-.js +0 -19
- package/dist/chunks/settings-CHn0gJCG.js +0 -1
- package/dist/chunks/settingsSync-DF4JgSNc.js +0 -1
- package/dist/chunks/setup-UiEO9i7F.js +0 -3
- package/dist/chunks/shellQuote-Ddgr1vif.js +0 -4
- package/dist/chunks/sinks-DnLqRPEC.js +0 -1
- package/dist/chunks/sinks-mGBiINp8.js +0 -1
- package/dist/chunks/skillChangeDetector-Dc6YZXJE.js +0 -1
- package/dist/chunks/skills-DKtN17ch.js +0 -1
- package/dist/chunks/startupProfiler-B90b5vuq.js +0 -3
- package/dist/chunks/startupProfiler-DG2TN5R_.js +0 -1
- package/dist/chunks/state-BStOuCh4.js +0 -1
- package/dist/chunks/stats-D4LEtkrw.js +0 -1
- package/dist/chunks/status-0ZBx6Ls0.js +0 -2
- package/dist/chunks/status-BUJ4-omB.js +0 -1
- package/dist/chunks/statusNoticeHelpers-BrpQWj0l.js +0 -1
- package/dist/chunks/stringUtils-D7oJIyY2.js +0 -4
- package/dist/chunks/subprocessEnv-CNBOhlDV.js +0 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +0 -1
- package/dist/chunks/switcher-D7Ey5uIi.js +0 -1
- package/dist/chunks/syncCache-DUhciJLz.js +0 -1
- package/dist/chunks/teleport-DwZMevmQ.js +0 -1
- package/dist/chunks/terminalSetup-a7-BNS4T.js +0 -32
- package/dist/chunks/tmux-DA06aewY.js +0 -1
- package/dist/chunks/toolPool-mdsxlKWR.js +0 -1
- package/dist/chunks/trustedDevice-C1m--Yjw.js +0 -1
- package/dist/chunks/trustedDevice-CeDIk_ln.js +0 -1
- package/dist/chunks/types-APu4OCXJ.js +0 -17
- package/dist/chunks/udsClient-BcwsY0XE.js +0 -1
- package/dist/chunks/upstreamproxy-CTOuotLO.js +0 -10
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-L5idX6Kz.js +0 -1
- package/dist/chunks/useMainLoopModel-VXeS2EC6.js +0 -1
- package/dist/chunks/useManagePlugins-CAXp5CfH.js +0 -1
- package/dist/chunks/useMergedTools-DYXrPTIA.js +0 -1
- package/dist/chunks/useSearchInput-Bxl4wGcZ.js +0 -1
- package/dist/chunks/useSettingsErrors-sbjsaT7k.js +0 -1
- package/dist/chunks/userAgent-NbKd-hN7.js +0 -1
- package/dist/chunks/util-DU63xTwZ.js +0 -1
- package/dist/chunks/validatePlugin-DQ_9OCpP.js +0 -1
- package/dist/chunks/which-B8rchd8P.js +0 -1
- package/dist/chunks/windowsPaths-BdhjMYTm.js +0 -1
- package/dist/chunks/windowsPaths-DtGZ83kH.js +0 -1
- package/dist/chunks/workSecret-CaM2yIJD.js +0 -1
- package/dist/chunks/workerRegistry-BBgquE8F.js +0 -2
- package/dist/chunks/worktree-C28I8mFB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{F as i,N as a,P as o,Ub as s,ad as c,id as l}from"./loadAgentsDir-C1LkW7gl.js";import{D as u,I as d,P as f,T as p,Wt as m,ai as h,t as g,vn as _,y as v,yn as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{n as x,t as S}from"./TextInput-7uqPhq9T.js";import{n as C,t as w}from"./select-C_KXmqbI.js";import{r as T,t as E}from"./directoryCompletion-CT6YVeg7.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-lkr_A5jQ.js";function k(){return(0,P.jsx)(f,{dimColor:!0,children:`Work Mate 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)(d,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(f,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:a,selectedSuggestion:o}){return(0,P.jsxs)(d,{flexDirection:`column`,children:[(0,P.jsx)(f,{children:`Enter the path to the directory:`}),(0,P.jsx)(d,{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:()=>{}})}),a.length>0&&(0,P.jsx)(d,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:a,selectedSuggestion:o})}),i&&(0,P.jsx)(f,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[o,s]=(0,N.useState)(``),[c,h]=(0,N.useState)(null),[g,_]=(0,N.useState)([]),[b,x]=(0,N.useState)(0),S=(0,N.useMemo)(()=>F,[]),C=y((0,N.useCallback)(async e=>{if(!e){_([]),x(0);return}let t=await E(e);_(t),x(0)},[]),100);(0,N.useEffect)(()=>{C(o)},[o,C]);let T=(0,N.useCallback)(e=>{let t=`${e.id}/`;s(t),h(null)},[]),D=(0,N.useCallback)(async t=>{let r=await i(t,n);r.resultType===`success`?e(r.absolutePath,!1):h(a(r))},[n,e]);m(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(g.length>0){if(e.key===`tab`){e.preventDefault();let t=g[b];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=g[b];t&&D(`${t.id}/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),x(e=>e<=0?g.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),x(e=>e>=g.length-1?0:e+1);return}}},[g,b,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)(d,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(v,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(f,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(p,{children:[(0,P.jsx)(u,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(u,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(w,{options:S,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(d,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:o,onChange:s,onSubmit:D,error:c,suggestions:g,selectedSuggestion:b})]})})})}var N,P,F,I=e((()=>{n(),N=t(h(),1),_(),o(),x(),g(),s(),T(),c(),C(),D(),P=b(),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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./AgentsMdExternalIncludesDialog-s0Orgord.js";e();export{t as AgentsMdExternalIncludesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,ai as a,t as o,y as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as l,m as u}from"./config-BddEvZZl.js";import{n as d,r as f}from"./analytics-DJobLaWP.js";import{t as p}from"./select-C_KXmqbI.js";import{t as m}from"./CustomSelect-B46Eh0gU.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:a}){g.useEffect(()=>{f(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(f(`tengu_claude_md_external_includes_dialog_declined`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!1,hasAgentsMdExternalIncludesWarningShown:!0}))):(f(`tengu_claude_md_external_includes_dialog_accepted`,{}),l(e=>({...e,hasAgentsMdExternalIncludesApproved:!0,hasAgentsMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(s,{title:`Allow external AGENTS.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's AGENTS.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 Work Mate with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(r,{url:`https://code.workmate.com/docs/en/security`}),` `]}),(0,_.jsx)(p,{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),d(),o(),u(),m(),_=c()}));export{v as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dp as e,Tp as t}from"./loadAgentsDir-C1LkW7gl.js";import{R as n,t as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{c as a,m as o,v as s}from"./config-BddEvZZl.js";import{t as c}from"./fpsMetrics-wxj9GAsd.js";import{n as l,t as u}from"./onChangeAppState-4KOJMN82.js";e(),r(),o();var d=i();function f({getFpsMetrics:e,stats:r,initialState:i,children:o}){return(0,d.jsx)(c,{getFpsMetrics:e,children:(0,d.jsx)(l,{store:r,children:(0,d.jsx)(t,{initialState:i,onChangeAppState:u,children:(0,d.jsx)(n,{initialState:a().theme,onThemeSave:e=>s(t=>({...t,theme:e})),children:o})})})})}export{f as App};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ApproveApiKey-_VXIMSwY.js";export{e as ApproveApiKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as e,t,y as n}from"./src-DL3w8VPk.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{m as i,v as a}from"./config-BddEvZZl.js";import{t as o}from"./select-C_KXmqbI.js";import{t as s}from"./CustomSelect-B46Eh0gU.js";t(),i(),s();var c=r();function l({customApiKeyTruncated:t,onDone:r}){function i(e){switch(e){case`yes`:a(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,approved:[...e.customApiKeyResponses?.approved??[],t]}})),r(!0);break;case`no`:a(e=>({...e,customApiKeyResponses:{...e.customApiKeyResponses,rejected:[...e.customApiKeyResponses?.rejected??[],t]}})),r(!1);break}}return(0,c.jsxs)(n,{title:`Detected a custom API key in your environment`,color:`warning`,onCancel:()=>i(`no`),children:[(0,c.jsxs)(e,{children:[(0,c.jsx)(e,{bold:!0,children:`ANTHROPIC_API_KEY`}),(0,c.jsxs)(e,{children:[`: sk-ant-...`,t]})]}),(0,c.jsx)(e,{children:`Do you want to use this API key?`}),(0,c.jsx)(o,{defaultValue:`no`,defaultFocusValue:`no`,options:[{label:`Yes`,value:`yes`},{label:(0,c.jsxs)(e,{children:[`No (`,(0,c.jsx)(e,{bold:!0,children:`recommended`}),`)`]}),value:`no`}],onChange:e=>i(e),onCancel:()=>i(`no`)})]})}export{l as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Ap as i,Bl as a,CS as o,Cc as s,Dp as c,En as l,Gb as u,Hu as d,On as f,Op as p,Rl as m,Sc as h,Ub as g,Uu as _,Vl as v,Wb as y,Yb as b,Zi as x,am as S,fu as C,ms as w,nm as ee,ps as te,pu as T,zl as E}from"./loadAgentsDir-C1LkW7gl.js";import{D,Gt as O,H as ne,I as k,P as A,T as j,ai as M,ot as N,t as P,y as F}from"./src-DL3w8VPk.js";import{t as I}from"./jsx-runtime-Bb4Xn-E0.js";import{_ as re,f as ie}from"./debug-8DCufdSp.js";import{Jn as ae,Yn as oe,qn as se}from"./settings-DKN4xSpQ.js";import{l as L,o as ce}from"./stringUtils-BQm3OfeJ.js";import{S as le,_ as R,f as ue,l as de,u as fe,y as z}from"./startupProfiler-DTs9w9EN.js";import{_n as pe,gn as me,vn as he}from"./prompt-BGqgPgCU.js";import{i as ge,t as _e}from"./overlayContext-CMV7nYR9.js";function B(e,t,n=1e3,r=0,i){let a=()=>de(Math.max(0,(i??Date.now())-e-r));return(0,V.useSyncExternalStore)((0,V.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var V,H=e((()=>{V=t(M(),1),R()}));function ve(e,t,n){let r=me(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,ye.jsxs)(A,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var ye,be=e((()=>{P(),he(),ye=I()}));function xe(e,t){let{isIdle:n,awaitingApproval:i,hasError:a,shutdownRequested:o}=t??{};return a?r.cross:i?r.questionMarkPrefix:o?r.warning:e===`running`?n?r.ellipsis:r.play:e===`completed`?r.tick:e===`failed`||e===`killed`?r.cross:r.bullet}function Se(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 Ce(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(T(t))return n=!0,!1;return n}var we=e((()=>{n(),C()}));function Te({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=ne(),a=(0,Ee.useMemo)(()=>h(pe()),[]),s=B(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);O({"confirm:yes":t},{context:`Confirmation`});let c=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},l=o(e.prompt,`plan`),u=e.prompt.length>300?`${e.prompt.substring(0,297)}…`:e.prompt,f=e.result?.totalTokens??e.progress?.tokenCount,p=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,U.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:c,children:(0,U.jsx)(F,{title:(0,U.jsxs)(A,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,U.jsxs)(A,{children:[e.status!==`running`&&(0,U.jsxs)(A,{color:Se(e.status),children:[xe(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,U.jsxs)(A,{dimColor:!0,children:[s,f!==void 0&&f>0&&(0,U.jsxs)(U.Fragment,{children:[` · `,ue(f),` tokens`]}),p!==void 0&&p>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,p,` `,p===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(j,{children:[r&&(0,U.jsx)(D,{shortcut:`←`,action:`go back`}),(0,U.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,U.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(k,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,U.jsxs)(k,{flexDirection:`column`,children:[(0,U.jsx)(A,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,U.jsxs)(A,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,ve(t,a,i)]},n))]}),l?(0,U.jsx)(k,{marginTop:1,children:(0,U.jsx)(d,{addMargin:!1,planContent:l})}):(0,U.jsxs)(k,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(A,{bold:!0,dimColor:!0,children:`Prompt`}),(0,U.jsx)(A,{wrap:`wrap`,children:u})]}),e.status===`failed`&&e.error&&(0,U.jsxs)(k,{flexDirection:`column`,marginTop:1,children:[(0,U.jsx)(A,{bold:!0,color:`error`,children:`Error`}),(0,U.jsx)(A,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Ee,U,De=e((()=>{Ee=t(M(),1),H(),P(),g(),he(),s(),R(),x(),_(),be(),we(),U=I()}));function W({status:e,label:t,suffix:n}){return(0,G.jsxs)(A,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function Oe({shell:e}){switch(e.status){case`completed`:return(0,G.jsx)(W,{status:`completed`,label:`done`});case`failed`:return(0,G.jsx)(W,{status:`failed`,label:`error`});case`killed`:return(0,G.jsx)(W,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,G.jsx)(W,{status:`running`})}}var G,ke=e((()=>{P(),G=I()}));function Ae({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,K.jsxs)(A,{children:[z(e.command,n,!0),` `,(0,K.jsx)(Oe,{shell:e})]});case`local_agent`:return(0,K.jsxs)(A,{children:[z(e.description,n,!0),` `,(0,K.jsx)(W,{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,K.jsxs)(A,{children:[z(t.workflowName??e.summary??e.description,n,!0),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`running`?`${t.agentCount} ${L(t.agentCount,`agent`)}`: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} ${L(t,`file`)}`:`${e.sessionsReviewing} ${L(e.sessionsReviewing,`session`)}`;return(0,K.jsxs)(A,{children:[e.description,` `,(0,K.jsxs)(A,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,K.jsx)(W,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var K,je=e((()=>{P(),R(),ce(),ke(),K=I()}));function Me({task:e,onDone:t,onBack:n,onKill:r}){let i=B(e.startTime,e.status===`running`,1e3,0);O({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-6),c=o.length-s.length;return(0,q.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,q.jsx)(F,{title:`Memory consolidation`,subtitle:(0,q.jsxs)(A,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,L(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,q.jsxs)(q.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,L(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(j,{children:[n&&(0,q.jsx)(D,{shortcut:`←`,action:`go back`}),(0,q.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,q.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:(0,q.jsxs)(k,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(A,{children:[(0,q.jsx)(A,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsx)(A,{color:`background`,children:`running`}):e.status===`completed`?(0,q.jsx)(A,{color:`success`,children:e.status}):(0,q.jsx)(A,{color:`error`,children:e.status})]}),s.length===0?(0,q.jsx)(A,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,q.jsxs)(q.Fragment,{children:[c>0&&(0,q.jsxs)(A,{dimColor:!0,children:[`(`,c,` earlier `,L(c,`turn`),`)`]}),s.map((e,t)=>(0,q.jsxs)(k,{flexDirection:`column`,children:[(0,q.jsx)(A,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,q.jsxs)(A,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,L(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var q,Ne=e((()=>{H(),P(),g(),ce(),q=I()}));async function Pe(e){let t=l(e.id);try{let e=await re(t,Le);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Fe({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=N(),[a,o]=(0,J.useState)(()=>Pe(e)),s=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Pe(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let c=()=>t(`Shell details dismissed`,{display:`system`});O({"confirm:yes":c},{context:`Confirmation`});let l=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())},u=le(e.command,280);return(0,Y.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:l,children:(0,Y.jsxs)(F,{title:`Shell details`,onCancel:c,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(A,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(j,{children:[r&&(0,Y.jsx)(D,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(D,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(k,{flexDirection:`column`,children:[(0,Y.jsxs)(A,{children:[(0,Y.jsx)(A,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(A,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(A,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(A,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(A,{children:[(0,Y.jsx)(A,{bold:!0,children:`Runtime:`}),` `,de((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(A,{wrap:`wrap`,children:[(0,Y.jsx)(A,{bold:!0,children:`Command:`}),` `,u]})]}),(0,Y.jsxs)(k,{flexDirection:`column`,children:[(0,Y.jsx)(A,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(A,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Ie,{outputPromise:s,columns:i})})]})]})})}function Ie({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(A,{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,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(k,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,Y.jsx)(A,{wrap:`truncate-end`,children:e},t))}),(0,Y.jsxs)(A,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${fe(r)}`:``]})]})}var J,Y,Le,Re=e((()=>{J=t(M(),1),b(),P(),g(),R(),ie(),f(),Y=I(),Le=8192}));function ze(e,t){return Object.values(e??{}).filter(T).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Be({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=p(e=>e.tasks),o=p(e=>e.foregroundedTaskId),s=i(),c=u(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),l=r,d=(0,Z.useRef)(!1),[f,m]=(0,Z.useState)(()=>{if(n)return d.current=!0,{mode:`detail`,itemId:n};let e=ze(l,o);return e.length===1?(d.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[h,g]=(0,Z.useState)(0);ge(`background-tasks-dialog`);let{bashTasks:_,agentTasks:v,workflowTasks:y,dreamTasks:b,allSelectableItems:x}=(0,Z.useMemo)(()=>{let e=Object.values(l??{}).filter(T).map(Ve).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===`local_agent`&&e.id!==o),r=e.filter(e=>e.type===`local_workflow`),i=e.filter(e=>e.type===`dream`);return{bashTasks:t,agentTasks:n,workflowTasks:r,dreamTasks:i,allSelectableItems:[...t,...n,...r,...i]}},[l,o]),S=x[h]??null;O({"confirm:previous":()=>g(e=>Math.max(0,e-1)),"confirm:next":()=>g(e=>Math.min(x.length-1,e+1)),"confirm:yes":()=>{let e=x[h];e&&m({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:f.mode===`list`});let C=t=>{if(f.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=x[h];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?w(n.id):n.type===`local_agent`&&n.status===`running`?E(n.id):n.type===`local_workflow`&&n.status===`running`?$(n.id,s):n.type===`dream`&&n.status===`running`&&ne(n.id))};async function w(e){await ee.kill(e,s)}async function E(e){await te.kill(e,s)}async function ne(e){await a.kill(e,s)}let M=(0,Z.useEffectEvent)(e);(0,Z.useEffect)(()=>{if(f.mode!==`list`){let e=l?.[f.itemId];(!e||e.type!==`local_workflow`&&!T(e))&&(d.current?M(`Background tasks dialog dismissed`,{display:`system`}):m({mode:`list`}))}let e=x.length;h>=e&&e>0&&g(e-1)},[f,l,h,x,M]);let N=()=>{d.current&&x.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(d.current=!1,m({mode:`list`}))};if(f.mode!==`list`&&l){let t=l[f.itemId];if(!t)return null;switch(t.type){case`local_bash`:return(0,Q.jsx)(Fe,{shell:t,onDone:e,onKillShell:()=>void w(t.id),onBack:N},`shell-${t.id}`);case`local_agent`:return(0,Q.jsx)(Te,{agent:t,onDone:e,onKillAgent:()=>void E(t.id),onBack:N},`agent-${t.id}`);case`local_workflow`:{let e=t.status===`running`?()=>$(t.id,s):void 0;return(0,Q.jsx)(k,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),N()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Q.jsx)(F,{title:t.workflowName,subtitle:(0,Q.jsxs)(A,{dimColor:!0,children:[t.status,t.summary?` · ${t.summary}`:``]}),onCancel:N,inputGuide:()=>(0,Q.jsxs)(j,{children:[(0,Q.jsx)(D,{shortcut:`←`,action:`go back`}),(0,Q.jsx)(D,{shortcut:`Esc`,action:`close`}),e&&(0,Q.jsx)(D,{shortcut:`x`,action:`stop`})]}),children:t.status===`failed`&&t.error?(0,Q.jsxs)(A,{color:`error`,children:[`失败原因:`,t.error]}):null})},`workflow-${t.id}`)}case`dream`:return(0,Q.jsx)(Me,{task:t,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:N,onKill:t.status===`running`?()=>void ne(t.id):void 0},`dream-${t.id}`)}}let P=se(_,e=>e.status===`running`),I=se(v,e=>e.status===`running`),re=oe([...P>0?[(0,Q.jsxs)(A,{children:[P,` `,P===1?`active shell`:`active shells`]},`shells`)]:[],...I>0?[(0,Q.jsxs)(A,{children:[I,` `,I===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Q.jsx)(A,{children:` · `},`separator-${e}`)),ie=[(0,Q.jsx)(D,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Q.jsx)(D,{shortcut:`Enter`,action:`view`},`enter`),...(S?.type===`local_bash`||S?.type===`local_agent`||S?.type===`local_workflow`||S?.type===`dream`)&&S.status===`running`?[(0,Q.jsx)(D,{shortcut:`x`,action:`stop`},`kill`)]:[],...v.some(e=>e.status===`running`)?[(0,Q.jsx)(D,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Q.jsx)(D,{shortcut:`←/Esc`,action:`close`},`esc`)],ae=()=>e(`Background tasks dialog dismissed`,{display:`system`});function L(e){return e.pending?(0,Q.jsxs)(A,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsx)(j,{children:ie})}return(0,Q.jsx)(k,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:C,children:(0,Q.jsx)(F,{title:`Background tasks`,subtitle:re,onCancel:ae,color:`background`,inputGuide:L,children:x.length===0?(0,Q.jsx)(A,{dimColor:!0,children:`No tasks currently running`}):(0,Q.jsxs)(k,{flexDirection:`column`,children:[_.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,children:[v.length>0&&(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Shells`]}),` (`,_.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:_.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),v.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,marginTop:+(_.length>0),children:[(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Local agents`]}),` (`,v.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:v.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),y.length>0&&(0,Q.jsxs)(k,{flexDirection:`column`,marginTop:+(_.length>0||v.length>0),children:[(0,Q.jsxs)(A,{dimColor:!0,children:[(0,Q.jsxs)(A,{bold:!0,children:[` `,`Workflows`]}),` (`,y.length,`)`]}),(0,Q.jsx)(k,{flexDirection:`column`,children:y.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})]}),b.length>0&&(0,Q.jsx)(k,{flexDirection:`column`,marginTop:+(_.length>0||v.length>0||y.length>0),children:(0,Q.jsx)(k,{flexDirection:`column`,children:b.map(e=>(0,Q.jsx)(X,{item:e,isSelected:e.id===S?.id},e.id))})})]})})})}function Ve(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.command,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`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function X({item:e,isSelected:t}){let{columns:n}=N(),i=Math.max(30,n-26);return(0,Q.jsxs)(k,{flexDirection:`row`,children:[(0,Q.jsx)(A,{children:t?`${r.pointer} `:` `}),(0,Q.jsx)(A,{color:t?`suggestion`:void 0,children:(0,Q.jsx)(Ae,{task:e.task,maxActivityWidth:i})})]})}var Z,Q,$,He=e((()=>{n(),Z=t(M(),1),b(),c(),v(),w(),S(),C(),ae(),_e(),P(),g(),y(),De(),je(),Ne(),Re(),m(),Q=I(),$=E}));export{H as a,Ce as i,He as n,B as o,we as r,Be as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{_i as t,vi as n}from"./loadAgentsDir-C1LkW7gl.js";import{I as r,Lt as i,P as a,ai as o,kt as s,t as c,y as l}from"./src-DL3w8VPk.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{b as d,h as f}from"./settings-DKN4xSpQ.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{t as h}from"./select-C_KXmqbI.js";import{t as g}from"./CustomSelect-B46Eh0gU.js";var _=e(o(),1);p(),c(),n(),f(),g();var v=u();function y({onAccept:e}){let[n,o]=_.useState(null);_.useEffect(()=>{if(n!==null){let e=n,r=setTimeout(()=>t(e));return()=>clearTimeout(r)}},[n]),_.useEffect(()=>{m(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:m(`tengu_bypass_permissions_mode_dialog_accept`,{}),d(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let u=(0,_.useCallback)(()=>{o(0)},[]);return n===null?(0,v.jsxs)(l,{title:`WARNING: Work Mate running in Bypass Permissions mode`,color:`error`,onCancel:u,children:[(0,v.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(a,{children:[`In Bypass Permissions mode, Work Mate will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(s,{}),`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)(a,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(i,{url:`https://code.workmate.com/docs/en/security`})]}),(0,v.jsx)(h,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t}from"./SelectMulti-CNE06VAN.js";import{n}from"./select-C_KXmqbI.js";var r=e((()=>{t(),n()}));export{r as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Gb as i,Ub as a,Wb as o,Yb as s,lp as c,up as l}from"./loadAgentsDir-C1LkW7gl.js";import{C as u,Gt as d,I as f,P as p,T as m,ai as h,ot as g,t as _,y as ee}from"./src-DL3w8VPk.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{n as y,t as b}from"./cwd-BcO6WHKo.js";import{An as x,Hr as S,Ln as C,Lr as w,Rr as T,Ur as E}from"./settings-DKN4xSpQ.js";import{i as D,t as O}from"./execFileNoThrow-BsfuytkN.js";import{l as k,o as A}from"./stringUtils-BQm3OfeJ.js";import{_ as te,x as ne}from"./startupProfiler-DTs9w9EN.js";import{i as re,t as ie}from"./overlayContext-CMV7nYR9.js";import{r as ae}from"./detectRepository-DfX8xXw2.js";import{join as oe,resolve as se}from"path";import{access as j}from"fs/promises";async function M(){if(!await T()||await P())return null;let{stdout:e,code:t}=await O(S(),[`--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 O(S(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:F,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=le(n),o=I-a.size;if(o>0){let e=await ue(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function ce(){if(!await T()||await P())return new Map;let{stdout:e,code:t}=await O(S(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:F,preserveOutputOnError:!1});return t===0?N(e):new Map}function le(e){let t=e.trim().split(`
|
|
2
|
+
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<I&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function N(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=I)break;if(e.length>L)continue;let n=e.split(`
|
|
3
|
+
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=R)continue;o.lines.push(`${t}`),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function P(){let e=await w(b());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>j(oe(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function ue(e){let{stdout:t,code:n}=await O(S(),[`--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((()=>{y(),ae(),D(),x(),E(),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([M(),ce()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,H.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>U;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var H,U,fe=e((()=>{H=t(h(),1),B(),U=400}));function pe(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function W(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:`${n.slice(0,29)}…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(r?.type===`user`){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(pe(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&W(e)){let t=e.content.split(`
|
|
5
|
+
`),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(h(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:i,isUntracked:a}){let{columns:o}=g(),{firstLine:s,fileContent:l}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=C(se(b(),e));return{firstLine:t?.split(`
|
|
6
|
+
`)[0]??null,fileContent:t??void 0}},[e]);return a?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(p,{bold:!0,children:e}),(0,J.jsx)(p,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(u,{padding:4}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(p,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(p,{bold:!0,children:e})}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(p,{bold:!0,children:e})}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(p,{bold:!0,children:e}),i&&(0,J.jsx)(p,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(u,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(p,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(c,{patch:t,filePath:e,firstLine:s,fileContent:l,dim:!1,width:o-2-2},n))}),i&&(0,J.jsx)(p,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(h(),1),s(),_(),y(),x(),l(),J=v()}));function be({files:e,selectedIndex:t}){let{columns:n}=g(),{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)(p,{dimColor:!0,children:`No changed files`});let a=e.slice(r,i),o=r>0,s=i<e.length,c=e.length>Z,l=Math.max(20,n-16-3-4);return(0,X.jsxs)(f,{flexDirection:`column`,children:[c&&(0,X.jsx)(p,{dimColor:!0,children:o?` ↑ ${r} more ${k(r,`file`)}`:` `}),a.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:l},e.path)),c&&(0,X.jsx)(p,{dimColor:!0,children:s?` ↓ ${e.length-i} more ${k(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)(f,{flexDirection:`row`,children:[(0,X.jsx)(p,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(f,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(p,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(p,{children:[e.linesAdded>0&&(0,X.jsxs)(p,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(p,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(p,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(h(),1),s(),_(),te(),A(),X=v(),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),[a,o]=(0,Q.useState)(`list`),[s,c]=(0,Q.useState)(0),[l,u]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[l],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[s],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{l>=h.length&&u(Math.max(0,h.length-1))},[h.length,l]);let x=(0,Q.useRef)(l);(0,Q.useEffect)(()=>{x.current!==l&&(c(0),x.current=l)},[l]),re(`diff-dialog`),d({"diff:previousSource":()=>{a===`detail`?o(`list`):a===`list`&&h.length>1&&u(e=>Math.max(0,e-1))},"diff:nextSource":()=>{a===`list`&&h.length>1&&u(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{a===`detail`&&o(`list`)},"diff:viewDetails":()=>{a===`list`&&y&&o(`detail`)},"diff:previousFile":()=>{a===`list`&&c(e=>Math.max(0,e-1))},"diff:nextFile":()=>{a===`list`&&c(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(p,{dimColor:!0,children:[v.stats.filesCount,` `,k(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(p,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(p,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,T=h.length>1?(0,$.jsxs)(f,{children:[l>0&&(0,$.jsx)(p,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===l,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(p,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),l<h.length-1&&(0,$.jsx)(p,{dimColor:!0,children:` ▶`})]}):null,E=i(`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)(p,{children:[C,w&&(0,$.jsxs)(p,{dimColor:!0,children:[` `,w]})]});function A(){a===`detail`?o(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(ee,{title:O,onCancel:A,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(p,{children:[`Press `,e.keyName,` again to exit`]}):a===`list`?(0,$.jsxs)(m,{children:[h.length>1&&(0,$.jsx)(p,{children:`←/→ source`}),(0,$.jsx)(p,{children:`↑/↓ select`}),(0,$.jsx)(p,{children:`Enter view`}),(0,$.jsxs)(p,{children:[E,` close`]})]}):(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{children:`← back`}),(0,$.jsxs)(p,{children:[E,` close`]})]}),children:[T,S,v.files.length===0?(0,$.jsx)(f,{marginTop:1,children:(0,$.jsx)(p,{dimColor:!0,children:D})}):a===`list`?(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:s})}):(0,$.jsx)(f,{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(h(),1),ie(),fe(),_e(),_(),a(),o(),A(),ye(),Ce(),$=v()}))();export{Te as DiffDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./Doctor-By_y3C2V.js";e();export{t as Doctor};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Bw as o,C_ as s,Dp as c,Dx as l,El as u,Ex as d,Iw as f,KC as p,Lw as m,Op as h,Ox as g,Rw as _,SS as v,Tl as ee,Tx as te,Ub as y,Xi as b,YC as x,Yi as S,__ as C,_h as w,b_ as T,vh as ne,wl as re,wx as ie,xS as ae,x_ as oe}from"./loadAgentsDir-C1LkW7gl.js";import{Gt as se,I as E,P as D,ai as ce,t as O,x as k}from"./src-DL3w8VPk.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{Z as j,zt as M}from"./state-BowF111d.js";import{An as N,Fn as P,R as F,V as I}from"./settings-DKN4xSpQ.js";import{l as L,o as R}from"./stringUtils-BQm3OfeJ.js";import{f as z,gn as B,pn as V,s as H}from"./model-BwBE0Pt5.js";import{n as U,t as W}from"./ValidationErrorsList-BLtP647v.js";import{f as G,g as le,h as ue,i as de,n as fe,o as pe,p as me,r as he}from"./pidLock-D9do1Afy.js";import{n as ge,t as _e}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{n as ve,t as ye}from"./McpParsingWarnings-DZejAh8b.js";import{n as be,t as xe}from"./PressEnterToContinue-DZc_s_pE.js";import{n as Se,t as Ce}from"./useSettingsErrors-DutJBiKZ.js";import{n as we,t as Te}from"./shadowedRuleDetection-Df-kZ_pK.js";import{n as Ee,r as De,t as K}from"./statusNoticeHelpers-X75JNlx5.js";import{join as q}from"path";function Oe(){if(!o())return null;let e=f();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)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(D,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`Location: `}),(0,J.jsx)(D,{dimColor:!0,children:m()})]}),(0,J.jsxs)(E,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`error`,children:`[Error]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(E,{flexDirection:`column`,children:[(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{dimColor:!0,children:`└ `}),(0,J.jsx)(D,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(D,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(E,{marginLeft:3,children:(0,J.jsxs)(D,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,ke=e((()=>{O(),_(),J=A()}));function Ae(){if(!p.isSupportedPlatform()||!p.isSandboxEnabledInSettings())return null;let e=p.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(E,{flexDirection:`column`,children:[(0,Y.jsx)(D,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(D,{children:[`└ Status: `,(0,Y.jsx)(D,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(D,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(D,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(D,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,je=e((()=>{O(),x(),Y=A()}));async function Me(){let e=T(await oe());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:`agentsmd_files`,severity:`warning`,message:e.length===1?`Large AGENTS.md file detected (${e[0].content.length.toLocaleString()} chars > ${C.toLocaleString()})`:`${e.length} large AGENTS.md files detected (each > ${C.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:C}}async function Ne(e){if(!e)return null;let t=Ee(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:b(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 X(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await w(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+b(((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 Pe(e){let t=Te(await e(),{sandboxAutoAllowEnabled:p.isSandboxingEnabled()&&p.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${I(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Fe(e,t,n){let[r,i,a,o]=await Promise.all([Me(),Ne(t),X(e,n,t),Pe(n)]);return{agentsMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ie=e((()=>{S(),ne(),s(),z(),F(),we(),x(),De(),R(),Z=25e3}));function Le({onDone:e}){let t=h(e=>e.agentDefinitions),r=h(e=>e.mcp.tools),i=h(e=>e.toolPermissionContext),o=h(e=>e.plugins.errors);ge();let s=(0,Q.useMemo)(()=>r||[],[r]),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(null),[m,_]=(0,Q.useState)(null),v=Se().filter(e=>e.mcpErrorMetadata===void 0),y=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:ie,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:re,upperLimit:ee},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...V(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=g(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{ue().then(l),(async()=>{let e=q(n(),`agents`),r=q(j(),`.workmate`,`agents`),{activeAgents:a,allAgents:o,failedFiles:c}=t,[l,u]=await Promise.all([P(e),P(r)]),f={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:l,projectDirExists:u,failedFiles:c};d(f);let m=await Fe(s,{activeAgents:a,allAgents:o,failedFiles:c},async()=>i);if(p(m),pe()){let e=q(G(),`claude`,`locks`),t=fe(e),n=he(e);_({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else _({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,s,t]);let b=(0,Q.useCallback)(()=>{e(`Work Mate diagnostics dismissed`,{display:`system`})},[e]);return se({"confirm:yes":b,"confirm:no":b},{context:`Confirmation`}),c?(0,$.jsxs)(k,{children:[(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(D,{children:[`└ Currently running: `,c.installationType,` (`,c.version,`)`]}),c.packageManager&&(0,$.jsxs)(D,{children:[`└ Package manager: `,c.packageManager]}),(0,$.jsxs)(D,{children:[`└ Path: `,c.installationPath]}),(0,$.jsxs)(D,{children:[`└ Invoked: `,c.invokedBinary]}),(0,$.jsxs)(D,{children:[`└ Config install method: `,c.configInstallMethod]}),(0,$.jsxs)(D,{children:[`└ Search: `,c.ripgrepStatus.working?`OK`:`Not working`,` (`,c.ripgrepStatus.mode===`embedded`?`bundled`:c.ripgrepStatus.mode===`builtin`?`vendor`:c.ripgrepStatus.systemPath||`system`,`)`]}),c.ripgrepStatus.note&&(0,$.jsxs)(D,{color:`warning`,children:[`└ Note: `,c.ripgrepStatus.note]}),c.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsxs)(D,{color:`warning`,children:[`Recommendation: `,c.recommendation.split(`
|
|
2
|
+
`)[0]]}),(0,$.jsx)(D,{dimColor:!0,children:c.recommendation.split(`
|
|
3
|
+
`)[1]})]}),c.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),(0,$.jsx)(D,{color:`warning`,children:`Warning: Multiple installations found`}),c.multipleInstallations.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.type,` at `,e.path]},t))]}),c.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(D,{}),c.warnings.map((e,t)=>(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsxs)(D,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(D,{children:[`Fix: `,e.fix]})]},t))]}),v.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(D,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:v})]})]}),(0,$.jsx)(Ae,{}),(0,$.jsx)(ye,{}),(0,$.jsx)(Oe,{}),y.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Environment Variables`}),y.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(D,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),m?.enabled&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Version Locks`}),m.staleLocksCleaned>0&&(0,$.jsxs)(D,{dimColor:!0,children:[`└ Cleaned `,m.staleLocksCleaned,` stale lock(s)`]}),m.locks.length===0?(0,$.jsx)(D,{dimColor:!0,children:`└ No active version locks`}):m.locks.map((e,t)=>(0,$.jsxs)(D,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(D,{children:`(running)`}):(0,$.jsx)(D,{color:`warning`,children:`(stale)`})]},t))]}),u?.failedFiles&&u.failedFiles.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ Failed to parse `,u.failedFiles.length,` agent file(s):`]}),u.failedFiles.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),o.length>0&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(D,{color:`error`,children:[`└ `,o.length,` plugin error(s) detected:`]}),o.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ae(e)]},t))]}),f?.unreachableRulesWarning&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.unreachableRulesWarning.message]})]}),f.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f&&(f.agentsMdWarning||f.agentWarning||f.mcpWarning)&&(0,$.jsxs)(E,{flexDirection:`column`,children:[(0,$.jsx)(D,{bold:!0,children:`Context Usage Warnings`}),f.agentsMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.agentsMdWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Files:`]}),f.agentsMdWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.agentWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ Top contributors:`]}),f.agentWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]}),f.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(D,{children:[`└`,` `,(0,$.jsxs)(D,{color:`warning`,children:[a.warning,` `,f.mcpWarning.message]})]}),(0,$.jsxs)(D,{children:[` `,`└ MCP servers:`]}),f.mcpWarning.details.map((e,t)=>(0,$.jsxs)(D,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(E,{children:(0,$.jsx)(xe,{})})]}):(0,$.jsx)(k,{children:(0,$.jsx)(D,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,Re=e((()=>{i(),Q=t(ce(),1),ke(),ve(),B(),r(),M(),O(),be(),je(),U(),Ce(),_e(),y(),c(),v(),Ie(),le(),l(),N(),de(),d(),u(),me(),$=A()}));export{Re as n,Le as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{St as r,Tt as i,cT as a,cx as o,ft as s,gi as c,lx as l,ow as u,sT as d,sw as f,ui as p,vi as m,vr as h,wt as g,yt as _}from"./loadAgentsDir-C1LkW7gl.js";import{I as v,P as y,ai as b,t as x,y as S}from"./src-DL3w8VPk.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{c as w,i as T}from"./debug-8DCufdSp.js";import{i as E,t as D}from"./execFileNoThrow-BsfuytkN.js";import{n as O,r as k}from"./analytics-DJobLaWP.js";import{n as A,t as j}from"./select-C_KXmqbI.js";import{r as M,t as N}from"./Spinner-DwsJJUtn.js";function P(){(h(),e(p)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,r]=(0,I.useState)(`loading`),[a,o]=(0,I.useState)([]),[c,u]=(0,I.useState)(0),[f,p]=(0,I.useState)(),m=_();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await D(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
|
+
`).filter(e=>e.trim()!==``),o(e)),m){let{stdout:t}=await D(`git`,[`rev-list`,`--count`,`${m.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(u(n),e.length===0&&n===0){r(`removing`),s().then(()=>{process.chdir(m.originalCwd),l(m.originalCwd),P(),d.cache.clear?.(),p(`Worktree removed (no changes)`)}).catch(e=>{w(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`)}).then(()=>{r(`done`)});return}else r(`asking`)}}e()},[m]),(0,I.useEffect)(()=>{n===`done`&&e(f)},[n,e,f]),!m)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function h(e){if(!m)return;let t=!!m.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:a.length}),await g(),process.chdir(m.originalCwd),l(m.originalCwd),P(),d.cache.clear?.(),p(t?`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${m.tmuxSessionName}`:`Worktree kept. Your work is saved at ${m.worktreePath} on branch ${m.worktreeBranch}`),r(`done`);else if(e===`keep-kill-tmux`)r(`keeping`),k(`tengu_worktree_kept`,{commits:c,changed_files:a.length}),m.tmuxSessionName&&await i(m.tmuxSessionName),await g(),process.chdir(m.originalCwd),l(m.originalCwd),P(),d.cache.clear?.(),p(`Worktree kept at ${m.worktreePath} on branch ${m.worktreeBranch}. Tmux session terminated.`),r(`done`);else if(e===`remove`||e===`remove-with-tmux`){r(`removing`),k(`tengu_worktree_removed`,{commits:c,changed_files:a.length}),m.tmuxSessionName&&await i(m.tmuxSessionName);try{await s(),process.chdir(m.originalCwd),l(m.originalCwd),P(),d.cache.clear?.()}catch(e){w(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`),r(`done`);return}let e=t?` Tmux session terminated.`:``;c>0&&a.length>0?p(`Worktree removed. ${c} ${c===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):c>0?p(`Worktree removed. ${c} ${c===1?`commit`:`commits`} on ${m.worktreeBranch} ${c===1?`was`:`were`} discarded.${e}`):a.length>0?p(`Worktree removed. Uncommitted changes were discarded.${e}`):p(`Worktree removed.${e}`),r(`done`)}}if(n===`keeping`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(v,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(N,{}),(0,L.jsx)(y,{children:`Removing worktree…`})]});let b=m.worktreeBranch,x=a.length>0,C=c>0,T=``;T=x&&C?`You have ${a.length} uncommitted ${a.length===1?`file`:`files`} and ${c} ${c===1?`commit`:`commits`} on ${b}. All will be lost if you remove.`:x?`You have ${a.length} uncommitted ${a.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:C?`You have ${c} ${c===1?`commit`:`commits`} on ${b}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function E(){if(t){t();return}h(`keep`)}let O=x||C?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!m.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${m.worktreePath}. Reattach with: tmux attach -t ${m.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${m.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${m.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(S,{title:`Exiting worktree session`,subtitle:T,onCancel:E,children:(0,L.jsx)(j,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:h})})}var I,L,R=t((()=>{I=n(b(),1),O(),T(),x(),E(),a(),o(),r(),A(),M(),L=C()}));function z(){return f(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await c(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{u(),m(),R(),V=C(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
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,ai as o,t as s,y as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-DJobLaWP.js";import{i as f,o as p,r as m,s as h,t as g}from"./grove-Dq8QbQ9o.js";import{t as _}from"./select-C_KXmqbI.js";import{t as v}from"./CustomSelect-B46Eh0gU.js";var y=e(o(),1);u(),s(),v();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 Work Mate `}),(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 Work Mate`}),(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 Work Mate 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,v]=(0,y.useState)(null);if((0,y.useEffect)(()=>{async function t(){let[t,n]=await Promise.all([f(),m()]),i=n.success?n.data:null;v(i);let a=g(t,n,e);if(l(a),!a){o(`skip_rendering`);return}p(),d(`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 h(!0),d(`tengu_grove_policy_submitted`,{state:!0,dismissable:u?.notice_is_grace_period});break;case`accept_opt_out`:await h(!1),d(`tengu_grove_policy_submitted`,{state:!1,dismissable:u?.notice_is_grace_period});break;case`defer`:d(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:d(`tengu_grove_policy_escaped`,{});break}o(e)}let T=u?.domain_excluded?[{label:`Accept terms · Help improve Work Mate: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Work Mate: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Work Mate: 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)(_,{options:[...T,...u?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>w(e),onCancel:E})]})]})}export{w as GroveDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dp as e,Tp as t}from"./loadAgentsDir-C1LkW7gl.js";import{I as n,P as r,kn as i,t as a,y as o}from"./src-DL3w8VPk.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{C as c,T as l,x as u}from"./debug-8DCufdSp.js";import{t as d}from"./KeybindingProviderSetup-Bn1jzN5F.js";import{t as f}from"./select-C_KXmqbI.js";import{t as p}from"./CustomSelect-B46Eh0gU.js";import{t as m}from"./renderOptions-Zqfm2U1y.js";a(),e(),u(),p();var h=s();function g({filePath:e,errorDescription:t,onExit:i,onReset:a}){return(0,h.jsxs)(o,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,h.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,h.jsxs)(r,{children:[`The configuration file at `,(0,h.jsx)(r,{bold:!0,children:e}),` contains invalid JSON.`]}),(0,h.jsx)(r,{children:t})]}),(0,h.jsxs)(n,{flexDirection:`column`,children:[(0,h.jsx)(r,{bold:!0,children:`Choose an option:`}),(0,h.jsx)(f,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():a()},onCancel:i})]})]})}var _=`dark`;async function v({error:e}){let n={...m(!1),theme:_};await new Promise(async r=>{let{unmount:a}=await i((0,h.jsx)(t,{children:(0,h.jsx)(d,{children:(0,h.jsx)(g,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{a(),r(),process.exit(1)},onReset:()=>{l(e.filePath,c(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),a(),r(),process.exit(0)}})})}),n)})}export{v as showInvalidConfigDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{P as e,t,y as n}from"./src-DL3w8VPk.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";import{n as i,t as a}from"./ValidationErrorsList-BLtP647v.js";import{t as o}from"./select-C_KXmqbI.js";import{t as s}from"./CustomSelect-B46Eh0gU.js";t(),s(),i();var c=r();function l({settingsErrors:t,onContinue:r,onExit:i}){function s(e){e===`exit`?i():r()}return(0,c.jsxs)(n,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,c.jsx)(a,{errors:t}),(0,c.jsx)(e,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,c.jsx)(o,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:s})]})}export{l as InvalidSettingsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hw as t,Rw as n,Vw as r,zw as i}from"./loadAgentsDir-C1LkW7gl.js";import{Vt as a,ai as o,t as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{c as l,i as u}from"./debug-8DCufdSp.js";import{Jn as d,qn as f}from"./settings-DKN4xSpQ.js";import{l as p,o as m}from"./stringUtils-BQm3OfeJ.js";import{n as h,t as g}from"./notifications-B0DTaYoy.js";var _=e(o(),1);g(),d(),u(),m(),s(),n();var v=c();function y({children:e}){let{addNotification:n,removeNotification:o}=h();return(0,v.jsx)(a,{loadBindings:r,subscribeToChanges:t,initWatcher:i,onWarnings:(0,_.useCallback)((e,t)=>{let r=`keybinding-config-warning`;if(e.length===0){o(r);return}let i=f(e,e=>e.severity===`error`),a=f(e,e=>e.severity===`warning`),s;s=i>0&&a>0?`Found ${i} keybinding ${p(i,`error`)} and ${a} ${p(a,`warning`)}`:i>0?`Found ${i} keybinding ${p(i,`error`)}`:`Found ${a} keybinding ${p(a,`warning`)}`,s+=` · /doctor for details`,n({key:r,text:s,color:i>0?`error`:`warning`,priority:i>0?`immediate`:`high`,timeoutMs:6e4})},[n,o]),onDebugLog:l,children:e})}export{y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as n,Ap as r,Dp as i,Hv as a,Iv as o,Op as s,Q_ as c,X_ as l,Yv as u,_y as d,av as f,cv as p,cw as m,cy as h,db as ee,ev as g,ey as te,hb as ne,hy as re,kp as ie,lw as _,ly as v,mb as y,my as b,nv as x,ny as ae,py as S,rv as C,sv as w,sy as T,ty as E,ub as D}from"./loadAgentsDir-C1LkW7gl.js";import{ai as O}from"./src-DL3w8VPk.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{ut as oe,zt as A}from"./state-BowF111d.js";import{L as j,N as M,c as se,i as ce}from"./debug-8DCufdSp.js";import{rt as N,tt as P}from"./settings-DKN4xSpQ.js";import{c as F,l as I,o as L}from"./log-DaILwWJa.js";import{n as R,r as z}from"./analytics-DJobLaWP.js";import{o as B,t as V}from"./localSearch-DFo_WTMm.js";import{n as H,t as U}from"./omit-Dl1Us_PY.js";import{n as W,t as le}from"./notifications-B0DTaYoy.js";function G(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function K(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>G(e))),r=t.filter(e=>!n.has(G(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function ue(e,t=!1){let i=ie(),u=s(e=>e.authVersion),d=s(e=>e.mcp.pluginReconnectKey),m=r(),h=(0,q.useRef)(new Map),{addNotification:ne}=W(),C=(0,q.useRef)([]),w=(0,q.useRef)(null),O=(0,q.useCallback)(()=>{w.current=null;let e=C.current;e.length!==0&&(C.current=[],m(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,s=a.type===`disabled`||a.type===`failed`?e??[]:e,c=a.type===`disabled`||a.type===`failed`?r??[]:r,l=a.type===`disabled`||a.type===`failed`?i??[]:i,u=P(a.name),d=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),f=s===void 0?n.tools:[..._(n.tools,e=>e.name?.startsWith(u)),...s],p=c===void 0?n.commands:[..._(n.commands,e=>o(e,a.name)),...c],m=l===void 0?n.resources:{...n.resources,...l.length>0?{[a.name]:l}:H(n.resources,a.name)};n={...n,clients:d,tools:f,commands:p,resources:m}}return{...t,mcp:n}}))},[m]),k=(0,q.useCallback)(e=>{C.current.push(e),w.current===null&&(w.current=setTimeout(O,16))},[O]),A=(0,q.useCallback)(({client:e,tools:t,commands:r,resources:i})=>{switch(k({...e,tools:t,commands:r,resources:i}),e.type){case`connected`:p(e.client,e.name,m),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(l(e.name,e.config).catch(()=>{se(`Failed to invalidate the server cache: ${e.name}`)}),v(e.name)){F(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=de(t);F(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=h.current.get(e.name);r&&(clearTimeout(r),h.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(v(e.name)){F(e.name,`Server disabled during reconnection, stopping retry`),h.current.delete(e.name);return}k({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await f(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){F(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),h.current.delete(e.name),A(i);return}if(F(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){F(e.name,`Max reconnection attempts (${J}) reached, giving up`),h.current.delete(e.name),A(i);return}}catch(i){let a=Date.now()-r;if(I(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){F(e.name,`Max reconnection attempts (${J}) reached, giving up`),h.current.delete(e.name),k({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);F(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);h.current.set(e.name,n)})}})()}else k({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(y,async()=>{F(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=g.cache.get(e.name);g.cache.delete(e.name);let n=await g(e),r=n.length;t?t.then(e=>{z(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{z(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):z(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),k({...e,tools:n})}catch(t){I(e.name,`Failed to refresh tools after list_changed notification: ${M(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(D,async()=>{F(e.name,`Received prompts/list_changed notification, refreshing prompts`),z(`tengu_mcp_list_changed`,{type:`prompts`});try{c.cache.delete(e.name);let[t,n]=await Promise.all([c(e),Promise.resolve([])]);k({...e,commands:[...t,...n]}),V()}catch(t){I(e.name,`Failed to refresh prompts after list_changed notification: ${M(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(ee,async()=>{F(e.name,`Received resources/list_changed notification, refreshing resources`),z(`tengu_mcp_list_changed`,{type:`resources`});try{n.cache.delete(e.name);{let t=await n(e);k({...e,resources:t})}}catch(t){I(e.name,`Failed to refresh resources after list_changed notification: ${M(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[k]),j=oe();return(0,q.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await T(e),i={...n,...e};K(m,r),m(e=>{let{stale:t,...n}=a(e.mcp,i);for(let e of t){let t=h.current.get(e.name);t&&(clearTimeout(t),h.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,l(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),o=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:v(e)?`disabled`:`pending`,config:t}));return o.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...o]}}})}n().catch(e=>{I(`useManageMCPConnections`,`Failed to initialize servers as pending: ${M(e)}`)})},[t,e,m,j,d]),(0,q.useEffect)(()=>{let n=!1;async function r(){let r;t||E()?r=Promise.resolve({}):(b(),r=re());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await T(e,r);if(n)return;K(m,a);let o={...i,...e},s=Object.fromEntries(Object.entries(o).filter(([e])=>!v(e)));x(A,s).catch(e=>{I(`useManageMcpConnections`,`Failed to get MCP resources: ${M(e)}`)});let c={};if(!t){if(c=ae(await r).allowed,n)return;if(Object.keys(c).length>0){let{servers:e}=te(c,o);c=e}if(Object.keys(c).length>0){m(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(c).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:v(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(c).filter(([e])=>!v(e)));x(A,e).catch(e=>{I(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${M(e)}`)})}}let l={...o,...c},u={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0};for(let[e,t]of Object.entries(l))t.scope===`enterprise`?u.enterprise++:t.scope===`user`?u.global++:t.scope===`project`?u.project++:t.scope===`local`?u.user++:t.scope===`dynamic`?u.plugin++:t.scope===`claudeai`&&u.claudeai++;z(`tengu_mcp_servers`,{...u})}return r(),()=>{n=!0}},[t,e,A,m,u,j,d]),(0,q.useEffect)(()=>{let e=h.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),w.current!==null&&(clearTimeout(w.current),w.current=null,O())}},[O]),{reconnectMcpServer:(0,q.useCallback)(async e=>{let t=i.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let n=h.current.get(e);n&&(clearTimeout(n),h.current.delete(e));let r=await f(e,t.config);return A(r),r},[i,A]),toggleMcpServer:(0,q.useCallback)(async e=>{let t=i.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=h.current.get(e);n&&(clearTimeout(n),h.current.delete(e)),S(e,!1),t.type===`connected`&&await l(e,t.config),k({name:e,type:`disabled`,config:t.config})}else{S(e,!0),k({name:e,type:`pending`,config:t.config});let n=await f(e,t.config);A(n)}},[i,k,A])}}function de(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var q,J,Y,X,fe=e((()=>{q=t(O(),1),A(),C(),B(),ne(),U(),m(),R(),h(),ce(),le(),i(),j(),L(),w(),d(),N(),u(),J=5,Y=1e3,X=3e4}));function pe(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function me(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function he({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=ue(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ge=e((()=>{Z=t(O(),1),fe(),Q=k(),$=(0,Z.createContext)(null)}));export{me as i,ge as n,pe as r,he as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Ap as i,Bv as a,Cv as o,Dp as s,Gv as c,Kv as l,Lv as ee,My as u,Op as te,Ub as ne,Uv as d,Vv as re,X_ as f,Yb as p,Yv as m,ad as h,bv as g,cy as _,hv as ie,id as v,iy as ae,jy as oe,rv as se,xv as ce}from"./loadAgentsDir-C1LkW7gl.js";import{D as y,H as le,I as b,Lt as ue,P as x,T as S,Wt as de,ai as C,dr as fe,hn as pe,j as w,ot as me,t as T,y as E}from"./src-DL3w8VPk.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{L as O,N as he}from"./debug-8DCufdSp.js";import{$ as k,en as ge,et as A,rt as j,tn as M}from"./settings-DKN4xSpQ.js";import{c as _e,o as N}from"./log-DaILwWJa.js";import{l as P,n as ve,o as F}from"./stringUtils-BQm3OfeJ.js";import{n as I,r as L}from"./analytics-DJobLaWP.js";import{St as R,ht as ye}from"./model-BwBE0Pt5.js";import{n as be,t as xe}from"./TextInput-7uqPhq9T.js";import{i as Se,n as z,r as Ce}from"./MCPConnectionManager-ChN4Ayjk.js";import{n as we,t as B}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{t as Te}from"./select-C_KXmqbI.js";import{r as V,t as H}from"./Spinner-DwsJJUtn.js";import{t as U}from"./CustomSelect-B46Eh0gU.js";function Ee({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,W.jsxs)(b,{children:[(0,W.jsx)(x,{bold:!0,children:`Capabilities: `}),(0,W.jsx)(x,{color:`text`,children:r.length>0?(0,W.jsx)(S,{children:r}):`none`})]})}var W,De=e((()=>{T(),W=D()}));function Oe(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function ke(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var G=e((()=>{}));function Ae({server:e,serverToolsCount:t,onViewTools:n,onCancel:s,onComplete:l,borderless:ne=!1}){let[p]=le(),m=we(),{columns:h}=me(),[g,_]=K.useState(!1),[ae,oe]=K.useState(null),se=te(e=>e.mcp),C=i(),[T,E]=K.useState(null),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),[A,j]=(0,K.useState)(!1),[M,N]=(0,K.useState)(null),[P,F]=(0,K.useState)(!1),[I,R]=(0,K.useState)(null),[be,z]=(0,K.useState)(!1),[B,V]=(0,K.useState)(!1),U=(0,K.useRef)(void 0),W=(0,K.useRef)(!1),[De,G]=(0,K.useState)(``),[Ae,je]=(0,K.useState)(0),[Me,J]=(0,K.useState)(null);(0,K.useEffect)(()=>()=>{W.current=!0,k.current?.abort(),U.current!==void 0&&clearTimeout(U.current)},[]);let Y=e.isAuthenticated||e.client.type===`connected`&&t>0,X=Ce(),Ne=K.useCallback(async()=>{j(!1),N(null),O(!0);try{let t=await X(e.name),n=t.client.type===`connected`;L(`tengu_claudeai_mcp_auth_completed`,{success:n}),n?l?.(`Authentication successful. Connected to ${e.name}.`):t.client.type===`needs-auth`?l?.(`Authentication successful, but server still requires authentication. You may need to manually restart Work Mate.`):l?.(`Authentication successful, but server reconnection failed. You may need to manually restart Work Mate for the changes to take effect.`)}catch(t){L(`tengu_claudeai_mcp_auth_completed`,{success:!1}),l?.(ke(t,e.name))}finally{O(!1)}},[X,e.name,l]),Pe=K.useCallback(async()=>{await f(e.name,{...e.config,scope:e.scope}),C(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=d(t.mcp.tools,e.name),i=a(t.mcp.commands,e.name),o=re(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:o}}}),L(`tengu_claudeai_mcp_clear_auth_completed`,{}),l?.(`Disconnected from ${e.name}.`),F(!1),R(null),z(!1)},[e.name,e.config,e.scope,C,l]);de(`confirm:no`,()=>{k.current?.abort(),k.current=null,_(!1),E(null)},{context:`Confirmation`,isActive:g}),de(`confirm:no`,()=>{j(!1),N(null)},{context:`Confirmation`,isActive:A}),de(`confirm:no`,()=>{F(!1),R(null),z(!1)},{context:`Confirmation`,isActive:P}),pe((e,t)=>{if(t.return&&A&&Ne(),t.return&&P)if(be)Pe();else{let e=`${ge().CLAUDE_AI_ORIGIN}/settings/connectors`;R(e),z(!0),u(e)}if(e===`c`&&!B){let e=T||M||I;e&&fe(e).then(e=>{W.current||(e&&process.stdout.write(e),V(!0),U.current!==void 0&&clearTimeout(U.current),U.current=setTimeout(V,2e3,!1))})}});let Z=ve(String(e.name)),Fe=c(se.commands,e.name).length,Ie=Se(),Le=K.useCallback(async()=>{let t=ge().CLAUDE_AI_ORIGIN,n=ye()?.organizationUuid,r;r=n&&e.config.type===`claudeai-proxy`&&e.config.id?`${t}/api/organizations/${n}/mcp/start-auth/${e.config.id.startsWith(`mcprs`)?`mcpsrv${e.config.id.slice(5)}`:e.config.id}?product_surface=${encodeURIComponent(process.env.CLAUDE_CODE_ENTRYPOINT||`cli`)}`:`${t}/settings/connectors`,N(r),j(!0),L(`tengu_claudeai_mcp_auth_started`,{}),await u(r)},[e.config]),Q=K.useCallback(()=>{F(!0),L(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Re=K.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await Ie(e.name),e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),s()}catch(n){l?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${he(n)}`)}},[e.client.type,e.config.type,e.name,Ie,s,l]),ze=K.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;_(!0),oe(null);let t=new AbortController;k.current=t;try{if(e.isAuthenticated&&e.config&&await o(e.name,e.config,{preserveStepUpState:!0}),e.config){await ce(e.name,e.config,E,t.signal,{onWaitingForCallback:e=>{J(()=>e)}}),L(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await X(e.name);if(n.client.type===`connected`){let t=Y?`Authentication successful. Reconnected to ${e.name}.`:`Authentication successful. Connected to ${e.name}.`;l?.(t)}else n.client.type===`needs-auth`?l?.(`Authentication successful, but server still requires authentication. You may need to manually restart Work Mate.`):(_e(e.name,`Reconnection failed after authentication`),l?.(`Authentication successful, but server reconnection failed. You may need to manually restart Work Mate for the changes to take effect.`))}}catch(e){e instanceof Error&&!(e instanceof ie)&&oe(e.message)}finally{_(!1),k.current=null,J(null),G(``)}},[e.isAuthenticated,e.config,e.name,l,X,Y]),Be=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await o(e.name,e.config),L(`tengu_mcp_auth_config_clear`,{}),await f(e.name,{...e.config,scope:e.scope}),C(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=d(t.mcp.tools,e.name),i=a(t.mcp.commands,e.name),o=re(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:o}}}),l?.(`Authentication cleared for ${e.name}.`))};if(g){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,q.jsxs)(b,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(x,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(H,{}),(0,q.jsx)(x,{children:t})]}),T&&(0,q.jsxs)(b,{flexDirection:`column`,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),B?(0,q.jsx)(x,{color:`success`,children:`(Copied!)`}):(0,q.jsx)(x,{dimColor:!0,children:(0,q.jsx)(y,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,q.jsx)(ue,{url:T})]}),g&&T&&Me&&(0,q.jsxs)(b,{flexDirection:`column`,marginTop:1,children:[(0,q.jsx)(x,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,q.jsxs)(b,{children:[(0,q.jsxs)(x,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,q.jsx)(xe,{value:De,onChange:G,onSubmit:e=>{Me(e.trim()),G(``)},cursorOffset:Ae,onChangeCursorOffset:je,columns:h-8})]})]}),(0,q.jsx)(b,{marginLeft:3,children:(0,q.jsx)(x,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(A)return(0,q.jsxs)(b,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(x,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(H,{}),(0,q.jsx)(x,{children:` A browser window will open for authentication`})]}),M&&(0,q.jsxs)(b,{flexDirection:`column`,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),B?(0,q.jsx)(x,{color:`success`,children:`(Copied!)`}):(0,q.jsx)(x,{dimColor:!0,children:(0,q.jsx)(y,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,q.jsx)(ue,{url:M})]}),(0,q.jsxs)(b,{marginLeft:3,flexDirection:`column`,children:[(0,q.jsxs)(x,{color:`permission`,children:[`Press `,(0,q.jsx)(x,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,q.jsx)(x,{dimColor:!0,italic:!0,children:(0,q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(P)return(0,q.jsxs)(b,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(x,{color:`claude`,children:[`Clear authentication for `,e.name]}),be?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(x,{children:`Find the MCP server in the browser and click "Disconnect".`}),I&&(0,q.jsxs)(b,{flexDirection:`column`,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),B?(0,q.jsx)(x,{color:`success`,children:`(Copied!)`}):(0,q.jsx)(x,{dimColor:!0,children:(0,q.jsx)(y,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,q.jsx)(ue,{url:I})]}),(0,q.jsxs)(b,{marginLeft:3,flexDirection:`column`,children:[(0,q.jsxs)(x,{color:`permission`,children:[`Press `,(0,q.jsx)(x,{bold:!0,children:`Enter`}),` when done.`]}),(0,q.jsx)(x,{dimColor:!0,italic:!0,children:(0,q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(x,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,q.jsxs)(b,{marginLeft:3,flexDirection:`column`,children:[(0,q.jsxs)(x,{color:`permission`,children:[`Press `,(0,q.jsx)(x,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,q.jsx)(x,{dimColor:!0,italic:!0,children:(0,q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(D)return(0,q.jsxs)(b,{flexDirection:`column`,gap:1,padding:1,children:[(0,q.jsxs)(x,{color:`text`,children:[`Connecting to `,(0,q.jsx)(x,{bold:!0,children:e.name}),`…`]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(H,{}),(0,q.jsx)(x,{children:` Establishing connection to MCP server`})]}),(0,q.jsx)(x,{dimColor:!0,children:`This may take a few moments.`})]});let $=[];return e.client.type===`disabled`&&$.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&$.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?$.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&$.push({label:`Authenticate`,value:`claudeai-auth`}):(Y&&($.push({label:`Re-authenticate`,value:`reauth`}),$.push({label:`Clear authentication`,value:`clear-auth`})),Y||$.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&$.push({label:`Reconnect`,value:`reconnectMcpServer`}),$.push({label:`Disable`,value:`toggle-enabled`})),$.length===0&&$.push({label:`Back`,value:`back`}),(0,q.jsxs)(b,{flexDirection:`column`,children:[(0,q.jsxs)(b,{flexDirection:`column`,paddingX:1,borderStyle:ne?void 0:`round`,children:[(0,q.jsx)(b,{marginBottom:1,children:(0,q.jsxs)(x,{bold:!0,children:[Z,` MCP Server`]})}),(0,q.jsxs)(b,{flexDirection:`column`,gap:0,children:[(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,q.jsxs)(x,{children:[w(`inactive`,p)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,q.jsxs)(x,{children:[w(`success`,p)(r.tick),` connected`]}):e.client.type===`pending`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(x,{dimColor:!0,children:r.radioOff}),(0,q.jsx)(x,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,q.jsxs)(x,{children:[w(`warning`,p)(r.triangleUpOutline),` needs authentication`]}):(0,q.jsxs)(x,{children:[w(`error`,p)(r.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{bold:!0,children:`Auth: `}),Y?(0,q.jsxs)(x,{children:[w(`success`,p)(r.tick),` authenticated`]}):(0,q.jsxs)(x,{children:[w(`error`,p)(r.cross),` not authenticated`]})]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{bold:!0,children:`URL: `}),(0,q.jsx)(x,{dimColor:!0,children:e.config.url})]}),(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{bold:!0,children:`Config location: `}),(0,q.jsx)(x,{dimColor:!0,children:ee(e.scope)})]}),e.client.type===`connected`&&(0,q.jsx)(Ee,{serverToolsCount:t,serverPromptsCount:Fe,serverResourcesCount:se.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,q.jsxs)(b,{children:[(0,q.jsx)(x,{bold:!0,children:`Tools: `}),(0,q.jsxs)(x,{dimColor:!0,children:[t,` tools`]})]})]}),ae&&(0,q.jsx)(b,{marginTop:1,children:(0,q.jsxs)(x,{color:`error`,children:[`Error: `,ae]})}),$.length>0&&(0,q.jsx)(b,{marginTop:1,children:(0,q.jsx)(Te,{options:$,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ze();break;case`clear-auth`:await Be();break;case`claudeai-auth`:await Le();break;case`claudeai-clear-auth`:Q();break;case`reconnectMcpServer`:O(!0);try{let t=await X(e.name);e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_reconnect`,{success:t.client.type===`connected`});let{message:n}=Oe(t,e.name);l?.(n)}catch(t){e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_reconnect`,{success:!1}),l?.(ke(t,e.name))}finally{O(!1)}break;case`toggle-enabled`:await Re();break;case`back`:s();break}},onCancel:s})})]}),(0,q.jsx)(b,{marginTop:1,children:(0,q.jsx)(x,{dimColor:!0,italic:!0,children:m.pending?(0,q.jsxs)(q.Fragment,{children:[`Press `,m.keyName,` again to exit`]}):(0,q.jsxs)(S,{children:[(0,q.jsx)(y,{shortcut:`↑↓`,action:`navigate`}),(0,q.jsx)(y,{shortcut:`Enter`,action:`select`}),(0,q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var K,q,je=e((()=>{n(),K=t(C(),1),I(),M(),B(),p(),T(),ne(),g(),se(),z(),m(),s(),R(),oe(),O(),N(),F(),h(),U(),V(),be(),De(),G(),q=D()}));function Me({server:e,serverToolsCount:t,onViewTools:n,onCancel:i,onComplete:a,borderless:o=!1}){let[s]=le(),l=we(),u=te(e=>e.mcp),ne=Ce(),d=Se(),[re,f]=(0,J.useState)(!1),p=J.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await d(e.name),i()}catch(n){a(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${he(n)}`)}},[e.client.type,e.name,d,i,a]),m=ve(String(e.name)),h=c(u.commands,e.name).length,g=[];return e.client.type!==`disabled`&&t>0&&g.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&g.push({label:`Reconnect`,value:`reconnectMcpServer`}),g.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),g.length===0&&g.push({label:`Back`,value:`back`}),re?(0,Y.jsxs)(b,{flexDirection:`column`,gap:1,padding:1,children:[(0,Y.jsxs)(x,{color:`text`,children:[`Reconnecting to `,(0,Y.jsx)(x,{bold:!0,children:e.name})]}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(H,{}),(0,Y.jsx)(x,{children:` Restarting MCP server process`})]}),(0,Y.jsx)(x,{dimColor:!0,children:`This may take a few moments.`})]}):(0,Y.jsxs)(b,{flexDirection:`column`,children:[(0,Y.jsxs)(b,{flexDirection:`column`,paddingX:1,borderStyle:o?void 0:`round`,children:[(0,Y.jsx)(b,{marginBottom:1,children:(0,Y.jsxs)(x,{bold:!0,children:[m,` MCP Server`]})}),(0,Y.jsxs)(b,{flexDirection:`column`,gap:0,children:[(0,Y.jsxs)(b,{children:[(0,Y.jsx)(x,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,Y.jsxs)(x,{children:[w(`inactive`,s)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,Y.jsxs)(x,{children:[w(`success`,s)(r.tick),` connected`]}):e.client.type===`pending`?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(x,{dimColor:!0,children:r.radioOff}),(0,Y.jsx)(x,{children:` connecting…`})]}):(0,Y.jsxs)(x,{children:[w(`error`,s)(r.cross),` failed`]})]}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(x,{bold:!0,children:`Command: `}),(0,Y.jsx)(x,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,Y.jsxs)(b,{children:[(0,Y.jsx)(x,{bold:!0,children:`Args: `}),(0,Y.jsx)(x,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,Y.jsxs)(b,{children:[(0,Y.jsx)(x,{bold:!0,children:`Config location: `}),(0,Y.jsx)(x,{dimColor:!0,children:ee(ae(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,Y.jsx)(Ee,{serverToolsCount:t,serverPromptsCount:h,serverResourcesCount:u.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,Y.jsxs)(b,{children:[(0,Y.jsx)(x,{bold:!0,children:`Tools: `}),(0,Y.jsxs)(x,{dimColor:!0,children:[t,` tools`]})]})]}),g.length>0&&(0,Y.jsx)(b,{marginTop:1,children:(0,Y.jsx)(Te,{options:g,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){f(!0);try{let{message:t}=Oe(await ne(e.name),e.name);a?.(t)}catch(t){a?.(ke(t,e.name))}finally{f(!1)}}else t===`toggle-enabled`?await p():t===`back`&&i()},onCancel:i})})]}),(0,Y.jsx)(b,{marginTop:1,children:(0,Y.jsx)(x,{dimColor:!0,italic:!0,children:l.pending?(0,Y.jsxs)(Y.Fragment,{children:[`Press `,l.keyName,` again to exit`]}):(0,Y.jsxs)(S,{children:[(0,Y.jsx)(y,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(y,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var J,Y,X=e((()=>{n(),J=t(C(),1),B(),T(),_(),z(),m(),s(),O(),F(),h(),U(),V(),De(),G(),Y=D()}));function Ne({tool:e,server:t,onBack:n}){let[r,i]=Pe.useState(``),a=A(e.name,t.name),o=k(e.userFacingName?e.userFacingName({}):a),s=e.isReadOnly?.({})??!1,c=e.isDestructive?.({})??!1,l=e.isOpenWorld?.({})??!1;return Pe.useEffect(()=>{async function t(){try{let t=await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});i(t)}catch{i(`Failed to load description`)}}t()},[e]),(0,Z.jsx)(E,{title:(0,Z.jsxs)(Z.Fragment,{children:[o,s&&(0,Z.jsx)(x,{color:`success`,children:` [read-only]`}),c&&(0,Z.jsx)(x,{color:`error`,children:` [destructive]`}),l&&(0,Z.jsx)(x,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,Z.jsxs)(x,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,Z.jsxs)(b,{flexDirection:`column`,children:[(0,Z.jsxs)(b,{children:[(0,Z.jsx)(x,{bold:!0,children:`Tool name: `}),(0,Z.jsx)(x,{dimColor:!0,children:a})]}),(0,Z.jsxs)(b,{children:[(0,Z.jsx)(x,{bold:!0,children:`Full name: `}),(0,Z.jsx)(x,{dimColor:!0,children:e.name})]}),r&&(0,Z.jsxs)(b,{flexDirection:`column`,marginTop:1,children:[(0,Z.jsx)(x,{bold:!0,children:`Description:`}),(0,Z.jsx)(x,{wrap:`wrap`,children:r})]}),e.inputJSONSchema?.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,Z.jsxs)(b,{flexDirection:`column`,marginTop:1,children:[(0,Z.jsx)(x,{bold:!0,children:`Parameters:`}),(0,Z.jsx)(b,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,Z.jsxs)(x,{children:[`• `,t,r&&(0,Z.jsx)(x,{dimColor:!0,children:` (required)`}),`:`,` `,(0,Z.jsx)(x,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,Z.jsxs)(x,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var Pe,Z,Fe=e((()=>{Pe=t(C(),1),T(),j(),h(),Z=D()}));function Ie({server:e,onSelectTool:t,onBack:n}){let r=te(e=>e.mcp.tools),i=Le.useMemo(()=>e.client.type===`connected`?l(r,e.name):[],[e,r]),a=i.map((t,n)=>{let r=A(t.name,e.name),i=k(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Q.jsx)(E,{title:`Tools for ${e.name}`,subtitle:`${i.length} ${P(i.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Q.jsxs)(x,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsxs)(S,{children:[(0,Q.jsx)(y,{shortcut:`↑↓`,action:`navigate`}),(0,Q.jsx)(y,{shortcut:`Enter`,action:`select`}),(0,Q.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:i.length===0?(0,Q.jsx)(x,{dimColor:!0,children:`No tools available`}):(0,Q.jsx)(Te,{options:a,onChange:e=>{let n=parseInt(e,10),r=i[n];r&&t(r,n)},onCancel:n})})}var Le,Q,Re=e((()=>{Le=t(C(),1),T(),j(),m(),s(),F(),h(),U(),Q=D()}));export{Me as a,je as c,Fe as i,Re as n,X as o,Ne as r,Ae as s,Ie as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Jv as n,Lv as r,Yv as i,ay as a,cy as o}from"./loadAgentsDir-C1LkW7gl.js";import{I as s,Lt as c,P as l,ai as u,t as d}from"./src-DL3w8VPk.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p({scope:e,parsingErrors:t,warnings:i}){let a=t.length>0,o=i.length>0;return!a&&!o?null:(0,_.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(s,{children:[(a||o)&&(0,_.jsxs)(l,{color:a?`error`:`warning`,children:[`[`,a?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(l,{children:n(e)})]}),(0,_.jsxs)(s,{children:[(0,_.jsx)(l,{dimColor:!0,children:`Location: `}),(0,_.jsx)(l,{dimColor:!0,children:r(e)})]}),(0,_.jsxs)(s,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(s,{children:(0,_.jsxs)(l,{children:[(0,_.jsx)(l,{dimColor:!0,children:`└ `}),(0,_.jsx)(l,{color:`error`,children:`[Error]`}),(0,_.jsxs)(l,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),i.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(s,{children:(0,_.jsxs)(l,{children:[(0,_.jsx)(l,{dimColor:!0,children:`└ `}),(0,_.jsx)(l,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(l,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:a(`user`)},{scope:`project`,config:a(`project`)},{scope:`local`,config:a(`local`)},{scope:`enterprise`,config:a(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),n=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!n?null:(0,_.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(l,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(s,{marginTop:1,children:(0,_.jsxs)(l,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(c,{url:`https://code.workmate.com/docs/en/mcp`,children:`https://code.workmate.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(u(),1),o(),i(),d(),_=f()}));export{v as n,m as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{$o as a,Ax as o,CS as s,Da as c,Dp as l,HS as u,Hp as d,Mx as f,Nu as p,Nx as m,Op as h,TS as g,Ub as _,Up as v,Wp as y,Yb as b,Yp as x,Zi as S,dc as C,dn as w,es as T,fc as E,hc as D,hn as O,iC as k,ju as A,m_ as ee,nn as j,ns as M,p_ as N,pc as P,wa as F,zS as I}from"./loadAgentsDir-C1LkW7gl.js";import{C as te,Gt as ne,I as L,P as R,Wt as re,ai as ie,ot as z,t as ae}from"./src-DL3w8VPk.js";import{t as oe}from"./jsx-runtime-Bb4Xn-E0.js";import{Ln as se,zt as ce}from"./state-BowF111d.js";import{Jn as le,qn as B}from"./settings-DKN4xSpQ.js";import{D as V,h as ue,m as H,o as de,q as fe,s as U}from"./log-DaILwWJa.js";import{n as W,r as G}from"./analytics-DJobLaWP.js";import{_ as pe,p as me,y as he}from"./startupProfiler-DTs9w9EN.js";import{E as ge,T as _e,c as ve,d as ye,w as be}from"./sessionTracing-yBre24PH.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{n as Ce,t as we}from"./select-C_KXmqbI.js";import{r as Te,t as Ee}from"./Spinner-DwsJJUtn.js";import*as K from"path";import{randomUUID as q}from"crypto";var J=t(ie(),1),Y=oe();ae(),ce(),fe(),H(),de(),le(),W(),pe(),f(),N(),be(),A(),ve(),P(),C(),M(),S(),O();function De(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function Oe(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function ke(e,t,n,r,i,a,o){let s=q();se(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;ye(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&_e(`user_prompt`,{prompt_length:String(l.length),prompt:ge(l),"prompt.id":s}),G(`tengu_input_prompt`,{is_negative:De(c),is_keep_going:Oe(c)}),t.length>0?{messages:[u({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[u({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}W(),S();async function Ae({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:o,ideSelection:s,messages:c,setUserInputOnProcessing:l,uuid:d,isAlreadyProcessing:f,querySource:p,canUseTool:m,skipSlashCommands:h,bridgeOrigin:_,isMeta:v,skipAttachments:y,autonomy:b}){let x=typeof e==`string`?e:null,S=x?.startsWith(`/`)&&!h;n===`prompt`&&x!==null&&!v&&!S&&l?.(x),D(`query_process_user_input_base_start`);let C=i.getAppState(),T=await Me(e,n,r,i,o,s,c,d,f,p,m,C.toolPermissionContext.mode,h,_,v,y,t,b);if(D(`query_process_user_input_base_end`),!T.shouldQuery)return T;D(`query_hooks_start`);let E=g(e)||``;for await(let t of j(E,C.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[I(`${w(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:T.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return T.messages.push(u({content:e})),T.shouldQuery=!1,T}if(t.additionalContexts&&t.additionalContexts.length>0&&T.messages.push(a({type:`hook_additional_context`,content:t.additionalContexts.map(je),hookName:`UserPromptSubmit`,toolUseID:`hook-${q()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;T.messages.push({...t.message,attachment:{...t.message.attachment,content:je(t.message.attachment.content)}});break;default:T.messages.push(t.message);break}}return D(`query_hooks_end`),T}var X=1e4;function je(e){return e.length>X?`${e.substring(0,X)}… [output truncated - exceeded ${X} characters]`:e}async function Me(e,t,n,r,i,a,s,c,l,u,d,f,h,g,_,v,y,b){let x=null,S=[],C=[],w=e;if(typeof e==`string`)x=e;else if(e.length>0){D(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await m(n);if(e.dimensions){let t=o(e.dimensions);t&&C.push(t)}t.push(e.block)}else t.push(n);w=t,D(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(x=n.text,S=t.slice(0,-1)):S=t}if(x===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let O=i?Object.values(i).filter(ee):[],k=O.map(e=>e.id),A=i?await p(i):new Map;D(`query_pasted_image_processing_start`);let j=await Promise.all(O.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return G(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await m(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??A.get(e.id)}})),M=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of j){if(e.dimensions){let t=o(e.dimensions,n);t&&C.push(t)}else if(t){let e=o(t,n);e&&C.push(e)}else n&&C.push(`[Image source: ${n}]`);M.push(e.block)}D(`query_pasted_image_processing_end`);let N=h,P=!v&&x!==null&&(t!==`prompt`||N||!x.startsWith(`/`));D(`query_attachment_loading_start`);let F=P?await E(T(x,r,a??null,[],s,u)):[];if(D(`query_attachment_loading_end`),x!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-DIwrI2QC.js`);return Z(await e(x,S,F,r,n),C)}if(x!==null&&!N&&x.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-B-Gujpxm.js`);return Z(await e(x,S,M,F,r,n,c,l,d,b),C)}if(x!==null&&t===`prompt`){let e=x.trim(),t=F.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;G(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Z(ke(w,M,k,F,c,f,_),C)}function Z(e,t){return t.length>0&&e.messages.push(u({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}var Ne=n({MessageSelector:()=>Fe,messagesAfterAreOnlySynthetic:()=>Ue,selectableUserMessagesFilter:()=>He});function Pe(e){return e.type===`text`}function Q(e){return e===`summarize`}function Fe({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:s}){let c=h(e=>e.fileHistory),[l,f]=(0,J.useState)(void 0),p=v(),m=(0,J.useMemo)(q,[]),g=(0,J.useMemo)(()=>[...e.filter(He),{...u({content:``}),uuid:m}],[e,m]),[_,b]=(0,J.useState)(g.length-1),x=Math.max(0,Math.min(_-Math.floor($/2),g.length-$)),S=g.length>1,[C,w]=(0,J.useState)(s),[T,E]=(0,J.useState)(void 0);(0,J.useEffect)(()=>{if(!s||!p)return;let e=!1;return y(c,s.uuid).then(t=>{e||E(t)}),()=>{e=!0}},[s,p,c]);let[D,O]=(0,J.useState)(!1),[k,A]=(0,J.useState)(null),[ee,j]=(0,J.useState)(`both`),[M,N]=(0,J.useState)(``);function P(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}];return t.push({value:`summarize`,label:`Summarize from here`,type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `,onChange:N}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,J.useEffect)(()=>{G(`tengu_message_selector_opened`,{})},[]);async function F(e){t(),O(!0);try{await n(e),O(!1),o()}catch(e){U(e),O(!1),f(`Failed to restore the conversation:\n${e}`)}}async function I(t){let n=e.indexOf(t);if(G(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){o();return}if(!p){await F(t);return}let r=await y(c,t.uuid);w(t),E(r)}async function ie(e){if(G(`tengu_message_selector_restore_option_selected`,{option:e}),!C){f(`Message not found.`);return}if(e===`nevermind`){s?o():w(void 0);return}if(Q(e)){t(),O(!0),A(e),f(void 0);try{let e=M.trim()||void 0;await a(C,e,`from`),O(!1),A(null),w(void 0),o()}catch(e){U(e),O(!1),A(null),w(void 0),f(`Failed to summarize:\n${e}`)}return}t(),O(!0),f(void 0);let i=null,c=null;if(e===`code`||e===`both`)try{await r(C)}catch(e){i=e,U(i)}if(e===`conversation`||e===`both`)try{await n(C)}catch(e){c=e,U(c)}O(!1),w(void 0),c&&i?f(`Failed to restore the conversation and code:\n${c}\n${i}`):c?f(`Failed to restore the conversation:\n${c}`):i?f(`Failed to restore the code:\n${i}`):o()}let z=xe(),ae=(0,J.useCallback)(()=>{if(C&&!s){w(void 0);return}G(`tengu_message_selector_cancelled`,{}),o()},[o,C,s]),oe=(0,J.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),se=(0,J.useCallback)(()=>b(e=>Math.min(g.length-1,e+1)),[g.length]),ce=(0,J.useCallback)(()=>b(0),[]),le=(0,J.useCallback)(()=>b(g.length-1),[g.length]),B=(0,J.useCallback)(()=>{let e=g[_];e&&I(e)},[g,_,I]);re(`confirm:no`,ae,{context:`Confirmation`,isActive:!C}),ne({"messageSelector:up":oe,"messageSelector:down":se,"messageSelector:top":ce,"messageSelector:bottom":le,"messageSelector:select":B},{context:`MessageSelector`,isActive:!D&&!l&&!C&&S});let[V,ue]=(0,J.useState)({});(0,J.useEffect)(()=>{async function t(){p&&Promise.all(g.map(async(t,n)=>{if(t.uuid!==m){let r=d(c,t.uuid),i=g.at(n+1),a=r?Ve(e,t.uuid,i?.uuid===m?void 0:i?.uuid):void 0;ue(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[g,e,m,c,p]);let H=p&&T?.filesChanged&&T.filesChanged.length>0,de=!l&&!C&&!s&&S;return(0,Y.jsxs)(L,{flexDirection:`column`,width:`100%`,children:[(0,Y.jsx)(te,{color:`suggestion`}),(0,Y.jsxs)(L,{flexDirection:`column`,marginX:1,gap:1,children:[(0,Y.jsx)(R,{bold:!0,color:`suggestion`,children:`Rewind`}),l&&(0,Y.jsxs)(R,{color:`error`,children:[`Error: `,l]}),!S&&(0,Y.jsx)(R,{children:`Nothing to rewind to yet.`}),!l&&C&&S&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(R,{children:[`Confirm you want to restore `,!T&&`the conversation `,`to the point before you sent this message:`]}),(0,Y.jsxs)(L,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,Y.jsx)(Be,{userMessage:C,color:`text`,isCurrent:!1}),(0,Y.jsxs)(R,{dimColor:!0,children:[`(`,me(new Date(C.timestamp)),`)`]})]}),(0,Y.jsx)(Le,{selectedRestoreOption:ee,canRestoreCode:!!H,diffStatsForRestore:T}),D&&Q(k)?(0,Y.jsxs)(L,{flexDirection:`row`,gap:1,children:[(0,Y.jsx)(Ee,{}),(0,Y.jsx)(R,{children:`Summarizing…`})]}):(0,Y.jsx)(we,{isDisabled:D,options:P(!!H),defaultFocusValue:H?`both`:`conversation`,onFocus:e=>j(e),onChange:e=>ie(e),onCancel:()=>s?o():w(void 0)}),H&&(0,Y.jsx)(L,{marginBottom:1,children:(0,Y.jsxs)(R,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),de&&(0,Y.jsxs)(Y.Fragment,{children:[p?(0,Y.jsx)(R,{children:`Restore the code and/or conversation to the point before…`}):(0,Y.jsx)(R,{children:`Restore and fork the conversation to the point before…`}),(0,Y.jsx)(L,{width:`100%`,flexDirection:`column`,children:g.slice(x,x+$).map((e,t)=>{let n=x+t,r=n===_,a=e.uuid===m,o=n in V,s=V[n],c=s?.filesChanged?.length;return(0,Y.jsxs)(L,{height:p?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,Y.jsx)(L,{width:2,minWidth:2,children:r?(0,Y.jsxs)(R,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,Y.jsx)(R,{children:` `})}),(0,Y.jsxs)(L,{flexDirection:`column`,children:[(0,Y.jsx)(L,{flexShrink:1,height:1,overflow:`hidden`,children:(0,Y.jsx)(Be,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),p&&o&&(0,Y.jsx)(L,{height:1,flexDirection:`row`,children:s?(0,Y.jsx)(R,{dimColor:!r,color:`inactive`,children:c?(0,Y.jsxs)(Y.Fragment,{children:[c===1&&s.filesChanged[0]?`${K.basename(s.filesChanged[0])} `:`${c} files changed `,(0,Y.jsx)(ze,{diffStats:s})]}):(0,Y.jsx)(Y.Fragment,{children:`No code changes`})}):(0,Y.jsxs)(R,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!C&&(0,Y.jsx)(R,{dimColor:!0,italic:!0,children:z.pending?(0,Y.jsxs)(Y.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,Y.jsxs)(Y.Fragment,{children:[!l&&S&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Ie(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function Le({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,Y.jsxs)(L,{flexDirection:`column`,children:[(0,Y.jsx)(R,{dimColor:!0,children:Ie(e)}),!Q(e)&&(r?(0,Y.jsx)(Re,{diffStatsForRestore:n}):(0,Y.jsx)(R,{dimColor:!0,children:`The code will be unchanged.`}))]})}function Re({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged?.[0])return(0,Y.jsx)(R,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?K.basename(e.filesChanged[0]||``):t===2?`${K.basename(e.filesChanged[0]||``)} and ${K.basename(e.filesChanged[1]||``)}`:`${K.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,Y.jsxs)(R,{dimColor:!0,children:[`The code will be restored `,(0,Y.jsx)(ze,{diffStats:e}),` in `,n,`.`]})}function ze({diffStats:e}){if(e?.filesChanged)return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(R,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,Y.jsxs)(R,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function Be({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=z();if(r)return(0,Y.jsx)(L,{width:`100%`,children:(0,Y.jsx)(R,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,c=typeof o==`string`?null:o[o.length-1],l=ue(typeof o==`string`?o.trim():c&&Pe(c)?c.text.trim():`(no prompt)`);if(F(l))return(0,Y.jsx)(L,{flexDirection:`row`,width:`100%`,children:(0,Y.jsx)(R,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(l.includes(`<bash-input>`)){let e=s(l,`bash-input`);if(e)return(0,Y.jsxs)(L,{flexDirection:`row`,width:`100%`,children:[(0,Y.jsx)(R,{color:`bashBorder`,children:`!`}),(0,Y.jsxs)(R,{color:t,dimColor:n,children:[` `,e]})]})}if(l.includes(`<command-message>`)){let e=s(l,V),r=s(l,`command-args`),i=s(l,`skill-format`)===`true`;if(e)return i?(0,Y.jsx)(L,{flexDirection:`row`,width:`100%`,children:(0,Y.jsxs)(R,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,Y.jsx)(L,{flexDirection:`row`,width:`100%`,children:(0,Y.jsxs)(R,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,Y.jsx)(L,{flexDirection:`row`,width:`100%`,children:(0,Y.jsx)(R,{color:t,dimColor:n,children:i?he(l,a-i,!0):l.slice(0,500).split(`
|
|
2
|
+
`).slice(0,4).join(`
|
|
3
|
+
`)})})}function Ve(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!c(n))continue;let r=n.toolUseResult;if(!(!r?.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=B(e.lines,e=>e.startsWith(`+`)),n=B(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function He(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||k(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&Pe(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function Ue(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!k(t)&&!c(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var $,We=e((()=>{r(),W(),l(),x(),Se(),_(),S(),Ce(),Te(),b(),$=7}));export{He as a,Ue as i,Ne as n,Ae as o,We as r,Fe as t};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Bb as o,CS as s,C_ as c,Cf as l,DS as u,Dp as d,Dw as f,Fb as p,Gb as m,HC as h,JS as g,KC as _,Ku as v,Lb as y,My as b,Ny as x,OS as S,Op as C,PS as w,Rb as T,Su as E,Ta as D,Tw as O,VC as ee,Vb as te,Wb as ne,XS as re,YC as ie,YS as ae,Yb as k,Zi as A,__ as oe,_u as j,aa as se,am as ce,b_ as M,bp as le,bu as N,ca as ue,cu as de,ed as fe,fa as pe,ga as me,ia as P,jy as he,ma as ge,mu as _e,na as ve,oa as ye,ou as be,qu as xe,ra as Se,su as Ce,ta as we,td as Te,va as Ee,vu as De,wf as Oe,x_ as ke,xu as F,yp as Ae,yu as je,zb as Me}from"./loadAgentsDir-C1LkW7gl.js";import{C as Ne,Gr as I,I as L,N as Pe,P as R,Pn as Fe,Rn as Ie,ai as z,di as Le,fi as Re,j as ze,mt as Be,ot as Ve,t as B,xt as He}from"./src-DL3w8VPk.js";import{t as V}from"./jsx-runtime-Bb4Xn-E0.js";import{n as Ue,t as We}from"./cwd-BcO6WHKo.js";import{a as Ge,c as H,i as Ke,n as qe,o as Je}from"./debug-8DCufdSp.js";import{Ht as Ye,Vt as Xe,h as Ze,t as Qe}from"./settings-DKN4xSpQ.js";import{c as $e,m as et,v as tt}from"./config-BddEvZZl.js";import{B as nt,L as rt,R as it,q as at}from"./log-DaILwWJa.js";import{l as ot,o as st}from"./stringUtils-BQm3OfeJ.js";import{_ as ct,f as lt,p as ut,y as dt}from"./startupProfiler-DTs9w9EN.js";import{Ht as ft,St as pt,Tt as mt,Vt as ht,ct as gt,f as _t,ft as vt,h as yt,ut as bt,x as xt}from"./model-BwBE0Pt5.js";import{gn as St,vn as Ct}from"./prompt-BGqgPgCU.js";import{a as wt,n as Tt,r as Et,t as Dt}from"./projectOnboardingState-CJycxw5P.js";import{n as Ot,t as kt}from"./systemTheme-Ceakddth.js";import{a as At,c as jt,i as Mt}from"./SpinnerGlyph-A6G-gloN.js";import{n as Nt,r as Pt}from"./PromptInputFooterSuggestions-lkr_A5jQ.js";import{n as Ft,t as It}from"./useMainLoopModel-DWscpA9I.js";import{n as Lt,t as Rt}from"./modalContext-DDZdU1J8.js";import{n as zt,r as Bt,t as Vt}from"./statusNoticeHelpers-X75JNlx5.js";import{a as Ht,c as Ut,i as Wt,l as Gt,n as Kt,o as qt,r as Jt,t as Yt,u as Xt}from"./logoUtils-Dj_2SWmO.js";import{homedir as Zt}from"os";import{relative as Qt}from"path";import{fileURLToPath as $t}from"url";function en(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var tn=e((()=>{}));function nn(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||s(t.text,`status`)!==`completed`?!1:s(t.text,`summary`)?.startsWith(`Background command `)??!1}function rn(e,t){if(!le()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(nn(t)){let i=0;for(;r<e.length&&nn(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${nt}><${rt}>completed</${rt}><${it}>${i} background commands completed</${it}></${nt}>`}]}})}else n.push(t),r++}return n}var an=e((()=>{at(),ce(),Ae(),A()}));function on(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function sn(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(on(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!on(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var cn=e((()=>{}));function ln(e){let t=fn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),fn.set(e,t)),t}function un(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function dn(e,t,n=!1){if(n)return{messages:e};let r=ln(t),i=new Map;for(let t of e){let e=un(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=un(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=un(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var fn,pn=e((()=>{fn=new WeakMap}));function mn(e){let t=bn.get(e);if(t!==void 0)return t;let n=hn(e).toLowerCase();return bn.set(e,n),n}function hn(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=yn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?yn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(_n(e.toolUseResult));t=r.join(`
|
|
2
|
+
`)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[gn(e.input)]:[]).join(`
|
|
3
|
+
`));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
|
|
4
|
+
`);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
5
|
+
`)}break;case`collapsed_read_search`:e.relevantMemories&&(t=e.relevantMemories.map(e=>e.content).join(`
|
|
6
|
+
`));break;default:break}let n=t,r=n.indexOf(`<system-reminder>`);for(;r>=0;){let e=n.indexOf(vn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function gn(e){if(!e||typeof e!=`object`)return``;let t=e,n=[];for(let e of[`command`,`pattern`,`file_path`,`path`,`prompt`,`description`,`query`,`url`,`skill`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`args`,`files`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(` `))}return n.join(`
|
|
7
|
+
`)}function _n(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`\n${e}`:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
|
|
8
|
+
`))}return n.join(`
|
|
9
|
+
`)}var vn,yn,bn,xn=e((()=>{A(),vn=`</system-reminder>`,yn=new Set([ae,re]),bn=new WeakMap}));function Sn({pose:e=`default`}={}){return(0,Cn.jsxs)(L,{flexDirection:`column`,alignItems:`center`,children:[(0,Cn.jsx)(R,{color:`clawd_body`,children:` █████ `}),(0,Cn.jsx)(R,{color:`clawd_body`,children:`██ ● ● ██`}),(0,Cn.jsx)(R,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,Cn.jsx)(R,{color:`clawd_body`,children:` █ █ █ █ `})]})}var Cn,wn=e((()=>{B(),Cn=V()}));function Tn(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=I(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,I(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?I(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=I(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,I(r))),o}function En({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?I(e.timestamp):0));return(0,U.jsxs)(L,{flexDirection:`column`,width:t,children:[(0,U.jsx)(R,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(R,{dimColor:!0,italic:!0,children:dt(i,t)})]}):r.length===0&&a?(0,U.jsx)(R,{dimColor:!0,children:dt(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(R,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(R,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(R,{children:dt(e.text,r)})]},n)}),i&&(0,U.jsx)(R,{dimColor:!0,italic:!0,children:dt(i,t)})]})]})}var U,Dn=e((()=>{B(),ct(),U=V()}));function On({feeds:e,maxWidth:t}){let n=e.map(e=>Tn(e)),r=Math.max(...n),i=Math.min(r,t);return(0,An.jsx)(L,{flexDirection:`column`,children:e.map((t,n)=>(0,An.jsxs)(kn.Fragment,{children:[(0,An.jsx)(En,{config:t,actualWidth:i}),n<e.length-1&&(0,An.jsx)(Ne,{color:`claude`,width:i})]},n))})}var kn,An,jn=e((()=>{kn=t(z(),1),B(),Dn(),An=V()}));function Mn(e){let t=e.map(e=>{let t=ut(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function Nn(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${a.tick} `:``}${e}`})),n=We()===Zt()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}var Pn=e((()=>{i(),Ue(),ct()}));function Fn(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function In(){let{pose:e,bounceOffset:t,onClick:n}=Ln();return(0,zn.jsx)(L,{height:Gn,flexDirection:`column`,onClick:n,children:(0,zn.jsx)(L,{marginTop:t,flexShrink:0,children:(0,zn.jsx)(Sn,{pose:e})})})}function Ln(){let[e]=(0,Rn.useState)(()=>Qe().prefersReducedMotion??!1),[t,n]=(0,Rn.useState)(-1),r=(0,Rn.useRef)(Bn),i=()=>{e||t!==-1||(r.current=Vn[Math.floor(Math.random()*Vn.length)],n(0))};(0,Rn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Un,Wn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Hn;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn=e((()=>{Rn=t(z(),1),B(),Ze(),wn(),zn=V(),Bn=[...Fn(`default`,1,2),...Fn(`arms-up`,0,3),...Fn(`default`,0,1),...Fn(`default`,1,2),...Fn(`arms-up`,0,3),...Fn(`default`,0,1)],Vn=[Bn,[...Fn(`look-right`,0,5),...Fn(`look-left`,0,5),...Fn(`default`,0,1)]],Hn={pose:`default`,offset:0},Un=60,Wn=e=>e+1,Gn=3}));function qn(){let{columns:e}=Ve(),t=C(e=>e.agent),n=xt(Ft()),{version:r,cwd:i,billingType:a,agentName:o}=qt(),s=t??o,c=Math.max(e-15,20),u=dt(r,Math.max(c-11,6)),{shouldSplit:d,truncatedModel:f,truncatedBilling:p}=Jt(n,a,c),m=s?c-1-I(s)-3:c,h=Xt(i,Math.max(m,10));return(0,W.jsx)(l,{children:(0,W.jsxs)(L,{flexDirection:`row`,gap:2,alignItems:`center`,children:[le()?(0,W.jsx)(In,{}):(0,W.jsx)(Sn,{}),(0,W.jsxs)(L,{flexDirection:`column`,children:[(0,W.jsxs)(R,{children:[(0,W.jsx)(R,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(R,{dimColor:!0,children:[`v`,u]})]}),d?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(R,{dimColor:!0,children:f}),(0,W.jsx)(R,{dimColor:!0,children:p})]}):(0,W.jsxs)(R,{dimColor:!0,children:[f,` · `,p]}),(0,W.jsx)(R,{dimColor:!0,children:s?`@${s} · ${h}`:h})]})]})})}var W,Jn=e((()=>{It(),k(),B(),d(),ct(),Ae(),Gt(),_t(),Oe(),Kn(),wn(),W=V()}));function Yn(){let e=(0,Zn.useMemo)(Xn,[]),t=(0,Zn.useMemo)(()=>$e().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,Zn.useEffect)(()=>{n&&tt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Qn.jsx)(L,{paddingLeft:2,flexDirection:`column`,children:(0,Qn.jsx)(R,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Xn(){return $n}var Zn,Qn,$n,er=e((()=>{Zn=t(z(),1),B(),et(),Qn=V(),$n={tip:``,color:`dim`}}));function tr({char:e=`✻`}){let[t]=(0,nr.useState)(()=>Qe().prefersReducedMotion??!1),[n,r]=(0,nr.useState)(t),i=(0,nr.useRef)(null),[a,o]=Be(n?null:50);return(0,nr.useEffect)(()=>{if(n)return;let e=setTimeout(r,ar,!0);return()=>clearTimeout(e)},[n]),n?(0,rr.jsx)(L,{ref:a,children:(0,rr.jsx)(R,{color:or,children:e})}):(i.current===null&&(i.current=o),(0,rr.jsx)(L,{ref:a,children:(0,rr.jsx)(R,{color:jt(Mt((o-i.current)/ir*360%360)),children:e})}))}var nr,rr,ir,ar,or,sr=e((()=>{nr=t(z(),1),Ye(),B(),Ze(),At(),rr=V(),ir=1500,ar=ir*2,or=jt({r:153,g:153,b:153})}));function cr(){return yt()&&($e().opus1mMergeNoticeSeenCount??0)<fr}function lr(){let[e]=(0,ur.useState)(cr);return(0,ur.useEffect)(()=>{if(!e)return;let t=($e().opus1mMergeNoticeSeenCount??0)+1;tt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,dr.jsxs)(L,{paddingLeft:2,children:[(0,dr.jsx)(tr,{char:`↑`}),(0,dr.jsx)(R,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ur,dr,fr,pr=e((()=>{ur=t(z(),1),Ye(),B(),et(),_t(),sr(),dr=V(),fr=6}));function mr(){let e=Ut(),t=$e().oauthAccount?.displayName??``,{columns:r}=Ve(),i=wt(),a=_.isSandboxingEnabled(),o=C(e=>e.agent),s=$e(),[c]=(0,hr.useState)(()=>{let e=Qe().companyAnnouncements;if(!(!e||e.length===0))return s.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,hr.useEffect)(()=>{i&&Tt()},[i]),!i&&n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let u=xt(Ft()),{version:d,cwd:f,billingType:p,agentName:m}=qt(),h=o??m,g=dt(u,gr-20);if(!i&&!n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(qn,{}),(0,G.jsx)(lr,{}),Ge()&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(R,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(R,{dimColor:!0,children:[`Logging to: `,Je()?`stderr`:qe()]})]}),(0,G.jsx)(Yn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(R,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(R,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Work Mate uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),c&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(R,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(R,{children:c})]})]});let v=Ht(r),y=Ot($e().theme),b=` ${ze(`claude`,y)(`Work Mate`)} ${ze(`inactive`,y)(`v${d}`)} `,x=ze(`claude`,y)(` Work Mate `);if(v===`compact`){let e=Wt(t);I(e)>r-4&&(e=Wt(null));let n=h?r-4-1-I(h)-3:r-4,i=Xt(f,Math.max(n,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(l,{children:(0,G.jsxs)(L,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:x,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:r,children:[(0,G.jsx)(R,{bold:!0,children:e}),(0,G.jsx)(L,{marginY:1,children:(0,G.jsx)(Sn,{})}),(0,G.jsx)(R,{dimColor:!0,children:g}),(0,G.jsx)(R,{dimColor:!0,children:p}),(0,G.jsx)(R,{dimColor:!0,children:h?`@${h} · ${i}`:i})]})}),(0,G.jsx)(lr,{}),a&&(0,G.jsx)(L,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(R,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let S=Wt(t),w=!process.env.IS_DEMO&&s.oauthAccount?.organizationName?`${g} · ${p} · ${s.oauthAccount.organizationName}`:`${g} · ${p}`,T=h?gr-1-I(h)-3:gr,E=Xt(f,Math.max(T,10)),D=h?`@${h} · ${E}`:E,{leftWidth:O,rightWidth:ee}=Yt(r,v,Kt(S,D,w));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(l,{children:(0,G.jsx)(L,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:b,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(L,{flexDirection:v===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(L,{flexDirection:`column`,width:O,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(L,{marginTop:1,children:(0,G.jsx)(R,{bold:!0,children:S})}),(0,G.jsx)(Sn,{}),(0,G.jsxs)(L,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(R,{dimColor:!0,children:w}),(0,G.jsx)(R,{dimColor:!0,children:D})]})]}),v===`horizontal`&&(0,G.jsx)(L,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),v===`horizontal`&&(0,G.jsx)(On,{feeds:i?[Nn(Dt()),Mn(e)]:[Mn(e)],maxWidth:ee})]})})}),(0,G.jsx)(lr,{}),Ge()&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(R,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(R,{dimColor:!0,children:[`Logging to: `,Je()?`stderr`:qe()]})]}),(0,G.jsx)(Yn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(R,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(R,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Work Mate uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),c&&(0,G.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(R,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(R,{children:c})]}),a&&(0,G.jsx)(L,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(R,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var hr,G,gr,_r=e((()=>{B(),k(),Gt(),ct(),wn(),jn(),Pn(),et(),kt(),Ze(),Ke(),hr=t(z(),1),Et(),Jn(),Oe(),r(),er(),pr(),ie(),d(),It(),_t(),G=V(),gr=50}));function vr({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,yr.jsx)(L,{minWidth:I(i)+8,children:(0,yr.jsx)(R,{dimColor:!0,children:i})})}var yr,br=e((()=>{B(),yr=V()}));function xr({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,Sr.jsx)(L,{minWidth:I(n),children:(0,Sr.jsx)(R,{dimColor:!0,children:n})})}var Sr,Cr=e((()=>{B(),Sr=V()}));function wr(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=jr(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(je(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&jr(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=jr(t.messages[0]?.message.content)?.input;if(je(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function Tr({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:_}){let v=c===`transcript`,y=e.type===`grouped_tool_use`,b=e.type===`collapsed_read_search`,x=b&&(F(e,o)||m&&!n),C=y?e.displayMessage:b?De(e):e,w=y||b?[]:Se(e,h),T=Gi(e,s,o,y||b?g:P(e,h),c,h),E=!1;if(u)if(y)E=e.messages.some(e=>{let t=jr(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(b)E=F(e,o);else{let t=S(e);E=!t||o.has(t)}let D=v&&C.type===`assistant`&&Array.isArray(C.message.content)&&C.message.content.some(e=>e.type===`text`)&&(C.timestamp||C.message.model),O=(0,Ar.jsx)(be,{message:e,lookups:h,addMargin:!D,containerWidth:D?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:w,shouldAnimate:E,shouldShowDot:!0,isTranscriptMode:v,isStatic:T,isActiveCollapsedGroup:x,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:_});return D?(0,Ar.jsx)(l,{children:(0,Ar.jsxs)(L,{width:p,flexDirection:`column`,children:[(0,Ar.jsxs)(L,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Ar.jsx)(xr,{message:C,isTranscriptMode:v}),(0,Ar.jsx)(vr,{message:C,isTranscriptMode:v})]}),O]})}):(0,Ar.jsx)(l,{children:O})}function Er(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=jr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return N(e).some(e=>t.has(e));let n=S(e);return!!n&&t.has(n)}function Dr(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=jr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return N(e).every(e=>t.has(e));if(e.type===`assistant`){let n=jr(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=S(e);return!n||t.has(n)}function Or(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&Ce(t.message))return!1;let n=Er(e.message,e.streamingToolUseIDs),r=Dr(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var kr,Ar,jr,Mr,Nr=e((()=>{kr=t(z(),1),B(),E(),A(),de(),Ar=V(),br(),$i(),Cr(),Oe(),jr=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Mr=kr.memo(Tr,Or)}));function Pr(e){return e.type===`attachment`&&Fr.has(e.attachment.type)}var Fr,Ir=e((()=>{Fr=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.token_usage.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function Lr(e){return Ur.filter(t=>t.isActive(e))}var K,Rr,zr,Br,Vr,Hr,Ur,Wr=e((()=>{B(),c(),i(),Ue(),ct(),pt(),Bt(),K=V(),Rr={id:`large-memory-files`,type:`warning`,isActive:e=>M(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:M(e.memoryFiles).map(e=>{let t=e.path.startsWith(We())?Qt(We(),e.path):e.path;return(0,K.jsxs)(L,{flexDirection:`row`,children:[(0,K.jsx)(R,{color:`warning`,children:a.warning}),(0,K.jsxs)(R,{color:`warning`,children:[`Large `,(0,K.jsx)(R,{bold:!0,children:t}),` will impact performance (`,lt(e.content.length),` chars > `,lt(oe),`)`,(0,K.jsx)(R,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},zr={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=vt();return mt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=vt();return(0,K.jsxs)(L,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(R,{color:`warning`,children:a.warning}),(0,K.jsxs)(R,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Work Mate account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Br={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=gt({skipRetrievingKeyFromApiKeyHelper:!0});return!!bt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=gt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(L,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(R,{color:`warning`,children:a.warning}),(0,K.jsxs)(R,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Vr={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=gt({skipRetrievingKeyFromApiKeyHelper:!0}),t=vt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=gt({skipRetrievingKeyFromApiKeyHelper:!0}),t=vt();return(0,K.jsxs)(L,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(L,{flexDirection:`row`,children:[(0,K.jsx)(R,{color:`warning`,children:a.warning}),(0,K.jsxs)(R,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(L,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(R,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(R,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Hr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>zt(e.agentDefinitions)>Vt,render:e=>{let t=zt(e.agentDefinitions);return(0,K.jsxs)(L,{flexDirection:`row`,children:[(0,K.jsx)(R,{color:`warning`,children:a.warning}),(0,K.jsxs)(R,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,lt(t),` tokens > `,lt(Vt),`)`,(0,K.jsx)(R,{dimColor:!0,children:` · /agents to manage`})]})]})}},Ur=[Rr,Hr,zr,Br,Vr]}));function Gr({agentDefinitions:e}={}){let t={config:$e(),agentDefinitions:e,memoryFiles:(0,qr.use)(ke())},n=Lr(t);return n.length===0?null:(0,Jr.jsx)(L,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Jr.jsx)(Kr.Fragment,{children:e.render(t)},e.id))})}var Kr,qr,Jr,Yr=e((()=>{Kr=t(z(),1),qr=t(z(),1),B(),c(),et(),Wr(),Jr=V()}));function Xr(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??ii,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/ei);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Zr);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-$r),w=b;else{if(y){let e=v+Qr;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Qr;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Qr,y=Math.min(b,C+ni),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Qr);)S+=r.current.get(t[w])??ti,w++}let e=v+2*Qr,n=Math.max(0,w-ni),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??ti;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??ti;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-ri&&(C=e-ri),w>t+ri&&(w=t+ri),C>w&&(w=Math.min(C+ri,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>ni){let e=(x[D]+x[O])/2;g-m.current<e?O=D+ni:D=O-ni}let ee=m.current,te=x[D],ne=D===0?0:te+ee,re=O===b?1/0:Math.max(te,x[O]-v)+ee;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ne,re)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let ie=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),ae=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),k=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),A=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),oe=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),j=S-x[O];return{range:[D,O],topSpacer:te,bottomSpacer:j,measureRef:ie,spacerRef:h,offsets:x,getItemTop:ae,getItemElement:k,getItemHeight:A,scrollToIndex:oe}}var q,Zr,Qr,$r,ei,ti,ni,ri,ii,ai=e((()=>{q=t(z(),1),Zr=3,Qr=40,$r=30,ei=20,ti=1,ni=200,ri=25,ii=()=>{}}));function oi({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,di.jsx)(pi.Provider,{value:n,children:(0,di.jsx)(hi.Provider,{value:i,children:(0,di.jsx)(fi.Provider,{value:t,children:(0,di.jsx)(mi.Provider,{value:r,children:e})})})})}function si(){return(0,J.useContext)(fi)}function ci(){return(0,J.useContext)(mi)}function li(e){let t=(0,J.useContext)(pi);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function ui(e){let t=(0,J.useContext)(hi);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,di,fi,pi,mi,hi,gi=e((()=>{J=t(z(),1),di=V(),fi=(0,J.createContext)(null),pi=(0,J.createContext)(null),mi=(0,J.createContext)(null),hi=(0,J.createContext)(null)}));function _i(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function vi(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!yi(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function yi(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function bi(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||Pr(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=vi(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function xi({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:u=0,onPillClick:d}){let{rows:f,columns:p}=Ve(),[m,h]=(0,Y.useState)(null),g=(0,Y.useMemo)(()=>({setStickyPrompt:h}),[]),_=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!le())return;let e=Ie.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{x($t(e))}catch{}else b(e)},()=>{e.onHyperlinkClick=void 0}},[]),le()){let s=l?null:m,h=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(oi,{children:[(0,X.jsx)(L,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(L,{flexDirection:`column`,flexGrow:1,width:p,overflow:`hidden`,children:[(0,X.jsxs)(L,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[h&&(0,X.jsx)(Ci,{text:h.text,onClick:h.scrollTo}),(0,X.jsxs)(He,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(Di,{value:g,children:e}),n]}),!c&&_&&n==null&&(0,X.jsx)(Si,{count:u,onClick:d}),r!=null&&(0,X.jsx)(L,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(L,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(wi,{}),(0,X.jsx)(Ti,{}),(0,X.jsx)(L,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Rt,{value:{rows:f-Ei-1,columns:p-4,scrollRef:a??null},children:(0,X.jsxs)(L,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:f-Ei,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(L,{flexShrink:0,children:(0,X.jsx)(R,{color:`permission`,children:`▔`.repeat(p)})}),(0,X.jsx)(L,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function Si({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(L,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(L,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(R,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${ot(e,`message`)}`:`Jump to bottom`,` `,a.arrowDown,` `]})})})}function Ci({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(L,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(R,{color:`subtle`,wrap:`truncate-end`,children:[a.pointer,` `,e]})})}function wi(){let e=si();return!e||e.suggestions.length===0?null:(0,X.jsx)(L,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(Nt,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function Ti(){let e=ci();return e?(0,X.jsx)(L,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,Ei,Di,Oi=e((()=>{i(),Y=t(z(),1),Lt(),gi(),k(),B(),he(),Ae(),st(),Ir(),Pt(),X=V(),Ei=2,Di=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function ki(e){let t=Li.get(e);if(t!==void 0)return t;let n=mn(e);return Li.set(e,n),n}function Ai(e){let t=zi.get(e);if(t!==void 0)return t;let n=ji(e);return zi.set(e,n),n}function ji(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
|
|
10
|
+
`)}if(t===null)return null;let n=o(t);return n.startsWith(`<`)||n===``?null:n}function Mi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Fi.jsx)(L,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,Fi.jsx)(Pe.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function Ni({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=ki,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:x,topSpacer:S,bottomSpacer:C,measureRef:w,spacerRef:T,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:ee,scrollToIndex:ne}=Xr(t,b,n),[re,ie]=x,ae=(0,Z.useCallback)(t=>ee(t)!==0&&Me(e[t]),[ee,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:te(e)?.name}),r=u??-1,i=(t,r,i=ae)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ae(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,ae]);let k=(0,Z.useRef)({offsets:E,start:re,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne});k.current={offsets:E,start:re,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ne},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=k.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let A=(0,Z.useRef)(null),oe=(0,Z.useRef)({msgIdx:-1,positions:[]}),j=(0,Z.useRef)(-1),se=(0,Z.useRef)(0),ce=(0,Z.useRef)(0),M=(0,Z.useRef)(()=>{}),le=(0,Z.useRef)(()=>{}),N=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),ue=(0,Z.useRef)(-1),de=(0,Z.useRef)(!1);function fe(e){let t=k.current.getItemTop(e);return Math.max(0,t-Ii)}function pe(e){let n=t.current,{msgIdx:r,positions:i}=oe.current;if(!n||i.length===0||r<0){g?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=k.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-Ii)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=N.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),H(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}le.current=pe;let[me,P]=(0,Z.useState)(0),he=(0,Z.useCallback)(()=>P(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=A.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=k.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){A.current=null,H(`seek(i=${n}): no mount after scrollToIndex, skip`),M.current(r?-1:1);return}A.current={idx:n,wantLast:r,tries:i+1},c(n),he();return}A.current=null,a.scrollTo(Math.max(0,s(n)-Ii));let d=h?.(l)??[];if(oe.current={msgIdx:n,positions:d},H(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++se.current>20){se.current=0;return}M.current(r?-1:1);return}se.current=0;let f=r?d.length-1:0;N.current.screenOrd=f,j.current=-1,le.current(f);let p=ce.current;p&&(ce.current=0,M.current(p))},[me]);function ge(e,n){let r=t.current;if(!r)return;let i=k.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),oe.current={msgIdx:-1,positions:[]},A.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(fe(e)):o(e),he()}function _e(e){let t=N.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(A.current){ce.current=e;return}j.current<0&&(j.current=t.ptr);let{positions:a}=oe.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,pe(o),j.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===j.current){g?.(null),j.current=-1,H(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,ge(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}M.current=_e,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(fe(e))},setSearchQuery:e=>{A.current=null,oe.current={msgIdx:-1,positions:[]},j.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=k.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=k.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=ue.current>=0?ue.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}H(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}N.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?ge(r[o],!0):ue.current>=0&&s&&s.scrollTo(ue.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>_e(1),prevMatch:()=>_e(-1),setAnchor:()=>{let e=t.current;e&&(ue.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),A.current=null,oe.current={msgIdx:-1,positions:[]},j.current=-1},warmSearchIndex:async()=>{if(de.current)return 0;let e=k.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await ft(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return H(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),de.current=!0,Math.round(t)}}),[t]);let[ve,ye]=(0,Z.useState)(null),be=(0,Z.useRef)({onItemClick:a,setHoveredKey:ye});be.current={onItemClick:a,setHoveredKey:ye};let xe=(0,Z.useCallback)((e,t)=>{let n=be.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),Se=(0,Z.useCallback)(e=>{be.current.setHoveredKey(e)},[]),Ce=(0,Z.useCallback)(e=>{be.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Fi.jsxs)(Fi.Fragment,{children:[(0,Fi.jsx)(L,{ref:T,height:S,flexShrink:0}),e.slice(re,ie).map((e,t)=>{let n=re+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&ve===r,u=s?.(e);return(0,Fi.jsx)(Mi,{itemKey:r,msg:e,idx:n,measureRef:w,expanded:u,hovered:l,clickable:c,onClickK:xe,onEnterK:Se,onLeaveK:Ce,renderItem:i},r)}),C>0&&(0,Fi.jsx)(L,{height:C,flexShrink:0}),l&&(0,Fi.jsx)(Pi,{messages:e,start:re,end:ie,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function Pi({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(Di);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Bi,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=Ai(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Ri).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,Fi,Ii,Li,Ri,zi,Bi,Vi=e((()=>{Z=t(z(),1),ai(),B(),_e(),Oi(),Fi=V(),Ke(),ht(),xn(),T(),Ii=3,Li=new WeakMap,Ri=500,zi=new WeakMap,Bi=()=>{}}));function Hi(e,t,n=Yi,r=Xi){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Ui(e){return(e.type===`assistant`||e.type===`user`?S(e):null)??e.uuid}function Wi(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Gi(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=S(e);return i?t.has(i)||n.has(i)||ye(i,`PostToolUse`,a)?!1:en(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var Ki,Q,$,qi,Ji,Yi,Xi,Zi,Qi,$i=e((()=>{Re(),Ki=t(z(),1),Q=t(z(),1),tn(),Ye(),k(),B(),ne(),Ct(),ee(),an(),cn(),E(),et(),r(),Ae(),pn(),A(),st(),xn(),_r(),Te(),Nr(),T(),xe(),Ir(),Oe(),Yr(),$=V(),O(),Vi(),qi=Ki.memo(function({agentDefinitions:e}){return(0,$.jsx)(l,{children:(0,$.jsxs)(L,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(mr,{}),(0,$.jsx)(Ki.Suspense,{fallback:null,children:(0,$.jsx)(Gr,{agentDefinitions:e})})]})})}),Ji=30,Yi=200,Xi=50,Zi=({messages:e,tools:t,commands:r,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:d,streamingToolUses:g,showAllInTranscript:_=!1,agentDefinitions:b,hideLogo:x=!1,isLoading:S,hidePastThinking:C=!1,streamingThinking:T,streamingText:E,unseenDivider:O,scrollRef:ee,trackStickyPrompt:te,jumpRef:ne,onSearchMatchesChange:re,scanElement:ie,setPositions:ae,disableRenderCap:k=!1,cursor:A=null,setCursor:oe,cursorNavRef:ce,renderRange:M})=>{let{columns:N}=Ve(),de=m(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),P=(0,Q.useMemo)(()=>pe(e).filter(D),[e]),he=(0,Q.useMemo)(()=>T?T.isStreaming?!0:T.streamingEndedAt?Date.now()-T.streamingEndedAt<3e4:!1:!1,[T]),{lastThinkingBlockId:_e,latestBashOutputUUID:ye}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!he;C&&he&&(e=`streaming`);for(let r=P.length-1;r>=0;r--){let i=P[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return C||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[P,C,he]),be=(0,Q.useMemo)(()=>se(P),[P]),xe=(0,Q.useMemo)(()=>g.filter(e=>!s.has(e.contentBlock.id)&&!be.has(e.contentBlock.id)),[g,s,be]),Se=(0,Q.useMemo)(()=>xe.flatMap(e=>{let t=w({content:[e.contentBlock]});return t.uuid=me(e.contentBlock.id,0),pe([t])}),[xe]),Ce=d===`transcript`,Te=(0,Q.useMemo)(()=>n(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),De=ee!=null&&!Te,Oe=Ce&&!_&&!De,ke=(0,Q.useRef)(null),F=(0,Q.useRef)(null),{collapsed:Ae,lookups:je,hasTruncatedMessages:Me,hiddenMessageCount:I}=(0,Q.useMemo)(()=>{let e=ge((i||le()?P:u(P,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!Pr(e)&&Ee(e,Ce)),Se),n=Oe?e.slice(-30):e,r=Oe&&e.length>Ji,{messages:a}=dn(n,t,i),o=rn(sn(j(a,t)),i),s=ve(P,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(F.current&&F.current.key===s)l=F.current.lookups;else if(F.current&&P.length>=F.current.normalizedCount&&n.length>=F.current.messageCount&&F.current.lastAssistantMsgId===c){let e=ue(F.current.lookups,F.current.normalizedCount,F.current.messageCount,P,n);e?(l=e,F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c}):(l=we(P,n),F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c})}else l=we(P,n),F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c};let d=e.length-Ji;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:d}},[i,P,Ce,Se,Oe,t]),Pe=(0,Q.useMemo)(()=>{let e=!De&&!k?Hi(Ae,ke):0;return M?Ae.slice(M[0],M[1]):e>0?Ae.slice(e):Ae},[Ae,M,De,k]),Ie=(0,Q.useMemo)(()=>new Set(g.map(e=>e.contentBlock.id)),[g]),{dividerBeforeIndex:z,selectedIdx:Re}=(0,Q.useMemo)(()=>{if(!O&&!A)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=O?.firstUnseenUuid.slice(0,24);for(let r=0;r<Pe.length;r++){let i=Pe[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&A&&i.uuid===A.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[O,A,Pe]),[ze,Be]=(0,Q.useState)(()=>new Set),B=(0,Q.useCallback)(e=>{let t=Ui(e);Be(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),He=(0,Q.useCallback)(e=>ze.size>0&&ze.has(Ui(e)),[ze]),V=(0,Q.useRef)(je);V.current=je;let Ue=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&h(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=V.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?St(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),We=(!a||!!a.shouldContinueAnimation)&&!o.length&&!c,Ge=s.size>0,{progress:H}=Fe(),Ke=(0,Q.useRef)(null),qe=$e().terminalProgressBarEnabled&&!f();(0,Q.useEffect)(()=>{let e=qe?Ge?`indeterminate`:`completed`:null;Ke.current!==e&&(Ke.current=e,H(e))},[H,qe,Ge]),(0,Q.useEffect)(()=>()=>H(null),[H]);let Je=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Ye=(e,n)=>{let a=n>0?Pe[n-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!E||wr(Pe,n,t,Ie)),l=Pe.length-1-n>0,u=Je(e),f=(0,$.jsx)(Mr,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:r,verbose:i||He(e)||A?.expanded===!0&&n===Re,inProgressToolUseIDs:s,streamingToolUseIDs:Ie,screen:d,canAnimate:We,lastThinkingBlockId:_e,latestBashOutputUUID:ye,columns:N,isLoading:S,lookups:je,shouldCollapseDiffs:l},u),p=(0,$.jsx)(y.Provider,{value:n===Re,children:f},u);return O&&n===z?[(0,$.jsx)(L,{marginTop:1,children:(0,$.jsx)(Ne,{title:`${O.count} new ${ot(O.count,`message`)}`,width:N,color:`inactive`})},`unseen-divider`),p]:p},Ze=(0,Q.useRef)(new WeakMap),Qe=(0,Q.useCallback)(e=>{let n=Ze.current.get(e);if(n!==void 0)return n;let r=mn(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=je.toolUseByToolUseID.get(n.tool_use_id),a=(i&&St(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Ze.current.set(e,i),i},[t,je]);return(0,$.jsxs)($.Fragment,{children:[!x&&!(M&&M[0]>0)&&(0,$.jsx)(qi,{agentDefinitions:b}),Me&&(0,$.jsx)(Ne,{title:`${de} to show ${Le.bold(I)} previous messages`,width:N}),Ce&&_&&I>0&&!k&&(0,$.jsx)(Ne,{title:`${de} to hide ${Le.bold(I)} previous messages`,width:N}),De?(0,$.jsx)(p.Provider,{value:!0,children:(0,$.jsx)(Ni,{messages:Pe,scrollRef:ee,columns:N,itemKey:Je,renderItem:Ye,onItemClick:B,isItemClickable:Ue,isItemExpanded:He,trackStickyPrompt:te,selectedIndex:Re>=0?Re:void 0,cursorNavRef:ce,setCursor:oe,jumpRef:ne,onSearchMatchesChange:re,scanElement:ie,setPositions:ae,extractSearchText:Qe})}):Pe.flatMap(Ye),E&&(0,$.jsx)(L,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(L,{flexDirection:`row`,children:[(0,$.jsx)(L,{minWidth:2,children:(0,$.jsx)(R,{color:`text`,children:Xe})}),(0,$.jsx)(L,{flexDirection:`column`,children:(0,$.jsx)(fe,{children:E})})]})}),he&&T&&(0,$.jsx)(L,{marginTop:1,children:(0,$.jsx)(v,{param:{type:`thinking`,thinking:T.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},Qi=Ki.memo(Zi,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&Wi(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{Oi as a,li as c,bi as i,ui as l,$i as n,_i as o,xi as r,gi as s,Qi as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DcaKZlRU.js";import{Ub as r,Yb as i}from"./loadAgentsDir-C1LkW7gl.js";import{Gt as a,H as o,I as s,Lt as c,P as l,Wt as u,ai as d,kt as f,ot as p,t as m}from"./src-DL3w8VPk.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as g,b as _,h as v,qt as y}from"./settings-DKN4xSpQ.js";import{m as b,s as x}from"./config-BddEvZZl.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{Gn as w,St as T,Wn as E,wt as D}from"./model-BwBE0Pt5.js";import{n as O,t as k}from"./TextInput-7uqPhq9T.js";import{c as ee,i as A,s as j}from"./terminalSetup-Cf_r6pwK.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CjW3gUOt.js";import{n as P,t as F}from"./select-C_KXmqbI.js";import{r as I}from"./Spinner-DwsJJUtn.js";import{n as L,t as R}from"./ThemePicker-DT9zVy-0.js";import{n as z,t as B}from"./PressEnterToContinue-DZc_s_pE.js";import{t as V}from"./ApproveApiKey-_VXIMSwY.js";n();var H=e(d(),1),U=h();S(),y(),v(),b(),E(),T(),r(),A(),N(),m(),m(),I(),i(),m(),O();function W({onDone:e}){let[t,n]=(0,H.useState)({state:`custom_platform`,baseUrl:process.env.ANTHROPIC_BASE_URL??``,apiKey:process.env.ANTHROPIC_AUTH_TOKEN??``,haikuModel:process.env.ANTHROPIC_DEFAULT_HAIKU_MODEL??``,sonnetModel:process.env.ANTHROPIC_DEFAULT_SONNET_MODEL??``,opusModel:process.env.ANTHROPIC_DEFAULT_OPUS_MODEL??``,activeField:`base_url`});return(0,H.useEffect)(()=>{if(t.state===`about_to_retry`){let e=setTimeout(n,1e3,t.nextState);return()=>clearTimeout(e)}},[t]),u(`confirm:yes`,()=>{C(`tengu_oauth_success`,{}),e()},{context:`Confirmation`,isActive:t.state===`success`}),u(`confirm:yes`,()=>{t.state===`error`&&t.toRetry&&n({state:`about_to_retry`,nextState:t.toRetry})},{context:`Confirmation`,isActive:t.state===`error`&&!!t.toRetry}),(0,U.jsx)(s,{flexDirection:`column`,gap:1,children:(0,U.jsx)(s,{paddingLeft:1,flexDirection:`column`,gap:1,children:(0,U.jsx)(G,{oauthStatus:t,setOAuthStatus:n,onDone:e})})})}function G({oauthStatus:e,setOAuthStatus:t,onDone:n}){switch(e.state){case`custom_platform`:{let r=[`base_url`,`api_key`,`haiku_model`,`sonnet_model`,`opus_model`],{activeField:i,baseUrl:a,apiKey:o,haikuModel:c,sonnetModel:d,opusModel:f}=e,m={base_url:a,api_key:o,haiku_model:c,sonnet_model:d,opus_model:f},[h,g]=(0,H.useState)(()=>m[i]),[v,y]=(0,H.useState)(()=>m[i].length),b=(0,H.useCallback)((e,t,n)=>{let r={state:`custom_platform`,activeField:n??i,baseUrl:a,apiKey:o,haikuModel:c,sonnetModel:d,opusModel:f};switch(e){case`base_url`:return{...r,baseUrl:t};case`api_key`:return{...r,apiKey:t};case`haiku_model`:return{...r,haikuModel:t};case`sonnet_model`:return{...r,sonnetModel:t};case`opus_model`:return{...r,opusModel:t}}},[i,a,o,c,d,f]),x=(0,H.useCallback)(()=>{let e={...m,[i]:h},r={};if(e.base_url){try{new URL(e.base_url)}catch{t({state:`error`,message:`Invalid base URL: please enter a full URL including protocol (e.g., https://api.example.com)`,toRetry:{state:`custom_platform`,baseUrl:``,apiKey:``,haikuModel:``,sonnetModel:``,opusModel:``,activeField:`base_url`}});return}r.ANTHROPIC_BASE_URL=e.base_url}e.api_key&&(r.ANTHROPIC_AUTH_TOKEN=e.api_key),e.haiku_model&&(r.ANTHROPIC_DEFAULT_HAIKU_MODEL=e.haiku_model),e.sonnet_model&&(r.ANTHROPIC_DEFAULT_SONNET_MODEL=e.sonnet_model),e.opus_model&&(r.ANTHROPIC_DEFAULT_OPUS_MODEL=e.opus_model);let{error:a}=_(`userSettings`,{modelType:`anthropic`,env:r});if(a)t({state:`error`,message:`Failed to save settings. Please try again.`,toRetry:{state:`custom_platform`,baseUrl:e.base_url??``,apiKey:e.api_key??``,haikuModel:e.haiku_model??``,sonnetModel:e.sonnet_model??``,opusModel:e.opus_model??``,activeField:`base_url`}});else{for(let[e,t]of Object.entries(r))process.env[e]=t;t({state:`success`}),n()}},[i,h,m,t,n]),S=(0,H.useCallback)(()=>{let e=r.indexOf(i);if(e===r.length-1)t(b(i,h)),x();else{let n=r[e+1];t(b(i,h,n)),g(m[n]??``),y((m[n]??``).length)}},[i,h,b,x,m,t]);u(`tabs:next`,()=>{let e=r.indexOf(i);e<r.length-1&&(t(b(i,h,r[e+1])),g(m[r[e+1]]??``),y((m[r[e+1]]??``).length))},{context:`FormField`}),u(`tabs:previous`,()=>{let e=r.indexOf(i);e>0&&(t(b(i,h,r[e-1])),g(m[r[e-1]]??``),y((m[r[e-1]]??``).length))},{context:`FormField`}),u(`confirm:no`,()=>{n()},{context:`Confirmation`});let C=p().columns-20,w=(e,t,n)=>{let r=i===e,a=m[e];return(0,U.jsxs)(s,{children:[(0,U.jsx)(l,{backgroundColor:r?`suggestion`:void 0,color:r?`inverseText`:void 0,children:` ${t} `}),(0,U.jsx)(l,{children:` `}),r?(0,U.jsx)(k,{value:h,onChange:g,onSubmit:S,cursorOffset:v,onChangeCursorOffset:y,columns:C,mask:n?.mask?`*`:void 0,focus:!0}):a?(0,U.jsx)(l,{color:`success`,children:n?.mask?a.slice(0,8)+`·`.repeat(Math.max(0,a.length-8)):a}):null]})};return(0,U.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(l,{bold:!0,children:`Compatible API Setup`}),(0,U.jsxs)(s,{flexDirection:`column`,gap:1,children:[w(`base_url`,`Base URL `),w(`api_key`,`API Key `,{mask:!0}),w(`haiku_model`,`Haiku `),w(`sonnet_model`,`Sonnet `),w(`opus_model`,`Opus `)]}),(0,U.jsx)(l,{dimColor:!0,children:`↑↓/Tab to switch · Enter on last field to save · Esc to go back`})]})}case`about_to_retry`:return(0,U.jsx)(s,{flexDirection:`column`,gap:1,children:(0,U.jsx)(l,{color:`permission`,children:`Retrying…`})});case`success`:return(0,U.jsx)(s,{flexDirection:`column`,children:(0,U.jsxs)(l,{color:`success`,children:[`Login successful. Press `,(0,U.jsx)(l,{bold:!0,children:`Enter`}),` to continue…`]})});case`error`:return(0,U.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,U.jsxs)(l,{color:`error`,children:[`OAuth error: `,e.message]}),e.toRetry&&(0,U.jsx)(s,{marginTop:1,children:(0,U.jsxs)(l,{color:`permission`,children:[`Press `,(0,U.jsx)(l,{bold:!0,children:`Enter`}),` to retry.`]})})]});default:return null}}P(),m();var K=58;function q(){let[e]=o(),t=`Welcome to Work Mate`;return g.terminal===`Apple_Terminal`?(0,U.jsx)(J,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,U.jsxs)(s,{width:K,flexDirection:`column`,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(l,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,U.jsxs)(l,{dimColor:!0,children:[`v`,`0.0.22`,` `]})]}),(0,U.jsx)(l,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,U.jsx)(l,{children:` ░░░░░░ `}),(0,U.jsx)(l,{children:` ░░░ ░░░░░░░░░░ `}),(0,U.jsx)(l,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,U.jsx)(l,{children:` `})]}):(0,U.jsxs)(s,{width:K,flexDirection:`column`,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(l,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,U.jsxs)(l,{dimColor:!0,children:[`v`,`0.0.22`,` `]})]}),(0,U.jsx)(l,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,U.jsx)(l,{children:` * █████▓▓░ `}),(0,U.jsx)(l,{children:` * ███▓░ ░░ `}),(0,U.jsx)(l,{children:` ░░░░░░ ███▓░ `}),(0,U.jsx)(l,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,U.jsxs)(l,{children:[(0,U.jsx)(l,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,U.jsx)(l,{bold:!0,children:`*`}),(0,U.jsx)(l,{children:` ██▓░░ ▓ `})]}),(0,U.jsx)(l,{children:` ░▓▓███▓▓░ `}),(0,U.jsx)(l,{dimColor:!0,children:` * ░░░░ `}),(0,U.jsx)(l,{dimColor:!0,children:` ░░░░░░░░ `}),(0,U.jsx)(l,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,U.jsx)(l,{dimColor:!0,children:` * `})]})}function J({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,U.jsxs)(s,{width:K,flexDirection:`column`,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(l,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,U.jsxs)(l,{dimColor:!0,children:[`v`,`0.0.22`,` `]})]}),(0,U.jsx)(l,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,U.jsx)(l,{children:` ░░░░░░ `}),(0,U.jsx)(l,{children:` ░░░ ░░░░░░░░░░ `}),(0,U.jsx)(l,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,U.jsx)(l,{children:` `})]}):(0,U.jsxs)(s,{width:K,flexDirection:`column`,children:[(0,U.jsxs)(l,{children:[(0,U.jsxs)(l,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,U.jsxs)(l,{dimColor:!0,children:[`v`,`0.0.22`,` `]})]}),(0,U.jsx)(l,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,U.jsx)(l,{children:` * █████▓▓░ `}),(0,U.jsx)(l,{children:` * ███▓░ ░░ `}),(0,U.jsx)(l,{children:` ░░░░░░ ███▓░ `}),(0,U.jsx)(l,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,U.jsxs)(l,{children:[(0,U.jsx)(l,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,U.jsx)(l,{bold:!0,children:`*`}),(0,U.jsx)(l,{children:` ██▓░░ ▓ `})]}),(0,U.jsx)(l,{children:` ░▓▓███▓▓░ `}),(0,U.jsx)(l,{dimColor:!0,children:` * ░░░░ `}),(0,U.jsx)(l,{dimColor:!0,children:` ░░░░░░░░ `}),(0,U.jsx)(l,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}L(),z(),m();var Y=(0,H.createContext)({marker:``});function X({children:e}){let{marker:t}=(0,H.useContext)(Y);return(0,U.jsxs)(s,{gap:1,children:[(0,U.jsx)(l,{dimColor:!0,children:t}),(0,U.jsx)(s,{flexDirection:`column`,children:e})]})}m();var Z=(0,H.createContext)({marker:``});function Q({children:e}){let{marker:t}=(0,H.useContext)(Z),n=0;for(let t of H.Children.toArray(e))!(0,H.isValidElement)(t)||t.type!==X||n++;let r=String(n).length;return(0,U.jsx)(s,{flexDirection:`column`,children:H.Children.map(e,(e,n)=>{if(!(0,H.isValidElement)(e)||e.type!==X)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,U.jsx)(Z.Provider,{value:{marker:a},children:(0,U.jsx)(Y.Provider,{value:{marker:a},children:e})})})})}Q.Item=X;var $=Q;S(),m(),r(),y();function te({onDone:e}){let[n,r]=(0,H.useState)(0),[i,u]=(0,H.useState)(!1),[d]=(0,H.useState)(()=>D()),[p,m]=o();(0,H.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:d})},[d]);function h(){if(n<E.length-1){let e=n+1;r(e),C(`tengu_onboarding_step`,{oauthEnabled:d,stepId:E[e]?.id})}else e()}function _(e){m(e),h()}let v=M(),y=(0,U.jsx)(s,{marginX:1,children:(0,U.jsx)(R,{onThemeSelect:_,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),b=(0,U.jsxs)(s,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,U.jsx)(l,{bold:!0,children:`Before you start, keep in mind:`}),(0,U.jsx)(s,{flexDirection:`column`,width:70,children:(0,U.jsxs)($,{children:[(0,U.jsxs)($.Item,{children:[(0,U.jsx)(l,{children:`Always review changes before accepting`}),(0,U.jsxs)(l,{dimColor:!0,wrap:`wrap`,children:[`Work Mate can make mistakes — especially when running commands`,(0,U.jsx)(f,{}),`or editing files. You stay in control of every action.`,(0,U.jsx)(f,{})]})]}),(0,U.jsxs)($.Item,{children:[(0,U.jsx)(l,{children:`Only use Work Mate on projects you trust`}),(0,U.jsxs)(l,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,U.jsx)(f,{}),(0,U.jsx)(c,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,U.jsx)(B,{})]}),S=(0,H.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=w(process.env.ANTHROPIC_API_KEY);if(x(e)===`new`)return e},[]);function T(e){e&&u(!0),h()}let E=[];E.push({id:`theme`,component:y}),S&&E.push({id:`api-key`,component:(0,U.jsx)(V,{customApiKeyTruncated:S,onDone:T})}),d&&E.push({id:`oauth`,component:(0,U.jsx)(ne,{skip:i,onSkip:h,children:(0,U.jsx)(W,{onDone:h})})}),E.push({id:`security`,component:b}),ee()&&E.push({id:`terminal-setup`,component:(0,U.jsxs)(s,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,U.jsx)(l,{bold:!0,children:`Use Work Mate's terminal setup?`}),(0,U.jsxs)(s,{flexDirection:`column`,width:70,gap:1,children:[(0,U.jsxs)(l,{children:[`For the optimal coding experience, enable the recommended settings`,(0,U.jsx)(f,{}),`for your terminal:`,` `,g.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,U.jsx)(F,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?j(p).catch(()=>{}).finally(h):h()},onCancel:()=>h()}),(0,U.jsx)(l,{dimColor:!0,children:v.pending?(0,U.jsxs)(U.Fragment,{children:[`Press `,v.keyName,` again to exit`]}):(0,U.jsx)(U.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let O=E[n],k=(0,H.useCallback)(()=>{n===E.length-1?e():h()},[n,E.length,d,e]),A=(0,H.useCallback)(()=>{h()},[n,E.length,d,e]);return a({"confirm:yes":k},{context:`Confirmation`,isActive:O?.id===`security`}),a({"confirm:no":A},{context:`Confirmation`,isActive:O?.id===`terminal-setup`}),(0,U.jsxs)(s,{flexDirection:`column`,children:[(0,U.jsx)(q,{}),(0,U.jsxs)(s,{flexDirection:`column`,marginTop:1,children:[O?.component,v.pending&&(0,U.jsx)(s,{padding:1,children:(0,U.jsxs)(l,{dimColor:!0,children:[`Press `,v.keyName,` again to exit`]})})]})]})}function ne({skip:e,onSkip:t,children:n}){return(0,H.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{te as Onboarding};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Yb as n}from"./loadAgentsDir-C1LkW7gl.js";import{Gr as r,I as i,P as a,ai as o,ot as s,t as c}from"./src-DL3w8VPk.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{S as u,_ as d,b as f}from"./startupProfiler-DTs9w9EN.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:n,overlay:a}){let{rows:o}=s(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=n??Math.max(...e.map(e=>r(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(i,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(o(),1),n(),c(),d(),_=l(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:n}){let i=s().columns;if(m(e.id)){let t=p(e.id),o=n?`suggestion`:void 0,s=!n,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,r(e.description)):0,n=i-2-4-d-t;m=f(e.displayText,n)}else m=l?u(e.displayText,30):e.displayText;let h=i-2-r(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:o,dimColor:s,wrap:`truncate`,children:g})}let o=Math.floor(i*.4),c=Math.min(t??r(e.displayText)+5,o),l=e.color||(n?`suggestion`:void 0),d=!n,h=e.displayText;r(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-r(h))),v=e.tag?`[${e.tag}] `:``,y=r(v),b=Math.max(0,i-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:n?`suggestion`:void 0,dimColor:!n,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bw as t,Gb as n,Rw as r,Wb as i}from"./loadAgentsDir-C1LkW7gl.js";import{I as a,P as o,t as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as l,qt as u}from"./settings-DKN4xSpQ.js";import{c as d,m as f}from"./config-BddEvZZl.js";import{i as p,o as m}from"./platform-Dzff1WWw.js";import{K as h,U as g,W as _}from"./model-BwBE0Pt5.js";import{a as v,i as y,r as b}from"./terminalSetup-Cf_r6pwK.js";function x(){return d().editorMode===`vim`}function S(){return l.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),f(),u()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:r,fixedWidth:i,gap:s,paddingX:c}=e,l=T(n(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=T(n(`app:toggleTodos`,`Global`,`ctrl+t`)),d=T(n(`chat:undo`,`Chat`,`ctrl+_`)),f=T(n(`chat:stash`,`Chat`,`ctrl+s`)),m=T(n(`chat:cycleMode`,`Chat`,`shift+tab`)),g=T(n(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(n(`chat:fastMode`,`Chat`,`alt+o`)),y=T(n(`chat:externalEditor`,`Chat`,`ctrl+g`));T(n(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(n(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(a,{paddingX:c,flexDirection:`row`,gap:s,children:[(0,D.jsxs)(a,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`! for bash mode`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`/ for commands`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`@ for file paths`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`& for background`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`/btw for side question`})})]}),(0,D.jsxs)(a,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`double tap esc to clear input`})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[m,` to auto-accept edits`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[l,` for verbose output`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[u,` to toggle tasks`]})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:S()})})]}),(0,D.jsxs)(a,{flexDirection:`column`,children:[(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[d,` to undo`]})}),p()!==`windows`&&(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`ctrl + z to suspend`})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[b,` to paste images`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[g,` to switch model`]})}),h()&&_()&&(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[f,` to stash prompt`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),t()&&(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:r,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{s(),m(),r(),i(),g(),w(),D=c()}));export{x as a,C as i,O as n,w as r,E as t};
|