@readmagic/workmate 0.0.29 → 0.0.31
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-C0lrhffT.js → AddWorkspaceDirectory-C07tZJZN.js} +1 -1
- package/dist/chunks/{AgentsMdExternalIncludesDialog-Dmjjx4ql.js → AgentsMdExternalIncludesDialog-6_bT7l-8.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BbSA-E68.js +1 -0
- package/dist/chunks/{App-COz7knHS.js → App--Nvun0sE.js} +1 -1
- package/dist/chunks/{BackgroundTasksDialog-5IkCQ8lN.js → BackgroundTasksDialog-DTWNv4Gc.js} +1 -1
- package/dist/chunks/{BypassPermissionsModeDialog-g1FMGfQF.js → BypassPermissionsModeDialog-CJ6U9Vb2.js} +1 -1
- package/dist/chunks/{CustomSelect-BsEd2To5.js → CustomSelect-uOjgHk8D.js} +1 -1
- package/dist/chunks/{DiffDialog-Cwf8CdxZ.js → DiffDialog-CTFLCtYp.js} +4 -4
- package/dist/chunks/Doctor-Bd0k7Jo7.js +1 -0
- package/dist/chunks/{Doctor-GmT5aeAc.js → Doctor-CgZxiFf3.js} +1 -1
- package/dist/chunks/{ExitFlow-DPgUFqeC.js → ExitFlow-DGqwlF8J.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-Di6HZYDV.js → InvalidConfigDialog-8ZJmSDBO.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-BHL-MERJ.js → InvalidSettingsDialog-B7czkYPj.js} +1 -1
- package/dist/chunks/{KeybindingProviderSetup-eE3o0bfp.js → KeybindingProviderSetup-C8rq4fwQ.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-D-qpUJLV.js → MCPConnectionManager-DbPzbRdc.js} +1 -1
- package/dist/chunks/{MCPToolListView-DtHRw4jQ.js → MCPToolListView-BsO2uWCL.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-ByyErvR3.js → McpParsingWarnings-BIpQ_Dle.js} +1 -1
- package/dist/chunks/{MessageSelector-CFz30wBL.js → MessageSelector-DuCpdn-Q.js} +1 -1
- package/dist/chunks/{Messages-CfY-Oj3M.js → Messages-SKlSLbVo.js} +1 -1
- package/dist/chunks/{Onboarding-BfWLRx3n.js → Onboarding-CLEqdl35.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-BRyJj7XR.js → PromptInputFooterSuggestions-cu1KF4_b.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-DLuRCXVS.js → PromptInputHelpMenu-MH_gVGmN.js} +1 -1
- package/dist/chunks/{ProviderSetup-CKZGG2B9.js → ProviderSetup-zjQQUmDr.js} +1 -1
- package/dist/chunks/{QueryEngine-B27MOtBA.js → QueryEngine-Cb2ncWE6.js} +1 -1
- package/dist/chunks/REPL-CWbLkb3q.js +124 -0
- package/dist/chunks/REPL-D1bn80_0.js +1 -0
- package/dist/chunks/{ResumeConversation-7eURPHmQ.js → ResumeConversation-DRcIMHTE.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-B6Qlr08G.js +1 -0
- package/dist/chunks/{Settings-4TNYpfUs.js → Settings-B-EscJrZ.js} +2 -2
- package/dist/chunks/{Spinner-BgjmQLjw.js → Spinner-ByYcKk2V.js} +1 -1
- package/dist/chunks/{SpinnerGlyph-BR_SiV9L.js → SpinnerGlyph-4aVLQdJf.js} +1 -1
- package/dist/chunks/{TextInput-BVEWdRz9.js → TextInput-eYxBj_1-.js} +1 -1
- package/dist/chunks/{ThemePicker-th2jdUjh.js → ThemePicker-BqeGU99Q.js} +1 -1
- package/dist/chunks/{TrustDialog-YsYqHyRR.js → TrustDialog-DYZ0i7rH.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-CKeHoN2Z.js → ValidationErrorsList-Cw-sjz1h.js} +1 -1
- package/dist/chunks/{_baseEach-Bz5fQbIq.js → _baseEach-BQ2jM5Sg.js} +1 -1
- package/dist/chunks/{add-dir-BsO6l8Ue.js → add-dir-3q2C-Kfj.js} +1 -1
- package/dist/chunks/{agentDisplay-ChkgiTIH.js → agentDisplay-C18dbK7V.js} +1 -1
- package/dist/chunks/{agents-DqEB6iwV.js → agents--BKL-glS.js} +1 -1
- package/dist/chunks/{agents-BV1nan6b.js → agents-B_Ik_9lY.js} +1 -1
- package/dist/chunks/{allErrors-CkdguCDv.js → allErrors-CJOE7EGx.js} +1 -1
- package/dist/chunks/{appleTerminalBackup-CN8kS74J.js → appleTerminalBackup-j8nI5uNK.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-COON_jRA.js +1 -0
- package/dist/chunks/{backgroundHousekeeping-1VsWy8xd.js → backgroundHousekeeping-FPn2H48W.js} +1 -1
- package/dist/chunks/banner-BsO6K4Ve.js +2 -0
- package/dist/chunks/{branch-CTIHtpwz.js → branch-7SdIl7ZG.js} +1 -1
- package/dist/chunks/bridgeControl-DMUu37uO.js +2 -0
- package/dist/chunks/{btw-BA39Zrhm.js → btw-BhVWw00h.js} +1 -1
- package/dist/chunks/{bundledMode-D9omqD3L.js → bundledMode-Dqe4pz0a.js} +1 -1
- package/dist/chunks/caches-DaOhyHsb.js +1 -0
- package/dist/chunks/caches-DgNr-KX3.js +1 -0
- package/dist/chunks/channel-BNS35qVl.js +2 -0
- package/dist/chunks/{channel-C5yKM1wf.js → channel-DWDK9jut.js} +1 -1
- package/dist/chunks/{clear-BmlaYYrD.js → clear-B5WkPxlz.js} +1 -1
- package/dist/chunks/{client-pA7fKk0-.js → client-D3QmHVeI.js} +1 -1
- package/dist/chunks/client-dTKhXxBT.js +1 -0
- package/dist/chunks/{client-2w-g5kMx.js → client-q_uGYC2E.js} +1 -1
- package/dist/chunks/client-y_U1O4mI.js +1 -0
- package/dist/chunks/commands-DJe5bkNw.js +1 -0
- package/dist/chunks/{compact-D3uePeI7.js → compact-DriVPdmX.js} +1 -1
- package/dist/chunks/config-CMtnYZR9.js +3 -0
- package/dist/chunks/config-CgzzjTUe.js +1 -0
- package/dist/chunks/config-FEF6EcWp.js +1 -0
- package/dist/chunks/{context-CBEWyVpE.js → context-CXi66Ghx.js} +1 -1
- package/dist/chunks/{context-noninteractive-B03nuxfN.js → context-noninteractive-BRoUkLxt.js} +1 -1
- package/dist/chunks/context-noninteractive-Bupgkyt9.js +1 -0
- package/dist/chunks/conversation-CCV0BYD_.js +1 -0
- package/dist/chunks/{conversation-BFL0rEIx.js → conversation-DrEE7olO.js} +1 -1
- package/dist/chunks/{conversationRecovery-Bt84CYO6.js → conversationRecovery-CZzxsT_R.js} +1 -1
- package/dist/chunks/{crossProjectResume-DwlYY6lV.js → crossProjectResume-CbXDWdHE.js} +1 -1
- package/dist/chunks/{debug-2pVES-2G.js → debug-NBJH_NxR.js} +2 -2
- package/dist/chunks/{detectRepository--luIRv5H.js → detectRepository-Bu0he_XM.js} +1 -1
- package/dist/chunks/{diff-CewYzu3Y.js → diff-CH8kHqwX.js} +1 -1
- package/dist/chunks/{directoryCompletion-BC0qRmrz.js → directoryCompletion-CwKPuwrS.js} +1 -1
- package/dist/chunks/doctor-HV7-zZgq.js +1 -0
- package/dist/chunks/{entry-DdVUdGWV.js → entry-CyH0Rkjq.js} +3 -3
- package/dist/chunks/{execFileNoThrow-DXSEj8ZO.js → execFileNoThrow-7Ys9mO27.js} +1 -1
- package/dist/chunks/{exit-QwCo2aJo.js → exit-zYpIKg68.js} +1 -1
- package/dist/chunks/{extraUsage-Cu0aV35i.js → extraUsage-Dp_LtcKE.js} +1 -1
- package/dist/chunks/extractMemories-1_fkJtc-.js +1 -0
- package/dist/chunks/fast-Bi-RRDlf.js +1 -0
- package/dist/chunks/{fast-BlhpCQ2f.js → fast-DnP_x58e.js} +1 -1
- package/dist/chunks/{fetchModelList-DjFCMjVN.js → fetchModelList-BctZn47N.js} +1 -1
- package/dist/chunks/fetchModelList-Dfyy0Yds.js +1 -0
- package/dist/chunks/fileSuggestions-CoYWpIJB.js +3 -0
- package/dist/chunks/{gemini-I-M5_sUA.js → gemini-CyZAw1Wg.js} +1 -1
- package/dist/chunks/{generateSessionName-CJ0sh6HD.js → generateSessionName-CJ13ZLWG.js} +1 -1
- package/dist/chunks/{genericProcessUtils-GqURdVAv.js → genericProcessUtils-XwqvFxyn.js} +1 -1
- package/dist/chunks/{goal-DIrBBT5J.js → goal-CiuF90SO.js} +1 -1
- package/dist/chunks/{grok-ZLjJN6b9.js → grok-B4R78Wy4.js} +1 -1
- package/dist/chunks/{help-CDMjVOl6.js → help-CQ8yZg8_.js} +1 -1
- package/dist/chunks/{history-CUrqO9rV.js → history-PZLMYab7.js} +1 -1
- package/dist/chunks/hooks-Cj3t3ItG.js +1 -0
- package/dist/chunks/{hooks-BNKCE023.js → hooks-DgsxCW0L.js} +1 -1
- package/dist/chunks/{install-xlfTw1j6.js → install-W_2JVR8Y.js} +1 -1
- package/dist/chunks/{instrumentation-DSt0UvGn.js → instrumentation-Yk5dlvD_.js} +3 -3
- package/dist/chunks/{job-BVElGsu0.js → job-CAbdQPkT.js} +1 -1
- package/dist/chunks/{keybindings-CxgQqQJe.js → keybindings-CkiE_uBG.js} +1 -1
- package/dist/chunks/{launchLocalMemory-DUkJCKmd.js → launchLocalMemory-C-KuYLDQ.js} +1 -1
- package/dist/chunks/{launchOnboarding-BvD-E_jC.js → launchOnboarding-2-AEYja0.js} +1 -1
- package/dist/chunks/{loadAgentsDir-BfLCckVj.js → loadAgentsDir-CgDTTnMX.js} +477 -477
- package/dist/chunks/loadAgentsDir-jBY44wEO.js +1 -0
- package/dist/chunks/{loadPluginHooks-BPwWtBzO.js → loadPluginHooks-CWkivYx4.js} +1 -1
- package/dist/chunks/{loader-BMAtuwRa.js → loader-DsEdsMHv.js} +1 -1
- package/dist/chunks/localSearch-B3aRqi3q.js +1 -0
- package/dist/chunks/{localSearch-BHG8sp8p.js → localSearch-BhygSl0K.js} +1 -1
- package/dist/chunks/{log-L1kqxa_P.js → log-D98mO6yJ.js} +1 -1
- package/dist/chunks/{logoUtils-BsNLv-qi.js → logoUtils-rZbHAggC.js} +1 -1
- package/dist/chunks/{magicDocs-Bue9vxzY.js → magicDocs-430IH4o3.js} +1 -1
- package/dist/chunks/{main-U71X4Thd.js → main-DuS6HbbE.js} +17 -17
- package/dist/chunks/managedEnv-BV6T_PdC.js +1 -0
- package/dist/chunks/{managedEnv-EZ2IirNa.js → managedEnv-O3Xqe_lk.js} +1 -1
- package/dist/chunks/{mcp-De3QGKvT.js → mcp-BoJ9rdef.js} +1 -1
- package/dist/chunks/{mcp-C4CxCMwJ.js → mcp-C2GF6Gp7.js} +1 -1
- package/dist/chunks/{mcp-D9HFARDy.js → mcp-XaHs-eh9.js} +1 -1
- package/dist/chunks/{memory-DVRdJFfI.js → memory-D0vG6luI.js} +1 -1
- package/dist/chunks/{mode-Bd5w-RBX.js → mode-4ZXGLC71.js} +1 -1
- package/dist/chunks/model-BidsdFhX.js +1 -0
- package/dist/chunks/{model-BCIcUhrc.js → model-CcgVXT3w.js} +1 -1
- package/dist/chunks/{modelOptions-COIU5U3w.js → modelOptions-Bw53Jebp.js} +1 -1
- package/dist/chunks/{nativeInstaller-CGSNzGNn.js → nativeInstaller-BczAzL96.js} +1 -1
- package/dist/chunks/{notifications-B5gzCmPC.js → notifications-B3v1XAdd.js} +1 -1
- package/dist/chunks/{onChangeAppState-NWwSE-I4.js → onChangeAppState-wASLrUas.js} +1 -1
- package/dist/chunks/{openai-CyJ3m4dI.js → openai-CvSNI6b2.js} +1 -1
- package/dist/chunks/{overlayContext-DYrGDe63.js → overlayContext-0wuZMXWl.js} +1 -1
- package/dist/chunks/{parser-CTnaXFVJ.js → parser-D2kggQDp.js} +1 -1
- package/dist/chunks/parser-DZUcp40d.js +1 -0
- package/dist/chunks/{partition-BavNaw1S.js → partition-CGKLltyv.js} +1 -1
- package/dist/chunks/{pasteStore-njJCBMKr.js → pasteStore-2RafnH7M.js} +1 -1
- package/dist/chunks/{permissions-CLYcBXIu.js → permissions-DawwDdur.js} +1 -1
- package/dist/chunks/{pidLock-Bao7SU6Z.js → pidLock-TOlSC34M.js} +2 -2
- package/dist/chunks/{plan-Dwj_ZX8G.js → plan-D_vIEUQa.js} +1 -1
- package/dist/chunks/{plugin-Cscvf8st.js → plugin-CDWB3AFL.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-D5XyiZrP.js → pluginAutoupdate-CPzXHVsX.js} +1 -1
- package/dist/chunks/{pluginBlocklist-CpkjXXKQ.js → pluginBlocklist-Bu6GP9_C.js} +1 -1
- package/dist/chunks/{pluginCliCommands-DmLsxs1M.js → pluginCliCommands-CNpseXZD.js} +1 -1
- package/dist/chunks/{pluginFlagging-CRuX6sHR.js → pluginFlagging-1MM3zuMP.js} +1 -1
- package/dist/chunks/{pluginOperations-orq3bOCp.js → pluginOperations-qT-GGKNu.js} +1 -1
- package/dist/chunks/pluginStartupCheck-CCDpCchC.js +1 -0
- package/dist/chunks/{pluginStartupCheck-DGDl1WOZ.js → pluginStartupCheck-DXPIrR7f.js} +1 -1
- package/dist/chunks/{plugins-Cq5c-Qs1.js → plugins-Bbbvm9KH.js} +1 -1
- package/dist/chunks/{poorMode-CG2JNTD0.js → poorMode-BvypUTur.js} +1 -1
- package/dist/chunks/poorMode-CP6359Sz.js +1 -0
- package/dist/chunks/print-Db7IDW_T.js +13 -0
- package/dist/chunks/process-CewWh77C.js +1 -0
- package/dist/chunks/process-De2crvt4.js +1 -0
- package/dist/chunks/{processBashCommand-C7oVqf0B.js → processBashCommand-DtEP1Js2.js} +1 -1
- package/dist/chunks/{processSlashCommand-CPQB5_0w.js → processSlashCommand-BIIOr3n4.js} +1 -1
- package/dist/chunks/{projectOnboardingState-D-_ijZnG.js → projectOnboardingState-DqGLXSM_.js} +1 -1
- package/dist/chunks/prompt-CCP82QoX.js +1 -0
- package/dist/chunks/{prompt-DaYH88Oe.js → prompt-CduUPV0s.js} +3 -3
- package/dist/chunks/prompt-DmWyLDH6.js +1 -0
- package/dist/chunks/{promptEditor-14TB3MYt.js → promptEditor-CyMqa_av.js} +1 -1
- package/dist/chunks/{protocolHandler-CJO3CRYW.js → protocolHandler-DrGjosKa.js} +1 -1
- package/dist/chunks/{proxy--_NfbJhm.js → proxy-MzIsnPd7.js} +1 -1
- package/dist/chunks/{reconciler-B5Kr4do0.js → reconciler-DQxjz0OK.js} +1 -1
- package/dist/chunks/{refresh-DurNMJeS.js → refresh-BmkkYKno.js} +1 -1
- package/dist/chunks/{reject-CzjtO3fU.js → reject-DYsU8jkO.js} +1 -1
- package/dist/chunks/{reload-plugins-C38i_Eb3.js → reload-plugins-CmHAxvlA.js} +1 -1
- package/dist/chunks/{rename-BV-3ZpFx.js → rename-BrGuvkvC.js} +1 -1
- package/dist/chunks/{renderOptions-B0RFpjRI.js → renderOptions-B3DyIbF6.js} +1 -1
- package/dist/chunks/{resume-CUzQIor4.js → resume-COSo0ATp.js} +1 -1
- package/dist/chunks/ripgrep-CIIzTaSI.js +1 -0
- package/dist/chunks/{ripgrep-67m14ImZ.js → ripgrep-CnK9qx1e.js} +1 -1
- package/dist/chunks/{runtimeObserver-Ess1Cn8Y.js → runtimeObserver-CoNTwrJ3.js} +1 -1
- package/dist/chunks/{runtimeObserver-BKoQ5IEO.js → runtimeObserver-Dpi40Nfi.js} +2 -2
- package/dist/chunks/sandbox-adapter-D0bQ6nsv.js +1 -0
- package/dist/chunks/{sandbox-toggle-Bp6Xpjh3.js → sandbox-toggle-CrjErH9V.js} +1 -1
- package/dist/chunks/searchExtraTools-_Fo0KDnz.js +1 -0
- package/dist/chunks/{select-Bm29ymsI.js → select-BNeFiLNP.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-BCBV26Ut.js +1 -0
- package/dist/chunks/{sessionObserver-CBlzrJt1.js → sessionObserver-CAvR0MCN.js} +1 -1
- package/dist/chunks/sessionObserver-QbHl_0Dr.js +1 -0
- package/dist/chunks/sessionStorage-CscAodvT.js +1 -0
- package/dist/chunks/{sessionTracing-TDsq54Uc.js → sessionTracing-rMBtalMz.js} +1 -1
- package/dist/chunks/settings-B3WqnPDo.js +1 -0
- package/dist/chunks/{settings-D4M13toi.js → settings-CA-5Px85.js} +2 -2
- package/dist/chunks/setup-X5QOX_BW.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BG3jtA9Y.js → shadowedRuleDetection-BucAPuXp.js} +1 -1
- package/dist/chunks/{sideQuestion-C8GNVo4R.js → sideQuestion-B1W_L7NR.js} +1 -1
- package/dist/chunks/{sinks-BafJR6Fw.js → sinks-Bqzavjot.js} +1 -1
- package/dist/chunks/sinks-ofVW99nt.js +1 -0
- package/dist/chunks/{skillChangeDetector-CY17weG4.js → skillChangeDetector-jKxXTp4F.js} +1 -1
- package/dist/chunks/{skillGapStore-Cl4J1WoZ.js → skillGapStore-CQVCxlWd.js} +2 -2
- package/dist/chunks/{skillLifecycle-DdfeUHBf.js → skillLifecycle-GGpX7H8W.js} +2 -2
- package/dist/chunks/{skillSearchPanel-DtQYF9gN.js → skillSearchPanel-DDM0zZ_r.js} +2 -2
- package/dist/chunks/{skills-Fd12LJal.js → skills-Bmdrtecu.js} +1 -1
- package/dist/chunks/{sleep-xKMbXTJe.js → sleep-BGewNhNx.js} +1 -1
- package/dist/chunks/{startupProfiler-B9Qv2QGH.js → startupProfiler-C_xcIvEA.js} +1 -1
- package/dist/chunks/startupProfiler-uueg2S43.js +1 -0
- package/dist/chunks/status-CFpCBQX1.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-D0tonVy0.js → statusNoticeHelpers-DRJcaVdx.js} +1 -1
- package/dist/chunks/{stringUtils-Cs6E5f-B.js → stringUtils-CtJhTszO.js} +1 -1
- package/dist/chunks/switcher-BCr3vwnq.js +1 -0
- package/dist/chunks/{switcher-BCq9Az_q.js → switcher-CqGz0hjQ.js} +1 -1
- package/dist/chunks/{tasks-DQmkY_xD.js → tasks-CNQUkXoq.js} +1 -1
- package/dist/chunks/{templateJobs-CEDUbFAY.js → templateJobs-CYArZLti.js} +1 -1
- package/dist/chunks/{terminalSetup-CaGbEVjB.js → terminalSetup-QvvwfSGV.js} +1 -1
- package/dist/chunks/{terminalSetup-xe_P98fY.js → terminalSetup-h_TPZN2E.js} +1 -1
- package/dist/chunks/{theme-DQjJ4R0o.js → theme-DVkXXIPx.js} +1 -1
- package/dist/chunks/{tipRegistry-BwxZ_G0j.js → tipRegistry-DzOyYhJT.js} +2 -2
- package/dist/chunks/{toolEventObserver-DdZ30on9.js → toolEventObserver-BAkhiG0F.js} +1 -1
- package/dist/chunks/{toolPool-CWIXwdX7.js → toolPool-D_7Onp-c.js} +1 -1
- package/dist/chunks/{udsClient-CWeoNrm3.js → udsClient-COYqIvvr.js} +1 -1
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ClrtNKJ6.js → useExitOnCtrlCDWithKeybindings-z3RiW9jT.js} +1 -1
- package/dist/chunks/useMainLoopModel-DMB41HoQ.js +1 -0
- package/dist/chunks/{useManagePlugins-CmsPSHor.js → useManagePlugins-DSRLHKH5.js} +1 -1
- package/dist/chunks/{useMergedTools-C8PxReh0.js → useMergedTools-C7wh5W03.js} +1 -1
- package/dist/chunks/{useSearchInput-BZhTzjgN.js → useSearchInput-r534PKo1.js} +1 -1
- package/dist/chunks/{useSettingsErrors-GWIxCYyd.js → useSettingsErrors-DL_ai-el.js} +1 -1
- package/dist/chunks/{util-Bih2g-pV.js → util-DombpJHQ.js} +1 -1
- package/dist/chunks/{validatePlugin-BwcC_Wbr.js → validatePlugin-DU3C7Mvb.js} +1 -1
- package/dist/chunks/vim-BX8ljWbJ.js +1 -0
- package/dist/chunks/worktree-CjnMMjR6.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-DIahWLha.js +0 -1
- package/dist/chunks/Doctor-CcLoI7tF.js +0 -1
- package/dist/chunks/REPL-DMRD5wSN.js +0 -124
- package/dist/chunks/REPL-gzolQvzu.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BINZTstr.js +0 -1
- package/dist/chunks/backgroundHousekeeping-pMtrl4K2.js +0 -1
- package/dist/chunks/banner-BKOzHotb.js +0 -2
- package/dist/chunks/bridgeControl-C8xaGuwO.js +0 -2
- package/dist/chunks/caches-DHZHqVhf.js +0 -1
- package/dist/chunks/caches-fqs-Y-kW.js +0 -1
- package/dist/chunks/channel-B5FkNSZ3.js +0 -1
- package/dist/chunks/client-B0ngS4Uu.js +0 -1
- package/dist/chunks/client-BP4DOH3K.js +0 -1
- package/dist/chunks/commands-EUcHifS4.js +0 -1
- package/dist/chunks/config-Bio2EjUK.js +0 -3
- package/dist/chunks/config-C_AEhZrn.js +0 -1
- package/dist/chunks/config-GgGdlJ9h.js +0 -1
- package/dist/chunks/context-noninteractive-BLCyyyGL.js +0 -1
- package/dist/chunks/conversation-D-ker4RO.js +0 -1
- package/dist/chunks/doctor-CrQ0UfG2.js +0 -1
- package/dist/chunks/extractMemories-DHlbRc5g.js +0 -1
- package/dist/chunks/fast-C3JeBy3A.js +0 -1
- package/dist/chunks/fetchModelList-L2XarfAj.js +0 -1
- package/dist/chunks/fileSuggestions-BRwKV_KA.js +0 -3
- package/dist/chunks/hooks-ERYtmuNW.js +0 -1
- package/dist/chunks/loadAgentsDir-BImZsKrh.js +0 -1
- package/dist/chunks/localSearch-D3rvcRRC.js +0 -1
- package/dist/chunks/managedEnv-DCGLDTP_.js +0 -1
- package/dist/chunks/model-BIf2i1is.js +0 -1
- package/dist/chunks/parser-Diihup2V.js +0 -1
- package/dist/chunks/pluginStartupCheck-GHO77nmg.js +0 -1
- package/dist/chunks/poorMode-eMIFCAC_.js +0 -1
- package/dist/chunks/print-zo7Z--Ll.js +0 -13
- package/dist/chunks/process-CNfq37LF.js +0 -1
- package/dist/chunks/process-gEbdy6uY.js +0 -1
- package/dist/chunks/prompt-CAzFDybL.js +0 -1
- package/dist/chunks/prompt-Cm8SKZXY.js +0 -1
- package/dist/chunks/ripgrep-DB7KB8RZ.js +0 -1
- package/dist/chunks/sandbox-adapter-ClRO21Ci.js +0 -1
- package/dist/chunks/searchExtraTools-CV_fkuD6.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-B5kAD4ol.js +0 -1
- package/dist/chunks/sessionObserver-CayxkuxO.js +0 -1
- package/dist/chunks/sessionStorage-vLxCo1Mh.js +0 -1
- package/dist/chunks/settings-Dfit5gGT.js +0 -1
- package/dist/chunks/setup-BbyfyeQk.js +0 -3
- package/dist/chunks/sinks-CHtjg7sn.js +0 -1
- package/dist/chunks/startupProfiler-DWcM4QBl.js +0 -1
- package/dist/chunks/status-CGEMRiPI.js +0 -1
- package/dist/chunks/switcher-DQMr6Anx.js +0 -1
- package/dist/chunks/useMainLoopModel-CULw8pB_.js +0 -1
- package/dist/chunks/vim-BlO9V5_5.js +0 -1
- package/dist/chunks/worktree-BB9lFWBB.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{t as a}from"./semver-DQo45qGo.js";import{ln as o,rn as s,sn as c,t as l}from"./src-BX54x08P.js";import{Gn as u,Kn as d}from"./state-CXY-q5gr.js";import{$ as ee,I as te,M as f,R as ne,S as re,c as p,et as ie,i as ae,x as oe}from"./debug-2pVES-2G.js";import{i as m,o as se,r as ce,t as le}from"./bundledMode-D9omqD3L.js";import{n as ue}from"./analytics-COpjZpvd.js";import{dirname as de,join as fe}from"path";import*as h from"node:path";import{join as pe,relative as me,resolve as he,sep as ge}from"node:path";import{readFileSync as _e}from"fs";import{stat as ve,unwatchFile as ye,watch as be,watchFile as xe}from"node:fs";import{type as Se}from"node:os";import{readFile as Ce,stat as we}from"fs/promises";import{EventEmitter as Te}from"node:events";import{Readable as Ee}from"node:stream";import{lstat as De,open as Oe,readdir as ke,realpath as g,stat as _}from"node:fs/promises";function Ae(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=v.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!x.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${x.join(`, `)}`);return t.root=e,new Ie(t)}var v,y,b,je,x,Me,Ne,Pe,Fe,S,C,Ie,Le=e((()=>{r(),v={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},y={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:v.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096},Object.freeze(y),b=`READDIRP_RECURSIVE_ERROR`,je=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,b]),x=[v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE],Me=new Set([v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE]),Ne=new Set([v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE]),Pe=e=>je.has(e.code),Fe=process.platform===`win32`,S=e=>!0,C=e=>{if(e===void 0)return S;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return S},Ie=class extends Ee{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark}),i(this,`parents`,void 0),i(this,`reading`,void 0),i(this,`parent`,void 0),i(this,`_stat`,void 0),i(this,`_maxDepth`,void 0),i(this,`_wantsDir`,void 0),i(this,`_wantsFile`,void 0),i(this,`_wantsEverything`,void 0),i(this,`_root`,void 0),i(this,`_isDirent`,void 0),i(this,`_statsProp`,void 0),i(this,`_rdOptions`,void 0),i(this,`_fileFilter`,void 0),i(this,`_directoryFilter`,void 0);let t={...y,...e},{root:n,type:r}=t;this._fileFilter=C(t.fileFilter),this._directoryFilter=C(t.directoryFilter);let a=t.lstat?De:_;Fe?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:y.depth,this._wantsDir=r?Me.has(r):!1,this._wantsFile=r?Ne.has(r):!1,this._wantsEverything=r===v.EVERYTHING_TYPE,this._root=he(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await ke(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let i=he(pe(t,r));n={path:me(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e);return}return n}_onError(e){Pe(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await g(t),n=await De(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===ge){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=b,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}}));function Re(e,t,n,r,i){let a=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&L(h.resolve(e,r),k,h.join(e,r))};try{return be(e,{persistent:t.persistent},a)}catch(e){r(e);return}}var ze,Be,w,T,E,Ve,He,Ue,We,D,O,Ge,Ke,k,A,j,qe,Je,Ye,M,N,Xe,P,F,I,L,Ze,R,Qe,$e,et=e((()=>{r(),ze=`data`,Be=`close`,w=()=>{},T=process.platform,E=T===`win32`,Ve=T===`darwin`,He=T===`linux`,Ue=T===`freebsd`,We=Se()===`OS400`,D={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},O=D,Ge=`watch`,Ke={lstat:De,stat:_},k=`listeners`,A=`errHandlers`,j=`rawEmitters`,qe=[k,A,j],Je=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),Ye=e=>Je.has(h.extname(e).slice(1).toLowerCase()),M=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},N=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},Xe=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},P=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},F=e=>e instanceof Set?e.size===0:!e,I=new Map,L=(e,t,n,r,i)=>{let a=I.get(e);a&&M(a[t],e=>{e(n,r,i)})},Ze=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=I.get(t),c;if(!n.persistent)return c=Re(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)N(s,k,i),N(s,A,a),N(s,j,o);else{if(c=Re(e,n,L.bind(null,t,k),a,L.bind(null,t,j)),!c)return;c.on(O.ERROR,async n=>{let r=L.bind(null,t,A);if(s&&(s.watcherUnusable=!0),E&&n.code===`EPERM`)try{await(await Oe(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},I.set(t,s)}return()=>{P(s,k,i),P(s,A,a),P(s,j,o),F(s.listeners)&&(s.watcher.close(),I.delete(t),qe.forEach(Xe(s)),s.watcher=void 0,Object.freeze(s))}},R=new Map,Qe=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=R.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(ye(t),o=void 0),o?(N(o,k,i),N(o,j,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:xe(t,n,(n,r)=>{M(o.rawEmitters,e=>{e(O.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&M(o.listeners,t=>t(e,n))})},R.set(t,o)),()=>{P(o,k,i),P(o,j,a),F(o.listeners)&&(R.delete(t),ye(t),o.options=o.watcher=void 0,Object.freeze(o))}},$e=class{constructor(e){i(this,`fsw`,void 0),i(this,`_boundHandleError`,void 0),this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,r=h.dirname(e),i=h.basename(e);this.fsw._getWatchedDir(r).add(i);let a=h.resolve(e),o={persistent:n.persistent};t||(t=w);let s;return n.usePolling?(o.interval=n.interval!==n.binaryInterval&&Ye(i)?n.binaryInterval:n.interval,s=Qe(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})):s=Ze(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),s}_handleFile(e,t,n){if(this.fsw.closed)return;let r=h.dirname(e),i=h.basename(e),a=this.fsw._getWatchedDir(r),o=t;if(a.has(i))return;let s=async(t,n)=>{if(this.fsw._throttle(Ge,e,5)){if(!n||n.mtimeMs===0)try{let n=await _(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),(Ve||He||Ue)&&o.ino!==n.ino){this.fsw._closeFile(t),o=n;let r=this._watchWithNodeFs(e,s);r&&this.fsw._addPathCloser(t,r)}else o=n}catch{this.fsw._remove(r,i)}else if(a.has(i)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),o=n}}},c=this._watchWithNodeFs(e,s);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(O.ADD,e,0))return;this.fsw._emit(O.ADD,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await g(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,a,o){e=h.join(e,``);let s=r?`${e}:${r}`:e;if(o=this.fsw._throttle(`readdir`,s,1e3),!o)return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(u)return u.on(ze,async o=>{if(this.fsw.closed){u=void 0;return}let s=o.path,d=h.join(e,s);if(l.add(s),!(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,s))){if(this.fsw.closed){u=void 0;return}(s===r||!r&&!c.has(s))&&(this.fsw._incrReadyCount(),d=h.join(i,h.relative(i,d)),this._addToNodeFs(d,t,n,a+1))}}).on(O.ERROR,this._boundHandleError),new Promise((t,s)=>{if(!u)return s();u.once(`end`,()=>{if(this.fsw.closed){u=void 0;return}let s=o?o.clear():!1;t(void 0),c.getChildren().filter(t=>t!==e&&!l.has(t)).forEach(t=>{this.fsw._remove(e,t)}),u=void 0,s&&this._handleRead(e,!1,n,r,i,a,o)})})}async _handleDir(e,t,n,r,i,a,o){let s=this.fsw._getWatchedDir(h.dirname(e)),c=s.has(h.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!c&&this.fsw._emit(O.ADD_DIR,e,t),s.add(h.basename(e)),this.fsw._getWatchedDir(e);let l,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,a,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,a,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(e);n&&(o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{let n=await Ke[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return a(),!1;let s=this.fsw.options.followSymlinks,c;if(n.isDirectory()){let a=h.resolve(e),l=s?await g(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed))return;a!==l&&l!==void 0&&this.fsw._symlinkPaths.set(a,l)}else if(n.isSymbolicLink()){let i=s?await g(e):e;if(this.fsw.closed)return;let a=h.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(O.ADD,o.watchPath,n),c=await this._handleDir(a,n,t,r,e,o,i),this.fsw.closed)return;i!==void 0&&this.fsw._symlinkPaths.set(h.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return a(),c&&this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return a(),e}}}}));function z(e){return Array.isArray(e)?e:[e]}function tt(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=h.relative(e.path,t);return n?!n.startsWith(`..`)&&!h.isAbsolute(n):!1}return!1}:()=>!1}function nt(e){if(typeof e!=`string`)throw Error(`string expected`);e=h.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;return e.startsWith(`//`)&&(t=!0),e=e.replace(H,`/`),t&&(e=`/`+e),e}function rt(e,t,n){let r=nt(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function it(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=z(e).map(e=>tt(e));return t==null?(e,t)=>rt(n,e,t):rt(n,t)}function at(e,t={}){let n=new bt(t);return n.add(e),n}var B,ot,V,st,ct,lt,H,ut,dt,U,W,G,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St=e((()=>{Le(),et(),r(),B=`/`,ot=`//`,V=`.`,st=`..`,ct=`string`,lt=/\\/g,H=/\/\//g,ut=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,dt=/^\.[/\\]/,U=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp),W=e=>{let t=z(e).flat();if(!t.every(e=>typeof e===ct))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(ft)},G=e=>{let t=e.replace(lt,B),n=!1;return t.startsWith(ot)&&(n=!0),t=t.replace(H,B),n&&(t=B+t),t},ft=e=>G(h.normalize(G(e))),pt=(e=``)=>t=>typeof t==`string`?ft(h.isAbsolute(t)?t:h.join(e,t)):t,mt=(e,t)=>h.isAbsolute(e)?e:h.join(t,e),ht=Object.freeze(new Set),gt=class{constructor(e,t){i(this,`path`,void 0),i(this,`_removeWatcher`,void 0),i(this,`items`,void 0),this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==V&&e!==st&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await ke(n)}catch{this._removeWatcher&&this._removeWatcher(h.dirname(n),h.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=w,this.items=ht,Object.freeze(this)}},_t=`stat`,vt=`lstat`,yt=class{constructor(e,t,n){i(this,`fsw`,void 0),i(this,`path`,void 0),i(this,`watchPath`,void 0),i(this,`fullWatchPath`,void 0),i(this,`dirParts`,void 0),i(this,`followSymlinks`,void 0),i(this,`statMethod`,void 0),this.fsw=n;let r=e;this.path=e=e.replace(dt,``),this.watchPath=r,this.fullWatchPath=h.resolve(r),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?_t:vt}entryPath(e){return h.join(this.watchPath,h.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},bt=class extends Te{constructor(e={}){super(),i(this,`closed`,void 0),i(this,`options`,void 0),i(this,`_closers`,void 0),i(this,`_ignoredPaths`,void 0),i(this,`_throttled`,void 0),i(this,`_streams`,void 0),i(this,`_symlinkPaths`,void 0),i(this,`_watched`,void 0),i(this,`_pendingWrites`,void 0),i(this,`_pendingUnlinks`,void 0),i(this,`_readyCount`,void 0),i(this,`_emitReady`,void 0),i(this,`_closePromise`,void 0),i(this,`_userIgnored`,void 0),i(this,`_readyEmitted`,void 0),i(this,`_emitRaw`,void 0),i(this,`_boundRemove`,void 0),i(this,`_nodeFsHandler`,void 0),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?z(e.ignored):z([]),awaitWriteFinish:t===!0?n:typeof t==`object`&&{...n,...t}};We&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let a=process.env.CHOKIDAR_USEPOLLING;if(a!==void 0){let e=a.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let o=process.env.CHOKIDAR_INTERVAL;o&&(r.interval=Number.parseInt(o,10));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=w,this._readyEmitted=!0,process.nextTick(()=>this.emit(D.READY)))},this._emitRaw=(...e)=>this.emit(D.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new $e(this),Object.freeze(r)}_addIgnoredPath(e){if(U(e)){for(let t of this._ignoredPaths)if(U(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)U(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=W(e);return r&&(i=i.map(e=>mt(e,r))),i.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(h.dirname(e),h.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=W(e),{cwd:n}=this.options;return t.forEach(e=>{!h.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=h.join(n,e)),e=h.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?h.relative(this.options.cwd,n):n)||V;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==D.ERROR&&this.emit(D.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let r=this.options;E&&(t=h.normalize(t)),r.cwd&&(t=h.relative(r.cwd,t));let i=[t];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(t)))return o.lastChange=new Date,this;if(r.atomic){if(e===D.UNLINK)return this._pendingUnlinks.set(t,[e,...i]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(D.ALL,...e),this._pendingUnlinks.delete(t)})},typeof r.atomic==`number`?r.atomic:100),this;e===D.ADD&&this._pendingUnlinks.has(t)&&(e=D.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===D.ADD||e===D.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,n)=>{t?(e=D.ERROR,i[0]=t,this.emitWithAll(e,i)):n&&(i.length>1?i[1]=n:i.push(n),this.emitWithAll(e,i))}),this;if(e===D.CHANGE&&!this._throttle(D.CHANGE,t,50))return this;if(r.alwaysStat&&n===void 0&&(e===D.ADD||e===D.ADD_DIR||e===D.CHANGE)){let e=r.cwd?h.join(r.cwd,t):t,n;try{n=await _(e)}catch{}if(!n||this.closed)return;i.push(n)}return this.emitWithAll(e,i),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(D.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i=this.options.awaitWriteFinish;if(typeof i!=`object`)return;let a=i.pollInterval,o,s=e;this.options.cwd&&!h.isAbsolute(e)&&(s=h.join(this.options.cwd,e));let c=new Date,l=this._pendingWrites;function u(n){ve(s,(i,s)=>{if(i||!l.has(e)){i&&i.code!==`ENOENT`&&r(i);return}let c=Number(new Date);n&&s.size!==n.size&&(l.get(e).lastChange=c),c-l.get(e).lastChange>=t?(l.delete(e),r(void 0,s)):o=setTimeout(u,a,s)})}l.has(e)||(l.set(e,{lastChange:c,cancelWait:()=>(l.delete(e),clearTimeout(o),n)}),o=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&ut.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(pt(e)),n=[...[...this._ignoredPaths].map(pt(e)),...t];this._userIgnored=it(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new yt(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=h.resolve(e);return this._watched.has(t)||this._watched.set(t,new gt(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let r=h.join(e,t),i=h.resolve(r);if(n=n??(this._watched.has(r)||this._watched.has(i)),!this._throttle(`remove`,r,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));let a=this._getWatchedDir(e),o=a.has(t);a.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let s=r;if(this.options.cwd&&(s=h.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(s)&&this._pendingWrites.get(s).cancelWait()===D.ADD)return;this._watched.delete(r),this._watched.delete(i);let c=n?D.UNLINK_DIR:D.UNLINK;o&&!this._isIgnored(r)&&this._emit(c,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=h.dirname(e);this._getWatchedDir(t).remove(h.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=Ae(e,{type:D.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(Be,()=>{n=void 0}),n.once(`end`,()=>{n&&(this._streams.delete(n),n=void 0)}),n}},xt={watch:at,FSWatcher:bt}}));function Ct(){return Dt||(Dt=a()),Dt}function wt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===1:Ct().gt(e,t,{loose:!0})}function Tt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)>=0:Ct().gte(e,t,{loose:!0})}function Et(e,t){return typeof Bun<`u`?Bun.semver.satisfies(e,t):Ct().satisfies(e,t,{loose:!0})}var Dt,Ot=e((()=>{})),kt,At,jt,Mt=e((()=>{Ot(),le(),se(),kt=m()===`windows`?`alt+v`:`ctrl+v`,At=m()!==`windows`||(ce()?Et(process.versions.bun,`>=1.2.23`):Et(process.versions.node,`>=22.17.0 <23.0.0 || >=24.2.0`))?`shift+tab`:`meta+m`,jt=[{context:`Global`,bindings:{"ctrl+c":`app:interrupt`,"ctrl+d":`app:exit`,"ctrl+l":`app:redraw`,"ctrl+t":`app:toggleTodos`,"ctrl+o":`app:toggleTranscript`,"ctrl+shift+o":`app:toggleTeammatePreview`,"ctrl+r":`history:search`}},{context:`Chat`,bindings:{escape:`chat:cancel`,"ctrl+x ctrl+k":`chat:killAgents`,[At]:`chat:cycleMode`,"meta+p":`chat:modelPicker`,"meta+o":`chat:fastMode`,"meta+t":`chat:thinkingToggle`,enter:`chat:submit`,up:`history:previous`,down:`history:next`,"ctrl+_":`chat:undo`,"ctrl+shift+-":`chat:undo`,"ctrl+x ctrl+e":`chat:externalEditor`,"ctrl+g":`chat:externalEditor`,"ctrl+s":`chat:stash`,[kt]:`chat:imagePaste`}},{context:`Autocomplete`,bindings:{tab:`autocomplete:accept`,escape:`autocomplete:dismiss`,up:`autocomplete:previous`,down:`autocomplete:next`}},{context:`Settings`,bindings:{escape:`confirm:no`,up:`select:previous`,down:`select:next`,k:`select:previous`,j:`select:next`,"ctrl+p":`select:previous`,"ctrl+n":`select:next`,left:`select:previousValue`,right:`select:nextValue`,space:`select:accept`,enter:`settings:close`,"/":`settings:search`,r:`settings:retry`}},{context:`Confirmation`,bindings:{enter:`confirm:yes`,escape:`confirm:no`,up:`confirm:previous`,down:`confirm:next`,tab:`confirm:nextField`,space:`confirm:toggle`,"shift+tab":`confirm:cycleMode`,"ctrl+e":`confirm:toggleExplanation`,"ctrl+d":`permission:toggleDebug`}},{context:`FormField`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,up:`tabs:previous`,down:`tabs:next`}},{context:`Tabs`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,right:`tabs:next`,left:`tabs:previous`}},{context:`Transcript`,bindings:{"ctrl+e":`transcript:toggleShowAll`,"ctrl+c":`transcript:exit`,escape:`transcript:exit`,q:`transcript:exit`}},{context:`HistorySearch`,bindings:{"ctrl+r":`historySearch:next`,escape:`historySearch:accept`,tab:`historySearch:accept`,"ctrl+c":`historySearch:cancel`,enter:`historySearch:execute`}},{context:`Task`,bindings:{"ctrl+b":`task:background`}},{context:`ThemePicker`,bindings:{"ctrl+t":`theme:toggleSyntaxHighlighting`}},{context:`Scroll`,bindings:{pageup:`scroll:pageUp`,pagedown:`scroll:pageDown`,wheelup:`scroll:lineUp`,wheeldown:`scroll:lineDown`,"ctrl+home":`scroll:top`,"ctrl+end":`scroll:bottom`,"ctrl+shift+c":`selection:copy`,"cmd+c":`selection:copy`}},{context:`Help`,bindings:{escape:`help:dismiss`}},{context:`Attachments`,bindings:{right:`attachments:next`,left:`attachments:previous`,backspace:`attachments:remove`,delete:`attachments:remove`,down:`attachments:exit`,escape:`attachments:exit`}},{context:`Footer`,bindings:{up:`footer:up`,"ctrl+p":`footer:up`,down:`footer:down`,"ctrl+n":`footer:down`,right:`footer:next`,left:`footer:previous`,enter:`footer:openSelected`,escape:`footer:clearSelection`}},{context:`MessageSelector`,bindings:{up:`messageSelector:up`,down:`messageSelector:down`,k:`messageSelector:up`,j:`messageSelector:down`,"ctrl+p":`messageSelector:up`,"ctrl+n":`messageSelector:down`,"ctrl+up":`messageSelector:top`,"shift+up":`messageSelector:top`,"meta+up":`messageSelector:top`,"shift+k":`messageSelector:top`,"ctrl+down":`messageSelector:bottom`,"shift+down":`messageSelector:bottom`,"meta+down":`messageSelector:bottom`,"shift+j":`messageSelector:bottom`,enter:`messageSelector:select`}},{context:`DiffDialog`,bindings:{escape:`diff:dismiss`,left:`diff:previousSource`,right:`diff:nextSource`,up:`diff:previousFile`,down:`diff:nextFile`,enter:`diff:viewDetails`}},{context:`ModelPicker`,bindings:{space:`modelPicker:toggle1M`}},{context:`Select`,bindings:{up:`select:previous`,down:`select:next`,j:`select:next`,k:`select:previous`,"ctrl+n":`select:next`,"ctrl+p":`select:previous`,enter:`select:accept`,escape:`select:cancel`}},{context:`Plugin`,bindings:{space:`plugin:toggle`,i:`plugin:install`}}]})),Nt=e((()=>{l()}));function Pt(){let e=m(),t=[...It,...Lt];return e===`macos`&&t.push(...Rt),t}function K(e){return e.trim().split(/\s+/).map(Ft).join(` `)}function Ft(e){let t=e.split(`+`),n=[],r=``;for(let e of t){let t=e.trim().toLowerCase();[`ctrl`,`control`,`alt`,`opt`,`option`,`meta`,`cmd`,`command`,`shift`].includes(t)?t===`control`?n.push(`ctrl`):t===`option`||t===`opt`?n.push(`alt`):t===`command`||t===`cmd`?n.push(`cmd`):n.push(t):r=t}return n.sort(),[...n,r].join(`+`)}var It,Lt,Rt,zt=e((()=>{se(),It=[{key:`ctrl+c`,reason:`Cannot be rebound - used for interrupt/exit (hardcoded)`,severity:`error`},{key:`ctrl+d`,reason:`Cannot be rebound - used for exit (hardcoded)`,severity:`error`},{key:`ctrl+m`,reason:`Cannot be rebound - identical to Enter in terminals (both send CR)`,severity:`error`}],Lt=[{key:`ctrl+z`,reason:`Unix process suspend (SIGTSTP)`,severity:`warning`},{key:`ctrl+\\`,reason:`Terminal quit signal (SIGQUIT)`,severity:`error`}],Rt=[{key:`cmd+c`,reason:`macOS system copy`,severity:`error`},{key:`cmd+v`,reason:`macOS system paste`,severity:`error`},{key:`cmd+x`,reason:`macOS system cut`,severity:`error`},{key:`cmd+q`,reason:`macOS quit application`,severity:`error`},{key:`cmd+w`,reason:`macOS close window/tab`,severity:`error`},{key:`cmd+tab`,reason:`macOS app switcher`,severity:`error`},{key:`cmd+space`,reason:`macOS Spotlight`,severity:`error`}]}));function Bt(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function Vt(e){return Array.isArray(e)&&e.every(Bt)}function Ht(e){return Zt.includes(e)}function Ut(e){let t=e.toLowerCase().split(`+`);for(let n of t)if(!n.trim())return{type:`parse_error`,severity:`error`,message:`Empty key part in "${e}"`,key:e,suggestion:`Remove extra "+" characters`};let n=o(e);return!n.key&&!n.ctrl&&!n.alt&&!n.shift&&!n.meta?{type:`parse_error`,severity:`error`,message:`Could not parse keystroke "${e}"`,key:e}:null}function Wt(e,t){let n=[];if(typeof e!=`object`||!e)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} is not an object`}),n;let r=e,i=r.context,a;if(typeof i==`string`?Ht(i)?a=i:n.push({type:`invalid_context`,severity:`error`,message:`Unknown context "${i}"`,context:i,suggestion:`Valid contexts: ${Zt.join(`, `)}`}):n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "context" field`}),typeof r.bindings!=`object`||r.bindings===null)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "bindings" field`}),n;let o=r.bindings;for(let[e,t]of Object.entries(o)){let r=Ut(e);r&&(r.context=a,n.push(r)),t!==null&&typeof t!=`string`?n.push({type:`invalid_action`,severity:`error`,message:`Invalid action for "${e}": must be a string or null`,key:e,context:a}):typeof t==`string`&&t.startsWith(`command:`)&&(/^command:[a-zA-Z0-9:\-_]+$/.test(t)||n.push({type:`invalid_action`,severity:`warning`,message:`Invalid command binding "${t}" for "${e}": command name may only contain alphanumeric characters, colons, hyphens, and underscores`,key:e,context:a,action:t}),a&&a!==`Chat`&&n.push({type:`invalid_action`,severity:`warning`,message:`Command binding "${t}" must be in "Chat" context, not "${a}"`,key:e,context:a,action:t,suggestion:`Move this binding to a block with "context": "Chat"`}))}return n}function Gt(e){let t=[],n=/"bindings"\s*:\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,r;for(;(r=n.exec(e))!==null;){let n=r[1];if(!n)continue;let i=e.slice(0,r.index).match(/"context"\s*:\s*"([^"]+)"[^{]*$/)?.[1]??`unknown`,a=/"([^"]+)"\s*:/g,o=new Map,s;for(;(s=a.exec(n))!==null;){let e=s[1];if(!e)continue;let n=(o.get(e)??0)+1;o.set(e,n),n===2&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate key "${e}" in ${i} bindings`,key:e,context:i,suggestion:`This key appears multiple times in the same context. JSON uses the last value, earlier values are ignored.`})}}return t}function Kt(e){let t=[];if(!Array.isArray(e))return t.push({type:`parse_error`,severity:`error`,message:`keybindings.json must contain an array`,suggestion:`Wrap your bindings in [ ]`}),t;for(let n=0;n<e.length;n++)t.push(...Wt(e[n],n));return t}function qt(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.context)??new Map;n.set(r.context,e);for(let[n,i]of Object.entries(r.bindings)){let a=K(n),o=e.get(a);o&&o!==i&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate binding "${n}" in ${r.context} context`,key:n,context:r.context,action:i??`null (unbind)`,suggestion:`Previously bound to "${o}". Only the last binding will be used.`}),e.set(a,i??`null`)}}return t}function Jt(e){let t=[],n=Pt();for(let r of e){let e=s(r.chord),i=K(e);for(let a of n)K(a.key)===i&&t.push({type:`reserved`,severity:a.severity,message:`"${e}" may not work: ${a.reason}`,key:e,context:r.context,action:r.action??void 0})}return t}function Yt(e){let t=[];for(let n of e)for(let[e,r]of Object.entries(n.bindings)){let i=e.split(` `).map(e=>o(e));t.push({chord:i,action:r,context:n.context})}return t}function Xt(e,t){let n=[];if(n.push(...Kt(e)),Vt(e)){n.push(...qt(e));let t=Yt(e);n.push(...Jt(t))}let r=new Set;return n.filter(e=>{let t=`${e.type}:${e.key}:${e.context}`;return r.has(t)?!1:(r.add(t),!0)})}var Zt,Qt=e((()=>{Nt(),zt(),Zt=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`FormField`,`MessageActions`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Scroll`,`Select`,`Plugin`]}));function q(){return!1}function $t(e){let t=new Date().toISOString().slice(0,10);$!==t&&($=t)}function en(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function tn(e){return Array.isArray(e)&&e.every(en)}function J(){return fe(t(),`keybindings.json`)}function nn(){return c(jt)}async function rn(){let e=nn();if(!q())return{bindings:e,warnings:[]};let t=J();try{let n=await Ce(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else{let t=`keybindings.json must have a "bindings" array`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:`Use format: { "bindings": [ ... ] }`}]}}if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:n}]}}let a=c(i);p(`[keybindings] Loaded ${a.length} user bindings from ${t}`);let o=[...e,...a];$t(a.length);let s=[...Gt(n),...Xt(i,o)];return s.length>0&&p(`[keybindings] Found ${s.length} validation issue(s)`),{bindings:o,warnings:s}}catch(n){return ne(n)?{bindings:e,warnings:[]}:(p(`[keybindings] Error loading ${t}: ${f(n)}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:`Failed to parse keybindings.json: ${f(n)}`}]})}}function an(){return X||on().bindings}function on(){if(X)return{bindings:X,warnings:Z};let e=nn();if(!q())return X=e,Z=[],{bindings:X,warnings:Z};let t=J();try{let n=_e(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else return X=e,Z=[{type:`parse_error`,severity:`error`,message:`keybindings.json must have a "bindings" array`,suggestion:`Use format: { "bindings": [ ... ] }`}],{bindings:X,warnings:Z};if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return X=e,Z=[{type:`parse_error`,severity:`error`,message:t,suggestion:n}],{bindings:X,warnings:Z}}let a=c(i);return p(`[keybindings] Loaded ${a.length} user bindings from ${t}`),X=[...e,...a],$t(a.length),Z=[...Gt(n),...Xt(i,X)],Z.length>0&&p(`[keybindings] Found ${Z.length} validation issue(s)`),{bindings:X,warnings:Z}}catch{return X=e,Z=[],{bindings:X,warnings:Z}}}async function sn(){if(mn||hn)return;if(!q()){p(`[keybindings] Skipping file watcher - user customization disabled`);return}let e=J(),t=de(e);try{if(!(await we(t)).isDirectory()){p(`[keybindings] Not watching: ${t} is not a directory`);return}}catch{p(`[keybindings] Not watching: ${t} does not exist`);return}mn=!0,p(`[keybindings] Watching for changes to ${e}`),Y=xt.watch(e,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:fn,pollInterval:pn},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),Y.on(`add`,ln),Y.on(`change`,ln),Y.on(`unlink`,un),ie(async()=>cn())}function cn(){hn=!0,Y&&(Y.close(),Y=null),Q.clear()}async function ln(e){p(`[keybindings] Detected change to ${e}`);try{let e=await rn();X=e.bindings,Z=e.warnings,Q.emit(e)}catch(e){p(`[keybindings] Error reloading: ${f(e)}`)}}function un(e){p(`[keybindings] Detected deletion of ${e}`);let t=nn();X=t,Z=[],Q.emit({bindings:t,warnings:[]})}function dn(){return Z}var fn,pn,Y,mn,hn,X,Z,Q,$,gn,_n=e((()=>{St(),ue(),ee(),ae(),n(),te(),d(),oe(),Mt(),Nt(),Qt(),fn=500,pn=200,Y=null,mn=!1,hn=!1,X=null,Z=[],Q=u(),$=null,gn=Q.subscribe}));function vn(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var yn=e((()=>{}));export{St as S,Mt as _,_n as a,Ot as b,an as c,Rt as d,It as f,jt as g,K as h,J as i,on as l,zt as m,vn as n,sn as o,Lt as p,dn as r,q as s,yn as t,gn as u,wt as v,xt as x,Tt as y};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{t as a}from"./semver-DQo45qGo.js";import{ln as o,rn as s,sn as c,t as l}from"./src-BX54x08P.js";import{Gn as u,Kn as d}from"./state-CXY-q5gr.js";import{$ as ee,I as te,M as f,R as ne,S as re,c as p,et as ie,i as ae,x as oe}from"./debug-NBJH_NxR.js";import{i as m,o as se,r as ce,t as le}from"./bundledMode-Dqe4pz0a.js";import{n as ue}from"./analytics-COpjZpvd.js";import{dirname as de,join as fe}from"path";import*as h from"node:path";import{join as pe,relative as me,resolve as he,sep as ge}from"node:path";import{readFileSync as _e}from"fs";import{stat as ve,unwatchFile as ye,watch as be,watchFile as xe}from"node:fs";import{type as Se}from"node:os";import{readFile as Ce,stat as we}from"fs/promises";import{EventEmitter as Te}from"node:events";import{Readable as Ee}from"node:stream";import{lstat as De,open as Oe,readdir as ke,realpath as g,stat as _}from"node:fs/promises";function Ae(e,t={}){let n=t.entryType||t.type;if(n===`both`&&(n=v.FILE_DIR_TYPE),n&&(t.type=n),!e)throw Error(`readdirp: root argument is required. Usage: readdirp(root, options)`);if(typeof e!=`string`)throw TypeError(`readdirp: root argument must be a string. Usage: readdirp(root, options)`);if(n&&!x.includes(n))throw Error(`readdirp: Invalid type passed. Use one of ${x.join(`, `)}`);return t.root=e,new Ie(t)}var v,y,b,je,x,Me,Ne,Pe,Fe,S,C,Ie,Le=e((()=>{r(),v={FILE_TYPE:`files`,DIR_TYPE:`directories`,FILE_DIR_TYPE:`files_directories`,EVERYTHING_TYPE:`all`},y={root:`.`,fileFilter:e=>!0,directoryFilter:e=>!0,type:v.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096},Object.freeze(y),b=`READDIRP_RECURSIVE_ERROR`,je=new Set([`ENOENT`,`EPERM`,`EACCES`,`ELOOP`,b]),x=[v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE],Me=new Set([v.DIR_TYPE,v.EVERYTHING_TYPE,v.FILE_DIR_TYPE]),Ne=new Set([v.EVERYTHING_TYPE,v.FILE_DIR_TYPE,v.FILE_TYPE]),Pe=e=>je.has(e.code),Fe=process.platform===`win32`,S=e=>!0,C=e=>{if(e===void 0)return S;if(typeof e==`function`)return e;if(typeof e==`string`){let t=e.trim();return e=>e.basename===t}if(Array.isArray(e)){let t=e.map(e=>e.trim());return e=>t.some(t=>e.basename===t)}return S},Ie=class extends Ee{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark}),i(this,`parents`,void 0),i(this,`reading`,void 0),i(this,`parent`,void 0),i(this,`_stat`,void 0),i(this,`_maxDepth`,void 0),i(this,`_wantsDir`,void 0),i(this,`_wantsFile`,void 0),i(this,`_wantsEverything`,void 0),i(this,`_root`,void 0),i(this,`_isDirent`,void 0),i(this,`_statsProp`,void 0),i(this,`_rdOptions`,void 0),i(this,`_fileFilter`,void 0),i(this,`_directoryFilter`,void 0);let t={...y,...e},{root:n,type:r}=t;this._fileFilter=C(t.fileFilter),this._directoryFilter=C(t.directoryFilter);let a=t.lstat?De:_;Fe?this._stat=e=>a(e,{bigint:!0}):this._stat=a,this._maxDepth=t.depth!=null&&Number.isSafeInteger(t.depth)?t.depth:y.depth,this._wantsDir=r?Me.has(r):!1,this._wantsFile=r?Ne.has(r):!1,this._wantsEverything=r===v.EVERYTHING_TYPE,this._root=he(n),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?`dirent`:`stats`,this._rdOptions={encoding:`utf8`,withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,n=t&&t.files;if(n&&n.length>0){let{path:r,depth:i}=t,a=n.splice(0,e).map(e=>this._formatEntry(e,r)),o=await Promise.all(a);for(let t of o){if(!t)continue;if(this.destroyed)return;let n=await this._getEntryType(t);n===`directory`&&this._directoryFilter(t)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,i+1)),this._wantsDir&&(this.push(t),e--)):(n===`file`||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{let e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await ke(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n,r=this._isDirent?e.name:e;try{let i=he(pe(t,r));n={path:me(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e);return}return n}_onError(e){Pe(e)&&!this.destroyed?this.emit(`warn`,e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return``;let t=e[this._statsProp];if(t.isFile())return`file`;if(t.isDirectory())return`directory`;if(t&&t.isSymbolicLink()){let t=e.fullPath;try{let e=await g(t),n=await De(e);if(n.isFile())return`file`;if(n.isDirectory()){let n=e.length;if(t.startsWith(e)&&t.substr(n,1)===ge){let n=Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=b,this._onError(n)}return`directory`}}catch(e){return this._onError(e),``}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}}));function Re(e,t,n,r,i){let a=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&L(h.resolve(e,r),k,h.join(e,r))};try{return be(e,{persistent:t.persistent},a)}catch(e){r(e);return}}var ze,Be,w,T,E,Ve,He,Ue,We,D,O,Ge,Ke,k,A,j,qe,Je,Ye,M,N,Xe,P,F,I,L,Ze,R,Qe,$e,et=e((()=>{r(),ze=`data`,Be=`close`,w=()=>{},T=process.platform,E=T===`win32`,Ve=T===`darwin`,He=T===`linux`,Ue=T===`freebsd`,We=Se()===`OS400`,D={ALL:`all`,READY:`ready`,ADD:`add`,CHANGE:`change`,ADD_DIR:`addDir`,UNLINK:`unlink`,UNLINK_DIR:`unlinkDir`,RAW:`raw`,ERROR:`error`},O=D,Ge=`watch`,Ke={lstat:De,stat:_},k=`listeners`,A=`errHandlers`,j=`rawEmitters`,qe=[k,A,j],Je=new Set(`3dm.3ds.3g2.3gp.7z.a.aac.adp.afdesign.afphoto.afpub.ai.aif.aiff.alz.ape.apk.appimage.ar.arj.asf.au.avi.bak.baml.bh.bin.bk.bmp.btif.bz2.bzip2.cab.caf.cgm.class.cmx.cpio.cr2.cur.dat.dcm.deb.dex.djvu.dll.dmg.dng.doc.docm.docx.dot.dotm.dra.DS_Store.dsk.dts.dtshd.dvb.dwg.dxf.ecelp4800.ecelp7470.ecelp9600.egg.eol.eot.epub.exe.f4v.fbs.fh.fla.flac.flatpak.fli.flv.fpx.fst.fvt.g3.gh.gif.graffle.gz.gzip.h261.h263.h264.icns.ico.ief.img.ipa.iso.jar.jpeg.jpg.jpgv.jpm.jxr.key.ktx.lha.lib.lvp.lz.lzh.lzma.lzo.m3u.m4a.m4v.mar.mdi.mht.mid.midi.mj2.mka.mkv.mmr.mng.mobi.mov.movie.mp3.mp4.mp4a.mpeg.mpg.mpga.mxu.nef.npx.numbers.nupkg.o.odp.ods.odt.oga.ogg.ogv.otf.ott.pages.pbm.pcx.pdb.pdf.pea.pgm.pic.png.pnm.pot.potm.potx.ppa.ppam.ppm.pps.ppsm.ppsx.ppt.pptm.pptx.psd.pya.pyc.pyo.pyv.qt.rar.ras.raw.resources.rgb.rip.rlc.rmf.rmvb.rpm.rtf.rz.s3m.s7z.scpt.sgi.shar.snap.sil.sketch.slk.smv.snk.so.stl.suo.sub.swf.tar.tbz.tbz2.tga.tgz.thmx.tif.tiff.tlz.ttc.ttf.txz.udf.uvh.uvi.uvm.uvp.uvs.uvu.viv.vob.war.wav.wax.wbmp.wdp.weba.webm.webp.whl.wim.wm.wma.wmv.wmx.woff.woff2.wrm.wvx.xbm.xif.xla.xlam.xls.xlsb.xlsm.xlsx.xlt.xltm.xltx.xm.xmind.xpi.xpm.xwd.xz.z.zip.zipx`.split(`.`)),Ye=e=>Je.has(h.extname(e).slice(1).toLowerCase()),M=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},N=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},Xe=e=>t=>{let n=e[t];n instanceof Set?n.clear():delete e[t]},P=(e,t,n)=>{let r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},F=e=>e instanceof Set?e.size===0:!e,I=new Map,L=(e,t,n,r,i)=>{let a=I.get(e);a&&M(a[t],e=>{e(n,r,i)})},Ze=(e,t,n,r)=>{let{listener:i,errHandler:a,rawEmitter:o}=r,s=I.get(t),c;if(!n.persistent)return c=Re(e,n,i,a,o),c?c.close.bind(c):void 0;if(s)N(s,k,i),N(s,A,a),N(s,j,o);else{if(c=Re(e,n,L.bind(null,t,k),a,L.bind(null,t,j)),!c)return;c.on(O.ERROR,async n=>{let r=L.bind(null,t,A);if(s&&(s.watcherUnusable=!0),E&&n.code===`EPERM`)try{await(await Oe(e,`r`)).close(),r(n)}catch{}else r(n)}),s={listeners:i,errHandlers:a,rawEmitters:o,watcher:c},I.set(t,s)}return()=>{P(s,k,i),P(s,A,a),P(s,j,o),F(s.listeners)&&(s.watcher.close(),I.delete(t),qe.forEach(Xe(s)),s.watcher=void 0,Object.freeze(s))}},R=new Map,Qe=(e,t,n,r)=>{let{listener:i,rawEmitter:a}=r,o=R.get(t),s=o&&o.options;return s&&(s.persistent<n.persistent||s.interval>n.interval)&&(ye(t),o=void 0),o?(N(o,k,i),N(o,j,a)):(o={listeners:i,rawEmitters:a,options:n,watcher:xe(t,n,(n,r)=>{M(o.rawEmitters,e=>{e(O.CHANGE,t,{curr:n,prev:r})});let i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||i===0)&&M(o.listeners,t=>t(e,n))})},R.set(t,o)),()=>{P(o,k,i),P(o,j,a),F(o.listeners)&&(R.delete(t),ye(t),o.options=o.watcher=void 0,Object.freeze(o))}},$e=class{constructor(e){i(this,`fsw`,void 0),i(this,`_boundHandleError`,void 0),this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,r=h.dirname(e),i=h.basename(e);this.fsw._getWatchedDir(r).add(i);let a=h.resolve(e),o={persistent:n.persistent};t||(t=w);let s;return n.usePolling?(o.interval=n.interval!==n.binaryInterval&&Ye(i)?n.binaryInterval:n.interval,s=Qe(e,a,o,{listener:t,rawEmitter:this.fsw._emitRaw})):s=Ze(e,a,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),s}_handleFile(e,t,n){if(this.fsw.closed)return;let r=h.dirname(e),i=h.basename(e),a=this.fsw._getWatchedDir(r),o=t;if(a.has(i))return;let s=async(t,n)=>{if(this.fsw._throttle(Ge,e,5)){if(!n||n.mtimeMs===0)try{let n=await _(e);if(this.fsw.closed)return;let r=n.atimeMs,i=n.mtimeMs;if((!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),(Ve||He||Ue)&&o.ino!==n.ino){this.fsw._closeFile(t),o=n;let r=this._watchWithNodeFs(e,s);r&&this.fsw._addPathCloser(t,r)}else o=n}catch{this.fsw._remove(r,i)}else if(a.has(i)){let t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(O.CHANGE,e,n),o=n}}},c=this._watchWithNodeFs(e,s);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(O.ADD,e,0))return;this.fsw._emit(O.ADD,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;let i=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let t;try{t=await g(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.CHANGE,n,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(O.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,a,o){e=h.join(e,``);let s=r?`${e}:${r}`:e;if(o=this.fsw._throttle(`readdir`,s,1e3),!o)return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e)});if(u)return u.on(ze,async o=>{if(this.fsw.closed){u=void 0;return}let s=o.path,d=h.join(e,s);if(l.add(s),!(o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,d,s))){if(this.fsw.closed){u=void 0;return}(s===r||!r&&!c.has(s))&&(this.fsw._incrReadyCount(),d=h.join(i,h.relative(i,d)),this._addToNodeFs(d,t,n,a+1))}}).on(O.ERROR,this._boundHandleError),new Promise((t,s)=>{if(!u)return s();u.once(`end`,()=>{if(this.fsw.closed){u=void 0;return}let s=o?o.clear():!1;t(void 0),c.getChildren().filter(t=>t!==e&&!l.has(t)).forEach(t=>{this.fsw._remove(e,t)}),u=void 0,s&&this._handleRead(e,!1,n,r,i,a,o)})})}async _handleDir(e,t,n,r,i,a,o){let s=this.fsw._getWatchedDir(h.dirname(e)),c=s.has(h.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!c&&this.fsw._emit(O.ADD_DIR,e,t),s.add(h.basename(e)),this.fsw._getWatchedDir(e);let l,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,a,i,e,r,void 0),this.fsw.closed))return;l=this._watchWithNodeFs(e,(t,n)=>{n&&n.mtimeMs===0||this._handleRead(t,!1,a,i,e,r,void 0)})}return l}async _addToNodeFs(e,t,n,r,i){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(e);n&&(o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{let n=await Ke[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return a(),!1;let s=this.fsw.options.followSymlinks,c;if(n.isDirectory()){let a=h.resolve(e),l=s?await g(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed))return;a!==l&&l!==void 0&&this.fsw._symlinkPaths.set(a,l)}else if(n.isSymbolicLink()){let i=s?await g(e):e;if(this.fsw.closed)return;let a=h.dirname(o.watchPath);if(this.fsw._getWatchedDir(a).add(o.watchPath),this.fsw._emit(O.ADD,o.watchPath,n),c=await this._handleDir(a,n,t,r,e,o,i),this.fsw.closed)return;i!==void 0&&this.fsw._symlinkPaths.set(h.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return a(),c&&this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return a(),e}}}}));function z(e){return Array.isArray(e)?e:[e]}function tt(e){return typeof e==`function`?e:typeof e==`string`?t=>e===t:e instanceof RegExp?t=>e.test(t):typeof e==`object`&&e?t=>{if(e.path===t)return!0;if(e.recursive){let n=h.relative(e.path,t);return n?!n.startsWith(`..`)&&!h.isAbsolute(n):!1}return!1}:()=>!1}function nt(e){if(typeof e!=`string`)throw Error(`string expected`);e=h.normalize(e),e=e.replace(/\\/g,`/`);let t=!1;return e.startsWith(`//`)&&(t=!0),e=e.replace(H,`/`),t&&(e=`/`+e),e}function rt(e,t,n){let r=nt(t);for(let t=0;t<e.length;t++){let i=e[t];if(i(r,n))return!0}return!1}function it(e,t){if(e==null)throw TypeError(`anymatch: specify first argument`);let n=z(e).map(e=>tt(e));return t==null?(e,t)=>rt(n,e,t):rt(n,t)}function at(e,t={}){let n=new bt(t);return n.add(e),n}var B,ot,V,st,ct,lt,H,ut,dt,U,W,G,ft,pt,mt,ht,gt,_t,vt,yt,bt,xt,St=e((()=>{Le(),et(),r(),B=`/`,ot=`//`,V=`.`,st=`..`,ct=`string`,lt=/\\/g,H=/\/\//g,ut=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,dt=/^\.[/\\]/,U=e=>typeof e==`object`&&!!e&&!(e instanceof RegExp),W=e=>{let t=z(e).flat();if(!t.every(e=>typeof e===ct))throw TypeError(`Non-string provided as watch path: ${t}`);return t.map(ft)},G=e=>{let t=e.replace(lt,B),n=!1;return t.startsWith(ot)&&(n=!0),t=t.replace(H,B),n&&(t=B+t),t},ft=e=>G(h.normalize(G(e))),pt=(e=``)=>t=>typeof t==`string`?ft(h.isAbsolute(t)?t:h.join(e,t)):t,mt=(e,t)=>h.isAbsolute(e)?e:h.join(t,e),ht=Object.freeze(new Set),gt=class{constructor(e,t){i(this,`path`,void 0),i(this,`_removeWatcher`,void 0),i(this,`items`,void 0),this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==V&&e!==st&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await ke(n)}catch{this._removeWatcher&&this._removeWatcher(h.dirname(n),h.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path=``,this._removeWatcher=w,this.items=ht,Object.freeze(this)}},_t=`stat`,vt=`lstat`,yt=class{constructor(e,t,n){i(this,`fsw`,void 0),i(this,`path`,void 0),i(this,`watchPath`,void 0),i(this,`fullWatchPath`,void 0),i(this,`dirParts`,void 0),i(this,`followSymlinks`,void 0),i(this,`statMethod`,void 0),this.fsw=n;let r=e;this.path=e=e.replace(dt,``),this.watchPath=r,this.fullWatchPath=h.resolve(r),this.dirParts=[],this.dirParts.forEach(e=>{e.length>1&&e.pop()}),this.followSymlinks=t,this.statMethod=t?_t:vt}entryPath(e){return h.join(this.watchPath,h.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},bt=class extends Te{constructor(e={}){super(),i(this,`closed`,void 0),i(this,`options`,void 0),i(this,`_closers`,void 0),i(this,`_ignoredPaths`,void 0),i(this,`_throttled`,void 0),i(this,`_streams`,void 0),i(this,`_symlinkPaths`,void 0),i(this,`_watched`,void 0),i(this,`_pendingWrites`,void 0),i(this,`_pendingUnlinks`,void 0),i(this,`_readyCount`,void 0),i(this,`_emitReady`,void 0),i(this,`_closePromise`,void 0),i(this,`_userIgnored`,void 0),i(this,`_readyEmitted`,void 0),i(this,`_emitRaw`,void 0),i(this,`_boundRemove`,void 0),i(this,`_nodeFsHandler`,void 0),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?z(e.ignored):z([]),awaitWriteFinish:t===!0?n:typeof t==`object`&&{...n,...t}};We&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let a=process.env.CHOKIDAR_USEPOLLING;if(a!==void 0){let e=a.toLowerCase();e===`false`||e===`0`?r.usePolling=!1:e===`true`||e===`1`?r.usePolling=!0:r.usePolling=!!e}let o=process.env.CHOKIDAR_INTERVAL;o&&(r.interval=Number.parseInt(o,10));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=w,this._readyEmitted=!0,process.nextTick(()=>this.emit(D.READY)))},this._emitRaw=(...e)=>this.emit(D.RAW,...e),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new $e(this),Object.freeze(r)}_addIgnoredPath(e){if(U(e)){for(let t of this._ignoredPaths)if(U(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e==`string`)for(let t of this._ignoredPaths)U(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,n){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let i=W(e);return r&&(i=i.map(e=>mt(e,r))),i.forEach(e=>{this._removeIgnoredPath(e)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async e=>{let r=await this._nodeFsHandler._addToNodeFs(e,!n,void 0,0,t);return r&&this._emitReady(),r})).then(e=>{this.closed||e.forEach(e=>{e&&this.add(h.dirname(e),h.basename(t||e))})}),this}unwatch(e){if(this.closed)return this;let t=W(e),{cwd:n}=this.options;return t.forEach(e=>{!h.isAbsolute(e)&&!this._closers.has(e)&&(n&&(e=h.join(n,e)),e=h.resolve(e)),this._closePath(e),this._addIgnoredPath(e),this._watched.has(e)&&this._addIgnoredPath({path:e,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(t=>{let n=t();n instanceof Promise&&e.push(n)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>void 0):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let r=(this.options.cwd?h.relative(this.options.cwd,n):n)||V;e[r]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==D.ERROR&&this.emit(D.ALL,e,...t)}async _emit(e,t,n){if(this.closed)return;let r=this.options;E&&(t=h.normalize(t)),r.cwd&&(t=h.relative(r.cwd,t));let i=[t];n!=null&&i.push(n);let a=r.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(t)))return o.lastChange=new Date,this;if(r.atomic){if(e===D.UNLINK)return this._pendingUnlinks.set(t,[e,...i]),setTimeout(()=>{this._pendingUnlinks.forEach((e,t)=>{this.emit(...e),this.emit(D.ALL,...e),this._pendingUnlinks.delete(t)})},typeof r.atomic==`number`?r.atomic:100),this;e===D.ADD&&this._pendingUnlinks.has(t)&&(e=D.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===D.ADD||e===D.CHANGE)&&this._readyEmitted)return this._awaitWriteFinish(t,a.stabilityThreshold,e,(t,n)=>{t?(e=D.ERROR,i[0]=t,this.emitWithAll(e,i)):n&&(i.length>1?i[1]=n:i.push(n),this.emitWithAll(e,i))}),this;if(e===D.CHANGE&&!this._throttle(D.CHANGE,t,50))return this;if(r.alwaysStat&&n===void 0&&(e===D.ADD||e===D.ADD_DIR||e===D.CHANGE)){let e=r.cwd?h.join(r.cwd,t):t,n;try{n=await _(e)}catch{}if(!n||this.closed)return;i.push(n)}return this.emitWithAll(e,i),this}_handleError(e){let t=e&&e.code;return e&&t!==`ENOENT`&&t!==`ENOTDIR`&&(!this.options.ignorePermissionErrors||t!==`EPERM`&&t!==`EACCES`)&&this.emit(D.ERROR,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw Error(`invalid throttle`);let i=r.get(t);if(i)return i.count++,!1;let a,o=()=>{let e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(a),e&&clearTimeout(e.timeoutObject),n};a=setTimeout(o,n);let s={timeoutObject:a,clear:o,count:0};return r.set(t,s),s}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i=this.options.awaitWriteFinish;if(typeof i!=`object`)return;let a=i.pollInterval,o,s=e;this.options.cwd&&!h.isAbsolute(e)&&(s=h.join(this.options.cwd,e));let c=new Date,l=this._pendingWrites;function u(n){ve(s,(i,s)=>{if(i||!l.has(e)){i&&i.code!==`ENOENT`&&r(i);return}let c=Number(new Date);n&&s.size!==n.size&&(l.get(e).lastChange=c),c-l.get(e).lastChange>=t?(l.delete(e),r(void 0,s)):o=setTimeout(u,a,s)})}l.has(e)||(l.set(e,{lastChange:c,cancelWait:()=>(l.delete(e),clearTimeout(o),n)}),o=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&ut.test(e))return!0;if(!this._userIgnored){let{cwd:e}=this.options,t=(this.options.ignored||[]).map(pt(e)),n=[...[...this._ignoredPaths].map(pt(e)),...t];this._userIgnored=it(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new yt(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=h.resolve(e);return this._watched.has(t)||this._watched.set(t,new gt(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,n){let r=h.join(e,t),i=h.resolve(r);if(n=n??(this._watched.has(r)||this._watched.has(i)),!this._throttle(`remove`,r,100))return;!n&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(e=>this._remove(r,e));let a=this._getWatchedDir(e),o=a.has(t);a.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let s=r;if(this.options.cwd&&(s=h.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(s)&&this._pendingWrites.get(s).cancelWait()===D.ADD)return;this._watched.delete(r),this._watched.delete(i);let c=n?D.UNLINK_DIR:D.UNLINK;o&&!this._isIgnored(r)&&this._emit(c,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=h.dirname(e);this._getWatchedDir(t).remove(h.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(e=>e()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n=Ae(e,{type:D.ALL,alwaysStat:!0,lstat:!0,...t,depth:0});return this._streams.add(n),n.once(Be,()=>{n=void 0}),n.once(`end`,()=>{n&&(this._streams.delete(n),n=void 0)}),n}},xt={watch:at,FSWatcher:bt}}));function Ct(){return Dt||(Dt=a()),Dt}function wt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===1:Ct().gt(e,t,{loose:!0})}function Tt(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)>=0:Ct().gte(e,t,{loose:!0})}function Et(e,t){return typeof Bun<`u`?Bun.semver.satisfies(e,t):Ct().satisfies(e,t,{loose:!0})}var Dt,Ot=e((()=>{})),kt,At,jt,Mt=e((()=>{Ot(),le(),se(),kt=m()===`windows`?`alt+v`:`ctrl+v`,At=m()!==`windows`||(ce()?Et(process.versions.bun,`>=1.2.23`):Et(process.versions.node,`>=22.17.0 <23.0.0 || >=24.2.0`))?`shift+tab`:`meta+m`,jt=[{context:`Global`,bindings:{"ctrl+c":`app:interrupt`,"ctrl+d":`app:exit`,"ctrl+l":`app:redraw`,"ctrl+t":`app:toggleTodos`,"ctrl+o":`app:toggleTranscript`,"ctrl+shift+o":`app:toggleTeammatePreview`,"ctrl+r":`history:search`}},{context:`Chat`,bindings:{escape:`chat:cancel`,"ctrl+x ctrl+k":`chat:killAgents`,[At]:`chat:cycleMode`,"meta+p":`chat:modelPicker`,"meta+o":`chat:fastMode`,"meta+t":`chat:thinkingToggle`,enter:`chat:submit`,up:`history:previous`,down:`history:next`,"ctrl+_":`chat:undo`,"ctrl+shift+-":`chat:undo`,"ctrl+x ctrl+e":`chat:externalEditor`,"ctrl+g":`chat:externalEditor`,"ctrl+s":`chat:stash`,[kt]:`chat:imagePaste`}},{context:`Autocomplete`,bindings:{tab:`autocomplete:accept`,escape:`autocomplete:dismiss`,up:`autocomplete:previous`,down:`autocomplete:next`}},{context:`Settings`,bindings:{escape:`confirm:no`,up:`select:previous`,down:`select:next`,k:`select:previous`,j:`select:next`,"ctrl+p":`select:previous`,"ctrl+n":`select:next`,left:`select:previousValue`,right:`select:nextValue`,space:`select:accept`,enter:`settings:close`,"/":`settings:search`,r:`settings:retry`}},{context:`Confirmation`,bindings:{enter:`confirm:yes`,escape:`confirm:no`,up:`confirm:previous`,down:`confirm:next`,tab:`confirm:nextField`,space:`confirm:toggle`,"shift+tab":`confirm:cycleMode`,"ctrl+e":`confirm:toggleExplanation`,"ctrl+d":`permission:toggleDebug`}},{context:`FormField`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,up:`tabs:previous`,down:`tabs:next`}},{context:`Tabs`,bindings:{tab:`tabs:next`,"shift+tab":`tabs:previous`,right:`tabs:next`,left:`tabs:previous`}},{context:`Transcript`,bindings:{"ctrl+e":`transcript:toggleShowAll`,"ctrl+c":`transcript:exit`,escape:`transcript:exit`,q:`transcript:exit`}},{context:`HistorySearch`,bindings:{"ctrl+r":`historySearch:next`,escape:`historySearch:accept`,tab:`historySearch:accept`,"ctrl+c":`historySearch:cancel`,enter:`historySearch:execute`}},{context:`Task`,bindings:{"ctrl+b":`task:background`}},{context:`ThemePicker`,bindings:{"ctrl+t":`theme:toggleSyntaxHighlighting`}},{context:`Scroll`,bindings:{pageup:`scroll:pageUp`,pagedown:`scroll:pageDown`,wheelup:`scroll:lineUp`,wheeldown:`scroll:lineDown`,"ctrl+home":`scroll:top`,"ctrl+end":`scroll:bottom`,"ctrl+shift+c":`selection:copy`,"cmd+c":`selection:copy`}},{context:`Help`,bindings:{escape:`help:dismiss`}},{context:`Attachments`,bindings:{right:`attachments:next`,left:`attachments:previous`,backspace:`attachments:remove`,delete:`attachments:remove`,down:`attachments:exit`,escape:`attachments:exit`}},{context:`Footer`,bindings:{up:`footer:up`,"ctrl+p":`footer:up`,down:`footer:down`,"ctrl+n":`footer:down`,right:`footer:next`,left:`footer:previous`,enter:`footer:openSelected`,escape:`footer:clearSelection`}},{context:`MessageSelector`,bindings:{up:`messageSelector:up`,down:`messageSelector:down`,k:`messageSelector:up`,j:`messageSelector:down`,"ctrl+p":`messageSelector:up`,"ctrl+n":`messageSelector:down`,"ctrl+up":`messageSelector:top`,"shift+up":`messageSelector:top`,"meta+up":`messageSelector:top`,"shift+k":`messageSelector:top`,"ctrl+down":`messageSelector:bottom`,"shift+down":`messageSelector:bottom`,"meta+down":`messageSelector:bottom`,"shift+j":`messageSelector:bottom`,enter:`messageSelector:select`}},{context:`DiffDialog`,bindings:{escape:`diff:dismiss`,left:`diff:previousSource`,right:`diff:nextSource`,up:`diff:previousFile`,down:`diff:nextFile`,enter:`diff:viewDetails`}},{context:`ModelPicker`,bindings:{space:`modelPicker:toggle1M`}},{context:`Select`,bindings:{up:`select:previous`,down:`select:next`,j:`select:next`,k:`select:previous`,"ctrl+n":`select:next`,"ctrl+p":`select:previous`,enter:`select:accept`,escape:`select:cancel`}},{context:`Plugin`,bindings:{space:`plugin:toggle`,i:`plugin:install`}}]})),Nt=e((()=>{l()}));function Pt(){let e=m(),t=[...It,...Lt];return e===`macos`&&t.push(...Rt),t}function K(e){return e.trim().split(/\s+/).map(Ft).join(` `)}function Ft(e){let t=e.split(`+`),n=[],r=``;for(let e of t){let t=e.trim().toLowerCase();[`ctrl`,`control`,`alt`,`opt`,`option`,`meta`,`cmd`,`command`,`shift`].includes(t)?t===`control`?n.push(`ctrl`):t===`option`||t===`opt`?n.push(`alt`):t===`command`||t===`cmd`?n.push(`cmd`):n.push(t):r=t}return n.sort(),[...n,r].join(`+`)}var It,Lt,Rt,zt=e((()=>{se(),It=[{key:`ctrl+c`,reason:`Cannot be rebound - used for interrupt/exit (hardcoded)`,severity:`error`},{key:`ctrl+d`,reason:`Cannot be rebound - used for exit (hardcoded)`,severity:`error`},{key:`ctrl+m`,reason:`Cannot be rebound - identical to Enter in terminals (both send CR)`,severity:`error`}],Lt=[{key:`ctrl+z`,reason:`Unix process suspend (SIGTSTP)`,severity:`warning`},{key:`ctrl+\\`,reason:`Terminal quit signal (SIGQUIT)`,severity:`error`}],Rt=[{key:`cmd+c`,reason:`macOS system copy`,severity:`error`},{key:`cmd+v`,reason:`macOS system paste`,severity:`error`},{key:`cmd+x`,reason:`macOS system cut`,severity:`error`},{key:`cmd+q`,reason:`macOS quit application`,severity:`error`},{key:`cmd+w`,reason:`macOS close window/tab`,severity:`error`},{key:`cmd+tab`,reason:`macOS app switcher`,severity:`error`},{key:`cmd+space`,reason:`macOS Spotlight`,severity:`error`}]}));function Bt(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function Vt(e){return Array.isArray(e)&&e.every(Bt)}function Ht(e){return Zt.includes(e)}function Ut(e){let t=e.toLowerCase().split(`+`);for(let n of t)if(!n.trim())return{type:`parse_error`,severity:`error`,message:`Empty key part in "${e}"`,key:e,suggestion:`Remove extra "+" characters`};let n=o(e);return!n.key&&!n.ctrl&&!n.alt&&!n.shift&&!n.meta?{type:`parse_error`,severity:`error`,message:`Could not parse keystroke "${e}"`,key:e}:null}function Wt(e,t){let n=[];if(typeof e!=`object`||!e)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} is not an object`}),n;let r=e,i=r.context,a;if(typeof i==`string`?Ht(i)?a=i:n.push({type:`invalid_context`,severity:`error`,message:`Unknown context "${i}"`,context:i,suggestion:`Valid contexts: ${Zt.join(`, `)}`}):n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "context" field`}),typeof r.bindings!=`object`||r.bindings===null)return n.push({type:`parse_error`,severity:`error`,message:`Keybinding block ${t+1} missing "bindings" field`}),n;let o=r.bindings;for(let[e,t]of Object.entries(o)){let r=Ut(e);r&&(r.context=a,n.push(r)),t!==null&&typeof t!=`string`?n.push({type:`invalid_action`,severity:`error`,message:`Invalid action for "${e}": must be a string or null`,key:e,context:a}):typeof t==`string`&&t.startsWith(`command:`)&&(/^command:[a-zA-Z0-9:\-_]+$/.test(t)||n.push({type:`invalid_action`,severity:`warning`,message:`Invalid command binding "${t}" for "${e}": command name may only contain alphanumeric characters, colons, hyphens, and underscores`,key:e,context:a,action:t}),a&&a!==`Chat`&&n.push({type:`invalid_action`,severity:`warning`,message:`Command binding "${t}" must be in "Chat" context, not "${a}"`,key:e,context:a,action:t,suggestion:`Move this binding to a block with "context": "Chat"`}))}return n}function Gt(e){let t=[],n=/"bindings"\s*:\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,r;for(;(r=n.exec(e))!==null;){let n=r[1];if(!n)continue;let i=e.slice(0,r.index).match(/"context"\s*:\s*"([^"]+)"[^{]*$/)?.[1]??`unknown`,a=/"([^"]+)"\s*:/g,o=new Map,s;for(;(s=a.exec(n))!==null;){let e=s[1];if(!e)continue;let n=(o.get(e)??0)+1;o.set(e,n),n===2&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate key "${e}" in ${i} bindings`,key:e,context:i,suggestion:`This key appears multiple times in the same context. JSON uses the last value, earlier values are ignored.`})}}return t}function Kt(e){let t=[];if(!Array.isArray(e))return t.push({type:`parse_error`,severity:`error`,message:`keybindings.json must contain an array`,suggestion:`Wrap your bindings in [ ]`}),t;for(let n=0;n<e.length;n++)t.push(...Wt(e[n],n));return t}function qt(e){let t=[],n=new Map;for(let r of e){let e=n.get(r.context)??new Map;n.set(r.context,e);for(let[n,i]of Object.entries(r.bindings)){let a=K(n),o=e.get(a);o&&o!==i&&t.push({type:`duplicate`,severity:`warning`,message:`Duplicate binding "${n}" in ${r.context} context`,key:n,context:r.context,action:i??`null (unbind)`,suggestion:`Previously bound to "${o}". Only the last binding will be used.`}),e.set(a,i??`null`)}}return t}function Jt(e){let t=[],n=Pt();for(let r of e){let e=s(r.chord),i=K(e);for(let a of n)K(a.key)===i&&t.push({type:`reserved`,severity:a.severity,message:`"${e}" may not work: ${a.reason}`,key:e,context:r.context,action:r.action??void 0})}return t}function Yt(e){let t=[];for(let n of e)for(let[e,r]of Object.entries(n.bindings)){let i=e.split(` `).map(e=>o(e));t.push({chord:i,action:r,context:n.context})}return t}function Xt(e,t){let n=[];if(n.push(...Kt(e)),Vt(e)){n.push(...qt(e));let t=Yt(e);n.push(...Jt(t))}let r=new Set;return n.filter(e=>{let t=`${e.type}:${e.key}:${e.context}`;return r.has(t)?!1:(r.add(t),!0)})}var Zt,Qt=e((()=>{Nt(),zt(),Zt=[`Global`,`Chat`,`Autocomplete`,`Confirmation`,`Help`,`Transcript`,`HistorySearch`,`Task`,`ThemePicker`,`Settings`,`Tabs`,`Attachments`,`Footer`,`FormField`,`MessageActions`,`MessageSelector`,`DiffDialog`,`ModelPicker`,`Scroll`,`Select`,`Plugin`]}));function q(){return!1}function $t(e){let t=new Date().toISOString().slice(0,10);$!==t&&($=t)}function en(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.context==`string`&&typeof t.bindings==`object`&&t.bindings!==null}function tn(e){return Array.isArray(e)&&e.every(en)}function J(){return fe(t(),`keybindings.json`)}function nn(){return c(jt)}async function rn(){let e=nn();if(!q())return{bindings:e,warnings:[]};let t=J();try{let n=await Ce(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else{let t=`keybindings.json must have a "bindings" array`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:`Use format: { "bindings": [ ... ] }`}]}}if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return p(`[keybindings] Invalid keybindings.json: ${t}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:t,suggestion:n}]}}let a=c(i);p(`[keybindings] Loaded ${a.length} user bindings from ${t}`);let o=[...e,...a];$t(a.length);let s=[...Gt(n),...Xt(i,o)];return s.length>0&&p(`[keybindings] Found ${s.length} validation issue(s)`),{bindings:o,warnings:s}}catch(n){return ne(n)?{bindings:e,warnings:[]}:(p(`[keybindings] Error loading ${t}: ${f(n)}`),{bindings:e,warnings:[{type:`parse_error`,severity:`error`,message:`Failed to parse keybindings.json: ${f(n)}`}]})}}function an(){return X||on().bindings}function on(){if(X)return{bindings:X,warnings:Z};let e=nn();if(!q())return X=e,Z=[],{bindings:X,warnings:Z};let t=J();try{let n=_e(t,`utf-8`),r=re(n),i;if(typeof r==`object`&&r&&`bindings`in r)i=r.bindings;else return X=e,Z=[{type:`parse_error`,severity:`error`,message:`keybindings.json must have a "bindings" array`,suggestion:`Use format: { "bindings": [ ... ] }`}],{bindings:X,warnings:Z};if(!tn(i)){let t=Array.isArray(i)?`keybindings.json contains invalid block structure`:`"bindings" must be an array`,n=Array.isArray(i)?`Each block must have "context" (string) and "bindings" (object)`:`Set "bindings" to an array of keybinding blocks`;return X=e,Z=[{type:`parse_error`,severity:`error`,message:t,suggestion:n}],{bindings:X,warnings:Z}}let a=c(i);return p(`[keybindings] Loaded ${a.length} user bindings from ${t}`),X=[...e,...a],$t(a.length),Z=[...Gt(n),...Xt(i,X)],Z.length>0&&p(`[keybindings] Found ${Z.length} validation issue(s)`),{bindings:X,warnings:Z}}catch{return X=e,Z=[],{bindings:X,warnings:Z}}}async function sn(){if(mn||hn)return;if(!q()){p(`[keybindings] Skipping file watcher - user customization disabled`);return}let e=J(),t=de(e);try{if(!(await we(t)).isDirectory()){p(`[keybindings] Not watching: ${t} is not a directory`);return}}catch{p(`[keybindings] Not watching: ${t} does not exist`);return}mn=!0,p(`[keybindings] Watching for changes to ${e}`),Y=xt.watch(e,{persistent:!0,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:fn,pollInterval:pn},ignorePermissionErrors:!0,usePolling:!1,atomic:!0}),Y.on(`add`,ln),Y.on(`change`,ln),Y.on(`unlink`,un),ie(async()=>cn())}function cn(){hn=!0,Y&&(Y.close(),Y=null),Q.clear()}async function ln(e){p(`[keybindings] Detected change to ${e}`);try{let e=await rn();X=e.bindings,Z=e.warnings,Q.emit(e)}catch(e){p(`[keybindings] Error reloading: ${f(e)}`)}}function un(e){p(`[keybindings] Detected deletion of ${e}`);let t=nn();X=t,Z=[],Q.emit({bindings:t,warnings:[]})}function dn(){return Z}var fn,pn,Y,mn,hn,X,Z,Q,$,gn,_n=e((()=>{St(),ue(),ee(),ae(),n(),te(),d(),oe(),Mt(),Nt(),Qt(),fn=500,pn=200,Y=null,mn=!1,hn=!1,X=null,Z=[],Q=u(),$=null,gn=Q.subscribe}));function vn(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var yn=e((()=>{}));export{St as S,Mt as _,_n as a,Ot as b,an as c,Rt as d,It as f,jt as g,K as h,J as i,on as l,zt as m,vn as n,sn as o,Lt as p,dn as r,q as s,yn as t,gn as u,wt as v,xt as x,Tt as y};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-QyzA_cFM.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-BX54x08P.js";import{Pt as ee,at as c}from"./state-CXY-q5gr.js";import{T as l,c as u,f as d,i as te,u as f,x as p}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-QyzA_cFM.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-BX54x08P.js";import{Pt as ee,at as c}from"./state-CXY-q5gr.js";import{T as l,c as u,f as d,i as te,u as f,x as p}from"./debug-NBJH_NxR.js";import{n as m}from"./analytics-COpjZpvd.js";import{i as h,n as g,o as _,r as v}from"./intl-D2kgJmX7.js";import{dirname as ne,join as y}from"path";function b(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return x(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return S(e,t);let s=t-1-a;return s<=0?S(r,t):`${C(i,s)}…${r}`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return`${r}…`}function S(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...g().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function C(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function w(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
|
|
2
2
|
`);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?x(r,t):`${r}…`}return o(r)<=t?r:x(r,t)}var T=e((()=>{s(),_()}));function E(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function re(e){return`${(e/1e3).toFixed(1)}s`}function ie(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function D(e){return F(e>=1e3).format(e).toLowerCase()}function O(e){return D(e).replace(`.0`,``)}function k(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:v(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:v(n,r).format(0,`second`)}function A(e,t={}){let{now:n=new Date,...r}=t;return e>n?k(e,{...r,now:n}):k(e,{...r,numeric:`always`,now:n})}function j(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:E(e.fileSize),n=[A(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function M(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}var N,P,F,I=e((()=>{_(),T(),N=null,P=null,F=e=>e?(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),N):(P||(P=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),P)}));function L(){return V}function R(e){return e.toFixed(3)}function z(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${E(r.rss)}, Heap: ${E(r.heapUsed)}`:``;return`[+${R(e).padStart(i)}ms] (+${R(t).padStart(a)}ms) ${n}${o}${s}`}var B,V,H=e((()=>{I(),i(),B=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},V=new B}));function U(e){X&&(L().mark(e),J&&Z.push(process.memoryUsage()))}function W(){if(!J)return`Startup profiling not enabled`;let e=L().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(z(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${R(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
|
|
3
3
|
`)}function G(){if(!$){if($=!0,q(),J){let e=K(),t=ne(e);f().mkdirSync(t),l(e,W(),{encoding:`utf8`,flush:!0}),u(`Startup profiling report:`),u(W())}L().clearMarks(),Z.length=0}}function K(){return y(t(),`startup-perf`,`${c()}.txt`)}function q(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length}var J,Y,X,Z,Q,$,ae=e((()=>{ee(),m(),te(),r(),d(),H(),p(),J=n(process.env.WORKMATE_PROFILE_STARTUP),Y=Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{C,x as S,I as _,R as a,b,H as c,j as d,D as f,O as g,re as h,G as i,ie as l,M as m,ae as n,z as o,A as p,U as r,L as s,K as t,E as u,T as v,S as x,w as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./startupProfiler-C_xcIvEA.js";e();export{t as profileCheckpoint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-B-EscJrZ.js";async function i(e,t){return(0,a.jsx)(r,{onClose:e,context:t,defaultTab:`Status`})}var a;e((()=>{n(),a=t()}))();export{i as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ji as t,Yi as n}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ji as t,Yi as n}from"./loadAgentsDir-CgDTTnMX.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,t)=>e+n(`${t.agentType}: ${t.whenToUse}`),0):0}var i,a=e((()=>{t(),i=15e3}));export{r as n,a as r,i as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{l as r,s as i}from"./bundledMode-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{l as r,s as i}from"./bundledMode-Dqe4pz0a.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=`${t}s`){return e===1?t:n}function u(e){let t=e.indexOf(`
|
|
2
2
|
`);return t===-1?e:e.slice(0,t)}function d(e,t,n=0){let r=0,i=e.indexOf(t,n);for(;i!==-1;)r++,i=e.indexOf(t,i+1);return r}function f(e){return e.replace(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function p(e){return e.replace(/\u3000/g,` `)}function m(e,t=`,`,n=g){let r=`...[truncated]`,i=``;for(let a of e){let e=i?t:``,o=e+a;if(i.length+o.length<=n)i+=o;else{let t=n-i.length-e.length-14;return t>0?i+=e+a.slice(0,t)+r:i+=r,i}}return i}function h(e,t){let n=e.split(`
|
|
3
3
|
`);return n.length<=t?e:`${n.slice(0,t).join(`
|
|
4
4
|
`)}…`}var g,_,v=e((()=>{t(),g=2**21,_=class{constructor(e=g){n(this,`maxSize`,void 0),n(this,`content`,``),n(this,`isTruncated`,!1),n(this,`totalBytesReceived`,0),this.maxSize=e}append(e){let t=typeof e==`string`?e:e.toString();if(this.totalBytesReceived+=t.length,!(this.isTruncated&&this.content.length>=this.maxSize))if(this.content.length+t.length>this.maxSize){let e=this.maxSize-this.content.length;e>0&&(this.content+=t.slice(0,e)),this.isTruncated=!0}else this.content+=t}toString(){if(!this.isTruncated)return this.content;let e=this.totalBytesReceived-this.maxSize,t=Math.round(e/1024);return`${this.content}\n... [output truncated - ${t}KB removed]`}clear(){this.content=``,this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}}));export{u as a,p as c,h as d,a as f,s as i,l,c as n,v as o,o as p,d as r,f as s,_ as t,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./switcher-CqGz0hjQ.js";t();export{e as restoreActiveProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{m as t,s as n}from"./settings-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{m as t,s as n}from"./settings-CA-5Px85.js";import{i as r,n as i,r as a,t as o}from"./loader-DsEdsMHv.js";function s(e=a()){let t=n(`userSettings`)?.activeProviderId;if(t&&e.some(e=>e.id===t))return t;let r=process.env.OPENAI_BASE_URL,i=process.env.ANTHROPIC_BASE_URL;for(let t of e)if(t.kind===`anthropic-compat`&&i===t.baseUrl||t.kind===`openai-compat`&&r===t.baseUrl)return t.id}function c(e){if(e.apiKey)return e.apiKey;if(e.apiKeyEnv)return process.env[e.apiKeyEnv]}function l(e,t){let n=t??a(),r=o(e,n);if(!r){let t=n.map(e=>e.id).join(`, `);throw Error(`switchProvider: provider "${e}" not found. Available: ${t}`)}let i=r.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:r.baseUrl,ANTHROPIC_MODEL:r.defaultModel}:{WORKMATE_USE_OPENAI:`1`,OPENAI_BASE_URL:r.baseUrl,OPENAI_MODEL:r.defaultModel},s=[];if(r.kind===`openai-compat`){let e=process.env.WORKMATE_USE_OPENAI===`1`||!!process.env.OPENAI_API_KEY,t=!!process.env.ANTHROPIC_API_KEY;e&&t&&s.push(`Both ANTHROPIC_API_KEY and OpenAI-compat mode are set. ANTHROPIC_API_KEY is for workspace endpoints (/v1/agents, /v1/vaults). OpenAI-compat mode routes /v1/messages to a third-party provider. These are separate planes — verify this is intentional.`)}return!r.apiKey&&!r.apiKeyEnv?s.push(`Provider "${r.id}" has neither apiKey nor apiKeyEnv configured. Edit ~/.workmate/providers.json to add one.`):!r.apiKey&&r.apiKeyEnv&&!process.env[r.apiKeyEnv]&&s.push(`${r.apiKeyEnv} is not set in the current environment. Set it before starting Work Mate: export ${r.apiKeyEnv}=<your-api-key>`),{env:i,warnings:s,provider:r}}function u(e){return e.kind===`anthropic-compat`?`ANTHROPIC_API_KEY`:`OPENAI_API_KEY`}async function d(e,t){delete process.env.WORKMATE_USE_BEDROCK,delete process.env.WORKMATE_USE_VERTEX,delete process.env.WORKMATE_USE_FOUNDRY,delete process.env.WORKMATE_USE_GEMINI,delete process.env.WORKMATE_USE_GROK,e.kind===`anthropic-compat`?(delete process.env.WORKMATE_USE_OPENAI,delete process.env.OPENAI_BASE_URL,delete process.env.OPENAI_API_KEY,delete process.env.OPENAI_MODEL):(delete process.env.ANTHROPIC_BASE_URL,delete process.env.ANTHROPIC_API_KEY,delete process.env.ANTHROPIC_MODEL);let n=e.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:e.baseUrl,ANTHROPIC_API_KEY:t??``,ANTHROPIC_MODEL:e.defaultModel}:{WORKMATE_USE_OPENAI:`1`,OPENAI_BASE_URL:e.baseUrl,OPENAI_API_KEY:t??``,OPENAI_MODEL:e.defaultModel},{clearOpenAIClientCache:r}=await import(`./client-dTKhXxBT.js`);r();let{fetchAvailableModels:i}=await import(`./fetchModelList-Dfyy0Yds.js`);i.cache.clear();let{applyConfigEnvironmentVariables:a}=await import(`./managedEnv-BV6T_PdC.js`);a(),Object.assign(process.env,n)}async function f(e,t){let{provider:n,warnings:r}=l(e,t),i=c(n),a=u(n);i||r.push(`No API key available for provider "${n.id}" — ${a} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`),await d(n,i);let{updateSettingsForSource:o}=await import(`./settings-B3WqnPDo.js`);return o(`userSettings`,{activeProviderId:n.id,modelType:n.kind===`anthropic-compat`?`anthropic`:`openai`}),{provider:n,warnings:r}}async function p(e){let{getSettingsForSource:t}=await import(`./settings-B3WqnPDo.js`),n=t(`userSettings`)?.activeProviderId;if(!n)return{kind:`no-active-provider`};let i=a(),s=o(n,i);if(!s)return{kind:`provider-not-found`,id:n};if(s.defaultModel===e)return{kind:`unchanged`,providerId:n,model:e};let c=s.defaultModel;return r(i.map(t=>t.id===n?{...t,defaultModel:e}:t)),{kind:`updated`,providerId:n,previousModel:c,newModel:e}}async function m(){let{getSettingsForSource:e}=await import(`./settings-B3WqnPDo.js`),t=e(`userSettings`)?.activeProviderId;if(!t)return null;let n=o(t);if(!n)return null;let r=[],i=c(n);if(!i){let e=u(n);r.push(`No API key available for provider "${n.id}" — ${e} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`)}return await d(n,i),{provider:n,warnings:r}}var h=e((()=>{t(),i()}));export{m as a,p as i,s as n,l as o,h as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-DTWNv4Gc.js";async function i(e,t){return(0,a.jsx)(r,{toolUseContext:t,onDone:e})}var a;e((()=>{n(),a=t()}))();export{i as call};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{bw as r,g as i,h as a,m as o,xw as s}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-QyzA_cFM.js";import{bw as r,g as i,h as a,m as o,xw as s}from"./loadAgentsDir-CgDTTnMX.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=a(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let r;try{r=p(n)}catch{continue}for(let i of r){if(!i.endsWith(`.md`))continue;let r=c(i,`.md`);if(t.has(r))continue;t.add(r);let a=l(n,i);try{let{frontmatter:t,content:n}=s(f(a,`utf-8`),a),i=(typeof t.description==`string`?t.description:``)||o(n,`No description`);e.push({name:r,description:i,filePath:a,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{r(),n(),i()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,`${a}\n`,`utf-8`)}catch{m(i,`${a}\n`,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
|
|
2
2
|
Template Job Commands:
|
|
3
3
|
|
|
4
4
|
wm job list List available templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-h_TPZN2E.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bt as t,di as n,fi as r,j as i,t as a}from"./src-BX54x08P.js";import{Xt as o,_n as s,qt as c,vn as l,xn as u}from"./settings-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bt as t,di as n,fi as r,j as i,t as a}from"./src-BX54x08P.js";import{Xt as o,_n as s,qt as c,vn as l,xn as u}from"./settings-CA-5Px85.js";import{C as d,I as f,S as p,x as m,z as h}from"./debug-NBJH_NxR.js";import{d as g,h as _,o as v}from"./config-CMtnYZR9.js";import{o as ee,s as y}from"./log-D98mO6yJ.js";import{i as b,t as x}from"./execFileNoThrow-7Ys9mO27.js";import{i as S,o as C}from"./bundledMode-Dqe4pz0a.js";import{i as w,r as T}from"./projectOnboardingState-DqGLXSM_.js";import{a as E,i as D,n as O,r as k,t as A}from"./appleTerminalBackup-j8nI5uNK.js";import{homedir as j,platform as M}from"os";import{dirname as te,join as N}from"path";import{randomBytes as P}from"crypto";import{copyFile as F,mkdir as I,readFile as L,writeFile as R}from"fs/promises";import{pathToFileURL as z}from"url";function B(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function V(){return!c.terminal||!(c.terminal in $)?null:$[c.terminal]??null}function H(e){return t()?`\x1b]8;;${z(e).href}\x07${e}\x1b]8;;\x07`:e}function U(){return M()===`darwin`&&c.terminal===`Apple_Terminal`||c.terminal===`vscode`||c.terminal===`cursor`||c.terminal===`windsurf`||c.terminal===`alacritty`||c.terminal===`zed`}async function W(e){let t=``;switch(c.terminal){case`Apple_Terminal`:t=await ne(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await re(e);break;case`zed`:t=await ie(e);break;case null:break}return _(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(c.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:c.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),w(),t}function G(){return v().shiftEnterKeyBindingInstalled===!0}function K(){return v().hasUsedBackslashReturn===!0}function q(){v().hasUsedBackslashReturn||_(e=>({...e,hasUsedBackslashReturn:!0}))}async function J(e,t,r){if(c.terminal&&c.terminal in $)return e(`Shift+Enter is natively supported in ${$[c.terminal]}.
|
|
2
2
|
|
|
3
3
|
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!U()){let t=c.terminal||`your current terminal`,r=S(),i=``;return r===`macos`?i=` • macOS: Apple Terminal
|
|
4
4
|
`:r===`windows`&&(i=` • Windows: Windows Terminal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-BX54x08P.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-BqeGU99Q.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r}from"./envUtils-QyzA_cFM.js";import{di as i,fi as a,j as o,t as s}from"./src-BX54x08P.js";import{
|
|
2
|
-
`)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await
|
|
1
|
+
import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r}from"./envUtils-QyzA_cFM.js";import{di as i,fi as a,j as o,t as s}from"./src-BX54x08P.js";import{Jr as c,Jt as l,Kr as u,Wr as d,Xt as f,d as p,m,qr as h,qt as g,t as _}from"./settings-CA-5Px85.js";import{Pt as v,at as y}from"./state-CXY-q5gr.js";import{Wv as ee,Za as b,br as x,cb as S,fo as C,gC as w,hC as te,mo as ne,qv as re,sb as T,sg as E,tg as D,to as O,vr as k,xx as A,yx as j}from"./loadAgentsDir-CgDTTnMX.js";import{n as M,t as N}from"./cwd-DrEEb4f5.js";import{c as P,i as F}from"./debug-NBJH_NxR.js";import{a as I,d as L,h as R,l as z,m as B,o as V}from"./config-CMtnYZR9.js";import{r as H,t as U}from"./execa-CBhG1doD.js";import{o as W,s as G}from"./log-D98mO6yJ.js";import{i as K,n as q}from"./execFileNoThrow-7Ys9mO27.js";import{i as J,o as Y}from"./bundledMode-Dqe4pz0a.js";import{Mt as X,Pt as ie}from"./model-BidsdFhX.js";import{c as ae,i as oe}from"./terminalSetup-h_TPZN2E.js";F(),W(),K(),c(),te(),H(),t(),v(),L(),M(),f(),r();async function se(){}e(e=>({deviceId:z(),sessionId:y(),email:void 0,appVersion:`0.0.31`,platform:l(),userType:process.env.USER_TYPE,...n(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}}));var ce=e(async()=>{let e=await U(`git config --get user.email`,{shell:!0,reject:!1,cwd:N()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0});t(),M(),L(),f();var le=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function ue(e){return!le.some(t=>t.test(e))}function de(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!ue(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function fe(){if(g.platform===`win32`||!await d())return[];try{let e=await ce(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
|
|
2
|
+
`)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await q(`git`,[...t,`--author=${e}`],{cwd:N()});r(n)}if(n.size<10){let{stdout:e}=await q(h(),t,{cwd:N()});r(e)}return de(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return G(e),[]}}var pe=10080*60*1e3,me=e(()=>{let e=I(),t=e.exampleFiles?.length?w(e.exampleFiles):`<filepath>`;return`Try "${w([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),he=e(async()=>{let e=I();Date.now()-(e.exampleFilesGeneratedAt??0)>pe&&(e.exampleFiles=[]),e.exampleFiles?.length||fe().then(e=>{e.length&&B(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});ie();var ge={"claude-3-opus":{modelName:`Work Mate 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Work Mate 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Work Mate 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function _e(e){let t=e.toLowerCase(),n=X();for(let[e,r]of Object.entries(ge)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function ve(e){if(!e)return null;let t=_e(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}a(),s(),Y(),m(),A(),S(),re(),E(),C(),b(),k(),oe(),L();function ye(e){let t=V().numStartups;R(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function Z(e){let t=V(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}L(),f(),c();var Q;async function be(){return Q===void 0&&(Q=j in await ne()),Q}async function $(e,t,n){if(!await be()||O(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&ee(t.readFileState).some(e=>n.filePath.test(e)))}var xe=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Work Mate to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return V().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${T(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=V();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=V(),t=p(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return P(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Work Mate sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=V();return await u()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>g.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=V();return g.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>g.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=V();return!!((g.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>g.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!ae())return!1;let e=V();return!(g.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Work Mate memory`,cooldownSessions:15,async isRelevant(){return V().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&i.level<3},{id:`powershell-tool-env`,content:async()=>`Set WORKMATE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>J()===`windows`&&process.env.WORKMATE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>p().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Work Mate is working.`,cooldownSessions:5,async isRelevant(){return V().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Work Mate while it works to steer Work Mate in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Work Mate to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return V().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!g.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>J()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!D()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>D()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>x()&&V().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .workmate/skills/ in your project or ~/.workmate/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return V().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${T(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${T(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return V().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return V().numStartups>5}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${o(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${j}`)}`,cooldownSessions:3,isRelevant:async e=>$(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${o(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${j}`)}`,cooldownSessions:3,isRelevant:async e=>$(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${o(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Work Mate sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>!1}],Se=[];function Ce(){let e=_().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function we(e){let t=_().spinnerTipsOverride,n=Ce();if(t?.excludeDefault&&n.length>0)return n;let r=[...xe,...Se],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>Z(e.id)>=e.cooldownSessions),...n]}export{me as a,ve as i,Z as n,he as o,ye as r,se as s,we as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-NBJH_NxR.js";import{o as r,s as i}from"./log-D98mO6yJ.js";import{r as a,t as o}from"./observationStore-pnSSxec_.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-DnJHynXv.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-CoNTwrJ3.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E;e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}))();export{u as hasToolHookObservationsForTurn,c as pruneEmittedTurns,_ as recordToolComplete,v as recordToolError,g as recordToolStart,y as recordUserCorrection,d as resetToolHookBookkeeping,m as resetToolHookDepsCache,h as runToolCallWithSkillLearningHooks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mC as t,nf as n,pC as r,tf as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{mC as t,nf as n,pC as r,tf as i}from"./loadAgentsDir-CgDTTnMX.js";import{n as a,t as o}from"./partition-CGKLltyv.js";function s(e,r,i){let[o,s]=a(t([...e,...r],`name`),n),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),r(),i()}));export{s as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,o as t}from"./envUtils-QyzA_cFM.js";import{I as n,M as r,S as i,c as a,i as o,x as s,z as c}from"./debug-
|
|
1
|
+
import{i as e,o as t}from"./envUtils-QyzA_cFM.js";import{I as n,M as r,S as i,c as a,i as o,x as s,z as c}from"./debug-NBJH_NxR.js";import{o as l}from"./log-D98mO6yJ.js";import{i as u,r as d}from"./genericProcessUtils-XwqvFxyn.js";import"os";import{join as f}from"path";import"crypto";import{readFile as p,readdir as m}from"fs/promises";import"node:string_decoder";t(),o(),d(),n(),s(),n(),l(),s(),t(),o(),n(),s();function h(){return f(e(),`sessions`)}async function g(){let e=h(),t;try{t=await m(e)}catch(e){return c(e)||a(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(u(t))try{let a=i(await p(f(e,r),`utf8`));n.push({pid:t,sessionId:a.sessionId,cwd:a.cwd,startedAt:a.startedAt,kind:a.kind,name:a.name,messagingSocketPath:a.messagingSocketPath,entrypoint:a.entrypoint,bridgeSessionId:a.bridgeSessionId,alive:!0})}catch{}}return n}export{g as listAllLiveSessions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,ai as r,et as i,t as a,vt as o}from"./src-BX54x08P.js";import{rb as s}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gt as n,ai as r,et as i,t as a,vt as o}from"./src-BX54x08P.js";import{rb as s}from"./loadAgentsDir-CgDTTnMX.js";import{t as c}from"./useDoublePress-zA5QwIpO.js";function l(e,t,n,r=!0){let{exit:a}=o(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??a,[n,a]),d=i(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=i(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),s}var u,d=e((()=>{u=t(r(),1),a(),c()}));function f(e,t,r){return l(n,t,e,r)}var p=e((()=>{s(),d()}));export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hh as t,Vh as n}from"./loadAgentsDir-CgDTTnMX.js";import{f as r,i,v as a}from"./model-BidsdFhX.js";function o(){let e=t(e=>e.mainLoopModel);return a(t(e=>e.mainLoopModelForSession)??e??i())}var s=e((()=>{n(),r()}));export{o as n,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{$n as n,Qn as r,di as i,
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{$n as n,Qn as r,di as i,fi as a}from"./settings-CA-5Px85.js";import{$o as o,Hh as s,Ia as c,Jm as l,Jo as u,Km as d,La as f,Qo as p,Vh as m,Wh as h,Wm as g,Ym as _,bf as v,l_ as y,qo as b,u_ as x,yf as S}from"./loadAgentsDir-CgDTTnMX.js";import{I as C,V as w,c as T,i as E}from"./debug-NBJH_NxR.js";import{o as D,s as O}from"./log-D98mO6yJ.js";import{n as k}from"./analytics-COpjZpvd.js";import{n as A,t as j}from"./notifications-B3v1XAdd.js";import{n as M,r as N}from"./pluginFlagging-1MM3zuMP.js";import{t as P}from"./pluginBlocklist-Bu6GP9_C.js";var F=e(t(),1);j(),k(),g(),m(),n(),E(),i(),C(),D(),p(),u(),y(),l(),S(),N(),c();function I({enabled:e=!0}={}){let t=h(),n=s(e=>e.plugins.needsRefresh),{addNotification:i}=A(),c=(0,F.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:a}=await f();await P();let s=M();Object.keys(s).length>0&&i({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let c=[],l=[];try{c=await b()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{l=await o()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await x()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let u=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await v(e,a);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),p=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await _(e,a);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);d(),t(t=>{let r=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(a.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...a];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:c,errors:o}}}),T(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${c.length}, Agents: ${l.length}, Errors: ${a.length}`);let m=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:r(e,e=>e.source.endsWith(`@inline`)),marketplace_count:r(e,e=>!e.source.endsWith(`@inline`)),error_count:a.length,skill_count:c.length,agent_count:l.length,hook_count:m,mcp_count:u,lsp_count:p}}catch(e){let n=w(e);return O(n),T(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:n.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,i]);(0,F.useEffect)(()=>{e&&c().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.WORKMATE_PLUGIN_CACHE_DIR};({...r,...t!==void 0&&{enabled_names:t}}),a(`info`,`tengu_plugins_loaded`,r)})},[c,e]),(0,F.useEffect)(()=>{!e||!n||i({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,n,i])}export{I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Tc as r,kc as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Tc as r,kc as i}from"./loadAgentsDir-CgDTTnMX.js";import{n as a,t as o}from"./toolPool-D_7Onp-c.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,ai as r,hn as i,ot as a,t as o}from"./src-BX54x08P.js";import{lb as s}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Vn as n,ai as r,hn as i,ot as a,t as o}from"./src-BX54x08P.js";import{lb as s}from"./loadAgentsDir-CgDTTnMX.js";import{_ as c,b as l,d as u,g as d,h as f,l as p,u as m,v as h,y as g}from"./TextInput-eYxBj_1-.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:o,columns:s,passthroughCtrlKeys:u=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=a(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let i=p.fromText(T,w,D);if(!(n.ctrl&&u.includes(n.key.toLowerCase()))){if(_(n)||c(),v(n)||h(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),o&&o();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=i.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.prevWord();O(e.offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault();let e=i.nextWord();O(e.offset);return}if(n.key===`left`){n.preventDefault();let e=i.left();O(e.offset);return}if(n.key===`right`){n.preventDefault();let e=i.right();O(e.offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(i.left().offset);return;case`f`:O(i.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=i.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=i.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=i.deleteToLineEnd();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=i.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=i.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=i.offset,n=i.insert(e);d(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(i.prevWord().offset);return;case`f`:O(i.nextWord().offset);return;case`d`:{let e=i.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=l();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;g(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=i.insert(n.key);E(e.text),O(e.offset)}}};return i((e,t,r)=>{A(new n(r.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),o(),u(),s(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Jh as r,qh as i}from"./loadAgentsDir-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as n}from"./src-BX54x08P.js";import{Jh as r,qh as i}from"./loadAgentsDir-CgDTTnMX.js";import{n as a,t as o}from"./notifications-B3v1XAdd.js";import{n as s,t as c}from"./allErrors-CJOE7EGx.js";function l(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,u.useState)(()=>{let{errors:e}=c();return e});return r((0,u.useCallback)(()=>{let{errors:e}=c();i(e)},[])),(0,u.useEffect)(()=>{if(n.length>0){let t=`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`;e({key:d,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(d)},[n,e,t]),n}var u,d,f=e((()=>{u=t(n(),1),o(),s(),i(),d=`settings-errors`}));export{l as n,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Vh as r,zh as i}from"./loadAgentsDir-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-BX54x08P.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{Vh as r,zh as i}from"./loadAgentsDir-CgDTTnMX.js";import{n as a}from"./analytics-COpjZpvd.js";import{t as o}from"./useManagePlugins-DSRLHKH5.js";import{t as s}from"./KeybindingProviderSetup-C8rq4fwQ.js";import{n as c,t as l}from"./MCPConnectionManager-DbPzbRdc.js";import{cwd as u}from"process";var d=e(t(),1);a(),c(),r();var f=n(),p=d.lazy(()=>import(`./Doctor-Bd0k7Jo7.js`).then(e=>({default:e.Doctor})));function m({onDone:e}){return o(),(0,f.jsx)(d.Suspense,{fallback:null,children:(0,f.jsx)(p,{onDone:e})})}async function h(e){await new Promise(t=>{e.render((0,f.jsx)(i,{children:(0,f.jsx)(s,{children:(0,f.jsx)(l,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,f.jsx)(m,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function g(e,t){let{setup:n}=await import(`./setup-X5QOX_BW.js`);await n(u(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-W_2JVR8Y.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{h as doctorHandler,g as installHandler};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Ni as r,Wi as i,dt as a,gt as o,ht as s,mt as c,pt as l}from"./settings-D4M13toi.js";import{Cw as ee,Sw as u,_x as d,bw as f,dx as p,gx as te,ux as m,vx as h,yw as g}from"./loadAgentsDir-BfLCckVj.js";import{C as _,I as v,M as y,N as b,R as x,S,c as C,f as w,i as T,u as E,x as D}from"./debug-2pVES-2G.js";import{o as ne,s as O}from"./log-L1kqxa_P.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(m(),U)}async function L(){let e=I();try{let t=S(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return C(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return C(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return C(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(C(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(C(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(C(`Install counts cache has malformed entries`),null)}catch(e){return b(e)!==`ENOENT`&&C(`Failed to load install counts cache: ${y(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=m();await E().mkdir(r),await F(n,_(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),C(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){C(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return h(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw h(`install_counts`,W,`failure`,performance.now()-e,te(t)),t}}async function B(){let e=await L();if(e){C(`Using cached install counts`),h(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),C(`Failed to fetch install counts: ${y(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),T(),v(),w(),ne(),D(),d(),p(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=E(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=b(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{v(),w()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=S(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=l().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=k.resolve(e),a;try{a=await A(r,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let o;try{o=S(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let l=s().extend({plugins:i(c().strict())}).strict().safeParse(o);if(l.success||t.push(...q(l.error)),l.success){let e=l.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=k.dirname(r),a=k.basename(i)===`.claude-plugin`?k.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=S(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(g);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,s;try{s=ee(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${y(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return b(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${y(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=S(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=a().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=b(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(x(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${y(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!x(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=S(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(b(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{r(),v(),f(),D(),u(),o(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{Gi as r,Pi as i,dt as a,gt as o,ht as s,mt as c,pt as l}from"./settings-CA-5Px85.js";import{Cw as ee,Sw as u,_x as d,bw as f,dx as p,gx as te,ux as m,vx as h,yw as g}from"./loadAgentsDir-CgDTTnMX.js";import{C as _,I as v,M as y,N as b,R as x,S,c as C,f as w,i as T,u as E,x as D}from"./debug-NBJH_NxR.js";import{o as ne,s as O}from"./log-D98mO6yJ.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(m(),U)}async function L(){let e=I();try{let t=S(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return C(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return C(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return C(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(C(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(C(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(C(`Install counts cache has malformed entries`),null)}catch(e){return b(e)!==`ENOENT`&&C(`Failed to load install counts cache: ${y(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=m();await E().mkdir(r),await F(n,_(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),C(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){C(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return h(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw h(`install_counts`,W,`failure`,performance.now()-e,te(t)),t}}async function B(){let e=await L();if(e){C(`Using cached install counts`),h(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),C(`Failed to fetch install counts: ${y(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),T(),v(),w(),ne(),D(),d(),p(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=E(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=b(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{v(),w()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=S(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=l().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=k.resolve(e),a;try{a=await A(i,{encoding:`utf-8`})}catch(e){let t=b(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=S(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let l=s().extend({plugins:r(c().strict())}).strict().safeParse(o);if(l.success||t.push(...q(l.error)),l.success){let e=l.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=k.dirname(i),a=k.basename(r)===`.claude-plugin`?k.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=S(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(g);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,s;try{s=ee(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${y(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return b(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${y(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=S(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=a().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=b(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(x(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${y(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!x(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=S(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(b(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),v(),f(),D(),u(),o(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,h as n,o as r}from"./config-CMtnYZR9.js";import{n as i}from"./analytics-COpjZpvd.js";var a;e((()=>{i(),t(),a=async()=>{let e=(r().editorMode??`normal`)===`normal`?`vim`:`normal`;return n(t=>({...t,editorMode:e})),{type:`text`,value:`Editor mode set to ${e}. ${e===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{a as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{wt as e,yt as t}from"./loadAgentsDir-CgDTTnMX.js";e();export{t as execIntoTmuxWorktree};
|